CMS 3D CMS Logo

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

#include <APDShape.h>

Inheritance diagram for APDShape:
EcalShapeBase CaloVShape

Public Member Functions

 APDShape ()
 
 APDShape (edm::ConsumesCollector iC)
 
- Public Member Functions inherited from EcalShapeBase
double derivative (double time) const
 
 EcalShapeBase (bool)
 
void m_shape_print (const char *fileName)
 
double operator() (double aTime) const override
 
void setEventSetup (const edm::EventSetup &evtSetup)
 
double threshold () const
 
double timeOfMax () const
 
double timeOfThr () const
 
double timeToRise () const override
 
 ~EcalShapeBase () override
 
- Public Member Functions inherited from CaloVShape
 CaloVShape ()
 
virtual ~CaloVShape ()
 

Protected Member Functions

void fillShape (float &time_interval, double &m_thresh, EcalShapeBase::DVec &aVec, const edm::EventSetup *es) const override
 
- Protected Member Functions inherited from EcalShapeBase
void buildMe (const edm::EventSetup *=nullptr)
 
unsigned int timeIndex (double aTime) const
 

Private Attributes

edm::ESGetToken< EcalSimPulseShape, EcalSimPulseShapeRcdespsToken_
 

Additional Inherited Members

- Public Types inherited from EcalShapeBase
typedef std::vector< double > DVec
 
- Protected Attributes inherited from EcalShapeBase
bool m_useDBShape
 

Detailed Description

Definition at line 7 of file APDShape.h.

Constructor & Destructor Documentation

◆ APDShape() [1/2]

APDShape::APDShape ( )
inline

Definition at line 10 of file APDShape.h.

References EcalShapeBase::buildMe().

10 : EcalShapeBase(false) { buildMe(); }
void buildMe(const edm::EventSetup *=nullptr)

◆ APDShape() [2/2]

APDShape::APDShape ( edm::ConsumesCollector  iC)
inline

Definition at line 12 of file APDShape.h.

12 : EcalShapeBase(true), espsToken_(iC.esConsumes()) {}
edm::ESGetToken< EcalSimPulseShape, EcalSimPulseShapeRcd > espsToken_
Definition: APDShape.h:21

Member Function Documentation

◆ fillShape()

void APDShape::fillShape ( float &  time_interval,
double &  m_thresh,
EcalShapeBase::DVec aVec,
const edm::EventSetup es 
) const
overrideprotectedvirtual

Implements EcalShapeBase.

Definition at line 7 of file APDShape.cc.

References espsToken_, Exception, JetChargeProducer_cfi::exp, edm::EventSetup::getData(), mps_fire::i, EcalShapeBase::m_thresh, EcalShapeBase::m_useDBShape, and heppy_batch::val.

10  {
11  if (m_useDBShape) {
12  if (es == nullptr) {
13  throw cms::Exception("EcalShapeBase:: DB conditions are not available, const edm::EventSetup* es == nullptr ");
14  }
15  auto const& esps = es->getData(espsToken_);
16 
17  aVec = esps.apd_shape;
18  time_interval = esps.time_interval;
19  m_thresh = esps.apd_thresh;
20  } else {
21  m_thresh = 0.0;
22  time_interval = 1.0;
23  aVec.reserve(500);
24  const double m_tStart = 74.5;
25  const double m_tau = 40.5;
26 
27  for (unsigned int i(0); i != 500; ++i) {
28  const double ctime((1. * i + 0.5 - m_tStart) / m_tau);
29  double val = 0 > ctime ? 0 : ctime * exp(1. - ctime);
30  aVec.push_back(val);
31  }
32  }
33 }
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::ESGetToken< EcalSimPulseShape, EcalSimPulseShapeRcd > espsToken_
Definition: APDShape.h:21

Member Data Documentation

◆ espsToken_

edm::ESGetToken<EcalSimPulseShape, EcalSimPulseShapeRcd> APDShape::espsToken_
private

Definition at line 21 of file APDShape.h.

Referenced by fillShape().