CMS 3D CMS Logo

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

#include <ComponentShape.h>

Inheritance diagram for ComponentShape:
EcalShapeBase CaloVShape

Public Member Functions

 ComponentShape (int shapeIndex)
 
 ComponentShape (int shapeIndex, edm::ESGetToken< EcalSimComponentShape, EcalSimComponentShapeRcd > espsToken)
 
double timeToRise () const override
 
- Public Member Functions inherited from EcalShapeBase
double derivative (double time) const
 
 EcalShapeBase (bool)
 
void m_shape_print (const char *fileName) const
 
double operator() (double aTime) const override
 
void setEventSetup (const edm::EventSetup &evtSetup, bool normalize=true)
 
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, bool normalize=true)
 
unsigned int timeIndex (double aTime) const
 

Private Attributes

edm::ESGetToken< EcalSimComponentShape, EcalSimComponentShapeRcdespsToken_
 
int shapeIndex_
 

Static Private Attributes

static constexpr double kTimeToRise = 16.
 

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 9 of file ComponentShape.h.

Constructor & Destructor Documentation

◆ ComponentShape() [1/2]

ComponentShape::ComponentShape ( int  shapeIndex)
inline

Definition at line 12 of file ComponentShape.h.

References EcalShapeBase::buildMe().

12 : EcalShapeBase(false), shapeIndex_(shapeIndex) { buildMe(nullptr, false); }
void buildMe(const edm::EventSetup *=nullptr, bool normalize=true)

◆ ComponentShape() [2/2]

ComponentShape::ComponentShape ( int  shapeIndex,
edm::ESGetToken< EcalSimComponentShape, EcalSimComponentShapeRcd espsToken 
)
inline

Definition at line 14 of file ComponentShape.h.

15  : EcalShapeBase(true), espsToken_(espsToken), shapeIndex_(shapeIndex) {}
edm::ESGetToken< EcalSimComponentShape, EcalSimComponentShapeRcd > espsToken_

Member Function Documentation

◆ fillShape()

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

Implements EcalShapeBase.

Definition at line 5 of file ComponentShape.cc.

References espsToken_, Exception, edm::EventSetup::getData(), mps_fire::i, EcalShapeBase::m_thresh, EcalShapeBase::m_useDBShape, and shapeIndex_.

8  {
9  if (m_useDBShape) {
10  if (es == nullptr) {
11  throw cms::Exception("[ComponentShape] DB conditions are not available, const edm::EventSetup* es == nullptr ");
12  }
13  auto const& esps = es->getData(espsToken_);
14 
15  //barrel_shapes elements are vectors of floats, to save space in db
16  aVec = std::vector<double>(esps.barrel_shapes.at(shapeIndex_).begin(), esps.barrel_shapes.at(shapeIndex_).end());
17  time_interval = esps.time_interval;
18  m_thresh = esps.barrel_thresh;
19  }
20 
21  else { // fill with dummy values, since this code is only reached before the actual digi simulation
22  m_thresh = 0.00013;
23  time_interval = 1.0;
24  aVec.reserve(500);
25  for (unsigned int i(0); i != 500; ++i)
26  aVec.push_back(0.0);
27  }
28 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< EcalSimComponentShape, EcalSimComponentShapeRcd > espsToken_

◆ timeToRise()

double ComponentShape::timeToRise ( ) const
overridevirtual

Implements CaloVShape.

Definition at line 30 of file ComponentShape.cc.

References kTimeToRise.

30  {
31  return kTimeToRise;
32 } // hardcoded rather than computed because
static constexpr double kTimeToRise

Member Data Documentation

◆ espsToken_

edm::ESGetToken<EcalSimComponentShape, EcalSimComponentShapeRcd> ComponentShape::espsToken_
private

Definition at line 27 of file ComponentShape.h.

Referenced by fillShape().

◆ kTimeToRise

constexpr double ComponentShape::kTimeToRise = 16.
staticprivate

Definition at line 29 of file ComponentShape.h.

Referenced by timeToRise().

◆ shapeIndex_

int ComponentShape::shapeIndex_
private

Definition at line 28 of file ComponentShape.h.

Referenced by fillShape().