ATLAS Offline Software
Loading...
Searching...
No Matches
SimHitHandle_TRTHit::Imp Class Reference
Collaboration diagram for SimHitHandle_TRTHit::Imp:

Public Member Functions

 Imp (const TRTUncompressedHit *h)
bool ensureDetElemInit () const

Public Attributes

const TRTUncompressedHitthehit
const InDetDD::TRT_BaseElementdetelem
size_t strawID

Detailed Description

Definition at line 32 of file SimHitHandle_TRTHit.cxx.

Constructor & Destructor Documentation

◆ Imp()

SimHitHandle_TRTHit::Imp::Imp ( const TRTUncompressedHit * h)
inline

Definition at line 34 of file SimHitHandle_TRTHit.cxx.

34: thehit(h), detelem(nullptr),strawID(0) {}
const TRTUncompressedHit * thehit
const InDetDD::TRT_BaseElement * detelem

Member Function Documentation

◆ ensureDetElemInit()

bool SimHitHandle_TRTHit::Imp::ensureDetElemInit ( ) const

Definition at line 87 of file SimHitHandle_TRTHit.cxx.

88{
89 if (detelem)
90 return true;
91 const InDetDD::TRT_DetectorManager * mgr = VP1DetInfo::trtDetMgr();
92 if (!mgr) {
93 VP1Msg::messageDebug("SimHitHandle_TRTHit ERROR: Could not get TRT detector manager.");
94 return false;
95 }
96 size_t hitID = thehit->GetHitID(), moduleID(0), trtID(0),sectorID(0);
97 static const size_t mask = 0x1F;
98 static const size_t shift = 5;
99 std::bitset<32> idBits(hitID);
100 if (!idBits[21]/*IE: BARREL*/ ) {
101 size_t layerID(0), ringID(0);
102 strawID = hitID & mask;
103 hitID >>= shift;
104 layerID = hitID & mask;
105 hitID >>= shift;
106 moduleID = hitID & mask;
107 hitID >>= shift;
108 ringID = hitID & mask;
109 trtID = hitID >> shift;
110 detelem = mgr->getBarrelElement(trtID,ringID,moduleID,layerID);//fixme: handle case
111 }
112 else /*ENDCAP*/ {
113 size_t wheelID(0), planeID(0);
114 strawID = hitID & mask;
115 hitID >>= shift;
116 planeID = hitID & mask;
117 hitID >>= shift;
118 sectorID = hitID & mask;
119 hitID >>= shift;
120 wheelID = hitID & mask;
121 trtID = hitID >> shift;
122 bool isPositive = (trtID==2);
123 detelem = mgr->getEndcapElement(isPositive,wheelID,planeID,sectorID);
124 }
125 if (detelem) {
126 return true;
127 } else {
128 VP1Msg::messageDebug("SimHitHandle_TRTHit WARNING: Could not find detector element.");
129 return false;
130 }
131}
static const InDetDD::TRT_DetectorManager * trtDetMgr()
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39

Member Data Documentation

◆ detelem

const InDetDD::TRT_BaseElement* SimHitHandle_TRTHit::Imp::detelem
mutable

Definition at line 36 of file SimHitHandle_TRTHit.cxx.

◆ strawID

size_t SimHitHandle_TRTHit::Imp::strawID
mutable

Definition at line 37 of file SimHitHandle_TRTHit.cxx.

◆ thehit

const TRTUncompressedHit* SimHitHandle_TRTHit::Imp::thehit

Definition at line 35 of file SimHitHandle_TRTHit.cxx.


The documentation for this class was generated from the following file: