CMS 3D CMS Logo

List of all members | Public Member Functions
BTLNumberingScheme Class Reference

#include <BTLNumberingScheme.h>

Inheritance diagram for BTLNumberingScheme:
MTDNumberingScheme

Public Member Functions

 BTLNumberingScheme ()
 
uint32_t getUnitID (const MTDBaseNumber &baseNumber) const override
 
 ~BTLNumberingScheme () override
 
- Public Member Functions inherited from MTDNumberingScheme
 MTDNumberingScheme ()
 
virtual ~MTDNumberingScheme ()
 

Detailed Description

Definition at line 6 of file BTLNumberingScheme.h.

Constructor & Destructor Documentation

BTLNumberingScheme::BTLNumberingScheme ( )

Definition at line 9 of file BTLNumberingScheme.cc.

9  :
11 #ifdef EDM_ML_DEBUG
12  edm::LogInfo("MTDGeom") << "Creating BTLNumberingScheme";
13 #endif
14 }
BTLNumberingScheme::~BTLNumberingScheme ( )
override

Definition at line 16 of file BTLNumberingScheme.cc.

16  {
17 #ifdef EDM_ML_DEBUG
18  edm::LogInfo("MTDGeom") << "Deleting BTLNumberingScheme";
19 #endif
20 }

Member Function Documentation

uint32_t BTLNumberingScheme::getUnitID ( const MTDBaseNumber baseNumber) const
overridevirtual

Implements MTDNumberingScheme.

Definition at line 22 of file BTLNumberingScheme.cc.

References MTDBaseNumber::getCopyNumber(), MTDBaseNumber::getLevelName(), MTDBaseNumber::getLevels(), DetId::rawId(), AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::zside().

22  {
23 
24  const uint32_t nLevels ( baseNumber.getLevels() ) ;
25 
26 #ifdef EDM_ML_DEBUG
27  edm::LogInfo("MTDGeom") << "BTLNumberingScheme geometry levels = " << nLevels;
28 #endif
29 
30  if( 9 > nLevels )
31  {
32  edm::LogWarning("MTDGeom") << "BTLNumberingScheme::getUnitID(): "
33  << "Not enough levels found in MTDBaseNumber ( "
34  << nLevels
35  << ") Returning 0" ;
36  return 0;
37  }
38 
39 #ifdef EDM_ML_DEBUG
40  edm::LogInfo("MTDGeom") << 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  << baseNumber.getLevelName(8);
49 #endif
50 
51  const uint32_t crystal ( baseNumber.getCopyNumber( 0 ) ) ;
52 
53  const uint32_t modCopy ( baseNumber.getCopyNumber( 2 ) ) ;
54  const uint32_t rodCopy ( baseNumber.getCopyNumber( 3 ) ) ;
55 
56  const std::string& modName ( baseNumber.getLevelName( 2 ) ) ; // name of module volume
57  uint32_t pos = modName.find("Positive");
58 
59  const uint32_t zside = ( pos <= strlen(modName.c_str()) ? 1 : 0 );
60  std::string baseName = modName.substr(modName.find(":")+1);
61  const int modtyp ( ::atoi( (baseName.substr(8,1)).c_str() ) == 9 ?
62  ::atoi( (baseName.substr(7,1)).c_str() ) + 1 : ::atoi( (baseName.substr(7,1)).c_str() ) ) ;
63 
64  // error checking
65 
66  if( 1 > crystal ||
67  64 < crystal )
68  {
69  edm::LogWarning("MTDGeom") << "BTLNumberingScheme::getUnitID(): "
70  << "****************** Bad crystal number = "
71  << crystal
72  << ", Volume Number = "
73  << baseNumber.getCopyNumber(0);
74  return 0 ;
75  }
76 
77  if( 1 > modtyp ||
78  3 < modtyp )
79  {
80  edm::LogWarning("MTDGeom") << "BTLNumberingScheme::getUnitID(): "
81  << "****************** Bad module name = "
82  << modName
83  << ", Volume Name = "
84  << baseNumber.getLevelName(2) ;
85  return 0 ;
86  }
87 
88  if( 1 > modCopy ||
89  54 < modCopy )
90  {
91  edm::LogWarning("MTDGeom") << "BTLNumberingScheme::getUnitID(): "
92  << "****************** Bad module copy = "
93  << modCopy
94  << ", Volume Number = "
95  << baseNumber.getCopyNumber(2) ;
96  return 0 ;
97  }
98 
99  if( 1 > rodCopy ||
100  36 < rodCopy )
101  {
102  edm::LogWarning("MTDGeom") << "BTLNumberingScheme::getUnitID(): "
103  << "****************** Bad rod copy = "
104  << rodCopy
105  << ", Volume Number = "
106  << baseNumber.getCopyNumber(4) ;
107  return 0 ;
108  }
109 
110  // all inputs are fine. Go ahead and decode
111 
112  BTLDetId thisBTLdetid( zside, rodCopy, modCopy, modtyp, crystal );
113  const int32_t intindex = thisBTLdetid.rawId() ;
114 
115 #ifdef EDM_ML_DEBUG
116  edm::LogInfo("MTDGeom") << "BTL Numbering scheme: "
117  << " rod = " << rodCopy
118  << " zside = " << zside
119  << " module = " << modCopy
120  << " modtyp = " << modtyp
121  << " crystal = " << crystal
122  << " Raw Id = " << intindex
123  << thisBTLdetid;
124 #endif
125 
126  return intindex ;
127 }
int zside(DetId const &)
int getLevels() const
int getCopyNumber(int level) const
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:17
std::string const & getLevelName(int level) const