ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::GlobalChi2AlignTool Class Reference

#include <GlobalChi2AlignTool.h>

Inheritance diagram for Trk::GlobalChi2AlignTool:
Collaboration diagram for Trk::GlobalChi2AlignTool:

Public Member Functions

 GlobalChi2AlignTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor. More...
 
virtual ~GlobalChi2AlignTool ()
 Virtual destructor. More...
 
virtual StatusCode initialize ()
 initialize More...
 
virtual StatusCode finalize ()
 finalize More...
 
virtual StatusCode firstEventInitialize ()
 sets up matrix More...
 
virtual StatusCode solve ()
 solves for alignment parameters More...
 
bool accumulate (AlignTrack *alignTrack)
 accumulates information from an AlignTrack More...
 
bool accumulateFromFiles ()
 accumulates information from binary files More...
 
unsigned int nAccumulatedTracks ()
 returns total number of accumulated tracks More...
 
void setNtuple (TFile *ntuple)
 set ntuple More...
 
void setLogStream (std::ostream *os)
 sets the output stream for the logfile More...
 
StatusCode fillNtuple ()
 writes tree to ntuple 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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

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

Protected Attributes

std::ostream * m_logStream
 logfile output stream More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

double getMaterialOnTrack (const Trk::Track *track)
 
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< Trk::IMatrixToolm_matrixTool
 Pointer to MatrixTool, used to write to and solve matrix. More...
 
ToolHandle< Trk::IAlignModuleToolm_alignModuleTool
 Pointer to AlignModuleTool. More...
 
std::string m_pathbin
 path binary files (in/out) More...
 
std::string m_pathtxt
 path ascii files (in/out) More...
 
std::string m_prefixName
 prefix string to filenames More...
 
unsigned int m_ntracks
 number of accumulated tracks More...
 
unsigned int m_nmeas
 number of accumulated measurements More...
 
unsigned int m_nhits
 number of accumulated hits More...
 
double m_chi2
 total chi2 More...
 
unsigned int m_nDoF
 number of degrees of freedom More...
 
double m_secondDerivativeCut
 
bool m_doTree
 
bool m_writeActualSecDeriv
 
bool m_storeLocalDerivOnly
 
TFile * m_ntuple
 output ntuple More...
 
TTree * m_tree
 
int m_run
 
int m_event
 
double m_materialOnTrack
 
double m_momentum
 
int m_nChambers
 
int * m_chamberIds
 
int m_nMatrixIndices
 
int * m_matrixIndices
 
int m_nSecndDeriv
 
double * m_secndDeriv
 
double * m_firstDeriv
 
double * m_actualSecndDeriv
 
double m_eta
 
double m_phi
 
double m_perigee_x
 
double m_perigee_y
 
double m_perigee_z
 
int m_trackInfo
 
int m_bremFit
 
int m_bremFitSuccessful
 
int m_straightTrack
 
int m_slimmedTrack
 
int m_hardScatterOrKink
 
int m_lowPtTrack
 
bool m_fromFiles
 
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 39 of file GlobalChi2AlignTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ GlobalChi2AlignTool()

GlobalChi2AlignTool::GlobalChi2AlignTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor.

Definition at line 42 of file GlobalChi2AlignTool.cxx.

45  , m_matrixTool("Trk::MatrixTool",this)
46  , m_alignModuleTool("Trk::AlignModuleTool/AlignModuleTool")
47  , m_ntracks(0)
48  , m_nmeas(0)
49  , m_nhits(0)
50  , m_chi2(0.)
51  , m_nDoF(0)
52  , m_ntuple(nullptr)
53  , m_tree(nullptr)
54  , m_run{}
55  , m_event{}
57  , m_momentum{}
58  , m_nChambers(0)
59  , m_chamberIds(new int[MAXNCHAMBERS])
60  , m_nMatrixIndices(0)
61  , m_matrixIndices(new int[MAXNINDICES])
62  , m_nSecndDeriv(0)
63  , m_secndDeriv(new double[MAXNINDICES*MAXNINDICES])
64  , m_firstDeriv(new double[MAXNINDICES])
65  , m_actualSecndDeriv(new double[MAXNINDICES])
66  , m_eta{}
67  , m_phi{}
69  , m_trackInfo{}
70  , m_bremFit{}
72  , m_straightTrack{}
73  , m_slimmedTrack{}
75  , m_lowPtTrack{}
76  , m_fromFiles(false)
77  {
78  declareInterface<IAlignTool>(this);
79 
80  declareProperty("MatrixTool", m_matrixTool, "tool for storing and inverting matrix");
81  declareProperty("AlignModuleTool", m_alignModuleTool);
82 
83  declareProperty("SecondDerivativeCut", m_secondDerivativeCut = -1e5);
84 
85  declareProperty("DoTree", m_doTree = false);
86  declareProperty("WriteActualSecDeriv", m_writeActualSecDeriv = false);
87 
88  declareProperty("StoreLocalDerivOnly", m_storeLocalDerivOnly = false);
89 
90  m_logStream = nullptr;
91  }

◆ ~GlobalChi2AlignTool()

GlobalChi2AlignTool::~GlobalChi2AlignTool ( )
virtual

Virtual destructor.

Definition at line 94 of file GlobalChi2AlignTool.cxx.

95  {
96  ATH_MSG_DEBUG("in GlobalChi2AlignTool d'tor");
97  //delete m_tree;
98 
99  delete [] m_chamberIds;
100  delete [] m_matrixIndices;
101  delete [] m_secndDeriv;
102  delete [] m_firstDeriv;
103  delete [] m_actualSecndDeriv;
104 
105  ATH_MSG_DEBUG("done with GlobalChi2AlignTool d'tor");
106  }

Member Function Documentation

◆ accumulate()

bool GlobalChi2AlignTool::accumulate ( AlignTrack alignTrack)
virtual

accumulates information from an AlignTrack

Implements Trk::IAlignTool.

Definition at line 143 of file GlobalChi2AlignTool.cxx.

144  {
145  ATH_MSG_DEBUG("in GlobalChi2AlignTool::accumulate()");
146 
147  // prepare ROOT tree for derivatives if it doesn't exist yet
148  // Shouldn't this be in firstEventInitialize() ?
149  if (m_doTree && !m_tree && m_ntuple) {
150 
151  m_ntuple->cd();
152  m_tree=new TTree("globalChi2Deriv","globalChi2Deriv");
153  m_tree->Branch("run", &m_run, "run/I");
154  m_tree->Branch("event", &m_event, "event/I");
155  m_tree->Branch("nChambers", &m_nChambers, "nChambers/I");
156  m_tree->Branch("chamberIds", m_chamberIds, "chamberIds[nChambers]/I");
157  m_tree->Branch("nMatrixIndices", &m_nMatrixIndices, "nMatrixIndices/I");
158  m_tree->Branch("matrixIndices", m_matrixIndices, "matrixIndices[nMatrixIndices]/I");
159  m_tree->Branch("nSecndDeriv", &m_nSecndDeriv, "nSecndDeriv/I");
160  m_tree->Branch("secndDeriv", m_secndDeriv, "secndDeriv[nSecndDeriv]/D");
161  m_tree->Branch("firstDeriv", m_firstDeriv, "firstDeriv[nMatrixIndices]/D");
163  m_tree->Branch("actualSecndDeriv", m_actualSecndDeriv, "actualSecndDeriv[nMatrixIndices]/D");
164 
165  m_tree->Branch("materialOnTrack", &m_materialOnTrack, "materialOnTrack/D");
166  m_tree->Branch("momentum", &m_momentum, "momentum/D");
167  m_tree->Branch("eta", &m_eta, "eta/D");
168  m_tree->Branch("phi", &m_phi, "phi/D");
169  m_tree->Branch("perigee_x", &m_perigee_x, "perigee_x/D");
170  m_tree->Branch("perigee_y", &m_perigee_y, "perigee_y/D");
171  m_tree->Branch("perigee_z", &m_perigee_z, "perigee_z/D");
172  m_tree->Branch("trackInfo", &m_trackInfo, "trackInfo/I");
173  m_tree->Branch("bremFit", &m_bremFit, "bremFit/I");
174  m_tree->Branch("bremFitSuccessful", &m_bremFitSuccessful, "bremFitSuccessful/I");
175  m_tree->Branch("straightTrack", &m_straightTrack, "straightTrack/I");
176  m_tree->Branch("slimmedTrack", &m_slimmedTrack, "slimmedTrack/I");
177  m_tree->Branch("hardScatterOrKink", &m_hardScatterOrKink, "hardScatterOrKink/I");
178  m_tree->Branch("lowPtTrack", &m_lowPtTrack, "lowPtTrack/I");
179  }
180 
181 
182  // check if the track belongs to a vertex. If yes, retrieve the relevant objects:
183  bool fullVertex = false;
184  AlignVertex * ptrVertex = alignTrack->getVtx();
185  const Amg::Vector3D * ptrPosition = nullptr;
186  const AmgSymMatrix(3) * ptrCovariance = nullptr;
187  const std::vector<AlignModuleVertexDerivatives> * ptrX = nullptr;
189  if( ptrVertex ) {
190  fullVertex = true;
191  ptrPosition = ptrVertex->position();
192  ptrCovariance = ptrVertex->covariance();
193  ptrX = ptrVertex->derivatives();
194  vtxType = ptrVertex->type();
195 
196  // check if pointers are valid
197  if ( !ptrPosition || !ptrCovariance || !ptrX || vtxType<AlignVertex::Refitted ) {
198  msg(MSG::ERROR)<<"something missing from alignVertex!"<<endmsg;
199  if (!ptrPosition) msg(MSG::ERROR)<<"no fitted position!"<<endmsg;
200  if (!ptrCovariance) msg(MSG::ERROR)<<"no covariance!"<<endmsg;
201  if (!ptrX) msg(MSG::ERROR)<<"no link to the X object!"<<endmsg;
202  if (vtxType<AlignVertex::Refitted) msg(MSG::ERROR)<<"Vertex type = "<< vtxType << endmsg;
203  return false;
204  }
205  }
206 
207 
208 
209  // reset tree variables
210  m_nChambers=0;
212 
213  // get pointers so we can reuse them if they're valid
214  const Amg::SymMatrixX * ptrWeights = alignTrack->weightMatrix();
215  const Amg::SymMatrixX * ptrWeightsFD = alignTrack->weightMatrixFirstDeriv();
216  const Amg::VectorX * ptrResiduals = alignTrack->residualVector();
217  const std::vector<AlignModuleDerivatives> * ptrDerivs = alignTrack->derivatives();
218 
219  // check if pointers are valid
220  if (!ptrWeights || !ptrWeightsFD || !ptrResiduals || !ptrDerivs) {
221  msg(MSG::ERROR)<<"something missing from alignTrack!"<<endmsg;
222  if (!ptrWeights) msg(MSG::ERROR)<<"no weights!"<<endmsg;
223  if (!ptrWeightsFD) msg(MSG::ERROR)<<"no weights for first deriv!"<<endmsg;
224  if (!ptrResiduals) msg(MSG::ERROR)<<"no residuals!"<<endmsg;
225  if (!ptrDerivs) msg(MSG::ERROR)<<"no derivatives!"<<endmsg;
226  return false;
227  }
228 
229  // get weight matrices
230  const Amg::SymMatrixX& weights = *ptrWeights;
231  const Amg::SymMatrixX& weightsFirstDeriv = *ptrWeightsFD;
232  ATH_MSG_VERBOSE("weights="<<weights);
233  ATH_MSG_VERBOSE("weightsFirstDeriv="<<weightsFirstDeriv);
234 
235  // get vectors
236  const Amg::VectorX& residuals = *ptrResiduals;
237  std::vector<AlignModuleDerivatives> derivatives = *ptrDerivs;
238  const std::vector<AlignModuleDerivatives>* derivativeErr = alignTrack->derivativeErr();
239  const std::vector<std::pair<AlignModule*,std::vector<double> > >* secDerivs = alignTrack->actualSecondDerivatives();
240 
241 
242 
243  std::vector<AlignPar*> allAlignPars;
244  std::vector<Amg::VectorX*> allDerivatives;
245  std::vector<const Amg::VectorX*> allDerivativeErr;
246  std::vector<double> allActualSecDeriv;
247  int WSize(weights.cols());
248  Amg::MatrixX matrix_F(3,WSize );
249  matrix_F.setZero();
250 
251  // get all alignPars and all derivatives
252  msg(MSG::DEBUG) << "accumulate: The derivative vector size is " << derivatives.size() << endmsg;
253  std::vector<AlignModuleDerivatives>::iterator derivIt = derivatives.begin();
254  std::vector<AlignModuleDerivatives>::iterator derivIt_end = derivatives.end();
255 
256  std::vector<AlignModuleDerivatives>::const_iterator derivErrIt;
257  std::vector<std::pair<AlignModule*,std::vector<double> > >::const_iterator secDerivIt;
258  if (derivativeErr) derivErrIt=derivativeErr->begin();
259  if (secDerivs) secDerivIt=secDerivs->begin();
260  for ( ; derivIt!=derivIt_end ; ++derivIt) {
261 
262  // get AlignModule
263  AlignModule* module=derivIt->first;
264 
265  // increment track counter
266  module->addTrack();
267  ATH_MSG_DEBUG("add track to module "<<module->identify().get_identifier32().get_compact());
268  module->addNDoF(alignTrack->fitQuality()->numberDoF());
269  module->addTrackChi2(alignTrack->fitQuality()->chiSquared());
270 
271  // tree variables
273  m_chamberIds[m_nChambers]=module->identify().get_identifier32().get_compact();
274  m_nChambers++;
275  }
276  else ATH_MSG_WARNING("number of chambers exceeded maximum");
277 
278  // get alignment parameters
279  std::vector<Amg::VectorX>& deriv_vec = derivIt->second;
280  ATH_MSG_DEBUG( "accumulate: The deriv_vec size is " << deriv_vec.size() );
281  DataVector<AlignPar>* alignPars = m_alignModuleTool->getAlignPars(module);
282  int nModPars = alignPars->size();
283  if (nModPars != (int)deriv_vec.size() && (nModPars+3) != (int)deriv_vec.size()) {
284  ATH_MSG_ERROR("accumulate: wrong size of the deriv_vec!");
285  return false;
286  }
287  for (int i=0;i<3;i++) {
288  for (int j=0;j<WSize;j++) {
289  matrix_F(i,j) += deriv_vec[nModPars+i][j]; // in the derivIT loop the complete F matrix is built
290  }
291  }
292 
293  // get derivatives and derivative errors
294  for (int i=0;i<nModPars;i++) {
295  ATH_MSG_DEBUG("align par for module "<<(*alignPars)[i]->alignModule()->identify());
296  allAlignPars.push_back((*alignPars)[i]);
297  allDerivatives.push_back(&deriv_vec[i]);
298  if (derivativeErr)
299  allDerivativeErr.push_back(&(derivErrIt->second)[i]);
300  if (secDerivs)
301  allActualSecDeriv.push_back((secDerivIt->second)[i]);
302  }
303  if (derivativeErr) ++derivErrIt;
304  if (secDerivs) ++secDerivIt;
305  }
306 
307  // increment hit counters in modules
308  AlignTSOSCollection::iterator iatsos = alignTrack->firstAtsos();
309  AlignTSOSCollection::iterator iatsos_last = alignTrack->lastAtsos();
310  for (; iatsos != iatsos_last; ++iatsos)
311  if ((*iatsos)->module())
312  (*iatsos)->module()->addHit();
313 
314  // determine all derivatives and set in matrix tool
315  int nAllPars = allAlignPars.size();
316  m_nSecndDeriv=0;
317  for (int ipar=0;ipar<nAllPars;ipar++) {
318 
319  // calculate first derivative
320  Amg::MatrixX derivativesT = (*allDerivatives[ipar]).transpose();
321  ATH_MSG_DEBUG("derivativesT (size "<<derivativesT.cols()<<"): "<<derivativesT);
322 
323  Amg::MatrixX RHM= weightsFirstDeriv * residuals;
324  ATH_MSG_DEBUG("RHM: "<<RHM);
325 
326  // get global parameter index
327  int index1 = allAlignPars[ipar]->index();
328 
329  Amg::MatrixX firstderivM = 2.* derivativesT * RHM;
330  ATH_MSG_DEBUG("firstderivM for i="<<index1 <<firstderivM);
331  if (firstderivM(0,0)==0.) {
332  ATH_MSG_DEBUG("firstderivM[0][0] is zero : "<<firstderivM(0,0));
333  continue;
334  }
335 
336 
337 
338  // tree variables
341  ATH_MSG_DEBUG("ipar: "<<ipar<<", m_nMatrixIndices="<<m_nMatrixIndices);
342  if (m_writeActualSecDeriv) {
343  ATH_MSG_DEBUG("alActualSecDeriv size: "<<allActualSecDeriv.size());
344  m_actualSecndDeriv[m_nMatrixIndices]=allActualSecDeriv[ipar];
345  }
347  }
348 
349  // get module index
350  int imodule1 = allAlignPars[ipar]->alignModule()->identifyHash();
351 
352  // calculate second derivatives
353  bool goodSecondDeriv = true;
354  for (int jpar=ipar;jpar<nAllPars;jpar++) {
355 
356  // get global parameter index
357  int index2=allAlignPars[jpar]->index();
358 
359  // get module index
360  int imodule2 = allAlignPars[jpar]->alignModule()->identifyHash();
361 
362  // if only local Chi2 method is used, the 2nd derivatives (correlations)
363  // between different modules don't need to be calculated/stored
365  if (imodule1 != imodule2)
366  continue;
367 
368  Amg::MatrixX RHM2 = weights * (*allDerivatives[jpar]);
369  Amg::MatrixX secondderivM = 2. * derivativesT * RHM2;
370 
371  // if second derivative on diagonal is below cut
372  // ignore the whole row/column
373  if (jpar==ipar && secondderivM(0,0)<0.) {
374  ATH_MSG_WARNING("second deriv < 0 !!!");
375  }
376  if (jpar==ipar && secondderivM(0,0)<m_secondDerivativeCut) {
377  ATH_MSG_DEBUG("secondderivM[0][0] is below threshold : "<<
378  secondderivM(0,0)<<" < "<<m_secondDerivativeCut);
379  goodSecondDeriv = false;
380  break;
381  }
382 
383  ATH_MSG_DEBUG("secondderivM for i "<<index1<<", j "<<index2<<": "<<secondderivM(0,0));
384  m_matrixTool->addSecondDerivative(index1, index2, secondderivM(0,0));
385 
386  // store derivatives and indices for ntuple
387  m_secndDeriv[m_nSecndDeriv]=secondderivM(0,0);
388  m_nSecndDeriv++;
389  }
390 
391  // if second derivative on diagonal didn't pass the cut,
392  // ignore also the first derivative
393  if (goodSecondDeriv) {
394  m_matrixTool->addFirstDerivative(index1, firstderivM(0,0));
395  m_firstDeriv[ipar]=firstderivM(0,0);
396  }
397  else
398  m_firstDeriv[ipar]=-999.;
399  }
400 
401 
402 
403 
404  if( fullVertex ) { // this track is associated to a vertex.
405 
406 
407  ATH_MSG_DEBUG( "accumulate: Contribution from the fullVTX will be added " );
408 
409  Amg::MatrixX RHM = (*ptrCovariance) * (matrix_F) * (weightsFirstDeriv * residuals);
410 
411  std::vector<AlignPar*> vtxAlignPars;
412  std::vector<const Amg::VectorX*> vtxDerivatives;
413 
414  // get all alignPars and all derivatives
415  msg(MSG::DEBUG) << "accumulate: The Vertex derivative vector size is " << ptrX->size() << endmsg;
416  std::vector<AlignModuleVertexDerivatives>::const_iterator XIt = ptrX->begin();
417  std::vector<AlignModuleVertexDerivatives>::const_iterator XIt_end = ptrX->end();
418 
419  for ( ; XIt!=XIt_end ; ++XIt) {
420 
421  // get AlignModule
422  const AlignModule* module=XIt->first;
423 
424  // get alignment parameters
425  const std::vector<Amg::VectorX>& X_vec = XIt->second;
426  msg(MSG::DEBUG) << "accumulate: The X_vec size is " << X_vec.size() << endmsg;
427  DataVector<AlignPar>* alignPars = m_alignModuleTool->getAlignPars(module);
428  int nModPars = alignPars->size();
429  if (nModPars != (int)X_vec.size()) {
430  ATH_MSG_ERROR("accumulate: wrong size of the X_vec!");
431  return false;
432  }
433 
434  // get derivatives and derivative errors
435  for (int i=0;i<nModPars;i++) {
436  ATH_MSG_DEBUG("align par for module "<<(*alignPars)[i]->alignModule()->identify());
437  vtxAlignPars.push_back((*alignPars)[i]);
438  vtxDerivatives.push_back(&X_vec[i]);
439  }
440 
441  }
442 
443  // bit responsible for the constraint:
444  int ierr(0);
445  AmgSymMatrix(3) Qinv;
446  Qinv.setZero();
447  Amg::Vector3D vtemp;
448  vtemp.setZero();
449  if( vtxType==AlignVertex::Refitted && ptrVertex->Constrained() && ptrVertex->Qmatrix()->determinant() > 1.0e-24 ) { // just my guess sigma>0.1 micron ???) only once per vertex!
450 
451  bool invertible;
452  double determinant;
453  ptrVertex->Qmatrix()->computeInverseAndDetWithCheck(Qinv,determinant,invertible);
454 
455  if(!invertible) {
456  std::cout <<"accumulate: Q inversion failed. CLHEP status flag = "<<ierr<< std::endl;
457  return false;
458  }
459  vtemp(0) = -ptrVertex->originalPosition()->x()+(*(ptrVertex->Vvector()))(0);
460  vtemp(1) = -ptrVertex->originalPosition()->y()+(*(ptrVertex->Vvector()))(1);
461  vtemp(2) = -ptrVertex->originalPosition()->z()+(*(ptrVertex->Vvector()))(2);
462  }
463 
464 
465  // determine all derivatives and set in matrix tool
466  int nvtxPars = vtxAlignPars.size();
467  for (int ipar=0;ipar<nvtxPars;ipar++) {
468 
469  // calculate first derivative
470  Amg::MatrixX derivativesT = (*vtxDerivatives[ipar]).transpose();
471  Amg::MatrixX firstderivM = -2.* derivativesT * RHM; // -2 seems correct :)
472 
473  // bit responsible for the constraint:
474  if( vtxType==AlignVertex::Refitted && ptrVertex->Constrained() && ptrVertex->Qmatrix()->determinant() > 1.0e-24 ) { // just my guess sigma>0.1 micron ???) only once per vertex!
475  firstderivM += 2.* derivativesT * ((*ptrCovariance) * Qinv) * vtemp;
476  }
477 
478  // get global parameter index
479  int index1 = vtxAlignPars[ipar]->index();
480 
481  ATH_MSG_DEBUG("vtx firstderivM for i="<<index1 <<firstderivM);
482 
483 
484  if( vtxType==AlignVertex::Refitted ) { // only once per vertex!
485  ATH_MSG_DEBUG("accumulate: Filling second derivative for this vertex... ");
486  for (int jpar=0;jpar<nvtxPars;jpar++) {
487 
488  // calculate second derivative
489  Amg::MatrixX secondderivM = -1.* derivativesT * (*ptrCovariance) * (*vtxDerivatives[jpar]); // -1 is the right factor :)
490 
491  // bit responsible for the constraint:
492  if( ptrVertex->Constrained() && ptrVertex->Qmatrix()->determinant() > 1.0e-24 ) { // just my guess sigma>0.1 micron ???)
493  secondderivM += 2.* derivativesT * ((*ptrCovariance) * Qinv * (*ptrCovariance)) * (*vtxDerivatives[jpar]);
494  }
495 
496  // get global parameter index
497  int index2=vtxAlignPars[jpar]->index();
498 
499  if( index1<=index2 ) {
500  ATH_MSG_DEBUG("vtx secondderivM for i="<<index1<<", j="<<index2<<": "<<secondderivM(0,0));
501  m_matrixTool->addSecondDerivative(index1, index2, secondderivM(0,0));
502  }
503 
504  }
505  ptrVertex->setType(AlignVertex::Accumulated); // only once per vertex!
506  }
507 
508  m_matrixTool->addFirstDerivative(index1, firstderivM(0,0));
509 
510  }
511 
512  }
513 
514 
515 
516 
517 
518  // fill tree
519  if (m_tree) {
520 
521  // get tree variables
522  const xAOD::EventInfo* currentEvent;
523  StatusCode sc = evtStore()->retrieve(currentEvent);
524  if (sc==StatusCode::SUCCESS) {
525  m_run = currentEvent->runNumber();
526  m_event = currentEvent->eventNumber();
527  }
528  else {
529  m_run = -999;
530  m_event = -999;
531  }
532 
533  m_materialOnTrack=getMaterialOnTrack(alignTrack->originalTrack());
534  ATH_MSG_DEBUG("materialOnTrack: "<<m_materialOnTrack);
535 
536  double pT=alignTrack->originalTrack()->perigeeParameters()->pT();
537  double eta=alignTrack->originalTrack()->perigeeParameters()->eta();
538  m_momentum=std::fabs(pT)*std::sqrt(1.+sinh(eta)*sinh(eta));
539  m_eta=eta;
540  m_phi=alignTrack->originalTrack()->perigeeParameters()->momentum().phi();
541 
542  Amg::Vector3D pos=alignTrack->originalTrack()->perigeeParameters()->position();
543  m_perigee_x=pos.x();
544  m_perigee_y=pos.y();
545  m_perigee_z=pos.z();
546 
547  const TrackInfo info=alignTrack->originalTrack()->info();
548  m_trackInfo = (int)info.trackFitter();
549  m_bremFit = (int)info.trackProperties(Trk::TrackInfo::BremFit);
554  m_lowPtTrack = (int)info.trackProperties(Trk::TrackInfo::LowPtTrack);
555 
556  m_ntuple->cd();
557  m_tree->Fill();
558  }
559 
560  // increment total number of accumulated tracks, hits and the total chi2
561  m_ntracks++;
562  m_nmeas += alignTrack->nAlignTSOSMeas();
563  m_nhits += alignTrack->alignTSOSCollection()->size();
564  m_chi2 += alignTrack->fitQuality()->chiSquared();
565  m_nDoF += alignTrack->fitQuality()->numberDoF();
566 
567  if(m_ntracks%50==0)
568  ATH_MSG_INFO(">>>> Number of accumulated tracks: "<<m_ntracks);
569 
570  return true;
571  }

◆ accumulateFromFiles()

bool GlobalChi2AlignTool::accumulateFromFiles ( )
virtual

accumulates information from binary files

Implements Trk::IAlignTool.

Definition at line 574 of file GlobalChi2AlignTool.cxx.

575  {
576  ATH_MSG_DEBUG("in accumulate");
577  bool success = m_matrixTool->accumulateFromFiles();
578 
579  if (!success) {
580  ATH_MSG_FATAL("failure in MatrixTool accumulateFromFiles");
581  return false;
582  }
583 
584  m_fromFiles = true;
585 
586  return true;
587  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ fillNtuple()

StatusCode GlobalChi2AlignTool::fillNtuple ( )
virtual

writes tree to ntuple

Reimplemented from Trk::IAlignTool.

Definition at line 630 of file GlobalChi2AlignTool.cxx.

631  {
632  ATH_MSG_DEBUG("writing tree");
633  int success=1;
634  if (m_tree) {
635  m_ntuple->cd();
636  success = m_tree->Write();
637  }
638  return success>0 ? StatusCode::SUCCESS : StatusCode::FAILURE;
639  }

◆ finalize()

StatusCode GlobalChi2AlignTool::finalize ( )
virtual

finalize

Definition at line 642 of file GlobalChi2AlignTool.cxx.

643  {
644  ATH_MSG_DEBUG("finalize() of GlobalChi2AlignTool");
645  return StatusCode::SUCCESS;
646  }

◆ firstEventInitialize()

StatusCode GlobalChi2AlignTool::firstEventInitialize ( )
virtual

sets up matrix

Implements Trk::IAlignTool.

Definition at line 126 of file GlobalChi2AlignTool.cxx.

127  {
128  ATH_MSG_DEBUG("in GlobalGhi2AlignTool::firstEventInitialize()");
129 
130  int nDoF=m_alignModuleTool->nAlignParameters();
131  ATH_MSG_DEBUG("allocating matrix with "<<nDoF<<" degrees of freedom");
132 
133  if( m_matrixTool->allocateMatrix(nDoF).isFailure()) {
134  msg(MSG::FATAL)<<"Problem with allocateMatrix"<<endmsg;
135  return StatusCode::FAILURE;
136  }
137  ATH_MSG_DEBUG("done with firstEventInitialize()");
138 
139  return StatusCode::SUCCESS;
140  }

◆ getMaterialOnTrack()

double GlobalChi2AlignTool::getMaterialOnTrack ( const Trk::Track track)
private

Definition at line 649 of file GlobalChi2AlignTool.cxx.

650  {
651 
652  double materialOnTrack(0.);
653 
654  const Trk::TrackStates* states = track->trackStateOnSurfaces();
655  if ( !states ) {
656  ATH_MSG_WARNING("no states");
657  return 0;
658  }
659 
660  // loop over TSOSs, find MDT hits, and mark them as outliers:
662  Trk::TrackStates::const_iterator tsit_end = states->end();
663  ATH_MSG_DEBUG("looping over TSOS");
664 
665  for ( ; tsit!=tsit_end ; ++tsit ) {
666  const Trk:: MaterialEffectsBase* materialEffects = (*tsit)->materialEffectsOnTrack();
667  if (materialEffects) {
668  const Trk::MaterialEffectsOnTrack* meot=dynamic_cast<const Trk::MaterialEffectsOnTrack*>(materialEffects);
669  if (meot) {
670  materialOnTrack += meot->thicknessInX0();
671  ATH_MSG_DEBUG("new materialOnTrack: "<<materialOnTrack);
672  }
673  else {
674  ATH_MSG_DEBUG("not material on track");
675  }
676  }
677  }
678 
679  return materialOnTrack;
680  }

◆ initialize()

StatusCode GlobalChi2AlignTool::initialize ( )
virtual

initialize

Definition at line 109 of file GlobalChi2AlignTool.cxx.

110  {
111  ATH_MSG_DEBUG("initialize() of GlobalChi2AlignTool");
112  // Get MatrixTool
113  ATH_CHECK( m_matrixTool.retrieve() );
114  ATH_CHECK(m_alignModuleTool.retrieve() );
115  return StatusCode::SUCCESS;
116  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ interfaceID()

const InterfaceID & IAlignTool::interfaceID ( )
inlinestaticinherited

Definition at line 58 of file IAlignTool.h.

58  {
59  return IID_TRK_IAlignTool;
60  }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

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

◆ nAccumulatedTracks()

unsigned int Trk::GlobalChi2AlignTool::nAccumulatedTracks ( )
inline

returns total number of accumulated tracks

Definition at line 68 of file GlobalChi2AlignTool.h.

68 { return m_ntracks; };

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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  }

◆ setLogStream()

void GlobalChi2AlignTool::setLogStream ( std::ostream *  os)
virtual

sets the output stream for the logfile

Reimplemented from Trk::IAlignTool.

Definition at line 119 of file GlobalChi2AlignTool.cxx.

120  {
121  m_logStream = os;
122  m_matrixTool->setLogStream(m_logStream);
123  }

◆ setNtuple()

void Trk::GlobalChi2AlignTool::setNtuple ( TFile *  ntuple)
inlinevirtual

set ntuple

Reimplemented from Trk::IAlignTool.

Definition at line 71 of file GlobalChi2AlignTool.h.

71 { m_ntuple=ntuple; }

◆ solve()

StatusCode GlobalChi2AlignTool::solve ( )
virtual

solves for alignment parameters

Implements Trk::IAlignTool.

Definition at line 590 of file GlobalChi2AlignTool.cxx.

591  {
592  if(m_fromFiles)
593  m_nhits = m_matrixTool->nHits();
594  else {
595  m_matrixTool->setNTracks(m_ntracks);
596  m_matrixTool->setNMeasurements(m_nmeas);
597  m_matrixTool->setNHits(m_nhits);
598  }
599 
600  // print statistics
601  if(m_logStream) {
602  *m_logStream<<"*************************************************************"<<std::endl;
603  *m_logStream<<"****** Global Chi2 alignment solving ******"<<std::endl;
604  *m_logStream<<"*"<<std::endl;
605  if(!m_fromFiles)
606  *m_logStream<<"* number of accumulated tracks: "<<m_ntracks<<std::endl;
607  *m_logStream<<"* number of processed hits: "<<m_nhits<<std::endl;
608  if(!m_fromFiles) {
609  *m_logStream<<"* number of used measurements: "<<m_nmeas<<std::endl;
610  *m_logStream<<"* total chi2 / nDoF: "<<m_chi2<<" / "<<m_nDoF<<std::endl;
611  }
612  *m_logStream<<"*"<<std::endl;
613  *m_logStream<<"* number of alignable objects: "<<m_alignModuleTool->alignModules1D()->size()<<std::endl;
614  *m_logStream<<"* total number of alignment DoFs: "<<m_alignModuleTool->nAlignParameters()<<std::endl;
615  *m_logStream<<"*"<<std::endl;
616  }
617 
618  ATH_MSG_INFO(">>>> -----------------------------------------------");
619  ATH_MSG_INFO(">>>> Total number of accumulated tracks: "<<m_ntracks);
620  ATH_MSG_INFO(">>>> -----------------------------------------------");
621 
622  ATH_MSG_DEBUG("calling matrixTool->solve()");
623  if (m_matrixTool->solve()>0)
624  return StatusCode::SUCCESS;
625 
626  return StatusCode::FAILURE;
627  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_actualSecndDeriv

double* Trk::GlobalChi2AlignTool::m_actualSecndDeriv
private

Definition at line 118 of file GlobalChi2AlignTool.h.

◆ m_alignModuleTool

ToolHandle<Trk::IAlignModuleTool> Trk::GlobalChi2AlignTool::m_alignModuleTool
private

Pointer to AlignModuleTool.

Definition at line 87 of file GlobalChi2AlignTool.h.

◆ m_bremFit

int Trk::GlobalChi2AlignTool::m_bremFit
private

Definition at line 125 of file GlobalChi2AlignTool.h.

◆ m_bremFitSuccessful

int Trk::GlobalChi2AlignTool::m_bremFitSuccessful
private

Definition at line 126 of file GlobalChi2AlignTool.h.

◆ m_chamberIds

int* Trk::GlobalChi2AlignTool::m_chamberIds
private

Definition at line 112 of file GlobalChi2AlignTool.h.

◆ m_chi2

double Trk::GlobalChi2AlignTool::m_chi2
private

total chi2

Definition at line 96 of file GlobalChi2AlignTool.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doTree

bool Trk::GlobalChi2AlignTool::m_doTree
private

Definition at line 100 of file GlobalChi2AlignTool.h.

◆ m_eta

double Trk::GlobalChi2AlignTool::m_eta
private

Definition at line 119 of file GlobalChi2AlignTool.h.

◆ m_event

int Trk::GlobalChi2AlignTool::m_event
private

Definition at line 108 of file GlobalChi2AlignTool.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_firstDeriv

double* Trk::GlobalChi2AlignTool::m_firstDeriv
private

Definition at line 117 of file GlobalChi2AlignTool.h.

◆ m_fromFiles

bool Trk::GlobalChi2AlignTool::m_fromFiles
private

Definition at line 132 of file GlobalChi2AlignTool.h.

◆ m_hardScatterOrKink

int Trk::GlobalChi2AlignTool::m_hardScatterOrKink
private

Definition at line 129 of file GlobalChi2AlignTool.h.

◆ m_logStream

std::ostream* Trk::IAlignTool::m_logStream
protectedinherited

logfile output stream

Definition at line 54 of file IAlignTool.h.

◆ m_lowPtTrack

int Trk::GlobalChi2AlignTool::m_lowPtTrack
private

Definition at line 130 of file GlobalChi2AlignTool.h.

◆ m_materialOnTrack

double Trk::GlobalChi2AlignTool::m_materialOnTrack
private

Definition at line 109 of file GlobalChi2AlignTool.h.

◆ m_matrixIndices

int* Trk::GlobalChi2AlignTool::m_matrixIndices
private

Definition at line 114 of file GlobalChi2AlignTool.h.

◆ m_matrixTool

ToolHandle<Trk::IMatrixTool> Trk::GlobalChi2AlignTool::m_matrixTool
private

Pointer to MatrixTool, used to write to and solve matrix.

Definition at line 84 of file GlobalChi2AlignTool.h.

◆ m_momentum

double Trk::GlobalChi2AlignTool::m_momentum
private

Definition at line 110 of file GlobalChi2AlignTool.h.

◆ m_nChambers

int Trk::GlobalChi2AlignTool::m_nChambers
private

Definition at line 111 of file GlobalChi2AlignTool.h.

◆ m_nDoF

unsigned int Trk::GlobalChi2AlignTool::m_nDoF
private

number of degrees of freedom

Definition at line 97 of file GlobalChi2AlignTool.h.

◆ m_nhits

unsigned int Trk::GlobalChi2AlignTool::m_nhits
private

number of accumulated hits

Definition at line 95 of file GlobalChi2AlignTool.h.

◆ m_nMatrixIndices

int Trk::GlobalChi2AlignTool::m_nMatrixIndices
private

Definition at line 113 of file GlobalChi2AlignTool.h.

◆ m_nmeas

unsigned int Trk::GlobalChi2AlignTool::m_nmeas
private

number of accumulated measurements

Definition at line 94 of file GlobalChi2AlignTool.h.

◆ m_nSecndDeriv

int Trk::GlobalChi2AlignTool::m_nSecndDeriv
private

Definition at line 115 of file GlobalChi2AlignTool.h.

◆ m_ntracks

unsigned int Trk::GlobalChi2AlignTool::m_ntracks
private

number of accumulated tracks

Definition at line 93 of file GlobalChi2AlignTool.h.

◆ m_ntuple

TFile* Trk::GlobalChi2AlignTool::m_ntuple
private

output ntuple

Definition at line 105 of file GlobalChi2AlignTool.h.

◆ m_pathbin

std::string Trk::GlobalChi2AlignTool::m_pathbin
private

path binary files (in/out)

Definition at line 89 of file GlobalChi2AlignTool.h.

◆ m_pathtxt

std::string Trk::GlobalChi2AlignTool::m_pathtxt
private

path ascii files (in/out)

Definition at line 90 of file GlobalChi2AlignTool.h.

◆ m_perigee_x

double Trk::GlobalChi2AlignTool::m_perigee_x
private

Definition at line 121 of file GlobalChi2AlignTool.h.

◆ m_perigee_y

double Trk::GlobalChi2AlignTool::m_perigee_y
private

Definition at line 122 of file GlobalChi2AlignTool.h.

◆ m_perigee_z

double Trk::GlobalChi2AlignTool::m_perigee_z
private

Definition at line 123 of file GlobalChi2AlignTool.h.

◆ m_phi

double Trk::GlobalChi2AlignTool::m_phi
private

Definition at line 120 of file GlobalChi2AlignTool.h.

◆ m_prefixName

std::string Trk::GlobalChi2AlignTool::m_prefixName
private

prefix string to filenames

Definition at line 91 of file GlobalChi2AlignTool.h.

◆ m_run

int Trk::GlobalChi2AlignTool::m_run
private

Definition at line 107 of file GlobalChi2AlignTool.h.

◆ m_secndDeriv

double* Trk::GlobalChi2AlignTool::m_secndDeriv
private

Definition at line 116 of file GlobalChi2AlignTool.h.

◆ m_secondDerivativeCut

double Trk::GlobalChi2AlignTool::m_secondDerivativeCut
private

Definition at line 99 of file GlobalChi2AlignTool.h.

◆ m_slimmedTrack

int Trk::GlobalChi2AlignTool::m_slimmedTrack
private

Definition at line 128 of file GlobalChi2AlignTool.h.

◆ m_storeLocalDerivOnly

bool Trk::GlobalChi2AlignTool::m_storeLocalDerivOnly
private

Definition at line 102 of file GlobalChi2AlignTool.h.

◆ m_straightTrack

int Trk::GlobalChi2AlignTool::m_straightTrack
private

Definition at line 127 of file GlobalChi2AlignTool.h.

◆ m_trackInfo

int Trk::GlobalChi2AlignTool::m_trackInfo
private

Definition at line 124 of file GlobalChi2AlignTool.h.

◆ m_tree

TTree* Trk::GlobalChi2AlignTool::m_tree
private

Definition at line 106 of file GlobalChi2AlignTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeActualSecDeriv

bool Trk::GlobalChi2AlignTool::m_writeActualSecDeriv
private

Definition at line 101 of file GlobalChi2AlignTool.h.


The documentation for this class was generated from the following files:
Trk::IAlignTool::m_logStream
std::ostream * m_logStream
logfile output stream
Definition: IAlignTool.h:54
grepfile.info
info
Definition: grepfile.py:38
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::GlobalChi2AlignTool::m_fromFiles
bool m_fromFiles
Definition: GlobalChi2AlignTool.h:132
Trk::GlobalChi2AlignTool::m_lowPtTrack
int m_lowPtTrack
Definition: GlobalChi2AlignTool.h:130
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
Trk::AlignVertex::AlignVertexType
AlignVertexType
Definition: AlignVertex.h:43
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::GlobalChi2AlignTool::m_matrixIndices
int * m_matrixIndices
Definition: GlobalChi2AlignTool.h:114
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:32
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::GlobalChi2AlignTool::m_firstDeriv
double * m_firstDeriv
Definition: GlobalChi2AlignTool.h:117
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
DataVector::iterator
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
Definition: DataVector.h:841
Trk::GlobalChi2AlignTool::m_secondDerivativeCut
double m_secondDerivativeCut
Definition: GlobalChi2AlignTool.h:99
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::TrackInfo::BremFitSuccessful
@ BremFitSuccessful
A brem fit was performed on this track and this fit was successful.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:81
Trk::GlobalChi2AlignTool::m_perigee_z
double m_perigee_z
Definition: GlobalChi2AlignTool.h:123
Trk::AlignVertex::Unknown
@ Unknown
default type
Definition: AlignVertex.h:44
Trk::TrackInfo::LowPtTrack
@ LowPtTrack
A LowPt track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:93
Trk::GlobalChi2AlignTool::m_chamberIds
int * m_chamberIds
Definition: GlobalChi2AlignTool.h:112
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::MaterialEffectsBase::thicknessInX0
double thicknessInX0() const
returns the actually traversed material .
Trk::GlobalChi2AlignTool::m_perigee_y
double m_perigee_y
Definition: GlobalChi2AlignTool.h:122
Trk::AlignVertex::Accumulated
@ Accumulated
accumulated by the GX algorithm.
Definition: AlignVertex.h:47
Trk::GlobalChi2AlignTool::m_nChambers
int m_nChambers
Definition: GlobalChi2AlignTool.h:111
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::MaterialEffectsBase
base class to integrate material effects on Trk::Track in a flexible way.
Definition: MaterialEffectsBase.h:35
Trk::GlobalChi2AlignTool::m_bremFit
int m_bremFit
Definition: GlobalChi2AlignTool.h:125
Trk::GlobalChi2AlignTool::m_materialOnTrack
double m_materialOnTrack
Definition: GlobalChi2AlignTool.h:109
Trk::GlobalChi2AlignTool::m_trackInfo
int m_trackInfo
Definition: GlobalChi2AlignTool.h:124
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::GlobalChi2AlignTool::m_doTree
bool m_doTree
Definition: GlobalChi2AlignTool.h:100
Trk::GlobalChi2AlignTool::m_phi
double m_phi
Definition: GlobalChi2AlignTool.h:120
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::GlobalChi2AlignTool::m_chi2
double m_chi2
total chi2
Definition: GlobalChi2AlignTool.h:96
Trk::GlobalChi2AlignTool::m_momentum
double m_momentum
Definition: GlobalChi2AlignTool.h:110
Rec::nDoF
double nDoF(const Trk::Track &track)
Definition: OutwardsCombinedMuonTrackBuilder.cxx:31
Trk::TrackInfo::StraightTrack
@ StraightTrack
A straight track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:84
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
Trk::GlobalChi2AlignTool::m_matrixTool
ToolHandle< Trk::IMatrixTool > m_matrixTool
Pointer to MatrixTool, used to write to and solve matrix.
Definition: GlobalChi2AlignTool.h:84
Trk::TrackInfo::SlimmedTrack
@ SlimmedTrack
A slimmed track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:87
AlignModule
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
python.PyAthena.module
module
Definition: PyAthena.py:134
Trk::MaterialEffectsOnTrack
represents the full description of deflection and e-loss of a track in material.
Definition: MaterialEffectsOnTrack.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
Trk::GlobalChi2AlignTool::m_alignModuleTool
ToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
Pointer to AlignModuleTool.
Definition: GlobalChi2AlignTool.h:87
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::index1
@ index1
Definition: BoundarySurfaceFace.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
urldecode::states
states
Definition: urldecode.h:39
Trk::GlobalChi2AlignTool::m_nDoF
unsigned int m_nDoF
number of degrees of freedom
Definition: GlobalChi2AlignTool.h:97
Trk::GlobalChi2AlignTool::m_slimmedTrack
int m_slimmedTrack
Definition: GlobalChi2AlignTool.h:128
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::MAXNCHAMBERS
constexpr int MAXNCHAMBERS
Definition: GlobalChi2AlignTool.cxx:38
Trk::GlobalChi2AlignTool::m_hardScatterOrKink
int m_hardScatterOrKink
Definition: GlobalChi2AlignTool.h:129
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::TrackInfo::BremFit
@ BremFit
A brem fit was performed on this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:78
Trk::GlobalChi2AlignTool::m_tree
TTree * m_tree
Definition: GlobalChi2AlignTool.h:106
DataVector< AlignPar >
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Trk::GlobalChi2AlignTool::m_ntracks
unsigned int m_ntracks
number of accumulated tracks
Definition: GlobalChi2AlignTool.h:93
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
Trk::GlobalChi2AlignTool::m_ntuple
TFile * m_ntuple
output ntuple
Definition: GlobalChi2AlignTool.h:105
Trk::MAXNINDICES
constexpr int MAXNINDICES
Definition: GlobalChi2AlignTool.cxx:39
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Trk::index2
@ index2
Definition: BoundarySurfaceFace.h:49
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trk::GlobalChi2AlignTool::m_actualSecndDeriv
double * m_actualSecndDeriv
Definition: GlobalChi2AlignTool.h:118
Trk::TrackInfo::HardScatterOrKink
@ HardScatterOrKink
A track with a kink or a hard scatter.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:90
Trk::GlobalChi2AlignTool::getMaterialOnTrack
double getMaterialOnTrack(const Trk::Track *track)
Definition: GlobalChi2AlignTool.cxx:649
Trk::GlobalChi2AlignTool::m_nhits
unsigned int m_nhits
number of accumulated hits
Definition: GlobalChi2AlignTool.h:95
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
Trk::GlobalChi2AlignTool::m_nmeas
unsigned int m_nmeas
number of accumulated measurements
Definition: GlobalChi2AlignTool.h:94
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
Trk::GlobalChi2AlignTool::m_event
int m_event
Definition: GlobalChi2AlignTool.h:108
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::GlobalChi2AlignTool::m_secndDeriv
double * m_secndDeriv
Definition: GlobalChi2AlignTool.h:116
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::GlobalChi2AlignTool::m_storeLocalDerivOnly
bool m_storeLocalDerivOnly
Definition: GlobalChi2AlignTool.h:102
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
Trk::GlobalChi2AlignTool::m_run
int m_run
Definition: GlobalChi2AlignTool.h:107
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
Trk::GlobalChi2AlignTool::m_writeActualSecDeriv
bool m_writeActualSecDeriv
Definition: GlobalChi2AlignTool.h:101
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
Trk::GlobalChi2AlignTool::m_eta
double m_eta
Definition: GlobalChi2AlignTool.h:119
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::GlobalChi2AlignTool::m_nMatrixIndices
int m_nMatrixIndices
Definition: GlobalChi2AlignTool.h:113
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Trk::GlobalChi2AlignTool::m_perigee_x
double m_perigee_x
Definition: GlobalChi2AlignTool.h:121
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::AlignVertex::Refitted
@ Refitted
normally refitted, without adding any pseudo-measurement
Definition: AlignVertex.h:46
AlignVertex
AlignVertex is a simple structure to store objects belonging to a vertex. Contains a pointer to the o...
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::GlobalChi2AlignTool::m_nSecndDeriv
int m_nSecndDeriv
Definition: GlobalChi2AlignTool.h:115
Trk::GlobalChi2AlignTool::m_bremFitSuccessful
int m_bremFitSuccessful
Definition: GlobalChi2AlignTool.h:126
fitman.k
k
Definition: fitman.py:528
Trk::GlobalChi2AlignTool::m_straightTrack
int m_straightTrack
Definition: GlobalChi2AlignTool.h:127
Amg::SymMatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > SymMatrixX
Definition: EventPrimitives.h:30