ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
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 31 of file SimHitHandle_TRTHit.cxx.

Constructor & Destructor Documentation

◆ Imp()

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

Definition at line 33 of file SimHitHandle_TRTHit.cxx.

33 : thehit(h), detelem(nullptr),strawID(0) {}

Member Function Documentation

◆ ensureDetElemInit()

bool SimHitHandle_TRTHit::Imp::ensureDetElemInit ( ) const

Definition at line 86 of file SimHitHandle_TRTHit.cxx.

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

Member Data Documentation

◆ detelem

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

Definition at line 35 of file SimHitHandle_TRTHit.cxx.

◆ strawID

size_t SimHitHandle_TRTHit::Imp::strawID
mutable

Definition at line 36 of file SimHitHandle_TRTHit.cxx.

◆ thehit

const TRTUncompressedHit* SimHitHandle_TRTHit::Imp::thehit

Definition at line 34 of file SimHitHandle_TRTHit.cxx.


The documentation for this class was generated from the following file:
TRTUncompressedHit::GetHitID
int GetHitID() const
Definition: TRTUncompressedHit.h:42
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
InDetDD::TRT_DetectorManager
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Definition: TRT_DetectorManager.h:69
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
h
SimHitHandle_TRTHit::Imp::thehit
const TRTUncompressedHit * thehit
Definition: SimHitHandle_TRTHit.cxx:34
VP1DetInfo::trtDetMgr
static const InDetDD::TRT_DetectorManager * trtDetMgr()
Definition: VP1DetInfo.cxx:147
SimHitHandle_TRTHit::Imp::strawID
size_t strawID
Definition: SimHitHandle_TRTHit.cxx:36
SimHitHandle_TRTHit::Imp::detelem
const InDetDD::TRT_BaseElement * detelem
Definition: SimHitHandle_TRTHit.cxx:35