CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Private Attributes
HcalSiPMHitResponse Class Reference

#include <HcalSiPMHitResponse.h>

Inheritance diagram for HcalSiPMHitResponse:
CaloHitResponse

Public Types

typedef std::vector< unsigned int > photonTimeHist
 
typedef std::map< DetId,
photonTimeHist
photonTimeMap
 
- Public Types inherited from CaloHitResponse
enum  { BUNCHSPACE =25 }
 
typedef std::map< DetId,
CaloSamples
AnalogSignalMap
 

Public Member Functions

virtual void add (const PCaloHit &hit)
 process a single SimHit More...
 
virtual void add (const CaloSamples &signal)
 
virtual void finalizeHits ()
 Finalize hits. More...
 
 HcalSiPMHitResponse (const CaloVSimParameterMap *parameterMap, const CaloShapes *shapes)
 
virtual void initializeHits ()
 Initialize hits. More...
 
virtual CaloSamples makeBlankSignal (const DetId &detId) const
 
virtual void run (MixCollection< PCaloHit > &hits)
 Complete cell digitization. More...
 
virtual void setRandomEngine (CLHEP::HepRandomEngine &engine)
 
virtual ~HcalSiPMHitResponse ()
 
- Public Member Functions inherited from CaloHitResponse
void add (const CaloSamples &signal)
 add a signal, in units of pe More...
 
void addHit (const PCaloHit *hit, CaloSamples &frame) const
 adds the amplitude for a single hit to the frame More...
 
double analogSignalAmplitude (const DetId &id, float energy, const CaloSimParameters &parameters) const
 
 CaloHitResponse (const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
 
 CaloHitResponse (const CaloVSimParameterMap *parameterMap, const CaloShapes *shapes)
 
void clear ()
 frees up memory More...
 
CaloSamplesfindSignal (const DetId &detId)
 users can look for the signal for a given cell More...
 
void initHBHEScale ()
 
virtual bool keepBlank () const
 
virtual CaloSamples makeAnalogSignal (const PCaloHit &inputHit) const
 creates the signal corresponding to this hit More...
 
CaloSamples makeBlankSignal (const DetId &detId) const
 creates an empty signal for this DetId More...
 
int nSignals () const
 number of signals in the current cache More...
 
void setBunchRange (int minBunch, int maxBunch)
 tells it which pileup bunches to do More...
 
void setGeometry (const CaloGeometry *geometry)
 geometry needed for time-of-flight More...
 
void setHBHEScale (std::string &)
 
void setHitCorrection (const CaloVHitCorrection *hitCorrection)
 If you want to correct hits, for attenuation or delay, set this. More...
 
void setHitFilter (const CaloVHitFilter *filter)
 if you want to reject hits, for example, from a certain subdetector, set this More...
 
void setPECorrection (const CaloVPECorrection *peCorrection)
 if you want to correct the photoelectrons More...
 
void setPhaseShift (const double &thePhaseShift)
 setting the phase shift for asynchronous trigger (e.g. test beams) More...
 
double timeOfFlight (const DetId &detId) const
 
bool withinBunchRange (int bunchCrossing) const
 check if crossing is within bunch range: More...
 
virtual ~CaloHitResponse ()
 doesn't delete the pointers passed in More...
 

Static Public Member Functions

static double Y11TimePDF (double t)
 

Protected Types

typedef std::multiset
< PCaloHit,
PCaloHitCompareTimes
SortedHitSet
 

Protected Member Functions

virtual void differentiatePreciseSamples (CaloSamples &samples, double diffNorm=1.0) const
 
double generatePhotonTime () const
 
virtual CaloSamples makeSiPMSignal (const DetId &id, const PCaloHit &hit, int &integral) const
 
virtual CaloSamples makeSiPMSignal (DetId const &id, photonTimeHist const &photons) const
 

Private Attributes

photonTimeMap precisionTimedPhotons
 
float theDiffNorm
 
double theRecoveryTime
 
CLHEP::RandFlat * theRndFlat
 
HcalSiPMtheSiPM
 
HcalTDCParameters theTDCParams
 
int const TIMEMULT
 
float const Y11MAX
 
float const Y11RANGE
 
float const Y11TIMETORISE
 

Additional Inherited Members

- Protected Attributes inherited from CaloHitResponse
bool changeScale
 
float hcal_en_scale [100][72][4]
 
AnalogSignalMap theAnalogSignalMap
 
const CaloGeometrytheGeometry
 
const CaloVHitCorrectiontheHitCorrection
 
const CaloVHitFiltertheHitFilter
 
int theMaxBunch
 
int theMinBunch
 
const CaloVSimParameterMaptheParameterMap
 
const CaloVPECorrectionthePECorrection
 
double thePhaseShift_
 
CLHEP::RandPoissonQ * theRandPoisson
 
const CaloVShapetheShape
 
const CaloShapestheShapes
 

Detailed Description

Definition at line 25 of file HcalSiPMHitResponse.h.

Member Typedef Documentation

typedef std::vector<unsigned int> HcalSiPMHitResponse::photonTimeHist

Definition at line 33 of file HcalSiPMHitResponse.h.

Definition at line 34 of file HcalSiPMHitResponse.h.

Definition at line 53 of file HcalSiPMHitResponse.h.

Constructor & Destructor Documentation

HcalSiPMHitResponse::HcalSiPMHitResponse ( const CaloVSimParameterMap parameterMap,
const CaloShapes shapes 
)

Definition at line 16 of file HcalSiPMHitResponse.cc.

References theSiPM.

17  :
18  CaloHitResponse(parameterMap, shapes), theSiPM(), theRecoveryTime(250.),
19  TIMEMULT(1), Y11RANGE(80.), Y11MAX(0.04), Y11TIMETORISE(16.65),
20  theRndFlat(0) {
21  theSiPM = new HcalSiPM(2500);
22 }
A general implementation for the response of a SiPM.
Definition: HcalSiPM.h:20
CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
CLHEP::RandFlat * theRndFlat
HcalSiPMHitResponse::~HcalSiPMHitResponse ( )
virtual

Definition at line 24 of file HcalSiPMHitResponse.cc.

References theRndFlat, and theSiPM.

24  {
25  if (theSiPM)
26  delete theSiPM;
27  delete theRndFlat;
28 }
CLHEP::RandFlat * theRndFlat

Member Function Documentation

void HcalSiPMHitResponse::add ( const PCaloHit hit)
virtual

process a single SimHit

Reimplemented from CaloHitResponse.

Definition at line 67 of file HcalSiPMHitResponse.cc.

References CaloVHitFilter::accepts(), CaloHitResponse::analogSignalAmplitude(), CaloHitResponse::BUNCHSPACE, CaloVHitCorrection::delay(), HcalTDCParameters::deltaT(), PCaloHit::energy(), generatePhotonTime(), PCaloHit::id(), edm::isNotFinite(), LogDebug, HcalTDCParameters::nbins(), interactiveExample::photons, precisionTimedPhotons, CaloVSimParameterMap::simParameters(), findQualityFiles::size, CaloHitResponse::theHitCorrection, CaloHitResponse::theHitFilter, CaloHitResponse::theParameterMap, CaloHitResponse::thePhaseShift_, theTDCParams, PCaloHit::time(), cond::rpcobgas::time, TIMEMULT, CaloHitResponse::timeOfFlight(), tzero, and Y11TIMETORISE.

Referenced by finalizeHits(), and run().

67  {
68  if (!edm::isNotFinite(hit.time()) &&
69  ((theHitFilter == 0) || (theHitFilter->accepts(hit)))) {
70  HcalDetId id(hit.id());
71  const HcalSimParameters& pars = dynamic_cast<const HcalSimParameters&>(theParameterMap->simParameters(id));
72  double signal(analogSignalAmplitude(id, hit.energy(), pars));
73  unsigned int photons(signal + 0.5);
74  double time( hit.time() );
75 
76  if (photons > 0)
77  if (precisionTimedPhotons.find(id)==precisionTimedPhotons.end()) {
78  precisionTimedPhotons.insert(
79  std::pair<DetId, photonTimeHist >(id,
81  pars.readoutFrameSize(), 0)
82  )
83  );
84  }
85 
86  LogDebug("HcalSiPMHitResponse") << id;
87  LogDebug("HcalSiPMHitResponse") << " fCtoGeV: " << pars.fCtoGeV(id)
88  << " samplingFactor: " << pars.samplingFactor(id)
89  << " photoelectronsToAnalog: " << pars.photoelectronsToAnalog(id)
90  << " simHitToPhotoelectrons: " << pars.simHitToPhotoelectrons(id);
91  LogDebug("HcalSiPMHitResponse") << " energy: " << hit.energy()
92  << " photons: " << photons
93  << " time: " << time;
94  if (theHitCorrection != 0)
95  time += theHitCorrection->delay(hit);
96  LogDebug("HcalSiPMHitResponse") << " corrected time: " << time;
97  LogDebug("HcalSiPMHitResponse") << " timePhase: " << pars.timePhase()
98  << " tof: " << timeOfFlight(id)
99  << " binOfMaximum: " << pars.binOfMaximum()
100  << " phaseShift: " << thePhaseShift_;
101  double tzero(Y11TIMETORISE + pars.timePhase() -
102  (hit.time() - timeOfFlight(id)) -
103  BUNCHSPACE*( pars.binOfMaximum() - thePhaseShift_));
104  LogDebug("HcalSiPMHitResponse") << " tzero: " << tzero;
105  tzero += BUNCHSPACE*pars.binOfMaximum() + 72.31;
106  LogDebug("HcalSiPMHitResponse") << " corrected tzero: " << tzero << '\n';
107  double t_pe(0.);
108  int t_bin(0);
109  for (unsigned int pe(0); pe<photons; ++pe) {
110  t_pe = generatePhotonTime();
111  t_bin = int((t_pe + tzero)/(theTDCParams.deltaT()/TIMEMULT) + 0.5);
112  LogDebug("HcalSiPMHitResponse") << "t_pe: " << t_pe << " t_pe + tzero: " << (t_pe+tzero)
113  << " t_bin: " << t_bin << '\n';
114  if ((t_bin >= 0) &&
115  (static_cast<unsigned int>(t_bin) < precisionTimedPhotons[id].size()))
116  precisionTimedPhotons[id][t_bin] += 1;
117  }
118  }
119 }
#define LogDebug(id)
float deltaT() const
double time() const
Definition: PCaloHit.h:34
double energy() const
Definition: PCaloHit.h:29
virtual double delay(const PCaloHit &hit) const =0
bool isNotFinite(T x)
Definition: isFinite.h:10
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
virtual bool accepts(const PCaloHit &hit) const =0
unsigned int id() const
Definition: PCaloHit.h:41
double timeOfFlight(const DetId &detId) const
double generatePhotonTime() const
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters &parameters) const
const CaloVHitCorrection * theHitCorrection
HcalTDCParameters theTDCParams
std::vector< unsigned int > photonTimeHist
const CaloVSimParameterMap * theParameterMap
static const double tzero[3]
const CaloVHitFilter * theHitFilter
photonTimeMap precisionTimedPhotons
tuple size
Write out results.
void HcalSiPMHitResponse::add ( const CaloSamples signal)
virtual

Definition at line 57 of file HcalSiPMHitResponse.cc.

References CaloHitResponse::findSignal(), CaloSamples::id(), and CaloHitResponse::theAnalogSignalMap.

57  {
58  DetId id(signal.id());
59  CaloSamples * oldSignal = findSignal(id);
60  if (oldSignal == 0) {
61  theAnalogSignalMap[id] = signal;
62  } else {
63  (*oldSignal) += signal;
64  }
65 }
AnalogSignalMap theAnalogSignalMap
Definition: DetId.h:20
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
DetId id() const
get the (generic) id
Definition: CaloSamples.h:23
void HcalSiPMHitResponse::differentiatePreciseSamples ( CaloSamples samples,
double  diffNorm = 1.0 
) const
protectedvirtual

Definition at line 260 of file HcalSiPMHitResponse.cc.

References i, CaloSamples::preciseAtMod(), CaloSamples::preciseDeltaT(), and CaloSamples::preciseSize().

261  {
262  static double const invdt(1./samples.preciseDeltaT());
263  // double dy(0.);
264  for (int i(0); i < samples.preciseSize(); ++i) {
265  // dy = samples.preciseAt(i+1) - samples.preciseAt(i);
266  samples.preciseAtMod(i) *= invdt*diffNorm;
267  }
268 }
int i
Definition: DBlmapReader.cc:9
int preciseSize() const
get the size
Definition: CaloSamples.h:64
float preciseDeltaT() const
Definition: CaloSamples.h:66
float & preciseAtMod(int i)
mutable function to access precise samples
Definition: CaloSamples.h:33
void HcalSiPMHitResponse::finalizeHits ( )
virtual

Finalize hits.

Reimplemented from CaloHitResponse.

Definition at line 34 of file HcalSiPMHitResponse.cc.

References add(), i, CaloSamples::id(), keep, CaloHitResponse::keepBlank(), LogDebug, makeSiPMSignal(), precisionTimedPhotons, CaloSamples::size(), and findQualityFiles::size.

34  {
35 
36  photonTimeMap::iterator channelPhotons;
37  for (channelPhotons = precisionTimedPhotons.begin();
38  channelPhotons != precisionTimedPhotons.end();
39  ++channelPhotons) {
40  CaloSamples signal(makeSiPMSignal(channelPhotons->first,
41  channelPhotons->second));
42  bool keep( keepBlank() );
43  if (!keep) {
44  const unsigned int size ( signal.size() ) ;
45  if( 0 != size ) {
46  for( unsigned int i ( 0 ) ; i != size ; ++i ) {
47  keep = keep || signal[i] > 1.e-7 ;
48  }
49  }
50  }
51 
52  LogDebug("HcalSiPMHitResponse") << HcalDetId(signal.id()) << ' ' << signal;
53  if (keep) add(signal);
54  }
55 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
virtual bool keepBlank() const
const int keep
virtual void add(const PCaloHit &hit)
process a single SimHit
photonTimeMap precisionTimedPhotons
tuple size
Write out results.
virtual CaloSamples makeSiPMSignal(const DetId &id, const PCaloHit &hit, int &integral) const
double HcalSiPMHitResponse::generatePhotonTime ( ) const
protected

Definition at line 270 of file HcalSiPMHitResponse.cc.

References query::result, theRndFlat, Y11MAX, Y11RANGE, and Y11TimePDF().

Referenced by add().

270  {
271  double result(0.);
272  while (true) {
273  result = theRndFlat->fire(Y11RANGE);
274  if (theRndFlat->fire(Y11MAX) < Y11TimePDF(result))
275  return result;
276  }
277 }
static double Y11TimePDF(double t)
CLHEP::RandFlat * theRndFlat
tuple result
Definition: query.py:137
void HcalSiPMHitResponse::initializeHits ( )
virtual

Initialize hits.

Reimplemented from CaloHitResponse.

Definition at line 30 of file HcalSiPMHitResponse.cc.

References precisionTimedPhotons.

30  {
31  precisionTimedPhotons.clear();
32 }
photonTimeMap precisionTimedPhotons
CaloSamples HcalSiPMHitResponse::makeBlankSignal ( const DetId detId) const
virtual

Definition at line 161 of file HcalSiPMHitResponse.cc.

References CaloSimParameters::binOfMaximum(), HcalTDCParameters::deltaT(), HcalTDCParameters::nbins(), Parameters::parameters, CaloSimParameters::readoutFrameSize(), query::result, CaloVSimParameterMap::simParameters(), CaloHitResponse::theParameterMap, and theTDCParams.

Referenced by makeSiPMSignal().

161  {
163  int preciseSize(parameters.readoutFrameSize()*theTDCParams.nbins());
164  CaloSamples result(detId, parameters.readoutFrameSize(), preciseSize);
165  result.setPresamples(parameters.binOfMaximum()-1);
166  result.setPrecise(result.presamples()*theTDCParams.nbins(),
167  theTDCParams.deltaT());
168  return result;
169 }
dictionary parameters
Definition: Parameters.py:2
float deltaT() const
Main class for Parameters in different subdetectors.
tuple result
Definition: query.py:137
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
HcalTDCParameters theTDCParams
const CaloVSimParameterMap * theParameterMap
int binOfMaximum() const
CaloSamples HcalSiPMHitResponse::makeSiPMSignal ( const DetId id,
const PCaloHit hit,
int &  integral 
) const
protectedvirtual

Definition at line 171 of file HcalSiPMHitResponse.cc.

References CaloHitResponse::analogSignalAmplitude(), newFWLiteAna::bin, CaloSimParameters::binOfMaximum(), CaloHitResponse::BUNCHSPACE, CaloVHitCorrection::delay(), PCaloHit::energy(), HcalSiPM::hitCells(), makeBlankSignal(), interactiveExample::photons, HcalSimParameters::pixels(), query::result, HcalSiPM::setNCells(), PCaloHit::setTime(), CaloShapes::shape(), CaloVSimParameterMap::simParameters(), CaloSamples::size(), CaloHitResponse::theHitCorrection, CaloHitResponse::theParameterMap, CaloHitResponse::thePhaseShift_, CaloHitResponse::theShapes, theSiPM, PCaloHit::time(), CaloHitResponse::timeOfFlight(), CaloSimParameters::timePhase(), and tzero.

Referenced by finalizeHits(), and run().

173  {
174 
175  PCaloHit hit = inHit;
176  if (theHitCorrection != 0) {
177  hit.setTime(hit.time() + theHitCorrection->delay(hit));
178  }
179 
180  const HcalSimParameters& pars = dynamic_cast<const HcalSimParameters&>(theParameterMap->simParameters(id));
181  theSiPM->setNCells(pars.pixels());
182 
183  double signal = analogSignalAmplitude(id, hit.energy(), pars);
184  int photons = static_cast<int>(signal + 0.5);
185  int pixels = theSiPM->hitCells(photons, integral);
186  integral += pixels;
187  signal = double(pixels);
188 
190 
191  if(pixels > 0)
192  {
193  const CaloVShape * shape = theShapes->shape(id);
194  double jitter = hit.time() - timeOfFlight(id);
195 
196  const double tzero = pars.timePhase() - jitter -
198  double binTime = tzero;
199 
200  for (int bin = 0; bin < result.size(); bin++) {
201  result[bin] += (*shape)(binTime)*signal;
202  binTime += BUNCHSPACE;
203  }
204  }
205 
206  return result;
207 }
double time() const
Definition: PCaloHit.h:34
double energy() const
Definition: PCaloHit.h:29
Electronic response of the preamp.
Definition: CaloVShape.h:11
virtual double delay(const PCaloHit &hit) const =0
double timePhase() const
the adjustment you need to apply to get the signal where you want it
void setNCells(int nCells)
Definition: HcalSiPM.cc:136
tuple result
Definition: query.py:137
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
double timeOfFlight(const DetId &detId) const
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters &parameters) const
const CaloVHitCorrection * theHitCorrection
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:69
virtual CaloSamples makeBlankSignal(const DetId &detId) const
const CaloShapes * theShapes
const CaloVSimParameterMap * theParameterMap
virtual int hitCells(unsigned int photons, unsigned int integral=0) const
Definition: HcalSiPM.cc:24
void setTime(float t)
Definition: PCaloHit.h:55
static const double tzero[3]
int binOfMaximum() const
virtual const CaloVShape * shape(const DetId &detId) const
Definition: CaloShapes.h:15
CaloSamples HcalSiPMHitResponse::makeSiPMSignal ( DetId const &  id,
photonTimeHist const &  photons 
) const
protectedvirtual

Definition at line 209 of file HcalSiPMHitResponse.cc.

References HcalTDCParameters::deltaT(), dt, HcalSiPM::hitCells(), makeBlankSignal(), HcalTDCParameters::nbins(), HcalSimParameters::pixels(), CaloSamples::preciseAtMod(), CaloSamples::preciseSize(), CaloSamples::resetPrecise(), HcalSiPM::setNCells(), HcalSiPM::setTau(), CaloVSimParameterMap::simParameters(), CaloHitResponse::theParameterMap, theSiPM, theTDCParams, and TIMEMULT.

210  {
211  const HcalSimParameters& pars = dynamic_cast<const HcalSimParameters&>(theParameterMap->simParameters(id));
212  theSiPM->setNCells(pars.pixels());
213  theSiPM->setTau(5.);
214  //use to make signal
215  CaloSamples signal( makeBlankSignal(id) );
216  double const dt(theTDCParams.deltaT()/TIMEMULT);
217  double const invdt(1./theTDCParams.deltaT());
218  int sampleBin(0), preciseBin(0);
219  signal.resetPrecise();
220  unsigned int pe(0);
221  double hitPixels(0.), elapsedTime(0.);
222  unsigned int sumPE(0);
223  double sumHits(0.);
224  // std::cout << HcalDetId(id) << '\n';
225  for (unsigned int pt(0); pt < photons.size(); ++pt) {
226  pe = photons[pt];
227  sumPE += pe;
228  preciseBin = pt/TIMEMULT;
229  sampleBin = preciseBin/theTDCParams.nbins();
230  if (pe > 0) {
231  hitPixels = theSiPM->hitCells(pe, 0., elapsedTime);
232  signal[sampleBin] += hitPixels;
233  sumHits += hitPixels;
234  // std::cout << " elapsedTime: " << elapsedTime
235  // << " sampleBin: " << sampleBin
236  // << " preciseBin: " << preciseBin
237  // << " pe: " << pe
238  // << " hitPixels: " << hitPixels
239  // << '\n';
240  hitPixels *= invdt;
241  signal.preciseAtMod(preciseBin) += 0.6*hitPixels;
242  if (preciseBin > 0)
243  signal.preciseAtMod(preciseBin-1) += 0.2*hitPixels;
244  if (preciseBin < signal.preciseSize() -1)
245  signal.preciseAtMod(preciseBin+1) += 0.2*hitPixels;
246  }
247  // signal.preciseAtMod(preciseBin) += sumHits;
248  elapsedTime += dt;
249  }
250 
251  // differentiatePreciseSamples(signal, 1.);
252 
253  // std::cout << "sum pe: " << sumPE
254  // << " sum sipm pixels: " << sumHits
255  // << std::endl;
256 
257  return signal;
258 }
float dt
Definition: AMPTWrapper.h:126
float deltaT() const
void setNCells(int nCells)
Definition: HcalSiPM.cc:136
void setTau(double tau)
Definition: HcalSiPM.h:42
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
HcalTDCParameters theTDCParams
virtual CaloSamples makeBlankSignal(const DetId &detId) const
const CaloVSimParameterMap * theParameterMap
virtual int hitCells(unsigned int photons, unsigned int integral=0) const
Definition: HcalSiPM.cc:24
void HcalSiPMHitResponse::run ( MixCollection< PCaloHit > &  hits)
virtual

Complete cell digitization.

Reimplemented from CaloHitResponse.

Definition at line 121 of file HcalSiPMHitResponse.cc.

References CaloVHitFilter::accepts(), add(), HcalSiPMRecovery::addToHistory(), MixCollection< T >::begin(), HcalSiPMRecovery::clearHistory(), MixCollection< T >::end(), HcalSiPMRecovery::getIntegral(), i, edm::isNotFinite(), makeSiPMSignal(), CaloHitResponse::theHitFilter, CaloHitResponse::theMaxBunch, CaloHitResponse::theMinBunch, theRecoveryTime, and PCaloHit::time().

121  {
122  typedef std::multiset <const PCaloHit *, PCaloHitCompareTimes> SortedHitSet;
123 
124  std::map< DetId, SortedHitSet > sortedhits;
125  for (MixCollection<PCaloHit>::MixItr hitItr = hits.begin();
126  hitItr != hits.end(); ++hitItr) {
127  if (!((hitItr.bunch() < theMinBunch) || (hitItr.bunch() > theMaxBunch)) &&
128  !(edm::isNotFinite(hitItr->time())) &&
129  ((theHitFilter == 0) || (theHitFilter->accepts(*hitItr)))) {
130  DetId id(hitItr->id());
131  if (sortedhits.find(id)==sortedhits.end())
132  sortedhits.insert(std::pair<DetId, SortedHitSet>(id, SortedHitSet()));
133  sortedhits[id].insert(&(*hitItr));
134  }
135  }
136  int pixelIntegral, oldIntegral;
137  HcalSiPMRecovery pixelHistory(theRecoveryTime);
138  for (std::map<DetId, SortedHitSet>::iterator i = sortedhits.begin();
139  i!=sortedhits.end(); ++i) {
140  pixelHistory.clearHistory();
141  for (SortedHitSet::iterator itr = i->second.begin();
142  itr != i->second.end(); ++itr) {
143  const PCaloHit& hit = **itr;
144  pixelIntegral = pixelHistory.getIntegral(hit.time());
145  oldIntegral = pixelIntegral;
146  CaloSamples signal(makeSiPMSignal(i->first, hit, pixelIntegral));
147  pixelHistory.addToHistory(hit.time(), pixelIntegral-oldIntegral);
148  add(signal);
149  }
150  }
151 }
int i
Definition: DBlmapReader.cc:9
double time() const
Definition: PCaloHit.h:34
std::multiset< PCaloHit, PCaloHitCompareTimes > SortedHitSet
iterator end()
bool isNotFinite(T x)
Definition: isFinite.h:10
virtual bool accepts(const PCaloHit &hit) const =0
Definition: DetId.h:20
iterator begin()
virtual void add(const PCaloHit &hit)
process a single SimHit
const CaloVHitFilter * theHitFilter
virtual CaloSamples makeSiPMSignal(const DetId &id, const PCaloHit &hit, int &integral) const
void HcalSiPMHitResponse::setRandomEngine ( CLHEP::HepRandomEngine &  engine)
virtual

Reimplemented from CaloHitResponse.

Definition at line 154 of file HcalSiPMHitResponse.cc.

References HcalSiPM::initRandomEngine(), CaloHitResponse::setRandomEngine(), theRndFlat, and theSiPM.

155 {
156  theSiPM->initRandomEngine(engine);
158  theRndFlat = new CLHEP::RandFlat(engine);
159 }
CLHEP::RandFlat * theRndFlat
void initRandomEngine(CLHEP::HepRandomEngine &engine)
Definition: HcalSiPM.cc:159
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
double HcalSiPMHitResponse::Y11TimePDF ( double  t)
static

Definition at line 279 of file HcalSiPMHitResponse.cc.

References create_public_lumi_plots::exp, and funct::pow().

Referenced by generatePhotonTime().

279  {
280  return exp(-0.0635-0.1518*t)*pow(t, 2.528)/2485.9;
281 }
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

photonTimeMap HcalSiPMHitResponse::precisionTimedPhotons
private

Definition at line 72 of file HcalSiPMHitResponse.h.

Referenced by add(), finalizeHits(), and initializeHits().

float HcalSiPMHitResponse::theDiffNorm
private

Definition at line 70 of file HcalSiPMHitResponse.h.

double HcalSiPMHitResponse::theRecoveryTime
private

Definition at line 65 of file HcalSiPMHitResponse.h.

Referenced by run().

CLHEP::RandFlat* HcalSiPMHitResponse::theRndFlat
private

Definition at line 75 of file HcalSiPMHitResponse.h.

Referenced by generatePhotonTime(), setRandomEngine(), and ~HcalSiPMHitResponse().

HcalSiPM* HcalSiPMHitResponse::theSiPM
private
HcalTDCParameters HcalSiPMHitResponse::theTDCParams
private

Definition at line 73 of file HcalSiPMHitResponse.h.

Referenced by add(), makeBlankSignal(), and makeSiPMSignal().

int const HcalSiPMHitResponse::TIMEMULT
private

Definition at line 66 of file HcalSiPMHitResponse.h.

Referenced by add(), and makeSiPMSignal().

float const HcalSiPMHitResponse::Y11MAX
private

Definition at line 68 of file HcalSiPMHitResponse.h.

Referenced by generatePhotonTime().

float const HcalSiPMHitResponse::Y11RANGE
private

Definition at line 67 of file HcalSiPMHitResponse.h.

Referenced by generatePhotonTime().

float const HcalSiPMHitResponse::Y11TIMETORISE
private

Definition at line 69 of file HcalSiPMHitResponse.h.

Referenced by add().