CMS 3D CMS Logo

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

#include <HcalShapes.h>

Inheritance diagram for HcalShapes:
CaloShapes

Public Types

enum  {
  HPD =101, LONG =102, ZECOTEK =201, HAMAMATSU =202,
  HE2017 =203, HF =301, ZDC =401
}
 

Public Member Functions

void beginRun (edm::EventSetup const &es)
 
void endRun ()
 
 HcalShapes ()
 
virtual const CaloVShapeshape (const DetId &detId) const
 
 ~HcalShapes ()
 
- Public Member Functions inherited from CaloShapes
 CaloShapes ()
 
 CaloShapes (const CaloVShape *shape)
 

Private Types

typedef std::map< int, const
CaloVShape * > 
ShapeMap
 

Private Member Functions

const CaloVShapedefaultShape (const DetId &detId) const
 

Private Attributes

HcalShape theHcalShape101
 
HcalShape theHcalShape102
 
HcalShape theHcalShape103
 
HcalShape theHcalShape104
 
HcalShape theHcalShape105
 
HcalShape theHcalShape123
 
HcalShape theHcalShape124
 
HcalShape theHcalShape125
 
HcalShape theHcalShape201
 
HcalShape theHcalShape202
 
HcalShape theHcalShape203
 
HcalShape theHcalShape301
 
HcalShape theHcalShape401
 
HcalMCParamstheMCParams
 
ShapeMap theShapes
 
const HcalTopologytheTopology
 
ZDCShape theZDCShape
 

Detailed Description

Definition at line 18 of file HcalShapes.h.

Member Typedef Documentation

typedef std::map<int, const CaloVShape *> HcalShapes::ShapeMap
private

Definition at line 35 of file HcalShapes.h.

Member Enumeration Documentation

anonymous enum
Enumerator
HPD 
LONG 
ZECOTEK 
HAMAMATSU 
HE2017 
HF 
ZDC 

Definition at line 21 of file HcalShapes.h.

Constructor & Destructor Documentation

HcalShapes::HcalShapes ( )

Definition at line 12 of file HcalShapes.cc.

References HcalShape::setShape(), theHcalShape101, theHcalShape102, theHcalShape103, theHcalShape104, theHcalShape105, theHcalShape123, theHcalShape124, theHcalShape125, theHcalShape201, theHcalShape202, theHcalShape203, theHcalShape301, theMCParams, theShapes, theTopology, theZDCShape, and ZDC.

13 : theMCParams(0),
14  theShapes(),
15  theZDCShape(),
29  {
30 /*
31  00 - not used (reserved)
32  101 - regular HPD HB/HE/HO shape
33  102 - "special" HB HPD#14 long shape
34  201 - SiPMs Zecotec shape (HO)
35  202 - SiPMs Hamamatsu shape (HO)
36  203 - SiPMs Hamamatsu shape (HE 2017)
37  301 - regular HF PMT shape
38  401 - regular ZDC shape
39  */
40 
50  theShapes[105] = new CaloCachedShapeIntegrator(&theHcalShape105); // HPD new
65  // ZDC not yet defined in CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc
66  // theHcalShape401(401);
67  // theShapes[401] = new CaloCachedShapeIntegrator(&theHcalShape401);
69 
70  theMCParams=0;
71  theTopology=0;
72 }
HcalShape theHcalShape102
Definition: HcalShapes.h:40
void setShape(int shapeType)
Definition: HcalShape.cc:8
HcalShape theHcalShape203
Definition: HcalShapes.h:49
HcalShape theHcalShape125
Definition: HcalShapes.h:46
HcalShape theHcalShape301
Definition: HcalShapes.h:50
HcalShape theHcalShape101
Definition: HcalShapes.h:39
HcalShape theHcalShape124
Definition: HcalShapes.h:45
HcalShape theHcalShape103
Definition: HcalShapes.h:41
HcalShape theHcalShape105
Definition: HcalShapes.h:43
const HcalTopology * theTopology
Definition: HcalShapes.h:34
HcalShape theHcalShape201
Definition: HcalShapes.h:47
ZDCShape theZDCShape
Definition: HcalShapes.h:37
HcalShape theHcalShape104
Definition: HcalShapes.h:42
HcalMCParams * theMCParams
Definition: HcalShapes.h:33
HcalShape theHcalShape123
Definition: HcalShapes.h:44
HcalShape theHcalShape401
Definition: HcalShapes.h:51
HcalShape theHcalShape202
Definition: HcalShapes.h:48
ShapeMap theShapes
Definition: HcalShapes.h:36
HcalShapes::~HcalShapes ( )

Definition at line 75 of file HcalShapes.cc.

References theMCParams, theShapes, and theTopology.

76 {
77  for(ShapeMap::const_iterator shapeItr = theShapes.begin();
78  shapeItr != theShapes.end(); ++shapeItr)
79  {
80  delete shapeItr->second;
81  }
82  theShapes.clear();
83  if (theMCParams!=0) delete theMCParams;
84  if (theTopology!=0) delete theTopology;
85 }
const HcalTopology * theTopology
Definition: HcalShapes.h:34
HcalMCParams * theMCParams
Definition: HcalShapes.h:33
ShapeMap theShapes
Definition: HcalShapes.h:36

Member Function Documentation

void HcalShapes::beginRun ( edm::EventSetup const &  es)

Definition at line 88 of file HcalShapes.cc.

References edm::EventSetup::get(), AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< class >::product(), HcalCondObjectContainerBase::setTopo(), theMCParams, and theTopology.

Referenced by HcalDigitizer::beginRun().

89 {
91  es.get<HcalMCParamsRcd>().get(p);
92  theMCParams = new HcalMCParams(*p.product());
93 
94 // here we are making a _copy_ so we need to add a copy of the topology...
95 
97  es.get<HcalRecNumberingRecord>().get(htopo);
98  theTopology=new HcalTopology(*htopo);
100 }
const HcalTopology * theTopology
Definition: HcalShapes.h:34
T const * product() const
Definition: ESHandle.h:86
HcalMCParams * theMCParams
Definition: HcalShapes.h:33
void setTopo(const HcalTopology *topo)
const CaloVShape * HcalShapes::defaultShape ( const DetId detId) const
private

Definition at line 128 of file HcalShapes.cc.

References HcalGenericDetId::genericSubdet(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenZDC, HF, HPD, mps_fire::result, theShapes, and ZDC.

Referenced by shape().

129 {
130  // try to figure the appropriate shape
131  const CaloVShape * result;
133  = HcalGenericDetId(detId).genericSubdet();
134  if(subdet == HcalGenericDetId::HcalGenBarrel
135  || subdet == HcalGenericDetId::HcalGenEndcap) result = theShapes.find(HPD)->second;
136  else if(subdet == HcalGenericDetId::HcalGenOuter) result = theShapes.find(HPD)->second;
137  else if(subdet == HcalGenericDetId::HcalGenForward) result = theShapes.find(HF)->second;
138  else if(subdet == HcalGenericDetId::HcalGenZDC) result = theShapes.find(ZDC)->second;
139  else result = 0;
140 
141  edm::LogWarning("HcalShapes") << "Cannot find HCAL MC Params, so the default one is taken for subdet " << subdet;
142 
143  return result;
144 }
Electronic response of the preamp.
Definition: CaloVShape.h:11
tuple result
Definition: mps_fire.py:84
HcalGenericSubdetector genericSubdet() const
ShapeMap theShapes
Definition: HcalShapes.h:36
void HcalShapes::endRun ( )

Definition at line 103 of file HcalShapes.cc.

References theMCParams, and theTopology.

Referenced by HcalDigitizer::endRun().

104 {
105  if (theMCParams) delete theMCParams;
106  theMCParams = 0;
107  if (theTopology) delete theTopology;
108  theTopology = 0;
109 }
const HcalTopology * theTopology
Definition: HcalShapes.h:34
HcalMCParams * theMCParams
Definition: HcalShapes.h:33
const CaloVShape * HcalShapes::shape ( const DetId detId) const
virtual

Reimplemented from CaloShapes.

Definition at line 112 of file HcalShapes.cc.

References defaultShape(), HcalCondObjectContainer< Item >::getValues(), HcalMCParam::signalShape(), theMCParams, and theShapes.

113 {
114  if(!theMCParams) {
115  return defaultShape(detId);
116  }
117  int shapeType = theMCParams->getValues(detId)->signalShape();
118  ShapeMap::const_iterator shapeMapItr = theShapes.find(shapeType);
119  if(shapeMapItr == theShapes.end()) {
120  edm::LogWarning("HcalShapes") << "HcalShapes::shape - shapeType ? = "
121  << shapeType << std::endl;
122  return defaultShape(detId);
123  } else {
124  return shapeMapItr->second;
125  }
126 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
unsigned int signalShape() const
Definition: HcalMCParam.h:40
const CaloVShape * defaultShape(const DetId &detId) const
Definition: HcalShapes.cc:128
HcalMCParams * theMCParams
Definition: HcalShapes.h:33
ShapeMap theShapes
Definition: HcalShapes.h:36

Member Data Documentation

HcalShape HcalShapes::theHcalShape101
private

Definition at line 39 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape102
private

Definition at line 40 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape103
private

Definition at line 41 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape104
private

Definition at line 42 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape105
private

Definition at line 43 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape123
private

Definition at line 44 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape124
private

Definition at line 45 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape125
private

Definition at line 46 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape201
private

Definition at line 47 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape202
private

Definition at line 48 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape203
private

Definition at line 49 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape301
private

Definition at line 50 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape401
private

Definition at line 51 of file HcalShapes.h.

HcalMCParams* HcalShapes::theMCParams
private

Definition at line 33 of file HcalShapes.h.

Referenced by beginRun(), endRun(), HcalShapes(), shape(), and ~HcalShapes().

ShapeMap HcalShapes::theShapes
private

Definition at line 36 of file HcalShapes.h.

Referenced by defaultShape(), HcalShapes(), shape(), and ~HcalShapes().

const HcalTopology* HcalShapes::theTopology
private

Definition at line 34 of file HcalShapes.h.

Referenced by beginRun(), endRun(), HcalShapes(), and ~HcalShapes().

ZDCShape HcalShapes::theZDCShape
private

Definition at line 37 of file HcalShapes.h.

Referenced by HcalShapes().