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

#include <TRTStrawAlign.h>

Inheritance diagram for TRTStrawAlign:
Collaboration diagram for TRTStrawAlign:

Public Member Functions

 TRTStrawAlign (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~TRTStrawAlign (void)
 
StatusCode initialize (void)
 
StatusCode execute (void)
 
StatusCode finalize (void)
 
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

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

ServiceHandle< ITRT_StrawAlignDbSvcp_caldbtool
 db tool More...
 
ServiceHandle< ITRT_AlignDbSvcp_aligndbtool
 db tool More...
 
bool m_doStrawAlign {}
 
bool m_doModuleAlign {}
 
const InDetDD::TRT_DetectorManagerm_trtman
 detector manager More...
 
const TRT_IDm_trt
 trt id helper More...
 
bool m_setup
 true for first event More...
 
bool m_doWriteToPOOL
 stream structures to output More...
 
bool m_doRegIOV
 register structures in the IOV service More...
 
std::string m_inputModuleAlignmentTextFile
 text file to read module alignment data More...
 
std::string m_inputStrawAlignmentTextFile
 text file to read straw alignment data More...
 
std::string m_outputModuleAlignmentTextFile
 output module level text file More...
 
std::string m_outputStrawAlignmentTextFile
 output module level text file
More...
 
std::string m_outputPOOLFile
 POOL file to write. More...
 
std::string m_moduleAlignTag
 IOV version tag for module alignment. More...
 
std::string m_stawAlignTag
 IOV version tag for straw alignment. More...
 
int m_runRangeBegin
 IOV range. More...
 
int m_runRangeEnd
 IOV range. More...
 
int m_eventRangeBegin
 IOV range. More...
 
int m_eventRangeEnd
 IOV range. More...
 
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 27 of file TRTStrawAlign.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

◆ TRTStrawAlign()

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

Definition at line 25 of file TRTStrawAlign.cxx.

26  :AthAlgorithm (name, pSvcLocator),
27  p_caldbtool("TRT_StrawAlignDbSvc",name),
28  p_aligndbtool("TRT_AlignDbSvc",name),
29  m_trtman(nullptr),
30  m_trt(nullptr),
31  m_setup(false),
32  m_doWriteToPOOL(false),
33  m_doRegIOV(false),
38  m_outputPOOLFile(""),
39  m_moduleAlignTag("TRTAlign_00"),
40  m_stawAlignTag("TrtCalibDx_00"),
41  m_runRangeBegin(0),
42  m_runRangeEnd(9999999),
44  m_eventRangeEnd(9999999)
45 
46 {
48  declareProperty("RegisterIOV",m_doRegIOV);
50  declareProperty("InputStrawAlignmentFile",m_inputStrawAlignmentTextFile);
51  declareProperty("PoolOutputFile",m_outputPOOLFile);
53  declareProperty("StrawAlignmentTextOutputFile",m_outputStrawAlignmentTextFile);
54  declareProperty("VersionTag",m_moduleAlignTag);
55  declareProperty("VersionTagStrawAlign",m_stawAlignTag);
56  declareProperty("ValidRun1",m_runRangeBegin);
57  declareProperty("ValidRun2",m_runRangeEnd);
58  declareProperty("ValidEvent1",m_eventRangeBegin);
59  declareProperty("ValidEvent2",m_eventRangeEnd);
60  declareProperty("DbTool",p_caldbtool);
61  declareProperty("AlignDbTool",p_aligndbtool);
62  declareProperty("DoStrawAlign",m_doStrawAlign);
63  declareProperty("DoModuleAlign",m_doModuleAlign);
64 }

◆ ~TRTStrawAlign()

TRTStrawAlign::~TRTStrawAlign ( void  )
default

Member Function Documentation

◆ 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 TRTStrawAlign::execute ( void  )

Definition at line 148 of file TRTStrawAlign.cxx.

148  {
149 
150  StatusCode sc=StatusCode::SUCCESS;
151  //
152  // at first event:
153  if (!m_setup) {
154  m_setup=true;
155 
156  if (m_doStrawAlign) {
157  // read alignment constants from text file
158  if (!m_inputStrawAlignmentTextFile.empty()) {
160  if(sc!=StatusCode::SUCCESS) {
161  msg(MSG::ERROR) << " Could not read input text file "
162  << endmsg;
163  return StatusCode::FAILURE;
164  }
165  }
166 
167  // write alignment constants to text file
168  if (!m_outputStrawAlignmentTextFile.empty()) {
170  if(sc!=StatusCode::SUCCESS) {
171  msg(MSG::ERROR) << " Could not write output text file "
172  << endmsg;
173  return StatusCode::FAILURE;
174  }
175  }
176 
177  if(m_doWriteToPOOL) {
178  if( StatusCode::SUCCESS != p_caldbtool->streamOutObjects()) {
179  msg(MSG::ERROR) << " Could not stream Straw Alignment objects to "
180  << m_outputPOOLFile << endmsg;
181  return StatusCode::FAILURE;
182  }
183  }
184  if(m_doRegIOV) {
185  if( StatusCode::SUCCESS != p_caldbtool->registerObjects(m_stawAlignTag,m_runRangeBegin,m_eventRangeBegin,m_runRangeEnd,m_eventRangeEnd) ) {
186  msg(MSG::ERROR) << " Could not register Straw Alignment objects "
187  << endmsg;
188  return StatusCode::FAILURE;
189  }
190  }
191  }
192 
193  if (m_doModuleAlign) {
194  // read alignment constants from text file
195  if (!m_inputModuleAlignmentTextFile.empty()) {
196  sc=p_aligndbtool->readAlignTextFile(m_inputModuleAlignmentTextFile);
197  if(sc!=StatusCode::SUCCESS) {
198  msg(MSG::ERROR) << " Could not read input text file "
199  << endmsg;
200  return StatusCode::FAILURE;
201  }
202  }
203 
204  // write alignment constants to text file
205  if (!m_outputModuleAlignmentTextFile.empty()) {
206  sc=p_aligndbtool->writeAlignTextFile(m_outputModuleAlignmentTextFile);
207  if(sc!=StatusCode::SUCCESS) {
208  msg(MSG::ERROR) << " Could not write output text file " << endmsg;
209  return StatusCode::FAILURE;
210  }
211  }
212 
213  if(m_doWriteToPOOL) {
214  if( StatusCode::SUCCESS != p_aligndbtool->streamOutAlignObjects()) {
215  msg(MSG::ERROR) << " Could not stream Module Alignment objects to " << m_outputPOOLFile << endmsg;
216  return StatusCode::FAILURE;
217  }
218  }
219  if(m_doRegIOV) {
220  if( StatusCode::SUCCESS != p_aligndbtool->registerAlignObjects(m_moduleAlignTag
224  ,m_eventRangeEnd) ) {
225 
226  msg(MSG::ERROR) << " Could not register Module Alignment objects " << endmsg;
227  return StatusCode::FAILURE;
228  }
229  }
230  }
231 
232  }
233 
234  return StatusCode::SUCCESS;
235 }

◆ 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 TRTStrawAlign::finalize ( void  )

Definition at line 238 of file TRTStrawAlign.cxx.

238  {
239 
240  //
241  // check a few straw positions
242  for(int strlay=0;strlay<3;strlay++) {
243  for(int str=7;str<10;str++) {
244  Identifier id=m_trt->layer_id(-1,1,0,strlay);
245  const InDetDD::TRT_BaseElement* element = m_trtman->getElement(id);
246  float y = element->strawCenter(str).x();
247  float x = element->strawCenter(str).y();
248  float z = element->strawCenter(str).z();
250  << "bec -1 layer 0 sector 1 plane "
251  << strlay << " straw " << str << endmsg;
253  << " x " << x << " y " << y << " z " << z << endmsg;
254  id=m_trt->layer_id(1,1,0,strlay);
255  element = m_trtman->getElement(id);
256  y = element->strawCenter(str).x();
257  x = element->strawCenter(str).y();
258  z = element->strawCenter(str).z();
260  << "bec 1 layer 0 sector 1 plane "
261  << strlay << " straw " << str << endmsg;
263  << " x " << x << " y " << y << " z " << z << endmsg;
264  }
265  }
266 
267  return StatusCode::SUCCESS;
268 }

◆ initialize()

StatusCode TRTStrawAlign::initialize ( void  )

Definition at line 70 of file TRTStrawAlign.cxx.

70  {
71 
72  ATH_MSG_DEBUG(" in initialize() ");
73 
74  //
75  // Get TRT manager and ID helper
76  StatusCode sc = AthAlgorithm::detStore()->retrieve(m_trtman,"TRT");
77  if(sc.isFailure() || m_trtman==nullptr)
78  {
79  msg(MSG::FATAL) << "Could not find TRT manager " << endmsg;
80  return StatusCode::FAILURE;
81  }
82 
83  sc = detStore()->retrieve(m_trt,"TRT_ID");
84  if ( sc.isFailure() ) {
85  ATH_MSG_FATAL( "Couldn't retrieve TRT ID helper." );
86  return sc;
87  }
88  if(m_trt) ATH_MSG_DEBUG("TRT manager and helper found ");
89 
90  //get Database manager tools
91  if (m_doStrawAlign) {
92  if (StatusCode::SUCCESS!=p_caldbtool.retrieve()) {
93  msg(MSG::FATAL) << "TRTStrawAlignDbTool not found" << endmsg;
94  return StatusCode::FAILURE;
95  }
96 
97  ATH_MSG_DEBUG(" TRTStrawAlignDbTool found ");
98  if (m_doWriteToPOOL && msgLvl(MSG::INFO)) msg(MSG::INFO)
99  << "Straw alignment will be written to POOL file "
100  << m_outputPOOLFile << endmsg;
101  if (m_doRegIOV) {
102  ATH_MSG_INFO("Straw alignment will be registered with IOV");
103  if (msgLvl(MSG::INFO)) {
104  msg(MSG::INFO) << " run range: "
105  << m_runRangeBegin << " to " << m_runRangeEnd << endmsg;
106  msg(MSG::INFO) << " version tag: " << m_stawAlignTag << endmsg;
107  }
108  }
109  if (!m_inputStrawAlignmentTextFile.empty() && msgLvl(MSG::INFO)) msg(MSG::INFO)
110  << "Straw Alignment will read from text file "
112  if (!m_outputStrawAlignmentTextFile.empty() && msgLvl(MSG::INFO)) msg(MSG::INFO)
113  << "Straw Alignment will be written on text file "
115 
116  }
117  if (m_doModuleAlign) {
118 
119  if (StatusCode::SUCCESS!=p_aligndbtool.retrieve()) {
120  msg(MSG::FATAL) << "TRTAlignDbTool not found" << endmsg;
121  return StatusCode::FAILURE;
122  }
123 
124  ATH_MSG_DEBUG(" TRTAlignDbTool found ");
125  if (m_doWriteToPOOL && msgLvl(MSG::INFO)) msg(MSG::INFO)
126  << "Module alignment will be written to POOL file "
127  << m_outputPOOLFile << endmsg;
128  if (m_doRegIOV) {
129  ATH_MSG_INFO("Module alignment will be registered with IOV");
130  if ( msgLvl(MSG::INFO) ) {
131  msg(MSG::INFO) << " run range: " << m_runRangeBegin << " to " << m_runRangeEnd
132  << endmsg;
133  msg(MSG::INFO) << " version tag: " << m_moduleAlignTag << endmsg;
134  }
135  }
136  if (!m_inputModuleAlignmentTextFile.empty() && msgLvl(MSG::INFO)) msg(MSG::INFO)
137  << "Module Alignment will read from text file "
139  if (!m_outputModuleAlignmentTextFile.empty() && msgLvl(MSG::INFO)) msg(MSG::INFO)
140  << "Module Alignment will be written on text file "
142  }
143 
144  return StatusCode::SUCCESS;
145 }

◆ 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.

◆ 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.

◆ 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_doModuleAlign

bool TRTStrawAlign::m_doModuleAlign {}
private

Definition at line 40 of file TRTStrawAlign.h.

◆ m_doRegIOV

bool TRTStrawAlign::m_doRegIOV
private

register structures in the IOV service

Definition at line 47 of file TRTStrawAlign.h.

◆ m_doStrawAlign

bool TRTStrawAlign::m_doStrawAlign {}
private

Definition at line 39 of file TRTStrawAlign.h.

◆ m_doWriteToPOOL

bool TRTStrawAlign::m_doWriteToPOOL
private

stream structures to output

Definition at line 46 of file TRTStrawAlign.h.

◆ m_eventRangeBegin

int TRTStrawAlign::m_eventRangeBegin
private

IOV range.

Definition at line 57 of file TRTStrawAlign.h.

◆ m_eventRangeEnd

int TRTStrawAlign::m_eventRangeEnd
private

IOV range.

Definition at line 58 of file TRTStrawAlign.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_inputModuleAlignmentTextFile

std::string TRTStrawAlign::m_inputModuleAlignmentTextFile
private

text file to read module alignment data

Definition at line 48 of file TRTStrawAlign.h.

◆ m_inputStrawAlignmentTextFile

std::string TRTStrawAlign::m_inputStrawAlignmentTextFile
private

text file to read straw alignment data

Definition at line 49 of file TRTStrawAlign.h.

◆ m_moduleAlignTag

std::string TRTStrawAlign::m_moduleAlignTag
private

IOV version tag for module alignment.

Definition at line 53 of file TRTStrawAlign.h.

◆ m_outputModuleAlignmentTextFile

std::string TRTStrawAlign::m_outputModuleAlignmentTextFile
private

output module level text file

Definition at line 50 of file TRTStrawAlign.h.

◆ m_outputPOOLFile

std::string TRTStrawAlign::m_outputPOOLFile
private

POOL file to write.

Definition at line 52 of file TRTStrawAlign.h.

◆ m_outputStrawAlignmentTextFile

std::string TRTStrawAlign::m_outputStrawAlignmentTextFile
private

output module level text file

Definition at line 51 of file TRTStrawAlign.h.

◆ m_runRangeBegin

int TRTStrawAlign::m_runRangeBegin
private

IOV range.

Definition at line 55 of file TRTStrawAlign.h.

◆ m_runRangeEnd

int TRTStrawAlign::m_runRangeEnd
private

IOV range.

Definition at line 56 of file TRTStrawAlign.h.

◆ m_setup

bool TRTStrawAlign::m_setup
private

true for first event

Definition at line 43 of file TRTStrawAlign.h.

◆ m_stawAlignTag

std::string TRTStrawAlign::m_stawAlignTag
private

IOV version tag for straw alignment.

Definition at line 54 of file TRTStrawAlign.h.

◆ m_trt

const TRT_ID* TRTStrawAlign::m_trt
private

trt id helper

Definition at line 42 of file TRTStrawAlign.h.

◆ m_trtman

const InDetDD::TRT_DetectorManager* TRTStrawAlign::m_trtman
private

detector manager

Definition at line 41 of file TRTStrawAlign.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.

◆ p_aligndbtool

ServiceHandle<ITRT_AlignDbSvc> TRTStrawAlign::p_aligndbtool
private

db tool

Definition at line 38 of file TRTStrawAlign.h.

◆ p_caldbtool

ServiceHandle<ITRT_StrawAlignDbSvc> TRTStrawAlign::p_caldbtool
private

db tool

Definition at line 37 of file TRTStrawAlign.h.


The documentation for this class was generated from the following files:
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
TRTStrawAlign::m_inputModuleAlignmentTextFile
std::string m_inputModuleAlignmentTextFile
text file to read module alignment data
Definition: TRTStrawAlign.h:48
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TRTStrawAlign::m_inputStrawAlignmentTextFile
std::string m_inputStrawAlignmentTextFile
text file to read straw alignment data
Definition: TRTStrawAlign.h:49
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TRTStrawAlign::m_trt
const TRT_ID * m_trt
trt id helper
Definition: TRTStrawAlign.h:42
TRTStrawAlign::p_aligndbtool
ServiceHandle< ITRT_AlignDbSvc > p_aligndbtool
db tool
Definition: TRTStrawAlign.h:38
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TRTStrawAlign::m_stawAlignTag
std::string m_stawAlignTag
IOV version tag for straw alignment.
Definition: TRTStrawAlign.h:54
TRTStrawAlign::m_outputModuleAlignmentTextFile
std::string m_outputModuleAlignmentTextFile
output module level text file
Definition: TRTStrawAlign.h:50
TRTStrawAlign::m_doStrawAlign
bool m_doStrawAlign
Definition: TRTStrawAlign.h:39
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
InDetDD::TRT_BaseElement::strawCenter
const Amg::Vector3D & strawCenter(int straw) const
Straw Surface: Local -> global transform of the straw via integer.
Definition: TRT_BaseElement.cxx:143
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
x
#define x
TRTStrawAlign::m_trtman
const InDetDD::TRT_DetectorManager * m_trtman
detector manager
Definition: TRTStrawAlign.h:41
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TRTStrawAlign::m_outputStrawAlignmentTextFile
std::string m_outputStrawAlignmentTextFile
output module level text file
Definition: TRTStrawAlign.h:51
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
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
z
#define z
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRTStrawAlign::m_eventRangeEnd
int m_eventRangeEnd
IOV range.
Definition: TRTStrawAlign.h:58
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TRTStrawAlign::m_eventRangeBegin
int m_eventRangeBegin
IOV range.
Definition: TRTStrawAlign.h:57
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
TRTStrawAlign::m_doRegIOV
bool m_doRegIOV
register structures in the IOV service
Definition: TRTStrawAlign.h:47
TRTStrawAlign::m_doWriteToPOOL
bool m_doWriteToPOOL
stream structures to output
Definition: TRTStrawAlign.h:46
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TRTStrawAlign::m_setup
bool m_setup
true for first event
Definition: TRTStrawAlign.h:43
InDetDD::TRT_DetectorManager::getElement
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
Definition: TRT_DetectorManager.cxx:148
TRTStrawAlign::m_doModuleAlign
bool m_doModuleAlign
Definition: TRTStrawAlign.h:40
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
TRTStrawAlign::m_runRangeEnd
int m_runRangeEnd
IOV range.
Definition: TRTStrawAlign.h:56
y
#define y
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
TRTStrawAlign::p_caldbtool
ServiceHandle< ITRT_StrawAlignDbSvc > p_caldbtool
db tool
Definition: TRTStrawAlign.h:37
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:623
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
TRTStrawAlign::m_moduleAlignTag
std::string m_moduleAlignTag
IOV version tag for module alignment.
Definition: TRTStrawAlign.h:53
TRTStrawAlign::m_outputPOOLFile
std::string m_outputPOOLFile
POOL file to write.
Definition: TRTStrawAlign.h:52
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
TRTStrawAlign::m_runRangeBegin
int m_runRangeBegin
IOV range.
Definition: TRTStrawAlign.h:55
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14