ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TileDetectorFactoryLite Class Reference

Definition of the TileDetectorFactoryLite class. The TileDetectorFactoryLite is invoked by the TileDetectorTool when the GeoModel description of Tile calorimeter is built from the SQLite database It also builds readout geometry (coming soon). More...

#include <TileDetectorFactoryLite.h>

Inheritance diagram for TileDetectorFactoryLite:
Collaboration diagram for TileDetectorFactoryLite:

Public Member Functions

 TileDetectorFactoryLite (StoreGateSvc *pDetStore, TileDetDescrManager *manager, GeoModelIO::ReadGeoModel *sqliteReader, IRDBAccessSvc *rdbaccess, const TileSwitches &switches, MsgStream *log, bool fullGeo)
 Constructor. More...
 
 ~TileDetectorFactoryLite ()
 Destructor. More...
 
virtual void create (GeoPhysVol *world)
 Creation of Tile geometry. More...
 
virtual const TileDetDescrManagergetDetectorManager () const
 Access function to TileDetDescr geometry data. More...
 

Private Attributes

TileDetDescrManagerm_detectorManager
 Detector pointer to TileDetDescrManager. More...
 
IRDBAccessSvcm_paramsSvc
 Pointer to an instance of the RDBAccessSvc to get parameters from the SQLite file. More...
 
TileSwitches m_switches
 all switches More...
 
MsgStream * m_log
 Get message SVC. More...
 
bool m_verbose
 Flag for activation verbose level for debugging. More...
 

Detailed Description

Definition of the TileDetectorFactoryLite class. The TileDetectorFactoryLite is invoked by the TileDetectorTool when the GeoModel description of Tile calorimeter is built from the SQLite database It also builds readout geometry (coming soon).

Author
Riccardo Maria BIANCHI ricca.nosp@m.rdo..nosp@m.maria.nosp@m..bia.nosp@m.nchi@.nosp@m.cern.nosp@m..ch , Aug 2021

Updates:

Definition at line 41 of file TileDetectorFactoryLite.h.

Constructor & Destructor Documentation

◆ TileDetectorFactoryLite()

TileDetectorFactoryLite::TileDetectorFactoryLite ( StoreGateSvc pDetStore,
TileDetDescrManager manager,
GeoModelIO::ReadGeoModel *  sqliteReader,
IRDBAccessSvc rdbaccess,
const TileSwitches switches,
MsgStream *  log,
bool  fullGeo 
)

Constructor.

Definition at line 39 of file TileDetectorFactoryLite.cxx.

47  , m_paramsSvc(paramsSvc)
48  , m_switches(switches)
49  , m_log(log)
50  , m_verbose(log->level()<=MSG::VERBOSE)
51 {
52  m_switches.testBeam = false;
53 }

◆ ~TileDetectorFactoryLite()

TileDetectorFactoryLite::~TileDetectorFactoryLite ( )

Destructor.

Definition at line 57 of file TileDetectorFactoryLite.cxx.

57 {}

Member Function Documentation

◆ create()

void TileDetectorFactoryLite::create ( GeoPhysVol *  world)
virtual

Creation of Tile geometry.

Definition at line 61 of file TileDetectorFactoryLite.cxx.

62 {
63  (*m_log) << MSG::INFO <<" Entering TileDetectorFactoryLite::create()" << endmsg;
64 
65  // -------- -------- MATERIAL MANAGER -------- ----------
66  // TODO: fix this, doesn't get access at runtime!!
67  StoredMaterialManager* theMaterialManager = nullptr; // dummy matManager, only used to instantiate a 'sectionBuilder'
68 
69  // -------- -------- DB MANAGER -------- ----------
71 
72  // -------- -------- SECTION BUILDER -------- ----------
73  TileGeoSectionBuilder* sectionBuilder = new TileGeoSectionBuilder(theMaterialManager,dbManager,m_switches,m_log);
74 
75 
76  // --- Get data from SQLite
77  (*m_log) << MSG::INFO << "Getting auxiliary data from SQLite..." << endmsg;
78  // get table
79  IRDBRecordset_ptr tileReadoutDataRecordSet = m_paramsSvc->getRecordsetPtr("TileReadoutData", "", "");
80  (*m_log) << MSG::DEBUG << "data rows in the 'TileReadoutData' RecordSet: " << tileReadoutDataRecordSet->size() << endmsg;
81  // get data
82  double barrelPeriodThickness = 0., extendedPeriodThickness = 0.;
83  if (tileReadoutDataRecordSet->size()>0) {
84  if ( (*tileReadoutDataRecordSet)[0]->getString("NAME") == "barrelPeriodThickness" ) {
85  barrelPeriodThickness = (*tileReadoutDataRecordSet)[0]->getDouble("VALUE");
86  } else {
87  std::string errMsg = "barrelPeriodThickness not found in position [0] in the TileReadoutData' RecordSet!!!";
88  (*m_log) << MSG::ERROR << errMsg << endmsg;
89  throw std::runtime_error(errMsg);
90  }
91  if ( (*tileReadoutDataRecordSet)[1]->getString("NAME") == "extendedPeriodThickness" ) {
92  extendedPeriodThickness = (*tileReadoutDataRecordSet)[1]->getDouble("VALUE");
93  } else {
94  std::string errMsg = "extendedPeriodThickness not found in position [1] in the TileReadoutData' RecordSet!!!";
95  (*m_log) << MSG::ERROR << errMsg << endmsg;
96  throw std::runtime_error(errMsg);
97  }
98  } else {
99  std::string errorMsg = "The 'TileReadoutData' recordSet is empty!!!";
100  (*m_log) << MSG::FATAL << errorMsg << endmsg;
101  throw std::runtime_error(errorMsg);
102  }
103  (*m_log) << MSG::DEBUG << "barrelPeriodThickness: " << barrelPeriodThickness << ", extendedPeriodThickness: " << extendedPeriodThickness << endmsg;
104 
105  // set data used to build the readout geometry
106  sectionBuilder->setBarrelPeriodThickness(barrelPeriodThickness);
107  sectionBuilder->setExtendedPeriodThickness(extendedPeriodThickness);
108 
109 
110  //
111  // creating Descriptors and CaloDetDescrElements
112  //
113 
114  int nModulesInSection[6] = {0,0,0,0,0,0};
115  double zShiftInSection[6] = {0.0,0.0,0.0,0.0,0.0,0.0,};
116 
117  int NumberOfEnv = dbManager->GetNumberOfEnv();
118  MLOG(DEBUG) << "NumberOfEnv: " << NumberOfEnv << endmsg;
119 
120  for (int EnvCounter = 0; EnvCounter < NumberOfEnv; ++EnvCounter) { //Loop over Envelopes
121 
122  dbManager->SetCurrentEnvByIndex(EnvCounter);
123  int EnvType = dbManager->GetEnvType();
124  int NumberOfMod = dbManager->GetEnvNModules();
125  double Zshift = dbManager->GetEnvZShift()*Gaudi::Units::cm;
126 
127  if (m_log->level()<=MSG::DEBUG)
128  (*m_log) << MSG::DEBUG
129  << " EnvCounter is " << EnvCounter
130  << " EnvType is " << EnvType
131  << " Zshift is " << Zshift*(1./Gaudi::Units::cm) << " cm"
132  << endmsg;
133 
134  // Central barrel
135  if (EnvType == 1 || EnvType == 0) {
136  nModulesInSection[0] = nModulesInSection[1] = NumberOfMod;
137  zShiftInSection[0] = zShiftInSection[1] = Zshift;
138  } else if (EnvType>0 and EnvType < 6) {
139  nModulesInSection[EnvType] = NumberOfMod;
140  zShiftInSection[EnvType] = Zshift;
141  }
142  }
143 
144 
145  // Build Regions
146  const TileID* tileID = m_detectorManager->get_id();
147 
148  unsigned int dete[6] = {TILE_REGION_CENTRAL,TILE_REGION_CENTRAL,
151  int side[6] = {0,1,0,1,0,1};
152 
153  (*m_log) << MSG::DEBUG << "Loop over Tile detector regions, and call computeCellDim() when needed..." << endmsg;
154  for (int ii=0; ii<6; ++ii) {
155 
156  (*m_log) << MSG::DEBUG << "ii: " << ii << ", region: " << dete[ii] << endmsg;
157 
158  if (ii%2 == 0) {
159  (*m_log) << MSG::DEBUG << "ii: " << ii << ", region: " << dete[ii] << " --> calling computeCellDim()..." << endmsg;
160  sectionBuilder->computeCellDim(m_detectorManager, dete[ii],
162  zShiftInSection[ii+1], // zShiftPos
163  zShiftInSection[ii]); // zShiftNeg
164  }
165 
166  (*m_log) << MSG::DEBUG << "Get TileDetDescriptor and call fillDescriptor()..." << endmsg;
167  TileDetDescriptor* descriptor = new TileDetDescriptor();
168  sectionBuilder->fillDescriptor(descriptor, dete[ii], side[ii],
169  m_switches.testBeam, // set to false - ATLAS geometry
170  m_switches.addPlatesToCell, // add front/end plates to cell volume
171  nModulesInSection[ii], // 0-64 modules
172  zShiftInSection[ii]); // Z-shift
173 
174  (*m_log) << MSG::DEBUG << "Get an Identifier for the region and add it to the detectorManager..." << endmsg;
175  Identifier idRegion = tileID->region_id(ii);
176  descriptor->set(idRegion);
177  m_detectorManager->add(descriptor);
178  m_detectorManager->add(new TileDetDescrRegion(idRegion, descriptor));
179  }
180 
181 
182  // Set geometry Tree Tops
183  GeoVolumeCursor cursor(world);
184  while (!cursor.atEnd()) {
185  std::string volName = cursor.getName();
186  if (volName.compare(0,4,"Tile")==0) {
187  (*m_log) << MSG::DEBUG << "Adding vol '" << volName << "' to detManager" << endmsg;
188  m_detectorManager->addTreeTop(cursor.getVolume());
189  }
190  cursor.next();
191  }
192 
193  (*m_log) << MSG::DEBUG << "Tile geometry from SQLite has been created." << endmsg;
194 
195 }

◆ getDetectorManager()

virtual const TileDetDescrManager* TileDetectorFactoryLite::getDetectorManager ( ) const
inlinevirtual

Access function to TileDetDescr geometry data.

Definition at line 61 of file TileDetectorFactoryLite.h.

61 { return m_detectorManager; }

Member Data Documentation

◆ m_detectorManager

TileDetDescrManager* TileDetectorFactoryLite::m_detectorManager
private

Detector pointer to TileDetDescrManager.

Definition at line 66 of file TileDetectorFactoryLite.h.

◆ m_log

MsgStream* TileDetectorFactoryLite::m_log
private

Get message SVC.

Definition at line 75 of file TileDetectorFactoryLite.h.

◆ m_paramsSvc

IRDBAccessSvc* TileDetectorFactoryLite::m_paramsSvc
private

Pointer to an instance of the RDBAccessSvc to get parameters from the SQLite file.

Definition at line 69 of file TileDetectorFactoryLite.h.

◆ m_switches

TileSwitches TileDetectorFactoryLite::m_switches
private

all switches

Definition at line 72 of file TileDetectorFactoryLite.h.

◆ m_verbose

bool TileDetectorFactoryLite::m_verbose
private

Flag for activation verbose level for debugging.

Definition at line 78 of file TileDetectorFactoryLite.h.


The documentation for this class was generated from the following files:
TileDddbManager::SetCurrentEnvByIndex
int SetCurrentEnvByIndex(unsigned int envelope)
Definition: TileDddbManager.cxx:209
TileDetectorFactoryLite::m_log
MsgStream * m_log
Get message SVC.
Definition: TileDetectorFactoryLite.h:75
MLOG
#define MLOG(x)
Definition: TileDetectorFactoryLite.cxx:35
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
IRDBAccessSvc::getRecordsetPtr
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.
TileDetDescrManager::addTreeTop
void addTreeTop(PVConstLink)
Definition: TileDetDescrManager.cxx:88
DeMoUpdate.errorMsg
string errorMsg
Definition: DeMoUpdate.py:897
TileSwitches::testBeam
bool testBeam
setting up testbeam geometry or ATLAS geometry
Definition: TileSwitches.h:31
TileDddbManager::GetNumberOfEnv
int GetNumberOfEnv() const
Definition: TileDddbManager.cxx:158
TILE_REGION_EXTENDED
#define TILE_REGION_EXTENDED
Definition: TileGeoSectionBuilder.h:23
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TileDetectorFactoryLite::m_switches
TileSwitches m_switches
all switches
Definition: TileDetectorFactoryLite.h:72
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
TileGeoSectionBuilder::fillDescriptor
void fillDescriptor(TileDetDescriptor *&descriptor, unsigned int detector, int side, bool testbeam, bool addPlates, unsigned int nphi, float zshift)
Readout Descriptor parameters are the following:
Definition: TileGeoSectionBuilder.cxx:2454
Tile_Base_ID::region_id
Identifier region_id(int index) const
build single region, module, tower, cell, pmt, adc identifiers
Definition: Tile_Base_ID.cxx:405
TileDetDescriptor::set
void set(const Identifier &id)
Definition: TileDetDescriptor.h:244
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TileDetDescrRegion
Definition: TileDetDescrRegion.h:40
TileDddbManager::GetEnvZShift
double GetEnvZShift() const
Definition: TileDddbManager.cxx:393
TileDetDescriptor
Definition: TileDetDescriptor.h:46
TileDetectorFactoryLite::m_detectorManager
TileDetDescrManager * m_detectorManager
Detector pointer to TileDetDescrManager.
Definition: TileDetectorFactoryLite.h:66
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
TILE_REGION_CENTRAL
#define TILE_REGION_CENTRAL
Definition: TileGeoSectionBuilder.h:22
TileSwitches::addPlatesToCell
bool addPlatesToCell
calculate cell volumes with or without front-plates and end-plates
Definition: TileSwitches.h:34
TileDetectorFactoryLite::m_paramsSvc
IRDBAccessSvc * m_paramsSvc
Pointer to an instance of the RDBAccessSvc to get parameters from the SQLite file.
Definition: TileDetectorFactoryLite.h:69
TILE_REGION_GAP
#define TILE_REGION_GAP
Definition: TileGeoSectionBuilder.h:24
TileGeoSectionBuilder::setBarrelPeriodThickness
void setBarrelPeriodThickness(double val)
Definition: TileGeoSectionBuilder.cxx:3460
TileDetDescrManager::add
void add(TileDetDescrRegion *region)
Definition: TileDetDescrManager.cxx:894
query_example.cursor
cursor
Definition: query_example.py:21
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
TileGeoSectionBuilder::setExtendedPeriodThickness
void setExtendedPeriodThickness(double val)
Definition: TileGeoSectionBuilder.cxx:3472
TileDetDescrManager::getDbManager
TileDddbManager * getDbManager() const
Definition: TileDetDescrManager.cxx:94
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TileGeoSectionBuilder::computeCellDim
void computeCellDim(TileDetDescrManager *&manager, int detector, bool addPlates, float zShiftPos, float zShiftNeg)
Cell dimension parameters are the following:
Definition: TileGeoSectionBuilder.cxx:2709
TileDetectorFactoryLite::m_verbose
bool m_verbose
Flag for activation verbose level for debugging.
Definition: TileDetectorFactoryLite.h:78
TileDddbManager::GetEnvType
int GetEnvType() const
Definition: TileDddbManager.cxx:163
TileDddbManager
This class provides access to constants in the Geometry DB.
Definition: TileDddbManager.h:38
TileDddbManager::GetEnvNModules
int GetEnvNModules() const
Definition: TileDddbManager.cxx:262
TileDetDescrManager::get_id
const TileID * get_id() const
Definition: TileDetDescrManager.h:172
TileGeoSectionBuilder
Definition: TileGeoSectionBuilder.h:38