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::LogInfo("EcalGeom") << "Creating EcalBarrelNumberingScheme";
12 }

◆ ~EcalBarrelNumberingScheme()

EcalBarrelNumberingScheme::~EcalBarrelNumberingScheme ( )
override

Definition at line 14 of file EcalBarrelNumberingScheme.cc.

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

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

EcalBaseNumber::getCopyNumber
int getCopyNumber(int level) const
Definition: EcalBaseNumber.cc:23
EcalBaseNumber::getLevelName
std::string const & getLevelName(int level) const
Definition: EcalBaseNumber.cc:34
EBDetId
Definition: EBDetId.h:17
edm::LogInfo
Definition: MessageLogger.h:254
PVValHelper::eta
Definition: PVValidationHelpers.h:69
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
EcalBaseNumber::getLevels
int getLevels() const
Definition: EcalBaseNumber.cc:21
DDAxes::phi
EcalNumberingScheme::EcalNumberingScheme
EcalNumberingScheme()
Definition: EcalNumberingScheme.cc:9