ATLAS Offline Software
AnalyticalDerivCalcTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TrkTrack/Track.h"
10 
13 
16 
21 #include "TrkAlignEvent/AlignPar.h"
23 
25 
27 
28 #include <string>
29 
30 namespace Trk {
31 
32  //________________________________________________________________________
34  const std::string & name,
35  const IInterface * parent)
37  , m_alignModuleTool("Trk::AlignModuleTool/AlignModuleTool")
38  , m_idHelper(nullptr)
39  , m_measTypeIdHelper(nullptr)
40  , m_residualType(HitOnly)
41  , m_residualTypeSet(false)
42  , m_storeDerivatives(false)
43  {
44  declareInterface<IDerivCalcTool>(this);
45 
46  declareProperty("AlignModuleTool", m_alignModuleTool);
47 
48  declareProperty("UseLocalSetting", m_useLocalSetting=false, "use local setup for the covariance matrix of the track");
49 
50  // Use constant errors for each sub-detector such that it's equivalent
51  // to minimize residual distance instead of minizing residual pull.
52  // This is only applied if m_useLocalSetting==true
53  declareProperty("UseIntrinsicPixelError", m_useIntrinsicPixelErrors, "use intrinsic errors for Pixel");
54  declareProperty("UseIntrinsicSCTError", m_useIntrinsicSCTErrors, "use intrinsic errors for SCT");
55  declareProperty("UseIntrinsicTRTError", m_useIntrinsicTRTErrors, "use intrinsic errors for TRT");
56 
57  declareProperty("StoreDerivatives", m_storeDerivatives, "store derivatives dr/da on AlignTSOS to be filled into ntuple");
58 
59  m_logStream = nullptr;
60  }
61 
62  //________________________________________________________________________
64  = default;
65 
66  //________________________________________________________________________
68  {
69  if (m_alignModuleTool.retrieve().isFailure()) {
70  msg(MSG::FATAL) << "Could not get " << m_alignModuleTool << endmsg;
71  return StatusCode::FAILURE;
72  }
73  ATH_MSG_INFO("Retrieved " << m_alignModuleTool);
74 
75  if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) {
76  msg(MSG::FATAL) << "Could not get AtlasDetectorID helper" << endmsg;
77  return StatusCode::FAILURE;
78  }
80 
81  return StatusCode::SUCCESS;
82  }
83 
84  //________________________________________________________________________
86  {
87  ATH_MSG_DEBUG("in AnalyticalDerivCalcTool::finalize()");
88  return StatusCode::SUCCESS;
89  }
90 
91  //________________________________________________________________________
93  {
95  checkResidualType(alignTrack);
96 
97  // create table of modules for checking whether the module
98  // is hit by the track or not
99  int nModules = m_alignModuleTool->alignModules1D()->size();
100  std::vector<bool> hitModules(nModules,false);
101 
102  // loop over AlignTSOSCollection,
103  // find modules that are in the AlignModuleList,
104  std::vector<AlignModule *> alignModules;
105  AlignTSOSCollection::iterator atsosItr = alignTrack->firstAtsos();
106  for (; atsosItr != alignTrack->lastAtsos(); ++atsosItr) {
107  AlignModule * module=(*atsosItr)->module();
108  if (module)
109  ATH_MSG_DEBUG("have ATSOS for module "<<module->identify());
110  else
111  ATH_MSG_DEBUG("no module!");
112 
113  if (!(*atsosItr)->isValid() || !module)
114  continue;
115 
116  // if the module is not yet in the list for this track, add it
117  if(!hitModules[module->identifyHash()]) {
118  hitModules[module->identifyHash()] = true;
119  alignModules.push_back(module);
120  }
121  }
122 
123  // Determine derivatives from shifting these modules
124  std::vector<AlignModuleDerivatives> * derivatives = new std::vector<AlignModuleDerivatives>;
125  std::vector<AlignModule *>::iterator moduleIt = alignModules.begin();
126  for ( ; moduleIt!=alignModules.end(); ++moduleIt) {
127  std::vector<Amg::VectorX> deriv_vec = getDerivatives(alignTrack,*moduleIt);
128  derivatives->push_back(make_pair(*moduleIt,deriv_vec));
129  }
130 
131  // alignTrack takes care of deleting the derivatives
132  ATH_MSG_DEBUG("setting matrix derivatives");
133  alignTrack->setDerivatives(derivatives);
134 
135  ATH_MSG_DEBUG("returning from setDerivatives");
136 
137  return true;
138  }
139 
140  //________________________________________________________________________
142  {
143  static std::once_flag flag;
144  std::call_once(flag, [&]() {
145  if(m_logStream) {
146  *m_logStream<<"*************************************************************"<<std::endl;
147  *m_logStream<<"*************************************************************"<<std::endl;
148  *m_logStream<<"*** *****"<<std::endl;
149 
151  *m_logStream<<"*** Running full LOCAL Chi2 method *****"<<std::endl;
152  else
153  *m_logStream<<"*** Running full GLOBAL Chi2 method *****"<<std::endl;
154 
155  *m_logStream<<"*** using analytical derivatives *****"<<std::endl;
156 
157  if(m_useLocalSetting) {
158  std::string resType = "HitOnly ";
160  resType = "Unbiased";
161  *m_logStream<<"*** with residual type: "<<resType<<" *****"<<std::endl;
162  }
163 
164  *m_logStream<<"*** *****"<<std::endl;
165  *m_logStream<<"*************************************************************"<<std::endl;
166  }
167  });
168 
169  // get inverse local error matrix of the track
170  const Amg::MatrixX * Vinv = alignTrack->localErrorMatrixInv();
171  if(!checkValidity(*Vinv)) {
172  ATH_MSG_WARNING("Inverse local error matrix is invalid, skipping the track");
173  return false;
174  }
175  ATH_MSG_DEBUG("V inverse (diagonal only):");
176  if (msgLvl(MSG::DEBUG)) {
177  for (int i=0;i<Vinv->rows();i++) msg()<<(*Vinv)(i,i)<<" ";
178  msg()<<endmsg;
179  }
180 
181  // ========================
182  // setup local chi2 method
183  // ========================
184  if (m_useLocalSetting) {
185  ATH_MSG_DEBUG("setting Residual covariance matrix for local method");
186 
187  // for local method we only need the Vinv
188  const Amg::MatrixX * Vinv = alignTrack->localErrorMatrixInv();
189  Amg::MatrixX * W = new Amg::MatrixX(*Vinv);
190 
191  // if we want to ignore the real errors of measurements for a particular subretector
192  // (we should add something similar for Muon detectors)
194 
196  ATH_MSG_DEBUG("Ignoring measured errors for Pixel clusters, using intrinsic errors");
198  ATH_MSG_DEBUG("Ignoring measured errors for SCT clusters, using intrinsic errors");
200  ATH_MSG_DEBUG("Ignoring measured errors for TRT clusters, using intrinsic errors");
201 
202  int index(0);
203  AlignTSOSCollection::const_iterator itAtsos = alignTrack->firstAtsos();
204  AlignTSOSCollection::const_iterator itAtsos_end = alignTrack->lastAtsos();
205  for ( ; itAtsos != itAtsos_end; ++itAtsos) {
206  const AlignTSOS * atsos = *itAtsos;
207  if (!atsos->isValid())
208  continue;
209 
211  (*W)(index,index) = 1./(0.05*0.05/12);
212  (*W)(index+1,index+1) = 1./(0.4*0.4/12);
213  }
215  (*W)(index,index) = 1./(0.1*0.1/12);
217  (*W)(index,index) = 1./(0.5*0.5/12);
218 
219  index += atsos->nResDim();
220  }
221  }
222 
223  ATH_MSG_DEBUG("setting local weight matrix W ( "<<W->rows()<<" x "<<W->cols()<<" ) (diagonal only):");
224  if (msgLvl(MSG::DEBUG)) {
225  for (int i=0;i<W->rows();i++) msg()<<(*W)(i,i)<<" ";
226  msg()<<endmsg;
227  }
228  alignTrack->setWeightMatrix(W);
229 
230  Amg::MatrixX * W1st = new Amg::MatrixX(*W);
231  alignTrack->setWeightMatrixFirstDeriv(W1st);
232 
233  return true;
234  }
235 
236  // ========================
237  // setup global chi2 method
238  // ========================
239 
240  // get the ingredients for calculating R = V - Q
241  const Amg::MatrixX * V = alignTrack->localErrorMatrix();
242  ATH_MSG_DEBUG("V ( "<<V->rows()<<" x "<<V->cols()<<" ) (diagonal only):");
243  if (msgLvl(MSG::DEBUG)) {
244  for (int i=0;i<V->rows();i++) msg()<<(*V)(i,i)<<" ";
245  msg()<<endmsg;
246  }
247 
248  const int outputdim = alignTrack->nAlignTSOSMeas();
249 
250  Amg::MatrixX Q(outputdim, outputdim); //symmetric matrix
251  if (!getTrkParamCovMatrix(alignTrack, Q))
252  return false;
253  ATH_MSG_DEBUG("Q ( "<<Q.rows()<<" x "<<Q.cols()<<" )");
254  ATH_MSG_DEBUG("Q: "<<Q);
255 
256  // calculate R
257  const Amg::MatrixX R = (*V) - Q;
258  if (!checkValidity(R)) {
259  ATH_MSG_WARNING("Matrix R = V - HCH is invalid, skipping the track");
260  return false;
261  }
262  ATH_MSG_DEBUG("R ( "<<R.rows()<<" x "<<R.cols()<<" )");
263  ATH_MSG_DEBUG("R: "<<R);
264 
265  // calculate weight matrix and set it
266  Amg::MatrixX * W = new Amg::MatrixX(outputdim,outputdim); //symmetric matrix
267  *W = ((*Vinv) * R * (*Vinv));
268 
269  if (!checkValidity(*W)) {
270  ATH_MSG_DEBUG("Weight matrix is invalid, skipping the track");
271  delete W;
272  return false;
273  }
274  ATH_MSG_DEBUG("setting weight: "<<(*W));
275  alignTrack->setWeightMatrix(W);
276 
277  // for 1st derivatives the weight matrix is just the V^-1
278  // it has been chacked above so no need to do it again
279  Amg::MatrixX * W1st = new Amg::MatrixX(*Vinv); //symmetric matrix
280  ATH_MSG_DEBUG("setting weight for 1st derivatives (diagonal only): ");
281  if (msgLvl(MSG::DEBUG)) {
282  for (int i=0;i<W1st->rows();i++) msg()<<(*W1st)(i,i)<<" ";
283  msg()<<endmsg;
284  }
285  alignTrack->setWeightMatrixFirstDeriv(W1st);
286 
287  return true;
288  }
289 
290  //________________________________________________________________________
291  bool AnalyticalDerivCalcTool::getTrkParamCovMatrix(const AlignTrack * alignTrack, Amg::MatrixX & Q /*symmetric matrix*/) const
292  {
293 
294  // get derivative matrices from fitter
295  const Amg::MatrixX * H0 = alignTrack->derivativeMatrix();
296  const Amg::MatrixX * C = alignTrack->fullCovarianceMatrix(); //symmetric matrix
297 
298  // H0 is a q0 x p matrix,
299  // C is a p x p matrix,
300  // q0 = number of tsos measurements
301  // p = number perigee params+2*nscat+nbrem
302 
303  if( H0==nullptr || C==nullptr) {
304  ATH_MSG_ERROR("no derivative matrix or cov matrix stored on AlignTrack!"
305  << "This should have been done in AlignTrackPreProcessor!"
306  << H0 << " " << C );
307  return false;
308  }
309 
310  ATH_MSG_DEBUG("H0 ( "<<H0->rows()<<" x "<<H0->cols()<<" )");
311  ATH_MSG_DEBUG("H0: "<<(*H0));
312  ATH_MSG_DEBUG("C ( "<<C->rows()<<" x "<<C->cols()<<" )");
313  ATH_MSG_DEBUG("C: "<<(*C));
314 
315 
316  int Csize(C->rows());
317  Amg::MatrixX CC(*C); // take a copy of C //symmetric matrix
318  int ierr(0);
319  bool amendC( !(alignTrack->refitD0() && alignTrack->refitZ0() &&
320  alignTrack->refitPhi() && alignTrack->refitTheta() &&
321  alignTrack->refitQovP()) );
322 
323  // amendC = true; // FUDGE!
324 
325  if( amendC ) {
326  // test with AlSymMat:
327  // build AlSymMat instance from
328  AlSymMat* CA = new AlSymMat(Csize);
329 
330  // take a copy of C:
331  for( int ii=0; ii<Csize; ++ii ) {
332  for( int jj=ii; jj<Csize; ++jj ) {
333  CA->elemr(ii,jj) = (*C)(ii,jj);
334  }
335  }
336 
337  // first inversion:
338  ierr = CA->invert();
339  if( ierr ) {
340  ATH_MSG_ERROR("First inversion of matrix CA failed with LAPACK status flag " << ierr);
341  return false;
342  } else {
343  // disable selected track parametrs (remove from refit).
344  // It is your duty to assure that corresponding constraints have been imposed!
345  if( !(alignTrack->refitD0()) ) {
346  for(int ii=0; ii<(Csize); ++ii) CA->elemr(0,ii)=0.0; // should do the trick. It is a CLHEP::HepSymMatrix!
347  CA->elemr(0,0)=1.0;
348  }
349  if( !(alignTrack->refitZ0()) ) {
350  for(int ii=0; ii<(Csize); ++ii) CA->elemr(1,ii)=0.0; // should do the trick. It is a CLHEP::HepSymMatrix!
351  CA->elemr(1,1)=1.0;
352  }
353  if( !(alignTrack->refitPhi()) ) {
354  for(int ii=0; ii<(Csize); ++ii) CA->elemr(2,ii)=0.0; // should do the trick. It is a CLHEP::HepSymMatrix!
355  CA->elemr(2,2)=1.0;
356  }
357  if( !(alignTrack->refitTheta()) ) {
358  for(int ii=0; ii<(Csize); ++ii) CA->elemr(3,ii)=0.0; // should do the trick. It is a CLHEP::HepSymMatrix!
359  CA->elemr(3,3)=1.0;
360  }
361  if( !(alignTrack->refitQovP()) ) {
362  for(int ii=0; ii<(Csize); ++ii) CA->elemr(4,ii)=0.0; // should do the trick. It is a CLHEP::HepSymMatrix!
363  CA->elemr(4,4)=1.0;
364  }
365 
366 
367  // invert back:
368  ierr = CA->invert();
369  if( ierr ) {
370  ATH_MSG_ERROR("Second inversion of matrix CA failed with LAPACK status flag " << ierr);
371  return false;
372  }
373 
374  // copy back to CC:
375  for( int ii=0; ii<Csize; ++ii ) {
376  for( int jj=ii; jj<Csize; ++jj ) {
377  CC(ii,jj) = CA->elemc(ii,jj);
378  }
379  }
380 
381  // clear the disabled rows/collumns
382  if( !(alignTrack->refitD0()) ) for(int ii=0; ii<(Csize); ++ii){ CC(0,ii)=0.0; CC(ii,0)=0.0; }; // should do the trick.
383  if( !(alignTrack->refitZ0()) ) for(int ii=0; ii<(Csize); ++ii){ CC(1,ii)=0.0; CC(ii,1)=0.0; }; // should do the trick.
384  if( !(alignTrack->refitPhi()) ) for(int ii=0; ii<(Csize); ++ii){ CC(2,ii)=0.0; CC(ii,2)=0.0; }; // should do the trick.
385  if( !(alignTrack->refitTheta()) ) for(int ii=0; ii<(Csize); ++ii){ CC(3,ii)=0.0; CC(ii,3)=0.0; }; // should do the trick.
386  if( !(alignTrack->refitQovP()) ) for(int ii=0; ii<(Csize); ++ii){ CC(4,ii)=0.0; CC(ii,4)=0.0; }; // should do the trick.
387 
388 
389  }
390 
391  //garbage collection:
392  delete CA;
393  }
394 
395 
396 
397  int nMeas = H0->rows();
398  int nAtsos = alignTrack->nAlignTSOSMeas();
399  ATH_MSG_DEBUG("nMeas: "<<nMeas);
400 
401  //CLHEP::HepSymMatrix HCH(nMeas,0);
402  Amg::MatrixX HCH(nAtsos,nAtsos);
403  HCH = CC.similarity( *H0 );
404 
405  ATH_MSG_DEBUG("HCH ( "<<HCH.rows()<<" x "<<HCH.cols()<<" )");
406  ATH_MSG_DEBUG("HCH: "<<HCH);
407 
408  //
409  // get indices of HCH matrix corresponding to alignTSOSs in alignTrack
410  const AlignTSOSCollection * alignTSOSCollection = alignTrack->alignTSOSCollection();
411 
412  std::vector<int> matrixIndices(nMeas);
413 
414  int imeas(-1);
415  for (const TrackStateOnSurface* tsos : *alignTrack->trackStateOnSurfaces()){
416 
417  ATH_MSG_DEBUG("tsos: "<<tsos->dumpType());
418 
419  // get tsos and make sure it is a RIO_OnTrack
420  if (tsos->type(TrackStateOnSurface::Outlier))
421  continue;
422 
423  // RIO
424  if (!tsos->type(TrackStateOnSurface::Scatterer)) {
425  ATH_MSG_DEBUG("not scatterer, trying rio");
426 
427  const MeasurementBase * mesb = tsos->measurementOnTrack();
428  const RIO_OnTrack * rio = dynamic_cast<const RIO_OnTrack *>(mesb);
429  const CompetingRIOsOnTrack * crio = dynamic_cast<const CompetingRIOsOnTrack *>(mesb);
430  if (!rio && crio)
431  rio=&crio->rioOnTrack(0);
432 
433  if (rio==nullptr)
434  continue;
435 
436  ++imeas;
437  matrixIndices[imeas]=-1;
438 
439  Identifier tsosId = rio->identify();
440  ATH_MSG_DEBUG("have tsos with Id "<<tsosId);
441 
442  // get matching alignTSOS and store track index in goodMatrixIndices
443  int iameas(0);
444  for (const AlignTSOS* atsos : *alignTSOSCollection) {
445 
446  if (!atsos->isValid())
447  continue;
448 
449  if (atsos->type(TrackStateOnSurface::Scatterer))
450  ATH_MSG_ERROR("can't use scatterers on AlignTrack yet for analytical derivatives!");
451 
452  const RIO_OnTrack * atsos_rio = atsos->rio();
453  if (atsos_rio) {
454 // ATH_MSG_DEBUG("tsosId / atsosId : "<<tsosId<<" / "<<atsos_rio->identify());
455 
456  if (atsos_rio->identify()==tsosId) {
457  matrixIndices[imeas]=iameas;
458  ATH_MSG_DEBUG("matrixIndices["<<imeas<<"]="<<iameas);
459 
460  // for Pixel we have two measurements
461  if (atsos->nResDim()>1)
462  {
463  imeas++;
464  iameas++;
465  matrixIndices[imeas]=iameas;
466  ATH_MSG_DEBUG("matrixIndices["<<imeas<<"]="<<iameas);
467  }
468  break;
469  }
470  // for Pixel we have two measurements
471  else if(atsos->nResDim()>1)
472  iameas++;
473  }
474  iameas++;
475  }
476 
477  // even when the Pixel is not aligned we have to take into account
478  // that it has two measurements
479  if(matrixIndices[imeas]==-1 && m_measTypeIdHelper->defineType(mesb) == TrackState::Pixel) {
480  imeas++;
481  matrixIndices[imeas]=-1;
482  ATH_MSG_DEBUG("matrixIndices["<<imeas<<"]="<<matrixIndices[imeas]);
483  }
484 
485  } // end tsos==rio
486 
487  } // end loop over track tsos
488 
489  // strip elements in the HCH matrix which don't correspond
490  // to AlignTSOS on alignTrack
491  ATH_MSG_DEBUG("Filling the Q matrix:");
492  for (int k=0;k<nMeas;k++) {
493 
494  int iameas=matrixIndices[k];
495  if (iameas==-1)
496  continue;
497 
498  for (int l=0;l<nMeas;l++) {
499  int jameas=matrixIndices[l];
500  if (jameas==-1)
501  continue;
502 
503  Q(iameas,jameas) = HCH(k,l);
504 
505  }
506  }
507 
508  ATH_MSG_DEBUG("before check Q ( "<<Q.rows()<<" x "<<Q.cols()<<" )");
509  ATH_MSG_DEBUG("before check Q: "<<Q);
510 
511  if(!checkValidity(Q)) {
512  ATH_MSG_DEBUG("Matrix Q = HCH is invalid, skipping the track");
513  return false;
514  }
515 
516  return true;
517  }
518 
519  //________________________________________________________________________
520  // is this method used used anywhere? maybe we should remove it
521  bool AnalyticalDerivCalcTool::getMeasErrorMatrix(const AlignTrack* alignTrack, Amg::MatrixX& V /*Symmetric Matrix*/) const
522  {
523  int index(0);
524  AlignTSOSCollection::const_iterator itAtsos=alignTrack->firstAtsos();
525  for (; itAtsos != alignTrack->lastAtsos(); ++itAtsos) {
526 
527  std::vector<Residual>::const_iterator itRes=(**itAtsos).firstResidual();
528  for (; itRes!=(**itAtsos).lastResidual(); ++itRes,index++) {
529 
530  V(index,index) = itRes->errSq();
531  }
532  }
533  return checkValidity(V);
534  }
535 
536  //________________________________________________________________________
537  bool AnalyticalDerivCalcTool::checkValidity(const Amg::MatrixX& R /*symmetric matrix*/) const
538  {
539  // perform some sort of sanity check. depending on how many hits
540  // on the track we use, R can have zero determinant, but it
541  // should definitely not be negative. for now, we'll just check
542  // that all diagonal elements are positive and that all correlation
543  // coefficients are within bounds
544 
545  bool Risvalid(true);
546  const double epsilon=1e-10;
547  for( int irow=0; irow<R.rows(); ++irow) {
548 
549  Risvalid = Risvalid && R(irow,irow)>0;
550  if ( msgLvl(MSG::DEBUG) ) {
551  if( !(R(irow,irow)>0) )
552  msg(MSG::DEBUG) << "matrix invalid: (" << irow << "," << irow<<") = " << R(irow,irow) << endmsg;
553  }
554  else if (!Risvalid)
555  break;
556 
557  for(int icol=0; icol<=irow; ++icol) {
558  // this one must be true if everything else succeeded
559  double Rcorr = R(irow,icol)/sqrt(R(irow,irow)*R(icol,icol));
560  if( Rcorr+epsilon<-1 || Rcorr-epsilon>1 )
561  {
562  Risvalid = false;
563  if (msgLvl(MSG::DEBUG))
564  ATH_MSG_DEBUG("matrix corr invalid for (" << irow << "," << icol << ") Rcorr = " << Rcorr);
565  else
566  break;
567  }
568  }
569  }
570 
571  if( !Risvalid ) {
572  ATH_MSG_WARNING("Checked matrix is invalid.");
573  ATH_MSG_WARNING("R: \n"<<R);
574  }
575  return Risvalid;
576  }
577 
578  //________________________________________________________________________
579  std::vector<Amg::VectorX> AnalyticalDerivCalcTool::getDerivatives(AlignTrack * alignTrack, const AlignModule * module)
580  {
581  // module-specific transforms
582  Amg::Transform3D globalFrameToAlignFrame = module->globalFrameToAlignFrame();
583  ATH_MSG_DEBUG("globalFrameToAlignFrame: ");
584  ATH_MSG_DEBUG(globalFrameToAlignFrame(0,0)<<" "<<
585  globalFrameToAlignFrame(0,1)<<" "<<
586  globalFrameToAlignFrame(0,2));
587  ATH_MSG_DEBUG(globalFrameToAlignFrame(1,0)<<" "<<
588  globalFrameToAlignFrame(1,1)<<" "<<
589  globalFrameToAlignFrame(1,2));
590  ATH_MSG_DEBUG(globalFrameToAlignFrame(2,0)<<" "<<
591  globalFrameToAlignFrame(2,1)<<" "<<
592  globalFrameToAlignFrame(2,2));
593 
594  Amg::RotationMatrix3D globalToAlignFrameRotation = module->globalToAlignFrameRotation();
595  ATH_MSG_DEBUG("globalToAlignFrameRotation: ");
596  ATH_MSG_DEBUG(globalToAlignFrameRotation(0,0)<<" "<<
597  globalToAlignFrameRotation(0,1)<<" "<<
598  globalToAlignFrameRotation(0,2));
599  ATH_MSG_DEBUG(globalToAlignFrameRotation(1,0)<<" "<<
600  globalToAlignFrameRotation(1,1)<<" "<<
601  globalToAlignFrameRotation(1,2));
602  ATH_MSG_DEBUG(globalToAlignFrameRotation(2,0)<<" "<<
603  globalToAlignFrameRotation(2,1)<<" "<<
604  globalToAlignFrameRotation(2,2));
605 
606  DataVector<AlignPar> * alignPars = m_alignModuleTool->getAlignPars(module);
607  const int nAlignPar = alignPars->size();
608 
609  //Create derivatives storage vector and initialise them ro zero
610  std::vector<Amg::VectorX> derivatives( nAlignPar+3 , Amg::VectorX(alignTrack->nAlignTSOSMeas()));
611  for(int i(0); i<nAlignPar+3; ++i) derivatives[i].setZero();
612 
613  int imeas(0);
614  AlignTSOSCollection::iterator iatsos = alignTrack->firstAtsos();
615  for (; iatsos != alignTrack->lastAtsos(); ++iatsos) {
616 
617  AlignTSOS * alignTSOS = *iatsos;
618  if (!alignTSOS->isValid() || nullptr==alignTSOS->module())
619  continue;
620 
621  // we only calculate the derivatives if the AlignTSOS belongs to the align module
622  int nResDim = alignTSOS->nResDim();
623  if (alignTSOS->module() != module) {
624  imeas += nResDim;
625  continue;
626  }
627 
628  // derivatives to be stored on the AlignTSOS
629  std::vector<Amg::VectorX> * atsosDerivs = nullptr;
630  std::vector<Amg::VectorX> * atsosDerVtx = nullptr;
631  if (m_storeDerivatives) {
632  atsosDerivs = new std::vector<Amg::VectorX>(nResDim,Amg::VectorX(nAlignPar));
633  atsosDerVtx = new std::vector<Amg::VectorX>(nResDim,Amg::VectorX(3));
634  ATH_MSG_DEBUG("nResDim = "<<nResDim<<" vector size is "<<atsosDerivs->size());
635  ATH_MSG_DEBUG("nAlignPar = "<<nAlignPar<<" CLHEP::HepVector size is "<<atsosDerivs->at(0).rows());
636  }
637 
638  // Get the rotation to the frame in which the residual is
639  // defined. In this frame the trkdistance is the x-coordinate.
640 
641  const TrackParameters * mtp = alignTSOS->trackParameters();
642  if (!mtp || !(mtp->covariance()) ) continue;
643  Amg::RotationMatrix3D localToGlobalRotation = mtp->measurementFrame();
644 
645 
646  ATH_MSG_DEBUG( "localToGlobalRotation:");
647  ATH_MSG_DEBUG(localToGlobalRotation(0,0) << " " <<
648  localToGlobalRotation(0,1) << " " <<
649  localToGlobalRotation(0,2));
650  ATH_MSG_DEBUG(localToGlobalRotation(1,0) << " " <<
651  localToGlobalRotation(1,1) << " " <<
652  localToGlobalRotation(1,2));
653  ATH_MSG_DEBUG(localToGlobalRotation(2,0) << " " <<
654  localToGlobalRotation(2,1) << " " <<
655  localToGlobalRotation(2,2));
656 
657  if(double alphastrip=alignTSOS->alphaStrip()) {
658  ATH_MSG_DEBUG( "applying fanout rotation : " << alphastrip );
659  localToGlobalRotation = localToGlobalRotation * Amg::AngleAxis3D(alphastrip, Amg::Vector3D(0.,0.,1.));
660  ATH_MSG_DEBUG( "localToGlobalRotation * fanout_rotation:");
661  ATH_MSG_DEBUG(localToGlobalRotation(0,0) << " " <<
662  localToGlobalRotation(0,1) << " " <<
663  localToGlobalRotation(0,2));
664  ATH_MSG_DEBUG(localToGlobalRotation(1,0) << " " <<
665  localToGlobalRotation(1,1) << " " <<
666  localToGlobalRotation(1,2));
667  ATH_MSG_DEBUG(localToGlobalRotation(2,0) << " " <<
668  localToGlobalRotation(2,1) << " " <<
669  localToGlobalRotation(2,2));
670  }
671 
672  // get the position of the track in the alignmentframe.
673  Amg::Vector3D refPos = globalFrameToAlignFrame * alignTSOS->trackParameters()->position();
674  ATH_MSG_DEBUG("refPos: "<<refPos);
675 
676 
677  const Amg::RotationMatrix3D R = globalToAlignFrameRotation * localToGlobalRotation;
678  ATH_MSG_DEBUG("R:");
679  ATH_MSG_DEBUG(R(0,0) << " " << R(0,1) << " " << R(0,2));
680  ATH_MSG_DEBUG(R(1,0) << " " << R(1,1) << " " << R(1,2));
681  ATH_MSG_DEBUG(R(2,0) << " " << R(2,1) << " " << R(2,2));
682 
683  // In the SCT measurement frame:
684  // x --> perpendicular to strips in wafer plane
685  // y --> along strips in wafer plane
686  // z --> perpendicular to wafer plane
687 
688  // In the TRT measurement frame:
689  // x --> perpendicular to track and straw
690  // y --> along straw wire
691  // z --> perpendicular to x and y (but not parallel to track!)
692 
693  // now 'correct' for the track angle in the measurement frame.
694  const TrackParameters * trkpars = nullptr;
695  if(m_residualType == HitOnly) {
696  ATH_MSG_DEBUG("using BIASED track parameters");
697  trkpars = alignTSOS->trackParameters();
698  }
699  else {
700  ATH_MSG_DEBUG("using UNBIASED track parameters");
701  trkpars = alignTSOS->unbiasedTrackPars();
702  }
703 
704 
705  Amg::Vector3D trackdir = localToGlobalRotation.inverse() * trkpars->momentum();
706  ATH_MSG_DEBUG( "trackdir " << trackdir[0] << " " << trackdir[1] << " " << trackdir[2]);
707 
708  // for 1-dimensional measurements and Pixel-x
709  ATH_MSG_DEBUG( "trackdir.z(): " << trackdir.z() );
710  double cotphi_x = trackdir.x() / trackdir.z();
711 
712  // some 1D measurements are in Y direction (e.g. in CSC)
713  // so we need the other angle
714  if (alignTSOS->measDir() == Trk::y)
715  cotphi_x = trackdir.y() / trackdir.z();
716 
717 
718  double Rxx = R(0,0) - cotphi_x * R(0,2);
719  double Ryx = R(1,0) - cotphi_x * R(1,2);
720  double Rzx = R(2,0) - cotphi_x * R(2,2);
721  ATH_MSG_DEBUG("Rxx/Ryx/Rzx: " << Rxx << "/" << Ryx << "/" << Rzx);
722 
723  double projR[AlignModule::NTransformPar];
724  projR[AlignModule::TransX] = Rxx;
725  projR[AlignModule::TransY] = Ryx;
726  projR[AlignModule::TransZ] = Rzx;
727  projR[AlignModule::RotX] = -Ryx * refPos.z() + Rzx * refPos.y();
728  projR[AlignModule::RotY] = -Rzx * refPos.x() + Rxx * refPos.z();
729  projR[AlignModule::RotZ] = -Rxx * refPos.y() + Ryx * refPos.x();
730  projR[AlignModule::BowX] = 0;
731  projR[AlignModule::BowY] = 0;
732  projR[AlignModule::BowZ] = 0;
733 
755  const double localz = alignTSOS->trackParameters()->position().z(); // - globalToAlignFrameTranslation().z(); // the last term to be doublechecked!
756  // stave length in the IBL -- we will see if there is a more generic way of doing this
757  const double z0z0 = 366.5*366.5;
758 
759  projR[AlignModule::BowX] = ( localz*localz - z0z0) / z0z0; // this formula should work for both L11 ans L16, sign to be checked!
760 
761 
762  // prepare derivatives w.r.t. the vertex position:
763  Amg::Vector3D RxLoc(Rxx, Ryx, Rzx);
764  Amg::Vector3D RxGlob=-1.0 * (globalToAlignFrameRotation.inverse() * RxLoc); // to be double checked!!!
765 
766  for (int ipar=0; ipar<nAlignPar; ipar++) {
767  const AlignPar * alignPar = (*alignPars)[ipar];
768  int paramType = alignPar->paramType();
769  //double sigma = alignPar->sigma();
770  ATH_MSG_DEBUG("ipar="<<ipar<<", paramType="<<paramType);
771  derivatives[ipar][imeas] = projR[paramType];//*sigma;
772  if (m_storeDerivatives)
773  (*atsosDerivs)[0][ipar] = projR[paramType];//*sigma;
774  }
775  // the dr/db bit:
776  for (int ipar=0; ipar<3; ipar++) {
777  derivatives[nAlignPar+ipar][imeas] = RxGlob[ipar];
778  if (m_storeDerivatives) (*atsosDerVtx)[0][ipar] = RxGlob[ipar];
779  }
780 
781  for (int i=0;i<nAlignPar+3;i++)
782  ATH_MSG_DEBUG("derivatives["<<i<<"]["<<imeas<<"]="<<derivatives[i][imeas]);
783 
784  imeas++;
785 
786  if (nResDim>1) {
787  // for Pixel the second measurement has to be corrected
788  // for the second angle
789  double cotphi_y = trackdir.y() / trackdir.z() ;
790  double Rxy = R(0,1) - cotphi_y * R(0,2) ;
791  double Ryy = R(1,1) - cotphi_y * R(1,2) ;
792  double Rzy = R(2,1) - cotphi_y * R(2,2) ;
793  ATH_MSG_DEBUG("Rxy/Ryy/Rzy: " << Rxy << "/" << Ryy << "/" << Rzy);
794 
795  projR[AlignModule::TransX] = Rxy;
796  projR[AlignModule::TransY] = Ryy;
797  projR[AlignModule::TransZ] = Rzy;
798  projR[AlignModule::RotX] = -Ryy * refPos.z() + Rzy * refPos.y();
799  projR[AlignModule::RotY] = -Rzy * refPos.x() + Rxy * refPos.z();
800  projR[AlignModule::RotZ] = -Rxy * refPos.y() + Ryy * refPos.x();
801 
802  //Possibly could add the bowing correction -- very weakly coupled to y residuals
803  projR[AlignModule::BowX] = 0;
804  projR[AlignModule::BowY] = 0;
805  projR[AlignModule::BowZ] = 0;
806 
807 
808  // prepare derivatives w.r.t. the vertex position:
809  Amg::Vector3D RyLoc(Rxy, Ryy, Rzy);
810  Amg::Vector3D RyGlob=-1.0 * (globalToAlignFrameRotation.inverse() * RyLoc); // to be double checked!!!
811 
812  for (int ipar=0; ipar<nAlignPar; ipar++) {
813  const AlignPar * alignPar = (*alignPars)[ipar];
814  int paramType = alignPar->paramType();
815  ATH_MSG_DEBUG("2nd dim, ipar="<<ipar<<", paramType="<<paramType);
816  //double sigma=alignPar->sigma();
817  derivatives[ipar][imeas] = projR[paramType];//*sigma;
818  if (m_storeDerivatives)
819  (*atsosDerivs)[1][ipar] = projR[paramType];//*sigma;
820  }
821 
822  // the dr/db bit:
823  for (int ipar=0; ipar<3; ipar++) {
824  derivatives[nAlignPar+ipar][imeas] = RyGlob[ipar];
825  if (m_storeDerivatives) (*atsosDerVtx)[1][ipar] = RyGlob[ipar];
826  }
827 
828  for (int i=0;i<nAlignPar+3;i++)
829  ATH_MSG_DEBUG("2nd dim: derivatives["<<i<<"]["<<imeas<<"]="<<derivatives[i][imeas]);
830 
831  imeas++;
832  }
833 
834  alignTSOS->setDerivatives(atsosDerivs);
835  alignTSOS->setDerivativesVtx(atsosDerVtx);
836  }
837  ATH_MSG_DEBUG("returning derivatives");
838  return derivatives;
839  }
840 
841  //________________________________________________________________________
843  {
844  // get first AlignTSOS of the AlignTrack
845  // this assumes that for unbiased or DCA residuals the scatterers
846  // and energy deposits are not included in the AlignTSOSSollection
847  const AlignTSOS * atsos = *(alignTrack->firstAtsos());
848 
849  // get residual type of the first residual
850  m_residualType = atsos->firstResidual()->residualType();
851  ATH_MSG_DEBUG("setting residualType to "<<m_residualType);
852 
853  m_residualTypeSet = true;
854  }
855 
856 } // end namespace
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::y
@ y
Definition: ParamDefs.h:62
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
Trk::AlignModule::BowY
@ BowY
Definition: AlignModule.h:54
Trk::AlignTSOS::measType
TrackState::MeasurementType measType() const
returns measurement type enum
Definition: AlignTSOS.h:80
AnalyticalDerivCalcTool.h
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::TrackState::Pixel
@ Pixel
Definition: TrackStateDefs.h:28
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
Trk::AlignTrack::refitZ0
bool refitZ0() const
Definition: AlignTrack.h:194
Trk::AlignTrack::refitQovP
bool refitQovP() const
Definition: AlignTrack.h:197
Trk::HitOnly
@ HitOnly
Definition: AlignResidualType.h:27
TrackParameters.h
Trk::AlignModule::TransZ
@ TransZ
Definition: AlignModule.h:54
Trk::TrackState::TRT
@ TRT
Definition: TrackStateDefs.h:30
MeasurementBase.h
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::AlignTrack::refitPhi
bool refitPhi() const
Definition: AlignTrack.h:195
CompetingRIOsOnTrack.h
Trk::AlignTSOS::isValid
bool isValid() const
Definition: AlignTSOS.h:74
Trk::AnalyticalDerivCalcTool::AnalyticalDerivCalcTool
AnalyticalDerivCalcTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AnalyticalDerivCalcTool.cxx:33
Trk::AnalyticalDerivCalcTool::m_useIntrinsicTRTErrors
bool m_useIntrinsicTRTErrors
use intrinsic errors for TRT
Definition: AnalyticalDerivCalcTool.h:80
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
TrackStateDefs.h
index
Definition: index.py:1
Trk::AnalyticalDerivCalcTool::getDerivatives
std::vector< Amg::VectorX > getDerivatives(AlignTrack *alignTrack, const AlignModule *module)
Definition: AnalyticalDerivCalcTool.cxx:579
JetTiledMap::W
@ W
Definition: TiledEtaPhiMap.h:44
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Trk::IDerivCalcTool::m_logStream
std::ostream * m_logStream
logfile output stream
Definition: IDerivCalcTool.h:76
Trk::AnalyticalDerivCalcTool::finalize
StatusCode finalize()
Definition: AnalyticalDerivCalcTool.cxx:85
Trk::AnalyticalDerivCalcTool::initialize
StatusCode initialize()
Definition: AnalyticalDerivCalcTool.cxx:67
Trk::AlignTSOS
Definition: AlignTSOS.h:37
Trk::AlignTrack::localErrorMatrixInv
const Amg::SymMatrixX * localErrorMatrixInv() const
inverse local error matrix, calculated by AlignTrack by calling atsos->hitDistanceVar()
Definition: AlignTrack.h:125
Trk::AlignTrack::refitTheta
bool refitTheta() const
Definition: AlignTrack.h:196
PixelModuleFeMask_create_db.nModules
nModules
Definition: PixelModuleFeMask_create_db.py:47
Trk::AlignModule
Definition: AlignModule.h:45
Trk::AnalyticalDerivCalcTool::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: AnalyticalDerivCalcTool.h:62
Trk::AnalyticalDerivCalcTool::~AnalyticalDerivCalcTool
virtual ~AnalyticalDerivCalcTool()
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::AnalyticalDerivCalcTool::m_residualTypeSet
bool m_residualTypeSet
do we have the residual type set?
Definition: AnalyticalDerivCalcTool.h:83
Trk::Unbiased
@ Unbiased
Definition: AlignResidualType.h:28
Trk::AlignTSOS::measDir
Trk::ParamDefs measDir() const
retrieve the measurement direction
Definition: AlignTSOS.h:128
AlSymMat.h
Trk::AlignTrack::localErrorMatrix
const Amg::SymMatrixX * localErrorMatrix() const
local error matrix, calculated by AlignTrack by calling atsos->hitDistanceVar()
Definition: AlignTrack.h:122
AlignResidualType.h
Trk::AlignPar::paramType
AlignModule::TransformParameters paramType() const
returns the type of parameter (i.e.
Definition: AlignPar.h:47
Trk::AlignTSOS::module
const AlignModule * module() const
accessor method for AlignModule to which tsos belongs
Definition: AlignTSOS.h:69
atlasStyleMacro.icol
int icol
Definition: atlasStyleMacro.py:13
Trk::AlSymMat
Definition: AlSymMat.h:26
Trk::AlignTrack::refitD0
bool refitD0() const
get refit flags
Definition: AlignTrack.h:193
AlignTSOS.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
Track.h
Trk::AnalyticalDerivCalcTool::m_useLocalSetting
bool m_useLocalSetting
use local setup for the covariance matrix of the track
Definition: AnalyticalDerivCalcTool.h:77
Trk::AlignModule::BowX
@ BowX
Definition: AlignModule.h:54
Trk::AnalyticalDerivCalcTool::checkResidualType
void checkResidualType(const AlignTrack *alignTrack)
Definition: AnalyticalDerivCalcTool.cxx:842
python.PyAthena.module
module
Definition: PyAthena.py:134
Trk::AlignTrack::derivativeMatrix
const Amg::MatrixX * derivativeMatrix() const
set and get derivative matrix
Definition: AlignTrack.h:173
Trk::AnalyticalDerivCalcTool::m_storeDerivatives
bool m_storeDerivatives
store derivatives on AlignTSOS to be filled into ntuple
Definition: AnalyticalDerivCalcTool.h:85
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Trk::CompetingRIOsOnTrack::rioOnTrack
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
Trk::AnalyticalDerivCalcTool::checkValidity
bool checkValidity(const Amg::MatrixX &R) const
Definition: AnalyticalDerivCalcTool.cxx:537
AlignTrack.h
Trk::AnalyticalDerivCalcTool::m_useIntrinsicSCTErrors
bool m_useIntrinsicSCTErrors
use intrinsic errors for SCT
Definition: AnalyticalDerivCalcTool.h:79
Trk::ParametersBase::measurementFrame
virtual Amg::RotationMatrix3D measurementFrame() const override=0
Return the measurement frame - this is needed for alignment, in particular for StraightLine and Perig...
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::AlignTrack::firstAtsos
AlignTSOSCollection::const_iterator firstAtsos() const
retrieve iterator pointer to first element in collection
Definition: AlignTrack.h:279
Trk::AlignTSOS::setDerivativesVtx
void setDerivativesVtx(std::vector< Amg::VectorX > *derivs)
setter for the derivatives w.r.t.
Definition: AlignTSOS.h:149
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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
master.flag
bool flag
Definition: master.py:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Trk::CompetingRIOsOnTrack
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
Definition: CompetingRIOsOnTrack.h:64
Trk::AlignPar
Definition: AlignPar.h:25
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::AlignModule::RotX
@ RotX
Definition: AlignModule.h:54
Trk::ParametersBase
Definition: ParametersBase.h:55
athena.CA
CA
Definition: athena.py:98
Trk::AnalyticalDerivCalcTool::m_alignModuleTool
ToolHandle< IAlignModuleTool > m_alignModuleTool
Definition: AnalyticalDerivCalcTool.h:60
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AlignModuleList.h
Trk::AlignTrack::setWeightMatrixFirstDeriv
void setWeightMatrixFirstDeriv(Amg::SymMatrixX *mat)
Definition: AlignTrack.h:162
Trk::AlignTSOS::unbiasedTrackPars
const TrackParameters * unbiasedTrackPars() const
returns pointer to unbiased track parameters if present
Definition: AlignTSOS.h:134
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
RIO_OnTrack.h
Trk::AlignTSOS::alphaStrip
double alphaStrip() const
returns strip angle for fan-out structured modules (SCT endcap)
Definition: AlignTSOS.h:122
Trk::MeasurementTypeID
classifies a MeasurementBase into one of the known inherited flavours or one of the detector types fo...
Definition: MeasurementTypeID.h:26
AlignModule.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::AlignTrack::nAlignTSOSMeas
int nAlignTSOSMeas() const
number of alignTSOS (including scatterers if included on AlignTrack
Definition: AlignTrack.h:128
Trk::AlignTrack
Definition: AlignTrack.h:41
Trk::AnalyticalDerivCalcTool::setResidualCovMatrix
bool setResidualCovMatrix(AlignTrack *alignTrack) const
sets residual covariance matrix
Definition: AnalyticalDerivCalcTool.cxx:141
Trk::AlignModule::TransX
@ TransX
Definition: AlignModule.h:54
Trk::AlignTrack::alignTSOSCollection
const AlignTSOSCollection * alignTSOSCollection() const
returns collection of alignTSOS
Definition: AlignTrack.h:267
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
MeasurementTypeID.h
DeMoScan.index
string index
Definition: DeMoScan.py:362
Trk::AnalyticalDerivCalcTool::m_useIntrinsicPixelErrors
bool m_useIntrinsicPixelErrors
use intrinsic errors for Pixel
Definition: AnalyticalDerivCalcTool.h:78
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
Trk::AlignTrack::setWeightMatrix
void setWeightMatrix(Amg::SymMatrixX *mat)
Definition: AlignTrack.h:157
Trk::AlignModule::NTransformPar
@ NTransformPar
Definition: AlignModule.h:55
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
Trk::AlignModule::RotY
@ RotY
Definition: AlignModule.h:54
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::AlignTSOS::setDerivatives
void setDerivatives(std::vector< Amg::VectorX > *derivs)
setter for the derivatives
Definition: AlignTSOS.h:146
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Trk::AlignTSOS::nResDim
int nResDim() const
returns number of measurement residual + scatterer residual dimensions
Definition: AlignTSOS.h:77
Trk::RIO_OnTrack::identify
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:155
Trk::AnalyticalDerivCalcTool::setDerivatives
bool setDerivatives(AlignTrack *alignTrack)
sets analytical partial derivatives of residuals w.r.t alignment parameters for TSOS on alignTrack.
Definition: AnalyticalDerivCalcTool.cxx:92
IAlignModuleTool.h
Trk::TrackStateOnSurface::Scatterer
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
Definition: TrackStateOnSurface.h:113
AlignPar.h
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition: GeoPrimitives.h:45
Trk::AnalyticalDerivCalcTool::getTrkParamCovMatrix
bool getTrkParamCovMatrix(const AlignTrack *alignTrack, Amg::MatrixX &HCH) const
Definition: AnalyticalDerivCalcTool.cxx:291
Trk::TrackState::SCT
@ SCT
Definition: TrackStateDefs.h:29
Trk::AlignTSOS::firstResidual
std::vector< Residual >::const_iterator firstResidual() const
returns first Residual iterator
Definition: AlignTSOS.h:104
AthAlgTool
Definition: AthAlgTool.h:26
Trk::AlignModule::RotZ
@ RotZ
Definition: AlignModule.h:54
Trk::AlignModule::BowZ
@ BowZ
Definition: AlignModule.h:54
Trk::AlignModule::TransY
@ TransY
Definition: AlignModule.h:54
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Trk::AlignTrack::fullCovarianceMatrix
const Amg::SymMatrixX * fullCovarianceMatrix() const
set and get full covariance matrix
Definition: AlignTrack.h:177
Trk::AnalyticalDerivCalcTool::m_measTypeIdHelper
MeasurementTypeID * m_measTypeIdHelper
Definition: AnalyticalDerivCalcTool.h:63
Trk::AnalyticalDerivCalcTool::m_residualType
int m_residualType
residual type to be used in the calculations
Definition: AnalyticalDerivCalcTool.h:82
Analysis::CC
@ CC
Definition: JpsiFinder.h:39
Trk::AnalyticalDerivCalcTool::getMeasErrorMatrix
bool getMeasErrorMatrix(const AlignTrack *alignTrack, Amg::MatrixX &V) const
Definition: AnalyticalDerivCalcTool.cxx:521
fitman.k
k
Definition: fitman.py:528
Trk::MeasurementTypeID::defineType
Trk::TrackState::MeasurementType defineType(const MeasurementBase *) const
createPerigee method - returned by object
Definition: MeasurementTypeID.cxx:20
Trk::AlignTrack::setDerivatives
void setDerivatives(std::vector< AlignModuleDerivatives > *vec)
Definition: AlignTrack.h:134
Trk::AlignTrack::lastAtsos
AlignTSOSCollection::const_iterator lastAtsos() const
returns iterator pointer to last element in collection
Definition: AlignTrack.h:280