#include <DigiConverterFP420.h>
Public Member Functions | |
DigitalMapType | convert (const signal_map_type &) |
DigiConverterFP420 (float in, int) | |
Private Member Functions | |
int | convert (float in) |
int | truncate (float in_adc) |
Private Attributes | |
int | adcBits |
float | electronperADC |
int | theMaxADC |
int | verbos |
Definition at line 6 of file DigiConverterFP420.h.
DigiConverterFP420::DigiConverterFP420 | ( | float | in, |
int | verbosity | ||
) |
Definition at line 9 of file DigiConverterFP420.cc.
References adcBits, gather_cfg::cout, electronperADC, recoMuon::in, theMaxADC, verbos, and verbosity.
{ electronperADC = in; verbos = verbosity; const int defaultBits = 10; const int largestBits = 30; // example is in SiStrips: // static SimpleConfigurable<int> // adcBits(defaultBits, "DigiConverterFP420:rawDataAdcBits"); adcBits=defaultBits; if (adcBits > largestBits || adcBits < 1) adcBits = largestBits; theMaxADC = ~(~0 << adcBits); // std::cout << "theMaxADC= "<< theMaxADC << std::endl; // = 1023 if(verbos>0) { std::cout << " ***DigiConverterFP420: constructor" << std::endl; std::cout << "with known electronperADC = " << electronperADC << "the adcBits = " << adcBits << " theMaxADC= " << theMaxADC << "for known defaultBits= " << defaultBits << " largestBits= " << largestBits << std::endl; } }
DConverterFP420::DigitalMapType DigiConverterFP420::convert | ( | const signal_map_type & | analogSignal | ) | [virtual] |
Implements DConverterFP420.
Definition at line 33 of file DigiConverterFP420.cc.
References ecalMGPA::adc(), gather_cfg::cout, i, and verbos.
Referenced by FP420DigiMain::run().
{ DConverterFP420::DigitalMapType _temp; for ( signal_map_type::const_iterator i=analogSignal.begin(); i!=analogSignal.end(); i++) { // convert analog amplitude to digital, means integer number simulating ADC digitization! //with truncation check int adc = convert((*i).second); if(verbos>0) { std::cout << " ***DigiConverterFP420: convert: after truncation " << std::endl; std::cout << "adc = " << adc << " (*i).first = " << (*i).first << std::endl; } if ( adc > 0) _temp.insert( _temp.end(), DigitalMapType::value_type((*i).first, adc)); } return _temp; }
int DigiConverterFP420::convert | ( | float | in | ) | [inline, private] |
Definition at line 15 of file DigiConverterFP420.h.
References electronperADC, and truncate().
{return truncate(in/electronperADC);}
int DigiConverterFP420::truncate | ( | float | in_adc | ) | [private] |
Definition at line 56 of file DigiConverterFP420.cc.
References ecalMGPA::adc(), gather_cfg::cout, theMaxADC, and verbos.
Referenced by convert().
int DigiConverterFP420::adcBits [private] |
Definition at line 20 of file DigiConverterFP420.h.
Referenced by DigiConverterFP420().
float DigiConverterFP420::electronperADC [private] |
Definition at line 18 of file DigiConverterFP420.h.
Referenced by convert(), and DigiConverterFP420().
int DigiConverterFP420::theMaxADC [private] |
Definition at line 19 of file DigiConverterFP420.h.
Referenced by DigiConverterFP420(), and truncate().
int DigiConverterFP420::verbos [private] |
Definition at line 21 of file DigiConverterFP420.h.
Referenced by convert(), DigiConverterFP420(), and truncate().