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,
  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 theHcalShape301
 
HcalShape theHcalShape401
 
const HcalMCParamstheMCParams
 
ShapeMap theShapes
 
ZDCShape theZDCShape
 

Detailed Description

Definition at line 19 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 
HF 
ZDC 

Definition at line 22 of file HcalShapes.h.

Constructor & Destructor Documentation

HcalShapes::HcalShapes ( )

Definition at line 11 of file HcalShapes.cc.

References HF, HPD, LONG, HcalShape::setShape(), theHcalShape101, theHcalShape102, theHcalShape103, theHcalShape104, theHcalShape105, theHcalShape123, theHcalShape124, theHcalShape125, theHcalShape201, theHcalShape202, theHcalShape301, theShapes, theZDCShape, ZDC, and ZECOTEK.

12 : theMCParams(0),
13  theShapes(),
14  theZDCShape(),
27  {
28 /*
29  00 - not used (reserved)
30  101 - regular HPD HB/HE/HO shape
31  102 - "special" HB HPD#14 long shape
32  201 - SiPMs Zecotec shape (HO)
33  202 - SiPMs Hamamatsu shape (HO)
34  301 - regular HF PMT shape
35  401 - regular ZDC shape
36  */
37 
38 /*
39  theShapes[HPD] = new CaloCachedShapeIntegrator(&theHcalShape);
40  theShapes[LONG] = theShapes[HPD];
41  theShapes[ZECOTEK] = new CaloCachedShapeIntegrator(&theSiPMShape);
42  theShapes[HAMAMATSU] = theShapes[ZECOTEK];
43  theShapes[HF] = new CaloCachedShapeIntegrator(&theHFShape);
44 */
45 
55  theShapes[105] = new CaloCachedShapeIntegrator(&theHcalShape105); // HPD new
68  // ZDC not yet defined in CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc
69  // theHcalShape401(401);
70  // theShapes[401] = new CaloCachedShapeIntegrator(&theHcalShape401);
72 
73 
74 
75  // backward-compatibility with old scheme
76 
77  theShapes[0] = theShapes[HPD];
78  //FIXME "special" HB
79  theShapes[1] = theShapes[LONG];
81  theShapes[3] = theShapes[HF];
82  theShapes[4] = theShapes[ZDC];
83 
84 }
const HcalMCParams * theMCParams
Definition: HcalShapes.h:34
HcalShape theHcalShape102
Definition: HcalShapes.h:43
void setShape(int shapeType)
Definition: HcalShape.cc:9
HcalShape theHcalShape125
Definition: HcalShapes.h:49
HcalShape theHcalShape301
Definition: HcalShapes.h:52
HcalShape theHcalShape101
Definition: HcalShapes.h:42
HcalShape theHcalShape124
Definition: HcalShapes.h:48
HcalShape theHcalShape103
Definition: HcalShapes.h:44
HcalShape theHcalShape105
Definition: HcalShapes.h:46
HcalShape theHcalShape201
Definition: HcalShapes.h:50
ZDCShape theZDCShape
Definition: HcalShapes.h:39
HcalShape theHcalShape104
Definition: HcalShapes.h:45
HcalShape theHcalShape123
Definition: HcalShapes.h:47
HcalShape theHcalShape401
Definition: HcalShapes.h:53
HcalShape theHcalShape202
Definition: HcalShapes.h:51
ShapeMap theShapes
Definition: HcalShapes.h:36
HcalShapes::~HcalShapes ( )

Definition at line 87 of file HcalShapes.cc.

References theMCParams, and theShapes.

88 {
89  for(ShapeMap::const_iterator shapeItr = theShapes.begin();
90  shapeItr != theShapes.end(); ++shapeItr)
91  {
92  delete shapeItr->second;
93  }
94  theShapes.clear();
95  delete theMCParams;
96 }
const HcalMCParams * theMCParams
Definition: HcalShapes.h:34
ShapeMap theShapes
Definition: HcalShapes.h:36

Member Function Documentation

void HcalShapes::beginRun ( edm::EventSetup const &  es)
const CaloVShape * HcalShapes::defaultShape ( const DetId detId) const
private

Definition at line 143 of file HcalShapes.cc.

References HcalGenericDetId::genericSubdet(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenZDC, query::result, and theShapes.

Referenced by shape().

144 {
145  // try to figure the appropriate shape
146  const CaloVShape * result;
148  = HcalGenericDetId(detId).genericSubdet();
149  if(subdet == HcalGenericDetId::HcalGenBarrel
150  || subdet == HcalGenericDetId::HcalGenEndcap) result = theShapes.find(0)->second;
151  else if(subdet == HcalGenericDetId::HcalGenOuter) result = theShapes.find(2)->second;
152  else if(subdet == HcalGenericDetId::HcalGenForward) result = theShapes.find(3)->second;
153  else if(subdet == HcalGenericDetId::HcalGenZDC) result = theShapes.find(3)->second;
154  else result = 0;
155 
156  edm::LogWarning("HcalShapes") << "Cannot find HCAL MC Params, so the defalut one is taken for subdet " << subdet;
157 
158  return result;
159 }
Electronic response of the preamp.
Definition: CaloVShape.h:11
tuple result
Definition: query.py:137
HcalGenericSubdetector genericSubdet() const
ShapeMap theShapes
Definition: HcalShapes.h:36
void HcalShapes::endRun ( void  )

Definition at line 107 of file HcalShapes.cc.

References theMCParams.

Referenced by HcalDigitizer::endRun().

108 {
109  delete theMCParams;
110  theMCParams = 0;
111 }
const HcalMCParams * theMCParams
Definition: HcalShapes.h:34
const CaloVShape * HcalShapes::shape ( const DetId detId) const
virtual

Reimplemented from CaloShapes.

Definition at line 114 of file HcalShapes.cc.

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

115 {
116  if(!theMCParams) {
117  return defaultShape(detId);
118  }
119  int shapeType = theMCParams->getValues(detId)->signalShape();
120  /*
121  HcalDetId cell(detId);
122  int sub = cell.subdet();
123  int depth = cell.depth();
124  int inteta = cell.ieta();
125  int intphi = cell.iphi();
126 
127  std::cout << "(SIM)HcalShapes::shape cell:"
128  << " sub, ieta, iphi, depth = "
129  << sub << " " << inteta << " " << intphi
130  << " " << depth << " => ShapeId "<< shapeType
131  << std::endl;
132  */
133  ShapeMap::const_iterator shapeMapItr = theShapes.find(shapeType);
134  if(shapeMapItr == theShapes.end()) {
135  edm::LogWarning("HcalShapes") << "HcalShapes::shape - shapeType ? = "
136  << shapeType << std::endl;
137  return defaultShape(detId);
138  } else {
139  return shapeMapItr->second;
140  }
141 }
const HcalMCParams * theMCParams
Definition: HcalShapes.h:34
unsigned int signalShape() const
Definition: HcalMCParam.h:38
const CaloVShape * defaultShape(const DetId &detId) const
Definition: HcalShapes.cc:143
const Item * getValues(DetId fId) const
ShapeMap theShapes
Definition: HcalShapes.h:36

Member Data Documentation

HcalShape HcalShapes::theHcalShape101
private

Definition at line 42 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape102
private

Definition at line 43 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape103
private

Definition at line 44 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape104
private

Definition at line 45 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape105
private

Definition at line 46 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape123
private

Definition at line 47 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape124
private

Definition at line 48 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape125
private

Definition at line 49 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape201
private

Definition at line 50 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape202
private

Definition at line 51 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape301
private

Definition at line 52 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape401
private

Definition at line 53 of file HcalShapes.h.

const HcalMCParams* HcalShapes::theMCParams
private

Definition at line 34 of file HcalShapes.h.

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

ShapeMap HcalShapes::theShapes
private

Definition at line 36 of file HcalShapes.h.

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

ZDCShape HcalShapes::theZDCShape
private

Definition at line 39 of file HcalShapes.h.

Referenced by HcalShapes().