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 | 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 CaloTSamplesBase< float > EcalSamples
 
typedef std::vector< unsigned int > VecInd
 

Public Member Functions

virtual void add (const PCaloHit &hit)
 
 EBHitResponse (const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool apdOnly, const APDSimParameters *apdPars, const CaloVShape *apdShape)
 
virtual void finalizeHits ()
 
virtual void initializeHits ()
 
virtual bool keepBlank () const
 
const VecDoffsets () const
 
virtual EcalSamplesoperator[] (unsigned int i)
 
virtual const EcalSamplesoperator[] (unsigned int i) const
 
virtual void run (MixCollection< PCaloHit > &hits)
 
virtual unsigned int samplesSize () const
 
void setIntercal (const EcalIntercalibConstantsMC *ical)
 
virtual ~EBHitResponse ()
 
- Public Member Functions inherited from EcalHitResponse
void add (const EcalSamples *pSam)
 
 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)
 
virtual unsigned int samplesSizeAll () const
 
virtual EcalSamplesvSam (unsigned int i)
 
virtual EcalSamplesvSamAll (unsigned int i)
 
virtual const EcalSamplesvSamAll (unsigned int i) const
 
- Protected Member Functions inherited from EcalHitResponse
double analogSignalAmplitude (const DetId &id, float energy) const
 
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::RandGaussQ * ranGauss () const
 
CLHEP::RandPoissonQ * ranPois () const
 
const CaloVShapeshape () const
 
double timeOfFlight (const DetId &detId) const
 

Private Member Functions

const APDSimParametersapdParameters () const
 
const CaloVShapeapdShape () const
 
double apdSignalAmplitude (const PCaloHit &hit) const
 
void findIntercalibConstant (const DetId &detId, double &icalconst) const
 
const double nonlFunc (double enr) const
 
const double nonlFunc1 (double energy) 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
 
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 10 of file EBHitResponse.h.

Member Typedef Documentation

Definition at line 14 of file EBHitResponse.h.

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

Definition at line 16 of file EBHitResponse.h.

Member Enumeration Documentation

anonymous enum
Enumerator
kNOffsets 

Definition at line 18 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 14 of file EBHitResponse.cc.

References apdParameters(), DetId::det(), EBDetId::detIdFromDenseIndex(), i, kNOffsets, EBDetId::kSizeForDenseIndexing, m_timeOffVec, m_vSam, Parameters::parameters, EcalHitResponse::ranGauss(), CaloVSimParameterMap::simParameters(), findQualityFiles::size, and DetId::subdetId().

18  :
19 
20  EcalHitResponse( parameterMap, shape ) ,
21 
22  m_apdOnly ( apdOnly ) ,
23  m_apdPars ( apdPars ) ,
24  m_apdShape ( apdShape ) ,
25  m_timeOffVec ( kNOffsets, apdParameters()->timeOffset() ) ,
26  pcub ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[0] ) ,
27  pqua ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[1] ) ,
28  plin ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[2] ) ,
29  pcon ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[3] ) ,
30  pelo ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[4] ) ,
31  pehi ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[5] ) ,
32  pasy ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[6] ) ,
33  pext ( 0 == apdPars ? 0 : nonlFunc1( pelo ) ) ,
34  poff ( 0 == apdPars ? 0 : nonlFunc1( pehi ) ) ,
35  pfac ( 0 == apdPars ? 0 : ( pasy - poff )*2./M_PI )
36 {
37  for( unsigned int i ( 0 ) ; i != kNOffsets ; ++i )
38  {
39  m_timeOffVec[ i ] +=
40  ranGauss()->fire( 0 , apdParameters()->timeOffWidth() ) ;
41  }
42 
43  const EBDetId detId ( EBDetId::detIdFromDenseIndex( 0 ) ) ;
44  const CaloSimParameters& parameters ( parameterMap->simParameters( detId ) ) ;
45 
46  const unsigned int rSize ( parameters.readoutFrameSize() ) ;
47  const unsigned int nPre ( parameters.binOfMaximum() - 1 ) ;
48 
49  const unsigned int size ( EBDetId::kSizeForDenseIndexing ) ;
50 
51  m_vSam.reserve( size ) ;
52 
53  for( unsigned int i ( 0 ) ; i != size ; ++i )
54  {
55  m_vSam.emplace_back(CaloGenericDetId( detId.det(), detId.subdetId(), i ) ,
56  rSize, nPre );
57  }
58 }
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
const double pfac
Definition: EBHitResponse.h:91
CLHEP::RandGaussQ * ranGauss() const
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:93
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:83
const APDSimParameters * apdParameters() const
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:82
Main class for Parameters in different subdetectors.
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:111
EcalHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
const double pelo
Definition: EBHitResponse.h:91
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
const double plin
Definition: EBHitResponse.h:91
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:86
const double nonlFunc1(double energy) const
Definition: EBHitResponse.h:67
const double pasy
Definition: EBHitResponse.h:91
const double pehi
Definition: EBHitResponse.h:91
#define M_PI
Definition: BFit3D.cc:3
const double poff
Definition: EBHitResponse.h:91
const double pcub
Definition: EBHitResponse.h:91
const double pcon
Definition: EBHitResponse.h:91
const bool m_apdOnly
Definition: EBHitResponse.h:81
tuple size
Write out results.
const double pext
Definition: EBHitResponse.h:91
const double pqua
Definition: EBHitResponse.h:91
EBHitResponse::~EBHitResponse ( )
virtual

Definition at line 60 of file EBHitResponse.cc.

61 {
62 }

Member Function Documentation

void EBHitResponse::add ( const PCaloHit hit)
virtual

Reimplemented from EcalHitResponse.

Definition at line 213 of file EBHitResponse.cc.

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

214 {
215  if (!edm::isNotFinite( hit.time() ) && ( 0 == hitFilter() || hitFilter()->accepts( hit ) ) ) {
216  if( 0 == hit.depth() ) // for now take only nonAPD hits
217  {
218  if( !m_apdOnly ) putAnalogSignal( hit ) ;
219  }
220  else // APD hits here
221  {
222  if( apdParameters()->addToBarrel() ||
223  m_apdOnly )
224  {
225  const unsigned int icell ( EBDetId( hit.id() ).denseIndex() ) ;
226  m_apdNpeVec[ icell ] += apdSignalAmplitude( hit ) ;
227  if( 0 == m_apdTimeVec[ icell ] ) m_apdTimeVec[ icell ] = hit.time() ;
228  }
229  }
230  }
231 }
double time() const
Definition: PCaloHit.h:36
uint16_t depth() const
Definition: PCaloHit.h:49
const APDSimParameters * apdParameters() const
bool isNotFinite(T x)
Definition: isFinite.h:10
const CaloVHitFilter * hitFilter() const
virtual bool accepts(const PCaloHit &hit) const =0
unsigned int id() const
Definition: PCaloHit.h:43
virtual void putAnalogSignal(const PCaloHit &inputHit)
double apdSignalAmplitude(const PCaloHit &hit) const
const bool m_apdOnly
Definition: EBHitResponse.h:81
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:89
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:88
const APDSimParameters * EBHitResponse::apdParameters ( ) const
private

Definition at line 65 of file EBHitResponse.cc.

References m_apdPars.

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

66 {
67  assert ( 0 != m_apdPars ) ;
68  return m_apdPars ;
69 }
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:82
const CaloVShape * EBHitResponse::apdShape ( ) const
private

Definition at line 72 of file EBHitResponse.cc.

References m_apdShape.

Referenced by putAPDSignal().

73 {
74  assert( 0 != m_apdShape ) ;
75  return m_apdShape ;
76 }
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:83
double EBHitResponse::apdSignalAmplitude ( const PCaloHit hit) const
private

Definition at line 113 of file EBHitResponse.cc.

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

Referenced by add(), and run().

114 {
115  assert( 1 == hit.depth() ||
116  2 == hit.depth() ) ;
117 
118  double npe ( hit.energy()*( 2 == hit.depth() ?
120  apdParameters()->simToPEHigh() ) ) ;
121 
122  // do we need to do Poisson statistics for the photoelectrons?
123  if( apdParameters()->doPEStats() &&
124  !m_apdOnly ) npe = ranPois()->fire( npe ) ;
125 
126  assert( 0 != m_intercal ) ;
127  double fac ( 1 ) ;
128  findIntercalibConstant( hit.id(), fac ) ;
129 
130  npe *= fac ;
131 
132 // edm::LogError( "EBHitResponse" ) << "--- # photoelectrons for "
133 /* std::cout << "--- # photoelectrons for "
134  << EBDetId( hit.id() )
135  <<" is " << npe //;
136  <<std::endl ;*/
137 
138  return npe ;
139 }
double simToPEHigh() const
double energy() const
Definition: PCaloHit.h:29
uint16_t depth() const
Definition: PCaloHit.h:49
const APDSimParameters * apdParameters() const
void findIntercalibConstant(const DetId &detId, double &icalconst) const
unsigned int id() const
Definition: PCaloHit.h:43
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:84
CLHEP::RandPoissonQ * ranPois() const
const bool m_apdOnly
Definition: EBHitResponse.h:81
double simToPELow() const
void EBHitResponse::finalizeHits ( )
virtual

Reimplemented from EcalHitResponse.

Definition at line 191 of file EBHitResponse.cc.

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

191  {
192  const unsigned int bSize ( EBDetId::kSizeForDenseIndexing ) ;
193  if( apdParameters()->addToBarrel() ||
194  m_apdOnly )
195  {
196  for( unsigned int i ( 0 ) ; i != bSize ; ++i )
197  {
198  if( 0 < m_apdNpeVec[i] )
199  {
201  m_apdNpeVec[i] ,
202  m_apdTimeVec[i] ) ;
203 
204  // now zero out for next time
205  m_apdNpeVec[i] = 0. ;
206  m_apdTimeVec[i] = 0. ;
207  }
208  }
209  }
210 }
int i
Definition: DBlmapReader.cc:9
void putAPDSignal(const DetId &detId, double npe, double time)
const APDSimParameters * apdParameters() const
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:111
const bool m_apdOnly
Definition: EBHitResponse.h:81
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:89
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:88
void EBHitResponse::findIntercalibConstant ( const DetId detId,
double &  icalconst 
) const
private

Definition at line 148 of file EBHitResponse.cc.

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

Referenced by apdSignalAmplitude().

150 {
151  EcalIntercalibConstantMC thisconst ( 1. ) ;
152 
153  if( 0 == m_intercal )
154  {
155  edm::LogError( "EBHitResponse" ) <<
156  "No intercal constant defined for EBHitResponse" ;
157  }
158  else
159  {
160  const EcalIntercalibConstantMCMap& icalMap ( m_intercal->getMap() ) ;
161  EcalIntercalibConstantMCMap::const_iterator icalit ( icalMap.find( detId ) ) ;
162  if( icalit != icalMap.end() )
163  {
164  thisconst = *icalit ;
165  if ( thisconst == 0. ) thisconst = 1. ;
166  }
167  else
168  {
169  edm::LogError("EBHitResponse") << "No intercalib const found for xtal "
170  << detId.rawId()
171  << "! something wrong with EcalIntercalibConstants in your DB? ";
172  }
173  }
174  icalconst = thisconst ;
175 }
const self & getMap() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:84
std::vector< Item >::const_iterator const_iterator
float EcalIntercalibConstantMC
void EBHitResponse::initializeHits ( )
virtual

Reimplemented from EcalHitResponse.

Definition at line 178 of file EBHitResponse.cc.

References EcalHitResponse::blankOutUsedSamples(), EcalHitResponse::index(), EBDetId::kSizeForDenseIndexing, m_apdNpeVec, m_apdTimeVec, and findQualityFiles::size.

178  {
179  if( 0 != index().size() ) blankOutUsedSamples() ;
180 
181  const unsigned int bSize ( EBDetId::kSizeForDenseIndexing ) ;
182 
183  if( 0 == m_apdNpeVec.size() )
184  {
185  m_apdNpeVec = std::vector<double>( bSize, (double)0.0 ) ;
186  m_apdTimeVec = std::vector<double>( bSize, (double)0.0 ) ;
187  }
188 }
tuple size
Write out results.
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:89
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:88
virtual bool EBHitResponse::keepBlank ( ) const
inlinevirtual

Definition at line 28 of file EBHitResponse.h.

References edm::false.

28 { return false ; }
volatile std::atomic< bool > shutdown_flag false
const double EBHitResponse::nonlFunc ( double  enr) const
inlineprivate

Definition at line 62 of file EBHitResponse.h.

References nonlFunc1(), pehi, pelo, pext, pfac, and poff.

Referenced by putAPDSignal().

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

Definition at line 67 of file EBHitResponse.h.

References pcon, pcub, plin, and pqua.

Referenced by nonlFunc().

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

Definition at line 32 of file EBHitResponse.h.

References m_timeOffVec.

Referenced by putAPDSignal().

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

Implements EcalHitResponse.

Definition at line 312 of file EBHitResponse.cc.

References i, and m_vSam.

313 {
314  return &m_vSam[ i ] ;
315 }
int i
Definition: DBlmapReader.cc:9
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:93
const EcalHitResponse::EcalSamples * EBHitResponse::operator[] ( unsigned int  i) const
virtual

Implements EcalHitResponse.

Definition at line 306 of file EBHitResponse.cc.

References i, and m_vSam.

307 {
308  return &m_vSam[ i ] ;
309 }
int i
Definition: DBlmapReader.cc:9
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:93
void EBHitResponse::putAPDSignal ( const DetId detId,
double  npe,
double  time 
)
protected

Definition at line 79 of file EBHitResponse.cc.

References apdShape(), newFWLiteAna::bin, CaloSimParameters::binOfMaximum(), EcalHitResponse::BUNCHSPACE, EcalHitResponse::findSignal(), kNOffsets, nonlFunc(), offsets(), Parameters::parameters, EcalHitResponse::params(), EcalHitResponse::phaseShift(), query::result, CaloSimParameters::simHitToPhotoelectrons(), CaloTSamplesBase< Ttype >::size(), EcalHitResponse::timeOfFlight(), and tzero.

Referenced by finalizeHits(), and run().

82 {
83  const CaloSimParameters& parameters ( *params( detId ) ) ;
84 
85  const double energyFac ( 1./parameters.simHitToPhotoelectrons( detId ) ) ;
86 
87 // std::cout<<"******** Input APD Npe="<<npe<<", Efactor="<<energyFac
88 // <<", Energy="<<npe*energyFac
89 // <<", nonlFunc="<<nonlFunc( npe*energyFac )<<std::endl ;
90 
91  const double signal ( npe*nonlFunc( npe*energyFac ) ) ;
92 
93  const double jitter ( time - timeOfFlight( detId ) ) ;
94 
95  const double tzero ( apdShape()->timeToRise()
96  - jitter
97  - offsets()[ EBDetId( detId ).denseIndex()%kNOffsets ]
98  - BUNCHSPACE*( parameters.binOfMaximum()
99  - phaseShift() ) ) ;
100 
101  double binTime ( tzero ) ;
102 
103  EcalSamples& result ( *findSignal( detId ) );
104 
105  for( unsigned int bin ( 0 ) ; bin != result.size(); ++bin )
106  {
107  result[bin] += (*apdShape())(binTime)*signal ;
108  binTime += BUNCHSPACE ;
109  }
110 }
dictionary parameters
Definition: Parameters.py:2
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:32
tuple result
Definition: query.py:137
CaloTSamplesBase< float > EcalSamples
const double nonlFunc(double enr) const
Definition: EBHitResponse.h:62
static const double tzero[3]
EcalSamples * findSignal(const DetId &detId)
const CaloVShape * apdShape() const
void EBHitResponse::run ( MixCollection< PCaloHit > &  hits)
virtual

Reimplemented from EcalHitResponse.

Definition at line 234 of file EBHitResponse.cc.

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

235 {
236  if( 0 != index().size() ) blankOutUsedSamples() ;
237 
238  const unsigned int bSize ( EBDetId::kSizeForDenseIndexing ) ;
239 
240  if( 0 == m_apdNpeVec.size() )
241  {
242  m_apdNpeVec = std::vector<double>( bSize, (double)0.0 ) ;
243  m_apdTimeVec = std::vector<double>( bSize, (double)0.0 ) ;
244  }
245 
246  for( MixCollection<PCaloHit>::MixItr hitItr ( hits.begin() ) ;
247  hitItr != hits.end() ; ++hitItr )
248  {
249  const PCaloHit& hit ( *hitItr ) ;
250  const int bunch ( hitItr.bunch() ) ;
251  if( minBunch() <= bunch &&
252  maxBunch() >= bunch &&
253  !edm::isNotFinite( hit.time() ) &&
254  ( 0 == hitFilter() ||
255  hitFilter()->accepts( hit ) ) )
256  {
257  if( 0 == hit.depth() ) // for now take only nonAPD hits
258  {
259  if( !m_apdOnly ) putAnalogSignal( hit ) ;
260  }
261  else // APD hits here
262  {
263  if( apdParameters()->addToBarrel() ||
264  m_apdOnly )
265  {
266  const unsigned int icell ( EBDetId( hit.id() ).denseIndex() ) ;
267  m_apdNpeVec[ icell ] += apdSignalAmplitude( hit ) ;
268  if( 0 == m_apdTimeVec[ icell ] ) m_apdTimeVec[ icell ] = hit.time() ;
269  }
270  }
271  }
272  }
273 
274  if( apdParameters()->addToBarrel() ||
275  m_apdOnly )
276  {
277  for( unsigned int i ( 0 ) ; i != bSize ; ++i )
278  {
279  if( 0 < m_apdNpeVec[i] )
280  {
282  m_apdNpeVec[i] ,
283  m_apdTimeVec[i] ) ;
284 
285  // now zero out for next time
286  m_apdNpeVec[i] = 0. ;
287  m_apdTimeVec[i] = 0. ;
288  }
289  }
290  }
291 }
int i
Definition: DBlmapReader.cc:9
void putAPDSignal(const DetId &detId, double npe, double time)
const APDSimParameters * apdParameters() const
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:111
iterator end()
bool isNotFinite(T x)
Definition: isFinite.h:10
const CaloVHitFilter * hitFilter() const
int maxBunch() const
virtual bool accepts(const PCaloHit &hit) const =0
int minBunch() const
virtual void putAnalogSignal(const PCaloHit &inputHit)
unsigned int id
iterator begin()
double apdSignalAmplitude(const PCaloHit &hit) const
const bool m_apdOnly
Definition: EBHitResponse.h:81
tuple size
Write out results.
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:89
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:88
unsigned int EBHitResponse::samplesSize ( ) const
virtual

Implements EcalHitResponse.

Definition at line 294 of file EBHitResponse.cc.

References m_vSam.

295 {
296  return m_vSam.size() ;
297 }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:93
unsigned int EBHitResponse::samplesSizeAll ( ) const
protectedvirtual

Implements EcalHitResponse.

Definition at line 300 of file EBHitResponse.cc.

References m_vSam.

301 {
302  return m_vSam.size() ;
303 }
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:93
void EBHitResponse::setIntercal ( const EcalIntercalibConstantsMC ical)

Definition at line 142 of file EBHitResponse.cc.

References m_intercal.

Referenced by EcalDigiProducer::checkCalibrations().

143 {
144  m_intercal = ical ;
145 }
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:84
EcalHitResponse::EcalSamples * EBHitResponse::vSam ( unsigned int  i)
protectedvirtual

Implements EcalHitResponse.

Definition at line 318 of file EBHitResponse.cc.

References i, and m_vSam.

319 {
320  return &m_vSam[ i ] ;
321 }
int i
Definition: DBlmapReader.cc:9
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:93
EcalHitResponse::EcalSamples * EBHitResponse::vSamAll ( unsigned int  i)
protectedvirtual

Implements EcalHitResponse.

Definition at line 324 of file EBHitResponse.cc.

References i, and m_vSam.

325 {
326  return &m_vSam[ i ] ;
327 }
int i
Definition: DBlmapReader.cc:9
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:93
const EcalHitResponse::EcalSamples * EBHitResponse::vSamAll ( unsigned int  i) const
protectedvirtual

Implements EcalHitResponse.

Definition at line 330 of file EBHitResponse.cc.

References i, and m_vSam.

331 {
332  return &m_vSam[ i ] ;
333 }
int i
Definition: DBlmapReader.cc:9
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:93

Member Data Documentation

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

Definition at line 88 of file EBHitResponse.h.

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

const bool EBHitResponse::m_apdOnly
private

Definition at line 81 of file EBHitResponse.h.

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

const APDSimParameters* EBHitResponse::m_apdPars
private

Definition at line 82 of file EBHitResponse.h.

Referenced by apdParameters().

const CaloVShape* EBHitResponse::m_apdShape
private

Definition at line 83 of file EBHitResponse.h.

Referenced by apdShape().

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

Definition at line 89 of file EBHitResponse.h.

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

const EcalIntercalibConstantsMC* EBHitResponse::m_intercal
private

Definition at line 84 of file EBHitResponse.h.

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

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

Definition at line 86 of file EBHitResponse.h.

Referenced by EBHitResponse(), and offsets().

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

Definition at line 93 of file EBHitResponse.h.

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

const double EBHitResponse::pasy
private

Definition at line 91 of file EBHitResponse.h.

const double EBHitResponse::pcon
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc1().

const double EBHitResponse::pcub
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc1().

const double EBHitResponse::pehi
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc().

const double EBHitResponse::pelo
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc().

const double EBHitResponse::pext
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc().

const double EBHitResponse::pfac
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc().

const double EBHitResponse::plin
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc1().

const double EBHitResponse::poff
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc().

const double EBHitResponse::pqua
private

Definition at line 91 of file EBHitResponse.h.

Referenced by nonlFunc1().