ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
InDetDD::BCM_Builder Class Reference

#include <BCM_Builder.h>

Inheritance diagram for InDetDD::BCM_Builder:
Collaboration diagram for InDetDD::BCM_Builder:

Public Member Functions

 BCM_Builder (const std::string &, const std::string &, const IInterface *)
 
virtual ~BCM_Builder ()=default
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode finalize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode build (GeoVPhysVol *parent) override
 build the BCM geometry More...
 
virtual StatusCode registerCallback (StoreGateSvc *detStore) override
 For alignment. More...
 
virtual StatusCode align (IOVSVC_CALLBACK_ARGS) override
 

Private Attributes

std::vector< double > m_module0
 member variables for algorithm properties: More...
 
std::vector< double > m_moduleI
 
std::vector< double > m_moduleII
 
std::vector< double > m_moduleIII
 
std::vector< double > m_moduleIV
 
std::vector< double > m_moduleV
 
std::vector< double > m_moduleVI
 
std::vector< double > m_moduleVII
 
unsigned int m_moduleon
 
bool m_bcmon
 
bool m_BDparameters
 

Detailed Description

Definition at line 24 of file BCM_Builder.h.

Constructor & Destructor Documentation

◆ BCM_Builder()

InDetDD::BCM_Builder::BCM_Builder ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 25 of file BCM_Builder.cxx.

28  : base_class(t,n,p)
29 {
30 
31  //default settings
32  // TRANS_X TRANS_Y TRANS_Z ROT_X ROT_Y ROT_Z DIMENSION_Z DIAM_TRANS_Y DIAM_TRANS_Z DIAM_DIAM_X DIAM_DIAM_Y DIAM_DIAM_Z LAMEL_OFFSET_H LAMEL_OFFSET_I LAMEL_OFFSET_J
33  m_module0.push_back(95.744); m_module0.push_back(0); m_module0.push_back(1882.4); m_module0.push_back(0); m_module0.push_back(45); m_module0.push_back(0); m_module0.push_back(0.4); m_module0.push_back(0); m_module0.push_back(-59.785); m_module0.push_back(0.2); m_module0.push_back(0); m_module0.push_back(-0.4); m_module0.push_back(34.860); m_module0.push_back(29.509); m_module0.push_back(20.205); //F410
34  m_moduleI.push_back(0); m_moduleI.push_back(95.744); m_moduleI.push_back(1882.4); m_moduleI.push_back(0); m_moduleI.push_back(45); m_moduleI.push_back(90); m_moduleI.push_back(0.4); m_moduleI.push_back(0); m_moduleI.push_back(-59.785); m_moduleI.push_back(0.2); m_moduleI.push_back(0); m_moduleI.push_back(-0.4); m_moduleI.push_back(34.860); m_moduleI.push_back(29.509); m_moduleI.push_back(20.205); //F405
35  m_moduleII.push_back(-95.744); m_moduleII.push_back(0); m_moduleII.push_back(1882.4); m_moduleII.push_back(0); m_moduleII.push_back(45); m_moduleII.push_back(180); m_moduleII.push_back(0.4); m_moduleII.push_back(0); m_moduleII.push_back(-59.785); m_moduleII.push_back(0.2); m_moduleII.push_back(0); m_moduleII.push_back(-0.4); m_moduleII.push_back(34.860); m_moduleII.push_back(29.509); m_moduleII.push_back(20.205); //F413
36  m_moduleIII.push_back(0); m_moduleIII.push_back(-95.744); m_moduleIII.push_back(1882.4); m_moduleIII.push_back(0); m_moduleIII.push_back(45); m_moduleIII.push_back(270); m_moduleIII.push_back(0.4); m_moduleIII.push_back(0); m_moduleIII.push_back(-59.785); m_moduleIII.push_back(0.2); m_moduleIII.push_back(0); m_moduleIII.push_back(-0.4); m_moduleIII.push_back(34.860); m_moduleIII.push_back(29.509); m_moduleIII.push_back(20.205); //F404
37  m_moduleIV.push_back(95.744); m_moduleIV.push_back(0); m_moduleIV.push_back(-1882.4); m_moduleIV.push_back(180); m_moduleIV.push_back(-45); m_moduleIV.push_back(0); m_moduleIV.push_back(1.4); m_moduleIV.push_back(0); m_moduleIV.push_back(-59.785); m_moduleIV.push_back(0.2); m_moduleIV.push_back(0); m_moduleIV.push_back(-0.4); m_moduleIV.push_back(34.860); m_moduleIV.push_back(29.509); m_moduleIV.push_back(20.205); //F424
38  m_moduleV.push_back(0); m_moduleV.push_back(95.744); m_moduleV.push_back(-1882.4); m_moduleV.push_back(180); m_moduleV.push_back(-45); m_moduleV.push_back(90); m_moduleV.push_back(1.4); m_moduleV.push_back(0); m_moduleV.push_back(-59.785); m_moduleV.push_back(0.2); m_moduleV.push_back(0); m_moduleV.push_back(-0.4); m_moduleV.push_back(34.860); m_moduleV.push_back(29.509); m_moduleV.push_back(20.205); //F420
39  m_moduleVI.push_back(-95.744); m_moduleVI.push_back(0); m_moduleVI.push_back(-1882.4); m_moduleVI.push_back(180); m_moduleVI.push_back(-45); m_moduleVI.push_back(180); m_moduleVI.push_back(1.4); m_moduleVI.push_back(0); m_moduleVI.push_back(-59.785); m_moduleVI.push_back(0.2); m_moduleVI.push_back(0); m_moduleVI.push_back(-0.4); m_moduleVI.push_back(34.860); m_moduleVI.push_back(29.509); m_moduleVI.push_back(20.205); //F422
40  m_moduleVII.push_back(0); m_moduleVII.push_back(-95.744); m_moduleVII.push_back(-1882.4); m_moduleVII.push_back(180); m_moduleVII.push_back(-45); m_moduleVII.push_back(270); m_moduleVII.push_back(0.4); m_moduleVII.push_back(0); m_moduleVII.push_back(-59.785); m_moduleVII.push_back(0.2); m_moduleVII.push_back(0); m_moduleVII.push_back(-0.4); m_moduleVII.push_back(34.860); m_moduleVII.push_back(29.509); m_moduleVII.push_back(20.205); //F408
41 
42  // template for property decalration
43  declareProperty("Modul0", m_module0);
44  declareProperty("ModulI", m_moduleI);
45  declareProperty("ModulII", m_moduleII);
46  declareProperty("ModulIII", m_moduleIII);
47  declareProperty("ModulIV", m_moduleIV);
48  declareProperty("ModulV", m_moduleV);
49  declareProperty("ModulVI", m_moduleVI);
50  declareProperty("ModulVII", m_moduleVII);
51  declareProperty("ModulesOn", m_moduleon=255);
52  declareProperty("BCMon", m_bcmon=true);
53  declareProperty("DBparameters", m_BDparameters=true);
54 }

◆ ~BCM_Builder()

virtual InDetDD::BCM_Builder::~BCM_Builder ( )
virtualdefault

default destructor

Member Function Documentation

◆ align()

StatusCode InDetDD::BCM_Builder::align ( IOVSVC_CALLBACK_ARGS  )
overridevirtual

Definition at line 249 of file BCM_Builder.cxx.

250 {
251  // Return Failure since no function has been registered
252  return StatusCode::FAILURE;
253 }

◆ build()

StatusCode InDetDD::BCM_Builder::build ( GeoVPhysVol *  parent)
overridevirtual

build the BCM geometry

Definition at line 78 of file BCM_Builder.cxx.

79 {
80  if(!m_bcmon) {
81  ATH_MSG_INFO("BCM disabled.");
82  return StatusCode::SUCCESS;
83  }
84 
85  // Unfortunately add is not part of the abstract interface of GeoVPhysVol so we have to dynamic cast
86  // to the concrete class.
87  GeoFullPhysVol* Phys = dynamic_cast<GeoFullPhysVol *>(pv);
88  if (!Phys) {
89  ATH_MSG_ERROR("Parent volume is not a GeoFullPhysVol as expected.");
90  return StatusCode::FAILURE;
91  }
92 
93  StoredMaterialManager * materialManager{nullptr};
94  ATH_CHECK(detStore()->retrieve(materialManager, std::string("MATERIALS")));
95 
96  //create geometry manager
97  std::unique_ptr<BCM_GeometryManager> manager = std::make_unique<BCM_GeometryManager>();
98 
99  StatusCode sc;
100 
101  if(m_BDparameters)
102  {
103  DecodeVersionKey versionKey("InnerDetector");
104 
105  // Issue error if AUTO.
106  if (versionKey.tag() == "AUTO") {
107  ATH_MSG_ERROR("AUTO Atlas version. Please select a version.");
108  return StatusCode::FAILURE;
109  }
110 
111  ATH_MSG_INFO("Building BCM with Version Tag: " << versionKey.tag() << " at Node: " << versionKey.node());
112  SmartIF<IRDBAccessSvc> accessSvc{Gaudi::svcLocator()->service("RDBAccessSvc")};
113  ATH_CHECK(accessSvc.isValid());
114 
115  // Print the BCM version tag:
116  std::string BCMVersionTag;
117  BCMVersionTag = accessSvc->getChildTag("BCM", versionKey.tag(), versionKey.node());
118  ATH_MSG_INFO("BCM Version: " << BCMVersionTag);
119 
120  // Check if version is empty. If so, then the BCM cannot be built. This may or may not be intentional. We just issue an INFO message.
121  if (BCMVersionTag.empty()) {
122  ATH_MSG_INFO("No BCM Version. BCM will not be built.");
123  return StatusCode::SUCCESS;
124  }
125 
126  IRDBRecordset_ptr DBmodul = accessSvc->getRecordsetPtr("BCMModule", versionKey.tag(), versionKey.node());
127  ATH_MSG_DEBUG(" --> Number of records fetched = " << DBmodul->size());
128 
129  unsigned int ind;
130  long moduleNo;
131 
132  for(ind = 0; ind < DBmodul->size(); ind++) {
133  const IRDBRecord* rec = (*DBmodul)[ind];
134  moduleNo = rec->getLong("MODULE_ID");
135 
136  //check if this module is suposed to be builded
137  unsigned int mask = (1 << moduleNo);
138  if((mask & m_moduleon) != mask) {
139  //this module is not sopoused to be built
140  continue;
141  }
142 
143  std::vector<double> module_property;
144  module_property.push_back(rec->getFloat("TRANS_X"));
145  module_property.push_back(rec->getFloat("TRANS_Y"));
146  module_property.push_back(rec->getFloat("TRANS_Z"));
147  module_property.push_back(rec->getFloat("ROT_X"));
148  module_property.push_back(rec->getFloat("ROT_Y"));
149  module_property.push_back(rec->getFloat("ROT_Z"));
150  module_property.push_back(rec->getFloat("DIMESION_Z"));
151  module_property.push_back(rec->getFloat("DIAM_TRANS_Y"));
152  module_property.push_back(rec->getFloat("DIAM_TRANS_Z"));
153  module_property.push_back(rec->getFloat("DIAM_DIAM_X"));
154  module_property.push_back(rec->getFloat("DIAM_DAIM_Y"));
155  module_property.push_back(rec->getFloat("DIAM_DIAM_Z"));
156  module_property.push_back(rec->getFloat("OFF_H"));
157  module_property.push_back(rec->getFloat("OFF_I"));
158  module_property.push_back(rec->getFloat("OFF_J"));
159 
160  //set the BCM_GeometryManeger
161  manager->ModuleOn(moduleNo);
162  manager->Module(moduleNo)->Set(moduleNo, &module_property);
163  }
164  ATH_MSG_DEBUG(" --> Number succesfully read from DB");
165  }
166  else
167  {
168  //parameters via jobOptions
169  int moduleNo;
170  const std::vector<double>* module_property = nullptr;
171  for(moduleNo = 0; moduleNo < 8; moduleNo++)
172  {
173  unsigned int mask = (1 << moduleNo);
174  if((mask & m_moduleon) != mask)
175  {
176  //this module is not sopoused to be built
177  continue;
178  }
179  if(moduleNo == 0) module_property = &m_module0;
180  else if(moduleNo == 1) module_property = &m_moduleI;
181  else if(moduleNo == 2) module_property = &m_moduleII;
182  else if(moduleNo == 3) module_property = &m_moduleIII;
183  else if(moduleNo == 4) module_property = &m_moduleIV;
184  else if(moduleNo == 5) module_property = &m_moduleV;
185  else if(moduleNo == 6) module_property = &m_moduleVI;
186  else if(moduleNo == 7) module_property = &m_moduleVII;
187 
188  //set the BCM_GeometryManeger
189  manager->ModuleOn(moduleNo);
190  if (module_property){
191  manager->Module(moduleNo)->Set(moduleNo, module_property);
192  } else {
193  ATH_MSG_ERROR("module_property pointer is null in BCM_Builder.cxx");
194  }
195  }
196  }
197 
198  //we are now adding eight BCM modules
199  BCM_Module bcm;
200 
201  for(int i=0; i<8; i++)
202  {
203  //see if this module is to be built
204  if(!(manager->IsModuleOn(i)))
205  continue;
206 
207  //the module should be build
209 
210  //setting transformation
211  GeoTrf::Translation3D pos(parameters->Position_X(), parameters->Position_Y(), parameters->Position_Z());
212  GeoTrf::Transform3D rm = GeoTrf::RotateZ3D(parameters->Rotation_Z()*Gaudi::Units::deg)
213  * GeoTrf::RotateY3D(parameters->Rotation_Y()*Gaudi::Units::deg)
214  * GeoTrf::RotateX3D(parameters->Rotation_X()*Gaudi::Units::deg)
215  * GeoTrf::RotateZ3D(-90.*Gaudi::Units::deg)
216  * GeoTrf::RotateY3D(-90.*Gaudi::Units::deg);
217  GeoIntrusivePtr<GeoTransform> xform{new GeoTransform(GeoTrf::Transform3D(pos*rm))};
218  ATH_MSG_DEBUG(" --> Module " << i << " build!");
219 
220  //building module
221  int k=i+951;
222 
223  GeoIntrusivePtr<GeoNameTag> tag{new GeoNameTag("BCM Module")};
224  if (materialManager){
225  GeoVPhysVol* bcmModPhys = bcm.Build(materialManager, parameters, (msgLvl(MSG::INFO) ? &msg(MSG::INFO) : nullptr));
226  Phys->add(tag);
227  Phys->add(new GeoIdentifierTag(k));
228  Phys->add(xform);
229  Phys->add(bcmModPhys);
230  }
231  }
232 
233  ATH_MSG_DEBUG("Registering BCM_GeometryManager.");
234  ATH_CHECK(detStore()->record(std::move(manager), "BCMParameters"));
235 
236  return StatusCode::SUCCESS;
237 }

◆ finalize()

StatusCode InDetDD::BCM_Builder::finalize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 70 of file BCM_Builder.cxx.

71 {
73  return sc;
74 }

◆ initialize()

StatusCode InDetDD::BCM_Builder::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 58 of file BCM_Builder.cxx.

59 {
60 
62  if (sc.isFailure()) return sc;
63 
64  ATH_MSG_INFO("BCMBuilder initialize() successful in " << name());
65  return StatusCode::SUCCESS;
66 }

◆ registerCallback()

StatusCode InDetDD::BCM_Builder::registerCallback ( StoreGateSvc detStore)
overridevirtual

For alignment.

Definition at line 242 of file BCM_Builder.cxx.

243 {
244  return StatusCode::SUCCESS;
245 }

Member Data Documentation

◆ m_bcmon

bool InDetDD::BCM_Builder::m_bcmon
private

Definition at line 59 of file BCM_Builder.h.

◆ m_BDparameters

bool InDetDD::BCM_Builder::m_BDparameters
private

Definition at line 60 of file BCM_Builder.h.

◆ m_module0

std::vector<double> InDetDD::BCM_Builder::m_module0
private

member variables for algorithm properties:

Definition at line 50 of file BCM_Builder.h.

◆ m_moduleI

std::vector<double> InDetDD::BCM_Builder::m_moduleI
private

Definition at line 51 of file BCM_Builder.h.

◆ m_moduleII

std::vector<double> InDetDD::BCM_Builder::m_moduleII
private

Definition at line 52 of file BCM_Builder.h.

◆ m_moduleIII

std::vector<double> InDetDD::BCM_Builder::m_moduleIII
private

Definition at line 53 of file BCM_Builder.h.

◆ m_moduleIV

std::vector<double> InDetDD::BCM_Builder::m_moduleIV
private

Definition at line 54 of file BCM_Builder.h.

◆ m_moduleon

unsigned int InDetDD::BCM_Builder::m_moduleon
private

Definition at line 58 of file BCM_Builder.h.

◆ m_moduleV

std::vector<double> InDetDD::BCM_Builder::m_moduleV
private

Definition at line 55 of file BCM_Builder.h.

◆ m_moduleVI

std::vector<double> InDetDD::BCM_Builder::m_moduleVI
private

Definition at line 56 of file BCM_Builder.h.

◆ m_moduleVII

std::vector<double> InDetDD::BCM_Builder::m_moduleVII
private

Definition at line 57 of file BCM_Builder.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDetDD::BCM_Builder::m_moduleV
std::vector< double > m_moduleV
Definition: BCM_Builder.h:55
InDetDD::BCM_Builder::m_moduleVI
std::vector< double > m_moduleVI
Definition: BCM_Builder.h:56
InDetDD::BCM_Builder::m_bcmon
bool m_bcmon
Definition: BCM_Builder.h:59
InDetDD::BCM_Builder::m_BDparameters
bool m_BDparameters
Definition: BCM_Builder.h:60
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
initialize
void initialize()
Definition: run_EoverP.cxx:894
deg
#define deg
Definition: SbPolyhedron.cxx:17
BCM_Module
Definition: BCM_Module.h:25
BCM_ModuleParameters
Definition: BCM_ModuleParameters.h:20
BCM_Module::Build
GeoPhysVol * Build(StoredMaterialManager *mat_mgr, const BCM_ModuleParameters *parameters, MsgStream *msg)
Definition: BCM_Module.cxx:18
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDetDD::BCM_Builder::m_moduleIV
std::vector< double > m_moduleIV
Definition: BCM_Builder.h:54
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
InDetDD::BCM_Builder::m_moduleII
std::vector< double > m_moduleII
Definition: BCM_Builder.h:52
InDetDD::BCM_Builder::m_moduleVII
std::vector< double > m_moduleVII
Definition: BCM_Builder.h:57
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition: DecodeVersionKey.h:18
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
IRDBRecord::getLong
virtual long getLong(const std::string &fieldName) const =0
Get long field value.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
InDetDD::BCM_Builder::m_module0
std::vector< double > m_module0
member variables for algorithm properties:
Definition: BCM_Builder.h:50
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetDD::BCM_Builder::m_moduleI
std::vector< double > m_moduleI
Definition: BCM_Builder.h:51
InDetDD::BCM_Builder::m_moduleIII
std::vector< double > m_moduleIII
Definition: BCM_Builder.h:53
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition: IRDBRecord.h:27
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
python.changerun.pv
pv
Definition: changerun.py:81
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
InDetDD::BCM_Builder::m_moduleon
unsigned int m_moduleon
Definition: BCM_Builder.h:58
IRDBRecord::getFloat
virtual float getFloat(const std::string &fieldName) const =0
Get float field value.
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
fitman.k
k
Definition: fitman.py:528