CMS 3D CMS Logo

Public Member Functions | Private Attributes

HcalShapes Class Reference

#include <HcalShapes.h>

Inheritance diagram for HcalShapes:
CaloShapes

List of all members.

Public Member Functions

void beginRun (edm::EventSetup const &es)
void endRun ()
 HcalShapes ()
virtual const CaloVShapeshape (const DetId &detId) const
 ~HcalShapes ()

Private Attributes

HcalShape theHcalShape
HFShape theHFShape
const HcalMCParamstheMCParams
std::vector< const CaloVShape * > theShapes
HcalSiPMShape theSiPMShape
ZDCShape theZDCShape

Detailed Description

Definition at line 19 of file HcalShapes.h.


Constructor & Destructor Documentation

HcalShapes::HcalShapes ( )
HcalShapes::~HcalShapes ( )

Definition at line 27 of file HcalShapes.cc.

References theMCParams, and theShapes.

{
  for(std::vector<const CaloVShape *>::const_iterator shapeItr = theShapes.begin();
      shapeItr != theShapes.end();  ++shapeItr)
  {
    delete *shapeItr;
  }
  theShapes.clear();
  delete theMCParams;
}

Member Function Documentation

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

Definition at line 47 of file HcalShapes.cc.

References theMCParams.

Referenced by HcalDigitizer::endRun().

{
  delete theMCParams;
  theMCParams = 0;
}
const CaloVShape * HcalShapes::shape ( const DetId detId) const [virtual]

Reimplemented from CaloShapes.

Definition at line 54 of file HcalShapes.cc.

References HcalGenericDetId::genericSubdet(), HcalCondObjectContainer< Item >::getValues(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenZDC, HcalMCParam::signalShape(), theMCParams, and theShapes.

{
  if(!theMCParams) {
    edm::LogWarning("HcalShapes") << "Cannot find HCAL MC Params ";
    // try to figure the appropriate shape
    HcalGenericDetId::HcalGenericSubdetector subdet = HcalGenericDetId(detId).genericSubdet();
    if(subdet == HcalGenericDetId::HcalGenBarrel || subdet == HcalGenericDetId::HcalGenEndcap) return theShapes[0];
    else if(subdet == HcalGenericDetId::HcalGenOuter) return theShapes[2];
    else if(subdet == HcalGenericDetId::HcalGenForward) return theShapes[3];
    else if(subdet == HcalGenericDetId::HcalGenZDC) return theShapes[4];
    else return 0;
  }
  int shapeType = theMCParams->getValues(detId)->signalShape();
  return theShapes.at(shapeType);
}

Member Data Documentation

Definition at line 33 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 34 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 31 of file HcalShapes.h.

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

std::vector<const CaloVShape *> HcalShapes::theShapes [private]

Definition at line 32 of file HcalShapes.h.

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

Definition at line 36 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 35 of file HcalShapes.h.

Referenced by HcalShapes().