CMS 3D CMS Logo

List of all members | Public Member Functions
EcalBarrelNumberingScheme Class Reference

#include <EcalBarrelNumberingScheme.h>

Inheritance diagram for EcalBarrelNumberingScheme:
EcalNumberingScheme CaloNumberingScheme

Public Member Functions

 EcalBarrelNumberingScheme ()
 
uint32_t getUnitID (const EcalBaseNumber &baseNumber) const override
 
 ~EcalBarrelNumberingScheme () override
 
- Public Member Functions inherited from EcalNumberingScheme
 EcalNumberingScheme ()
 
 ~EcalNumberingScheme () override
 
- Public Member Functions inherited from CaloNumberingScheme
 CaloNumberingScheme (int iv=0)
 Constructor with optional verbosity control. More...
 
void setVerbosity (int)
 Verbosity setting. More...
 
virtual ~CaloNumberingScheme ()
 

Additional Inherited Members

- Protected Attributes inherited from CaloNumberingScheme
int verbosity
 Verbosity field: Zero = quiet, increasing integers mean more output. More...
 

Detailed Description

Definition at line 10 of file EcalBarrelNumberingScheme.h.

Constructor & Destructor Documentation

◆ EcalBarrelNumberingScheme()

EcalBarrelNumberingScheme::EcalBarrelNumberingScheme ( )

Definition at line 10 of file EcalBarrelNumberingScheme.cc.

11  edm::LogVerbatim("EcalGeom") << "Creating EcalBarrelNumberingScheme";
12 }

◆ ~EcalBarrelNumberingScheme()

EcalBarrelNumberingScheme::~EcalBarrelNumberingScheme ( )
override

Definition at line 14 of file EcalBarrelNumberingScheme.cc.

14  {
15  edm::LogVerbatim("EcalGeom") << "Deleting EcalBarrelNumberingScheme";
16 }

Member Function Documentation

◆ getUnitID()

uint32_t EcalBarrelNumberingScheme::getUnitID ( const EcalBaseNumber baseNumber) const
overridevirtual

Implements EcalNumberingScheme.

Definition at line 18 of file EcalBarrelNumberingScheme.cc.

18  {
19  const uint32_t nLevels(baseNumber.getLevels());
20 
21 #ifdef EDM_ML_DEBUG
22  edm::LogVerbatim("EcalGeom") << "ECalBarrelNumberingScheme geometry levels = " << nLevels;
23 #endif
24  if (12 > nLevels) {
25  edm::LogWarning("EcalGeom") << "ECalBarrelNumberingScheme::getUnitID(): "
26  << "Not enough levels found in EcalBaseNumber ( " << nLevels << ") Returning 0";
27  return 0;
28  }
29 
30  const std::string& cryName(baseNumber.getLevelName(0).substr(0, 7)); // name of crystal volume
31 
32  const int cryType(::atoi(cryName.c_str() + 5));
33 
34  const int off(13 < nLevels ? 3 : 0);
35 
36  const uint32_t wallCopy(baseNumber.getCopyNumber(3 + off));
37  const uint32_t hawCopy(baseNumber.getCopyNumber(4 + off));
38  const uint32_t fawCopy(baseNumber.getCopyNumber(5 + off));
39  const uint32_t supmCopy(baseNumber.getCopyNumber(6 + off));
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("EcalGeom") << nLevels << ", " << off << ", " << cryType << ", " << baseNumber.getLevelName(0) << ":"
42  << baseNumber.getCopyNumber(0) << ", " << baseNumber.getLevelName(1) << ":"
43  << baseNumber.getCopyNumber(1) << ", " << baseNumber.getLevelName(2) << ":"
44  << baseNumber.getCopyNumber(2) << ", " << baseNumber.getLevelName(3) << ":"
45  << baseNumber.getCopyNumber(3) << ", " << baseNumber.getLevelName(4) << ":"
46  << baseNumber.getCopyNumber(4) << ", " << baseNumber.getLevelName(5) << ":"
47  << baseNumber.getCopyNumber(5) << ", " << baseNumber.getLevelName(6) << ":"
48  << baseNumber.getCopyNumber(6) << ", " << baseNumber.getLevelName(7) << ":"
49  << baseNumber.getCopyNumber(7) << ", " << baseNumber.getLevelName(8) << ":"
50  << baseNumber.getCopyNumber(8) << ", " << baseNumber.getLevelName(9) << ":"
51  << baseNumber.getCopyNumber(9) << ", " << baseNumber.getLevelName(10) << ":"
52  << baseNumber.getCopyNumber(10);
53 #endif
54  // error checking
55 
56  if (1 > cryType || 17 < cryType) {
57  edm::LogWarning("EdalGeom") << "ECalBarrelNumberingScheme::getUnitID(): "
58  << "****************** Bad crystal name = " << cryName
59  << ", Volume Name = " << baseNumber.getLevelName(0);
60  return 0;
61  }
62 
63  if (1 > wallCopy || 5 < wallCopy) {
64  edm::LogWarning("EcalGeom") << "ECalBarrelNumberingScheme::getUnitID(): "
65  << "****************** Bad wall copy = " << wallCopy
66  << ", Volume Name = " << baseNumber.getLevelName(3);
67  return 0;
68  }
69 
70  if (1 > hawCopy || 2 < hawCopy) {
71  edm::LogWarning("EcalGeom") << "ECalBarrelNumberingScheme::getUnitID(): "
72  << "****************** Bad haw copy = " << hawCopy
73  << ", Volume Name = " << baseNumber.getLevelName(4);
74  return 0;
75  }
76 
77  if (1 > fawCopy || 10 < fawCopy) {
78  edm::LogWarning("EcalGeom") << "ECalBarrelNumberingScheme::getUnitID(): "
79  << "****************** Bad faw copy = " << fawCopy
80  << ", Volume Name = " << baseNumber.getLevelName(5);
81  return 0;
82  }
83 
84  if (1 > supmCopy || 36 < supmCopy) {
85  edm::LogWarning("EcalGeom") << "ECalBarrelNumberingScheme::getUnitID(): "
86  << "****************** Bad supermodule copy = " << supmCopy
87  << ", Volume Name = " << baseNumber.getLevelName(6);
88  return 0;
89  }
90 
91  // all inputs are fine. Go ahead and decode
92 
93  const int32_t zsign(18 < supmCopy ? -1 : 1);
94 
95  const int32_t eta(5 * (cryType - 1) + wallCopy);
96 
97  const int32_t phi(18 < supmCopy ? 20 * (supmCopy - 19) + 2 * (10 - fawCopy) + 3 - hawCopy
98  : 20 * (supmCopy - 1) + 2 * (fawCopy - 1) + hawCopy);
99 
100  const int32_t intindex(EBDetId(zsign * eta, phi).rawId());
101 
102  /*
103  static int count ( 1 ) ;
104  if( 0==count%1000 )
105  {
106  std::cout<<"************************** NLEVELS="<<nLevels
107  <<", eta="<<eta<<", phi="<<phi<<", zsign="<<zsign<<std::endl;
108  }
109  ++count;
110 */
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("EcalGeom") << "EcalBarrelNumberingScheme: "
113  << "supmCopy = " << supmCopy << ", fawCopy = " << fawCopy << ", hawCopy = " << hawCopy
114  << ", wallCopy = " << wallCopy << ", cryType = " << cryType
115  << "\n zsign = " << zsign << ", eta = " << eta << ", phi = " << phi
116  << ", packed index = 0x" << std::hex << intindex << std::dec;
117 #endif
118  return intindex;
119 }

References TauDecayModes::dec, PVValHelper::eta, EcalBaseNumber::getCopyNumber(), EcalBaseNumber::getLevelName(), EcalBaseNumber::getLevels(), phi, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EcalDumpGeometry::dumpTouch().

EcalBaseNumber::getCopyNumber
int getCopyNumber(int level) const
Definition: EcalBaseNumber.cc:24
EcalBaseNumber::getLevelName
std::string const & getLevelName(int level) const
Definition: EcalBaseNumber.cc:35
EBDetId
Definition: EBDetId.h:17
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
PVValHelper::eta
Definition: PVValidationHelpers.h:69
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalBaseNumber::getLevels
int getLevels() const
Definition: EcalBaseNumber.cc:22
DDAxes::phi
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
EcalNumberingScheme::EcalNumberingScheme
EcalNumberingScheme()
Definition: EcalNumberingScheme.cc:9