CMS 3D CMS Logo

HcalSiPM.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef HcalSimAlgos_HcalSiPM_h
3 #define HcalSimAlgos_HcalSiPM_h
4 
12 #include <vector>
13 #include <algorithm>
14 #include <unordered_map>
15 
17 
18 namespace CLHEP {
19  class HepRandomEngine;
20 }
21 
22 class HcalSiPM {
23 public:
24  HcalSiPM(int nCells = 1, double tau = 15.);
25 
26  virtual ~HcalSiPM();
27 
28  void resetSiPM() { std::fill(theSiPM.begin(), theSiPM.end(), -999.); }
29  virtual double hitCells(CLHEP::HepRandomEngine*, unsigned int pes, double tempDiff = 0., double photonTime = 0.);
30 
31  virtual double totalCharge() const { return totalCharge(theLastHitTime); }
32  virtual double totalCharge(double time) const;
33 
34  int getNCells() const { return theCellCount; }
35  double getTau() const { return theTau; }
36  double getCrossTalk() const { return theCrossTalk; }
37  double getTempDep() const { return theTempDep; }
38 
39  void setNCells(int nCells);
40  void setTau(double tau);
41  void setCrossTalk(double xtalk); // Borel-Tanner "lambda"
42  void setTemperatureDependence(double tempDep);
43  void setSaturationPars(const std::vector<float>& pars);
44 
45 protected:
46  typedef std::pair<unsigned int, std::vector<double> > cdfpair;
47  typedef std::unordered_map<unsigned int, cdfpair> cdfmap;
48 
49  // void expRecover(double dt);
50 
51  double cellCharge(double deltaTime) const;
52  unsigned int addCrossTalkCells(CLHEP::HepRandomEngine* engine, unsigned int in_pes);
53 
54  //numerical random generation from Borel-Tanner distribution
55  double Borel(unsigned int n, double lambda, unsigned int k);
56  const cdfpair& BorelCDF(unsigned int k);
57 
58  unsigned int theCellCount;
59  std::vector<double> theSiPM;
60  double theTau;
61  double theTauInv;
62  double theCrossTalk;
63  double theTempDep;
65 
67 
69 };
70 
71 #endif //HcalSimAlgos_HcalSiPM_h
HcalSiPM::nonlin
HcalSiPMnonlinearity * nonlin
Definition: HcalSiPM.h:66
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
HcalSiPM::theTau
double theTau
Definition: HcalSiPM.h:60
metsig::tau
Definition: SignAlgoResolutions.h:49
HcalSiPM::hitCells
virtual double hitCells(CLHEP::HepRandomEngine *, unsigned int pes, double tempDiff=0., double photonTime=0.)
Definition: HcalSiPM.cc:100
HcalSiPM::resetSiPM
void resetSiPM()
Definition: HcalSiPM.h:28
HcalSiPM::theSiPM
std::vector< double > theSiPM
Definition: HcalSiPM.h:59
HcalSiPM::setNCells
void setNCells(int nCells)
Definition: HcalSiPM.cc:143
HcalSiPM::totalCharge
virtual double totalCharge() const
Definition: HcalSiPM.h:31
HcalSiPM::setSaturationPars
void setSaturationPars(const std::vector< float > &pars)
Definition: HcalSiPM.cc:192
HcalSiPM::theTauInv
double theTauInv
Definition: HcalSiPM.h:61
protons_cff.time
time
Definition: protons_cff.py:39
nCells
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ const uint32_t *__restrict__ nCells
Definition: CAHitNtupletGeneratorKernelsImpl.h:33
HcalSiPM::getTau
double getTau() const
Definition: HcalSiPM.h:35
HcalSiPM::borelcdfs
cdfmap borelcdfs
Definition: HcalSiPM.h:68
HcalSiPM::setTemperatureDependence
void setTemperatureDependence(double tempDep)
Definition: HcalSiPM.cc:178
HcalSiPM::Borel
double Borel(unsigned int n, double lambda, unsigned int k)
Definition: HcalSiPM.cc:28
HcalSiPM::setCrossTalk
void setCrossTalk(double xtalk)
Definition: HcalSiPM.cc:158
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HcalSiPM::setTau
void setTau(double tau)
Definition: HcalSiPM.cc:150
CLHEP
Definition: CocoaGlobals.h:27
HcalSiPM::getTempDep
double getTempDep() const
Definition: HcalSiPM.h:37
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
HcalSiPM::theCellCount
unsigned int theCellCount
Definition: HcalSiPM.h:58
HcalSiPM::BorelCDF
const cdfpair & BorelCDF(unsigned int k)
Definition: HcalSiPM.cc:47
HcalSiPM::theCrossTalk
double theCrossTalk
Definition: HcalSiPM.h:62
HcalSiPM::HcalSiPM
HcalSiPM(int nCells=1, double tau=15.)
Definition: HcalSiPM.cc:14
HcalSiPM
A general implementation for the response of a SiPM.
Definition: HcalSiPM.h:22
HcalSiPM::addCrossTalkCells
unsigned int addCrossTalkCells(CLHEP::HepRandomEngine *engine, unsigned int in_pes)
Definition: HcalSiPM.cc:84
HcalSiPM::cellCharge
double cellCharge(double deltaTime) const
Definition: HcalSiPM.cc:183
HcalSiPM::~HcalSiPM
virtual ~HcalSiPM()
Definition: HcalSiPM.cc:21
HcalSiPM::getNCells
int getNCells() const
Definition: HcalSiPM.h:34
HcalSiPM::cdfmap
std::unordered_map< unsigned int, cdfpair > cdfmap
Definition: HcalSiPM.h:47
HcalSiPMnonlinearity
Definition: HcalSiPMnonlinearity.h:7
HcalSiPM::cdfpair
std::pair< unsigned int, std::vector< double > > cdfpair
Definition: HcalSiPM.h:46
HcalSiPM::theLastHitTime
double theLastHitTime
Definition: HcalSiPM.h:64
HcalSiPMnonlinearity.h
HcalSiPM::getCrossTalk
double getCrossTalk() const
Definition: HcalSiPM.h:36
HcalSiPM::theTempDep
double theTempDep
Definition: HcalSiPM.h:63