CMS 3D CMS Logo

HcalHardcodeGeometryLoader Class Reference

Note:
The HE geometry is not currently correct.
More...

#include <Geometry/HcalTowerAlgo/interface/HcalHardcodeGeometryLoader.h>

List of all members.

Public Types

typedef CaloSubdetectorGeometryReturnType

Public Member Functions

 HcalHardcodeGeometryLoader (const HcalTopology &ht)
 HcalHardcodeGeometryLoader ()
ReturnType load ()
 Load all of HCAL.
ReturnType load (DetId::Detector det, int subdet)
virtual ~HcalHardcodeGeometryLoader ()

Private Member Functions

void fill (HcalSubdetector subdet, int firstEtaRing, int lastEtaRing, ReturnType cg)
 helper functions to make all the ids and cells, and put them into the vectors and mpas passed in.
void init ()
const CaloCellGeometrymakeCell (const HcalDetId &detId, ReturnType geom) const

Private Attributes

const HcalTopologyextTopology
double theBarrelRadius
double theHB15aThickness
double theHB15bThickness
double theHB16aThickness
double theHB16bThickness
double theHBThickness
double theHEZPos [4]
double theHFThickness
double theHFZPos [2]
double theHOThickness
double theOuterRadius
HcalTopologytheTopology


Detailed Description

Note:
The HE geometry is not currently correct.

The z positions must be corrected.

Date
2008/04/21 22:19:36
Revision
1.6
Author:
R. Wilkinson - Caltech

Definition at line 19 of file HcalHardcodeGeometryLoader.h.


Member Typedef Documentation

typedef CaloSubdetectorGeometry* HcalHardcodeGeometryLoader::ReturnType

Definition at line 23 of file HcalHardcodeGeometryLoader.h.


Constructor & Destructor Documentation

HcalHardcodeGeometryLoader::HcalHardcodeGeometryLoader (  ) 

Definition at line 10 of file HcalHardcodeGeometryLoader.cc.

References init().

00010                                                       :
00011    theTopology ( new HcalTopology ),
00012    extTopology ( theTopology      )
00013 {
00014    init();
00015 }

HcalHardcodeGeometryLoader::HcalHardcodeGeometryLoader ( const HcalTopology ht  )  [explicit]

Definition at line 17 of file HcalHardcodeGeometryLoader.cc.

References init().

00017                                                                              : 
00018    theTopology ( 0   ) ,
00019    extTopology ( &ht )
00020 {
00021    init();
00022 }

virtual HcalHardcodeGeometryLoader::~HcalHardcodeGeometryLoader (  )  [inline, virtual]

Definition at line 27 of file HcalHardcodeGeometryLoader.h.

References theTopology.

00027 { delete theTopology ; }


Member Function Documentation

void HcalHardcodeGeometryLoader::fill ( HcalSubdetector  subdet,
int  firstEtaRing,
int  lastEtaRing,
ReturnType  cg 
) [private]

helper functions to make all the ids and cells, and put them into the vectors and mpas passed in.

Definition at line 87 of file HcalHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::addCell(), HcalTopology::depthBinInformation(), extTopology, id, makeCell(), max, HcalTopology::nPhiBins(), and HcalTopology::valid().

Referenced by load().

00091 {
00092    // start by making the new HcalDetIds
00093    std::vector<HcalDetId> hcalIds;
00094    int nDepthSegments, startingDepthSegment;
00095    for(int etaRing = firstEtaRing; etaRing <= lastEtaRing; ++etaRing) {
00096       extTopology->depthBinInformation(subdet, etaRing, nDepthSegments, startingDepthSegment);
00097       unsigned int nPhiBins = extTopology->nPhiBins(etaRing);
00098       unsigned int phiInc=72/std::max(36u,nPhiBins);
00099       for(int idepth = 0; idepth < nDepthSegments; ++idepth) {
00100          int depthBin = startingDepthSegment + idepth;
00101          
00102          for(unsigned iphi = 1; iphi <= 72; iphi+=phiInc) {
00103             for(int zsign = -1; zsign <= 1; zsign += 2) {
00104                HcalDetId id( subdet, zsign * etaRing, iphi, depthBin);
00105                if (extTopology->valid(id)) hcalIds.push_back(id);
00106             }
00107          } 
00108       }
00109    }
00110 
00111    edm::LogInfo("HcalHardcodeGeometry") << "Number of HCAL DetIds made: " 
00112                                         << subdet 
00113                                         << " " << hcalIds.size();
00114    // for each new HcalDetId, make a CaloCellGeometry
00115    for(std::vector<HcalDetId>::const_iterator hcalIdItr = hcalIds.begin();
00116        hcalIdItr != hcalIds.end(); ++hcalIdItr)
00117    {
00118       const CaloCellGeometry * geometry = makeCell(*hcalIdItr,geom);
00119       geom->addCell(*hcalIdItr, geometry);
00120    }
00121 }

void HcalHardcodeGeometryLoader::init ( void   )  [private]

Definition at line 25 of file HcalHardcodeGeometryLoader.cc.

References theBarrelRadius, theHB15aThickness, theHB15bThickness, theHB16aThickness, theHB16bThickness, theHBThickness, theHEZPos, theHFThickness, theHFZPos, theHOThickness, and theOuterRadius.

Referenced by HcalHardcodeGeometryLoader().

00026 {
00027   theBarrelRadius = 190.;
00028   theHBThickness = 93.6; // just from drawings.  All thicknesses needs to be done right
00029 
00030   theHB15aThickness = theHBThickness * 12.0/17.0; // relative weight from layer count!
00031   theHB15bThickness = theHBThickness * 4.0/17.0;  // relative weight from layer count!
00032   theHB16aThickness = theHBThickness * 1.0/17.0;  // relative weight from layer count!
00033   theHB16bThickness = theHBThickness * 7.0/17.0;  // relative weight from layer count!
00034 
00035   theOuterRadius  = 406;
00036   theHOThickness = 1.;
00037 
00038   theHEZPos[0] = 388.0;
00039   theHEZPos[1] = 397.0;
00040   theHEZPos[2] = 450.0;
00041   theHEZPos[3] = 568.0;
00042 
00043   theHFZPos[0] = 1100.0;
00044   theHFZPos[1] = 1120.0;
00045   theHFThickness = 165;
00046 
00047 }

HcalHardcodeGeometryLoader::ReturnType HcalHardcodeGeometryLoader::load (  ) 

Load all of HCAL.

Definition at line 72 of file HcalHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), extTopology, fill(), HcalTopology::firstHBRing(), HcalTopology::firstHERing(), HcalTopology::firstHFRing(), HcalTopology::firstHORing(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalTopology::lastHBRing(), HcalTopology::lastHERing(), HcalTopology::lastHFRing(), HcalTopology::lastHORing(), and CaloSubdetectorGeometry::parMgr().

00073 {
00074    ReturnType hg( new HcalGeometry( extTopology ) ) ;
00075 
00076    if( hg->cornersMgr() == 0 ) hg->allocateCorners( 9072 ) ;
00077    if( hg->parMgr()     == 0 ) hg->allocatePar( 500, 3 ) ;
00078 
00079    fill(HcalBarrel,  extTopology->firstHBRing(), extTopology->lastHBRing(), hg); 
00080    fill(HcalEndcap,  extTopology->firstHERing(), extTopology->lastHERing(), hg); 
00081    fill(HcalForward, extTopology->firstHFRing(), extTopology->lastHFRing(), hg); 
00082    fill(HcalOuter,   extTopology->firstHORing(), extTopology->lastHORing(), hg);
00083    return hg;
00084 }

HcalHardcodeGeometryLoader::ReturnType HcalHardcodeGeometryLoader::load ( DetId::Detector  det,
int  subdet 
)

Definition at line 51 of file HcalHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), extTopology, fill(), HcalTopology::firstHBRing(), HcalTopology::firstHERing(), HcalTopology::firstHFRing(), HcalTopology::firstHORing(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalTopology::lastHBRing(), HcalTopology::lastHERing(), HcalTopology::lastHFRing(), HcalTopology::lastHORing(), and CaloSubdetectorGeometry::parMgr().

Referenced by HcalHardcodeGeometryEP::produceAligned(), and HcalHardcodeGeometryEP::produceIdeal().

00053 {
00054    HcalSubdetector hsub=static_cast<HcalSubdetector>( subdet );
00055    ReturnType hg( new HcalGeometry( extTopology) );
00056 
00057    if( hg->cornersMgr() == 0 ) hg->allocateCorners( 9072 ) ;
00058    if( hg->parMgr()     == 0 ) hg->allocatePar( 500, 3 ) ;
00059 
00060    switch (hsub) 
00061    {
00062       case (HcalBarrel) :  fill(hsub, extTopology->firstHBRing(), extTopology->lastHBRing(), hg ); break;
00063       case (HcalEndcap) :  fill(hsub, extTopology->firstHERing(), extTopology->lastHERing(), hg ); break;
00064       case (HcalForward) : fill(hsub, extTopology->firstHFRing(), extTopology->lastHFRing(), hg ); break;
00065       case (HcalOuter) :   fill(hsub, extTopology->firstHORing(), extTopology->lastHORing(), hg ); break;
00066       default:  break;
00067    }
00068    return hg;
00069 }

const CaloCellGeometry * HcalHardcodeGeometryLoader::makeCell ( const HcalDetId detId,
ReturnType  geom 
) const [private]

Definition at line 127 of file HcalHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::cornersMgr(), funct::cos(), HcalDetId::depth(), HcalTopology::depthBinInformation(), eta, extTopology, HcalTopology::firstHFRing(), CaloCellGeometry::getParmPtr(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hh, HcalDetId::ietaAbs(), HcalDetId::iphi(), HcalTopology::nPhiBins(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), phi, r, funct::sin(), HcalDetId::subdet(), funct::tan(), theBarrelRadius, theHB15aThickness, theHB15bThickness, theHB16aThickness, theHB16bThickness, theHBHEEtaBounds, theHBThickness, theHEZPos, theHFEtaBounds, theHFThickness, theHFZPos, theHOThickness, theOuterRadius, theta, theta_from_eta(), x, y, z, and HcalDetId::zside().

Referenced by fill().

00129 {
00130    // the two eta boundaries of the cell
00131    double eta1, eta2;
00132    HcalSubdetector subdet = detId.subdet();
00133    int etaRing = detId.ietaAbs();
00134    if(subdet == HcalForward) 
00135    {
00136       eta1 = theHFEtaBounds[etaRing-extTopology->firstHFRing()];
00137       eta2 = theHFEtaBounds[etaRing-extTopology->firstHFRing()+1];
00138    } 
00139    else if (etaRing==28 && detId.depth()==3) 
00140    {
00141       // double-width in eta at depth 3 in ieta=28
00142       eta1 = theHBHEEtaBounds[etaRing-1];
00143       eta2 = theHBHEEtaBounds[etaRing+1];
00144    } 
00145    else 
00146    {
00147       eta1 = theHBHEEtaBounds[etaRing-1];
00148       eta2 = theHBHEEtaBounds[etaRing];
00149    }
00150    double eta = 0.5*(eta1+eta2) * detId.zside();
00151    double deta = 0.5*(eta2-eta1);
00152    double theta = theta_from_eta(eta);
00153 
00154    int nDepthBins, startingBin;
00155    extTopology->depthBinInformation(subdet,etaRing,nDepthBins,startingBin);
00156 
00157    // in radians
00158    double dphi_nominal = 2.0*M_PI / extTopology->nPhiBins(1); // always the same
00159    double dphi_half = M_PI / extTopology->nPhiBins(etaRing); // half-width
00160   
00161    double phi_low = dphi_nominal*(detId.iphi()-1); // low-edge boundaries are constant...
00162    double phi = phi_low+dphi_half;
00163 
00164    bool isBarrel = (subdet == HcalBarrel || subdet == HcalOuter);
00165 
00166    double x,y,z,r;
00167    double thickness;
00168 
00169    if(isBarrel) 
00170    {
00171       if(subdet == HcalBarrel) 
00172       {
00173          if (detId.ietaAbs()==15) 
00174          {
00175             if (detId.depth()==1) 
00176             {
00177                r = theBarrelRadius;
00178                thickness = theHB15aThickness;
00179             } 
00180             else 
00181             {
00182                r = theBarrelRadius+theHB15aThickness;
00183                thickness = theHB15bThickness;
00184             }
00185          } 
00186          else if (detId.ietaAbs()==16) 
00187          {
00188             if (detId.depth()==1) 
00189             {
00190                r = theBarrelRadius;
00191                thickness = theHB16aThickness;
00192             } 
00193             else 
00194             {
00195                r = theBarrelRadius+theHB16aThickness;
00196                thickness = theHB16bThickness;
00197             }
00198          } 
00199          else 
00200          {
00201             r = theBarrelRadius;
00202             thickness = theHBThickness;
00203          }
00204       } 
00205       else 
00206       { // HO
00207          r = theOuterRadius;
00208          thickness = theHOThickness;
00209       } 
00210       z = r * sinh(eta); // sinh(eta) == 1/tan(theta)
00211       thickness *= cosh(eta); // cosh(eta) == 1/sin(theta)
00212    } 
00213    else 
00214    {
00215       int depth = detId.depth();
00216       if(subdet == HcalEndcap) 
00217       { // Sadly, Z must be made a function of ieta.
00218          if (nDepthBins==1) 
00219          {
00220             z = theHEZPos[depth - 1];
00221             thickness = theHEZPos[3] - z;
00222          } 
00223          else if (nDepthBins==2 && depth==2) 
00224          {
00225             z = theHEZPos[depth - 1];
00226             if (etaRing==29) // special case for tower 29
00227                thickness = theHEZPos[depth] - z;
00228             else
00229                thickness = theHEZPos[3] - z;
00230          } 
00231          else 
00232          {
00233             z = theHEZPos[depth - 1];
00234             thickness = theHEZPos[depth] - z;
00235          }
00236          thickness /= fabs(tanh(eta));
00237       } 
00238       else 
00239       {
00240          z = theHFZPos[depth - 1];
00241          thickness = theHFThickness-(theHFZPos[depth-1]-theHFZPos[0]);
00242       }
00243       z*=detId.zside(); // get the sign right.
00244       r = z * tan(theta);
00245       assert(r>0.);
00246    }
00247 
00248    x = r * cos(phi);
00249    y = r * sin(phi);
00250    GlobalPoint point(x,y,z);
00251 
00252 
00253    if (subdet==HcalForward) 
00254    {
00255       std::vector<float> hf ;
00256       hf.reserve(3) ;
00257       hf.push_back( deta ) ;
00258       hf.push_back( dphi_half ) ;
00259       hf.push_back( thickness/2 ) ;
00260       return new calogeom::IdealZPrism( 
00261          point, 
00262          geom->cornersMgr(),
00263          CaloCellGeometry::getParmPtr( hf, 
00264                                        geom->parMgr(), 
00265                                        geom->parVecVec() ) );
00266    } 
00267    else 
00268    { 
00269       const double mysign ( isBarrel ? 1 : -1 ) ;
00270       std::vector<float> hh ;
00271       hh.reserve(3) ;
00272       hh.push_back( deta ) ;
00273       hh.push_back( dphi_half ) ;
00274       hh.push_back( mysign*thickness/2. ) ;
00275       return new calogeom::IdealObliquePrism(
00276          point,
00277          geom->cornersMgr(),
00278          CaloCellGeometry::getParmPtr( hh, 
00279                                        geom->parMgr(), 
00280                                        geom->parVecVec() ) );
00281    }
00282 }


Member Data Documentation

const HcalTopology* HcalHardcodeGeometryLoader::extTopology [private]

Definition at line 47 of file HcalHardcodeGeometryLoader.h.

Referenced by fill(), load(), and makeCell().

double HcalHardcodeGeometryLoader::theBarrelRadius [private]

Definition at line 49 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHB15aThickness [private]

Definition at line 55 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHB15bThickness [private]

Definition at line 55 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHB16aThickness [private]

Definition at line 56 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHB16bThickness [private]

Definition at line 56 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHBThickness [private]

Definition at line 54 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHEZPos[4] [private]

Definition at line 51 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHFThickness [private]

Definition at line 57 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHFZPos[2] [private]

Definition at line 52 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHOThickness [private]

Definition at line 58 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theOuterRadius [private]

Definition at line 50 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

HcalTopology* HcalHardcodeGeometryLoader::theTopology [private]

Definition at line 46 of file HcalHardcodeGeometryLoader.h.

Referenced by ~HcalHardcodeGeometryLoader().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:42 2009 for CMSSW by  doxygen 1.5.4