CMS 3D CMS Logo

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 &) override
 
 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::DigiConverterFP420 ( float  in,
int  verbosity 
)

Definition at line 9 of file DigiConverterFP420.cc.

9  {
11  verbos = verbosity;
12 
13  constexpr int defaultBits = 10;
14  constexpr int largestBits = 30;
15  constexpr unsigned int allOne = ~0;
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)
23  adcBits = largestBits;
24 
25  theMaxADC = ~(allOne << adcBits);
26  // std::cout << "theMaxADC= "<< theMaxADC << std::endl; // = 1023
27  if (verbos > 0) {
28  std::cout << " ***DigiConverterFP420: constructor" << std::endl;
29  std::cout << "with known electronperADC = " << electronperADC << "the adcBits = " << adcBits
30  << " theMaxADC= " << theMaxADC << "for known defaultBits= " << defaultBits
31  << " largestBits= " << largestBits << std::endl;
32  }
33 }

References adcBits, gather_cfg::cout, electronperADC, recoMuon::in, theMaxADC, verbos, and HIPAlignmentAlgorithm_cfi::verbosity.

Member Function Documentation

◆ convert() [1/2]

DConverterFP420::DigitalMapType DigiConverterFP420::convert ( const signal_map_type analogSignal)
overridevirtual

Implements DConverterFP420.

Definition at line 35 of file DigiConverterFP420.cc.

35  {
37 
38  for (signal_map_type::const_iterator i = analogSignal.begin(); i != analogSignal.end(); i++) {
39  // convert analog amplitude to digital, means integer number simulating ADC
40  // digitization!
41  // with truncation check
42  int adc = convert((*i).second);
43 
44  if (verbos > 0) {
45  std::cout << " ***DigiConverterFP420: convert: after truncation " << std::endl;
46  std::cout << "adc = " << adc << " (*i).first = " << (*i).first << std::endl;
47  }
48  if (adc > 0)
49  _temp.insert(_temp.end(), DigitalMapType::value_type((*i).first, adc));
50  }
51 
52  return _temp;
53 }

References gpuClustering::adc, gather_cfg::cout, mps_fire::i, and verbos.

Referenced by FP420DigiMain::run().

◆ convert() [2/2]

int DigiConverterFP420::convert ( float  in)
inlineprivate

Definition at line 13 of file DigiConverterFP420.h.

13 { return truncate(in / electronperADC); }

References electronperADC, recoMuon::in, and truncate().

◆ truncate()

int DigiConverterFP420::truncate ( float  in_adc)
private

Definition at line 55 of file DigiConverterFP420.cc.

55  {
56  int adc = int(in_adc);
57  if (verbos > 0) {
58  std::cout << " ***DigiConverterFP420: truncate" << std::endl;
59  std::cout << "if adc = " << adc << "bigger theMaxADC = " << theMaxADC << " adc=theMaxADC !!!" << std::endl;
60  }
61  if (adc > theMaxADC)
62  adc = theMaxADC;
63 
64  return adc;
65 }

References gpuClustering::adc, gather_cfg::cout, createfilelist::int, theMaxADC, and verbos.

Referenced by convert().

Member Data Documentation

◆ adcBits

int DigiConverterFP420::adcBits
private

Definition at line 18 of file DigiConverterFP420.h.

Referenced by DigiConverterFP420().

◆ electronperADC

float DigiConverterFP420::electronperADC
private

Definition at line 16 of file DigiConverterFP420.h.

Referenced by convert(), and DigiConverterFP420().

◆ theMaxADC

int DigiConverterFP420::theMaxADC
private

Definition at line 17 of file DigiConverterFP420.h.

Referenced by DigiConverterFP420(), and truncate().

◆ verbos

int DigiConverterFP420::verbos
private

Definition at line 19 of file DigiConverterFP420.h.

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

HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
mps_fire.i
i
Definition: mps_fire.py:428
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DigiConverterFP420::electronperADC
float electronperADC
Definition: DigiConverterFP420.h:16
DigiConverterFP420::convert
DigitalMapType convert(const signal_map_type &) override
Definition: DigiConverterFP420.cc:35
DigiConverterFP420::adcBits
int adcBits
Definition: DigiConverterFP420.h:18
DigiConverterFP420::verbos
int verbos
Definition: DigiConverterFP420.h:19
recoMuon::in
Definition: RecoMuonEnumerators.h:6
DigiConverterFP420::theMaxADC
int theMaxADC
Definition: DigiConverterFP420.h:17
createfilelist.int
int
Definition: createfilelist.py:10
DigiConverterFP420::truncate
int truncate(float in_adc)
Definition: DigiConverterFP420.cc:55
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
DConverterFP420::DigitalMapType
std::map< int, int, std::less< int > > DigitalMapType
Definition: DConverterFP420.h:8