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

Creates electronics signals from EB hits , including APD. More...

#include <EBHitResponse.h>

Inheritance diagram for EBHitResponse:
CaloHitRespoNew

Public Types

enum  { kNOffsets = 2000 }
 
typedef CaloHitRespoNew CaloHitResponse
 
typedef std::vector< double > VecD
 
- Public Types inherited from CaloHitRespoNew
enum  { BUNCHSPACE =25 }
 
typedef std::vector< unsigned int > VecInd
 
typedef std::vector< CaloSamplesVecSam
 

Public Member Functions

 EBHitResponse (const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool apdOnly, const APDSimParameters *apdPars, const CaloVShape *apdShape)
 
virtual bool keepBlank () const
 
const VecDoffsets () const
 
void setIntercal (const EcalIntercalibConstantsMC *ical)
 
virtual ~EBHitResponse ()
 
- Public Member Functions inherited from CaloHitRespoNew
 CaloHitRespoNew (const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
 
const CaloSamplesoperator[] (unsigned int i) const
 
virtual void run (MixCollection< PCaloHit > &hits)
 
unsigned int samplesSize () const
 
void setBunchRange (int minBunch, int maxBunch)
 
void setGeometry (const CaloSubdetectorGeometry *geometry)
 
void setHitCorrection (const CaloVHitCorrection *hitCorrection)
 
void setHitFilter (const CaloVHitFilter *filter)
 
void setPECorrection (const CaloVPECorrection *peCorrection)
 
void setPhaseShift (double phaseShift)
 
virtual void setRandomEngine (CLHEP::HepRandomEngine &engine) const
 
virtual ~CaloHitRespoNew ()
 

Protected Member Functions

virtual void putAnalogSignal (const PCaloHit &inputHit)
 
- Protected Member Functions inherited from CaloHitRespoNew
double analogSignalAmplitude (const PCaloHit &hit) const
 
void blankOutUsedSamples ()
 
CaloSamplesfindSignal (const DetId &detId)
 
const CaloSubdetectorGeometrygeometry () const
 
const CaloSimParametersparams (const DetId &detId) const
 
double phaseShift () const
 
CLHEP::RandGaussQ * ranGauss () const
 
CLHEP::RandPoissonQ * ranPois () const
 
void setupSamples (const DetId &detId)
 
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
 

Private Attributes

const bool m_apdOnly
 
const APDSimParametersm_apdPars
 
const CaloVShapem_apdShape
 
const EcalIntercalibConstantsMCm_intercal
 
std::vector< double > m_timeOffVec
 

Detailed Description

Creates electronics signals from EB hits , including APD.

Definition at line 17 of file EBHitResponse.h.

Member Typedef Documentation

Definition at line 21 of file EBHitResponse.h.

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

Definition at line 23 of file EBHitResponse.h.

Member Enumeration Documentation

anonymous enum
Enumerator
kNOffsets 

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

References apdParameters(), i, kNOffsets, m_timeOffVec, and CaloHitRespoNew::ranGauss().

15  :
16 
17  CaloHitResponse( parameterMap,
18  shape ),
19 
20  m_apdOnly ( apdOnly ) ,
21  m_apdPars ( apdPars ) ,
22  m_apdShape ( apdShape ) ,
23  m_timeOffVec ( kNOffsets, apdParameters()->timeOffset() )
24 {
25  for( unsigned int i ( 0 ) ; i != kNOffsets ; ++i )
26  {
27  m_timeOffVec[ i ] +=
28  ranGauss()->fire( 0 , apdParameters()->timeOffWidth() ) ;
29  }
30 }
int i
Definition: DBlmapReader.cc:9
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:57
const APDSimParameters * apdParameters() const
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:56
CLHEP::RandGaussQ * ranGauss() const
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:60
CaloHitRespoNew CaloHitResponse
Definition: EBHitResponse.h:21
const bool m_apdOnly
Definition: EBHitResponse.h:55
EBHitResponse::~EBHitResponse ( )
virtual

Definition at line 32 of file EBHitResponse.cc.

33 {
34 }

Member Function Documentation

const APDSimParameters * EBHitResponse::apdParameters ( ) const
private

Definition at line 38 of file EBHitResponse.cc.

References m_apdPars.

Referenced by apdSignalAmplitude(), EBHitResponse(), and putAnalogSignal().

39 {
40  assert ( 0 != m_apdPars ) ;
41  return m_apdPars ;
42 }
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:56
const CaloVShape * EBHitResponse::apdShape ( ) const
private

Definition at line 45 of file EBHitResponse.cc.

References m_apdShape.

Referenced by putAnalogSignal().

46 {
47  assert( 0 != m_apdShape ) ;
48  return m_apdShape ;
49 }
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:57
double EBHitResponse::apdSignalAmplitude ( const PCaloHit hit) const
private

Definition at line 98 of file EBHitResponse.cc.

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

Referenced by putAnalogSignal().

99 {
100  assert( 1 == hit.depth() ||
101  2 == hit.depth() ) ;
102 
103  double npe ( hit.energy()*( 2 == hit.depth() ?
105  apdParameters()->simToPEHigh() ) ) ;
106 
107  // do we need to doPoisson statistics for the photoelectrons?
108  if( apdParameters()->doPEStats() &&
109  !m_apdOnly ) npe = ranPois()->fire( npe ) ;
110 
111  assert( 0 != m_intercal ) ;
112  double fac ( 1 ) ;
113  findIntercalibConstant( hit.id(), fac ) ;
114 
115  npe *= fac ;
116 // edm::LogError( "EBHitResponse" ) << "--- # photoelectrons for "
117 /* std::cout << "--- # photoelectrons for "
118  << EBDetId( hit.id() )
119  <<" is " << npe //;
120  <<std::endl ;*/
121 
122  return npe ;
123 }
double simToPEHigh() const
double energy() const
Definition: PCaloHit.h:29
uint16_t depth() const
Definition: PCaloHit.h:45
const APDSimParameters * apdParameters() const
void findIntercalibConstant(const DetId &detId, double &icalconst) const
unsigned int id() const
Definition: PCaloHit.h:40
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:58
CLHEP::RandPoissonQ * ranPois() const
const bool m_apdOnly
Definition: EBHitResponse.h:55
double simToPELow() const
void EBHitResponse::findIntercalibConstant ( const DetId detId,
double &  icalconst 
) const
private

Definition at line 132 of file EBHitResponse.cc.

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

Referenced by apdSignalAmplitude().

134 {
135  EcalIntercalibConstantMC thisconst ( 1. ) ;
136 
137  if( 0 == m_intercal )
138  {
139  edm::LogError( "EBHitResponse" ) <<
140  "No intercal constant defined for EBHitResponse" ;
141  }
142  else
143  {
144  const EcalIntercalibConstantMCMap& icalMap ( m_intercal->getMap() ) ;
145  EcalIntercalibConstantMCMap::const_iterator icalit ( icalMap.find( detId ) ) ;
146  if( icalit != icalMap.end() )
147  {
148  thisconst = *icalit ;
149  if ( thisconst == 0. ) thisconst = 1. ;
150  }
151  else
152  {
153  edm::LogError("EBHitResponse") << "No intercalib const found for xtal "
154  << detId.rawId()
155  << "! something wrong with EcalIntercalibConstants in your DB? ";
156  }
157  }
158  icalconst = thisconst ;
159 }
const self & getMap() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:58
std::vector< Item >::const_iterator const_iterator
float EcalIntercalibConstantMC
virtual bool EBHitResponse::keepBlank ( ) const
inlinevirtual

Definition at line 35 of file EBHitResponse.h.

References funct::false.

35 { return false ; }
const VecD& EBHitResponse::offsets ( ) const
inline

Definition at line 39 of file EBHitResponse.h.

References m_timeOffVec.

Referenced by putAnalogSignal().

39 { return m_timeOffVec ; }
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:60
void EBHitResponse::putAnalogSignal ( const PCaloHit inputHit)
protectedvirtual

Reimplemented from CaloHitRespoNew.

Definition at line 52 of file EBHitResponse.cc.

References apdParameters(), apdShape(), apdSignalAmplitude(), newFWLiteAna::bin, CaloSimParameters::binOfMaximum(), CaloHitRespoNew::BUNCHSPACE, PCaloHit::depth(), CaloHitRespoNew::findSignal(), PCaloHit::id(), kNOffsets, m_apdOnly, offsets(), ExpressReco_HICollisions_FallBack::parameters, CaloHitRespoNew::params(), CaloHitRespoNew::phaseShift(), CaloHitRespoNew::putAnalogSignal(), query::result, PCaloHit::time(), CaloHitRespoNew::timeOfFlight(), and tzero.

53 {
54  const unsigned int depth ( hit.depth() ) ;
55  if( !m_apdOnly &&
56  0 == depth )
57  {
59  }
60  else
61  {
62  if( 0 != depth &&
63  ( apdParameters()->addToBarrel() ||
64  m_apdOnly ) ) // can digitize apd
65  {
66  const DetId detId ( hit.id() ) ;
67  CaloSamples& result ( *findSignal( detId ) );
68 
69 // edm::LogError( "EBHitResponse" )<<"---APD SimHit found for "
70 /* std::cout<<"---APD SimHit found for "
71  << EBDetId( detId )
72  <<", depth="<< depth
73  <<std::endl ;*/
74 
75  const double signal ( apdSignalAmplitude( hit ) ) ;
76 
77  const CaloSimParameters& parameters ( *params( detId ) ) ;
78 
79  const double jitter ( hit.time() - timeOfFlight( detId ) ) ;
80 
81  const double tzero ( apdShape()->timeToRise()
82  - jitter
83  - offsets()[ EBDetId( detId ).denseIndex()%kNOffsets ]
84  - BUNCHSPACE*( parameters.binOfMaximum()
85  - phaseShift() ) ) ;
86  double binTime ( tzero ) ;
87 
88  for( int bin ( 0 ) ; bin != result.size(); ++bin )
89  {
90  result[bin] += (*apdShape())(binTime)*signal;
91  binTime += BUNCHSPACE;
92  }
93  }
94  }
95 }
double timeOfFlight(const DetId &detId) const
const APDSimParameters * apdParameters() const
Main class for Parameters in different subdetectors.
CaloSamples * findSignal(const DetId &detId)
double phaseShift() const
virtual void putAnalogSignal(const PCaloHit &inputHit)
const VecD & offsets() const
Definition: EBHitResponse.h:39
tuple result
Definition: query.py:137
unsigned int id
Definition: DetId.h:20
const CaloSimParameters * params(const DetId &detId) const
static const double tzero[3]
double apdSignalAmplitude(const PCaloHit &hit) const
const bool m_apdOnly
Definition: EBHitResponse.h:55
const CaloVShape * apdShape() const
void EBHitResponse::setIntercal ( const EcalIntercalibConstantsMC ical)

Definition at line 126 of file EBHitResponse.cc.

References m_intercal.

Referenced by EcalDigiProducer::checkCalibrations().

127 {
128  m_intercal = ical ;
129 }
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:58

Member Data Documentation

const bool EBHitResponse::m_apdOnly
private

Definition at line 55 of file EBHitResponse.h.

Referenced by apdSignalAmplitude(), and putAnalogSignal().

const APDSimParameters* EBHitResponse::m_apdPars
private

Definition at line 56 of file EBHitResponse.h.

Referenced by apdParameters().

const CaloVShape* EBHitResponse::m_apdShape
private

Definition at line 57 of file EBHitResponse.h.

Referenced by apdShape().

const EcalIntercalibConstantsMC* EBHitResponse::m_intercal
private

Definition at line 58 of file EBHitResponse.h.

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

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

Definition at line 60 of file EBHitResponse.h.

Referenced by EBHitResponse(), and offsets().