CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.,
30  double photonTime = 0.);
31 
32 
33  virtual double totalCharge() const { return totalCharge(theLastHitTime); }
34  virtual double totalCharge(double time) const;
35 
36  int getNCells() const { return theCellCount; }
37  double getTau() const { return theTau; }
38  double getCrossTalk() const { return theCrossTalk; }
39  double getTempDep() const { return theTempDep; }
40 
41  void setNCells(int nCells);
42  void setTau(double tau);
43  void setCrossTalk(double xtalk); // Borel-Tanner "lambda"
44  void setTemperatureDependence(double tempDep);
45  void setSaturationPars(const std::vector<float>& pars);
46 
47  protected:
48 
49  typedef std::pair<unsigned int, std::vector<double> > cdfpair;
50  typedef std::unordered_map< unsigned int, cdfpair > cdfmap;
51 
52  // void expRecover(double dt);
53 
54  double cellCharge(double deltaTime) const;
55  unsigned int addCrossTalkCells(CLHEP::HepRandomEngine* engine, unsigned int in_pes);
56 
57  //numerical random generation from Borel-Tanner distribution
58  double Borel(unsigned int n, double lambda, unsigned int k);
59  const cdfpair& BorelCDF(unsigned int k);
60 
61  unsigned int theCellCount;
62  std::vector< double > theSiPM;
63  double theTau;
64  double theTauInv;
65  double theCrossTalk;
66  double theTempDep;
68 
70 
72 };
73 
74 #endif //HcalSimAlgos_HcalSiPM_h
double getTempDep() const
Definition: HcalSiPM.h:39
double theTempDep
Definition: HcalSiPM.h:66
A general implementation for the response of a SiPM.
Definition: HcalSiPM.h:22
string fill
Definition: lumiContext.py:319
virtual ~HcalSiPM()
Definition: HcalSiPM.cc:23
double cellCharge(double deltaTime) const
Definition: HcalSiPM.cc:182
void setSaturationPars(const std::vector< float > &pars)
Definition: HcalSiPM.cc:189
virtual double totalCharge() const
Definition: HcalSiPM.h:33
double theTauInv
Definition: HcalSiPM.h:64
void resetSiPM()
Definition: HcalSiPM.h:28
double getCrossTalk() const
Definition: HcalSiPM.h:38
double theCrossTalk
Definition: HcalSiPM.h:65
std::vector< double > theSiPM
Definition: HcalSiPM.h:62
const cdfpair & BorelCDF(unsigned int k)
Definition: HcalSiPM.cc:46
double Borel(unsigned int n, double lambda, unsigned int k)
Definition: HcalSiPM.cc:28
virtual double hitCells(CLHEP::HepRandomEngine *, unsigned int pes, double tempDiff=0., double photonTime=0.)
Definition: HcalSiPM.cc:100
int getNCells() const
Definition: HcalSiPM.h:36
void setNCells(int nCells)
Definition: HcalSiPM.cc:144
void setTau(double tau)
Definition: HcalSiPM.cc:151
double theLastHitTime
Definition: HcalSiPM.h:67
void setCrossTalk(double xtalk)
Definition: HcalSiPM.cc:157
double getTau() const
Definition: HcalSiPM.h:37
cdfmap borelcdfs
Definition: HcalSiPM.h:71
unsigned int addCrossTalkCells(CLHEP::HepRandomEngine *engine, unsigned int in_pes)
Definition: HcalSiPM.cc:81
HcalSiPMnonlinearity * nonlin
Definition: HcalSiPM.h:69
double theTau
Definition: HcalSiPM.h:63
unsigned int theCellCount
Definition: HcalSiPM.h:61
HcalSiPM(int nCells=1, double tau=15.)
Definition: HcalSiPM.cc:14
void setTemperatureDependence(double tempDep)
Definition: HcalSiPM.cc:177
std::unordered_map< unsigned int, cdfpair > cdfmap
Definition: HcalSiPM.h:50
std::pair< unsigned int, std::vector< double > > cdfpair
Definition: HcalSiPM.h:49