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

This class implements a vertex fitting algorithm optimised for V0 finding. More...

#include <TrkV0VertexFitter.h>

Inheritance diagram for Trk::TrkV0VertexFitter:
Collaboration diagram for Trk::TrkV0VertexFitter:

Public Types

enum  FitError {
  FITOK, MATINV, NEGTRCHI2, MAXCHI2,
  MAXTRCHI2, NOTRKS, NOFIT
}
 

Public Member Functions

virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
 TrkV0VertexFitter (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~TrkV0VertexFitter ()
 standard destructor More...
 
virtual xAOD::Vertexfit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const Amg::Vector3D &startingPoint) const override
 Interface for xAOD::TrackParticle with Amg::Vector3D starting point. More...
 
virtual xAOD::Vertexfit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const std::vector< const xAOD::NeutralParticle * > &, const Amg::Vector3D &startingPoint) const override
 
virtual xAOD::Vertexfit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const xAOD::Vertex &constraint) const override
 Interface for xAOD::TrackParticle with xAOD::Vertex starting point. More...
 
virtual xAOD::Vertexfit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const std::vector< const xAOD::NeutralParticle * > &, const xAOD::Vertex &constraint) const override
 
virtual xAOD::Vertexfit (const std::vector< const xAOD::TrackParticle * > &vectorTrk) const
 Fit interface for xAOD::TrackParticle with no starting point. More...
 
virtual xAOD::Vertexfit (const std::vector< const Trk::TrackParameters * > &perigeeList, const Amg::Vector3D &startingPoint) const override
 Interface for Trk::TrackParameters with Amg::Vector3D starting point. More...
 
virtual xAOD::Vertexfit (const std::vector< const Trk::TrackParameters * > &perigeeList, const std::vector< const Trk::NeutralParameters * > &, const Amg::Vector3D &startingPoint) const override
 Interface for Trk::TrackParameters and NeutralParameters with Amg::Vector3D starting point. More...
 
virtual xAOD::Vertexfit (const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex &constraint) const override
 Interface for TrackParameters with xAOD::Vertex starting point. More...
 
virtual xAOD::Vertexfit (const std::vector< const Trk::TrackParameters * > &perigeeList, const std::vector< const Trk::NeutralParameters * > &, const xAOD::Vertex &constraint) const override
 Interface for TrackParameters and NeutralParameters with xAOD::Vertex starting point. More...
 
virtual xAOD::Vertexfit (const std::vector< const Trk::TrackParameters * > &perigeeList) const override
 Fit interface for TrackParameters with no starting point. More...
 
virtual xAOD::Vertexfit (const std::vector< const Trk::TrackParameters * > &perigeeList, const std::vector< const Trk::NeutralParameters * > &) const override
 
virtual xAOD::Vertexfit (const std::vector< const xAOD::TrackParticle * > &vectorTrk, const std::vector< double > &masses, const double &constraintMass, const xAOD::Vertex *pointingVertex, const Amg::Vector3D &startingPoint) const
 Methods specific for the V0 fitter Method taking a vector of tracks, vector of masses and starting point as arguments. More...
 
virtual xAOD::Vertexfit (const std::vector< const Trk::TrackParameters * > &perigeeList, const std::vector< double > &masses, const double &constraintMass, const xAOD::Vertex *pointingVertex, const Amg::Vector3D &startingPoint) const
 Interface for Trk::TrackParameters with mass and pointing constraints. More...
 

Private Attributes

int m_maxIterations
 
double m_maxDchi2PerNdf
 
double m_maxR
 
double m_maxZ
 
bool m_firstMeas
 
bool m_deltaR
 
ToolHandle< Trk::IExtrapolatorm_extrapolator
 Data members to store the results. More...
 
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
 

Detailed Description

This class implements a vertex fitting algorithm optimised for V0 finding.

The algorithm fits the full track information, incorporating the possibility of performing full kinematic constraints at the same time. The full covariance matrix from the fit, including track-track and track-vertex correlations is calculated and returned

Definition at line 39 of file TrkV0VertexFitter.h.

Member Enumeration Documentation

◆ FitError

Enumerator
FITOK 
MATINV 
NEGTRCHI2 
MAXCHI2 
MAXTRCHI2 
NOTRKS 
NOFIT 

Definition at line 49 of file TrkV0VertexFitter.h.

Constructor & Destructor Documentation

◆ TrkV0VertexFitter()

Trk::TrkV0VertexFitter::TrkV0VertexFitter ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 39 of file TrkV0VertexFitter.cxx.

39  : base_class(t,n,p),
40  m_maxIterations(10),
41  m_maxDchi2PerNdf(0.1),
42  m_maxR(2000.),
43  m_maxZ(5000.),
44  m_firstMeas(true),
45  m_deltaR(false),
46  m_extrapolator("Trk::Extrapolator/InDetExtrapolator", this)
47  {
48  declareProperty("MaxIterations", m_maxIterations);
49  declareProperty("MaxChi2PerNdf", m_maxDchi2PerNdf);
50  declareProperty("MaxR", m_maxR);
51  declareProperty("MaxZ", m_maxZ);
52  declareProperty("FirstMeasuredPoint", m_firstMeas);
53  declareProperty("Use_deltaR", m_deltaR);
54  declareProperty("Extrapolator", m_extrapolator);
55  declareInterface<IVertexFitter>(this);
56  }

◆ ~TrkV0VertexFitter()

Trk::TrkV0VertexFitter::~TrkV0VertexFitter ( )
virtualdefault

standard destructor

Member Function Documentation

◆ finalize()

StatusCode Trk::TrkV0VertexFitter::finalize ( )
overridevirtual

Definition at line 75 of file TrkV0VertexFitter.cxx.

76  {
77  ATH_MSG_DEBUG( "Finalize successful" );
78  return StatusCode::SUCCESS;
79  }

◆ fit() [1/13]

xAOD::Vertex * Trk::TrkV0VertexFitter::fit ( const std::vector< const Trk::TrackParameters * > &  originalPerigees) const
overridevirtual

Fit interface for TrackParameters with no starting point.

Interface for Trk::TrackParameters with no starting point.

(0,0,0) will be assumed.

(0,0,0) will be assumed

Definition at line 212 of file TrkV0VertexFitter.cxx.

213  {
214  Amg::Vector3D tmpVtx;
215  tmpVtx.setZero();
216  return fit(originalPerigees, tmpVtx);
217  }

◆ fit() [2/13]

xAOD::Vertex * Trk::TrkV0VertexFitter::fit ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const Amg::Vector3D startingPoint 
) const
overridevirtual

Interface for Trk::TrackParameters with Amg::Vector3D starting point.

Definition at line 191 of file TrkV0VertexFitter.cxx.

193  {
194  std::vector<double> masses;
195  double constraintMass = -9999.;
196  xAOD::Vertex * pointingVertex = nullptr;
197  return fit(originalPerigees, masses, constraintMass, pointingVertex, firstStartingPoint);
198  }

◆ fit() [3/13]

virtual xAOD::Vertex* Trk::TrkV0VertexFitter::fit ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const std::vector< const Trk::NeutralParameters * > &   
) const
inlineoverridevirtual

Definition at line 135 of file TrkV0VertexFitter.h.

139  {
140  msg(MSG::WARNING) << "TrkV0VertexFitter::fit(fit(const std::vector<const "
141  "Trk::TrackParameters*>&,const std::vector<const "
142  "Trk::NeutralParameters*>&) ignoring neutrals"
143  << endmsg;
144  return fit(perigeeList);
145  };

◆ fit() [4/13]

virtual xAOD::Vertex* Trk::TrkV0VertexFitter::fit ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const std::vector< const Trk::NeutralParameters * > &  ,
const Amg::Vector3D startingPoint 
) const
inlineoverridevirtual

Interface for Trk::TrackParameters and NeutralParameters with Amg::Vector3D starting point.

Definition at line 97 of file TrkV0VertexFitter.h.

101  {
102  msg(MSG::WARNING)
103  << "TrkV0VertexFitter::fit(fit(const std::vector<const "
104  "Trk::TrackParameters*>&,const std::vector<const "
105  "Trk::NeutralParameters*>&,const Amg::Vector3D&) ignoring neutrals"
106  << endmsg;
107  return fit(perigeeList, startingPoint);
108  };

◆ fit() [5/13]

virtual xAOD::Vertex* Trk::TrkV0VertexFitter::fit ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const std::vector< const Trk::NeutralParameters * > &  ,
const xAOD::Vertex constraint 
) const
inlineoverridevirtual

Interface for TrackParameters and NeutralParameters with xAOD::Vertex starting point.

Definition at line 117 of file TrkV0VertexFitter.h.

121  {
122  msg(MSG::WARNING)
123  << "TrkV0VertexFitter::fit(fit(const std::vector<const "
124  "Trk::TrackParameters*>&,const std::vector<const "
125  "Trk::NeutralParameters*>&,const xAOD::Vertex&) ignoring neutrals"
126  << endmsg;
127  return fit(perigeeList, constraint);
128  };

◆ fit() [6/13]

xAOD::Vertex * Trk::TrkV0VertexFitter::fit ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const std::vector< double > &  masses,
const double &  constraintMass,
const xAOD::Vertex pointingVertex,
const Amg::Vector3D startingPoint 
) const
virtual

Interface for Trk::TrackParameters with mass and pointing constraints.

Definition at line 220 of file TrkV0VertexFitter.cxx.

225  {
226  const EventContext& ctx = Gaudi::Hive::currentContext();
227  if ( originalPerigees.empty() )
228  {
229  ATH_MSG_DEBUG("No tracks to fit in this event.");
230  return nullptr;
231  }
232 
233  // Initialisation of variables
234  bool pointingConstraint = false;
235  bool massConstraint = false;
236  if(constraintMass > -100.) massConstraint = true;
237  bool conversion = false;
238  if(constraintMass == 0. && originalPerigees.size() == 2) conversion = true;
239  double x_point=0., y_point=0., z_point=0.;
240  AmgSymMatrix(3) pointingVertexCov; pointingVertexCov.setIdentity();
241  if (pointingVertex != nullptr) {
242  if (pointingVertex->covariancePosition().trace() != 0.) {
243  pointingConstraint = true;
244  Amg::Vector3D pv = pointingVertex->position();
245  x_point = pv.x();
246  y_point = pv.y();
247  z_point = pv.z();
248  pointingVertexCov = pointingVertex->covariancePosition().inverse();
249  }
250  }
251 
252  if (msgLvl(MSG::DEBUG)) {
253  msg(MSG::DEBUG) << "massConstraint " << massConstraint << " pointingConstraint " << pointingConstraint << " conversion " << conversion << endmsg;
254  msg(MSG::DEBUG) << "V0Fitter called with: " << endmsg;
255  if (massConstraint && !masses.empty()) msg(MSG::DEBUG) << "mass constraint, V0Mass = " << constraintMass << " particle masses " << masses << endmsg;
256  if (pointingConstraint) msg(MSG::DEBUG) << "pointing constraint, x = " << x_point << " y = " << y_point << " z = " << z_point << endmsg;
257  }
258 
259  bool restartFit = true;
260  double chi2 = 2000000000000.;
261  unsigned int nTrk = originalPerigees.size(); // Number of tracks to fit
262  unsigned int nMeas = 5*nTrk; // Number of measurements
263  unsigned int nVert = 1; // Number of vertices
264 
265  unsigned int nCnst = 2*nTrk; // Number of constraint equations
266  unsigned int nPntC = 2; // Contribution from pointing constraint in 2D
267  unsigned int nMass = 1; // Contribution from mass constraint
268 
269  if (massConstraint) {
270  nCnst = nCnst + nMass;
271  }
272  if (pointingConstraint) {
273  nCnst = nCnst + nPntC;
274  nMeas = nMeas + 3;
275  nVert = nVert + 1;
276  }
277 
278  unsigned int nPar = 5*nTrk + 3*nVert; // Number of parameters
279  int ndf = nMeas - (nPar - nCnst); // Number of degrees of freedom
280  if (ndf < 0) {ndf = 1;}
281 
282  unsigned int dim = nCnst; //
283  unsigned int n_dim = nMeas; //
284 
285  ATH_MSG_DEBUG("ndf " << ndf << " n_dim " << n_dim << " dim " << dim);
286 
287  std::vector<V0FitterTrack> v0FitterTracks;
288 
289  Amg::VectorX Y_vec(n_dim); Y_vec.setZero();
290  Amg::VectorX Y0_vec(n_dim); Y0_vec.setZero();
291  Amg::Vector3D A_vec; A_vec.setZero();
292 
293  Amg::MatrixX Wmeas_mat(n_dim,n_dim); Wmeas_mat.setZero();
294  Amg::MatrixX Wmeas0_mat(n_dim,n_dim); Wmeas0_mat.setZero();
295  Amg::MatrixX Bjac_mat(dim,n_dim); Bjac_mat.setZero();
296  Amg::MatrixX Ajac_mat(dim,3); Ajac_mat.setZero();
297  Amg::MatrixX C11_mat(n_dim,n_dim); C11_mat.setZero();
298  Amg::MatrixX C22_mat(3,3); C22_mat.setZero();
299  Amg::MatrixX C21_mat(3,n_dim); C21_mat.setZero();
300  Amg::MatrixX C31_mat(dim,n_dim); C31_mat.setZero();
301  Amg::MatrixX C32_mat(dim,3); C32_mat.setZero();
302  Amg::MatrixX Wb_mat(dim,dim); Wb_mat.setZero();
303  Amg::MatrixX Btemp_mat(dim,n_dim); Btemp_mat.setZero();
304  Amg::MatrixX Atemp_mat(dim,3); Atemp_mat.setZero();
305  Amg::VectorX DeltaY_vec(n_dim); DeltaY_vec.setZero();
306  Amg::Vector3D DeltaA_vec; DeltaA_vec.setZero();
307  Amg::VectorX DeltaY0_vec(n_dim); DeltaY0_vec.setZero();
308  Amg::VectorX F_vec(dim); F_vec.setZero();
309  Amg::VectorX C_vec(dim); C_vec.setZero();
310  Amg::VectorX C_cor_vec(dim); C_cor_vec.setZero();
311  Amg::MatrixX V_mat(nPar,nPar); V_mat.setZero();
312  Amg::MatrixX Chi_vec(1,n_dim); Chi_vec.setZero();
313  AmgSymMatrix(1) Chi_mat; Chi_mat.setZero();
314  Amg::MatrixX ChiItr_vec(1,n_dim); ChiItr_vec.setZero();
315  AmgSymMatrix(1) ChiItr_mat; ChiItr_mat.setZero();
316  Amg::VectorX F_fac_vec(dim); F_fac_vec.setZero();
317 
318  const Amg::Vector3D * globalPosition = &(firstStartingPoint);
319  ATH_MSG_DEBUG("globalPosition of starting point: " << (*globalPosition)[0] << ", " << (*globalPosition)[1] << ", " << (*globalPosition)[2]);
320  if (globalPosition->perp() > m_maxR && globalPosition->z() > m_maxZ) return nullptr;
321 
322  SG::ReadCondHandle<AtlasFieldCacheCondObj> readHandle{m_fieldCacheCondObjInputKey, ctx};
323  if (!readHandle.isValid()) {
324  std::string msg = "Failed to retrieve magmnetic field conditions data ";
326  throw std::runtime_error(msg);
327  }
328  const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
329 
330  MagField::AtlasFieldCache fieldCache;
331  fieldCondObj->getInitializedCache (fieldCache);
332 
333  // magnetic field
334  double BField[3];
335  fieldCache.getField(globalPosition->data(),BField);
336  double B_z = BField[2]*299.792; // should be in GeV/mm
337  if (B_z == 0. || std::isnan(B_z)) {
338  ATH_MSG_DEBUG("Could not find a magnetic field different from zero: very very strange");
339  B_z = 0.60407; // Value in GeV/mm (ATLAS units)
340  } else {
341  ATH_MSG_VERBOSE("Magnetic field projection of z axis in the perigee position is: " << B_z << " GeV/mm ");
342  }
343 // double B_z = 1.998*0.3;
344 
345 
346  v0FitterTracks.clear();
347  Trk::PerigeeSurface perigeeSurface(*globalPosition);
348  // Extrapolate the perigees to the startpoint of the fit
349  for (const Trk::TrackParameters* chargeParameters : originalPerigees)
350  {
351  if (chargeParameters != nullptr)
352  {
353  // Correct material changes
354  const Amg::Vector3D gMomentum = chargeParameters->momentum();
355  const Amg::Vector3D gDirection = chargeParameters->position() - *globalPosition;
356  const double extrapolationDirection = gMomentum.dot( gDirection );
358  if(extrapolationDirection > 0) mode = Trk::addNoise;
359  std::unique_ptr<const Trk::Perigee> extrapolatedPerigee(nullptr);
360  std::unique_ptr<const Trk::TrackParameters> tmp =
361  m_extrapolator->extrapolate(ctx,
362  *chargeParameters,
363  perigeeSurface,
365  true,
366  Trk::pion,
367  mode);
368  //if of right type we want to pass ownership
369  if (tmp && tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) {
370  extrapolatedPerigee.reset(static_cast<const Trk::Perigee*>(tmp.release()));
371  }
372 
373  if (extrapolatedPerigee == nullptr) {
374  ATH_MSG_DEBUG("Perigee was not extrapolated! Taking original one!");
375  const Trk::Perigee* tmpPerigee = dynamic_cast<const Trk::Perigee*>(chargeParameters);
376  if (tmpPerigee!=nullptr) extrapolatedPerigee = std::make_unique<Trk::Perigee>(*tmpPerigee);
377  else return nullptr;
378  }
379 
380  // store track parameters at starting point
381  V0FitterTrack locV0FitterTrack;
382  locV0FitterTrack.TrkPar[0] = extrapolatedPerigee->parameters()[Trk::d0];
383  locV0FitterTrack.TrkPar[1] = extrapolatedPerigee->parameters()[Trk::z0];
384  locV0FitterTrack.TrkPar[2] = extrapolatedPerigee->parameters()[Trk::phi];
385  locV0FitterTrack.TrkPar[3] = extrapolatedPerigee->parameters()[Trk::theta];
386  locV0FitterTrack.TrkPar[4] = extrapolatedPerigee->parameters()[Trk::qOverP];
387  locV0FitterTrack.Wi_mat = extrapolatedPerigee->covariance()->inverse().eval();
388  locV0FitterTrack.originalPerigee = chargeParameters;
389  v0FitterTracks.push_back(locV0FitterTrack);
390  } else {
391  ATH_MSG_DEBUG("Track parameters are not charged tracks ... fit aborted");
392  return nullptr;
393  }
394  }
395 
396  // Iterate fits until the fit criteria are met, or the number of max iterations is reached
397  double chi2New=0.; double chi2Old=chi2;
398  double sumConstr=0.;
399  bool onConstr = false;
400  Amg::Vector3D frameOrigin = firstStartingPoint;
401  Amg::Vector3D frameOriginItr = firstStartingPoint;
402  for (int itr=0; itr < m_maxIterations; ++itr)
403  {
404  ATH_MSG_DEBUG("Iteration number: " << itr);
405  if (!restartFit) chi2Old = chi2New;
406  chi2New = 0.;
407 
408  if (restartFit)
409  {
410  // ===> loop over tracks
412  int i=0;
413  for (PTIter = v0FitterTracks.begin(); PTIter != v0FitterTracks.end() ; ++PTIter)
414  {
415  V0FitterTrack locP((*PTIter));
416  Wmeas0_mat.block(5*i,5*i,5,5) = locP.Wi_mat;
417  Wmeas_mat.block(5*i,5*i,5,5) = locP.Wi_mat;
418  for (int j=0; j<5; ++j) {
419  Y0_vec(j+5*i) = locP.TrkPar[j];
420  }
421  ++i;
422  }
423  if(pointingConstraint) {
424  Y0_vec(5*nTrk + 0) = x_point;
425  Y0_vec(5*nTrk + 1) = y_point;
426  Y0_vec(5*nTrk + 2) = z_point;
427  Wmeas0_mat.block(5*nTrk,5*nTrk,3,3) = pointingVertexCov;
428  Wmeas_mat.block(5*nTrk,5*nTrk,3,3) = pointingVertexCov;
429  }
430  Wmeas_mat = Wmeas_mat.inverse();
431  }
432 
433  Y_vec = Y0_vec + DeltaY_vec;
434  A_vec = DeltaA_vec;
435 
436  // check theta and phi ranges
437  for (unsigned int i=0; i<nTrk; ++i)
438  {
439  if ( fabs ( Y_vec(2+5*i) ) > 100. || fabs ( Y_vec(3+5*i) ) > 100. ) { return nullptr; }
440  while ( fabs ( Y_vec(2+5*i) ) > M_PI ) Y_vec(2+5*i) += ( Y_vec(2+5*i) > 0 ) ? -2*M_PI : 2*M_PI;
441  while ( Y_vec(3+5*i) > 2*M_PI ) Y_vec(3+5*i) -= 2*M_PI;
442  while ( Y_vec(3+5*i) < -M_PI ) Y_vec(3+5*i) += M_PI;
443  if ( Y_vec(3+5*i) > M_PI )
444  {
445  Y_vec(3+5*i) = 2*M_PI - Y_vec(3+5*i);
446  if ( Y_vec(2+5*i) >= 0 ) Y_vec(2+5*i) += ( Y_vec(2+5*i) >0 ) ? -M_PI : M_PI;
447  }
448  if ( Y_vec(3+5*i) < 0.0 )
449  {
450  Y_vec(3+5*i) = - Y_vec(3+5*i);
451  if ( Y_vec(2+5*i) >= 0 ) Y_vec(2+5*i) += ( Y_vec(2+5*i) >0 ) ? -M_PI : M_PI;
452  }
453  }
454 
455  double SigE=0., SigPx=0., SigPy=0., SigPz=0., Px=0., Py=0., Pz=0.;
456  Amg::VectorX rho(nTrk), Phi(nTrk), charge(nTrk);
457  rho.setZero(); Phi.setZero(); charge.setZero();
458  Amg::VectorX d0Cor(nTrk), d0Fac(nTrk), xcphiplusysphi(nTrk), xsphiminusycphi(nTrk);
459  d0Cor.setZero(); d0Fac.setZero(); xcphiplusysphi.setZero(); xsphiminusycphi.setZero();
460  AmgVector(2) conv_sign;
461  conv_sign[0] = -1; conv_sign[1] = 1;
462  for (unsigned int i=0; i<nTrk; ++i)
463  {
464  charge[i] = (Y_vec(4+5*i) < 0.) ? -1. : 1.;
465  rho[i] = sin(Y_vec(3+5*i))/(B_z*Y_vec(4+5*i));
466  xcphiplusysphi[i] = A_vec(0)*cos(Y_vec(2+5*i))+A_vec(1)*sin(Y_vec(2+5*i));
467  xsphiminusycphi[i] = A_vec(0)*sin(Y_vec(2+5*i))-A_vec(1)*cos(Y_vec(2+5*i));
468  if(fabs(-xcphiplusysphi[i]/rho[i]) > 1.) return nullptr;
469  d0Cor[i] = 0.5*asin(-xcphiplusysphi[i]/rho[i]);
470  double d0Facsq = 1. - xcphiplusysphi[i]*xcphiplusysphi[i]/(rho[i]*rho[i]);
471  d0Fac[i] = (d0Facsq>0.) ? sqrt(d0Facsq) : 0;
472  Phi[i] = Y_vec(2+5*i) + 2.*d0Cor[i];
473 
474  if(massConstraint && !masses.empty() && masses[i] != 0.){
475  SigE += sqrt(1./(Y_vec(4+5*i)*Y_vec(4+5*i)) + masses[i]*masses[i]);
476  SigPx += sin(Y_vec(3+5*i))*cos(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
477  SigPy += sin(Y_vec(3+5*i))*sin(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
478  SigPz += cos(Y_vec(3+5*i))*charge[i]/Y_vec(4+5*i);
479  }
480  Px += sin(Y_vec(3+5*i))*cos(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
481  Py += sin(Y_vec(3+5*i))*sin(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
482  Pz += cos(Y_vec(3+5*i))*charge[i]/Y_vec(4+5*i);
483  }
484 
485  double FMass=0., dFMassdxs=0., dFMassdys=0., dFMassdzs=0.;
486  double FPxy=0., dFPxydxs=0., dFPxydys=0., dFPxydzs=0., dFPxydxp=0., dFPxydyp=0., dFPxydzp=0.;
487  double FPxz=0., dFPxzdxs=0., dFPxzdys=0., dFPxzdzs=0., dFPxzdxp=0., dFPxzdyp=0., dFPxzdzp=0.;
488  Amg::VectorX Fxy(nTrk), Fxz(nTrk), dFMassdPhi(nTrk);
489  Fxy.setZero(); Fxz.setZero(); dFMassdPhi.setZero();
490  Amg::VectorX drhodtheta(nTrk), drhodqOverP(nTrk), csplusbc(nTrk), ccminusbs(nTrk);
491  drhodtheta.setZero(); drhodqOverP.setZero(); csplusbc.setZero(); ccminusbs.setZero();
492  Amg::VectorX dFxydd0(nTrk), dFxydz0(nTrk), dFxydphi(nTrk), dFxydtheta(nTrk), dFxydqOverP(nTrk);
493  dFxydd0.setZero(); dFxydz0.setZero(); dFxydphi.setZero(); dFxydtheta.setZero(); dFxydqOverP.setZero();
494  Amg::VectorX dFxydxs(nTrk), dFxydys(nTrk), dFxydzs(nTrk);
495  dFxydxs.setZero(); dFxydys.setZero(); dFxydzs.setZero();
496  Amg::VectorX dFxzdd0(nTrk), dFxzdz0(nTrk), dFxzdphi(nTrk), dFxzdtheta(nTrk), dFxzdqOverP(nTrk);
497  dFxzdd0.setZero(); dFxzdz0.setZero(); dFxzdphi.setZero(); dFxzdtheta.setZero(); dFxzdqOverP.setZero();
498  Amg::VectorX dFxzdxs(nTrk), dFxzdys(nTrk), dFxzdzs(nTrk);
499  dFxzdxs.setZero(); dFxzdys.setZero(); dFxzdzs.setZero();
500  Amg::VectorX dFMassdd0(nTrk), dFMassdz0(nTrk), dFMassdphi(nTrk), dFMassdtheta(nTrk), dFMassdqOverP(nTrk);
501  dFMassdd0.setZero(); dFMassdz0.setZero(); dFMassdphi.setZero(); dFMassdtheta.setZero(); dFMassdqOverP.setZero();
502  Amg::VectorX dFPxydd0(nTrk), dFPxydz0(nTrk), dFPxydphi(nTrk), dFPxydtheta(nTrk), dFPxydqOverP(nTrk);
503  dFPxydd0.setZero(); dFPxydz0.setZero(); dFPxydphi.setZero(); dFPxydtheta.setZero(); dFPxydqOverP.setZero();
504  Amg::VectorX dFPxzdd0(nTrk), dFPxzdz0(nTrk), dFPxzdphi(nTrk), dFPxzdtheta(nTrk), dFPxzdqOverP(nTrk);
505  dFPxzdd0.setZero(); dFPxzdz0.setZero(); dFPxzdphi.setZero(); dFPxzdtheta.setZero(); dFPxzdqOverP.setZero();
506  Amg::VectorX dPhidd0(nTrk), dPhidz0(nTrk), dPhidphi0(nTrk), dPhidtheta(nTrk), dPhidqOverP(nTrk);
507  dPhidd0.setZero(); dPhidz0.setZero(); dPhidphi0.setZero(); dPhidtheta.setZero(); dPhidqOverP.setZero();
508  Amg::VectorX dPhidxs(nTrk), dPhidys(nTrk), dPhidzs(nTrk);
509  dPhidxs.setZero(); dPhidys.setZero(); dPhidzs.setZero();
510  //
511  // constraint equations for V0vertex fitter
512  //
513  // FMass = mass vertex constraint
514  //
515  if (conversion) {
516  FMass = Phi[1] - Phi[0];
517  } else {
518  FMass = constraintMass*constraintMass - SigE*SigE + SigPx*SigPx + SigPy*SigPy + SigPz*SigPz;
519  }
520  //
521  // FPxy = pointing constraint in xy
522  //
523  FPxy = Px*(frameOriginItr[1] - y_point) - Py*(frameOriginItr[0]- x_point);
524  //
525  // FPxz = pointing constraint in xz
526  //
527  FPxz = Px*(frameOriginItr[2] - z_point) - Pz*(frameOriginItr[0]- x_point);
528 
529  for (unsigned int i=0; i<nTrk; ++i)
530  {
531  //
532  // Fxy = vertex constraint in xy plane (one for each track)
533  //
534  Fxy[i] = Y_vec(0+5*i) + xsphiminusycphi[i] - 2.*rho[i]*sin(d0Cor[i])*sin(d0Cor[i]);
535  //
536  // Fxz = vertex constraint in xz plane (one for each track)
537  //
538  Fxz[i] = Y_vec(1+5*i) - A_vec(2) - rho[i]*2.*d0Cor[i]/tan(Y_vec(3+5*i));
539  //
540  // derivatives
541  //
542  drhodtheta[i] = cos(Y_vec(3+5*i))/(B_z*Y_vec(4+5*i));
543  drhodqOverP[i] = -sin(Y_vec(3+5*i))/(B_z*Y_vec(4+5*i)*Y_vec(4+5*i));
544 
545  dFxydd0[i] = 1.;
546  dFxydphi[i] = xcphiplusysphi[i]*(1. + xsphiminusycphi[i]/(d0Fac[i]*rho[i]));
547  dFxydtheta[i] = (xcphiplusysphi[i]*xcphiplusysphi[i]/(d0Fac[i]*rho[i]*rho[i])-2.*sin(d0Cor[i])*sin(d0Cor[i]))*drhodtheta[i];
548  dFxydqOverP[i] = (xcphiplusysphi[i]*xcphiplusysphi[i]/(d0Fac[i]*rho[i]*rho[i])-2.*sin(d0Cor[i])*sin(d0Cor[i]))*drhodqOverP[i];
549  dFxydxs[i] = sin(Y_vec(2+5*i)) - cos(Y_vec(2+5*i))*xcphiplusysphi[i]/(d0Fac[i]*rho[i]);
550  dFxydys[i] = -cos(Y_vec(2+5*i)) - sin(Y_vec(2+5*i))*xcphiplusysphi[i]/(d0Fac[i]*rho[i]);
551 
552  dFxzdz0[i] = 1.;
553  dFxzdphi[i] = -xsphiminusycphi[i]/(d0Fac[i]*tan(Y_vec(3+5*i)));
554  dFxzdtheta[i] = -((xcphiplusysphi[i]/(d0Fac[i]*rho[i]) + 2.*d0Cor[i])*tan(Y_vec(3+5*i))*drhodtheta[i] -
555  rho[i]*2.*d0Cor[i]/(cos(Y_vec(3+5*i))*cos(Y_vec(3+5*i))))/(tan(Y_vec(3+5*i))*tan(Y_vec(3+5*i)));
556  dFxzdqOverP[i] = -(xcphiplusysphi[i]/(d0Fac[i]*rho[i]) + 2.*d0Cor[i])*drhodqOverP[i]/tan(Y_vec(3+5*i));
557  dFxzdxs[i] = cos(Y_vec(2+5*i))/(d0Fac[i]*tan(Y_vec(3+5*i)));
558  dFxzdys[i] = sin(Y_vec(2+5*i))/(d0Fac[i]*tan(Y_vec(3+5*i)));
559  dFxzdzs[i] = -1.;
560 
561  dPhidphi0[i] = 1. + xsphiminusycphi[i]/(d0Fac[i]*rho[i]);
562  dPhidtheta[i] = xcphiplusysphi[i]*drhodtheta[i]/(d0Fac[i]*rho[i]*rho[i]);
563  dPhidqOverP[i] = xcphiplusysphi[i]*drhodqOverP[i]/(d0Fac[i]*rho[i]*rho[i]);
564  dPhidxs[i] = -cos(Y_vec(2+5*i))/(d0Fac[i]*rho[i]);
565  dPhidys[i] = -sin(Y_vec(2+5*i))/(d0Fac[i]*rho[i]);
566 
567  if (massConstraint && !masses.empty() && masses[i] != 0.){
568  if (conversion) {
569  dFMassdphi[i] = conv_sign[i]*dPhidphi0[i];
570  dFMassdtheta[i] = conv_sign[i]*dPhidtheta[i];
571  dFMassdqOverP[i] = conv_sign[i]*dPhidqOverP[i];
572  dFMassdxs += conv_sign[i]*dPhidxs[i];
573  dFMassdys += conv_sign[i]*dPhidys[i];
574  } else {
575  csplusbc[i] = SigPy*sin(Y_vec(2+5*i))+SigPx*cos(Y_vec(2+5*i));
576  ccminusbs[i] = SigPy*cos(Y_vec(2+5*i))-SigPx*sin(Y_vec(2+5*i));
577  dFMassdphi[i] = 2.*sin(Y_vec(3+5*i))*ccminusbs[i]*charge[i]/Y_vec(4+5*i);
578  dFMassdtheta[i] = 2.*(cos(Y_vec(3+5*i))*csplusbc[i] - sin(Y_vec(3+5*i))*SigPz)*charge[i]/Y_vec(4+5*i);
579  dFMassdqOverP[i] = 2.*SigE/(sqrt(1./(Y_vec(4+5*i)*Y_vec(4+5*i)) + masses[i]*masses[i])*Y_vec(4+5*i)*Y_vec(4+5*i)*Y_vec(4+5*i)) -
580  2.*charge[i]*(sin(Y_vec(3+5*i))*csplusbc[i] + cos(Y_vec(3+5*i))*SigPz)/(Y_vec(4+5*i)*Y_vec(4+5*i));
581  }
582  }
583 
584  if (pointingConstraint){
585  dFPxydphi[i] = -sin(Y_vec(3+5*i))*(sin(Y_vec(2+5*i))*(frameOriginItr[1]-y_point)+cos(Y_vec(2+5*i))*(frameOriginItr[0]-x_point))*charge[i]/Y_vec(4+5*i);
586  dFPxydtheta[i] = cos(Y_vec(3+5*i))*(cos(Y_vec(2+5*i))*(frameOriginItr[1]-y_point)-sin(Y_vec(2+5*i))*(frameOriginItr[0]-x_point))*charge[i]/Y_vec(4+5*i);
587  dFPxydqOverP[i] = -sin(Y_vec(3+5*i))*(cos(Y_vec(2+5*i))*(frameOriginItr[1]-y_point)-sin(Y_vec(2+5*i))*(frameOriginItr[0]-x_point))*charge[i]/(Y_vec(4+5*i)*Y_vec(4+5*i));
588  dFPxydxs += -sin(Y_vec(3+5*i))*sin(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
589  dFPxydys += sin(Y_vec(3+5*i))*cos(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
590  dFPxydxp += sin(Y_vec(3+5*i))*sin(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
591  dFPxydyp += -sin(Y_vec(3+5*i))*cos(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
592 
593  dFPxzdphi[i] = -sin(Y_vec(3+5*i))*sin(Y_vec(2+5*i))*(frameOriginItr[2]-z_point)*charge[i]/Y_vec(4+5*i);
594  dFPxzdtheta[i] = cos(Y_vec(3+5*i))*cos(Y_vec(2+5*i))*(frameOriginItr[2]-z_point)*charge[i]/Y_vec(4+5*i)
595  +sin(Y_vec(3+5*i))*(frameOriginItr[0]-x_point)*charge[i]/Y_vec(4+5*i);
596  dFPxzdqOverP[i] = -sin(Y_vec(3+5*i))*cos(Y_vec(2+5*i))*(frameOriginItr[2]-z_point)*charge[i]/(Y_vec(4+5*i)*Y_vec(4+5*i))
597  +cos(Y_vec(3+5*i))*(frameOriginItr[0]-x_point)*charge[i]/(Y_vec(4+5*i)*Y_vec(4+5*i));
598  dFPxzdxs += -cos(Y_vec(3+5*i))*charge[i]/Y_vec(4+5*i);
599  dFPxzdzs += sin(Y_vec(3+5*i))*cos(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
600  dFPxzdxp += cos(Y_vec(3+5*i))*charge[i]/Y_vec(4+5*i);
601  dFPxzdzp += -sin(Y_vec(3+5*i))*cos(Y_vec(2+5*i))*charge[i]/Y_vec(4+5*i);
602  }
603 
604  // fill vector of constraints
605  F_vec[i] = -Fxy[i];
606  F_vec[i+nTrk] = -Fxz[i];
607  F_fac_vec[i] = 1.;
608  F_fac_vec[i+nTrk] = 1.;
609  }
610  if(massConstraint) F_vec(2*nTrk+0) = -FMass;
611  //if(massConstraint) F_fac_vec(2*nTrk+0) = 1.;
612  if(massConstraint) F_fac_vec(2*nTrk+0) = 0.000001;
613  if(pointingConstraint) {
614  if(massConstraint) {
615  F_vec(2*nTrk+1) = -FPxy;
616  F_vec(2*nTrk+2) = -FPxz;
617  F_fac_vec(2*nTrk+1) = 0.000001;
618  F_fac_vec(2*nTrk+2) = 0.000001;
619  } else {
620  F_vec(2*nTrk+0) = -FPxy;
621  F_vec(2*nTrk+1) = -FPxz;
622  F_fac_vec(2*nTrk+0) = 0.000001;
623  F_fac_vec(2*nTrk+1) = 0.000001;
624  }
625  }
626 
627  sumConstr = 0.;
628  for (unsigned int i=0; i<dim; ++i)
629  {
630  sumConstr += F_fac_vec[i]*fabs(F_vec[i]);
631  }
632  if ( std::isnan(sumConstr) ) { return nullptr; }
633  if (sumConstr < 0.001) { onConstr = true; }
634  ATH_MSG_DEBUG("sumConstr " << sumConstr);
635 
636  for (unsigned int i=0; i<nTrk; ++i)
637  {
638  Bjac_mat(i,0+5*i) = dFxydd0(i);
639  Bjac_mat(i,1+5*i) = dFxydz0(i);
640  Bjac_mat(i,2+5*i) = dFxydphi(i);
641  Bjac_mat(i,3+5*i) = dFxydtheta(i);
642  Bjac_mat(i,4+5*i) = dFxydqOverP(i);
643  Bjac_mat(i+nTrk,0+5*i) = dFxzdd0(i);
644  Bjac_mat(i+nTrk,1+5*i) = dFxzdz0(i);
645  Bjac_mat(i+nTrk,2+5*i) = dFxzdphi(i);
646  Bjac_mat(i+nTrk,3+5*i) = dFxzdtheta(i);
647  Bjac_mat(i+nTrk,4+5*i) = dFxzdqOverP(i);
648  if(massConstraint) {
649  Bjac_mat(2*nTrk,0+5*i) = dFMassdd0(i);
650  Bjac_mat(2*nTrk,1+5*i) = dFMassdz0(i);
651  Bjac_mat(2*nTrk,2+5*i) = dFMassdphi(i);
652  Bjac_mat(2*nTrk,3+5*i) = dFMassdtheta(i);
653  Bjac_mat(2*nTrk,4+5*i) = dFMassdqOverP(i);
654  }
655  if(pointingConstraint) {
656  if(massConstraint) {
657  Bjac_mat(2*nTrk+1,0+5*i) = dFPxydd0(i);
658  Bjac_mat(2*nTrk+1,1+5*i) = dFPxydz0(i);
659  Bjac_mat(2*nTrk+1,2+5*i) = dFPxydphi(i);
660  Bjac_mat(2*nTrk+1,3+5*i) = dFPxydtheta(i);
661  Bjac_mat(2*nTrk+1,4+5*i) = dFPxydqOverP(i);
662  Bjac_mat(2*nTrk+1,5*nTrk) = dFPxydxp;
663  Bjac_mat(2*nTrk+1,5*nTrk+1) = dFPxydyp;
664  Bjac_mat(2*nTrk+1,5*nTrk+2) = dFPxydzp;
665  Bjac_mat(2*nTrk+2,0+5*i) = dFPxzdd0(i);
666  Bjac_mat(2*nTrk+2,1+5*i) = dFPxzdz0(i);
667  Bjac_mat(2*nTrk+2,2+5*i) = dFPxzdphi(i);
668  Bjac_mat(2*nTrk+2,3+5*i) = dFPxzdtheta(i);
669  Bjac_mat(2*nTrk+2,4+5*i) = dFPxzdqOverP(i);
670  Bjac_mat(2*nTrk+2,5*nTrk) = dFPxzdxp;
671  Bjac_mat(2*nTrk+2,5*nTrk+1) = dFPxzdyp;
672  Bjac_mat(2*nTrk+2,5*nTrk+2) = dFPxzdzp;
673  } else {
674  Bjac_mat(2*nTrk+0,0+5*i) = dFPxydd0(i);
675  Bjac_mat(2*nTrk+0,1+5*i) = dFPxydz0(i);
676  Bjac_mat(2*nTrk+0,2+5*i) = dFPxydphi(i);
677  Bjac_mat(2*nTrk+0,3+5*i) = dFPxydtheta(i);
678  Bjac_mat(2*nTrk+0,4+5*i) = dFPxydqOverP(i);
679  Bjac_mat(2*nTrk+0,5*nTrk) = dFPxydxp;
680  Bjac_mat(2*nTrk+0,5*nTrk+1) = dFPxydyp;
681  Bjac_mat(2*nTrk+0,5*nTrk+2) = dFPxydzp;
682  Bjac_mat(2*nTrk+1,0+5*i) = dFPxzdd0(i);
683  Bjac_mat(2*nTrk+1,1+5*i) = dFPxzdz0(i);
684  Bjac_mat(2*nTrk+1,2+5*i) = dFPxzdphi(i);
685  Bjac_mat(2*nTrk+1,3+5*i) = dFPxzdtheta(i);
686  Bjac_mat(2*nTrk+1,4+5*i) = dFPxzdqOverP(i);
687  Bjac_mat(2*nTrk+1,5*nTrk) = dFPxzdxp;
688  Bjac_mat(2*nTrk+1,5*nTrk+1) = dFPxzdyp;
689  Bjac_mat(2*nTrk+1,5*nTrk+2) = dFPxzdzp;
690  }
691  }
692 
693  Ajac_mat(i,0) = dFxydxs(i);
694  Ajac_mat(i,1) = dFxydys(i);
695  Ajac_mat(i,2) = dFxydzs(i);
696  Ajac_mat(i+nTrk,0) = dFxzdxs(i);
697  Ajac_mat(i+nTrk,1) = dFxzdys(i);
698  Ajac_mat(i+nTrk,2) = dFxzdzs(i);
699  if(massConstraint) {
700  Ajac_mat(2*nTrk,0) = dFMassdxs;
701  Ajac_mat(2*nTrk,1) = dFMassdys;
702  Ajac_mat(2*nTrk,2) = dFMassdzs;
703  }
704  if(pointingConstraint) {
705  if(massConstraint) {
706  Ajac_mat(2*nTrk+1,0) = dFPxydxs;
707  Ajac_mat(2*nTrk+1,1) = dFPxydys;
708  Ajac_mat(2*nTrk+1,2) = dFPxydzs;
709  Ajac_mat(2*nTrk+2,0) = dFPxzdxs;
710  Ajac_mat(2*nTrk+2,1) = dFPxzdys;
711  Ajac_mat(2*nTrk+2,2) = dFPxzdzs;
712  } else {
713  Ajac_mat(2*nTrk+0,0) = dFPxydxs;
714  Ajac_mat(2*nTrk+0,1) = dFPxydys;
715  Ajac_mat(2*nTrk+0,2) = dFPxydzs;
716  Ajac_mat(2*nTrk+1,0) = dFPxzdxs;
717  Ajac_mat(2*nTrk+1,1) = dFPxzdys;
718  Ajac_mat(2*nTrk+1,2) = dFPxzdzs;
719  }
720  }
721  }
722 
723  Wb_mat = Wmeas_mat.similarity(Bjac_mat) ;
724  Wb_mat = Wb_mat.inverse();
725 
726  C22_mat = Wb_mat.similarity(Ajac_mat.transpose());
727  C22_mat = C22_mat.inverse();
728 
729  Btemp_mat = Wb_mat * Bjac_mat * Wmeas_mat;
730  Atemp_mat = Wb_mat * Ajac_mat;
731 
732  C21_mat = - C22_mat * Ajac_mat.transpose() * Btemp_mat;
733  C32_mat = Atemp_mat * C22_mat;
734  C31_mat = Btemp_mat + Atemp_mat * C21_mat;
735  Amg::MatrixX mat_prod_1 = Wmeas_mat * Bjac_mat.transpose();
736  Amg::MatrixX mat_prod_2 = Wmeas_mat * Bjac_mat.transpose() * Wb_mat * Ajac_mat;
737  C11_mat = Wmeas_mat - Wb_mat.similarity( mat_prod_1 ) + C22_mat.similarity( mat_prod_2 );
738 
739  C_cor_vec = Ajac_mat*DeltaA_vec + Bjac_mat*DeltaY_vec;
740  C_vec = C_cor_vec + F_vec;
741 
742  DeltaY_vec = C31_mat.transpose()*C_vec;
743  DeltaA_vec = C32_mat.transpose()*C_vec;
744 
745  for (unsigned int i=0; i<n_dim; ++i)
746  {
747  ChiItr_vec(0,i) = DeltaY_vec(i);
748  }
749  ChiItr_mat = Wmeas0_mat.similarity( ChiItr_vec );
750  chi2New = ChiItr_mat(0,0);
751 
752  // current vertex position in global coordinates
753  frameOriginItr[0] += DeltaA_vec(0);
754  frameOriginItr[1] += DeltaA_vec(1);
755  frameOriginItr[2] += DeltaA_vec(2);
756  if (msgLvl(MSG::DEBUG)) {
757  msg(MSG::DEBUG) << "New vertex, global coordinates: " << frameOriginItr.transpose() << endmsg;
758  msg(MSG::DEBUG) << "chi2Old: " << chi2Old << " chi2New: " << chi2New << " fabs(chi2Old-chi2New): " << fabs(chi2Old-chi2New) << endmsg;
759  }
760 
761  const Amg::Vector3D * globalPositionItr = &frameOriginItr;
762  if (globalPositionItr->perp() > m_maxR && globalPositionItr->z() > m_maxZ) return nullptr;
763 
764  if (onConstr && fabs(chi2Old-chi2New) < 0.1) { break; }
765 
766  double BFieldItr[3];
767  fieldCache.getField(globalPositionItr->data(),BFieldItr);
768  double B_z_new = BFieldItr[2]*299.792; // should be in GeV/mm
769  if (B_z_new == 0. || std::isnan(B_z)) {
770  ATH_MSG_DEBUG("Using old B_z");
771  B_z_new = B_z;
772  }
773 
774  restartFit = false;
775  double deltaR = sqrt(DeltaA_vec(0)*DeltaA_vec(0)+DeltaA_vec(1)*DeltaA_vec(1)+DeltaA_vec(2)*DeltaA_vec(2));
776  double deltaB_z = fabs(B_z-B_z_new)/B_z;
777  bool changeBz = false;
778 
779  if (m_deltaR) {
780  if (deltaR > 5. && itr < m_maxIterations-1) changeBz = true;
781  } else {
782  if (deltaB_z > 0.000001 && itr < m_maxIterations-1) changeBz = true;
783  }
784 
785  if (changeBz) {
786  B_z = B_z_new;
787 
788  v0FitterTracks.clear();
789  Trk::PerigeeSurface perigeeSurfaceItr(*globalPositionItr);
790  // Extrapolate the perigees to the new startpoint of the fit
791  for (const Trk::TrackParameters* chargeParameters : originalPerigees)
792  {
793  if (chargeParameters != nullptr)
794  {
795  // Correct material changes
796  const Amg::Vector3D gMomentum = chargeParameters->momentum();
797  const Amg::Vector3D gDirection = chargeParameters->position() - *globalPositionItr;
798  const double extrapolationDirection = gMomentum .dot( gDirection );
800  if(extrapolationDirection > 0) mode = Trk::addNoise;
801  std::unique_ptr<const Trk::Perigee> extrapolatedPerigee(nullptr);
802  std::unique_ptr<const Trk::TrackParameters> tmp =
803  m_extrapolator->extrapolate(ctx,
804  *chargeParameters,
805  perigeeSurfaceItr,
807  true,
808  Trk::pion,
809  mode);
810  // if of right type we want to pass ownership
811  if (tmp && tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) {
812  extrapolatedPerigee.reset(
813  static_cast<const Trk::Perigee*>(tmp.release()));
814  }
815 
816  if (extrapolatedPerigee == nullptr) {
817  ATH_MSG_DEBUG("Perigee was not extrapolated! Taking original one!");
818  const Trk::Perigee* tmpPerigee = dynamic_cast<const Trk::Perigee*>(chargeParameters);
819  if (tmpPerigee!=nullptr) extrapolatedPerigee = std::make_unique<Trk::Perigee>(*tmpPerigee);
820  else return nullptr;
821  }
822 
823  // store track parameters at new starting point
824  V0FitterTrack locV0FitterTrack;
825  locV0FitterTrack.TrkPar[0] = extrapolatedPerigee->parameters()[Trk::d0];
826  locV0FitterTrack.TrkPar[1] = extrapolatedPerigee->parameters()[Trk::z0];
827  locV0FitterTrack.TrkPar[2] = extrapolatedPerigee->parameters()[Trk::phi];
828  locV0FitterTrack.TrkPar[3] = extrapolatedPerigee->parameters()[Trk::theta];
829  locV0FitterTrack.TrkPar[4] = extrapolatedPerigee->parameters()[Trk::qOverP];
830  locV0FitterTrack.Wi_mat = extrapolatedPerigee->covariance()->inverse().eval();
831  locV0FitterTrack.originalPerigee = chargeParameters;
832  v0FitterTracks.push_back(locV0FitterTrack);
833  } else {
834  ATH_MSG_DEBUG("Track parameters are not charged tracks ... fit aborted");
835  return nullptr;
836  }
837  }
838  frameOrigin = frameOriginItr;
839  Y0_vec *= 0.;
840  Y_vec *= 0.;
841  A_vec *= 0.;
842  DeltaY_vec *= 0.;
843  DeltaA_vec *= 0.;
844  chi2Old = 2000000000000.;
845  chi2New = 0.;
846  sumConstr = 0.;
847  onConstr = false;
848  restartFit = true;
849  }
850 
851  //if (onConstr && fabs(chi2Old-chi2New) < 0.1) { break; }
852 
853  } // end of iteration
854 
855  frameOrigin[0] += DeltaA_vec(0);
856  frameOrigin[1] += DeltaA_vec(1);
857  frameOrigin[2] += DeltaA_vec(2);
858  if ( std::isnan(frameOrigin[0]) || std::isnan(frameOrigin[1]) || std::isnan(frameOrigin[2]) ) return nullptr;
859 
860  Y_vec = Y0_vec + DeltaY_vec;
861 
862  // check theta and phi ranges
863  for (unsigned int i=0; i<nTrk; ++i)
864  {
865  if ( fabs ( Y_vec(2+5*i) ) > 100. || fabs ( Y_vec(3+5*i) ) > 100. ) { return nullptr; }
866  while ( fabs ( Y_vec(2+5*i) ) > M_PI ) Y_vec(2+5*i) += ( Y_vec(2+5*i) > 0 ) ? -2*M_PI : 2*M_PI;
867  while ( Y_vec(3+5*i) > 2*M_PI ) Y_vec(3+5*i) -= 2*M_PI;
868  while ( Y_vec(3+5*i) < -M_PI ) Y_vec(3+5*i) += M_PI;
869  if ( Y_vec(3+5*i) > M_PI )
870  {
871  Y_vec(3+5*i) = 2*M_PI - Y_vec(3+5*i);
872  if ( Y_vec(2+5*i) >= 0 ) Y_vec(2+5*i) += ( Y_vec(2+5*i) >0 ) ? -M_PI : M_PI;
873  }
874  if ( Y_vec(3+5*i) < 0.0 )
875  {
876  Y_vec(3+5*i) = - Y_vec(3+5*i);
877  if ( Y_vec(2+5*i) >= 0 ) Y_vec(2+5*i) += ( Y_vec(2+5*i) >0 ) ? -M_PI : M_PI;
878  }
879  }
880 
881  for (unsigned int i=0; i<n_dim; ++i)
882  {
883  Chi_vec(0,i) = DeltaY_vec(i);
884  }
885  Chi_mat = Wmeas0_mat.similarity( Chi_vec );
886  chi2 = Chi_mat(0,0);
887 
888  V_mat.setZero();
889  V_mat.block(0,0,n_dim,n_dim) = C11_mat;
890  V_mat.block(n_dim,n_dim,3,3) = C22_mat;
891  V_mat.block(n_dim,0,3,n_dim) = C21_mat;
892  V_mat.block(0,n_dim,n_dim,3) = C21_mat.transpose();
893 
894  // ===> loop over tracks
896  int iRP=0;
897  for (BTIter = v0FitterTracks.begin(); BTIter != v0FitterTracks.end() ; ++BTIter)
898  {
899  // chi2 per track
900  AmgSymMatrix(5) covTrk; covTrk.setZero();
901  covTrk = Wmeas0_mat.block(5*iRP,5*iRP,4+5*iRP,4+5*iRP);
902  AmgVector(5) chi_vec; chi_vec.setZero();
903  for (unsigned int i=0; i<5; ++i) chi_vec(i) = DeltaY_vec(i+5*iRP);
904  double chi2Trk = chi_vec.dot(covTrk*chi_vec);
905  (*BTIter).chi2=chi2Trk;
906  iRP++;
907  }
908 
909  // Store the vertex
910  xAOD::Vertex* vx = new xAOD::Vertex;
911  vx->makePrivateStore();
912  vx->setPosition (frameOrigin);
913  vx->setCovariancePosition (C22_mat);
914  vx->setFitQuality(chi2,static_cast<float>(ndf));
915  vx->setVertexType(xAOD::VxType::V0Vtx);
916 
917  // Store the tracks at vertex
918  std::vector<VxTrackAtVertex> & tracksAtVertex = vx->vxTrackAtVertex(); tracksAtVertex.clear();
919  Amg::Vector3D Vertex(frameOrigin[0],frameOrigin[1],frameOrigin[2]);
920  const Trk::PerigeeSurface Surface(Vertex);
921  Trk::Perigee * refittedPerigee(nullptr);
922  unsigned int iterf=0;
923  std::vector<V0FitterTrack>::iterator BTIterf;
924  for (BTIterf = v0FitterTracks.begin(); BTIterf != v0FitterTracks.end() ; ++BTIterf)
925  {
926  AmgSymMatrix(5) CovMtxP;
927  CovMtxP.setIdentity();
928  for (unsigned int i=0; i<5; ++i) {
929  for (unsigned int j=0; j<i+1; ++j) {
930  double val = V_mat(5*iterf+i,5*iterf+j);
931  CovMtxP.fillSymmetric(i,j,val);
932  }
933  }
934  refittedPerigee = new Trk::Perigee (Y_vec(0+5*iterf),Y_vec(1+5*iterf),Y_vec(2+5*iterf),Y_vec(3+5*iterf),Y_vec(4+5*iterf),
935  Surface, std::move(CovMtxP));
936  tracksAtVertex.emplace_back((*BTIterf).chi2, refittedPerigee, (*BTIterf).originalPerigee);
937  iterf++;
938  }
939 
940  // Full Covariance Matrix
941  unsigned int sfcmv = nPar*(nPar+1)/2;
942  std::vector<float> floatErrMtx(sfcmv,0.);
943  unsigned int ipnt = 0;
944  for (unsigned int i=0; i<nPar; ++i) {
945  for (unsigned int j=0; j<i+1; ++j) {
946  floatErrMtx[ipnt++]=V_mat(i,j);
947  }
948  }
949  vx->setCovariance(floatErrMtx);
950 
951  return vx;
952  }

◆ fit() [7/13]

xAOD::Vertex * Trk::TrkV0VertexFitter::fit ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const xAOD::Vertex constraint 
) const
overridevirtual

Interface for TrackParameters with xAOD::Vertex starting point.

Interface for Trk::TrackParameters with xAOD::Vertex starting point.

Definition at line 201 of file TrkV0VertexFitter.cxx.

203  {
204  std::vector<double> masses;
205  double constraintMass = -9999.;
206  xAOD::Vertex * pointingVertex = nullptr;
207  const Amg::Vector3D& startingPoint = firstStartingPoint.position();
208  return fit(originalPerigees, masses, constraintMass, pointingVertex, startingPoint);
209  }

◆ fit() [8/13]

xAOD::Vertex * Trk::TrkV0VertexFitter::fit ( const std::vector< const xAOD::TrackParticle * > &  vectorTrk) const
virtual

Fit interface for xAOD::TrackParticle with no starting point.

Interface for xAOD::TrackParticle with no starting point.

(0,0,0) will be assumed

Definition at line 104 of file TrkV0VertexFitter.cxx.

105  {
106  Amg::Vector3D tmpVtx;
107  tmpVtx.setZero();
108  return fit(vectorTrk, tmpVtx);
109  }

◆ fit() [9/13]

xAOD::Vertex * Trk::TrkV0VertexFitter::fit ( const std::vector< const xAOD::TrackParticle * > &  vectorTrk,
const Amg::Vector3D startingPoint 
) const
overridevirtual

Interface for xAOD::TrackParticle with Amg::Vector3D starting point.

Definition at line 83 of file TrkV0VertexFitter.cxx.

85  {
86  std::vector<double> masses;
87  double constraintMass = -9999.;
88  xAOD::Vertex * pointingVertex = nullptr;
89  return fit(vectorTrk, masses, constraintMass, pointingVertex, firstStartingPoint);
90  }

◆ fit() [10/13]

virtual xAOD::Vertex* Trk::TrkV0VertexFitter::fit ( const std::vector< const xAOD::TrackParticle * > &  vectorTrk,
const std::vector< const xAOD::NeutralParticle * > &  ,
const Amg::Vector3D startingPoint 
) const
inlineoverridevirtual

Definition at line 57 of file TrkV0VertexFitter.h.

60  {
61  msg(MSG::WARNING)
62  << "TrkV0VertexFitter::fit(fit(const std::vector<const "
63  "TrackParticle*>&,const std::vector<const "
64  "Trk::NeutralParticle*>&,const Amg::Vector3D&) ignoring neutrals"
65  << endmsg;
66  return fit(vectorTrk, startingPoint);
67  };

◆ fit() [11/13]

virtual xAOD::Vertex* Trk::TrkV0VertexFitter::fit ( const std::vector< const xAOD::TrackParticle * > &  vectorTrk,
const std::vector< const xAOD::NeutralParticle * > &  ,
const xAOD::Vertex constraint 
) const
inlineoverridevirtual

Definition at line 73 of file TrkV0VertexFitter.h.

76  {
77  msg(MSG::WARNING)
78  << "TrkV0VertexFitter::fit(fit(const std::vector<const "
79  "TrackParticle*>&,const std::vector<const "
80  "Trk::NeutralParticle*>&,const xAOD::Vertex&) ignoring neutrals"
81  << endmsg;
82  return fit(vectorTrk, constraint);
83  };

◆ fit() [12/13]

xAOD::Vertex * Trk::TrkV0VertexFitter::fit ( const std::vector< const xAOD::TrackParticle * > &  vectorTrk,
const std::vector< double > &  masses,
const double &  constraintMass,
const xAOD::Vertex pointingVertex,
const Amg::Vector3D startingPoint 
) const
virtual

Methods specific for the V0 fitter Method taking a vector of tracks, vector of masses and starting point as arguments.

Interface for xAOD::TrackParticle with mass and pointing constraints.

Action: Fits a vertex out of initial set of tracks and applies a mass constraint to the particle reconstructed at the vertex and a pointing constraint: in the case the pointingVertex is a zero pointer, no pointing constraint applied.

Definition at line 112 of file TrkV0VertexFitter.cxx.

117  {
118  const EventContext& ctx = Gaudi::Hive::currentContext();
119  std::vector<const Trk::TrackParameters*> measuredPerigees;
120  std::vector<const Trk::TrackParameters*> measuredPerigees_delete;
121  for (const xAOD::TrackParticle* p : vectorTrk)
122  {
123  if (m_firstMeas) {
124  unsigned int indexFMP;
125  if (p->indexOfParameterAtPosition(indexFMP, xAOD::FirstMeasurement)) {
126  measuredPerigees.push_back(new CurvilinearParameters(p->curvilinearParameters(indexFMP)));
127  ATH_MSG_DEBUG("first measurement on track exists");
128  ATH_MSG_DEBUG("first measurement " << p->curvilinearParameters(indexFMP));
129  ATH_MSG_DEBUG("first measurement covariance " << *(p->curvilinearParameters(indexFMP)).covariance());
130  } else {
131  Amg::Transform3D CylTrf;
132  CylTrf.setIdentity();
133  Trk::CylinderSurface estimationCylinder(CylTrf, p->radiusOfFirstHit(), 10e10);
134  const Trk::TrackParameters* chargeParameters = &p->perigeeParameters();
136  const Trk::TrackParameters* extrapolatedPerigee(nullptr);
137  extrapolatedPerigee = m_extrapolator->extrapolate(ctx,
138  *chargeParameters,
139  estimationCylinder,
141  true,
142  Trk::pion,
143  mode).release();
144  if (extrapolatedPerigee != nullptr) {
145  ATH_MSG_DEBUG("extrapolated to first measurement");
146  measuredPerigees.push_back (extrapolatedPerigee);
147  measuredPerigees_delete.push_back (extrapolatedPerigee);
148  } else {
149  extrapolatedPerigee =
150  m_extrapolator->extrapolateDirectly(ctx,
151  *chargeParameters,
152  estimationCylinder,
154  true,
155  Trk::pion).release();
156  if (extrapolatedPerigee != nullptr) {
157  ATH_MSG_DEBUG( "extrapolated (direct) to first measurement");
158  measuredPerigees.push_back (extrapolatedPerigee);
159  measuredPerigees_delete.push_back (extrapolatedPerigee);
160  } else {
161  ATH_MSG_DEBUG("Failed to extrapolate to the first measurement on track, using Perigee parameters");
162  measuredPerigees.push_back (&p->perigeeParameters());
163  }
164  }
165  }
166  } else {
167  measuredPerigees.push_back (&p->perigeeParameters());
168  }
169  }
170 
171  xAOD::Vertex * fittedVxCandidate = fit(measuredPerigees, masses, constraintMass, pointingVertex, firstStartingPoint);
172 
173  // assign the used tracks to the V0Candidate
174  if (fittedVxCandidate) {
175  for (const xAOD::TrackParticle* p : vectorTrk)
176  {
178  el.setElement(p);
179  fittedVxCandidate->addTrackAtVertex (el);
180  }
181  }
182 
183  for (const auto *ptr : measuredPerigees_delete){ delete ptr; }
184 
185  return fittedVxCandidate;
186  }

◆ fit() [13/13]

xAOD::Vertex * Trk::TrkV0VertexFitter::fit ( const std::vector< const xAOD::TrackParticle * > &  vectorTrk,
const xAOD::Vertex constraint 
) const
overridevirtual

Interface for xAOD::TrackParticle with xAOD::Vertex starting point.

Definition at line 93 of file TrkV0VertexFitter.cxx.

95  {
96  std::vector<double> masses;
97  double constraintMass = -9999.;
98  xAOD::Vertex * pointingVertex = nullptr;
99  const Amg::Vector3D& startingPoint = firstStartingPoint.position();
100  return fit(vectorTrk, masses, constraintMass, pointingVertex, startingPoint);
101  }

◆ initialize()

StatusCode Trk::TrkV0VertexFitter::initialize ( )
overridevirtual

Definition at line 60 of file TrkV0VertexFitter.cxx.

61  {
62  if ( m_extrapolator.retrieve().isFailure() ) {
63  ATH_MSG_FATAL("Failed to retrieve tool " << m_extrapolator);
64  return StatusCode::FAILURE;
65  }
66  ATH_MSG_DEBUG( "Retrieved tool " << m_extrapolator );
67 
68 
70 
71  ATH_MSG_DEBUG( "Initialize successful");
72  return StatusCode::SUCCESS;
73  }

Member Data Documentation

◆ m_deltaR

bool Trk::TrkV0VertexFitter::m_deltaR
private

Definition at line 175 of file TrkV0VertexFitter.h.

◆ m_extrapolator

ToolHandle< Trk::IExtrapolator > Trk::TrkV0VertexFitter::m_extrapolator
private

Data members to store the results.

Definition at line 179 of file TrkV0VertexFitter.h.

◆ m_fieldCacheCondObjInputKey

SG::ReadCondHandleKey<AtlasFieldCacheCondObj> Trk::TrkV0VertexFitter::m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
private

Definition at line 180 of file TrkV0VertexFitter.h.

◆ m_firstMeas

bool Trk::TrkV0VertexFitter::m_firstMeas
private

Definition at line 174 of file TrkV0VertexFitter.h.

◆ m_maxDchi2PerNdf

double Trk::TrkV0VertexFitter::m_maxDchi2PerNdf
private

Definition at line 171 of file TrkV0VertexFitter.h.

◆ m_maxIterations

int Trk::TrkV0VertexFitter::m_maxIterations
private

Definition at line 170 of file TrkV0VertexFitter.h.

◆ m_maxR

double Trk::TrkV0VertexFitter::m_maxR
private

Definition at line 172 of file TrkV0VertexFitter.h.

◆ m_maxZ

double Trk::TrkV0VertexFitter::m_maxZ
private

Definition at line 173 of file TrkV0VertexFitter.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:30
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:57
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
perp
Scalar perp() const
perp method - perpenticular length
Definition: AmgMatrixBasePlugin.h:44
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
Trk::TrkV0VertexFitter::m_deltaR
bool m_deltaR
Definition: TrkV0VertexFitter.h:175
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::CurvilinearParameters
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:29
LB_AnalMapSplitter.of
of
Definition: LB_AnalMapSplitter.py:48
Trk::TrkV0VertexFitter::MATINV
@ MATINV
Definition: TrkV0VertexFitter.h:49
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Trk::z0
@ z0
Definition: ParamDefs.h:64
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
Trk::MaterialUpdateMode
MaterialUpdateMode
This is a steering enum to force the material update it can be: (1) addNoise (-1) removeNoise Second ...
Definition: MaterialUpdateMode.h:18
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
Phi
@ Phi
Definition: RPCdef.h:8
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::TrkV0VertexFitter::m_maxR
double m_maxR
Definition: TrkV0VertexFitter.h:172
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
xAOD::Vertex_v1::addTrackAtVertex
void addTrackAtVertex(const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
Add a new track to the vertex.
Definition: Vertex_v1.cxx:314
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Trk::TrkV0VertexFitter::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Data members to store the results.
Definition: TrkV0VertexFitter.h:179
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
xAOD::FirstMeasurement
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.
Definition: TrackingPrimitives.h:213
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
vector
Definition: MultiHisto.h:13
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::TrkV0VertexFitter::FITOK
@ FITOK
Definition: TrkV0VertexFitter.h:49
Trk::TrkV0VertexFitter::NOTRKS
@ NOTRKS
Definition: TrkV0VertexFitter.h:49
Trk::CylinderSurface
Definition: CylinderSurface.h:55
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Trk::TrkV0VertexFitter::MAXCHI2
@ MAXCHI2
Definition: TrkV0VertexFitter.h:49
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Preparation.mode
mode
Definition: Preparation.py:94
Trk::TrkV0VertexFitter::m_maxDchi2PerNdf
double m_maxDchi2PerNdf
Definition: TrkV0VertexFitter.h:171
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
Trk::ParametersBase
Definition: ParametersBase.h:55
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Trk::TrkV0VertexFitter::m_maxZ
double m_maxZ
Definition: TrkV0VertexFitter.h:173
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::SurfaceType::Perigee
@ Perigee
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Trk::d0
@ d0
Definition: ParamDefs.h:63
Trk::V0Vtx
@ V0Vtx
Vertex from V0 Decay.
Definition: VertexType.h:31
charge
double charge(const T &p)
Definition: AtlasPID.h:538
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::TrkV0VertexFitter::NOFIT
@ NOFIT
Definition: TrkV0VertexFitter.h:49
Trk::TrkV0VertexFitter::NEGTRCHI2
@ NEGTRCHI2
Definition: TrkV0VertexFitter.h:49
Trk::TrkV0VertexFitter::fit
virtual xAOD::Vertex * fit(const std::vector< const xAOD::TrackParticle * > &vectorTrk, const Amg::Vector3D &startingPoint) const override
Interface for xAOD::TrackParticle with Amg::Vector3D starting point.
Definition: TrkV0VertexFitter.cxx:83
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Trk::addNoise
@ addNoise
Definition: MaterialUpdateMode.h:19
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
DEBUG
#define DEBUG
Definition: page_access.h:11
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
python.changerun.pv
pv
Definition: changerun.py:81
Trk::TrkV0VertexFitter::MAXTRCHI2
@ MAXTRCHI2
Definition: TrkV0VertexFitter.h:49
MagField::AtlasFieldCache::getField
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
Definition: AtlasFieldCache.cxx:42
dot
Definition: dot.py:1
Trk::TrkV0VertexFitter::m_maxIterations
int m_maxIterations
Definition: TrkV0VertexFitter.h:170
Trk::phi
@ phi
Definition: ParamDefs.h:75
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
Trk::TrkV0VertexFitter::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: TrkV0VertexFitter.h:181
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::removeNoise
@ removeNoise
Definition: MaterialUpdateMode.h:20
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
fitman.rho
rho
Definition: fitman.py:532
Trk::TrkV0VertexFitter::m_firstMeas
bool m_firstMeas
Definition: TrkV0VertexFitter.h:174
SUSY_SimplifiedModel_PreInclude.masses
dictionary masses
Definition: SUSY_SimplifiedModel_PreInclude.py:7