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
 
const HcalTopologytheTopology
 
ZDCShape theZDCShape
 

Detailed Description

Definition at line 20 of file HcalShapes.h.

Member Typedef Documentation

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

Definition at line 37 of file HcalShapes.h.

Member Enumeration Documentation

anonymous enum
Enumerator
HPD 
LONG 
ZECOTEK 
HAMAMATSU 
HF 
ZDC 

Definition at line 23 of file HcalShapes.h.

Constructor & Destructor Documentation

HcalShapes::HcalShapes ( )

Definition at line 12 of file HcalShapes.cc.

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

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

Definition at line 90 of file HcalShapes.cc.

References theMCParams, theShapes, and theTopology.

91 {
92  for(ShapeMap::const_iterator shapeItr = theShapes.begin();
93  shapeItr != theShapes.end(); ++shapeItr)
94  {
95  delete shapeItr->second;
96  }
97  theShapes.clear();
98  if (theMCParams!=0) delete theMCParams;
99  if (theTopology!=0) delete theTopology;
100 }
const HcalMCParams * theMCParams
Definition: HcalShapes.h:35
const HcalTopology * theTopology
Definition: HcalShapes.h:36
ShapeMap theShapes
Definition: HcalShapes.h:38

Member Function Documentation

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

Definition at line 103 of file HcalShapes.cc.

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

Referenced by HcalDigitizer::beginRun().

104 {
106  es.get<HcalMCParamsRcd>().get(p);
107  theMCParams = new HcalMCParams(*p.product());
108 
109 // here we are making a _copy_ so we need to add a copy of the topology...
110 
112  es.get<IdealGeometryRecord>().get(htopo);
113  theTopology=new HcalTopology(*htopo);
115 }
const HcalMCParams * theMCParams
Definition: HcalShapes.h:35
void setTopo(const HcalTopology *topo) const
const HcalTopology * theTopology
Definition: HcalShapes.h:36
T const * product() const
Definition: ESHandle.h:62
const CaloVShape * HcalShapes::defaultShape ( const DetId detId) const
private

Definition at line 156 of file HcalShapes.cc.

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

Referenced by shape().

157 {
158  // try to figure the appropriate shape
159  const CaloVShape * result;
161  = HcalGenericDetId(detId).genericSubdet();
162  if(subdet == HcalGenericDetId::HcalGenBarrel
163  || subdet == HcalGenericDetId::HcalGenEndcap) result = theShapes.find(0)->second;
164  else if(subdet == HcalGenericDetId::HcalGenOuter) result = theShapes.find(2)->second;
165  else if(subdet == HcalGenericDetId::HcalGenForward) result = theShapes.find(3)->second;
166  else if(subdet == HcalGenericDetId::HcalGenZDC) result = theShapes.find(3)->second;
167  else result = 0;
168 
169  edm::LogWarning("HcalShapes") << "Cannot find HCAL MC Params, so the defalut one is taken for subdet " << subdet;
170 
171  return result;
172 }
Electronic response of the preamp.
Definition: CaloVShape.h:11
tuple result
Definition: query.py:137
HcalGenericSubdetector genericSubdet() const
ShapeMap theShapes
Definition: HcalShapes.h:38
void HcalShapes::endRun ( void  )

Definition at line 118 of file HcalShapes.cc.

References theMCParams, and theTopology.

Referenced by HcalDigitizer::endRun().

119 {
120  if (theMCParams) delete theMCParams;
121  theMCParams = 0;
122  if (theTopology) delete theTopology;
123  theTopology = 0;
124 }
const HcalMCParams * theMCParams
Definition: HcalShapes.h:35
const HcalTopology * theTopology
Definition: HcalShapes.h:36
const CaloVShape * HcalShapes::shape ( const DetId detId) const
virtual

Reimplemented from CaloShapes.

Definition at line 127 of file HcalShapes.cc.

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

128 {
129  if(!theMCParams) {
130  return defaultShape(detId);
131  }
132  int shapeType = theMCParams->getValues(detId)->signalShape();
133  /*
134  HcalDetId cell(detId);
135  int sub = cell.subdet();
136  int depth = cell.depth();
137  int inteta = cell.ieta();
138  int intphi = cell.iphi();
139 
140  std::cout << "(SIM)HcalShapes::shape cell:"
141  << " sub, ieta, iphi, depth = "
142  << sub << " " << inteta << " " << intphi
143  << " " << depth << " => ShapeId "<< shapeType
144  << std::endl;
145  */
146  ShapeMap::const_iterator shapeMapItr = theShapes.find(shapeType);
147  if(shapeMapItr == theShapes.end()) {
148  edm::LogWarning("HcalShapes") << "HcalShapes::shape - shapeType ? = "
149  << shapeType << std::endl;
150  return defaultShape(detId);
151  } else {
152  return shapeMapItr->second;
153  }
154 }
const HcalMCParams * theMCParams
Definition: HcalShapes.h:35
const Item * getValues(DetId fId, bool throwOnFail=true) const
unsigned int signalShape() const
Definition: HcalMCParam.h:38
const CaloVShape * defaultShape(const DetId &detId) const
Definition: HcalShapes.cc:156
ShapeMap theShapes
Definition: HcalShapes.h:38

Member Data Documentation

HcalShape HcalShapes::theHcalShape101
private

Definition at line 44 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape102
private

Definition at line 45 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape103
private

Definition at line 46 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape104
private

Definition at line 47 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape105
private

Definition at line 48 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape123
private

Definition at line 49 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape124
private

Definition at line 50 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape125
private

Definition at line 51 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape201
private

Definition at line 52 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape202
private

Definition at line 53 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape301
private

Definition at line 54 of file HcalShapes.h.

Referenced by HcalShapes().

HcalShape HcalShapes::theHcalShape401
private

Definition at line 55 of file HcalShapes.h.

const HcalMCParams* HcalShapes::theMCParams
private

Definition at line 35 of file HcalShapes.h.

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

ShapeMap HcalShapes::theShapes
private

Definition at line 38 of file HcalShapes.h.

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

const HcalTopology* HcalShapes::theTopology
private

Definition at line 36 of file HcalShapes.h.

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

ZDCShape HcalShapes::theZDCShape
private

Definition at line 41 of file HcalShapes.h.

Referenced by HcalShapes().