CMS 3D CMS Logo

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

#include <APDShape.h>

Inheritance diagram for APDShape:
EcalShapeBase CaloVShape

Public Member Functions

 APDShape (bool useDB)
 
- 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
 

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 6 of file APDShape.h.

Constructor & Destructor Documentation

◆ APDShape()

APDShape::APDShape ( bool  useDB)
inline

Definition at line 8 of file APDShape.h.

9  if (!useDB)
10  buildMe();
11  } // if useDB = true, then buildMe is executed when setEventSetup and DB conditions are available

References EcalShapeBase::buildMe(), and SiStripMonitorPedestals_cfi::useDB.

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.

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  }
16  es->get<EcalSimPulseShapeRcd>().get(esps);
17 
18  aVec = esps->apd_shape;
19  time_interval = esps->time_interval;
20  m_thresh = esps->apd_thresh;
21  } else {
22  m_thresh = 0.0;
23  time_interval = 1.0;
24  aVec.reserve(500);
25  const double m_tStart = 74.5;
26  const double m_tau = 40.5;
27 
28  for (unsigned int i(0); i != 500; ++i) {
29  const double ctime((1. * i + 0.5 - m_tStart) / m_tau);
30  double val = 0 > ctime ? 0 : ctime * exp(1. - ctime);
31  aVec.push_back(val);
32  }
33  }
34 }

References EcalSimPulseShape::apd_shape, EcalSimPulseShape::apd_thresh, Exception, JetChargeProducer_cfi::exp, edm::EventSetup::get(), get, mps_fire::i, EcalShapeBase::m_thresh, EcalShapeBase::m_useDBShape, EcalSimPulseShape::time_interval, and heppy_batch::val.

EcalShapeBase::m_thresh
double m_thresh
Definition: EcalShapeBase.h:61
mps_fire.i
i
Definition: mps_fire.py:355
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SiStripMonitorPedestals_cfi.useDB
useDB
Definition: SiStripMonitorPedestals_cfi.py:15
edm::ESHandle
Definition: DTSurvey.h:22
EcalSimPulseShape::time_interval
float time_interval
Definition: EcalSimPulseShape.h:21
EcalSimPulseShape::apd_shape
std::vector< double > apd_shape
Definition: EcalSimPulseShape.h:16
EcalShapeBase::m_useDBShape
bool m_useDBShape
Definition: EcalShapeBase.h:54
get
#define get
EcalShapeBase::EcalShapeBase
EcalShapeBase(bool)
Definition: EcalShapeBase.cc:11
heppy_batch.val
val
Definition: heppy_batch.py:351
EcalShapeBase::buildMe
void buildMe(const edm::EventSetup *=nullptr)
Definition: EcalShapeBase.cc:29
Exception
Definition: hltDiff.cc:246
EcalSimPulseShape::apd_thresh
double apd_thresh
Definition: EcalSimPulseShape.h:20
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
EcalSimPulseShapeRcd
Definition: EcalSimPulseShapeRcd.h:5