ATLAS Offline Software
LArDetectorFactoryH62003.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
10 #include "LArReadoutGeometry/FCAL_ChannelMap.h"
11 
12 #include "GeoModelKernel/GeoPhysVol.h"
13 #include "GeoModelKernel/GeoTransform.h"
14 #include "GeoModelKernel/GeoNameTag.h"
15 #include "GeoModelKernel/GeoShapeUnion.h"
16 
17 #include "CLHEP/Geometry/Transform3D.h"
18 
21 
22 #include "StoreGate/StoreGateSvc.h"
23 #include "GaudiKernel/MsgStream.h"
24 #include "GaudiKernel/Bootstrap.h"
25 
26 
28  : m_detectorManager(nullptr),
29  m_fcalVisLimit(-1),
30  m_axisVisState(-1)
31 {}
32 
33 
35 = default;
36 
37 
38 // Place the cryostats into a container physical volume.
39 void LArGeo::LArDetectorFactoryH62003::create( GeoPhysVol* a_container )
40 {
41 
42  ISvcLocator *svcLocator = Gaudi::svcLocator();
43  IMessageSvc * msgSvc;
44  if (svcLocator->service("MessageSvc", msgSvc, true )==StatusCode::FAILURE) {
45  throw std::runtime_error("Error in LAr::DetectorFactor, cannot access MessageSvc");
46  }
47 
48  MsgStream log(msgSvc, "LAr::DetectorFactory");
49 
50  log << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
51  log << "+ +" << std::endl;
52  log << "+ HELLO from LAr::DetectorFactory +" << std::endl;
53  log << "+ +" << std::endl;
54  log << "+++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
55 
56 
57 
59  if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
60  throw std::runtime_error("Error in LArDetectorFactoryH62003, cannot access DetectorStore");
61  }
62 
63  // Get access to the material manager:
64 
65  LArDetectorConstructionH62003 BeamLineDets;
66  BeamLineDets.SetFCALVisLimit(m_fcalVisLimit);
67  BeamLineDets.SetAxisVisState(m_axisVisState);
68 
69  PVLink Envelope = nullptr;
70 
71  Envelope = BeamLineDets.GetEnvelope();
72 
73  a_container->add(new GeoNameTag("LAr"));
74  a_container->add(Envelope);
75 
76 
77 
78  FCALDetectorManager *fcalDetectorManager = new FCALDetectorManager();
79 
80  std::cout <<"In the LArDetectorFactory.........." << std::endl;
81 
82  // Get the full physical volumes that were created and stored by the construction:
83  {
84  StoredPhysVol *fcal1,*fcal2, *fcal3;
85  if (StatusCode::SUCCESS!=detStore->retrieve(fcal1,"FCAL1_NEG")) {
86  log << MSG::WARNING << "No volume created for FCAL 1 Neg" << endmsg;
87  }
88  else {
90  fcalDetectorManager->addModule(detDescr);
91  }
92  if (StatusCode::SUCCESS!=detStore->retrieve(fcal2,"FCAL2_NEG")) {
93  log << MSG::WARNING << "No volume created for FCAL 2 Neg" << endmsg;
94  }
95  else {
97  fcalDetectorManager->addModule(detDescr);
98  }
99  if (StatusCode::SUCCESS!=detStore->retrieve(fcal3,"FCAL3_NEG")) {
100  log << MSG::WARNING << "No volume created for FCAL 3 Neg" << endmsg;
101  }
102  else {
104  fcalDetectorManager->addModule(detDescr);
105  }
106  }
107 
108  detStore->record(fcalDetectorManager,fcalDetectorManager->getName()).ignore();
109  m_detectorManager = new LArDetectorManager(nullptr,nullptr,nullptr,fcalDetectorManager);
110  m_detectorManager->addTreeTop(Envelope);
111 
112 
113 }
114 
115 
117 {
118  return m_detectorManager;
119 }
120 
Envelope
Definition: IDetectorGeometryTool.h:17
LArDetectorConstructionH62003.h
FCALDetectorManager
A manager class providing access to readout geometry information for the forward calorimeter.
Definition: FCALDetectorManager.h:29
LArGeo::LArDetectorFactoryH62003::create
virtual void create(GeoPhysVol *world)
Definition: LArDetectorFactoryH62003.cxx:39
FCALModule::FCAL2
@ FCAL2
Definition: FCALModule.h:37
FCALDetectorManager.h
LArGeo::LArDetectorConstructionH62003::SetFCALVisLimit
void SetFCALVisLimit(int limit)
Definition: LArDetectorConstructionH62003.h:29
LArGeo::LArDetectorFactoryH62003::~LArDetectorFactoryH62003
virtual ~LArDetectorFactoryH62003()
FCALModule::NEG
@ NEG
Definition: FCALModule.h:38
StoredPhysVol
Definition: StoredPhysVol.h:27
LArGeo::LArDetectorConstructionH62003
Definition: LArDetectorConstructionH62003.h:19
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
StoredPhysVol::getPhysVol
GeoFullPhysVol * getPhysVol()
Destructor.
Definition: StoredPhysVol.cxx:20
LArGeo::LArDetectorConstructionH62003::GetEnvelope
virtual PVLink GetEnvelope()
Definition: LArDetectorConstructionH62003.cxx:82
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArGeo::LArDetectorFactoryH62003::LArDetectorFactoryH62003
LArDetectorFactoryH62003()
Definition: LArDetectorFactoryH62003.cxx:27
LArDetectorManager
Stored in storegate. Provides access to EMB, EMEC, HEC and FCAL Detector Managers....
Definition: LArDetectorManager.h:26
LArDetectorFactoryH62003.h
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
StoredMaterialManager.h
FCALDetectorManager::addModule
void addModule(FCALModule *fcalModule)
Adds an FCAL Module.
Definition: FCALDetectorManager.cxx:76
FCALModule
Definition: FCALModule.h:33
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
FCALModule::FCAL1
@ FCAL1
Definition: FCALModule.h:37
LArGeo::LArDetectorFactoryH62003::getDetectorManager
virtual const LArDetectorManager * getDetectorManager() const
Definition: LArDetectorFactoryH62003.cxx:116
StoreGateSvc.h
FCALModule.h
FCALModule::FCAL3
@ FCAL3
Definition: FCALModule.h:37
LArGeo::LArDetectorConstructionH62003::SetAxisVisState
void SetAxisVisState(bool state)
Definition: LArDetectorConstructionH62003.h:30
StoredPhysVol.h