CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CastorHardcodeGeometryLoader Class Reference

#include <CastorHardcodeGeometryLoader.h>

Public Member Functions

 CastorHardcodeGeometryLoader ()
 
 CastorHardcodeGeometryLoader (const CastorTopology &ht)
 
virtual std::unique_ptr< CaloSubdetectorGeometryload (DetId::Detector det, int subdet)
 
std::unique_ptr< CaloSubdetectorGeometryload ()
 
virtual ~CastorHardcodeGeometryLoader ()
 

Private Member Functions

void fill (HcalCastorDetId::Section section, CaloSubdetectorGeometry *cg)
 
void init ()
 
void makeCell (const HcalCastorDetId &detId, CaloSubdetectorGeometry *geom) const
 

Private Attributes

const CastorTopologyextTopology
 
float theEMSectiondX
 
float theEMSectiondY
 
float theEMSectiondZ
 
float theHADSectiondX
 
float theHADSectiondY
 
float theHADSectiondZ
 
CastorTopologytheTopology
 

Detailed Description

Definition at line 12 of file CastorHardcodeGeometryLoader.h.

Constructor & Destructor Documentation

CastorHardcodeGeometryLoader::CastorHardcodeGeometryLoader ( )
CastorHardcodeGeometryLoader::CastorHardcodeGeometryLoader ( const CastorTopology ht)
explicit

Definition at line 19 of file CastorHardcodeGeometryLoader.cc.

References init().

19  :
20  theTopology( nullptr ) ,
21  extTopology ( &ht )
22 {
23  init();
24 }
virtual CastorHardcodeGeometryLoader::~CastorHardcodeGeometryLoader ( )
inlinevirtual

Member Function Documentation

void CastorHardcodeGeometryLoader::fill ( HcalCastorDetId::Section  section,
CaloSubdetectorGeometry cg 
)
private

Definition at line 60 of file CastorHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), extTopology, CastorTopology::firstCell(), triggerObjects_cff::id, CastorGeometry::k_NumberOfParametersPerShape, CastorGeometry::k_NumberOfShapes, HcalCastorDetId::kNumberSectorsPerEnd, HcalCastorDetId::kSizeForDenseIndexing, CastorTopology::lastCell(), makeCell(), nullptr, CaloSubdetectorGeometry::parMgr(), and CastorTopology::valid().

Referenced by load(), and ~CastorHardcodeGeometryLoader().

62 {
63  if( geom->cornersMgr() == nullptr ) geom->allocateCorners(
65  if( geom->parMgr() == nullptr ) geom->allocatePar(
68  CastorGeometry::k_NumberOfParametersPerShape ) ;
69 
70  // start by making the new HcalDetIds
71  std::vector<HcalCastorDetId> castorIds ;
72 
73  const int firstCell ( extTopology->firstCell( section ) ) ;
74  const int lastCell ( extTopology->lastCell( section ) );
75 
76  for( int imodule ( firstCell ) ; imodule <= lastCell ; ++imodule )
77  {
78  for( int isector ( 1 ) ;
79  isector <= HcalCastorDetId::kNumberSectorsPerEnd ; ++isector )
80  {
81  const HcalCastorDetId id ( section, false, isector, imodule ) ;
82  if( extTopology->valid( id ) ) castorIds.emplace_back( id ) ;
83  }
84  }
85 // edm::LogInfo("CastorHardcodeGeometry")
86 // << "Number of Castor DetIds made: " << section
87 // << " " << castorIds.size();
88 
89  // for each new HcalCastorDetId, make a CaloCellGeometry
90 
91  for( std::vector<HcalCastorDetId>::const_iterator
92  castorIdItr ( castorIds.begin() ) ;
93  castorIdItr != castorIds.end() ; ++castorIdItr )
94  {
95  makeCell( *castorIdItr, geom ) ;
96  }
97 }
#define nullptr
void makeCell(const HcalCastorDetId &detId, CaloSubdetectorGeometry *geom) const
virtual bool valid(const HcalCastorDetId &id) const
int firstCell(HcalCastorDetId::Section section) const
int lastCell(HcalCastorDetId::Section section) const
void CastorHardcodeGeometryLoader::init ( void  )
private
std::unique_ptr< CaloSubdetectorGeometry > CastorHardcodeGeometryLoader::load ( DetId::Detector  det,
int  subdet 
)
virtual

Definition at line 37 of file CastorHardcodeGeometryLoader.cc.

References HcalCastorDetId::EM, extTopology, fill(), HcalCastorDetId::HAD, eostools::move(), and HcalCastorDetId::SubdetectorId.

Referenced by CastorHardcodeGeometryEP::produce().

39 {
40  std::unique_ptr<CaloSubdetectorGeometry> hg(new CastorGeometry( extTopology ));
41  if( subdet == HcalCastorDetId::SubdetectorId )
42  {
43  fill( HcalCastorDetId::EM, hg.get() ) ;
44  fill( HcalCastorDetId::HAD, hg.get() ) ;
45  }
46  return std::move(hg);
47 }
void fill(HcalCastorDetId::Section section, CaloSubdetectorGeometry *cg)
static const int SubdetectorId
def move(src, dest)
Definition: eostools.py:510
std::unique_ptr< CaloSubdetectorGeometry > CastorHardcodeGeometryLoader::load ( )

Definition at line 50 of file CastorHardcodeGeometryLoader.cc.

References HcalCastorDetId::EM, extTopology, fill(), HcalCastorDetId::HAD, and eostools::move().

Referenced by ~CastorHardcodeGeometryLoader().

51 {
52  std::unique_ptr<CaloSubdetectorGeometry> hg
53  ( new CastorGeometry( extTopology ) ) ;
54  fill( HcalCastorDetId::EM, hg.get() ) ;
55  fill( HcalCastorDetId::HAD, hg.get() ) ;
56  return std::move(hg);
57 }
void fill(HcalCastorDetId::Section section, CaloSubdetectorGeometry *cg)
def move(src, dest)
Definition: eostools.py:510
void CastorHardcodeGeometryLoader::makeCell ( const HcalCastorDetId detId,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 100 of file CastorHardcodeGeometryLoader.cc.

References funct::cos(), cuy::dh, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, HcalCastorDetId::EM, benchmark_cfg::fc, CaloCellGeometry::getParmPtr(), CastorGeometry::k_NumberOfParametersPerShape, HcalCastorDetId::kNumberSectorsPerEnd, create_public_lumi_plots::leg, M_PI, HcalCastorDetId::module(), python.rootplot.argparse::module, CaloSubdetectorGeometry::newCell(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), phi, HcalCastorDetId::section(), trackingPlots::section, HcalCastorDetId::sector(), Validation_hcalonly_cfi::sign, funct::sin(), mathSSE::sqrt(), HcalDigiParam_cfi::zside, HcalCastorDetId::zside(), and geometryCSVtoXML::zz.

Referenced by fill(), and ~CastorHardcodeGeometryLoader().

102 {
103  const double zside ( 1.0*detId.zside() ) ;
104  const HcalCastorDetId::Section section ( detId.section() ) ;
105  const int module ( detId.module() ) ;
106  const int isect ( detId.sector() ) ;
107  const double sector ( 1.0*isect ) ;
108 
109 // length units are cm
110 
111 
112  const double sign ( 0 == isect%2 ? -1 : 1 ) ;
113 
114 //********* HERE ARE HARDWIRED GEOMETRY NUMBERS ACTUALLY USED *****
115 
116  static const double an ( atan( 1.)); //angle of cant w.r.t. beam
117  static const double can ( cos( an ));
118  static const double san ( sin( an ));
119  static const double dxlEM ( 1.55/2. ) ; //halflength of side near beam
120  static const double dxhEM ( 5.73/2. ) ; //halflength of side away from beam
121  static const double dhEM ( 14.26/2. ); //halflength of 2nd longest side
122  static const double dR ( 0.1 + 2.*dhEM*san*dxlEM/( dxhEM-dxlEM ) ) ;
123  static const double dhHAD ( 19.88/2. ); //halflength of 2nd longest side
124 
125  static const double dxhHAD ( dxhEM*( 2.*dhHAD*san + dR )/
126  ( 2.*dhEM*san + dR ) ) ; //halflength of side away from beam
127  static const double zm ( 1439.0 ) ; //z of start of EM
128  static const double dzEM ( 5.45/2 ) ; // halflength in z of EM
129  static const double dzHAD ( 10.075/2 ) ; // halflength in z of HAD
130 
131 //*****************************************************************
132 
133  const double dxl ( sign*dxlEM ) ; // same for EM and HAD
134 
135  const double dxh ( sign*( section == HcalCastorDetId::EM ?
136  dxhEM : dxhHAD ) ) ;
137  const double dh ( section == HcalCastorDetId::EM ?
138  dhEM : dhHAD ) ;
139  const double dz ( section == HcalCastorDetId::EM ?
140  dzEM : dzHAD ) ;
141 
142  const double delz ( dh*can ) ;
143  const double dy ( dh*san ) ;
144  const double dx ( ( dxl + dxh )/2. ) ;
145  const double leg ( dR + dy ) ;
146  const double len ( sqrt( leg*leg + dx*dx ) ) ;
147 
148  static const double dphi
150 
151  const double fphi ( atan( dx/( dR + dy ) ) ) ;
152 
153  const double phi ( 0==isect%2 ? (sector-1.)*dphi - fphi :
154  sector*dphi - fphi ) ;
155 
156  const double sphi ( sin( phi ) ) ;
157  const double cphi ( cos( phi ) ) ;
158 
159  const double xc ( len*cphi ) ;
160  const double yc ( len*sphi ) ;
161  const double zc ( zside*( zm + delz +
162  ( module<3 ? ( 1.*module - 1.0 )*2.*dzEM :
163  4.*dzEM + ( 1.*(module-2) - 1 )*2.*dzHAD ) ) ) ;
164 
165  const GlobalPoint fc ( xc, yc, zc ) ;
166 
167  std::vector<CCGFloat> zz ;
169  zz.emplace_back( dxl ) ;
170  zz.emplace_back( dxh ) ;
171  zz.emplace_back( dh ) ;
172  zz.emplace_back( dz ) ;
173  zz.emplace_back( an ) ;
174  zz.emplace_back( dR ) ;
175 
176  geom->newCell( fc, fc, fc,
178  geom->parMgr(),
179  geom->parVecVec() ),
180  detId ) ;
181 }
int sector() const
get the sector (1-16)
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int module() const
get the module (1-2 for EM, 1-12 for HAD)
Section section() const
get the section
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int zside() const
get the z-side of the cell (1/-1)
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
#define M_PI
dh
Definition: cuy.py:353
Definition: vlib.h:208

Member Data Documentation

const CastorTopology* CastorHardcodeGeometryLoader::extTopology
private

Definition at line 28 of file CastorHardcodeGeometryLoader.h.

Referenced by fill(), and load().

float CastorHardcodeGeometryLoader::theEMSectiondX
private

Definition at line 31 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theEMSectiondY
private

Definition at line 32 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theEMSectiondZ
private

Definition at line 33 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theHADSectiondX
private

Definition at line 34 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theHADSectiondY
private

Definition at line 35 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theHADSectiondZ
private

Definition at line 36 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

CastorTopology* CastorHardcodeGeometryLoader::theTopology
private

Definition at line 27 of file CastorHardcodeGeometryLoader.h.

Referenced by ~CastorHardcodeGeometryLoader().