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

#include <BLM_Builder.h>

Inheritance diagram for InDetDD::BLM_Builder:
Collaboration diagram for InDetDD::BLM_Builder:

Public Member Functions

 BLM_Builder (const std::string &, const std::string &, const IInterface *)
 
virtual ~BLM_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
 
std::vector< double > m_moduleVIII
 
std::vector< double > m_moduleIX
 
std::vector< double > m_moduleX
 
std::vector< double > m_moduleXI
 
unsigned int m_moduleon
 
bool m_blmon
 
bool m_BDparameters
 

Detailed Description

Definition at line 24 of file BLM_Builder.h.

Constructor & Destructor Documentation

◆ BLM_Builder()

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

Definition at line 28 of file BLM_Builder.cxx.

31  : base_class(t,n,p)
32 {
33  //default settings
34  // Z R PHI ROT_X ROT_Y ROT_Z DIAM_TRANS_X DIAM_TRANS_Y DIAM_TRANS_Z
35  m_module0.push_back(3383.5); m_module0.push_back(62.825); m_module0.push_back(17); m_module0.push_back(180); m_module0.push_back(0); m_module0.push_back(287); m_module0.push_back(0); m_module0.push_back(0); m_module0.push_back(0);
36  m_moduleI.push_back(3383.5); m_moduleI.push_back(62.825); m_moduleI.push_back(45); m_moduleI.push_back(180); m_moduleI.push_back(0); m_moduleI.push_back(315); m_moduleI.push_back(0); m_moduleI.push_back(0); m_moduleI.push_back(0);
37  m_moduleII.push_back(3383.5); m_moduleII.push_back(62.825); m_moduleII.push_back(73); m_moduleII.push_back(180); m_moduleII.push_back(0); m_moduleII.push_back(343); m_moduleII.push_back(0); m_moduleII.push_back(0); m_moduleII.push_back(0);
38  m_moduleIII.push_back(3383.5); m_moduleIII.push_back(62.825); m_moduleIII.push_back(197); m_moduleIII.push_back(180); m_moduleIII.push_back(0); m_moduleIII.push_back(107); m_moduleIII.push_back(0); m_moduleIII.push_back(0); m_moduleIII.push_back(0);
39  m_moduleIV.push_back(3383.5); m_moduleIV.push_back(62.825); m_moduleIV.push_back(225); m_moduleIV.push_back(180); m_moduleIV.push_back(0); m_moduleIV.push_back(135); m_moduleIV.push_back(0); m_moduleIV.push_back(0); m_moduleIV.push_back(0);
40  m_moduleV.push_back(3383.5); m_moduleV.push_back(62.825); m_moduleV.push_back(253); m_moduleV.push_back(180); m_moduleV.push_back(0); m_moduleV.push_back(163); m_moduleV.push_back(0); m_moduleV.push_back(0); m_moduleV.push_back(0);
41  m_moduleVI.push_back(-3383.5); m_moduleVI.push_back(62.825); m_moduleVI.push_back(17); m_moduleVI.push_back(0); m_moduleVI.push_back(0); m_moduleVI.push_back(107); m_moduleVI.push_back(0); m_moduleVI.push_back(0); m_moduleVI.push_back(0);
42  m_moduleVII.push_back(-3383.5); m_moduleVII.push_back(62.825); m_moduleVII.push_back(45); m_moduleVII.push_back(0); m_moduleVII.push_back(0); m_moduleVII.push_back(135); m_moduleVII.push_back(0); m_moduleVII.push_back(0); m_moduleVII.push_back(0);
43  m_moduleVIII.push_back(-3383.5); m_moduleVIII.push_back(62.825); m_moduleVIII.push_back(73); m_moduleVIII.push_back(0); m_moduleVIII.push_back(0); m_moduleVIII.push_back(163); m_moduleVIII.push_back(0); m_moduleVIII.push_back(0); m_moduleVIII.push_back(0);
44  m_moduleIX.push_back(-3383.5); m_moduleIX.push_back(62.825); m_moduleIX.push_back(197); m_moduleIX.push_back(0); m_moduleIX.push_back(0); m_moduleIX.push_back(287); m_moduleIX.push_back(0); m_moduleIX.push_back(0); m_moduleIX.push_back(0);
45  m_moduleX.push_back(-3383.5); m_moduleX.push_back(62.825); m_moduleX.push_back(225); m_moduleX.push_back(0); m_moduleX.push_back(0); m_moduleX.push_back(315); m_moduleX.push_back(0); m_moduleX.push_back(0); m_moduleX.push_back(0);
46  m_moduleXI.push_back(-3383.5); m_moduleXI.push_back(62.825); m_moduleXI.push_back(253); m_moduleXI.push_back(0); m_moduleXI.push_back(0); m_moduleXI.push_back(343); m_moduleXI.push_back(0); m_moduleXI.push_back(0); m_moduleXI.push_back(0);
47 
48  // template for property declaration
49  declareProperty("Modul0", m_module0);
50  declareProperty("ModulI", m_moduleI);
51  declareProperty("ModulII", m_moduleII);
52  declareProperty("ModulIII", m_moduleIII);
53  declareProperty("ModulIV", m_moduleIV);
54  declareProperty("ModulV", m_moduleV);
55  declareProperty("ModulVI", m_moduleVI);
56  declareProperty("ModulVII", m_moduleVII);
57  declareProperty("ModulVIII", m_moduleVIII);
58  declareProperty("ModulIX", m_moduleIX);
59  declareProperty("ModulX", m_moduleX);
60  declareProperty("ModulXI", m_moduleXI);
61  declareProperty("ModulesOn", m_moduleon=0xFFFF);
62  declareProperty("BLMon", m_blmon=true);
63  declareProperty("DBparameters", m_BDparameters=true);
64 }

◆ ~BLM_Builder()

virtual InDetDD::BLM_Builder::~BLM_Builder ( )
virtualdefault

default destructor

Member Function Documentation

◆ align()

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

Definition at line 256 of file BLM_Builder.cxx.

257 {
258  // Return Failure since no function has been registered
259  return StatusCode::FAILURE;
260 }

◆ build()

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

build the BCM geometry

Definition at line 88 of file BLM_Builder.cxx.

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

◆ finalize()

StatusCode InDetDD::BLM_Builder::finalize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 80 of file BLM_Builder.cxx.

81 {
83  return sc;
84 }

◆ initialize()

StatusCode InDetDD::BLM_Builder::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 68 of file BLM_Builder.cxx.

69 {
70 
72  if (sc.isFailure()) return sc;
73 
74  ATH_MSG_INFO("BLMBuilder initialize() successful in " << name());
75  return StatusCode::SUCCESS;
76 }

◆ registerCallback()

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

For alignment.

Definition at line 249 of file BLM_Builder.cxx.

250 {
251  return StatusCode::SUCCESS;
252 }

Member Data Documentation

◆ m_BDparameters

bool InDetDD::BLM_Builder::m_BDparameters
private

Definition at line 62 of file BLM_Builder.h.

◆ m_blmon

bool InDetDD::BLM_Builder::m_blmon
private

Definition at line 61 of file BLM_Builder.h.

◆ m_module0

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

member variables for algorithm properties:

Definition at line 48 of file BLM_Builder.h.

◆ m_moduleI

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

Definition at line 49 of file BLM_Builder.h.

◆ m_moduleII

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

Definition at line 50 of file BLM_Builder.h.

◆ m_moduleIII

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

Definition at line 51 of file BLM_Builder.h.

◆ m_moduleIV

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

Definition at line 52 of file BLM_Builder.h.

◆ m_moduleIX

std::vector<double> InDetDD::BLM_Builder::m_moduleIX
private

Definition at line 57 of file BLM_Builder.h.

◆ m_moduleon

unsigned int InDetDD::BLM_Builder::m_moduleon
private

Definition at line 60 of file BLM_Builder.h.

◆ m_moduleV

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

Definition at line 53 of file BLM_Builder.h.

◆ m_moduleVI

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

Definition at line 54 of file BLM_Builder.h.

◆ m_moduleVII

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

Definition at line 55 of file BLM_Builder.h.

◆ m_moduleVIII

std::vector<double> InDetDD::BLM_Builder::m_moduleVIII
private

Definition at line 56 of file BLM_Builder.h.

◆ m_moduleX

std::vector<double> InDetDD::BLM_Builder::m_moduleX
private

Definition at line 58 of file BLM_Builder.h.

◆ m_moduleXI

std::vector<double> InDetDD::BLM_Builder::m_moduleXI
private

Definition at line 59 of file BLM_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
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
InDetDD::BLM_Builder::m_moduleIX
std::vector< double > m_moduleIX
Definition: BLM_Builder.h:57
InDetDD::BLM_Builder::m_moduleV
std::vector< double > m_moduleV
Definition: BLM_Builder.h:53
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
initialize
void initialize()
Definition: run_EoverP.cxx:894
InDetDD::BLM_Builder::m_moduleXI
std::vector< double > m_moduleXI
Definition: BLM_Builder.h:59
InDetDD::BLM_Builder::m_moduleVII
std::vector< double > m_moduleVII
Definition: BLM_Builder.h:55
InDetDD::BLM_Builder::m_moduleon
unsigned int m_moduleon
Definition: BLM_Builder.h:60
deg
#define deg
Definition: SbPolyhedron.cxx:17
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
InDetDD::BLM_Builder::m_module0
std::vector< double > m_module0
member variables for algorithm properties:
Definition: BLM_Builder.h:48
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
InDetDD::BLM_Builder::m_moduleVI
std::vector< double > m_moduleVI
Definition: BLM_Builder.h:54
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
BLM_ModuleParameters
Definition: BLM_ModuleParameters.h:20
InDetDD::BLM_Builder::m_moduleVIII
std::vector< double > m_moduleVIII
Definition: BLM_Builder.h:56
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetDD::BLM_Builder::m_moduleIV
std::vector< double > m_moduleIV
Definition: BLM_Builder.h:52
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDetDD::BLM_Builder::m_BDparameters
bool m_BDparameters
Definition: BLM_Builder.h:62
InDetDD::BLM_Builder::m_moduleX
std::vector< double > m_moduleX
Definition: BLM_Builder.h:58
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition: IRDBRecord.h:27
InDetDD::BLM_Builder::m_moduleII
std::vector< double > m_moduleII
Definition: BLM_Builder.h:50
InDetDD::BLM_Builder::m_moduleIII
std::vector< double > m_moduleIII
Definition: BLM_Builder.h:51
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
BLM_Module
Beam Loss Monitor module builder.
Definition: BLM_Module.h:22
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
InDetDD::BLM_Builder::m_blmon
bool m_blmon
Definition: BLM_Builder.h:61
IRDBRecord::getFloat
virtual float getFloat(const std::string &fieldName) const =0
Get float field value.
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
InDetDD::BLM_Builder::m_moduleI
std::vector< double > m_moduleI
Definition: BLM_Builder.h:49
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
fitman.k
k
Definition: fitman.py:528
BLM_Module::Build
GeoPhysVol * Build(StoredMaterialManager *mat_mgr, const BLM_ModuleParameters *parameters, MsgStream *msg)
Definition: BLM_Module.cxx:22