test
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, CLHEP::HepRandomEngine *) override
 process a single SimHit More...
 
virtual void add (const CaloSamples &signal)
 
virtual void finalizeHits (CLHEP::HepRandomEngine *) override
 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, CLHEP::HepRandomEngine *) override
 Complete cell digitization. More...
 
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, CLHEP::HepRandomEngine *) 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, CLHEP::HepRandomEngine *) 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 (CLHEP::HepRandomEngine *) const
 
virtual CaloSamples makeSiPMSignal (const DetId &id, const PCaloHit &hit, int &integral, CLHEP::HepRandomEngine *) const
 
virtual CaloSamples makeSiPMSignal (DetId const &id, photonTimeHist const &photons, CLHEP::HepRandomEngine *) const
 

Private Attributes

photonTimeMap precisionTimedPhotons
 
float theDiffNorm
 
double theRecoveryTime
 
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_
 
const CaloVShapetheShape
 
const CaloShapestheShapes
 

Detailed Description

Definition at line 27 of file HcalSiPMHitResponse.h.

Member Typedef Documentation

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

Definition at line 35 of file HcalSiPMHitResponse.h.

Definition at line 36 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 20 of file HcalSiPMHitResponse.cc.

References theSiPM.

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

Definition at line 27 of file HcalSiPMHitResponse.cc.

References theSiPM.

27  {
28  if (theSiPM)
29  delete theSiPM;
30 }

Member Function Documentation

void HcalSiPMHitResponse::add ( const PCaloHit hit,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

process a single SimHit

Reimplemented from CaloHitResponse.

Definition at line 71 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(), TIMEMULT, CaloHitResponse::timeOfFlight(), tzero, and Y11TIMETORISE.

Referenced by finalizeHits(), counter.Counter::register(), and run().

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

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

Referenced by counter.Counter::register().

61  {
62  DetId id(signal.id());
63  CaloSamples * oldSignal = findSignal(id);
64  if (oldSignal == 0) {
65  theAnalogSignalMap[id] = signal;
66  } else {
67  (*oldSignal) += signal;
68  }
69 }
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 288 of file HcalSiPMHitResponse.cc.

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

289  {
290  static double const invdt(1./samples.preciseDeltaT());
291  // double dy(0.);
292  for (int i(0); i < samples.preciseSize(); ++i) {
293  // dy = samples.preciseAt(i+1) - samples.preciseAt(i);
294  samples.preciseAtMod(i) *= invdt*diffNorm;
295  }
296 }
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 ( CLHEP::HepRandomEngine *  )
overridevirtual

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  engine));
45  bool keep( keepBlank() );
46  if (!keep) {
47  const unsigned int size ( signal.size() ) ;
48  if( 0 != size ) {
49  for( unsigned int i ( 0 ) ; i != size ; ++i ) {
50  keep = keep || signal[i] > 1.e-7 ;
51  }
52  }
53  }
54 
55  LogDebug("HcalSiPMHitResponse") << HcalDetId(signal.id()) << ' ' << signal;
56  // std::cout << HcalDetId(signal.id()) << ' ' << signal;
57  if (keep) add(signal);
58  }
59 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
virtual CaloSamples makeSiPMSignal(const DetId &id, const PCaloHit &hit, int &integral, CLHEP::HepRandomEngine *) const
virtual bool keepBlank() const
const int keep
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *) override
process a single SimHit
photonTimeMap precisionTimedPhotons
tuple size
Write out results.
double HcalSiPMHitResponse::generatePhotonTime ( CLHEP::HepRandomEngine *  engine) const
protected

Definition at line 298 of file HcalSiPMHitResponse.cc.

References mps_fire::result, Y11MAX, Y11RANGE, and Y11TimePDF().

Referenced by add().

298  {
299  double result(0.);
300  while (true) {
301  result = CLHEP::RandFlat::shoot(engine, Y11RANGE);
302  if (CLHEP::RandFlat::shoot(engine, Y11MAX) < Y11TimePDF(result))
303  return result;
304  }
305 }
static double Y11TimePDF(double t)
tuple result
Definition: mps_fire.py:84
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 159 of file HcalSiPMHitResponse.cc.

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

Referenced by makeSiPMSignal().

159  {
161  int preciseSize(parameters.readoutFrameSize()*theTDCParams.nbins());
162  CaloSamples result(detId, parameters.readoutFrameSize(), preciseSize);
163  result.setPresamples(parameters.binOfMaximum()-1);
164  result.setPrecise(result.presamples()*theTDCParams.nbins(),
165  theTDCParams.deltaT());
166  return result;
167 }
float deltaT() const
Main class for Parameters in different subdetectors.
tuple result
Definition: mps_fire.py:84
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,
CLHEP::HepRandomEngine *  engine 
) const
protectedvirtual

Definition at line 169 of file HcalSiPMHitResponse.cc.

References CaloHitResponse::analogSignalAmplitude(), newFWLiteAna::bin, CaloSimParameters::binOfMaximum(), CaloHitResponse::BUNCHSPACE, CaloVHitCorrection::delay(), PCaloHit::energy(), HcalSiPM::hitCells(), makeBlankSignal(), interactiveExample::photons, HcalSimParameters::pixels(), mps_fire::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().

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

Definition at line 208 of file HcalSiPMHitResponse.cc.

References HcalTDCParameters::deltaT(), HcalSimParameters::doSiPMSmearing(), dt, alignCSCRings::e, HcalSiPM::hitCells(), makeBlankSignal(), HcalTDCParameters::nbins(), HcalSimParameters::pixels(), CaloSamples::preciseAtMod(), CaloSamples::preciseSize(), EnergyCorrector::pt, 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 
225  HcalSiPMShape sipmPulseShape;
226 
227  std::list< std::pair<double, double> > pulses;
228  std::list< std::pair<double, double> >::iterator pulse;
229  double timeDiff, pulseBit;
230  // std::cout << HcalDetId(id) << '\n';
231  for (unsigned int pt(0); pt < photons.size(); ++pt) {
232  pe = photons[pt];
233  sumPE += pe;
234  preciseBin = pt/TIMEMULT;
235  sampleBin = preciseBin/theTDCParams.nbins();
236  if (pe > 0) {
237  hitPixels = theSiPM->hitCells(engine, pe, 0., elapsedTime);
238  sumHits += hitPixels;
239  // std::cout << " elapsedTime: " << elapsedTime
240  // << " sampleBin: " << sampleBin
241  // << " preciseBin: " << preciseBin
242  // << " pe: " << pe
243  // << " hitPixels: " << hitPixels
244  // << '\n';
245  if (pars.doSiPMSmearing()) {
246  pulses.push_back( std::pair<double, double>(elapsedTime, hitPixels) );
247  } else {
248  signal[sampleBin] += hitPixels;
249  hitPixels *= invdt;
250  signal.preciseAtMod(preciseBin) += 0.6*hitPixels;
251  if (preciseBin > 0)
252  signal.preciseAtMod(preciseBin-1) += 0.2*hitPixels;
253  if (preciseBin < signal.preciseSize() -1)
254  signal.preciseAtMod(preciseBin+1) += 0.2*hitPixels;
255  }
256  }
257 
258  if (pars.doSiPMSmearing()) {
259  pulse = pulses.begin();
260  while (pulse != pulses.end()) {
261  timeDiff = elapsedTime - pulse->first;
262  pulseBit = sipmPulseShape(timeDiff)*pulse->second;
263  // std::cout << "pulse t: " << pulse->first
264  // << " pulse A: " << pulse->second
265  // << " timeDiff: " << timeDiff
266  // << " pulseBit: " << pulseBit
267  // << '\n';
268  signal[sampleBin] += pulseBit;
269  signal.preciseAtMod(preciseBin) += pulseBit*invdt;
270  if (sipmPulseShape(timeDiff) < 1e-6)
271  pulse = pulses.erase(pulse);
272  else
273  ++pulse;
274  }
275  }
276  elapsedTime += dt;
277  }
278 
279  // differentiatePreciseSamples(signal, 1.);
280 
281  // std::cout << "sum pe: " << sumPE
282  // << " sum sipm pixels: " << sumHits
283  // << std::endl;
284 
285  return signal;
286 }
float dt
Definition: AMPTWrapper.h:126
float deltaT() const
void setNCells(int nCells)
Definition: HcalSiPM.cc:105
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(CLHEP::HepRandomEngine *, unsigned int photons, unsigned int integral=0) const
Definition: HcalSiPM.cc:23
void HcalSiPMHitResponse::run ( MixCollection< PCaloHit > &  hits,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Complete cell digitization.

Reimplemented from CaloHitResponse.

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

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

Definition at line 307 of file HcalSiPMHitResponse.cc.

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

Referenced by generatePhotonTime().

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

HcalSiPM* HcalSiPMHitResponse::theSiPM
private

Definition at line 64 of file HcalSiPMHitResponse.h.

Referenced by HcalSiPMHitResponse(), makeSiPMSignal(), and ~HcalSiPMHitResponse().

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().