ATLAS Offline Software
GeoSiHit.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #include "GeoAdaptors/GeoSiHit.h"
8 #include "GaudiKernel/ServiceHandle.h"
9 
10 
12 {
13  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
14  const InDetDD::PixelDetectorManager* pix = nullptr;
15  if (!detStore->contains<InDetDD::PixelDetectorManager>("Pixel") || detStore->retrieve(pix,"Pixel").isFailure())
16  {
17  // if Pixel retrieval fails, try ITkPixel
18  if (!detStore->contains<InDetDD::PixelDetectorManager>("ITkPixel") || detStore->retrieve(pix,"ITkPixel").isFailure())
19  {
20  std::abort();
21  }
22  }
23  return pix;
24 }
25 
26 
28 {
29  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
30  const InDetDD::SCT_DetectorManager* sct = nullptr;
31  if (!detStore->contains<InDetDD::SCT_DetectorManager>("SCT") || detStore->retrieve(sct,"SCT").isFailure())
32  {
33  // if SCT retrieval fails, try ITkStrip
34  if (!detStore->contains<InDetDD::SCT_DetectorManager>("ITkStrip") || detStore->retrieve(sct,"ITkStrip").isFailure())
35  {
36  std::abort();
37  }
38  }
39  return sct;
40 }
41 
43 {
44  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
45  const HGTD_DetectorManager* hgtd = nullptr;
46  detStore->retrieve(hgtd,"HGTD").isFailure();
47  return hgtd;
48 }
49 
51 {
52  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
53  const InDetDD::PixelDetectorManager* plr = nullptr;
54  detStore->retrieve(plr,"PLR").isFailure();
55  return plr;
56 }
57 
59 {
60  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
61  const PixelID* pix = nullptr;
62  if(detStore->retrieve(pix,"PixelID").isFailure()) {
63  std::abort();
64  }
65  return pix;
66 }
67 
69 {
70  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
71  const SCT_ID* sct = nullptr;
72  if(detStore->retrieve(sct,"SCT_ID").isFailure()) {
73  std::abort();
74  }
75  return sct;
76 }
77 
79 {
80  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
81  const HGTD_ID* hgtd = nullptr;
82  if(detStore->retrieve(hgtd,"HGTD_ID").isFailure()) {
83  std::abort();
84  }
85  return hgtd;
86 }
87 
89 {
90  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
91  const PLR_ID* plr = nullptr;
92  if(detStore->retrieve(plr,"PLR_ID").isFailure()) {
93  std::abort();
94  }
95  return plr;
96 }
97 
99 {
101  return mgr;
102 }
103 
104 
106 {
108  return mgr;
109 }
110 
111 
113 {
114  const HGTD_DetectorManager* const mgr = initHgtdMgr();
115  return mgr;
116 }
117 
118 
120 {
122  return mgr;
123 }
124 
125 
126 const PixelID* GeoSiHit::pixID() const
127 {
128  const PixelID* const id = initPixID();
129  return id;
130 }
131 
132 
133 const SCT_ID* GeoSiHit::sctID() const
134 {
135  const SCT_ID* const id = initSctID();
136  return id;
137 }
138 
139 
140 const HGTD_ID* GeoSiHit::hgtdID() const
141 {
142  const HGTD_ID* const id = initHgtdID();
143  return id;
144 }
145 
146 
147 const PLR_ID* GeoSiHit::plrID() const
148 {
149  const PLR_ID* const id = initPlrID();
150  return id;
151 }
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
GeoSiHit::initPlrID
static const PLR_ID * initPlrID()
Definition: GeoSiHit.cxx:88
GeoSiHit::initPixID
static const PixelID * initPixID()
Definition: GeoSiHit.cxx:58
GeoSiHit::initPlrMgr
static const InDetDD::PixelDetectorManager * initPlrMgr()
Definition: GeoSiHit.cxx:50
PLR_ID
This is a Identifier helper class for the PLR subdetector. This class inherits from PixelID.
Definition: PLR_ID.h:22
GeoSiHit::initPixMgr
static const InDetDD::PixelDetectorManager * initPixMgr()
Definition: GeoSiHit.cxx:11
GeoSiHit::plrID
const PLR_ID * plrID() const
Definition: GeoSiHit.cxx:147
GeoSiHit::plrMgr
const InDetDD::PixelDetectorManager * plrMgr() const
Definition: GeoSiHit.cxx:119
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
GeoSiHit::pixMgr
const InDetDD::PixelDetectorManager * pixMgr() const
Definition: GeoSiHit.cxx:98
GeoSiHit.h
GeoSiHit::sctMgr
const InDetDD::SCT_DetectorManager * sctMgr() const
Definition: GeoSiHit.cxx:105
HGTD_ID
Definition: HGTD_ID.h:47
GeoSiHit::initHgtdID
static const HGTD_ID * initHgtdID()
Definition: GeoSiHit.cxx:78
GeoSiHit::hgtdID
const HGTD_ID * hgtdID() const
Definition: GeoSiHit.cxx:140
GeoSiHit::sctID
const SCT_ID * sctID() const
Definition: GeoSiHit.cxx:133
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
GeoSiHit::initSctMgr
static const InDetDD::SCT_DetectorManager * initSctMgr()
Definition: GeoSiHit.cxx:27
GeoSiHit::hgtdMgr
const HGTD_DetectorManager * hgtdMgr() const
Definition: GeoSiHit.cxx:112
SCT_ID
Definition: SCT_ID.h:68
GeoSiHit::pixID
const PixelID * pixID() const
Definition: GeoSiHit.cxx:126
HGTD_DetectorManager
Definition: HGTD_DetectorManager.h:33
GeoSiHit::initHgtdMgr
static const HGTD_DetectorManager * initHgtdMgr()
Definition: GeoSiHit.cxx:42
GeoSiHit::initSctID
static const SCT_ID * initSctID()
Definition: GeoSiHit.cxx:68
pix
Definition: PixelMapping.cxx:16
PixelID
Definition: PixelID.h:67
StoreGateSvc.h
ServiceHandle< StoreGateSvc >