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 18 of file HcalSiPMHitResponse.cc.

References theSiPM.

19  :
20  CaloHitResponse(parameterMap, shapes), theSiPM(), theRecoveryTime(250.),
21  TIMEMULT(1), Y11RANGE(80.), Y11MAX(0.04), Y11TIMETORISE(16.65),
22  theRndFlat(0) {
23  theSiPM = new HcalSiPM(2500);
24 }
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 26 of file HcalSiPMHitResponse.cc.

References theRndFlat, and theSiPM.

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

Member Function Documentation

void HcalSiPMHitResponse::add ( const PCaloHit hit)
virtual

process a single SimHit

Reimplemented from CaloHitResponse.

Definition at line 70 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().

70  {
71  if (!edm::isNotFinite(hit.time()) &&
72  ((theHitFilter == 0) || (theHitFilter->accepts(hit)))) {
73  HcalDetId id(hit.id());
74  const HcalSimParameters& pars = dynamic_cast<const HcalSimParameters&>(theParameterMap->simParameters(id));
75  double signal(analogSignalAmplitude(id, hit.energy(), pars));
76  unsigned int photons(signal + 0.5);
77  double time( hit.time() );
78 
79  if (photons > 0)
80  if (precisionTimedPhotons.find(id)==precisionTimedPhotons.end()) {
81  precisionTimedPhotons.insert(
82  std::pair<DetId, photonTimeHist >(id,
84  pars.readoutFrameSize(), 0)
85  )
86  );
87  }
88 
89  LogDebug("HcalSiPMHitResponse") << id;
90  LogDebug("HcalSiPMHitResponse") << " fCtoGeV: " << pars.fCtoGeV(id)
91  << " samplingFactor: " << pars.samplingFactor(id)
92  << " photoelectronsToAnalog: " << pars.photoelectronsToAnalog(id)
93  << " simHitToPhotoelectrons: " << pars.simHitToPhotoelectrons(id);
94  LogDebug("HcalSiPMHitResponse") << " energy: " << hit.energy()
95  << " photons: " << photons
96  << " time: " << time;
97  if (theHitCorrection != 0)
98  time += theHitCorrection->delay(hit);
99  LogDebug("HcalSiPMHitResponse") << " corrected time: " << time;
100  LogDebug("HcalSiPMHitResponse") << " timePhase: " << pars.timePhase()
101  << " tof: " << timeOfFlight(id)
102  << " binOfMaximum: " << pars.binOfMaximum()
103  << " phaseShift: " << thePhaseShift_;
104  double tzero(Y11TIMETORISE + pars.timePhase() -
105  (hit.time() - timeOfFlight(id)) -
106  BUNCHSPACE*( pars.binOfMaximum() - thePhaseShift_));
107  LogDebug("HcalSiPMHitResponse") << " tzero: " << tzero;
108  // tzero += BUNCHSPACE*pars.binOfMaximum() + 75.;
109  //move it back 25ns to bin 4
110  tzero += BUNCHSPACE*pars.binOfMaximum() + 50.;
111  LogDebug("HcalSiPMHitResponse") << " corrected tzero: " << tzero << '\n';
112  double t_pe(0.);
113  int t_bin(0);
114  for (unsigned int pe(0); pe<photons; ++pe) {
115  t_pe = generatePhotonTime();
116  t_bin = int((t_pe + tzero)/(theTDCParams.deltaT()/TIMEMULT) + 0.5);
117  LogDebug("HcalSiPMHitResponse") << "t_pe: " << t_pe << " t_pe + tzero: " << (t_pe+tzero)
118  << " t_bin: " << t_bin << '\n';
119  if ((t_bin >= 0) &&
120  (static_cast<unsigned int>(t_bin) < precisionTimedPhotons[id].size()))
121  precisionTimedPhotons[id][t_bin] += 1;
122  }
123  }
124 }
#define LogDebug(id)
float deltaT() const
double time() const
Definition: PCaloHit.h:36
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:43
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 60 of file HcalSiPMHitResponse.cc.

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

60  {
61  DetId id(signal.id());
62  CaloSamples * oldSignal = findSignal(id);
63  if (oldSignal == 0) {
64  theAnalogSignalMap[id] = signal;
65  } else {
66  (*oldSignal) += signal;
67  }
68 }
AnalogSignalMap theAnalogSignalMap
Definition: DetId.h:18
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:21
void HcalSiPMHitResponse::differentiatePreciseSamples ( CaloSamples samples,
double  diffNorm = 1.0 
) const
protectedvirtual

Definition at line 293 of file HcalSiPMHitResponse.cc.

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

294  {
295  static double const invdt(1./samples.preciseDeltaT());
296  // double dy(0.);
297  for (int i(0); i < samples.preciseSize(); ++i) {
298  // dy = samples.preciseAt(i+1) - samples.preciseAt(i);
299  samples.preciseAtMod(i) *= invdt*diffNorm;
300  }
301 }
int i
Definition: DBlmapReader.cc:9
int preciseSize() const
get the size
Definition: CaloSamples.h:62
float preciseDeltaT() const
Definition: CaloSamples.h:64
float & preciseAtMod(int i)
mutable function to access precise samples
Definition: CaloSamples.h:31
void HcalSiPMHitResponse::finalizeHits ( )
virtual

Finalize hits.

Reimplemented from CaloHitResponse.

Definition at line 36 of file HcalSiPMHitResponse.cc.

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

36  {
37 
38  photonTimeMap::iterator channelPhotons;
39  for (channelPhotons = precisionTimedPhotons.begin();
40  channelPhotons != precisionTimedPhotons.end();
41  ++channelPhotons) {
42  CaloSamples signal(makeSiPMSignal(channelPhotons->first,
43  channelPhotons->second));
44  bool keep( keepBlank() );
45  if (!keep) {
46  const unsigned int size ( signal.size() ) ;
47  if( 0 != size ) {
48  for( unsigned int i ( 0 ) ; i != size ; ++i ) {
49  keep = keep || signal[i] > 1.e-7 ;
50  }
51  }
52  }
53 
54  LogDebug("HcalSiPMHitResponse") << HcalDetId(signal.id()) << ' ' << signal;
55  // std::cout << HcalDetId(signal.id()) << ' ' << signal;
56  if (keep) add(signal);
57  }
58 }
#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 303 of file HcalSiPMHitResponse.cc.

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

Referenced by add().

303  {
304  double result(0.);
305  while (true) {
306  result = theRndFlat->fire(Y11RANGE);
307  if (theRndFlat->fire(Y11MAX) < Y11TimePDF(result))
308  return result;
309  }
310 }
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 32 of file HcalSiPMHitResponse.cc.

References precisionTimedPhotons.

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

Definition at line 166 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().

166  {
168  int preciseSize(parameters.readoutFrameSize()*theTDCParams.nbins());
169  CaloSamples result(detId, parameters.readoutFrameSize(), preciseSize);
170  result.setPresamples(parameters.binOfMaximum()-1);
171  result.setPrecise(result.presamples()*theTDCParams.nbins(),
172  theTDCParams.deltaT());
173  return result;
174 }
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 176 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().

178  {
179 
180  PCaloHit hit = inHit;
181  if (theHitCorrection != 0) {
182  hit.setTime(hit.time() + theHitCorrection->delay(hit));
183  }
184 
185  const HcalSimParameters& pars = dynamic_cast<const HcalSimParameters&>(theParameterMap->simParameters(id));
186  theSiPM->setNCells(pars.pixels());
187 
188  double signal = analogSignalAmplitude(id, hit.energy(), pars);
189  int photons = static_cast<int>(signal + 0.5);
190  int pixels = theSiPM->hitCells(photons, integral);
191  integral += pixels;
192  signal = double(pixels);
193 
195 
196  if(pixels > 0)
197  {
198  const CaloVShape * shape = theShapes->shape(id);
199  double jitter = hit.time() - timeOfFlight(id);
200 
201  const double tzero = pars.timePhase() - jitter -
203  double binTime = tzero;
204 
205  for (int bin = 0; bin < result.size(); bin++) {
206  result[bin] += (*shape)(binTime)*signal;
207  binTime += BUNCHSPACE;
208  }
209  }
210 
211  return result;
212 }
double time() const
Definition: PCaloHit.h:36
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:57
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 214 of file HcalSiPMHitResponse.cc.

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

215  {
216  const HcalSimParameters& pars = dynamic_cast<const HcalSimParameters&>(theParameterMap->simParameters(id));
217  theSiPM->setNCells(pars.pixels());
218  theSiPM->setTau(5.);
219  //use to make signal
220  CaloSamples signal( makeBlankSignal(id) );
221  double const dt(theTDCParams.deltaT()/TIMEMULT);
222  double const invdt(1./theTDCParams.deltaT());
223  int sampleBin(0), preciseBin(0);
224  signal.resetPrecise();
225  unsigned int pe(0);
226  double hitPixels(0.), elapsedTime(0.);
227  unsigned int sumPE(0);
228  double sumHits(0.);
229 
230  HcalSiPMShape sipmPulseShape;
231 
232  std::list< std::pair<double, double> > pulses;
233  std::list< std::pair<double, double> >::iterator pulse;
234  double timeDiff, pulseBit;
235  // std::cout << HcalDetId(id) << '\n';
236  for (unsigned int pt(0); pt < photons.size(); ++pt) {
237  pe = photons[pt];
238  sumPE += pe;
239  preciseBin = pt/TIMEMULT;
240  sampleBin = preciseBin/theTDCParams.nbins();
241  if (pe > 0) {
242  hitPixels = theSiPM->hitCells(pe, 0., elapsedTime);
243  sumHits += hitPixels;
244  // std::cout << " elapsedTime: " << elapsedTime
245  // << " sampleBin: " << sampleBin
246  // << " preciseBin: " << preciseBin
247  // << " pe: " << pe
248  // << " hitPixels: " << hitPixels
249  // << '\n';
250  if (pars.doSiPMSmearing()) {
251  pulses.push_back( std::pair<double, double>(elapsedTime, hitPixels) );
252  } else {
253  signal[sampleBin] += hitPixels;
254  hitPixels *= invdt;
255  signal.preciseAtMod(preciseBin) += 0.6*hitPixels;
256  if (preciseBin > 0)
257  signal.preciseAtMod(preciseBin-1) += 0.2*hitPixels;
258  if (preciseBin < signal.preciseSize() -1)
259  signal.preciseAtMod(preciseBin+1) += 0.2*hitPixels;
260  }
261  }
262 
263  if (pars.doSiPMSmearing()) {
264  pulse = pulses.begin();
265  while (pulse != pulses.end()) {
266  timeDiff = elapsedTime - pulse->first;
267  pulseBit = sipmPulseShape(timeDiff)*pulse->second;
268  // std::cout << "pulse t: " << pulse->first
269  // << " pulse A: " << pulse->second
270  // << " timeDiff: " << timeDiff
271  // << " pulseBit: " << pulseBit
272  // << '\n';
273  signal[sampleBin] += pulseBit;
274  signal.preciseAtMod(preciseBin) += pulseBit*invdt;
275  if (sipmPulseShape(timeDiff) < 1e-6)
276  pulse = pulses.erase(pulse);
277  else
278  ++pulse;
279  }
280  }
281  elapsedTime += dt;
282  }
283 
284  // differentiatePreciseSamples(signal, 1.);
285 
286  // std::cout << "sum pe: " << sumPE
287  // << " sum sipm pixels: " << sumHits
288  // << std::endl;
289 
290  return signal;
291 }
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
bool doSiPMSmearing() const
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 126 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().

126  {
127  typedef std::multiset <const PCaloHit *, PCaloHitCompareTimes> SortedHitSet;
128 
129  std::map< DetId, SortedHitSet > sortedhits;
130  for (MixCollection<PCaloHit>::MixItr hitItr = hits.begin();
131  hitItr != hits.end(); ++hitItr) {
132  if (!((hitItr.bunch() < theMinBunch) || (hitItr.bunch() > theMaxBunch)) &&
133  !(edm::isNotFinite(hitItr->time())) &&
134  ((theHitFilter == 0) || (theHitFilter->accepts(*hitItr)))) {
135  DetId id(hitItr->id());
136  if (sortedhits.find(id)==sortedhits.end())
137  sortedhits.insert(std::pair<DetId, SortedHitSet>(id, SortedHitSet()));
138  sortedhits[id].insert(&(*hitItr));
139  }
140  }
141  int pixelIntegral, oldIntegral;
142  HcalSiPMRecovery pixelHistory(theRecoveryTime);
143  for (std::map<DetId, SortedHitSet>::iterator i = sortedhits.begin();
144  i!=sortedhits.end(); ++i) {
145  pixelHistory.clearHistory();
146  for (SortedHitSet::iterator itr = i->second.begin();
147  itr != i->second.end(); ++itr) {
148  const PCaloHit& hit = **itr;
149  pixelIntegral = pixelHistory.getIntegral(hit.time());
150  oldIntegral = pixelIntegral;
151  CaloSamples signal(makeSiPMSignal(i->first, hit, pixelIntegral));
152  pixelHistory.addToHistory(hit.time(), pixelIntegral-oldIntegral);
153  add(signal);
154  }
155  }
156 }
int i
Definition: DBlmapReader.cc:9
double time() const
Definition: PCaloHit.h:36
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:18
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 159 of file HcalSiPMHitResponse.cc.

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

160 {
161  theSiPM->initRandomEngine(engine);
163  theRndFlat = new CLHEP::RandFlat(engine);
164 }
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 312 of file HcalSiPMHitResponse.cc.

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

Referenced by generatePhotonTime().

312  {
313  return exp(-0.0635-0.1518*t)*pow(t, 2.528)/2485.9;
314 }
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().