#include <SimRomanPot/SimFP420/interface/DigiConverterFP420.h>
Public Member Functions | |
DigitalMapType | convert (const signal_map_type &) |
DigiConverterFP420 (float in) | |
Private Member Functions | |
int | convert (float in) |
int | truncate (float in_adc) |
Private Attributes | |
int | adcBits |
float | electronperADC |
int | theMaxADC |
Definition at line 6 of file DigiConverterFP420.h.
DigiConverterFP420::DigiConverterFP420 | ( | float | in | ) |
Definition at line 10 of file DigiConverterFP420.cc.
References adcBits, GenMuonPlsPt100GeV_cfg::cout, electronperADC, lat::endl(), and theMaxADC.
00010 { 00011 00012 electronperADC = in; 00013 00014 const int defaultBits = 10; 00015 const int largestBits = 30; 00016 00017 // example is in SiStrips: 00018 // static SimpleConfigurable<int> 00019 // adcBits(defaultBits, "DigiConverterFP420:rawDataAdcBits"); 00020 adcBits=defaultBits; 00021 00022 if (adcBits > largestBits || adcBits < 1) adcBits = largestBits; 00023 00024 theMaxADC = ~(~0 << adcBits); 00025 // cout << "theMaxADC= "<< theMaxADC << endl; // = 1023 00026 #ifdef mydigidebug8 00027 std::cout << " ***DigiConverterFP420: constructor" << std::endl; 00028 std::cout << "with known electronperADC = " << electronperADC << "the adcBits = " << adcBits << " theMaxADC= " << theMaxADC << "for known defaultBits= " << defaultBits << " largestBits= " << largestBits << std::endl; 00029 #endif 00030 }
int DigiConverterFP420::convert | ( | float | in | ) | [inline, private] |
Definition at line 15 of file DigiConverterFP420.h.
References electronperADC, and truncate().
00015 {return truncate(in/electronperADC);}
DConverterFP420::DigitalMapType DigiConverterFP420::convert | ( | const signal_map_type & | analogSignal | ) | [virtual] |
Implements DConverterFP420.
Definition at line 33 of file DigiConverterFP420.cc.
References ecalMGPA::adc(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and i.
Referenced by FP420DigiMain::run().
00033 { 00034 00035 DConverterFP420::DigitalMapType _temp; 00036 00037 for ( signal_map_type::const_iterator i=analogSignal.begin(); i!=analogSignal.end(); i++) { 00038 00039 // convert analog amplitude to digital, means integer number simulating ADC digitization! 00040 //with truncation check 00041 int adc = convert((*i).second); 00042 00043 #ifdef mydigidebug8 00044 std::cout << " ***DigiConverterFP420: convert: after truncation " << std::endl; 00045 std::cout << "adc = " << adc << " (*i).first = " << (*i).first << std::endl; 00046 #endif 00047 if ( adc > 0) _temp.insert( _temp.end(), 00048 DigitalMapType::value_type((*i).first, adc)); 00049 } 00050 00051 return _temp; 00052 00053 }
int DigiConverterFP420::truncate | ( | float | in_adc | ) | [private] |
Definition at line 56 of file DigiConverterFP420.cc.
References ecalMGPA::adc(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), int, and theMaxADC.
Referenced by convert().
00056 { 00057 00058 int adc = int(in_adc); 00059 #ifdef mydigidebug8 00060 std::cout << " ***DigiConverterFP420: truncate" << std::endl; 00061 std::cout << "if adc = " << adc << "bigger theMaxADC = " << theMaxADC << " adc=theMaxADC !!!" << std::endl; 00062 #endif 00063 if (adc > theMaxADC) adc = theMaxADC; 00064 00065 return adc; 00066 }
int DigiConverterFP420::adcBits [private] |
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().