ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TestTRT_Alignment Class Reference

#include <TestTRT_Alignment.h>

Inheritance diagram for TestTRT_Alignment:
Collaboration diagram for TestTRT_Alignment:

Public Member Functions

 TestTRT_Alignment (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void addShiftTop (const Amg::Transform3D &transform)
 
void addShiftModule (int bec, int phiMod, int layer, const Amg::Transform3D &transform)
 
void addShift (int level, const Identifier &id, const Amg::Transform3D &transform)
 
void compareStraw (const InDetDD::TRT_BaseElement *element, int straw)
 
void compareEndStraws (const Identifier &id)
 
void printAlignmentShifts ()
 
bool testIdentity (const Amg::Transform3D &transform, double errRot=0, double errTrans=0)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const InDetDD::TRT_DetectorManagerm_manager
 
const TRT_IDm_idHelper
 
std::string m_managerName
 
bool m_longPrintOut
 
bool m_testAllStraws
 
bool m_testAllElements
 
double m_errRot
 
double m_errTrans
 
bool m_hardwiredShifts
 
int m_precision
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 29 of file TestTRT_Alignment.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TestTRT_Alignment()

TestTRT_Alignment::TestTRT_Alignment ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 40 of file TestTRT_Alignment.cxx.

40  :
41  AthAlgorithm(name, pSvcLocator),
42  m_manager(nullptr),
43  m_idHelper(nullptr)
44 {
45  // Get parameter values from jobOptions file
46  declareProperty("ManagerName", m_managerName = "TRT");
47  declareProperty("LongPrintOut", m_longPrintOut = false);
48  declareProperty("TestAllStraws", m_testAllStraws = false);
49  declareProperty("TestAllElements", m_testAllElements = false);
50  declareProperty("ErrorRotation",m_errRot = 1e-15); // For testing if alignment changed
51  declareProperty("ErrorTranslation",m_errTrans = 1e-12); // For testing if alignment changed
52  declareProperty("HardwiredShifts", m_hardwiredShifts = false);
53  declareProperty("Precision", m_precision = 6);
54 }

Member Function Documentation

◆ addShift()

void TestTRT_Alignment::addShift ( int  level,
const Identifier id,
const Amg::Transform3D transform 
)
private

Definition at line 146 of file TestTRT_Alignment.cxx.

147 {
149 }

◆ addShiftModule()

void TestTRT_Alignment::addShiftModule ( int  bec,
int  phiMod,
int  layer,
const Amg::Transform3D transform 
)
private

Definition at line 138 of file TestTRT_Alignment.cxx.

139 {
140  Identifier id = m_idHelper->module_id(bec, phiMod, layer);
141  addShift(1, id, transform);
142 }

◆ addShiftTop()

void TestTRT_Alignment::addShiftTop ( const Amg::Transform3D transform)
private

Definition at line 131 of file TestTRT_Alignment.cxx.

131  {
132  Identifier id = m_idHelper->barrel_ec_id(1);
133  addShift(2, id, transform);
134 }

◆ compareEndStraws()

void TestTRT_Alignment::compareEndStraws ( const Identifier id)
private

Definition at line 212 of file TestTRT_Alignment.cxx.

212  {
213  const TRT_BaseElement * element = m_manager->getElement(id);
214  cout << " " << m_idHelper->show_to_string(id) << endl;
215  if (element) {
216  compareStraw(element, 0);
217  compareStraw(element, element->nStraws() - 1);
218  } else {
219  cout << " No Element with id = " << m_idHelper->show_to_string(id) << endl;
220  }
221 }

◆ compareStraw()

void TestTRT_Alignment::compareStraw ( const InDetDD::TRT_BaseElement element,
int  straw 
)
private

Definition at line 225 of file TestTRT_Alignment.cxx.

225  {
226  static const Amg::Vector3D zeroPoint(0., 0., 0.);
227  static const Amg::Vector3D zAxis(0., 0., 1.);
228  const Amg::Transform3D& strawDefXF = element->strawTransform(straw);
229  const Amg::Transform3D& strawXF = element->strawTransform(straw);
230 
231  Amg::Transform3D globalDelta = strawXF * strawDefXF.inverse();
232  // test if it is the identity transform within some error
233  if (testIdentity(globalDelta, m_errRot, m_errTrans)) {
234  cout << " Straw " << straw << ": NO SHIFT" << endl;
235  } else {
236  cout << " Straw " << straw << ": Global shift: " << globalDelta * zeroPoint << endl ;
237  if (m_longPrintOut) {
238  cout << " center " << strawDefXF * zeroPoint << " -> " << strawXF * zeroPoint << endl;
239  cout << " diff = " << strawXF * zeroPoint - strawDefXF * zeroPoint << endl;
240  cout << " strawAxis " << strawDefXF * zAxis << " -> " << strawXF * zAxis << endl;
241  }
242  }
243 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode TestTRT_Alignment::execute ( )

Definition at line 152 of file TestTRT_Alignment.cxx.

152  {
153  // Part 1: Get the messaging service, print where you are
154  msg(MSG::INFO) << "execute()" << endmsg;
156  return StatusCode::SUCCESS;
157 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode TestTRT_Alignment::finalize ( )

Definition at line 161 of file TestTRT_Alignment.cxx.

161  {
162  // Part 1: Get the messaging service, print where you are
163  msg(MSG::INFO) << "finalize()" << endmsg;
164  return StatusCode::SUCCESS;
165 }

◆ initialize()

StatusCode TestTRT_Alignment::initialize ( )

original (pre-Eigen) code for reference: addShiftTop(HepGeom::Translate3D(0,11.93*CLHEP::mm,0));
addShiftModule(1,0,0, HepGeom::TranslateY3D(0.2679 * CLHEP::mm) * HepGeom::RotateZ3D(atan(-0.0001639))); addShiftModule(1,0,1, HepGeom::TranslateY3D(-0.4254 * CLHEP::mm) * HepGeom::RotateZ3D(atan(0.0003195))); addShiftModule(1,0,2, HepGeom::TranslateY3D(0.0264 * CLHEP::mm) * HepGeom::RotateZ3D(atan(0.0000053))); addShiftModule(1,1,0, HepGeom::Transform3D()); addShiftModule(1,1,1, HepGeom::Transform3D()); addShiftModule(1,1,2, HepGeom::Transform3D());

Definition at line 58 of file TestTRT_Alignment.cxx.

58  {
59  msg(MSG::INFO) << "initialize()" << endmsg;
60  msg(MSG::INFO) << "Algorithm Properties" << endmsg;
61  msg(MSG::INFO) << " ManagerName: " << m_managerName << endmsg;
62  msg(MSG::INFO) << " LongPrintOut: " << (m_longPrintOut ? "true" : "false") << endmsg;
63  msg(MSG::INFO) << " TestAllElements: " << (m_testAllElements ? "true" : "false") << endmsg;
64  msg(MSG::INFO) << " TestAllStraws: " << (m_testAllStraws ? "true" : "false") << endmsg;
65  msg(MSG::INFO) << " ErrorRotation: " << m_errRot << endmsg;
66  msg(MSG::INFO) << " ErrorTranslation: " << m_errTrans << endmsg;
67  msg(MSG::INFO) << " Precision: " << m_precision << endmsg;
68  if (!m_testAllElements) {
69  msg(MSG::INFO) << endmsg;
70  msg(MSG::INFO) << " Modules only - the 4 corner straws of each module will be printed. " << endmsg;
71  if (m_testAllStraws) {
72  msg(MSG::INFO) << " NB. TestAllStraws flag is ignored" << endmsg;
73  }
74  }
75  // Retrieve GeoModel Detector Elements
76  // You can either get the SCT or pixel manager or the common base class
77  // manager. In this example I get the base class.
78  // const SiTrackerDetectorManager * manager;
79  // or
80  // const PixelDetectorManager * manager;
81  // const SCT_DetectorManager * manager;
82  // const SiDetectorManager * manager;
84  if (sc.isFailure() || !m_manager) {
85  msg(MSG::FATAL) << "Could not find the Manager: "<< m_managerName << " !" << endmsg;
86  return StatusCode::FAILURE;
87  } else {
88  msg(MSG::DEBUG) << "Manager found" << endmsg;
89  }
90  // Get ID helper
91  if (detStore()->retrieve(m_idHelper, "TRT_ID").isFailure()) {
92  msg(MSG::FATAL) << "Could not get TRT ID helper" << endmsg;
93  return StatusCode::FAILURE;
94  }
95  if (m_hardwiredShifts) {
97  //translation/rotation are inverted to get the same result between Eigen and CLHEP
98  const unsigned int nTests(3);
99  const double distances[nTests]={0.2679 * CLHEP::mm, -0.4254 * CLHEP::mm, 0.0264 * CLHEP::mm};
100  const double angles[nTests]={atan(-0.0001639), atan(0.0003195), atan(0.0000053)};
101  const Amg::Translation3D translation(0., 11.93*CLHEP::mm, 0.);
102  const Amg::Vector3D zAxis(0., 0., 1.);
103  //this really needs checking!
104  Amg::Transform3D zRotations[nTests] = {zRotation(angles[0]), zRotation(angles[1]), zRotation(angles[2])};
105  Amg::Transform3D yTranslations[nTests]={yTranslation(distances[0]), yTranslation(distances[1]), yTranslation(distances[2])};
106  addShiftTop(Amg::Transform3D(translation));
107  addShiftModule(1,0,0, zRotations[0]*yTranslations[0]);
108  addShiftModule(1,0,1, zRotations[1]*yTranslations[1]);
109  addShiftModule(1,0,2, zRotations[2]*yTranslations[2]);
110  //
111  addShiftModule(1,1,0, Amg::Transform3D::Identity());
112  addShiftModule(1,1,1, Amg::Transform3D::Identity());
113  addShiftModule(1,1,2, Amg::Transform3D::Identity());
124  }
126  return StatusCode::SUCCESS;
127 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ printAlignmentShifts()

void TestTRT_Alignment::printAlignmentShifts ( )
private

Definition at line 168 of file TestTRT_Alignment.cxx.

168  {
169  int oldPrec = cout.precision(m_precision);
170  if (m_testAllElements) {
171  unsigned int maxHash = m_idHelper->straw_layer_hash_max();
172  for (unsigned int index = 0; index < maxHash; index++) {
173  IdentifierHash idHash = index;
174  Identifier id = m_idHelper->layer_id(idHash);
175  m_idHelper->show(id);
176  const TRT_BaseElement * element;
177  element = m_manager->getElement(idHash);
178  if (element) {
179  // Test first and last straw
180  if (m_testAllStraws) {
181  for (unsigned int iStraw = 0; iStraw < element->nStraws(); iStraw++) {
182  compareStraw(element, iStraw);
183  }
184  } else {
185  compareStraw(element, 0);
186  compareStraw(element, element->nStraws() - 1);
187  }
188  } else {
189  cout << "No Element with id hash = " << idHash << endl;
190  }
191  } // loop over elements
192  } else { // Just modules
193  TRT_ID::const_id_iterator moduleIter;
194  for (moduleIter = m_idHelper->module_begin(); moduleIter != m_idHelper->module_end(); ++moduleIter) {
195  Identifier moduleId = *moduleIter;
196  cout << "Module " << m_idHelper->show_to_string(moduleId) << endl;
197  int numStrawLayers = m_idHelper->straw_layer_max(moduleId);
198  if (numStrawLayers) {
199  Identifier firstElementId = m_idHelper->layer_id(moduleId,0);
200  Identifier lastElementId = m_idHelper->layer_id(moduleId,numStrawLayers-1);
201  compareEndStraws(firstElementId);
202  compareEndStraws(lastElementId);
203  } else {
204  cout << "ERROR: No Elements in this module!" << endl;
205  }
206  }
207  }
208  cout.precision(oldPrec);
209 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ testIdentity()

bool TestTRT_Alignment::testIdentity ( const Amg::Transform3D transform,
double  errRot = 0,
double  errTrans = 0 
)
private

Definition at line 247 of file TestTRT_Alignment.cxx.

247  {
248  using std::abs;
249  const Amg::Transform3D & t1 = transform;
250  const Amg::Transform3D t2 = Amg::Transform3D::Identity();
251  // Rotation/Scale
252  for (int i=0; i < 3; i++){
253  for (int j=0; j < 3; j++){
254  double diff = abs(t1(i,j) - t2(i,j));
255  if (diff > errRot) return false;
256  }
257  }
258  // Translation
259  for (int ii = 0; ii < 3; ii++){
260  double diff = abs(t1(ii,3) - t2(ii,3));
261  if (diff > errTrans) return false;
262  }
263  return true;
264 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_errRot

double TestTRT_Alignment::m_errRot
private

Definition at line 54 of file TestTRT_Alignment.h.

◆ m_errTrans

double TestTRT_Alignment::m_errTrans
private

Definition at line 55 of file TestTRT_Alignment.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_hardwiredShifts

bool TestTRT_Alignment::m_hardwiredShifts
private

Definition at line 56 of file TestTRT_Alignment.h.

◆ m_idHelper

const TRT_ID* TestTRT_Alignment::m_idHelper
private

Definition at line 48 of file TestTRT_Alignment.h.

◆ m_longPrintOut

bool TestTRT_Alignment::m_longPrintOut
private

Definition at line 51 of file TestTRT_Alignment.h.

◆ m_manager

const InDetDD::TRT_DetectorManager* TestTRT_Alignment::m_manager
private

Definition at line 47 of file TestTRT_Alignment.h.

◆ m_managerName

std::string TestTRT_Alignment::m_managerName
private

Definition at line 50 of file TestTRT_Alignment.h.

◆ m_precision

int TestTRT_Alignment::m_precision
private

Definition at line 57 of file TestTRT_Alignment.h.

◆ m_testAllElements

bool TestTRT_Alignment::m_testAllElements
private

Definition at line 53 of file TestTRT_Alignment.h.

◆ m_testAllStraws

bool TestTRT_Alignment::m_testAllStraws
private

Definition at line 52 of file TestTRT_Alignment.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TestTRT_Alignment::printAlignmentShifts
void printAlignmentShifts()
Definition: TestTRT_Alignment.cxx:168
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:500
TestTRT_Alignment::m_hardwiredShifts
bool m_hardwiredShifts
Definition: TestTRT_Alignment.h:56
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
TestTRT_Alignment::m_testAllElements
bool m_testAllElements
Definition: TestTRT_Alignment.h:53
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
PlotCalibFromCool.zAxis
zAxis
Definition: PlotCalibFromCool.py:76
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TRT_ID::straw_layer_hash_max
size_type straw_layer_hash_max(void) const
Definition: TRT_ID.h:920
InDetDD::TRT_BaseElement::nStraws
unsigned int nStraws() const
Number of straws in the element.
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
InDetDD::TRT_DetectorManager::setAlignableTransformDelta
virtual bool setAlignableTransformDelta(int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const override
Set alignable transforms: Amg based.
Definition: TRT_DetectorManager.cxx:323
TRT_ID::barrel_ec_id
Identifier barrel_ec_id(int barrel_ec) const
For +/-barrel or +/-endcap id.
Definition: TRT_ID.h:417
TRT_ID::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition: TRT_ID.h:89
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TRT_ID::module_begin
const_id_iterator module_begin(void) const
Iterators over full set of module ids. Module ids are sorted.
Definition: TRT_ID.h:937
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TRT_ID::module_end
const_id_iterator module_end(void) const
Definition: TRT_ID.h:945
TestTRT_Alignment::m_longPrintOut
bool m_longPrintOut
Definition: TestTRT_Alignment.h:51
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TestTRT_Alignment::m_testAllStraws
bool m_testAllStraws
Definition: TestTRT_Alignment.h:52
TestTRT_Alignment::m_precision
int m_precision
Definition: TestTRT_Alignment.h:57
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:92
TestTRT_Alignment::m_managerName
std::string m_managerName
Definition: TestTRT_Alignment.h:50
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
TestTRT_Alignment::compareEndStraws
void compareEndStraws(const Identifier &id)
Definition: TestTRT_Alignment.cxx:212
TestTRT_Alignment::addShiftModule
void addShiftModule(int bec, int phiMod, int layer, const Amg::Transform3D &transform)
Definition: TestTRT_Alignment.cxx:138
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TestTRT_Alignment::m_idHelper
const TRT_ID * m_idHelper
Definition: TestTRT_Alignment.h:48
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
TRT_ID::straw_layer_max
int straw_layer_max(const Identifier &id) const
Max values for each field (-999 == failure)
Definition: TRT_ID.cxx:980
TestTRT_Alignment::addShiftTop
void addShiftTop(const Amg::Transform3D &transform)
Definition: TestTRT_Alignment.cxx:131
TestTRT_Alignment::m_errRot
double m_errRot
Definition: TestTRT_Alignment.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
TestTRT_Alignment::compareStraw
void compareStraw(const InDetDD::TRT_BaseElement *element, int straw)
Definition: TestTRT_Alignment.cxx:225
TestTRT_Alignment::m_errTrans
double m_errTrans
Definition: TestTRT_Alignment.h:55
TestTRT_Alignment::m_manager
const InDetDD::TRT_DetectorManager * m_manager
Definition: TestTRT_Alignment.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
InDetDD::TRT_DetectorManager::getElement
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
Definition: TRT_DetectorManager.cxx:158
AtlasDetectorID::show
void show(Identifier id, const IdContext *context=0, char sep='.') const
Short print out of any identifier (optionally provide separation character - default is '.
Definition: AtlasDetectorID.cxx:565
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
DeMoScan.index
string index
Definition: DeMoScan.py:362
InDetDD::TRT_BaseElement::strawTransform
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
Definition: TRT_BaseElement.cxx:89
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
h
TestTRT_Alignment::testIdentity
bool testIdentity(const Amg::Transform3D &transform, double errRot=0, double errTrans=0)
Definition: TestTRT_Alignment.cxx:247
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:57
TRT_ID::module_id
Identifier module_id(int barrel_ec, int phi_module, int layer_or_wheel) const
For an individual module phi sector.
Definition: TRT_ID.h:448
TestTRT_Alignment::addShift
void addShift(int level, const Identifier &id, const Amg::Transform3D &transform)
Definition: TestTRT_Alignment.cxx:146
ServiceHandle< ICondSvc >