CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
EBHitResponse Class Reference

#include <EBHitResponse.h>

Inheritance diagram for EBHitResponse:
EcalHitResponse

Public Types

enum  { kNOffsets = 2000 }
 
typedef CaloTSamples< float, 10 > EBSamples
 
typedef std::vector< double > VecD
 
- Public Types inherited from EcalHitResponse
enum  { BUNCHSPACE = 25 }
 
typedef std::unordered_map< uint32_t, double > CalibCache
 
typedef CaloTSamplesBase< float > EcalSamples
 
typedef std::vector< unsigned int > VecInd
 

Public Member Functions

void add (const PCaloHit &hit, CLHEP::HepRandomEngine *) override
 
 EBHitResponse (const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool apdOnly, const APDSimParameters *apdPars, const CaloVShape *apdShape)
 
void finalizeHits () override
 
void initialize (CLHEP::HepRandomEngine *)
 
void initializeHits () override
 
virtual bool keepBlank () const
 
EcalSamplesoperator[] (unsigned int i) override
 
const EcalSamplesoperator[] (unsigned int i) const override
 
void run (MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *) override
 
unsigned int samplesSize () const override
 
void setIntercal (const EcalIntercalibConstantsMC *ical)
 
 ~EBHitResponse () override
 
- Public Member Functions inherited from EcalHitResponse
void add (const EcalSamples *pSam)
 
virtual void add (const CaloSamples &hit)
 
 EcalHitResponse (const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
 
const EcalSamplesfindDetId (const DetId &detId) const
 
void setBunchRange (int minBunch, int maxBunch)
 
void setEventTime (const edm::TimeValue_t &iTime)
 
void setGeometry (const CaloSubdetectorGeometry *geometry)
 
void setHitCorrection (const CaloVHitCorrection *hitCorrection)
 
void setHitFilter (const CaloVHitFilter *filter)
 
void setLaserConstants (const EcalLaserDbService *laser, bool &useLCcorrection)
 
void setPECorrection (const CaloVPECorrection *peCorrection)
 
void setPhaseShift (double phaseShift)
 
bool withinBunchRange (int bunchCrossing) const
 
virtual ~EcalHitResponse ()
 

Protected Member Functions

void putAPDSignal (const DetId &detId, double npe, double time)
 
unsigned int samplesSizeAll () const override
 
EcalSamplesvSam (unsigned int i) override
 
EcalSamplesvSamAll (unsigned int i) override
 
const EcalSamplesvSamAll (unsigned int i) const override
 
- Protected Member Functions inherited from EcalHitResponse
double analogSignalAmplitude (const DetId &id, double energy, CLHEP::HepRandomEngine *)
 
void blankOutUsedSamples ()
 
double findLaserConstant (const DetId &detId) const
 
EcalSamplesfindSignal (const DetId &detId)
 
const CaloSubdetectorGeometrygeometry () const
 
const CaloVHitFilterhitFilter () const
 
VecIndindex ()
 
const VecIndindex () const
 
int maxBunch () const
 
int minBunch () const
 
const CaloSimParametersparams (const DetId &detId) const
 
double phaseShift () const
 
virtual void putAnalogSignal (const PCaloHit &inputHit, CLHEP::HepRandomEngine *)
 
const CaloVShapeshape () const
 
double timeOfFlight (const DetId &detId) const
 

Private Member Functions

const APDSimParametersapdParameters () const
 
const CaloVShapeapdShape () const
 
double apdSignalAmplitude (const PCaloHit &hit, CLHEP::HepRandomEngine *) const
 
void findIntercalibConstant (const DetId &detId, double &icalconst) const
 
const double nonlFunc (double enr) const
 
const double nonlFunc1 (double energy) const
 
const VecDoffsets () const
 

Private Attributes

std::vector< double > m_apdNpeVec
 
const bool m_apdOnly
 
const APDSimParametersm_apdPars
 
const CaloVShapem_apdShape
 
std::vector< double > m_apdTimeVec
 
const EcalIntercalibConstantsMCm_intercal
 
bool m_isInitialized
 
std::vector< double > m_timeOffVec
 
std::vector< EBSamplesm_vSam
 
const double pasy
 
const double pcon
 
const double pcub
 
const double pehi
 
const double pelo
 
const double pext
 
const double pfac
 
const double plin
 
const double poff
 
const double pqua
 

Detailed Description

Definition at line 14 of file EBHitResponse.h.

Member Typedef Documentation

Definition at line 16 of file EBHitResponse.h.

typedef std::vector<double> EBHitResponse::VecD

Definition at line 18 of file EBHitResponse.h.

Member Enumeration Documentation

anonymous enum
Enumerator
kNOffsets 

Definition at line 20 of file EBHitResponse.h.

Constructor & Destructor Documentation

EBHitResponse::EBHitResponse ( const CaloVSimParameterMap parameterMap,
const CaloVShape shape,
bool  apdOnly,
const APDSimParameters apdPars = 0,
const CaloVShape apdShape = 0 
)

Definition at line 15 of file EBHitResponse.cc.

References DetId::det(), EBDetId::detIdFromDenseIndex(), mps_fire::i, EBDetId::kSizeForDenseIndexing, m_vSam, CaloVSimParameterMap::simParameters(), findQualityFiles::size, and DetId::subdetId().

20  :
21 
22  EcalHitResponse(parameterMap, shape),
23 
24  m_apdOnly(apdOnly),
25  m_apdPars(apdPars),
26  m_apdShape(apdShape),
28  pcub(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[0]),
29  pqua(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[1]),
30  plin(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[2]),
31  pcon(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[3]),
32  pelo(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[4]),
33  pehi(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[5]),
34  pasy(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[6]),
35  pext(nullptr == apdPars ? 0 : nonlFunc1(pelo)),
36  poff(nullptr == apdPars ? 0 : nonlFunc1(pehi)),
37  pfac(nullptr == apdPars ? 0 : (pasy - poff) * 2. / M_PI),
38  m_isInitialized(false) {
39  const EBDetId detId(EBDetId::detIdFromDenseIndex(0));
40  const CaloSimParameters& parameters(parameterMap->simParameters(detId));
41 
42  const unsigned int rSize(parameters.readoutFrameSize());
43  const unsigned int nPre(parameters.binOfMaximum() - 1);
44 
45  const unsigned int size(EBDetId::kSizeForDenseIndexing);
46 
47  m_vSam.reserve(size);
48 
49  for (unsigned int i(0); i != size; ++i) {
50  m_vSam.emplace_back(CaloGenericDetId(detId.det(), detId.subdetId(), i), rSize, nPre);
51  }
52 }
size
Write out results.
const double pfac
Definition: EBHitResponse.h:92
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:84
const APDSimParameters * apdParameters() const
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:83
Main class for Parameters in different subdetectors.
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
EcalHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
const double pelo
Definition: EBHitResponse.h:92
const double plin
Definition: EBHitResponse.h:92
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:87
const double nonlFunc1(double energy) const
Definition: EBHitResponse.h:68
const double pasy
Definition: EBHitResponse.h:92
#define M_PI
const double pehi
Definition: EBHitResponse.h:92
const double poff
Definition: EBHitResponse.h:92
const double pcub
Definition: EBHitResponse.h:92
bool m_isInitialized
Definition: EBHitResponse.h:96
const double pcon
Definition: EBHitResponse.h:92
const bool m_apdOnly
Definition: EBHitResponse.h:82
const double pext
Definition: EBHitResponse.h:92
const double pqua
Definition: EBHitResponse.h:92
EBHitResponse::~EBHitResponse ( )
override

Definition at line 54 of file EBHitResponse.cc.

54 {}

Member Function Documentation

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

Reimplemented from EcalHitResponse.

Definition at line 178 of file EBHitResponse.cc.

References CaloVHitFilter::accepts(), apdParameters(), apdSignalAmplitude(), PCaloHit::depth(), EcalHitResponse::hitFilter(), PCaloHit::id(), edm::isNotFinite(), PCaloHit::kEcalDepthIdMask, m_apdNpeVec, m_apdOnly, m_apdTimeVec, EcalHitResponse::putAnalogSignal(), and PCaloHit::time().

Referenced by counter.Counter::register().

178  {
179  if (!edm::isNotFinite(hit.time()) && (nullptr == hitFilter() || hitFilter()->accepts(hit))) {
180  int iddepth = (hit.depth() & PCaloHit::kEcalDepthIdMask);
181  if (0 == iddepth) // for now take only nonAPD hits
182  {
183  if (!m_apdOnly)
184  putAnalogSignal(hit, engine);
185  } else // APD hits here
186  {
187  if (apdParameters()->addToBarrel() || m_apdOnly) {
188  const unsigned int icell(EBDetId(hit.id()).denseIndex());
189  m_apdNpeVec[icell] += apdSignalAmplitude(hit, engine);
190  if (0 == m_apdTimeVec[icell])
191  m_apdTimeVec[icell] = hit.time();
192  }
193  }
194  }
195 }
double time() const
Definition: PCaloHit.h:30
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
virtual void putAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *)
uint16_t depth() const
Definition: PCaloHit.h:43
const APDSimParameters * apdParameters() const
virtual bool accepts(const PCaloHit &hit) const =0
const CaloVHitFilter * hitFilter() const
double apdSignalAmplitude(const PCaloHit &hit, CLHEP::HepRandomEngine *) const
unsigned int id() const
Definition: PCaloHit.h:37
const bool m_apdOnly
Definition: EBHitResponse.h:82
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:90
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:89
static const int kEcalDepthIdMask
Definition: PCaloHit.h:60
const APDSimParameters * EBHitResponse::apdParameters ( ) const
private

Definition at line 63 of file EBHitResponse.cc.

References m_apdPars.

Referenced by add(), apdSignalAmplitude(), finalizeHits(), initialize(), and run().

63  {
64  assert(nullptr != m_apdPars);
65  return m_apdPars;
66 }
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:83
const CaloVShape * EBHitResponse::apdShape ( ) const
private

Definition at line 68 of file EBHitResponse.cc.

References m_apdShape.

Referenced by putAPDSignal().

68  {
69  assert(nullptr != m_apdShape);
70  return m_apdShape;
71 }
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:84
double EBHitResponse::apdSignalAmplitude ( const PCaloHit hit,
CLHEP::HepRandomEngine *  engine 
) const
private

Definition at line 103 of file EBHitResponse.cc.

References apdParameters(), PCaloHit::depth(), PCaloHit::energy(), findIntercalibConstant(), PCaloHit::id(), PCaloHit::kEcalDepthIdMask, m_apdOnly, m_intercal, APDSimParameters::simToPEHigh(), and APDSimParameters::simToPELow().

Referenced by add(), and run().

103  {
104  int iddepth = (hit.depth() & PCaloHit::kEcalDepthIdMask);
105  assert(1 == iddepth || 2 == iddepth);
106 
107  double npe(hit.energy() * (2 == iddepth ? apdParameters()->simToPELow() : apdParameters()->simToPEHigh()));
108 
109  // do we need to do Poisson statistics for the photoelectrons?
110  if (apdParameters()->doPEStats() && !m_apdOnly) {
111  CLHEP::RandPoissonQ randPoissonQ(*engine, npe);
112  npe = randPoissonQ.fire();
113  }
114  assert(nullptr != m_intercal);
115  double fac(1);
116  findIntercalibConstant(hit.id(), fac);
117 
118  npe *= fac;
119 
120  // edm::LogError( "EBHitResponse" ) << "--- # photoelectrons for "
121  /* std::cout << "--- # photoelectrons for "
122  << EBDetId( hit.id() )
123  <<" is " << npe //;
124  <<std::endl ;*/
125 
126  return npe;
127 }
double simToPEHigh() const
double energy() const
Definition: PCaloHit.h:24
uint16_t depth() const
Definition: PCaloHit.h:43
const APDSimParameters * apdParameters() const
void findIntercalibConstant(const DetId &detId, double &icalconst) const
unsigned int id() const
Definition: PCaloHit.h:37
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:85
const bool m_apdOnly
Definition: EBHitResponse.h:82
double simToPELow() const
static const int kEcalDepthIdMask
Definition: PCaloHit.h:60
void EBHitResponse::finalizeHits ( )
overridevirtual

Reimplemented from EcalHitResponse.

Definition at line 163 of file EBHitResponse.cc.

References apdParameters(), EBDetId::detIdFromDenseIndex(), mps_fire::i, EBDetId::kSizeForDenseIndexing, m_apdNpeVec, m_apdOnly, m_apdTimeVec, and putAPDSignal().

163  {
164  const unsigned int bSize(EBDetId::kSizeForDenseIndexing);
165  if (apdParameters()->addToBarrel() || m_apdOnly) {
166  for (unsigned int i(0); i != bSize; ++i) {
167  if (0 < m_apdNpeVec[i]) {
169 
170  // now zero out for next time
171  m_apdNpeVec[i] = 0.;
172  m_apdTimeVec[i] = 0.;
173  }
174  }
175  }
176 }
void putAPDSignal(const DetId &detId, double npe, double time)
const APDSimParameters * apdParameters() const
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
const bool m_apdOnly
Definition: EBHitResponse.h:82
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:90
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:89
void EBHitResponse::findIntercalibConstant ( const DetId detId,
double &  icalconst 
) const
private

Definition at line 131 of file EBHitResponse.cc.

References EcalCondObjectContainer< T >::getMap(), m_intercal, and DetId::rawId().

Referenced by apdSignalAmplitude().

131  {
132  EcalIntercalibConstantMC thisconst(1.);
133 
134  if (nullptr == m_intercal) {
135  edm::LogError("EBHitResponse") << "No intercal constant defined for EBHitResponse";
136  } else {
137  const EcalIntercalibConstantMCMap& icalMap(m_intercal->getMap());
138  EcalIntercalibConstantMCMap::const_iterator icalit(icalMap.find(detId));
139  if (icalit != icalMap.end()) {
140  thisconst = *icalit;
141  if (thisconst == 0.)
142  thisconst = 1.;
143  } else {
144  edm::LogError("EBHitResponse") << "No intercalib const found for xtal " << detId.rawId()
145  << "! something wrong with EcalIntercalibConstants in your DB? ";
146  }
147  }
148  icalconst = thisconst;
149 }
const self & getMap() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:85
std::vector< Item >::const_iterator const_iterator
float EcalIntercalibConstantMC
void EBHitResponse::initialize ( CLHEP::HepRandomEngine *  engine)

Definition at line 56 of file EBHitResponse.cc.

References apdParameters(), mps_fire::i, kNOffsets, m_isInitialized, and m_timeOffVec.

56  {
57  m_isInitialized = true;
58  for (unsigned int i(0); i != kNOffsets; ++i) {
59  m_timeOffVec[i] += CLHEP::RandGaussQ::shoot(engine, 0, apdParameters()->timeOffWidth());
60  }
61 }
const APDSimParameters * apdParameters() const
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:87
bool m_isInitialized
Definition: EBHitResponse.h:96
void EBHitResponse::initializeHits ( )
overridevirtual

Reimplemented from EcalHitResponse.

Definition at line 151 of file EBHitResponse.cc.

References EcalHitResponse::blankOutUsedSamples(), relativeConstraints::empty, EcalHitResponse::index(), EBDetId::kSizeForDenseIndexing, m_apdNpeVec, and m_apdTimeVec.

151  {
152  if (!index().empty())
154 
155  const unsigned int bSize(EBDetId::kSizeForDenseIndexing);
156 
157  if (m_apdNpeVec.empty()) {
158  m_apdNpeVec = std::vector<double>(bSize, (double)0.0);
159  m_apdTimeVec = std::vector<double>(bSize, (double)0.0);
160  }
161 }
void blankOutUsedSamples()
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:90
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:89
virtual bool EBHitResponse::keepBlank ( ) const
inlinevirtual
const double EBHitResponse::nonlFunc ( double  enr) const
inlineprivate

Definition at line 64 of file EBHitResponse.h.

Referenced by putAPDSignal().

64  {
65  return (pelo > enr ? pext : (pehi > enr ? nonlFunc1(enr) : pfac * atan(log10(enr - pehi + 0.00001)) + poff));
66  }
const double pfac
Definition: EBHitResponse.h:92
const double pelo
Definition: EBHitResponse.h:92
const double nonlFunc1(double energy) const
Definition: EBHitResponse.h:68
const double pehi
Definition: EBHitResponse.h:92
const double poff
Definition: EBHitResponse.h:92
const double pext
Definition: EBHitResponse.h:92
const double EBHitResponse::nonlFunc1 ( double  energy) const
inlineprivate

Definition at line 68 of file EBHitResponse.h.

68  {
69  const double enr(log10(energy));
70  const double enr2(enr * enr);
71  const double enr3(enr2 * enr);
72  return (pcub * enr3 + pqua * enr2 + plin * enr + pcon);
73  }
const double plin
Definition: EBHitResponse.h:92
const double pcub
Definition: EBHitResponse.h:92
const double pcon
Definition: EBHitResponse.h:92
const double pqua
Definition: EBHitResponse.h:92
const VecD& EBHitResponse::offsets ( ) const
inlineprivate

Definition at line 62 of file EBHitResponse.h.

Referenced by putAPDSignal().

62 { return m_timeOffVec; }
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:87
EcalHitResponse::EcalSamples * EBHitResponse::operator[] ( unsigned int  i)
overridevirtual

Implements EcalHitResponse.

Definition at line 249 of file EBHitResponse.cc.

References mps_fire::i, and m_vSam.

249 { return &m_vSam[i]; }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
const EcalHitResponse::EcalSamples * EBHitResponse::operator[] ( unsigned int  i) const
overridevirtual

Implements EcalHitResponse.

Definition at line 247 of file EBHitResponse.cc.

References mps_fire::i, and m_vSam.

247 { return &m_vSam[i]; }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
void EBHitResponse::putAPDSignal ( const DetId detId,
double  npe,
double  time 
)
protected

Definition at line 73 of file EBHitResponse.cc.

References apdShape(), stringResolutionProvider_cfi::bin, CaloSimParameters::binOfMaximum(), EcalHitResponse::BUNCHSPACE, Exception, EcalHitResponse::findSignal(), kNOffsets, m_isInitialized, nonlFunc(), offsets(), EcalHitResponse::params(), EcalHitResponse::phaseShift(), mps_fire::result, CaloSimParameters::simHitToPhotoelectrons(), CaloTSamplesBase< Ttype >::size(), EcalHitResponse::timeOfFlight(), and tzero.

Referenced by finalizeHits(), and run().

73  {
74  const CaloSimParameters& parameters(*params(detId));
75 
76  const double energyFac(1. / parameters.simHitToPhotoelectrons(detId));
77 
78  // std::cout<<"******** Input APD Npe="<<npe<<", Efactor="<<energyFac
79  // <<", Energy="<<npe*energyFac
80  // <<", nonlFunc="<<nonlFunc( npe*energyFac )<<std::endl ;
81 
82  const double signal(npe * nonlFunc(npe * energyFac));
83 
84  const double jitter(time - timeOfFlight(detId));
85 
86  if (!m_isInitialized) {
87  throw cms::Exception("LogicError") << "EBHitResponse::putAPDSignal called without initializing\n";
88  }
89 
90  const double tzero(apdShape()->timeToRise() - jitter - offsets()[EBDetId(detId).denseIndex() % kNOffsets] -
91  BUNCHSPACE * (parameters.binOfMaximum() - phaseShift()));
92 
93  double binTime(tzero);
94 
95  EcalSamples& result(*findSignal(detId));
96 
97  for (unsigned int bin(0); bin != result.size(); ++bin) {
98  result[bin] += (*apdShape())(binTime)*signal;
99  binTime += BUNCHSPACE;
100  }
101 }
double timeOfFlight(const DetId &detId) const
Main class for Parameters in different subdetectors.
const CaloSimParameters * params(const DetId &detId) const
double phaseShift() const
const VecD & offsets() const
Definition: EBHitResponse.h:62
CaloTSamplesBase< float > EcalSamples
bin
set the eta bin as selection string.
bool m_isInitialized
Definition: EBHitResponse.h:96
const double nonlFunc(double enr) const
Definition: EBHitResponse.h:64
static const double tzero[3]
EcalSamples * findSignal(const DetId &detId)
const CaloVShape * apdShape() const
void EBHitResponse::run ( MixCollection< PCaloHit > &  hits,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Reimplemented from EcalHitResponse.

Definition at line 197 of file EBHitResponse.cc.

References CaloVHitFilter::accepts(), apdParameters(), apdSignalAmplitude(), MixCollection< T >::begin(), EcalHitResponse::blankOutUsedSamples(), PCaloHit::depth(), EBDetId::detIdFromDenseIndex(), relativeConstraints::empty, MixCollection< T >::end(), EcalHitResponse::hitFilter(), mps_fire::i, PCaloHit::id(), EcalHitResponse::index(), edm::isNotFinite(), PCaloHit::kEcalDepthIdMask, EBDetId::kSizeForDenseIndexing, m_apdNpeVec, m_apdOnly, m_apdTimeVec, EcalHitResponse::maxBunch(), EcalHitResponse::minBunch(), EcalHitResponse::putAnalogSignal(), putAPDSignal(), and PCaloHit::time().

197  {
198  if (!index().empty())
200 
201  const unsigned int bSize(EBDetId::kSizeForDenseIndexing);
202 
203  if (m_apdNpeVec.empty()) {
204  m_apdNpeVec = std::vector<double>(bSize, (double)0.0);
205  m_apdTimeVec = std::vector<double>(bSize, (double)0.0);
206  }
207 
208  for (MixCollection<PCaloHit>::MixItr hitItr(hits.begin()); hitItr != hits.end(); ++hitItr) {
209  const PCaloHit& hit(*hitItr);
210  const int bunch(hitItr.bunch());
211  if (minBunch() <= bunch && maxBunch() >= bunch && !edm::isNotFinite(hit.time()) &&
212  (nullptr == hitFilter() || hitFilter()->accepts(hit))) {
213  int iddepth = (hit.depth() & PCaloHit::kEcalDepthIdMask);
214  if (0 == iddepth) // for now take only nonAPD hits
215  {
216  if (!m_apdOnly)
217  putAnalogSignal(hit, engine);
218  } else // APD hits here
219  {
220  if (apdParameters()->addToBarrel() || m_apdOnly) {
221  const unsigned int icell(EBDetId(hit.id()).denseIndex());
222  m_apdNpeVec[icell] += apdSignalAmplitude(hit, engine);
223  if (0 == m_apdTimeVec[icell])
224  m_apdTimeVec[icell] = hit.time();
225  }
226  }
227  }
228  }
229 
230  if (apdParameters()->addToBarrel() || m_apdOnly) {
231  for (unsigned int i(0); i != bSize; ++i) {
232  if (0 < m_apdNpeVec[i]) {
234 
235  // now zero out for next time
236  m_apdNpeVec[i] = 0.;
237  m_apdTimeVec[i] = 0.;
238  }
239  }
240  }
241 }
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
void putAPDSignal(const DetId &detId, double npe, double time)
virtual void putAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *)
const APDSimParameters * apdParameters() const
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
virtual bool accepts(const PCaloHit &hit) const =0
const CaloVHitFilter * hitFilter() const
int maxBunch() const
void blankOutUsedSamples()
double apdSignalAmplitude(const PCaloHit &hit, CLHEP::HepRandomEngine *) const
iterator end() const
int minBunch() const
unsigned int id
iterator begin() const
const bool m_apdOnly
Definition: EBHitResponse.h:82
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:90
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:89
static const int kEcalDepthIdMask
Definition: PCaloHit.h:60
unsigned int EBHitResponse::samplesSize ( ) const
overridevirtual

Implements EcalHitResponse.

Definition at line 243 of file EBHitResponse.cc.

References m_vSam.

243 { return m_vSam.size(); }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
unsigned int EBHitResponse::samplesSizeAll ( ) const
overrideprotectedvirtual

Implements EcalHitResponse.

Definition at line 245 of file EBHitResponse.cc.

References m_vSam.

245 { return m_vSam.size(); }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
void EBHitResponse::setIntercal ( const EcalIntercalibConstantsMC ical)

Definition at line 129 of file EBHitResponse.cc.

References m_intercal.

129 { m_intercal = ical; }
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:85
EcalHitResponse::EcalSamples * EBHitResponse::vSam ( unsigned int  i)
overrideprotectedvirtual

Implements EcalHitResponse.

Definition at line 251 of file EBHitResponse.cc.

References mps_fire::i, and m_vSam.

251 { return &m_vSam[i]; }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
EcalHitResponse::EcalSamples * EBHitResponse::vSamAll ( unsigned int  i)
overrideprotectedvirtual

Implements EcalHitResponse.

Definition at line 253 of file EBHitResponse.cc.

References mps_fire::i, and m_vSam.

253 { return &m_vSam[i]; }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
const EcalHitResponse::EcalSamples * EBHitResponse::vSamAll ( unsigned int  i) const
overrideprotectedvirtual

Implements EcalHitResponse.

Definition at line 255 of file EBHitResponse.cc.

References mps_fire::i, and m_vSam.

255 { return &m_vSam[i]; }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94

Member Data Documentation

std::vector<double> EBHitResponse::m_apdNpeVec
private

Definition at line 89 of file EBHitResponse.h.

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

const bool EBHitResponse::m_apdOnly
private

Definition at line 82 of file EBHitResponse.h.

Referenced by add(), apdSignalAmplitude(), finalizeHits(), and run().

const APDSimParameters* EBHitResponse::m_apdPars
private

Definition at line 83 of file EBHitResponse.h.

Referenced by apdParameters().

const CaloVShape* EBHitResponse::m_apdShape
private

Definition at line 84 of file EBHitResponse.h.

Referenced by apdShape().

std::vector<double> EBHitResponse::m_apdTimeVec
private

Definition at line 90 of file EBHitResponse.h.

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

const EcalIntercalibConstantsMC* EBHitResponse::m_intercal
private

Definition at line 85 of file EBHitResponse.h.

Referenced by apdSignalAmplitude(), findIntercalibConstant(), and setIntercal().

bool EBHitResponse::m_isInitialized
private

Definition at line 96 of file EBHitResponse.h.

Referenced by initialize(), and putAPDSignal().

std::vector<double> EBHitResponse::m_timeOffVec
private

Definition at line 87 of file EBHitResponse.h.

Referenced by initialize().

std::vector<EBSamples> EBHitResponse::m_vSam
private

Definition at line 94 of file EBHitResponse.h.

Referenced by EBHitResponse(), operator[](), samplesSize(), samplesSizeAll(), vSam(), and vSamAll().

const double EBHitResponse::pasy
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::pcon
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::pcub
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::pehi
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::pelo
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::pext
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::pfac
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::plin
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::poff
private

Definition at line 92 of file EBHitResponse.h.

const double EBHitResponse::pqua
private

Definition at line 92 of file EBHitResponse.h.