ATLAS Offline Software
FCALDetectorManager.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GaudiKernel/Bootstrap.h"
6 #include "GaudiKernel/ISvcLocator.h"
9 #include "LArReadoutGeometry/FCAL_ChannelMap.h"
10 #include "LArHV/LArHVManager.h"
11 
13  : GeoVDetectorManager()
14  , m_HVManager(hvManager)
15 {
16  setName("LArFCAL");
17  for (int s=0;s<2;s++) {
18  for (int m=0;m<3;m++) {
19  m_Module[s][m]=nullptr;
20  }
21  }
22 
23  ISvcLocator *svcLocator = Gaudi::svcLocator();
24 
26  if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
27  throw std::runtime_error("Error in FCALDetectorManager: cannot access DetectorStore");
28  }
29 
30  const FCAL_ChannelMap *cMap;
31  if (detStore->retrieve(cMap)==StatusCode::FAILURE) {
32  throw std::runtime_error("You must construct the GeoModel FCAL before instantiating FCALDetectorManager");
33  }
34 
35  m_fcal_channel_map=cMap;
36 
37 }
38 
39 
41 {
42  for (int s=0;s<2;s++) {
43  for (int m=0;m<3;m++) {
44  delete m_Module[s][m];
45  }
46  }
47 }
48 
49 
50 
52 {
53  return m_DetList.begin();
54 }
55 
57 {
58  return m_DetList.end();
59 }
60 
62 {
63  return m_Module[endcap][module-1];
64 }
65 
67 {
68  return m_treeTop.size();
69 }
70 
71 PVConstLink FCALDetectorManager::getTreeTop (unsigned int i) const
72 {
73  return m_treeTop[i];
74 }
75 
77 {
78  int mod = fcalModule->getModuleIndex()-1;
79  int side = fcalModule->getEndcapIndex();
80  m_Module[side][mod]=fcalModule;
81  m_DetList.push_back(fcalModule);
82  fcalModule->setManager(this);
83 }
84 
85 void FCALDetectorManager::addTreeTop (PVLink treeTop)
86 {
87  m_treeTop.push_back(treeTop);
88 }
89 
91 {
92  return *m_HVManager;
93 }
94 
95 
FCALDetectorManager::~FCALDetectorManager
virtual ~FCALDetectorManager() override
Desctructor.
Definition: FCALDetectorManager.cxx:40
LArHVManager.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
FCALDetectorManager::ConstIterator
std::vector< const FCALModule * >::const_iterator ConstIterator
Definition: FCALDetectorManager.h:34
FCALDetectorManager::m_DetList
std::vector< const FCALModule * > m_DetList
Vector of FCAL Modules.
Definition: FCALDetectorManager.h:115
FCAL_ChannelMap
This class contains the tube and tile maps for the FCAL A tile is of a set of FCAL tubes.
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:34
FCALDetectorManager.h
FCALDetectorManager::getFCAL
const FCALModule * getFCAL(FCALModule::Module module, FCALModule::Endcap endcap) const
Retreive a specific FCAL Module.
Definition: FCALDetectorManager.cxx:61
FCALDetectorManager::getNumTreeTops
virtual unsigned int getNumTreeTops() const override
Gets the number of tree tops.
Definition: FCALDetectorManager.cxx:66
FCALDetectorManager::m_HVManager
const FCALHVManager * m_HVManager
Definition: FCALDetectorManager.h:119
FCALDetectorManager::m_fcal_channel_map
const FCAL_ChannelMap * m_fcal_channel_map
Definition: FCALDetectorManager.h:117
FCALDetectorManager::addTreeTop
void addTreeTop(PVLink treeTop)
Add a Tree Top.
Definition: FCALDetectorManager.cxx:85
TRT::Hit::side
@ side
Definition: HitInfo.h:83
python.PyAthena.module
module
Definition: PyAthena.py:134
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:92
FCALDetectorManager::getHVManager
const FCALHVManager & getHVManager() const
Get the HV Manager:
Definition: FCALDetectorManager.cxx:90
FCALDetectorManager::m_treeTop
std::vector< PVLink > m_treeTop
This is the set of tree tops managed by this detector node.
Definition: FCALDetectorManager.h:103
FCALDetectorManager::m_Module
ModulePtr m_Module[2][3]
This is the array in which three modules in two sides are kept.
Definition: FCALDetectorManager.h:109
FCALModule::getModuleIndex
FCALModule::Module getModuleIndex() const
Returns the Module (1,2, or 3)
Definition: FCALModule.cxx:74
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
FCALModule::Endcap
Endcap
Definition: FCALModule.h:38
FCALDetectorManager::addModule
void addModule(FCALModule *fcalModule)
Adds an FCAL Module.
Definition: FCALDetectorManager.cxx:76
FCALModule
Definition: FCALModule.h:33
FCALModule::setManager
void setManager(FCALDetectorManager *fcalManager)
Sets the manager.
Definition: FCALModule.cxx:110
FCALModule::getEndcapIndex
FCALModule::Endcap getEndcapIndex() const
Returns the side (O=Negative, 1=Positive)
Definition: FCALModule.cxx:69
FCALDetectorManager::beginFCAL
FCALDetectorManager::ConstIterator beginFCAL() const
Iterate over FCAL Modules.
Definition: FCALDetectorManager.cxx:51
FCALDetectorManager::FCALDetectorManager
FCALDetectorManager(const FCALHVManager *hvManager=nullptr)
Constructor.
Definition: FCALDetectorManager.cxx:12
FCALDetectorManager::endFCAL
FCALDetectorManager::ConstIterator endFCAL() const
Iterate over FCAL Modules.
Definition: FCALDetectorManager.cxx:56
FCALModule::Module
Module
Definition: FCALModule.h:37
FCALHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: FCALHVManager.h:35
StoreGateSvc.h
FCALDetectorManager::getTreeTop
virtual PVConstLink getTreeTop(unsigned int i) const override
Gets the ith tree top.
Definition: FCALDetectorManager.cxx:71