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
HGCHEbackDigitizer Class Reference

#include <HGCHEbackDigitizer.h>

Inheritance diagram for HGCHEbackDigitizer:
HGCDigitizerBase< HGCHEDataFrame >

Public Member Functions

 HGCHEbackDigitizer (const edm::ParameterSet &ps)
 
void runDigitizer (std::auto_ptr< HGCHEDigiCollection > &digiColl, HGCSimHitDataAccumulator &simData, uint32_t digitizationType, CLHEP::HepRandomEngine *engine)
 
 ~HGCHEbackDigitizer ()
 
- Public Member Functions inherited from HGCDigitizerBase< HGCHEDataFrame >
 HGCDigitizerBase (const edm::ParameterSet &ps)
 CTOR. More...
 
void run (std::auto_ptr< DColl > &digiColl, HGCSimHitDataAccumulator &simData, uint32_t digitizationType, CLHEP::HepRandomEngine *engine)
 steer digitization mode More...
 
virtual void runDigitizer (std::auto_ptr< DColl > &coll, HGCSimHitDataAccumulator &simData, uint32_t digitizerType, CLHEP::HepRandomEngine *engine)
 to be specialized by top class More...
 
void runShaper (HGCHEDataFrame &dataFrame)
 applies a shape to each time sample and propagates the tails to the subsequent time samples More...
 
void runTrivial (std::auto_ptr< DColl > &coll, HGCSimHitDataAccumulator &simData, CLHEP::HepRandomEngine *engine)
 a trivial digitization: sum energies and digitize without noise More...
 
void updateOutput (std::auto_ptr< DColl > &coll, HGCHEDataFramerawDataFrame)
 prepares the output according to the number of time samples to produce More...
 
 ~HGCDigitizerBase ()
 DTOR. More...
 

Private Member Functions

void runCaliceLikeDigitizer (std::auto_ptr< HGCHEDigiCollection > &digiColl, HGCSimHitDataAccumulator &simData, CLHEP::HepRandomEngine *engine)
 

Private Attributes

float nPEperMIP_
 
float nTotalPE_
 
float sdPixels_
 
float xTalk_
 

Additional Inherited Members

- Public Types inherited from HGCDigitizerBase< HGCHEDataFrame >
typedef edm::SortedCollection
< HGCHEDataFrame
DColl
 
- Public Attributes inherited from HGCDigitizerBase< HGCHEDataFrame >
uint32_t adcThreshold_
 
int bxTime_
 
bool doTimeSamples_
 
double lsbInMIP_
 
double mip2noise_
 
double mipInKeV_
 
edm::ParameterSet myCfg_
 
double shaperN_
 
double shaperTau_
 

Detailed Description

Definition at line 8 of file HGCHEbackDigitizer.h.

Constructor & Destructor Documentation

HGCHEbackDigitizer::HGCHEbackDigitizer ( const edm::ParameterSet ps)

Definition at line 6 of file HGCHEbackDigitizer.cc.

References alignCSCRings::e, cppFunctionSkipper::exception, edm::ParameterSet::getParameter(), nPEperMIP_, nTotalPE_, sdPixels_, and xTalk_.

6  : HGCDigitizerBase(ps) {
7  try{
8  edm::ParameterSet caliceSpec = ps.getParameter<edm::ParameterSet>("digiCfg").getParameter<edm::ParameterSet>("caliceSpecific");
9  nPEperMIP_ = caliceSpec.getParameter<double>("nPEperMIP");
10  nTotalPE_ = caliceSpec.getParameter<double>("nTotalPE");
11  xTalk_ = caliceSpec.getParameter<double>("xTalk");
12  sdPixels_ = caliceSpec.getParameter<double>("sdPixels");
13  }catch(std::exception &e){
14  //no need to propagate
15  }
16 }
T getParameter(std::string const &) const
HGCDigitizerBase(const edm::ParameterSet &ps)
CTOR.
HGCHEbackDigitizer::~HGCHEbackDigitizer ( )

Definition at line 86 of file HGCHEbackDigitizer.cc.

86 { }

Member Function Documentation

void HGCHEbackDigitizer::runCaliceLikeDigitizer ( std::auto_ptr< HGCHEDigiCollection > &  digiColl,
HGCSimHitDataAccumulator simData,
CLHEP::HepRandomEngine *  engine 
)
private

Definition at line 30 of file HGCHEbackDigitizer.cc.

References create_public_lumi_plots::exp, i, cmsBatch::log, HGCDigitizerBase< HGCHEDataFrame >::lsbInMIP_, bookConverter::max, HGCDigitizerBase< HGCHEDataFrame >::mip2noise_, HGCDigitizerBase< HGCHEDataFrame >::mipInKeV_, nPEperMIP_, nTotalPE_, HGCDigitizerBase< HGCHEDataFrame >::runShaper(), sdPixels_, HGCSample::set(), HGCDataFrame< D, S >::setSample(), HGCDigitizerBase< HGCHEDataFrame >::updateOutput(), x, and xTalk_.

Referenced by runDigitizer().

30  {
31 
32  for(HGCSimHitDataAccumulator::iterator it=simData.begin();
33  it!=simData.end(); it++) {
34  //init a new data frame
35  HGCHEDataFrame newDataFrame( it->first );
36 
37  for(size_t i=0; i<it->second.size(); i++) {
38  //convert total energy GeV->keV->ADC counts
39  float totalEn( (it->second)[i]*1e6 );
40 
41  //convert energy to MIP
42  float totalIniMIPs = totalEn/mipInKeV_;
43 
44  //generate random number of photon electrons
45  CLHEP::RandPoissonQ randPoissonQ(*engine, totalIniMIPs*nPEperMIP_);
46  uint32_t npe = (uint32_t)randPoissonQ.fire();
47 
48  //number of pixels
49  float x=exp(-(float)(npe)/(float)(nTotalPE_));
50  uint32_t nPixel(0);
51  if(xTalk_*x!=1) nPixel=(uint32_t) std::max( float(nTotalPE_*(1-x)/(1-xTalk_*x)), float(0.) );
52 
53  //update signal
54  nPixel=(uint32_t)std::max( float(CLHEP::RandGaussQ::shoot(engine,(float)nPixel,(float)sdPixels_)),float(0.) );
55 
56  //convert to MIP again and saturate
57  float totalMIPs(totalIniMIPs);
58  if(nTotalPE_!=nPixel && (nTotalPE_-xTalk_*nPixel)/(nTotalPE_-nPixel)>0 )
59  totalMIPs = (nTotalPE_/nPEperMIP_)*log((nTotalPE_-xTalk_*nPixel)/(nTotalPE_-nPixel));
60  else
61  totalMIPs = 0;
62 
63  //add noise (in MIPs)
64  double noiseMIPs=CLHEP::RandGaussQ::shoot(engine,0.,1./mip2noise_);
65  totalMIPs=std::max(float(totalMIPs+noiseMIPs),float(0.));
66 
67  //round to integer (sample will saturate the value according to available bits)
68  uint16_t totalEnInt = floor( totalMIPs / lsbInMIP_ );
69 
70  //0 gain for the moment
71  HGCSample singleSample;
72  singleSample.set(0, totalEnInt );
73  newDataFrame.setSample(i, singleSample);
74 
75  }
76 
77  //run shaper
78  runShaper(newDataFrame);
79 
80  //prepare the output
81  updateOutput(digiColl,newDataFrame);
82  }
83 }
int i
Definition: DBlmapReader.cc:9
void set(uint16_t gain, uint16_t adc)
Definition: HGCSample.h:30
wrapper for a data word
Definition: HGCSample.h:12
void runShaper(HGCHEDataFrame &dataFrame)
applies a shape to each time sample and propagates the tails to the subsequent time samples ...
void updateOutput(std::auto_ptr< DColl > &coll, HGCHEDataFramerawDataFrame)
prepares the output according to the number of time samples to produce
tuple log
Definition: cmsBatch.py:341
void HGCHEbackDigitizer::runDigitizer ( std::auto_ptr< HGCHEDigiCollection > &  digiColl,
HGCSimHitDataAccumulator simData,
uint32_t  digitizationType,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 19 of file HGCHEbackDigitizer.cc.

References runCaliceLikeDigitizer().

19  {
20  switch(digitizationType) {
21  case 1:
22  {
23  runCaliceLikeDigitizer(digiColl,simData,engine);
24  break;
25  }
26  }
27 }
void runCaliceLikeDigitizer(std::auto_ptr< HGCHEDigiCollection > &digiColl, HGCSimHitDataAccumulator &simData, CLHEP::HepRandomEngine *engine)

Member Data Documentation

float HGCHEbackDigitizer::nPEperMIP_
private

Definition at line 19 of file HGCHEbackDigitizer.h.

Referenced by HGCHEbackDigitizer(), and runCaliceLikeDigitizer().

float HGCHEbackDigitizer::nTotalPE_
private

Definition at line 19 of file HGCHEbackDigitizer.h.

Referenced by HGCHEbackDigitizer(), and runCaliceLikeDigitizer().

float HGCHEbackDigitizer::sdPixels_
private

Definition at line 19 of file HGCHEbackDigitizer.h.

Referenced by HGCHEbackDigitizer(), and runCaliceLikeDigitizer().

float HGCHEbackDigitizer::xTalk_
private

Definition at line 19 of file HGCHEbackDigitizer.h.

Referenced by HGCHEbackDigitizer(), and runCaliceLikeDigitizer().