CMS 3D CMS Logo

Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes

HcalShapes Class Reference

#include <HcalShapes.h>

Inheritance diagram for HcalShapes:
CaloShapes

List of all members.

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 ()

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.

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

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.

: 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];

}
HcalShapes::~HcalShapes ( )

Definition at line 87 of file HcalShapes.cc.

References theMCParams, and theShapes.

{
  for(ShapeMap::const_iterator shapeItr = theShapes.begin();
      shapeItr != theShapes.end();  ++shapeItr)
  {
    delete shapeItr->second;
  }
  theShapes.clear();
  delete theMCParams;
}

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().

{
  // 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 107 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 114 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;
  }
}

Member Data Documentation

Definition at line 42 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 43 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 44 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 45 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 46 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 47 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 48 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 49 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 50 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 51 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 52 of file HcalShapes.h.

Referenced by HcalShapes().

Definition at line 53 of file HcalShapes.h.

Definition at line 34 of file HcalShapes.h.

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

Definition at line 36 of file HcalShapes.h.

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

Definition at line 39 of file HcalShapes.h.

Referenced by HcalShapes().