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

#include <InDetAlignWrt.h>

Inheritance diagram for InDetAlignWrt:
Collaboration diagram for InDetAlignWrt:

Public Member Functions

 InDetAlignWrt (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~InDetAlignWrt (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

void DispDB ()
 
void dispFile ()
 
void doOutput ()
 
void genTopTrans ()
 
void doMigration ()
 
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

ToolHandle< IInDetAlignDBToolp_iddbtool
 
ToolHandle< IInDetAlignDBToolp_migratetool
 
const xAOD::EventInfop_eventinfo
 
bool m_setup
 
bool m_par_create
 
bool m_par_wrt
 
bool m_par_wrtiov
 
bool m_par_print
 
bool m_par_migrate
 
std::string m_par_rfile
 
std::string m_par_wfile
 
std::string m_par_dispfile
 
bool m_par_ntuple
 
int m_par_wrtrun
 
int m_par_wrtevent
 
unsigned int m_par_run1
 
unsigned int m_par_run2
 
unsigned int m_par_evt1
 
unsigned int m_par_evt2
 
std::string m_par_iovtag
 
std::string m_par_dbtoolinst
 
int m_par_dispmode
 
int m_par_dettype
 
int m_par_bec
 
int m_par_layer
 
int m_par_ring
 
int m_par_sector
 
float m_par_rphidisp
 
float m_par_rdisp
 
float m_par_zdisp
 
int m_par_systdisp
 
int m_par_irskip
 
int m_par_dispcsc
 
bool m_par_writetop
 
std::string m_par_topname
 
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 15 of file InDetAlignWrt.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

◆ InDetAlignWrt()

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

Definition at line 22 of file AlignWrt.cxx.

23  :AthAlgorithm (name, pSvcLocator),
24  p_iddbtool("InDetAlignDBTool"),
25  p_migratetool("InDetAlignDBTool/InDetAlignMigrate"),
26  p_eventinfo (nullptr),
27  m_setup (false),
28  m_par_create(true),
29  m_par_wrt(false),
30  m_par_wrtiov(true),
31  m_par_print(false),
32  m_par_migrate(false),
33  m_par_rfile(""),
34  m_par_wfile(""),
35  m_par_dispfile(""),
36  m_par_ntuple(false),
37  m_par_wrtrun(-1),
38  m_par_wrtevent(0),
43  m_par_iovtag(""),
44  m_par_dbtoolinst("InDetAlignDBTool"),
45  m_par_dispmode(0),
46  m_par_dettype(-1),
47  m_par_bec(-1),
48  m_par_layer(-1),
49  m_par_ring(-1),
50  m_par_sector(-1),
51  m_par_rphidisp(0.1),
52  m_par_rdisp(0.2),
53  m_par_zdisp(0.3),
54  m_par_systdisp(1),
55  m_par_irskip(0),
56  m_par_dispcsc(0),
57  m_par_writetop(false),
58  m_par_topname("")
59 {
60 
61  // declare algorithm parameters
62  declareProperty("Create",m_par_create);
63  declareProperty("Write",m_par_wrt);
64  declareProperty("WriteIOV",m_par_wrtiov);
65  declareProperty("PrintDB",m_par_print);
66  declareProperty("Migrate",m_par_migrate);
69  declareProperty("RWNtuple",m_par_ntuple);
70  declareProperty("WriteRun",m_par_wrtrun);
71  declareProperty("WriteEvent",m_par_wrtevent);
72  declareProperty("ValidRun1",m_par_run1);
73  declareProperty("ValidRun2",m_par_run2);
74  declareProperty("ValidEvent1",m_par_evt1);
75  declareProperty("ValidEvent2",m_par_evt2);
76  declareProperty("IOVTag",m_par_iovtag);
77  declareProperty("DBToolInst",m_par_dbtoolinst);
78  declareProperty("DispMode",m_par_dispmode);
79  declareProperty("DispDet",m_par_dettype);
80  declareProperty("DispBec",m_par_bec);
81  declareProperty("DispLayer",m_par_layer);
82  declareProperty("DispRing",m_par_ring);
83  declareProperty("DispSector",m_par_sector);
84  declareProperty("DispRphi",m_par_rphidisp);
87  declareProperty("DispSyst",m_par_systdisp);
88  declareProperty("DispFile",m_par_dispfile);
89  declareProperty("RndmSkip",m_par_irskip);
90  declareProperty("DispCSC",m_par_dispcsc);
91 
92  declareProperty("WriteTopTrans",m_par_writetop);
93  declareProperty("TopTransFile",m_par_topname);
94 
95  declareProperty("InDetAlignDBTool",p_iddbtool);
96  declareProperty("InDetAlignMigrateTool",p_migratetool);
97 }

◆ ~InDetAlignWrt()

InDetAlignWrt::~InDetAlignWrt ( void  )

Definition at line 100 of file AlignWrt.cxx.

101 {}

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; }

◆ DispDB()

void InDetAlignWrt::DispDB ( )
private

Definition at line 188 of file AlignWrt.cxx.

188  {
189  // displace silicon modules according to recipe in DispMode
190  // or use DispCSC if appropriate parameter is set
191  //if (m_par_dispcsc!=0) {
192  // ATH_MSG_DEBUG("DispCSC called for mode " << m_par_dispcsc );
193  // p_iddbtool->dispCSC(m_par_dettype, m_par_bec, m_par_layer, m_par_ring,
194  // m_par_sector, m_par_dispcsc);
195  //} else {
196  ATH_MSG_DEBUG( "DispDB called for mode " << m_par_dispmode );
199  //}
200 }

◆ dispFile()

void InDetAlignWrt::dispFile ( )
private

Definition at line 202 of file AlignWrt.cxx.

202  {
203  ATH_MSG_DEBUG(
204  "::dispFile() : Initialise AlignableTransforms from parameters file "
205  << m_par_dispfile );
206  std::ifstream infile;
207  infile.open(m_par_dispfile.c_str());
208  // loop over lines in file
209  int nline=0;
210  std::string cline;
211  int level,isyst,dettype,bec,layer,ring,sector;
212  float rpd,rd,zd;
213  while (infile >> level >> isyst >> dettype >> bec >> layer >> ring >>
214  sector >> rpd >>
215  rd >> zd) {
216  ++nline;
217  ATH_MSG_DEBUG( "Add displacement level " << level << " syst " <<
218  isyst << " to [det,bec,layer] [" << dettype << "," << bec << "," <<
219  layer << "] {rphi,r,z} {" << rpd << "," << rd << "," << zd << "}" );
220  p_iddbtool->dispGroup(dettype,bec,layer,ring,sector,
221  rpd,rd,zd,isyst,level,m_par_irskip);
222  } // end of input loop
223  ATH_MSG_DEBUG( "Read " << nline <<
224  " displacement recipe lines" );
225 }

◆ doMigration()

void InDetAlignWrt::doMigration ( )
private

Definition at line 275 of file AlignWrt.cxx.

275  {
276  ATH_MSG_DEBUG( "Convert Pixel/SCT alignment from old to new format");
277  // create new format database
278  p_migratetool->createDB();
279  // copy data from old to new database via temporary file
280  p_iddbtool->writeFile(false,"migrate.dat");
281  p_migratetool->readTextFile("migrate.dat");
282  p_migratetool->writeFile(false,"migrate.check");
283  // write data to POOL file and optionally IOV
284  if (StatusCode::SUCCESS!=p_migratetool->outputObjs())
285  msg(MSG::ERROR) << "Write of AlignableTransform fails" << endmsg;
286  if (m_par_wrtiov)
288 }

◆ doOutput()

void InDetAlignWrt::doOutput ( )
private

Definition at line 227 of file AlignWrt.cxx.

227  {
228  // write all objects and fill IOV database
229  if (m_par_wrt) {
230  // first sort, just in case
231  p_iddbtool->sortTrans();
232  if (m_par_wfile=="") {
233  ATH_MSG_DEBUG( "doOutput for AlignableTransforms" );
234  if (StatusCode::SUCCESS!=p_iddbtool->outputObjs())
235  msg(MSG::ERROR) << "Write of AlignableTransforms fails" << endmsg;
236  if (m_par_wrtiov)
238  } else {
239  p_iddbtool->writeFile(m_par_ntuple,m_par_wfile);
240  }
241  }
242  if (m_par_writetop) {
243  genTopTrans();
244  }
245 }

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

Definition at line 143 of file AlignWrt.cxx.

143  {
144 
145  if (!m_setup) {
146  m_setup=true;
147  if (m_par_create) {
148  ATH_MSG_DEBUG(
149  "Creating null alignment database from geometry information in GeoModel");
150  p_iddbtool->createDB();
151  }
152  if (m_par_rfile!="") {
153  if (m_par_ntuple) {
154  p_iddbtool->readNtuple(m_par_rfile);
155  } else {
156  p_iddbtool->readTextFile(m_par_rfile);
157  }
158  }
159  if (m_par_dispmode>0 || m_par_dispcsc>0) DispDB();
160  if (m_par_dispfile!="") dispFile();
161  if (m_par_print) p_iddbtool->printDB(2);
162  }
163  // make a fall back solution in case event info not available to prevent crash
164  int run = -1;
165  int event = 0;
166  if (evtStore()->contains< xAOD::EventInfo >( "EventInfo" ) &&
167  StatusCode::SUCCESS==evtStore()->retrieve(p_eventinfo)) {
169  event=p_eventinfo->eventNumber();
170  }
171 
172  ATH_MSG_DEBUG( "In AlignWrt::execute for run/event " << run <<
173  "," << event );
174  // trigger database write by setting filter passed to false
175  if ((m_par_wrt || m_par_writetop) &&
177 
178  return StatusCode::SUCCESS;
179 }

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

Definition at line 182 of file AlignWrt.cxx.

182  {
183  if (m_par_wrtrun==-1) doOutput();
184  if (m_par_migrate) doMigration();
185  return StatusCode::SUCCESS;
186 }

◆ genTopTrans()

void InDetAlignWrt::genTopTrans ( )
private

Definition at line 247 of file AlignWrt.cxx.

247  {
248  // generate top level transforms into TDS
249  ATH_MSG_DEBUG( "Initialise TOPTRANS from parameters file: " <<
250  m_par_topname);
251  DetCondKeyTrans* dkp=new DetCondKeyTrans();
252  std::ifstream infile;
253  infile.open(m_par_topname.c_str());
254  // loop over all lines in file
255  int nline=0;
256  std::string cline,key;
257  float xd,yd,zd,phi,theta,psi;
258  while (infile >> key >> xd >> yd >> zd >> phi >> theta >> psi) {
259  ++nline;
260  ATH_MSG_DEBUG( "Add transform name: " << key << " x/y/z " << xd << "," << yd <<
261  "," << zd << " phi/theta/psi " << phi << "," << theta << "," << psi );
262  HepGeom::Transform3D newtrans=HepGeom::Transform3D(CLHEP::HepRotation(phi,theta,psi),
263  CLHEP::Hep3Vector(xd,yd,zd));
264  dkp->setTransform(key,newtrans);
265  }
266  ATH_MSG_DEBUG( "Read " << nline << " lines from recipe file" );
267  // record object in TDS
268  if (StatusCode::SUCCESS==detStore()->record(dkp,"/GLOBAL/GEOM/TOPTRANS")) {
269  ATH_MSG_DEBUG( "Recorded TOPTRANS in TDS" );
270  } else {
271  ATH_MSG_DEBUG( "Failed to record TOPTRANS in TDS");
272  }
273 }

◆ initialize()

StatusCode InDetAlignWrt::initialize ( void  )

Definition at line 103 of file AlignWrt.cxx.

103  {
104  ATH_MSG_DEBUG( "InDetAlignWrt::initialize() called" );
105  // get storegate pointers
106  if ( (evtStore().retrieve().isFailure()) ||
107  (detStore().retrieve().isFailure())) {
108  ATH_MSG_VERBOSE ("StoreGate or DetStore services not found" );
109  return StatusCode::FAILURE;
110  }
111 
112 
113  ATH_CHECK( p_iddbtool.retrieve() );
114 
115  // get second InDetAlignDBTool for migration if needed
116  if (m_par_migrate) {
117  ATH_CHECK (p_migratetool.retrieve() );
118  }
119 
120  if (msgLvl(MSG::DEBUG)) {
121  if (m_par_create) msg() << "ID Alignment database structures will be created" << endmsg;
122  if (m_par_rfile!="") {
123  if (m_par_ntuple) msg() << "Alignment constants will be initialised from ntuple: " << m_par_rfile << endmsg;
124  else msg() << "Alignment constants will be initialised from text file" << m_par_rfile << endmsg;
125  }
126  if (m_par_dispfile!="")
127  msg() << "Alignment constants will be set according to recipe in file " << m_par_dispfile << endmsg;
128  if (m_par_wrt)
129  msg() << "ID Alignment database structures will be written on run "
130  << m_par_wrtrun << " event " << m_par_wrtevent << endmsg;
131  if (m_par_wfile!="")
132  msg() << "Structures will be written on file " << m_par_wfile << endmsg;
133  if (m_par_writetop)
134  msg() << "Toplevel transforms will be read from file " << m_par_topname
135  << "and written on run " << m_par_wrtrun << " event " << m_par_wrtevent << endmsg;
136  if (!m_par_wrtiov)
137  msg() << "IOV writing will be suppressed - only output stream" << endmsg;
138  }
139 
140  return StatusCode::SUCCESS;
141 }

◆ 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_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_par_bec

int InDetAlignWrt::m_par_bec
private

Definition at line 53 of file InDetAlignWrt.h.

◆ m_par_create

bool InDetAlignWrt::m_par_create
private

Definition at line 32 of file InDetAlignWrt.h.

◆ m_par_dbtoolinst

std::string InDetAlignWrt::m_par_dbtoolinst
private

Definition at line 48 of file InDetAlignWrt.h.

◆ m_par_dettype

int InDetAlignWrt::m_par_dettype
private

Definition at line 52 of file InDetAlignWrt.h.

◆ m_par_dispcsc

int InDetAlignWrt::m_par_dispcsc
private

Definition at line 62 of file InDetAlignWrt.h.

◆ m_par_dispfile

std::string InDetAlignWrt::m_par_dispfile
private

Definition at line 39 of file InDetAlignWrt.h.

◆ m_par_dispmode

int InDetAlignWrt::m_par_dispmode
private

Definition at line 51 of file InDetAlignWrt.h.

◆ m_par_evt1

unsigned int InDetAlignWrt::m_par_evt1
private

Definition at line 45 of file InDetAlignWrt.h.

◆ m_par_evt2

unsigned int InDetAlignWrt::m_par_evt2
private

Definition at line 46 of file InDetAlignWrt.h.

◆ m_par_iovtag

std::string InDetAlignWrt::m_par_iovtag
private

Definition at line 47 of file InDetAlignWrt.h.

◆ m_par_irskip

int InDetAlignWrt::m_par_irskip
private

Definition at line 61 of file InDetAlignWrt.h.

◆ m_par_layer

int InDetAlignWrt::m_par_layer
private

Definition at line 54 of file InDetAlignWrt.h.

◆ m_par_migrate

bool InDetAlignWrt::m_par_migrate
private

Definition at line 36 of file InDetAlignWrt.h.

◆ m_par_ntuple

bool InDetAlignWrt::m_par_ntuple
private

Definition at line 40 of file InDetAlignWrt.h.

◆ m_par_print

bool InDetAlignWrt::m_par_print
private

Definition at line 35 of file InDetAlignWrt.h.

◆ m_par_rdisp

float InDetAlignWrt::m_par_rdisp
private

Definition at line 58 of file InDetAlignWrt.h.

◆ m_par_rfile

std::string InDetAlignWrt::m_par_rfile
private

Definition at line 37 of file InDetAlignWrt.h.

◆ m_par_ring

int InDetAlignWrt::m_par_ring
private

Definition at line 55 of file InDetAlignWrt.h.

◆ m_par_rphidisp

float InDetAlignWrt::m_par_rphidisp
private

Definition at line 57 of file InDetAlignWrt.h.

◆ m_par_run1

unsigned int InDetAlignWrt::m_par_run1
private

Definition at line 43 of file InDetAlignWrt.h.

◆ m_par_run2

unsigned int InDetAlignWrt::m_par_run2
private

Definition at line 44 of file InDetAlignWrt.h.

◆ m_par_sector

int InDetAlignWrt::m_par_sector
private

Definition at line 56 of file InDetAlignWrt.h.

◆ m_par_systdisp

int InDetAlignWrt::m_par_systdisp
private

Definition at line 60 of file InDetAlignWrt.h.

◆ m_par_topname

std::string InDetAlignWrt::m_par_topname
private

Definition at line 64 of file InDetAlignWrt.h.

◆ m_par_wfile

std::string InDetAlignWrt::m_par_wfile
private

Definition at line 38 of file InDetAlignWrt.h.

◆ m_par_writetop

bool InDetAlignWrt::m_par_writetop
private

Definition at line 63 of file InDetAlignWrt.h.

◆ m_par_wrt

bool InDetAlignWrt::m_par_wrt
private

Definition at line 33 of file InDetAlignWrt.h.

◆ m_par_wrtevent

int InDetAlignWrt::m_par_wrtevent
private

Definition at line 42 of file InDetAlignWrt.h.

◆ m_par_wrtiov

bool InDetAlignWrt::m_par_wrtiov
private

Definition at line 34 of file InDetAlignWrt.h.

◆ m_par_wrtrun

int InDetAlignWrt::m_par_wrtrun
private

Definition at line 41 of file InDetAlignWrt.h.

◆ m_par_zdisp

float InDetAlignWrt::m_par_zdisp
private

Definition at line 59 of file InDetAlignWrt.h.

◆ m_setup

bool InDetAlignWrt::m_setup
private

Definition at line 29 of file InDetAlignWrt.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_eventinfo

const xAOD::EventInfo* InDetAlignWrt::p_eventinfo
private

Definition at line 28 of file InDetAlignWrt.h.

◆ p_iddbtool

ToolHandle<IInDetAlignDBTool> InDetAlignWrt::p_iddbtool
private

Definition at line 26 of file InDetAlignWrt.h.

◆ p_migratetool

ToolHandle<IInDetAlignDBTool> InDetAlignWrt::p_migratetool
private

Definition at line 27 of file InDetAlignWrt.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDetAlignWrt::m_par_create
bool m_par_create
Definition: InDetAlignWrt.h:32
InDetAlignWrt::m_par_irskip
int m_par_irskip
Definition: InDetAlignWrt.h:61
run.infile
string infile
Definition: run.py:13
IOVTime::MAXRUN
static constexpr uint32_t MAXRUN
Definition: IOVTime.h:48
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
DetCondKeyTrans
Class to hold set of HepGeom::Transform3D keyed by string value for storage in the conditions DB typi...
Definition: DetCondKeyTrans.h:27
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
InDetAlignWrt::dispFile
void dispFile()
Definition: AlignWrt.cxx:202
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDetAlignWrt::m_par_rdisp
float m_par_rdisp
Definition: InDetAlignWrt.h:58
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
InDetAlignWrt::m_par_dispfile
std::string m_par_dispfile
Definition: InDetAlignWrt.h:39
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
InDetAlignWrt::m_par_migrate
bool m_par_migrate
Definition: InDetAlignWrt.h:36
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
InDetAlignWrt::m_par_dispmode
int m_par_dispmode
Definition: InDetAlignWrt.h:51
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDetAlignWrt::m_par_dbtoolinst
std::string m_par_dbtoolinst
Definition: InDetAlignWrt.h:48
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDetAlignWrt::m_par_iovtag
std::string m_par_iovtag
Definition: InDetAlignWrt.h:47
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
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
IOVTime::MINRUN
static constexpr uint32_t MINRUN
Definition: IOVTime.h:44
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
InDetAlignWrt::m_par_wfile
std::string m_par_wfile
Definition: InDetAlignWrt.h:38
InDetAlignWrt::p_iddbtool
ToolHandle< IInDetAlignDBTool > p_iddbtool
Definition: InDetAlignWrt.h:26
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
InDetAlignWrt::genTopTrans
void genTopTrans()
Definition: AlignWrt.cxx:247
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
InDetAlignWrt::m_par_dispcsc
int m_par_dispcsc
Definition: InDetAlignWrt.h:62
InDetAlignWrt::m_par_wrtiov
bool m_par_wrtiov
Definition: InDetAlignWrt.h:34
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
InDetAlignWrt::m_par_evt1
unsigned int m_par_evt1
Definition: InDetAlignWrt.h:45
InDetAlignWrt::m_par_run2
unsigned int m_par_run2
Definition: InDetAlignWrt.h:44
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
InDetAlignWrt::m_par_ntuple
bool m_par_ntuple
Definition: InDetAlignWrt.h:40
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
InDetAlignWrt::p_migratetool
ToolHandle< IInDetAlignDBTool > p_migratetool
Definition: InDetAlignWrt.h:27
InDetAlignWrt::m_setup
bool m_setup
Definition: InDetAlignWrt.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDetAlignWrt::m_par_run1
unsigned int m_par_run1
Definition: InDetAlignWrt.h:43
InDetAlignWrt::m_par_wrtevent
int m_par_wrtevent
Definition: InDetAlignWrt.h:42
InDetAlignWrt::m_par_bec
int m_par_bec
Definition: InDetAlignWrt.h:53
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
run
Definition: run.py:1
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
InDetAlignWrt::m_par_topname
std::string m_par_topname
Definition: InDetAlignWrt.h:64
InDetAlignWrt::m_par_layer
int m_par_layer
Definition: InDetAlignWrt.h:54
plotBeamSpotCompare.xd
xd
Definition: plotBeamSpotCompare.py:220
InDetAlignWrt::m_par_zdisp
float m_par_zdisp
Definition: InDetAlignWrt.h:59
InDetAlignWrt::m_par_rfile
std::string m_par_rfile
Definition: InDetAlignWrt.h:37
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
InDetAlignWrt::m_par_writetop
bool m_par_writetop
Definition: InDetAlignWrt.h:63
IOVTime::MAXEVENT
static constexpr uint32_t MAXEVENT
Definition: IOVTime.h:51
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDetAlignWrt::m_par_dettype
int m_par_dettype
Definition: InDetAlignWrt.h:52
InDetAlignWrt::m_par_wrtrun
int m_par_wrtrun
Definition: InDetAlignWrt.h:41
InDetAlignWrt::DispDB
void DispDB()
Definition: AlignWrt.cxx:188
IOVTime::MINEVENT
static constexpr uint32_t MINEVENT
Definition: IOVTime.h:50
InDetAlignWrt::m_par_evt2
unsigned int m_par_evt2
Definition: InDetAlignWrt.h:46
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
InDetAlignWrt::doMigration
void doMigration()
Definition: AlignWrt.cxx:275
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDetAlignWrt::m_par_ring
int m_par_ring
Definition: InDetAlignWrt.h:55
InDetAlignWrt::m_par_systdisp
int m_par_systdisp
Definition: InDetAlignWrt.h:60
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
InDetAlignWrt::m_par_rphidisp
float m_par_rphidisp
Definition: InDetAlignWrt.h:57
InDetAlignWrt::p_eventinfo
const xAOD::EventInfo * p_eventinfo
Definition: InDetAlignWrt.h:28
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
InDetAlignWrt::doOutput
void doOutput()
Definition: AlignWrt.cxx:227
DetCondKeyTrans::setTransform
void setTransform(const std::string &key, const HepGeom::Transform3D &trans)
Definition: DetCondKeyTrans.h:64
InDetAlignWrt::m_par_sector
int m_par_sector
Definition: InDetAlignWrt.h:56
InDetAlignWrt::m_par_wrt
bool m_par_wrt
Definition: InDetAlignWrt.h:33
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
InDetAlignWrt::m_par_print
bool m_par_print
Definition: InDetAlignWrt.h:35
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37