CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
HcalSiPMHitResponse Class Reference

#include <HcalSiPMHitResponse.h>

Inheritance diagram for HcalSiPMHitResponse:
CaloHitResponse

Public Member Functions

 HcalSiPMHitResponse (const CaloVSimParameterMap *parameterMap, const CaloShapes *shapes)
 
virtual void run (MixCollection< PCaloHit > &hits)
 Complete cell digitization. More...
 
virtual void setRandomEngine (CLHEP::HepRandomEngine &engine)
 
virtual ~HcalSiPMHitResponse ()
 
- Public Member Functions inherited from CaloHitResponse
virtual void add (const PCaloHit &hit)
 process a single SimHit More...
 
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 PCaloHit &hit, 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...
 
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 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
 
virtual ~CaloHitResponse ()
 doesn't delete the pointers passed in More...
 

Protected Member Functions

virtual CaloSamples makeSiPMSignal (const PCaloHit &inHit, int &integral) const
 

Protected Attributes

double theRecoveryTime
 
HcalSiPMtheSiPM
 
- Protected Attributes inherited from CaloHitResponse
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
 

Additional Inherited Members

- Public Types inherited from CaloHitResponse
enum  { BUNCHSPACE =25 }
 
typedef std::map< DetId,
CaloSamples
AnalogSignalMap
 

Detailed Description

Definition at line 9 of file HcalSiPMHitResponse.h.

Constructor & Destructor Documentation

HcalSiPMHitResponse::HcalSiPMHitResponse ( const CaloVSimParameterMap parameterMap,
const CaloShapes shapes 
)

Definition at line 25 of file HcalSiPMHitResponse.cc.

References theSiPM.

26  :
27  CaloHitResponse(parameterMap, shapes), theSiPM(0), theRecoveryTime(250.) {
28  theSiPM = new HcalSiPM(14000);
29 }
A general implementation for the response of a SiPM.
Definition: HcalSiPM.h:17
CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
HcalSiPMHitResponse::~HcalSiPMHitResponse ( )
virtual

Definition at line 31 of file HcalSiPMHitResponse.cc.

References theSiPM.

31  {
32  if (theSiPM)
33  delete theSiPM;
34 }

Member Function Documentation

CaloSamples HcalSiPMHitResponse::makeSiPMSignal ( const PCaloHit inHit,
int &  integral 
) const
protectedvirtual

Definition at line 78 of file HcalSiPMHitResponse.cc.

References CaloHitResponse::analogSignalAmplitude(), newFWLiteAna::bin, CaloHitResponse::BUNCHSPACE, CaloVHitCorrection::correct(), HcalSiPM::hitCells(), PCaloHit::id(), errorMatrix2Lands_multiChannel::id, CaloHitResponse::makeBlankSignal(), interactiveExample::photons, query::result, HcalSiPM::setNCells(), CaloShapes::shape(), CaloVSimParameterMap::simParameters(), CaloSamples::size(), CaloHitResponse::theHitCorrection, CaloHitResponse::theParameterMap, CaloHitResponse::thePhaseShift_, CaloHitResponse::theShapes, theSiPM, PCaloHit::time(), CaloHitResponse::timeOfFlight(), and tzero.

Referenced by run().

79  {
80  PCaloHit hit = inHit;
81  if (theHitCorrection != 0)
83 
84  DetId id(hit.id());
85  const HcalSimParameters& pars = dynamic_cast<const HcalSimParameters&>(theParameterMap->simParameters(id));
86  theSiPM->setNCells(pars.pixels());
87 
88  double signal = analogSignalAmplitude(hit, pars);
89  int photons = static_cast<int>(signal + 0.5);
90  int pixels = theSiPM->hitCells(photons, integral);
91  integral += pixels;
92  signal = double(pixels);
93 
95 
96  if(pixels > 0)
97  {
98  const CaloVShape * shape = theShapes->shape(id);
99  double jitter = hit.time() - timeOfFlight(id);
100 
101  const double tzero = pars.timePhase() - jitter -
102  BUNCHSPACE*(pars.binOfMaximum() - thePhaseShift_);
103  double binTime = tzero;
104 
105  for (int bin = 0; bin < result.size(); bin++) {
106  result[bin] += (*shape)(binTime)*signal;
107  binTime += BUNCHSPACE;
108  }
109  }
110 
111  return result;
112 }
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
double time() const
Definition: PCaloHit.h:34
Electronic response of the preamp.
Definition: CaloVShape.h:11
virtual void correct(PCaloHit &hit) const =0
void setNCells(int nCells)
Definition: HcalSiPM.cc:65
tuple result
Definition: query.py:137
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
unsigned int id() const
Definition: PCaloHit.h:40
double timeOfFlight(const DetId &detId) const
const CaloVHitCorrection * theHitCorrection
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:69
Definition: DetId.h:20
double analogSignalAmplitude(const PCaloHit &hit, const CaloSimParameters &parameters) const
const CaloShapes * theShapes
virtual int hitCells(int photons, int integral=0) const
Definition: HcalSiPM.cc:21
const CaloVSimParameterMap * theParameterMap
static const double tzero[3]
virtual const CaloVShape * shape(const DetId &detId) const
Definition: CaloShapes.h:15
void HcalSiPMHitResponse::run ( MixCollection< PCaloHit > &  hits)
virtual

Complete cell digitization.

Reimplemented from CaloHitResponse.

Definition at line 36 of file HcalSiPMHitResponse.cc.

References CaloVHitFilter::accepts(), CaloHitResponse::add(), HcalSiPMRecovery::addToHistory(), MixCollection< T >::begin(), HcalSiPMRecovery::clearHistory(), MixCollection< T >::end(), HcalSiPMRecovery::getIntegral(), i, errorMatrix2Lands_multiChannel::id, edm::detail::isnan(), makeSiPMSignal(), CaloHitResponse::theHitFilter, CaloHitResponse::theMaxBunch, CaloHitResponse::theMinBunch, theRecoveryTime, and PCaloHit::time().

36  {
37 
38  typedef std::multiset <const PCaloHit *, PCaloHitCompareTimes> SortedHitSet;
39 
40  std::map< DetId, SortedHitSet > sortedhits;
41  for (MixCollection<PCaloHit>::MixItr hitItr = hits.begin();
42  hitItr != hits.end(); ++hitItr) {
43  if (!((hitItr.bunch() < theMinBunch) || (hitItr.bunch() > theMaxBunch)) &&
44  !(isnan(hitItr->time())) &&
45  ((theHitFilter == 0) || (theHitFilter->accepts(*hitItr)))) {
46  DetId id(hitItr->id());
47  if (sortedhits.find(id)==sortedhits.end())
48  sortedhits.insert(std::pair<DetId, SortedHitSet>(id, SortedHitSet()));
49  sortedhits[id].insert(&(*hitItr));
50  }
51  }
52  int pixelIntegral, oldIntegral;
53  HcalSiPMRecovery pixelHistory(theRecoveryTime);
54  const PCaloHit * hit;
55  for (std::map<DetId, SortedHitSet>::iterator i = sortedhits.begin();
56  i!=sortedhits.end(); ++i) {
57  pixelHistory.clearHistory();
58  for (SortedHitSet::iterator itr = i->second.begin();
59  itr != i->second.end(); ++itr) {
60  hit = *itr;
61  pixelIntegral = pixelHistory.getIntegral(hit->time());
62  oldIntegral = pixelIntegral;
63  CaloSamples signal(makeSiPMSignal(*hit, pixelIntegral));
64  pixelHistory.addToHistory(hit->time(), pixelIntegral-oldIntegral);
65  add(signal);
66  }
67  }
68 }
int i
Definition: DBlmapReader.cc:9
double time() const
Definition: PCaloHit.h:34
iterator end()
virtual CaloSamples makeSiPMSignal(const PCaloHit &inHit, int &integral) const
bool isnan(float x)
Definition: math.h:13
virtual void add(const PCaloHit &hit)
process a single SimHit
virtual bool accepts(const PCaloHit &hit) const =0
Definition: DetId.h:20
iterator begin()
const CaloVHitFilter * theHitFilter
void HcalSiPMHitResponse::setRandomEngine ( CLHEP::HepRandomEngine &  engine)
virtual

Reimplemented from CaloHitResponse.

Definition at line 71 of file HcalSiPMHitResponse.cc.

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

72 {
73  theSiPM->initRandomEngine(engine);
75 }
void initRandomEngine(CLHEP::HepRandomEngine &engine)
Definition: HcalSiPM.cc:70
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)

Member Data Documentation

double HcalSiPMHitResponse::theRecoveryTime
protected

Definition at line 26 of file HcalSiPMHitResponse.h.

Referenced by run().

HcalSiPM* HcalSiPMHitResponse::theSiPM
protected