ATLAS Offline Software
Loading...
Searching...
No Matches
InDetServMatFactory Class Reference

#include <InDetServMatFactory.h>

Inheritance diagram for InDetServMatFactory:
Collaboration diagram for InDetServMatFactory:

Public Member Functions

 InDetServMatFactory (InDetDD::AthenaComps *athenaComps)
const InDetServMatFactoryoperator= (const InDetServMatFactory &right)=delete
 InDetServMatFactory (const InDetServMatFactory &right)=delete
 ~InDetServMatFactory ()=default
virtual void create (GeoPhysVol *world) override
virtual const InDetDD::InDetServMatManagergetDetectorManager () const override
StoreGateSvcdetStore ()
const StoreGateSvcdetStore () const
const IGeoDbTagSvcgeoDbTagSvc () const
IRDBAccessSvcrdbAccessSvc ()
const IGeometryDBSvcgeomDB () const
MsgStream & msg (MSG::Level lvl) const
bool msgLvl (MSG::Level lvl)
InDetDD::AthenaCompsgetAthenaComps ()

Private Attributes

InDetDD::InDetServMatManagerm_manager {nullptr}
InDetDD::AthenaCompsm_athenaComps

Detailed Description

Definition at line 15 of file InDetServMatFactory.h.

Constructor & Destructor Documentation

◆ InDetServMatFactory() [1/2]

InDetServMatFactory::InDetServMatFactory ( InDetDD::AthenaComps * athenaComps)

Definition at line 44 of file InDetServMatFactory.cxx.

45 : InDetDD::DetectorFactoryBase(athenaComps)
46{
47}

◆ InDetServMatFactory() [2/2]

InDetServMatFactory::InDetServMatFactory ( const InDetServMatFactory & right)
delete

◆ ~InDetServMatFactory()

InDetServMatFactory::~InDetServMatFactory ( )
default

Member Function Documentation

◆ create()

void InDetServMatFactory::create ( GeoPhysVol * world)
overridevirtual

Definition at line 50 of file InDetServMatFactory.cxx.

51{
52
53 // create a new det manager
54 m_manager = new InDetDD::InDetServMatManager();
55
56 // Get the material manager:
57 DecodeVersionKey sctVersionKey(geoDbTagSvc(),"SCT");
58 DecodeVersionKey trtVersionKey(geoDbTagSvc(),"TRT");
59 DecodeVersionKey indetVersionKey(geoDbTagSvc(),"InnerDetector");
60 DecodeVersionKey atlasVersionKey(geoDbTagSvc(),"ATLAS");
61
62
63 msg(MSG::DEBUG) << "Building InDet Service Material with ATLAS Version Tag: " << atlasVersionKey.tag() << endmsg;
64 msg(MSG::DEBUG) << " with InDet Version Tag: " << indetVersionKey.tag() << " at Node: "
65 << indetVersionKey.node() << endmsg;
66 msg(MSG::DEBUG) << " with TRT Version Tag: " << trtVersionKey.tag() << " at Node: "
67 << trtVersionKey.node() << endmsg;
68 msg(MSG::DEBUG) << " with SCT Version Tag: " << sctVersionKey.tag() << " at Node: "
69 << sctVersionKey.node() << endmsg;
70 msg(MSG::DEBUG) << " InDetServices Version " << rdbAccessSvc()->getChildTag("InDetServices", indetVersionKey.tag(), indetVersionKey.node()) << endmsg;
71 msg(MSG::DEBUG) << " TRT Version " << rdbAccessSvc()->getChildTag("TRT", trtVersionKey.tag(), trtVersionKey.node()) << endmsg;
72 msg(MSG::DEBUG) << " SCT Version " << rdbAccessSvc()->getChildTag("SCT", sctVersionKey.tag(), sctVersionKey.node()) << endmsg;
73
74 IRDBRecordset_ptr atls = rdbAccessSvc()->getRecordsetPtr("AtlasMother", atlasVersionKey.tag(), atlasVersionKey.node());
75
76 IRDBRecordset_ptr servEnvelopeTable =
77 rdbAccessSvc()->getRecordsetPtr("InDetServEnvelope", indetVersionKey.tag(), indetVersionKey.node());
78 const IRDBRecord *envelopes = (*servEnvelopeTable)[0];
79
80 IRDBRecordset_ptr scalingTable = rdbAccessSvc()->getRecordsetPtr("InDetServMatScaling", indetVersionKey.tag(), indetVersionKey.node());
81
82 InDetMaterialManager * materialManager = new InDetMaterialManager("InDetServMatMaterialManager", getAthenaComps());
83 materialManager->addScalingTable(scalingTable);
84
85 double safety = 0.001 * Gaudi::Units::mm;
86
87 double ZMaxBrlTRT = envelopes->getDouble("ZMAXBRLTRT") * Gaudi::Units::mm;
88 double ZMaxBrlSCT = envelopes->getDouble("ZMAXBRLSCT") * Gaudi::Units::mm;
89 double ZMinFwdSCTandTRT = envelopes->getDouble("ZMINFWDSCTANDTRT") * Gaudi::Units::mm;
90 double ZMinSCTServInTRT = envelopes->getDouble("ZMINSCTSERVINTRT") * Gaudi::Units::mm;
91 double ZMaxSCTServInTRT = envelopes->getDouble("ZMAXSCTSERVINTRT") * Gaudi::Units::mm;
92 double ZMinPixServ = envelopes->getDouble("ZMINPIXSERV") * Gaudi::Units::mm;
93 double ZMaxFwdTRTC = envelopes->getDouble("ZMAXFWDTRTC") * Gaudi::Units::mm;
94 double ZMaxIDet = (*atls)[0]->getDouble("IDETZMX") * Gaudi::Units::cm + safety; // 3470 mm
95
96 double RMinBrlSCT = envelopes->getDouble("RMINBRLSCT") * Gaudi::Units::mm;
97 double RMaxBrlTRT = envelopes->getDouble("RMAXBRLTRT") * Gaudi::Units::mm;
98 double RMinBrlTRT = envelopes->getDouble("RMINBRLTRT") * Gaudi::Units::mm;
99 double RMaxFwdTRT = envelopes->getDouble("RMAXFWDTRT") * Gaudi::Units::mm;
100 double RMaxFwdSCT = envelopes->getDouble("RMAXFWDSCT") * Gaudi::Units::mm;
101 double RMaxFwdTRTC = envelopes->getDouble("RMAXFWDTRTC") * Gaudi::Units::mm;
102 double RMinPixServ = envelopes->getDouble("RMINPIXSERV") * Gaudi::Units::mm;
103 double RMaxPixServ = envelopes->getDouble("RMAXPIXSERV") * Gaudi::Units::mm;
104 double RMaxIDet = (*atls)[0]->getDouble("IDETOR") * Gaudi::Units::cm + safety; // 1147 mm
105
106 // Since the TRT Wheel C space is not used in some versions and is used by some
107 // other services we simplify the volume.
108 // The 1mm is just to ensure the dimensions are considered equal if they differ
109 // by less than 1mm.
110
111 // join1 is True if the pixel service volume and SCT/TRT volume are joined
112 // (ie boolean volume not needed)
113 // join2 is True if RMaxFwdTRTC and RMaxPixServ are ~ the same as RMinPixServ
114 // in which case a couple of planes are not needed in the PCON.
115
116 bool join1 = false;
117 bool join2 = false;
118
119 if (std::abs(RMaxFwdTRTC - RMinPixServ) <= 1*Gaudi::Units::mm){
120 join1 = true;
121 join2 = true;
122 RMaxFwdTRTC = RMinPixServ;
123 RMaxPixServ = RMinPixServ;
124 } else if ((RMaxFwdTRTC - 1*Gaudi::Units::mm) <= RMaxPixServ) {
125 join1 = true;
126 RMaxPixServ = RMaxFwdTRTC;
127 }
128
129
130 //
131 // Create the envelope for the Pixel Services:
132 // Only need if join1 if false.
133
134 const GeoShapeUnion *ServVolAux = nullptr;
135
136 if (!join1) {
137 GeoPcon* pixServP = new GeoPcon(0.,2*Gaudi::Units::pi);
138 GeoPcon* pixServM = new GeoPcon(0.,2*Gaudi::Units::pi);
139
140 // Plane 1: Start at the end of the SCT endcap
141 pixServP->addPlane(ZMinPixServ, RMinPixServ, RMaxPixServ);
142 pixServM->addPlane(-ZMinPixServ, RMinPixServ, RMaxPixServ);
143
144 // Plane 2 and 3: at the end of the TRT endcap
145 pixServP->addPlane(ZMaxFwdTRTC, RMinPixServ, RMaxPixServ);
146 pixServP->addPlane(ZMaxFwdTRTC, RMinPixServ, RMaxIDet);
147 pixServM->addPlane(-ZMaxFwdTRTC, RMinPixServ, RMaxPixServ);
148 pixServM->addPlane(-ZMaxFwdTRTC, RMinPixServ, RMaxIDet);
149
150 // Plane 4 at the end of the ID
151 pixServP->addPlane(ZMaxIDet, RMinPixServ, RMaxIDet);
152 pixServM->addPlane(-ZMaxIDet, RMinPixServ, RMaxIDet);
153
154 ServVolAux = new GeoShapeUnion(pixServP, pixServM);
155 }
156
157 // This is the volume for the TRT/SCT services
158 GeoPcon *sctTrtServ = new GeoPcon(0.,2*Gaudi::Units::pi);
159
160 // Pixel Services
161 if (join1) {
162 // THE BEGINNING
163 sctTrtServ->addPlane(-ZMaxIDet, RMinPixServ, RMaxIDet);
164 // PP1 region.
165 if (!join2) {
166 sctTrtServ->addPlane(-ZMinPixServ, RMinPixServ, RMaxIDet);
167 sctTrtServ->addPlane(-ZMinPixServ, RMaxPixServ, RMaxIDet);
168 }
169 } else {
170 // THE BEGINNING
171 sctTrtServ->addPlane(-ZMaxIDet, RMaxFwdTRTC, RMaxIDet);
172 }
173
174 // SCT services in TRT endcap
175 sctTrtServ->addPlane(-ZMaxSCTServInTRT, RMaxFwdTRTC, RMaxIDet);
176 sctTrtServ->addPlane(-ZMaxSCTServInTRT, RMaxFwdSCT, RMaxIDet);
177 sctTrtServ->addPlane(-ZMinSCTServInTRT, RMaxFwdSCT, RMaxIDet);
178 sctTrtServ->addPlane(-ZMinSCTServInTRT, RMaxFwdTRT, RMaxIDet);
179
180 // Beginning of Ecap SCT and TRT
181 sctTrtServ->addPlane(-ZMinFwdSCTandTRT, RMaxFwdTRT, RMaxIDet);
182 sctTrtServ->addPlane(-ZMinFwdSCTandTRT, RMinBrlSCT, RMaxIDet);
183
184 // End of Barrel SCT (SCT barrel services)
185 sctTrtServ->addPlane(-ZMaxBrlSCT, RMinBrlSCT, RMaxIDet);
186 sctTrtServ->addPlane(-ZMaxBrlSCT, RMinBrlTRT, RMaxIDet);
187
188 // Plane, end of barrel TRT (TRT barrel services)
189 sctTrtServ->addPlane(-ZMaxBrlTRT, RMinBrlTRT, RMaxIDet);
190 sctTrtServ->addPlane(-ZMaxBrlTRT, RMaxBrlTRT, RMaxIDet);
191
192
193 // THE OTHER SIDE
194 // Plane, end of barrel TRT (TRT barrel services)
195 sctTrtServ->addPlane(ZMaxBrlTRT, RMaxBrlTRT, RMaxIDet);
196 sctTrtServ->addPlane(ZMaxBrlTRT, RMinBrlTRT, RMaxIDet);
197
198 // End of Barrel SCT (SCT barrel services)
199 sctTrtServ->addPlane(ZMaxBrlSCT, RMinBrlTRT, RMaxIDet);
200 sctTrtServ->addPlane(ZMaxBrlSCT, RMinBrlSCT, RMaxIDet);
201
202 // Beginning of Ecap SCT and TRT
203 sctTrtServ->addPlane(ZMinFwdSCTandTRT, RMinBrlSCT, RMaxIDet);
204 sctTrtServ->addPlane(ZMinFwdSCTandTRT, RMaxFwdTRT, RMaxIDet);
205
206 // SCT services in TRT endcap
207 sctTrtServ->addPlane(ZMinSCTServInTRT, RMaxFwdTRT, RMaxIDet);
208 sctTrtServ->addPlane(ZMinSCTServInTRT, RMaxFwdSCT, RMaxIDet);
209 sctTrtServ->addPlane(ZMaxSCTServInTRT, RMaxFwdSCT, RMaxIDet);
210 sctTrtServ->addPlane(ZMaxSCTServInTRT, RMaxFwdTRTC, RMaxIDet);
211
212 // Pixel Services
213 if (join1) {
214 // PP1 region
215 if (!join2) {
216 sctTrtServ->addPlane(ZMinPixServ, RMaxPixServ, RMaxIDet);
217 sctTrtServ->addPlane(ZMinPixServ, RMinPixServ, RMaxIDet);
218 }
219 // The end
220 sctTrtServ->addPlane(ZMaxIDet, RMinPixServ, RMaxIDet);
221 } else {
222
223 // The end
224 sctTrtServ->addPlane(ZMaxIDet, RMaxFwdTRTC, RMaxIDet);
225 }
226
227 const GeoShape * ServVol = nullptr;
228 if (ServVolAux == nullptr) {
229 ServVol = sctTrtServ;
230 } else {
231 ServVol = new GeoShapeUnion(sctTrtServ, ServVolAux);
232 }
233 const GeoMaterial* air = materialManager->getMaterial("std::Air");
234 const GeoLogVol* ServLog = new GeoLogVol("ServLog",ServVol,air);
235 GeoPhysVol* ServPhys = new GeoPhysVol(ServLog);
236
237 // Add this to the world and register it to the manager so GeoG4 will
238 // find it.
239 //
240 GeoNameTag *tag = new GeoNameTag("InDetServMat");
241 world->add(tag);
242 world->add(ServPhys);
243 m_manager->addTreeTop(ServPhys);
244 // Pixel Services:
245 PixelServMatFactory PSMF(getAthenaComps());
246 PSMF.create(ServPhys);
247
248 // SCT Services:
249 SCT_ServMatFactory SSMF(getAthenaComps());
250 SSMF.create(ServPhys);
251
252 // TRT Services:
253 TRT_ServMatFactory TSMF(getAthenaComps());
254 TSMF.create(ServPhys);
255
256 // EP:
257 EndPlateFactory EPMF(getAthenaComps(), materialManager);
258 EPMF.create(ServPhys);
259
260 // Rails:
261 SupportRailFactory RAMF(getAthenaComps(), materialManager);
262 RAMF.create(ServPhys);
263
264 // SquirrelCage:
265 SquirrelCageFactory SQCF(getAthenaComps(), materialManager);
266 SQCF.create(ServPhys);
267
268 // Extra material
269 InDetDD::DistortedMaterialManager xMatManager;
270 InDetDD::ExtraMaterial xMat(&xMatManager);
271 xMat.add(ServPhys, "InDetServMat");
272
273 delete materialManager;
274
275}
#define endmsg
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual std::string getChildTag(const std::string &childNode, const std::string &parentTag, const std::string &parentNode, const std::string &connName="ATLASDD")=0
Gets the tag name for the node by giving its parent node tag.
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
InDetDD::AthenaComps * getAthenaComps()
const IGeoDbTagSvc * geoDbTagSvc() const
void addScalingTable(const IRDBRecordset_ptr &scalingTable)
const GeoMaterial * getMaterial(const std::string &materialName)
Get material. First looks for locally defined material and if not found looks in GeoModel material ma...
InDetDD::InDetServMatManager * m_manager
MsgStream & msg
Definition testRead.cxx:32

◆ detStore() [1/2]

StoreGateSvc * InDetDD::DetectorFactoryBase::detStore ( )
inlineinherited

Definition at line 27 of file InDetDetectorFactoryBase.h.

27{return m_athenaComps->detStore();}

◆ detStore() [2/2]

const StoreGateSvc * InDetDD::DetectorFactoryBase::detStore ( ) const
inlineinherited

Definition at line 28 of file InDetDetectorFactoryBase.h.

28{return std::as_const(*m_athenaComps).detStore();}

◆ geoDbTagSvc()

const IGeoDbTagSvc * InDetDD::DetectorFactoryBase::geoDbTagSvc ( ) const
inlineinherited

Definition at line 30 of file InDetDetectorFactoryBase.h.

30{return std::as_const(*m_athenaComps).geoDbTagSvc();}

◆ geomDB()

const IGeometryDBSvc * InDetDD::DetectorFactoryBase::geomDB ( ) const
inlineinherited

Definition at line 34 of file InDetDetectorFactoryBase.h.

34{return m_athenaComps->geomDB();}

◆ getAthenaComps()

InDetDD::AthenaComps * InDetDD::DetectorFactoryBase::getAthenaComps ( )
inlineinherited

Definition at line 42 of file InDetDetectorFactoryBase.h.

42{return m_athenaComps;}

◆ getDetectorManager()

const InDetDD::InDetServMatManager * InDetServMatFactory::getDetectorManager ( ) const
overridevirtual

Definition at line 278 of file InDetServMatFactory.cxx.

278 {
279 return m_manager;
280}

◆ msg()

MsgStream & InDetDD::DetectorFactoryBase::msg ( MSG::Level lvl) const
inlineinherited

Definition at line 37 of file InDetDetectorFactoryBase.h.

37{ return m_athenaComps->msg(lvl); }

◆ msgLvl()

bool InDetDD::DetectorFactoryBase::msgLvl ( MSG::Level lvl)
inlineinherited

Definition at line 40 of file InDetDetectorFactoryBase.h.

40{ return m_athenaComps->msgLvl(lvl); }

◆ operator=()

const InDetServMatFactory & InDetServMatFactory::operator= ( const InDetServMatFactory & right)
delete

◆ rdbAccessSvc()

IRDBAccessSvc * InDetDD::DetectorFactoryBase::rdbAccessSvc ( )
inlineinherited

Definition at line 32 of file InDetDetectorFactoryBase.h.

32{return m_athenaComps->rdbAccessSvc();}

Member Data Documentation

◆ m_athenaComps

InDetDD::AthenaComps* InDetDD::DetectorFactoryBase::m_athenaComps
privateinherited

Definition at line 46 of file InDetDetectorFactoryBase.h.

◆ m_manager

InDetDD::InDetServMatManager* InDetServMatFactory::m_manager {nullptr}
private

Definition at line 36 of file InDetServMatFactory.h.

36{nullptr};

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