ATLAS Offline Software
LArDetectorFactoryTBEC.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // LArDetectorFactory.cxx
6 // 24-Aug-2006 : V. Niess. Put back initialisation for
7 // VDetectorParameters according to J. Toth scheme.
8 
10 
12 
13 #include "GeoModelKernel/GeoPhysVol.h"
14 #include "GeoModelKernel/GeoTransform.h"
15 #include "GeoModelKernel/GeoNameTag.h"
16 #include "GeoModelKernel/GeoShapeUnion.h"
17 
18 #include "CLHEP/Geometry/Transform3D.h"
19 
21 
22 #include "StoreGate/StoreGateSvc.h"
23 #include "GaudiKernel/MsgStream.h"
24 #include "GaudiKernel/Bootstrap.h"
26 
30 #include "GeoModelKernel/CellBinning.h"
31 
33 
34 // V.N : Patch LAr materials
36 #include "LArGeoRAL/RAL.h"
38 
39 // Place the cryostats into a container physical volume.
40 void LArGeo::LArDetectorFactoryTBEC::create( GeoPhysVol* a_container )
41 {
42  // V.N : Patch LAr materials ??? is this needed?
43  VDetectorParameters::SetInstance(std::make_unique<LArGeo::RAL>());
44 
45  EMECDetectorManager *emecDetectorManager = new EMECDetectorManager();
46 
47  // Get access to the material manager:
48  MsgStream log(Athena::getMessageSvc(), "LArGeo::LArDetectorFactoryTBEC");
49 
50  log << MSG::INFO << "+++++++++++++++++++++++++++++++++++++++++++++++++++++" << endmsg;
51  log << MSG::INFO << "+ +" << endmsg;
52  log << MSG::INFO << "+ HELLO from LAr::DetectorFactoryTBEC +" << endmsg;
53  log << MSG::INFO << "+ +" << endmsg;
54  log << MSG::INFO << "+++++++++++++++++++++++++++++++++++++++++++++++++++++" << endmsg;
55 
56  SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
57  if(!detStore.isValid()) {
58  throw std::runtime_error("Error in LArDetectorFactoryTBEC, cannot access DetectorStore");
59  }
60 
61  // V.N : Patch LAr materials
62  LArMaterialManager lArMaterialManager(detStore);
63  lArMaterialManager.buildMaterials();
64 
65  LArDetectorConstructionTBEC CryostatConstructionTB;
66 
67  PVLink Envelope = nullptr;
68 
69  Envelope = CryostatConstructionTB.GetEnvelope();
70 
71  a_container->add(new GeoNameTag("LAr"));
72  a_container->add(Envelope);
73 
74  double startPhi = M_PI/2-M_PI/8 - 2*M_PI/768/2;
75  double endPhi = M_PI/2+M_PI/8 - 2*M_PI/768/2;
76 
77  StoredPhysVol *sEmecOuterWheel;
78  if (StatusCode::SUCCESS==detStore->retrieve(sEmecOuterWheel, "EMEC_OUTER_WHEEL_POS" )) {
79  GeoIntrusivePtr<GeoFullPhysVol>emecEnvelope= sEmecOuterWheel->getPhysVol();
80 
81 
82  // Outer Wheel Sampling 1 Region 0:
83  {
84  CellBinning phiBinning(startPhi,endPhi,8,12);
85  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,1,0,0,phiBinning);
86  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
87  emecDetectorManager->addDetectorRegion(region);
88  }
89 
90  // Outer Wheel Sampling 1 Region 1:
91  {
92  CellBinning phiBinning(startPhi,endPhi,8,12);
93  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,1,1,0,phiBinning);
94  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
95  emecDetectorManager->addDetectorRegion(region);
96  }
97  // Outer Wheel Sampling 1 Region 2:
98  {
99  CellBinning phiBinning(startPhi,endPhi,8,12);
100  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,1,2,0,phiBinning);
101  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
102  emecDetectorManager->addDetectorRegion(region);
103  }
104  // Outer Wheel Sampling 1 Region 3:
105  {
106  CellBinning phiBinning(startPhi,endPhi,8,12);
107  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,1,3,0,phiBinning);
108  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
109  emecDetectorManager->addDetectorRegion(region);
110  }
111  // Outer Wheel Sampling 1 Region 4:
112  {
113  CellBinning phiBinning(startPhi,endPhi,8,12);
114  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,1,4,0,phiBinning);
115  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
116  emecDetectorManager->addDetectorRegion(region);
117  }
118  // Outer Wheel Sampling 1 Region 5:
119  {
120  CellBinning phiBinning(startPhi,endPhi,8,12);
121  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,1,5,0,phiBinning);
122  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
123  emecDetectorManager->addDetectorRegion(region);
124  }
125  // Outer Wheel Sampling 2 Region 0:
126  {
127  CellBinning phiBinning(startPhi,endPhi,32,48);
128  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,2,0,0,phiBinning);
129  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
130  emecDetectorManager->addDetectorRegion(region);
131  }
132  // Outer Wheel Sampling 2 Region 1:
133  {
134  CellBinning phiBinning(startPhi,endPhi,32,48);
135  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,2,1,0,phiBinning);
136  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
137  emecDetectorManager->addDetectorRegion(region);
138  }
139  // Outer Wheel Sampling 3 Region 0:
140  {
141  CellBinning phiBinning(startPhi,endPhi,32,48);
142  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,3,0,0,phiBinning);
143  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
144  emecDetectorManager->addDetectorRegion(region);
145  }
146  }
147  StoredPhysVol *sEmecInnerWheel;
148  if (StatusCode::SUCCESS==detStore->retrieve(sEmecInnerWheel, "EMEC_INNER_WHEEL_POS" )) {
149  GeoIntrusivePtr<GeoFullPhysVol>emecEnvelope= sEmecInnerWheel->getPhysVol();
150  // Inner Wheel Sampling 1 Region 0:
151  {
152  CellBinning phiBinning(startPhi,endPhi,8,12);
153  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,1,0,1,phiBinning);
154  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
155  emecDetectorManager->addDetectorRegion(region);
156  }
157  // Inner Wheel Sampling 2 Region 0:
158 
159  {
160  CellBinning phiBinning(startPhi,endPhi,8,12);
161  EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,2,0,1,phiBinning);
162  EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::POS);
163  emecDetectorManager->addDetectorRegion(region);
164  }
165  }
166 
167 
168  StoredPhysVol *sPresamplerEnvelope;
169  if (StatusCode::SUCCESS==detStore->retrieve(sPresamplerEnvelope, "PRESAMPLER_EC_POS" )) {
170  GeoIntrusivePtr<GeoFullPhysVol> PresamplerEnvelope=sPresamplerEnvelope->getPhysVol();
171  CellBinning presamplerPhiBinning(startPhi,endPhi,8,12);
172  EMECDetDescr *presamplerDetDescr = new EMECDetDescr(emecDetectorManager,0,0,0,presamplerPhiBinning);
173  EMECDetectorRegion *presamplerRegion = new EMECDetectorRegion(PresamplerEnvelope,presamplerDetDescr,EMECDetectorRegion::POS);
174  emecDetectorManager->addDetectorRegion(presamplerRegion);
175  }
176  detStore->record(emecDetectorManager,emecDetectorManager->getName()).ignore();
177  m_detectorManager = new LArDetectorManager(nullptr,emecDetectorManager,nullptr,nullptr);
179 
180 }
181 
182 
184 {
185  return m_detectorManager;
186 }
187 
LArMaterialManager.h
Envelope
Definition: IDetectorGeometryTool.h:17
EMECDetectorManager::addDetectorRegion
void addDetectorRegion(const EMECDetectorRegion *region)
Add a new HEC Detector Region.
Definition: EMECDetectorManager.cxx:128
LArMaterialManager::buildMaterials
void buildMaterials()
Definition: LArMaterialManager.cxx:28
LArGeo::VDetectorParameters::SetInstance
static void SetInstance(std::unique_ptr< VDetectorParameters >)
Definition: VDetectorParameters.cxx:24
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
EMECDetectorManager
A manager class providing access to readout geometry information for the electromagnetic endcap calor...
Definition: EMECDetectorManager.h:31
EMECDetectorManager.h
EMECDetectorRegion::POS
@ POS
Definition: EMECDetectorRegion.h:33
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LArGeo::LArDetectorConstructionTBEC::GetEnvelope
PVLink GetEnvelope()
Definition: LArDetectorConstructionTBEC.cxx:90
EMECDetectorRegion
Definition: EMECDetectorRegion.h:30
LArGeo::LArDetectorConstructionTBEC
Definition: LArDetectorConstructionTBEC.h:19
EMECDetDescr
Descriptor for regions of the electromagnetic endcap calorimeter.
Definition: EMECDetDescr.h:27
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
RAL.h
StoredPhysVol
Definition: StoredPhysVol.h:27
StoredPhysVol::getPhysVol
GeoFullPhysVol * getPhysVol()
Destructor.
Definition: StoredPhysVol.cxx:20
LArMaterialManager
Definition: LArMaterialManager.h:38
LArGeo::LArDetectorFactoryTBEC::getDetectorManager
virtual const LArDetectorManager * getDetectorManager() const override
Definition: LArDetectorFactoryTBEC.cxx:183
LArDetectorConstructionTBEC.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArGeo::LArDetectorFactoryTBEC::m_detectorManager
LArDetectorManager * m_detectorManager
Definition: LArDetectorFactoryTBEC.h:40
LArGeo::LArDetectorFactoryTBEC::create
virtual void create(GeoPhysVol *world) override
Definition: LArDetectorFactoryTBEC.cxx:40
LArDetectorManager::addTreeTop
void addTreeTop(const PVConstLink &treeTop)
Add a Tree Top.
Definition: LArDetectorManager.cxx:31
LArDetectorManager
Stored in storegate. Provides access to EMB, EMEC, HEC and FCAL Detector Managers....
Definition: LArDetectorManager.h:26
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
VDetectorParameters.h
StoredMaterialManager.h
EMECDetDescr.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArDetectorFactoryTBEC.h
StoreGateSvc.h
EMECDetectorRegion.h
StoredPhysVol.h