CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DigiConverterFP420 Class Reference

#include <DigiConverterFP420.h>

Inheritance diagram for DigiConverterFP420:
DConverterFP420

Public Member Functions

DigitalMapType convert (const signal_map_type &)
 
 DigiConverterFP420 (float in, int)
 
- Public Member Functions inherited from DConverterFP420
virtual ~DConverterFP420 ()
 

Private Member Functions

int convert (float in)
 
int truncate (float in_adc)
 

Private Attributes

int adcBits
 
float electronperADC
 
int theMaxADC
 
int verbos
 

Additional Inherited Members

- Public Types inherited from DConverterFP420
typedef std::map< int, int,
std::less< int > > 
DigitalMapType
 
typedef
PileUpFP420::signal_map_type 
signal_map_type
 

Detailed Description

Definition at line 6 of file DigiConverterFP420.h.

Constructor & Destructor Documentation

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 HLT_25ns10e33_v2_cff::verbosity.

9  {
10 
12  verbos = verbosity;
13 
14  const int defaultBits = 10;
15  const int largestBits = 30;
16 
17  // example is in SiStrips:
18  // static SimpleConfigurable<int>
19  // adcBits(defaultBits, "DigiConverterFP420:rawDataAdcBits");
20  adcBits=defaultBits;
21 
22  if (adcBits > largestBits || adcBits < 1) adcBits = largestBits;
23 
24  theMaxADC = ~(~0 << adcBits);
25  // std::cout << "theMaxADC= "<< theMaxADC << std::endl; // = 1023
26  if(verbos>0) {
27  std::cout << " ***DigiConverterFP420: constructor" << std::endl;
28  std::cout << "with known electronperADC = " << electronperADC << "the adcBits = " << adcBits << " theMaxADC= " << theMaxADC << "for known defaultBits= " << defaultBits << " largestBits= " << largestBits << std::endl;
29  }
30 }
tuple cout
Definition: gather_cfg.py:145

Member Function Documentation

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().

33  {
34 
36 
37  for ( signal_map_type::const_iterator i=analogSignal.begin(); i!=analogSignal.end(); i++) {
38 
39  // convert analog amplitude to digital, means integer number simulating ADC digitization!
40  //with truncation check
41  int adc = convert((*i).second);
42 
43  if(verbos>0) {
44  std::cout << " ***DigiConverterFP420: convert: after truncation " << std::endl;
45  std::cout << "adc = " << adc << " (*i).first = " << (*i).first << std::endl;
46  }
47  if ( adc > 0) _temp.insert( _temp.end(),
48  DigitalMapType::value_type((*i).first, adc));
49  }
50 
51  return _temp;
52 
53 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int i
Definition: DBlmapReader.cc:9
std::map< int, int, std::less< int > > DigitalMapType
DigitalMapType convert(const signal_map_type &)
tuple cout
Definition: gather_cfg.py:145
int DigiConverterFP420::convert ( float  in)
inlineprivate

Definition at line 15 of file DigiConverterFP420.h.

References electronperADC, and truncate().

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().

56  {
57 
58  int adc = int(in_adc);
59  if(verbos>0) {
60  std::cout << " ***DigiConverterFP420: truncate" << std::endl;
61  std::cout << "if adc = " << adc << "bigger theMaxADC = " << theMaxADC << " adc=theMaxADC !!!" << std::endl;
62  }
63  if (adc > theMaxADC) adc = theMaxADC;
64 
65  return adc;
66 }
int adc(sample_type sample)
get the ADC sample (12 bits)
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

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().