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

Definition at line 9 of file APDShape.h.

References EcalShapeBase::buildMe(), fillShape(), and EcalShapeBase::m_thresh.

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

Member Function Documentation

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

Implements EcalShapeBase.

Definition at line 8 of file APDShape.cc.

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

Referenced by APDShape().

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