#include <HcalShapes.h>
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 CaloVShape * | shape (const DetId &detId) const |
~HcalShapes () | |
Private Types | |
typedef std::map< int, const CaloVShape * > | ShapeMap |
Private Member Functions | |
const CaloVShape * | defaultShape (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 HcalMCParams * | theMCParams |
ShapeMap | theShapes |
const HcalTopology * | theTopology |
ZDCShape | theZDCShape |
Definition at line 20 of file HcalShapes.h.
typedef std::map<int, const CaloVShape *> HcalShapes::ShapeMap [private] |
Definition at line 37 of file HcalShapes.h.
anonymous enum |
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.
: theMCParams(0), theShapes(), theZDCShape(), theHcalShape101(), theHcalShape102(), theHcalShape103(), theHcalShape104(), theHcalShape105(), theHcalShape123(), theHcalShape124(), theHcalShape125(), theHcalShape201(), theHcalShape202(), theHcalShape301(), theHcalShape401() { /* 00 - not used (reserved) 101 - regular HPD HB/HE/HO shape 102 - "special" HB HPD#14 long shape 201 - SiPMs Zecotec shape (HO) 202 - SiPMs Hamamatsu shape (HO) 301 - regular HF PMT shape 401 - regular ZDC shape */ /* theShapes[HPD] = new CaloCachedShapeIntegrator(&theHcalShape); theShapes[LONG] = theShapes[HPD]; theShapes[ZECOTEK] = new CaloCachedShapeIntegrator(&theSiPMShape); theShapes[HAMAMATSU] = theShapes[ZECOTEK]; theShapes[HF] = new CaloCachedShapeIntegrator(&theHFShape); */ theHcalShape101.setShape(101); theShapes[101] = new CaloCachedShapeIntegrator(&theHcalShape101); theHcalShape102.setShape(102); theShapes[102] = new CaloCachedShapeIntegrator(&theHcalShape102); theHcalShape103.setShape(103); theShapes[103] = new CaloCachedShapeIntegrator(&theHcalShape103); theHcalShape104.setShape(104); theShapes[104] = new CaloCachedShapeIntegrator(&theHcalShape104); theHcalShape104.setShape(105); theShapes[105] = new CaloCachedShapeIntegrator(&theHcalShape105); // HPD new theHcalShape123.setShape(123); theShapes[123] = new CaloCachedShapeIntegrator(&theHcalShape123); theHcalShape124.setShape(124); theShapes[124] = new CaloCachedShapeIntegrator(&theHcalShape124); theHcalShape125.setShape(125); theShapes[125] = new CaloCachedShapeIntegrator(&theHcalShape125); theHcalShape201.setShape(201); theShapes[201] = new CaloCachedShapeIntegrator(&theHcalShape201); theHcalShape202.setShape(202); theShapes[202] = new CaloCachedShapeIntegrator(&theHcalShape202); theHcalShape301.setShape(301); theShapes[301] = new CaloCachedShapeIntegrator(&theHcalShape301); // ZDC not yet defined in CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc // theHcalShape401(401); // theShapes[401] = new CaloCachedShapeIntegrator(&theHcalShape401); theShapes[ZDC] = new CaloCachedShapeIntegrator(&theZDCShape); // backward-compatibility with old scheme theShapes[0] = theShapes[HPD]; //FIXME "special" HB theShapes[1] = theShapes[LONG]; theShapes[2] = theShapes[ZECOTEK]; theShapes[3] = theShapes[HF]; theShapes[4] = theShapes[ZDC]; theMCParams=0; theTopology=0; }
HcalShapes::~HcalShapes | ( | ) |
Definition at line 90 of file HcalShapes.cc.
References theMCParams, theShapes, and theTopology.
{ for(ShapeMap::const_iterator shapeItr = theShapes.begin(); shapeItr != theShapes.end(); ++shapeItr) { delete shapeItr->second; } theShapes.clear(); if (theMCParams!=0) delete theMCParams; if (theTopology!=0) delete theTopology; }
void HcalShapes::beginRun | ( | edm::EventSetup const & | es | ) |
Definition at line 103 of file HcalShapes.cc.
References edm::EventSetup::get(), AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), HcalCondObjectContainerBase::setTopo(), theMCParams, and theTopology.
Referenced by HcalDigitizer::beginRun().
{ edm::ESHandle<HcalMCParams> p; es.get<HcalMCParamsRcd>().get(p); theMCParams = new HcalMCParams(*p.product()); // here we are making a _copy_ so we need to add a copy of the topology... edm::ESHandle<HcalTopology> htopo; es.get<IdealGeometryRecord>().get(htopo); theTopology=new HcalTopology(*htopo); theMCParams->setTopo(theTopology); }
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().
{ // try to figure the appropriate shape const CaloVShape * result; HcalGenericDetId::HcalGenericSubdetector subdet = HcalGenericDetId(detId).genericSubdet(); if(subdet == HcalGenericDetId::HcalGenBarrel || subdet == HcalGenericDetId::HcalGenEndcap) result = theShapes.find(0)->second; else if(subdet == HcalGenericDetId::HcalGenOuter) result = theShapes.find(2)->second; else if(subdet == HcalGenericDetId::HcalGenForward) result = theShapes.find(3)->second; else if(subdet == HcalGenericDetId::HcalGenZDC) result = theShapes.find(3)->second; else result = 0; edm::LogWarning("HcalShapes") << "Cannot find HCAL MC Params, so the defalut one is taken for subdet " << subdet; return result; }
void HcalShapes::endRun | ( | void | ) |
Definition at line 118 of file HcalShapes.cc.
References theMCParams, and theTopology.
Referenced by HcalDigitizer::endRun().
{ if (theMCParams) delete theMCParams; theMCParams = 0; if (theTopology) delete theTopology; theTopology = 0; }
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.
{ if(!theMCParams) { return defaultShape(detId); } int shapeType = theMCParams->getValues(detId)->signalShape(); /* HcalDetId cell(detId); int sub = cell.subdet(); int depth = cell.depth(); int inteta = cell.ieta(); int intphi = cell.iphi(); std::cout << "(SIM)HcalShapes::shape cell:" << " sub, ieta, iphi, depth = " << sub << " " << inteta << " " << intphi << " " << depth << " => ShapeId "<< shapeType << std::endl; */ ShapeMap::const_iterator shapeMapItr = theShapes.find(shapeType); if(shapeMapItr == theShapes.end()) { edm::LogWarning("HcalShapes") << "HcalShapes::shape - shapeType ? = " << shapeType << std::endl; return defaultShape(detId); } else { return shapeMapItr->second; } }
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().