A general implementation for the response of a SiPM. More...
#include <HcalSiPM.h>
Public Member Functions | |
int | getNCells () const |
HcalSiPM (int nCells=1) | |
virtual int | hitCells (int photons, int integral=0) const |
void | initRandomEngine (CLHEP::HepRandomEngine &engine) |
void | setNCells (int nCells) |
virtual | ~HcalSiPM () |
Protected Member Functions | |
void | defaultErrInit () |
virtual double | errOnX (double x, double prehit=0.) const |
void | getBeforeAndAfter (double val, int &before, int &after, const std::vector< double > &vec) const |
Protected Attributes | |
int | theCellCount |
std::vector< std::vector < double > > | theErrSamples |
std::vector< double > | thePrehitSamples |
CLHEP::RandGaussQ * | theRndGauss |
std::vector< double > | theXSamples |
A general implementation for the response of a SiPM.
Definition at line 17 of file HcalSiPM.h.
HcalSiPM::HcalSiPM | ( | int | nCells = 1 | ) |
Definition at line 9 of file HcalSiPM.cc.
References defaultErrInit(), and theCellCount.
: theCellCount(nCells), theRndGauss(0) { assert(theCellCount>0); defaultErrInit(); }
HcalSiPM::~HcalSiPM | ( | ) | [virtual] |
void HcalSiPM::defaultErrInit | ( | ) | [protected] |
Definition at line 108 of file HcalSiPM.cc.
References ExpressReco_HICollisions_FallBack::e, i, cond::rpcobtemp::temp, theErrSamples, thePrehitSamples, and theXSamples.
Referenced by HcalSiPM().
{ //load up values for the interpolation for the errs on x used to generate //the number of photons. These were produced from a toy SiPM model. theXSamples.clear(); thePrehitSamples.clear(); theErrSamples.clear(); theXSamples.push_back(7.14286e-05); theXSamples.push_back(0.000142857); theXSamples.push_back(0.000428571); theXSamples.push_back(0.00107143); theXSamples.push_back(0.00221429); theXSamples.push_back(0.004); theXSamples.push_back(0.00657143); theXSamples.push_back(0.0100714); theXSamples.push_back(0.0146429); theXSamples.push_back(0.0204286); theXSamples.push_back(0.0275714); theXSamples.push_back(0.0362143); theXSamples.push_back(0.0465); theXSamples.push_back(0.0585714); theXSamples.push_back(0.0725714); theXSamples.push_back(0.0886429); theXSamples.push_back(0.106929); theXSamples.push_back(0.127571); theXSamples.push_back(0.150714); theXSamples.push_back(0.1765); theXSamples.push_back(0.205071); theXSamples.push_back(0.236571); theXSamples.push_back(0.271143); theXSamples.push_back(0.308929); theXSamples.push_back(0.350071); theXSamples.push_back(0.394714); theXSamples.push_back(0.443); theXSamples.push_back(0.495071); theXSamples.push_back(0.551071); theXSamples.push_back(0.611143); theXSamples.push_back(0.675429); theXSamples.push_back(0.744071); theXSamples.push_back(0.817214); theXSamples.push_back(0.895); theXSamples.push_back(0.977571); theXSamples.push_back(1.06507); theXSamples.push_back(1.15764); theXSamples.push_back(1.25543); theXSamples.push_back(1.35857); theXSamples.push_back(1.46721); theXSamples.push_back(1.5815); theXSamples.push_back(1.70157); theXSamples.push_back(1.82757); theXSamples.push_back(1.95964); theXSamples.push_back(2.09793); theXSamples.push_back(2.24257); theXSamples.push_back(2.39371); theXSamples.push_back(2.5515); theXSamples.push_back(2.71607); theXSamples.push_back(2.88757); theXSamples.push_back(3.06614); theXSamples.push_back(3.25193); theXSamples.push_back(3.44507); theXSamples.push_back(3.64571); theXSamples.push_back(3.854); theXSamples.push_back(4.07007); theXSamples.push_back(4.29407); theXSamples.push_back(4.52614); theXSamples.push_back(4.76643); theXSamples.push_back(5.01507); theXSamples.push_back(5.27221); theXSamples.push_back(5.538); theXSamples.push_back(5.81257); theXSamples.push_back(6.09607); theXSamples.push_back(6.38864); theXSamples.push_back(6.69043); theXSamples.push_back(7.00157); theXSamples.push_back(7.32221); theXSamples.push_back(7.6525); theXSamples.push_back(7.99257); theXSamples.push_back(8.34257); theXSamples.push_back(8.70264); theXSamples.push_back(9.07293); theXSamples.push_back(9.45357); theXSamples.push_back(9.84471); theXSamples.push_back(10.2465); for(int i=0; i<16; i++) thePrehitSamples.push_back(i*0.02); vector<double> temp; temp.push_back(0); temp.push_back(0); temp.push_back(0); temp.push_back(8.40058e-06); temp.push_back(1.17956e-05); temp.push_back(2.16323e-05); temp.push_back(3.82308e-05); temp.push_back(6.09053e-05); temp.push_back(8.38503e-05); temp.push_back(0.000119927); temp.push_back(0.000162094); temp.push_back(0.000214873); temp.push_back(0.000263888); temp.push_back(0.000358384); temp.push_back(0.000405752); temp.push_back(0.0004813); temp.push_back(0.000578313); temp.push_back(0.000708949); temp.push_back(0.000806313); temp.push_back(0.000947174); temp.push_back(0.00103474); temp.push_back(0.00117471); temp.push_back(0.00128605); temp.push_back(0.00137934); temp.push_back(0.00154853); temp.push_back(0.00177649); temp.push_back(0.00183272); temp.push_back(0.00186753); temp.push_back(0.0021082); temp.push_back(0.00224273); temp.push_back(0.00230361); temp.push_back(0.00237872); temp.push_back(0.00245845); temp.push_back(0.00265224); temp.push_back(0.00271459); temp.push_back(0.00256564); temp.push_back(0.00266094); temp.push_back(0.00280213); temp.push_back(0.00267646); temp.push_back(0.00263196); temp.push_back(0.00256547); temp.push_back(0.00248559); temp.push_back(0.00254747); temp.push_back(0.00246776); temp.push_back(0.0024417); temp.push_back(0.00233673); temp.push_back(0.00221526); temp.push_back(0.00212567); temp.push_back(0.00179446); temp.push_back(0.00174539); temp.push_back(0.00163708); temp.push_back(0.00152897); temp.push_back(0.00137436); temp.push_back(0.0012264); temp.push_back(0.00115666); temp.push_back(0.00104865); temp.push_back(0.000931932); temp.push_back(0.000867489); temp.push_back(0.000773467); temp.push_back(0.000659164); temp.push_back(0.00060111); temp.push_back(0.00054868); temp.push_back(0.000450312); temp.push_back(0.000393679); temp.push_back(0.000341696); temp.push_back(0.000305829); temp.push_back(0.000238913); temp.push_back(0.000216915); temp.push_back(0.000181357); temp.push_back(0.000164413); temp.push_back(0.000133342); temp.push_back(0.000113031); temp.push_back(9.45459e-05); temp.push_back(7.48834e-05); temp.push_back(5.68479e-05); temp.push_back(4.7456e-05); theErrSamples.push_back(temp); temp.clear(); temp.push_back(1.07019e-05); temp.push_back(1.4297e-05); temp.push_back(2.47542e-05); temp.push_back(3.98772e-05); temp.push_back(6.1143e-05); temp.push_back(7.55069e-05); temp.push_back(0.000101314); temp.push_back(0.000126813); temp.push_back(0.000169132); temp.push_back(0.00022141); temp.push_back(0.000261971); temp.push_back(0.000337033); temp.push_back(0.000353671); temp.push_back(0.000455462); temp.push_back(0.000529259); temp.push_back(0.00065141); temp.push_back(0.0007213); temp.push_back(0.000755735); temp.push_back(0.000905117); temp.push_back(0.000983389); temp.push_back(0.00117113); temp.push_back(0.00123377); temp.push_back(0.00140575); temp.push_back(0.0014624); temp.push_back(0.00158725); temp.push_back(0.0017951); temp.push_back(0.0019545); temp.push_back(0.00203318); temp.push_back(0.00228151); temp.push_back(0.00233437); temp.push_back(0.00236975); temp.push_back(0.00248279); temp.push_back(0.00257292); temp.push_back(0.00265839); temp.push_back(0.00291408); temp.push_back(0.00287581); temp.push_back(0.0027742); temp.push_back(0.0028192); temp.push_back(0.00290722); temp.push_back(0.00290954); temp.push_back(0.00289248); temp.push_back(0.0028919); temp.push_back(0.00274249); temp.push_back(0.00275067); temp.push_back(0.00254015); temp.push_back(0.00263388); temp.push_back(0.00246535); temp.push_back(0.00230695); temp.push_back(0.00219084); temp.push_back(0.00201822); temp.push_back(0.00195889); temp.push_back(0.00191163); temp.push_back(0.00195144); temp.push_back(0.0017406); temp.push_back(0.00171877); temp.push_back(0.00161755); temp.push_back(0.00161152); temp.push_back(0.00142289); temp.push_back(0.00142294); temp.push_back(0.00131059); temp.push_back(0.00131986); temp.push_back(0.00130397); temp.push_back(0.00131082); temp.push_back(0.00127312); temp.push_back(0.00127991); temp.push_back(0.00125962); temp.push_back(0.00123696); temp.push_back(0.00127488); temp.push_back(0.0012194); temp.push_back(0.00124351); temp.push_back(0.00130209); temp.push_back(0.00123718); temp.push_back(0.00126401); temp.push_back(0.0012762); temp.push_back(0.00118605); temp.push_back(0.00121322); theErrSamples.push_back(temp); temp.clear(); temp.push_back(1.52753e-05); temp.push_back(1.9252e-05); temp.push_back(3.51239e-05); temp.push_back(5.42772e-05); temp.push_back(8.42695e-05); temp.push_back(0.000112201); temp.push_back(0.000147315); temp.push_back(0.000181674); temp.push_back(0.000224435); temp.push_back(0.000284745); temp.push_back(0.000327223); temp.push_back(0.000395938); temp.push_back(0.000472805); temp.push_back(0.000519986); temp.push_back(0.000635296); temp.push_back(0.000669197); temp.push_back(0.000775362); temp.push_back(0.000874534); temp.push_back(0.00102977); temp.push_back(0.00113617); temp.push_back(0.00121311); temp.push_back(0.00141158); temp.push_back(0.00154837); temp.push_back(0.00169857); temp.push_back(0.00188519); temp.push_back(0.00191032); temp.push_back(0.00206575); temp.push_back(0.00222722); temp.push_back(0.00227325); temp.push_back(0.00245166); temp.push_back(0.00259628); temp.push_back(0.00249795); temp.push_back(0.00272387); temp.push_back(0.00297299); temp.push_back(0.0030973); temp.push_back(0.00299177); temp.push_back(0.00288901); temp.push_back(0.00304009); temp.push_back(0.00300757); temp.push_back(0.003216); temp.push_back(0.00301877); temp.push_back(0.00305196); temp.push_back(0.00305521); temp.push_back(0.00264599); temp.push_back(0.00289825); temp.push_back(0.00273878); temp.push_back(0.0028623); temp.push_back(0.00262132); temp.push_back(0.00244983); temp.push_back(0.00238771); temp.push_back(0.00241464); temp.push_back(0.0022464); temp.push_back(0.00216141); temp.push_back(0.00216927); temp.push_back(0.00202911); temp.push_back(0.00201579); temp.push_back(0.00206435); temp.push_back(0.00189058); temp.push_back(0.0019032); temp.push_back(0.00180546); temp.push_back(0.00181397); temp.push_back(0.00177982); temp.push_back(0.00169705); temp.push_back(0.00175611); temp.push_back(0.00183977); temp.push_back(0.00181481); temp.push_back(0.0017491); temp.push_back(0.00167498); temp.push_back(0.00176056); temp.push_back(0.00168206); temp.push_back(0.00178997); temp.push_back(0.00160131); temp.push_back(0.00175127); temp.push_back(0.00175144); temp.push_back(0.00172983); temp.push_back(0.00176049); theErrSamples.push_back(temp); temp.clear(); temp.push_back(1.56003e-05); temp.push_back(2.56961e-05); temp.push_back(3.98157e-05); temp.push_back(7.51062e-05); temp.push_back(0.000104808); temp.push_back(0.000137126); temp.push_back(0.000181945); temp.push_back(0.00023428); temp.push_back(0.000276685); temp.push_back(0.000340639); temp.push_back(0.000365219); temp.push_back(0.000455067); temp.push_back(0.000517277); temp.push_back(0.000653087); temp.push_back(0.000704082); temp.push_back(0.00081798); temp.push_back(0.000919737); temp.push_back(0.000997528); temp.push_back(0.00110852); temp.push_back(0.00127015); temp.push_back(0.00135952); temp.push_back(0.00157116); temp.push_back(0.00169714); temp.push_back(0.00181507); temp.push_back(0.00188281); temp.push_back(0.00187945); temp.push_back(0.00224784); temp.push_back(0.00234832); temp.push_back(0.00246759); temp.push_back(0.00258435); temp.push_back(0.00287211); temp.push_back(0.00282387); temp.push_back(0.00301207); temp.push_back(0.00301706); temp.push_back(0.00314772); temp.push_back(0.00313356); temp.push_back(0.00330207); temp.push_back(0.00321868); temp.push_back(0.00340633); temp.push_back(0.00316687); temp.push_back(0.0030367); temp.push_back(0.00346355); temp.push_back(0.00308358); temp.push_back(0.00313356); temp.push_back(0.00322158); temp.push_back(0.00286642); temp.push_back(0.0030063); temp.push_back(0.0028074); temp.push_back(0.00276659); temp.push_back(0.00284753); temp.push_back(0.00260215); temp.push_back(0.00256294); temp.push_back(0.00264208); temp.push_back(0.00247397); temp.push_back(0.00249761); temp.push_back(0.00232896); temp.push_back(0.00237722); temp.push_back(0.00223927); temp.push_back(0.00218478); temp.push_back(0.00219469); temp.push_back(0.00223608); temp.push_back(0.00225412); temp.push_back(0.00218023); temp.push_back(0.00223298); temp.push_back(0.0021489); temp.push_back(0.00216245); temp.push_back(0.00222762); temp.push_back(0.0021608); temp.push_back(0.00226409); temp.push_back(0.00215114); temp.push_back(0.00209354); temp.push_back(0.00220478); temp.push_back(0.00212817); temp.push_back(0.00216157); temp.push_back(0.00210899); temp.push_back(0.00221498); theErrSamples.push_back(temp); temp.clear(); temp.push_back(1.98294e-05); temp.push_back(2.74883e-05); temp.push_back(4.97341e-05); temp.push_back(7.8167e-05); temp.push_back(0.000115158); temp.push_back(0.000159637); temp.push_back(0.000198413); temp.push_back(0.000249918); temp.push_back(0.000307694); temp.push_back(0.00037631); temp.push_back(0.000420037); temp.push_back(0.000530557); temp.push_back(0.000574406); temp.push_back(0.000678883); temp.push_back(0.000783538); temp.push_back(0.000828001); temp.push_back(0.000945383); temp.push_back(0.0010672); temp.push_back(0.00119183); temp.push_back(0.00134696); temp.push_back(0.00155348); temp.push_back(0.00167101); temp.push_back(0.00181066); temp.push_back(0.00187759); temp.push_back(0.00199899); temp.push_back(0.00225269); temp.push_back(0.0023458); temp.push_back(0.00253072); temp.push_back(0.00270998); temp.push_back(0.00263773); temp.push_back(0.00294804); temp.push_back(0.00294624); temp.push_back(0.00321668); temp.push_back(0.00332147); temp.push_back(0.00334766); temp.push_back(0.00330149); temp.push_back(0.00340882); temp.push_back(0.00347742); temp.push_back(0.00352589); temp.push_back(0.0035523); temp.push_back(0.0035411); temp.push_back(0.00340469); temp.push_back(0.00335693); temp.push_back(0.00345872); temp.push_back(0.00316091); temp.push_back(0.0031948); temp.push_back(0.00307664); temp.push_back(0.00320621); temp.push_back(0.00304138); temp.push_back(0.00299107); temp.push_back(0.00281006); temp.push_back(0.00278658); temp.push_back(0.0028095); temp.push_back(0.00268299); temp.push_back(0.0027215); temp.push_back(0.00264144); temp.push_back(0.00260714); temp.push_back(0.00255874); temp.push_back(0.00266137); temp.push_back(0.00248823); temp.push_back(0.0026194); temp.push_back(0.0026251); temp.push_back(0.00245108); temp.push_back(0.00254617); temp.push_back(0.00264651); temp.push_back(0.00247705); temp.push_back(0.00252758); temp.push_back(0.00262686); temp.push_back(0.00248693); temp.push_back(0.00254178); temp.push_back(0.00258846); temp.push_back(0.0025353); temp.push_back(0.00240568); temp.push_back(0.00250232); temp.push_back(0.00251452); temp.push_back(0.00258121); theErrSamples.push_back(temp); temp.clear(); temp.push_back(2.362e-05); temp.push_back(3.24457e-05); temp.push_back(5.93625e-05); temp.push_back(9.71924e-05); temp.push_back(0.000126279); temp.push_back(0.000176152); temp.push_back(0.000224722); temp.push_back(0.000290262); temp.push_back(0.000351171); temp.push_back(0.000439513); temp.push_back(0.000497545); temp.push_back(0.000596431); temp.push_back(0.000686665); temp.push_back(0.000716486); temp.push_back(0.000835977); temp.push_back(0.000943229); temp.push_back(0.00104521); temp.push_back(0.00120528); temp.push_back(0.00140133); temp.push_back(0.00144132); temp.push_back(0.00164603); temp.push_back(0.00179182); temp.push_back(0.00188172); temp.push_back(0.00203418); temp.push_back(0.00224695); temp.push_back(0.00224972); temp.push_back(0.00259959); temp.push_back(0.00249426); temp.push_back(0.00280589); temp.push_back(0.00286528); temp.push_back(0.00309813); temp.push_back(0.00321952); temp.push_back(0.00324915); temp.push_back(0.00312759); temp.push_back(0.00338569); temp.push_back(0.00351915); temp.push_back(0.00336895); temp.push_back(0.00358675); temp.push_back(0.00361005); temp.push_back(0.00356783); temp.push_back(0.00381571); temp.push_back(0.00358167); temp.push_back(0.00355341); temp.push_back(0.00369961); temp.push_back(0.00345098); temp.push_back(0.00345749); temp.push_back(0.00366643); temp.push_back(0.00328805); temp.push_back(0.00317392); temp.push_back(0.00325794); temp.push_back(0.00325624); temp.push_back(0.00298589); temp.push_back(0.00313121); temp.push_back(0.00307129); temp.push_back(0.00303754); temp.push_back(0.00299004); temp.push_back(0.00283794); temp.push_back(0.0029663); temp.push_back(0.00278505); temp.push_back(0.00294565); temp.push_back(0.00295431); temp.push_back(0.0029553); temp.push_back(0.0027788); temp.push_back(0.00272655); temp.push_back(0.00267875); temp.push_back(0.00288197); temp.push_back(0.00284249); temp.push_back(0.00281758); temp.push_back(0.00285672); temp.push_back(0.00260368); temp.push_back(0.0027489); temp.push_back(0.00270647); temp.push_back(0.00300406); temp.push_back(0.00298123); temp.push_back(0.00284949); temp.push_back(0.00275038); theErrSamples.push_back(temp); temp.clear(); temp.push_back(2.62119e-05); temp.push_back(4.06637e-05); temp.push_back(6.45721e-05); temp.push_back(9.8698e-05); temp.push_back(0.000145844); temp.push_back(0.000209191); temp.push_back(0.000267177); temp.push_back(0.000312714); temp.push_back(0.000397544); temp.push_back(0.000436342); temp.push_back(0.000537476); temp.push_back(0.000588913); temp.push_back(0.000733794); temp.push_back(0.000834061); temp.push_back(0.000884576); temp.push_back(0.001049); temp.push_back(0.00109329); temp.push_back(0.00128614); temp.push_back(0.00139434); temp.push_back(0.00155489); temp.push_back(0.00169101); temp.push_back(0.00192918); temp.push_back(0.00192531); temp.push_back(0.00211887); temp.push_back(0.00227517); temp.push_back(0.00250976); temp.push_back(0.00268224); temp.push_back(0.00276841); temp.push_back(0.00287698); temp.push_back(0.00299388); temp.push_back(0.00306973); temp.push_back(0.00337693); temp.push_back(0.00332126); temp.push_back(0.00344551); temp.push_back(0.00364214); temp.push_back(0.00354195); temp.push_back(0.00371903); temp.push_back(0.0037893); temp.push_back(0.00381634); temp.push_back(0.00377593); temp.push_back(0.00382319); temp.push_back(0.00378659); temp.push_back(0.00379056); temp.push_back(0.00392088); temp.push_back(0.00396608); temp.push_back(0.00361685); temp.push_back(0.00356004); temp.push_back(0.00377212); temp.push_back(0.00359799); temp.push_back(0.00349761); temp.push_back(0.00345083); temp.push_back(0.00341753); temp.push_back(0.0031536); temp.push_back(0.00329225); temp.push_back(0.00318691); temp.push_back(0.00342211); temp.push_back(0.00324309); temp.push_back(0.00343059); temp.push_back(0.00313786); temp.push_back(0.00309648); temp.push_back(0.00308665); temp.push_back(0.00315973); temp.push_back(0.00320034); temp.push_back(0.00327231); temp.push_back(0.00315402); temp.push_back(0.00306078); temp.push_back(0.00307093); temp.push_back(0.00304372); temp.push_back(0.0032217); temp.push_back(0.00315268); temp.push_back(0.0031173); temp.push_back(0.00308137); temp.push_back(0.0031778); temp.push_back(0.0030366); temp.push_back(0.00304068); temp.push_back(0.0033214); theErrSamples.push_back(temp); temp.clear(); temp.push_back(2.74013e-05); temp.push_back(4.22899e-05); temp.push_back(6.78705e-05); temp.push_back(0.000108305); temp.push_back(0.000155136); temp.push_back(0.000215087); temp.push_back(0.000267491); temp.push_back(0.000324307); temp.push_back(0.000450428); temp.push_back(0.000525255); temp.push_back(0.000593983); temp.push_back(0.000670897); temp.push_back(0.000773512); temp.push_back(0.000886391); temp.push_back(0.000944693); temp.push_back(0.0012177); temp.push_back(0.00122543); temp.push_back(0.00137642); temp.push_back(0.00154086); temp.push_back(0.00165634); temp.push_back(0.00191029); temp.push_back(0.00190192); temp.push_back(0.00211654); temp.push_back(0.00212919); temp.push_back(0.00228748); temp.push_back(0.00254164); temp.push_back(0.00280712); temp.push_back(0.00302764); temp.push_back(0.00306686); temp.push_back(0.00327206); temp.push_back(0.00331136); temp.push_back(0.0036489); temp.push_back(0.00342041); temp.push_back(0.003781); temp.push_back(0.00378694); temp.push_back(0.00386973); temp.push_back(0.00369683); temp.push_back(0.0038999); temp.push_back(0.00395901); temp.push_back(0.00396228); temp.push_back(0.00405743); temp.push_back(0.00410244); temp.push_back(0.00413032); temp.push_back(0.00373123); temp.push_back(0.00395574); temp.push_back(0.00378686); temp.push_back(0.00406811); temp.push_back(0.00395806); temp.push_back(0.00379701); temp.push_back(0.00386635); temp.push_back(0.00361041); temp.push_back(0.00378335); temp.push_back(0.00353608); temp.push_back(0.00346058); temp.push_back(0.00361939); temp.push_back(0.00350638); temp.push_back(0.00351027); temp.push_back(0.00356889); temp.push_back(0.00353562); temp.push_back(0.00338339); temp.push_back(0.00358931); temp.push_back(0.0033404); temp.push_back(0.0034386); temp.push_back(0.00356428); temp.push_back(0.00342609); temp.push_back(0.00351769); temp.push_back(0.0034948); temp.push_back(0.0032928); temp.push_back(0.00354759); temp.push_back(0.0035006); temp.push_back(0.00344599); temp.push_back(0.00360147); temp.push_back(0.00350432); temp.push_back(0.00328072); temp.push_back(0.00352725); temp.push_back(0.00344304); theErrSamples.push_back(temp); temp.clear(); temp.push_back(3.19736e-05); temp.push_back(4.2274e-05); temp.push_back(7.42979e-05); temp.push_back(0.000115308); temp.push_back(0.000181278); temp.push_back(0.000238536); temp.push_back(0.000295333); temp.push_back(0.000372787); temp.push_back(0.000450952); temp.push_back(0.000549762); temp.push_back(0.000587952); temp.push_back(0.000717376); temp.push_back(0.000823059); temp.push_back(0.000929103); temp.push_back(0.00101405); temp.push_back(0.00120059); temp.push_back(0.00129663); temp.push_back(0.00138426); temp.push_back(0.0016377); temp.push_back(0.00177567); temp.push_back(0.00193567); temp.push_back(0.00193153); temp.push_back(0.00217634); temp.push_back(0.00226176); temp.push_back(0.00269487); temp.push_back(0.00260071); temp.push_back(0.0029404); temp.push_back(0.00314849); temp.push_back(0.00329682); temp.push_back(0.00359669); temp.push_back(0.0033118); temp.push_back(0.00346258); temp.push_back(0.00376314); temp.push_back(0.00361881); temp.push_back(0.00386849); temp.push_back(0.00410369); temp.push_back(0.0039706); temp.push_back(0.0041219); temp.push_back(0.00407418); temp.push_back(0.00410784); temp.push_back(0.00417039); temp.push_back(0.00396376); temp.push_back(0.00402818); temp.push_back(0.00408969); temp.push_back(0.00398906); temp.push_back(0.00407158); temp.push_back(0.00407663); temp.push_back(0.00429465); temp.push_back(0.00399424); temp.push_back(0.00398511); temp.push_back(0.00413987); temp.push_back(0.00402974); temp.push_back(0.00396823); temp.push_back(0.00406268); temp.push_back(0.00397054); temp.push_back(0.00406304); temp.push_back(0.00381928); temp.push_back(0.00373153); temp.push_back(0.0038722); temp.push_back(0.00372542); temp.push_back(0.00371033); temp.push_back(0.00370851); temp.push_back(0.00370273); temp.push_back(0.00375404); temp.push_back(0.00368417); temp.push_back(0.00370411); temp.push_back(0.00360586); temp.push_back(0.00374387); temp.push_back(0.00370439); temp.push_back(0.00362516); temp.push_back(0.00377766); temp.push_back(0.00360445); temp.push_back(0.00360142); temp.push_back(0.00368594); temp.push_back(0.00358465); temp.push_back(0.00361813); theErrSamples.push_back(temp); temp.clear(); temp.push_back(3.33533e-05); temp.push_back(4.71255e-05); temp.push_back(7.95104e-05); temp.push_back(0.000125354); temp.push_back(0.000184391); temp.push_back(0.000241585); temp.push_back(0.000312129); temp.push_back(0.000416606); temp.push_back(0.00048679); temp.push_back(0.000590734); temp.push_back(0.000680798); temp.push_back(0.00074592); temp.push_back(0.000925237); temp.push_back(0.000945055); temp.push_back(0.00111491); temp.push_back(0.00124566); temp.push_back(0.00130333); temp.push_back(0.00159285); temp.push_back(0.00160697); temp.push_back(0.00173291); temp.push_back(0.00205625); temp.push_back(0.0020842); temp.push_back(0.00234011); temp.push_back(0.00257964); temp.push_back(0.00271621); temp.push_back(0.00274754); temp.push_back(0.00300009); temp.push_back(0.00313262); temp.push_back(0.0033966); temp.push_back(0.00370825); temp.push_back(0.00365397); temp.push_back(0.00380956); temp.push_back(0.00406663); temp.push_back(0.00390965); temp.push_back(0.00400766); temp.push_back(0.0040838); temp.push_back(0.00430457); temp.push_back(0.00430605); temp.push_back(0.00452344); temp.push_back(0.00444883); temp.push_back(0.00462339); temp.push_back(0.00441296); temp.push_back(0.0044215); temp.push_back(0.00437965); temp.push_back(0.00450718); temp.push_back(0.00411557); temp.push_back(0.0044587); temp.push_back(0.00428602); temp.push_back(0.00415902); temp.push_back(0.00433486); temp.push_back(0.0043004); temp.push_back(0.00407849); temp.push_back(0.00423246); temp.push_back(0.00394595); temp.push_back(0.00402799); temp.push_back(0.00390578); temp.push_back(0.00403325); temp.push_back(0.00401427); temp.push_back(0.00413036); temp.push_back(0.00396507); temp.push_back(0.00397724); temp.push_back(0.00405608); temp.push_back(0.00410989); temp.push_back(0.00390445); temp.push_back(0.00408041); temp.push_back(0.00374423); temp.push_back(0.00380687); temp.push_back(0.00396012); temp.push_back(0.00403351); temp.push_back(0.00397022); temp.push_back(0.00420906); temp.push_back(0.00395898); temp.push_back(0.00414565); temp.push_back(0.00419401); temp.push_back(0.00398256); temp.push_back(0.00405866); theErrSamples.push_back(temp); temp.clear(); temp.push_back(3.60154e-05); temp.push_back(4.78073e-05); temp.push_back(8.81868e-05); temp.push_back(0.00014119); temp.push_back(0.000199197); temp.push_back(0.000271447); temp.push_back(0.000348848); temp.push_back(0.000414794); temp.push_back(0.000517428); temp.push_back(0.000613861); temp.push_back(0.000706405); temp.push_back(0.000830507); temp.push_back(0.000954556); temp.push_back(0.00102745); temp.push_back(0.00115016); temp.push_back(0.00130855); temp.push_back(0.00141543); temp.push_back(0.00154704); temp.push_back(0.00183892); temp.push_back(0.00182328); temp.push_back(0.00211743); temp.push_back(0.00238445); temp.push_back(0.00251855); temp.push_back(0.00259965); temp.push_back(0.00276547); temp.push_back(0.00279785); temp.push_back(0.00310652); temp.push_back(0.00332247); temp.push_back(0.00348554); temp.push_back(0.00340047); temp.push_back(0.00379133); temp.push_back(0.00394976); temp.push_back(0.00411556); temp.push_back(0.00395808); temp.push_back(0.00413605); temp.push_back(0.00434804); temp.push_back(0.00454974); temp.push_back(0.00448955); temp.push_back(0.00475876); temp.push_back(0.00457681); temp.push_back(0.00444923); temp.push_back(0.00441159); temp.push_back(0.00433255); temp.push_back(0.0044053); temp.push_back(0.00467223); temp.push_back(0.00444452); temp.push_back(0.00429894); temp.push_back(0.00466592); temp.push_back(0.004516); temp.push_back(0.00446295); temp.push_back(0.00435999); temp.push_back(0.00467332); temp.push_back(0.00423821); temp.push_back(0.00443203); temp.push_back(0.00434006); temp.push_back(0.00429902); temp.push_back(0.0042231); temp.push_back(0.00423514); temp.push_back(0.00451164); temp.push_back(0.00436348); temp.push_back(0.00436551); temp.push_back(0.00425205); temp.push_back(0.00429035); temp.push_back(0.00411415); temp.push_back(0.00427361); temp.push_back(0.0039277); temp.push_back(0.00405848); temp.push_back(0.00429804); temp.push_back(0.00408766); temp.push_back(0.00384011); temp.push_back(0.00435199); temp.push_back(0.004093); temp.push_back(0.00406005); temp.push_back(0.00431062); temp.push_back(0.00411773); temp.push_back(0.00435653); theErrSamples.push_back(temp); temp.clear(); temp.push_back(3.94789e-05); temp.push_back(5.3769e-05); temp.push_back(9.3841e-05); temp.push_back(0.000149774); temp.push_back(0.000215262); temp.push_back(0.000267695); temp.push_back(0.000370277); temp.push_back(0.000473963); temp.push_back(0.000548657); temp.push_back(0.000625464); temp.push_back(0.000737716); temp.push_back(0.000895534); temp.push_back(0.00100207); temp.push_back(0.00111602); temp.push_back(0.00123458); temp.push_back(0.00138359); temp.push_back(0.00158882); temp.push_back(0.00176246); temp.push_back(0.00177764); temp.push_back(0.00199677); temp.push_back(0.00211274); temp.push_back(0.00240314); temp.push_back(0.00238892); temp.push_back(0.00266706); temp.push_back(0.00292668); temp.push_back(0.00314009); temp.push_back(0.00330102); temp.push_back(0.00354671); temp.push_back(0.00371555); temp.push_back(0.00383521); temp.push_back(0.00392384); temp.push_back(0.00415042); temp.push_back(0.00417837); temp.push_back(0.00410063); temp.push_back(0.00436123); temp.push_back(0.00453869); temp.push_back(0.00456717); temp.push_back(0.00432658); temp.push_back(0.00474763); temp.push_back(0.00479594); temp.push_back(0.00495067); temp.push_back(0.00486827); temp.push_back(0.00501981); temp.push_back(0.00467952); temp.push_back(0.00496726); temp.push_back(0.00471759); temp.push_back(0.00487664); temp.push_back(0.00477905); temp.push_back(0.00457876); temp.push_back(0.00478556); temp.push_back(0.00470292); temp.push_back(0.00474277); temp.push_back(0.00474074); temp.push_back(0.00476266); temp.push_back(0.00459758); temp.push_back(0.00465773); temp.push_back(0.00469381); temp.push_back(0.004336); temp.push_back(0.00439833); temp.push_back(0.00434989); temp.push_back(0.00452046); temp.push_back(0.00444761); temp.push_back(0.00452204); temp.push_back(0.00433173); temp.push_back(0.00428761); temp.push_back(0.00454501); temp.push_back(0.00466898); temp.push_back(0.00449207); temp.push_back(0.00478147); temp.push_back(0.00448187); temp.push_back(0.00427879); temp.push_back(0.0045072); temp.push_back(0.00446825); temp.push_back(0.00442717); temp.push_back(0.00450486); temp.push_back(0.004514); theErrSamples.push_back(temp); temp.clear(); temp.push_back(4.07374e-05); temp.push_back(5.84427e-05); temp.push_back(0.000102379); temp.push_back(0.000154485); temp.push_back(0.00022167); temp.push_back(0.000291138); temp.push_back(0.000366195); temp.push_back(0.00049284); temp.push_back(0.000555038); temp.push_back(0.000718216); temp.push_back(0.000815782); temp.push_back(0.000929635); temp.push_back(0.00105284); temp.push_back(0.00117775); temp.push_back(0.00128659); temp.push_back(0.0014848); temp.push_back(0.00161139); temp.push_back(0.00186044); temp.push_back(0.00193622); temp.push_back(0.0021136); temp.push_back(0.00218413); temp.push_back(0.00254649); temp.push_back(0.00257878); temp.push_back(0.00286384); temp.push_back(0.00277422); temp.push_back(0.00337728); temp.push_back(0.0034849); temp.push_back(0.00340672); temp.push_back(0.00376872); temp.push_back(0.00397498); temp.push_back(0.00407663); temp.push_back(0.00416444); temp.push_back(0.00447438); temp.push_back(0.00421777); temp.push_back(0.00434779); temp.push_back(0.00457815); temp.push_back(0.00510487); temp.push_back(0.004957); temp.push_back(0.0050608); temp.push_back(0.00482047); temp.push_back(0.00479584); temp.push_back(0.00506816); temp.push_back(0.00485049); temp.push_back(0.00502603); temp.push_back(0.00496904); temp.push_back(0.0048041); temp.push_back(0.00498567); temp.push_back(0.00505111); temp.push_back(0.00495093); temp.push_back(0.00493909); temp.push_back(0.00518096); temp.push_back(0.00475333); temp.push_back(0.00509383); temp.push_back(0.00455324); temp.push_back(0.00501535); temp.push_back(0.00477645); temp.push_back(0.00467969); temp.push_back(0.00482058); temp.push_back(0.0049352); temp.push_back(0.00479813); temp.push_back(0.00456841); temp.push_back(0.00495553); temp.push_back(0.00475263); temp.push_back(0.00464536); temp.push_back(0.0045788); temp.push_back(0.00482641); temp.push_back(0.00468534); temp.push_back(0.00458609); temp.push_back(0.00469523); temp.push_back(0.00471367); temp.push_back(0.00480113); temp.push_back(0.00477874); temp.push_back(0.00487724); temp.push_back(0.00448248); temp.push_back(0.00457135); temp.push_back(0.00463623); theErrSamples.push_back(temp); temp.clear(); temp.push_back(4.19494e-05); temp.push_back(5.81133e-05); temp.push_back(0.000106598); temp.push_back(0.000167045); temp.push_back(0.000245601); temp.push_back(0.000309417); temp.push_back(0.000402556); temp.push_back(0.000531311); temp.push_back(0.000599414); temp.push_back(0.000724794); temp.push_back(0.000843293); temp.push_back(0.00102089); temp.push_back(0.00110244); temp.push_back(0.00119442); temp.push_back(0.0014845); temp.push_back(0.00144809); temp.push_back(0.00163904); temp.push_back(0.00179288); temp.push_back(0.00208349); temp.push_back(0.00218156); temp.push_back(0.00241731); temp.push_back(0.00260733); temp.push_back(0.0028223); temp.push_back(0.00303541); temp.push_back(0.00317796); temp.push_back(0.00318073); temp.push_back(0.00354012); temp.push_back(0.0038304); temp.push_back(0.00394061); temp.push_back(0.00388992); temp.push_back(0.00415685); temp.push_back(0.004271); temp.push_back(0.00454353); temp.push_back(0.00436867); temp.push_back(0.00471855); temp.push_back(0.00486456); temp.push_back(0.00458562); temp.push_back(0.00467012); temp.push_back(0.00488229); temp.push_back(0.0051219); temp.push_back(0.00525306); temp.push_back(0.00520996); temp.push_back(0.00512736); temp.push_back(0.00506308); temp.push_back(0.00509758); temp.push_back(0.00513977); temp.push_back(0.00506956); temp.push_back(0.0050327); temp.push_back(0.00528484); temp.push_back(0.00541921); temp.push_back(0.00486394); temp.push_back(0.00532431); temp.push_back(0.00491166); temp.push_back(0.0054032); temp.push_back(0.00515276); temp.push_back(0.00499206); temp.push_back(0.00507303); temp.push_back(0.00528015); temp.push_back(0.00502935); temp.push_back(0.00498204); temp.push_back(0.00482074); temp.push_back(0.0050209); temp.push_back(0.00506188); temp.push_back(0.00501215); temp.push_back(0.00523337); temp.push_back(0.00501484); temp.push_back(0.00482134); temp.push_back(0.00510347); temp.push_back(0.00500609); temp.push_back(0.00508656); temp.push_back(0.00505679); temp.push_back(0.00526603); temp.push_back(0.00491982); temp.push_back(0.00505811); temp.push_back(0.00494347); temp.push_back(0.00506382); theErrSamples.push_back(temp); temp.clear(); temp.push_back(4.58461e-05); temp.push_back(6.56593e-05); temp.push_back(0.000106249); temp.push_back(0.000177259); temp.push_back(0.000242624); temp.push_back(0.000318801); temp.push_back(0.000429442); temp.push_back(0.000524763); temp.push_back(0.000627853); temp.push_back(0.000767861); temp.push_back(0.000914838); temp.push_back(0.00101068); temp.push_back(0.00119111); temp.push_back(0.00124833); temp.push_back(0.00147471); temp.push_back(0.00151766); temp.push_back(0.00175504); temp.push_back(0.0019513); temp.push_back(0.00225088); temp.push_back(0.00232528); temp.push_back(0.002477); temp.push_back(0.0026629); temp.push_back(0.00282126); temp.push_back(0.00305865); temp.push_back(0.00328165); temp.push_back(0.00342969); temp.push_back(0.00368517); temp.push_back(0.00412023); temp.push_back(0.00408107); temp.push_back(0.00442514); temp.push_back(0.00419995); temp.push_back(0.00445839); temp.push_back(0.00480241); temp.push_back(0.00469063); temp.push_back(0.00488558); temp.push_back(0.00505738); temp.push_back(0.00534401); temp.push_back(0.00529189); temp.push_back(0.00503914); temp.push_back(0.00547271); temp.push_back(0.00532523); temp.push_back(0.0056474); temp.push_back(0.00528356); temp.push_back(0.00537977); temp.push_back(0.00528494); temp.push_back(0.00555228); temp.push_back(0.00522019); temp.push_back(0.00551423); temp.push_back(0.00532466); temp.push_back(0.00562846); temp.push_back(0.00531636); temp.push_back(0.00534452); temp.push_back(0.00546899); temp.push_back(0.00540307); temp.push_back(0.00522696); temp.push_back(0.00543343); temp.push_back(0.00496315); temp.push_back(0.0054688); temp.push_back(0.0054534); temp.push_back(0.00529457); temp.push_back(0.00527906); temp.push_back(0.00505608); temp.push_back(0.00532934); temp.push_back(0.00540523); temp.push_back(0.00546589); temp.push_back(0.00541721); temp.push_back(0.00518411); temp.push_back(0.0050658); temp.push_back(0.00538019); temp.push_back(0.00523502); temp.push_back(0.00518119); temp.push_back(0.00541954); temp.push_back(0.00556926); temp.push_back(0.00516485); temp.push_back(0.00543988); temp.push_back(0.00534757); theErrSamples.push_back(temp); temp.clear(); temp.push_back(4.87191e-05); temp.push_back(6.79557e-05); temp.push_back(0.00011585); temp.push_back(0.000170012); temp.push_back(0.000249995); temp.push_back(0.000358082); temp.push_back(0.000441529); temp.push_back(0.000573455); temp.push_back(0.000686492); temp.push_back(0.000768395); temp.push_back(0.000922129); temp.push_back(0.0010261); temp.push_back(0.00121379); temp.push_back(0.00132394); temp.push_back(0.00147006); temp.push_back(0.0016026); temp.push_back(0.00185945); temp.push_back(0.00205459); temp.push_back(0.00224833); temp.push_back(0.00239438); temp.push_back(0.00258948); temp.push_back(0.00285399); temp.push_back(0.00293392); temp.push_back(0.00310816); temp.push_back(0.0035526); temp.push_back(0.00353642); temp.push_back(0.003711); temp.push_back(0.00392946); temp.push_back(0.00417796); temp.push_back(0.00440017); temp.push_back(0.00474434); temp.push_back(0.00469919); temp.push_back(0.00476225); temp.push_back(0.00474708); temp.push_back(0.00515252); temp.push_back(0.0053985); temp.push_back(0.00515269); temp.push_back(0.00535194); temp.push_back(0.00519113); temp.push_back(0.00531732); temp.push_back(0.00545661); temp.push_back(0.00562353); temp.push_back(0.00547828); temp.push_back(0.00590485); temp.push_back(0.0054847); temp.push_back(0.00575722); temp.push_back(0.00578941); temp.push_back(0.0055163); temp.push_back(0.00565193); temp.push_back(0.00559088); temp.push_back(0.00578905); temp.push_back(0.00568463); temp.push_back(0.00538114); temp.push_back(0.00569508); temp.push_back(0.00534805); temp.push_back(0.00521921); temp.push_back(0.00568289); temp.push_back(0.0055866); temp.push_back(0.00561974); temp.push_back(0.00548487); temp.push_back(0.00558498); temp.push_back(0.00536631); temp.push_back(0.00541084); temp.push_back(0.00577058); temp.push_back(0.00540762); temp.push_back(0.00545929); temp.push_back(0.00571948); temp.push_back(0.00546965); temp.push_back(0.00557277); temp.push_back(0.00554671); temp.push_back(0.00521175); temp.push_back(0.00546106); temp.push_back(0.00541317); temp.push_back(0.00569926); temp.push_back(0.0055058); temp.push_back(0.00537131); theErrSamples.push_back(temp); temp.clear(); }
double HcalSiPM::errOnX | ( | double | x, |
double | prehit = 0. |
||
) | const [protected, virtual] |
Definition at line 75 of file HcalSiPM.cc.
References getBeforeAndAfter(), i, j, theErrSamples, thePrehitSamples, and theXSamples.
Referenced by hitCells().
{ //interpolate between the points in the x,prehit space to determine the //width of the distribution of x int before, after; getBeforeAndAfter(x, before, after, theXSamples); int i, j; getBeforeAndAfter(prehit, i, j, thePrehitSamples); double m1 = (theErrSamples[i][after]-theErrSamples[i][before])/ (theXSamples[after]-theXSamples[before]); double err1 = theErrSamples[i][before]+m1*(x-theXSamples[before]); double m2 = (theErrSamples[j][after]-theErrSamples[j][before])/ (theXSamples[after]-theXSamples[before]); double err2 = theErrSamples[j][before]+m2*(x-theXSamples[before]); return err1 + (err2-err1)/(thePrehitSamples[j]-thePrehitSamples[i])* (prehit - thePrehitSamples[i]); }
void HcalSiPM::getBeforeAndAfter | ( | double | val, |
int & | before, | ||
int & | after, | ||
const std::vector< double > & | vec | ||
) | const [protected] |
Definition at line 93 of file HcalSiPM.cc.
Referenced by errOnX().
{ //binary like search to indeces points around an arbitrary value. before = 0; after = vec.size()-1; int mid = vec.size()/2; bool go = true; do { if (vec[mid]>val) after = mid; else before = mid; mid = (after+before)/2; go = (after-before > 1); } while (go); }
int HcalSiPM::getNCells | ( | ) | const [inline] |
int HcalSiPM::hitCells | ( | int | photons, |
int | integral = 0 |
||
) | const [virtual] |
Definition at line 21 of file HcalSiPM.cc.
References errOnX(), Exception, funct::exp(), edm::Service< T >::isAvailable(), plotscripts::mean(), theCellCount, theRndGauss, tablePrinter::width, and ExpressReco_HICollisions_FallBack::x.
Referenced by HcalSiPMHitResponse::makeSiPMSignal().
{ //don't need to do zero or negative photons. if (photons < 1) return 0; if (integral < 0) integral = 0; if (integral >= theCellCount) return 0; if (theRndGauss == 0) { //random number generator setup edm::Service<edm::RandomNumberGenerator> rng; if ( ! rng.isAvailable()) { throw cms::Exception("Configuration") << "HcalSiPM requires the RandomNumberGeneratorService\n" "which is not present in the configuration file. " "You must add the service\n" "in the configuration file or remove the modules that require it."; } CLHEP::HepRandomEngine& engine = rng->getEngine(); theRndGauss = new CLHEP::RandGaussQ(engine); } //normalize by theCellCount to remove dependency on SiPM size and pixel density. double x = double(photons)/double(theCellCount); double prehit = double(integral)/double(theCellCount); //calculate the width and mean of the distribution for a given x double width = errOnX(x, prehit); double mean = 1. - std::exp(-x); //you can't hit more than everything. if (mean > 1.) mean = 1.; //convert back to absolute pixels mean *= (1-prehit)*theCellCount; width *= (1-prehit)*theCellCount; double npe; while (true) { npe = theRndGauss->fire(mean, width); if ((npe > -0.5) && (npe <= theCellCount-integral) && (npe <= photons)) return int(npe + 0.5); } }
void HcalSiPM::initRandomEngine | ( | CLHEP::HepRandomEngine & | engine | ) |
Definition at line 70 of file HcalSiPM.cc.
References theRndGauss.
Referenced by HcalSiPMHitResponse::setRandomEngine().
{ if(theRndGauss) delete theRndGauss; theRndGauss = new CLHEP::RandGaussQ(engine); }
void HcalSiPM::setNCells | ( | int | nCells | ) |
Definition at line 65 of file HcalSiPM.cc.
References theCellCount.
Referenced by HcalSiPMHitResponse::makeSiPMSignal().
{ assert(nCells>0); theCellCount = nCells; }
int HcalSiPM::theCellCount [protected] |
Definition at line 34 of file HcalSiPM.h.
Referenced by getNCells(), HcalSiPM(), hitCells(), and setNCells().
std::vector< std::vector< double > > HcalSiPM::theErrSamples [protected] |
Definition at line 39 of file HcalSiPM.h.
Referenced by defaultErrInit(), and errOnX().
std::vector< double > HcalSiPM::thePrehitSamples [protected] |
Definition at line 38 of file HcalSiPM.h.
Referenced by defaultErrInit(), and errOnX().
CLHEP::RandGaussQ* HcalSiPM::theRndGauss [mutable, protected] |
Definition at line 35 of file HcalSiPM.h.
Referenced by hitCells(), initRandomEngine(), and ~HcalSiPM().
std::vector< double > HcalSiPM::theXSamples [protected] |
Definition at line 37 of file HcalSiPM.h.
Referenced by defaultErrInit(), and errOnX().