CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DigiConverterFP420 Class Reference

#include <DigiConverterFP420.h>

Inheritance diagram for DigiConverterFP420:
DConverterFP420

List of all members.

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

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 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;
  }
}

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

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

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 adc = int(in_adc);
  if(verbos>0) {
    std::cout << " ***DigiConverterFP420: truncate" << std::endl;
    std::cout << "if adc =  " << adc << "bigger theMaxADC =  " << theMaxADC << " adc=theMaxADC !!!"  << std::endl;
  }
  if (adc > theMaxADC) adc = theMaxADC;
  
  return adc;
}

Member Data Documentation

Definition at line 20 of file DigiConverterFP420.h.

Referenced by DigiConverterFP420().

Definition at line 18 of file DigiConverterFP420.h.

Referenced by convert(), and DigiConverterFP420().

Definition at line 19 of file DigiConverterFP420.h.

Referenced by DigiConverterFP420(), and truncate().

Definition at line 21 of file DigiConverterFP420.h.

Referenced by convert(), DigiConverterFP420(), and truncate().