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

#include <V0Tools.h>

Inheritance diagram for Trk::V0Tools:
Collaboration diagram for Trk::V0Tools:

Public Member Functions

 V0Tools (const std::string &t, const std::string &n, const IInterface *p)
 Default constructor due to Athena interface. More...
 
 ~V0Tools ()
 Virtual destructor. More...
 
StatusCode initialize ()
 Standard AlgTool methods. More...
 
double invariantMass (const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
 Methods, returning the invariant mass, error on the invariant mass and Chi2 probability of the invariant mass of an xAOD::Vertex for a given hypothesis for the masses of the input tracks and the V0 mass. More...
 
double invariantMass (const xAOD::Vertex *vxCandidate, std::span< const double > masses) const
 
double invariantMassError (const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
 
double invariantMassError (const xAOD::Vertex *vxCandidate, std::span< const double > masses) const
 
double invariantMassProbability (const xAOD::Vertex *vxCandidate, double V0Mass, double posTrackMass, double negTrackMass) const
 
double invariantMassProbability (const xAOD::Vertex *vxCandidate, double V0Mass, std::span< const double > masses) const
 
double massProbability (double V0Mass, double mass, double massErr) const
 
double vertexProbability (const xAOD::Vertex *vxCandidate) const
 Probability of the vertex fit. More...
 
double rxyError (const xAOD::Vertex *vxCandidate) const
 error on Rxy More...
 
double rxyError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex) const
 wrt an xAOD::Vertex vertex More...
 
double rxyError (const xAOD::Vertex *vxCandidate, const Amg::Vector3D &vertex) const
 wrt an Amg::Vector3D vertex More...
 
double pTError (const xAOD::Vertex *vxCandidate) const
 error on the transverse momentum of the V0 More...
 
double separation (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex) const
 statistical separation (Mahalanobis distance) More...
 
double separation (const xAOD::Vertex *vxCandidate, const Amg::Vector3D &vertex) const
 
double a0xyError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex) const
 errors on a0xy and a0z More...
 
double a0zError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex) const
 
double a0Error (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, bool in3D=true) const
 error on a0 More...
 
double lxyError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex) const
 error on lxy More...
 
double lxyzError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex) const
 error on lxyz More...
 
double tau (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double posTrackMass, double negTrackMass) const
 proper time wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass tau = CONST*M*lxy/pT More...
 
double tau (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
 proper time wrt an xAOD::Vertex vertex assuming track masses More...
 
double tau (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double posTrackMass, double negTrackMass, double massV0) const
 proper time wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass (imposing massV0) making a correction to the proper time consistent with the imposed V0 mass More...
 
double tau (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses, double massV0) const
 proper time wrt an xAOD::Vertex vertex assuming track masses (imposing massV0) making a correction to the proper time consistent with the imposed V0 mass More...
 
double tauError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double posTrackMass, double negTrackMass) const
 proper time error wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass tau = CONST*M*lxy/pT More...
 
double tauError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
 proper time error wrt an xAOD::Vertex vertex assuming track masses More...
 
double tauError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double posTrackMass, double negTrackMass, double massV0) const
 proper time error wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass (imposing massV0) independent of massV0, variable included to match the corresponding proper time method More...
 
double tauError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses, double massV0) const
 proper time error wrt an xAOD::Vertex vertex assuming track masses (imposing massV0) independent of massV0, variable included to match the corresponding proper time method More...
 
double tauError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double massV0) const
 proper time error wrt an xAOD::Vertex vertex assuming massV0 imposing a V0 mass without making an adjustment More...
 
Amg::MatrixX tauMassCovariance (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
 mass-proper time covariance More...
 
double massTauCov (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
 
double tau3D (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
 proper time in 3D wrt an xAOD::Vertex vertex assuming track masses More...
 
double tau3DError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
 proper time error in 3D wrt an xAOD::Vertex vertex assuming track masses More...
 
double tau3DError (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double massV0) const
 proper time error in 3D wrt an xAOD::Vertex vertex assuming massV0 imposing a V0 mass without making an adjustment More...
 
double invariantMassBeforeFitIP (const xAOD::Vertex *vxCandidate, std::span< const double > masses) const
 create neutral TrackParticle from vxCandidate More...
 
double invariantMassBeforeFit (const xAOD::Vertex *vxCandidate, std::span< const double > masses, const EventContext &, const Trk::IExtrapolator *) const
 
double invariantMassBeforeFit (const xAOD::Vertex *vxCandidate, std::span< const double > masses, const Amg::Vector3D &vertex, const EventContext &, const Trk::IExtrapolator *) const
 
double invariantMassErrorBeforeFitIP (const xAOD::Vertex *vxCandidate, std::span< const double > masses) const
 
double invariantMassErrorBeforeFit (const xAOD::Vertex *vxCandidate, std::span< const double > masses, const EventContext &ctx, const Trk::IExtrapolator *) const
 
double invariantMassErrorBeforeFit (const xAOD::Vertex *vxCandidate, std::span< const double > masses, const Amg::Vector3D &vertex, const EventContext &ctx, const Trk::IExtrapolator *) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods. More...
 
static Amg::Vector3D trackMomentum (const xAOD::Vertex *vxCandidate, unsigned int trkIndex)
 Methods, returning the refitted 3-momenta of the positive and negative tracks and the V0 (for more than one track with the same charge, the first one is returned) More...
 
static Amg::Vector3D positiveTrackMomentum (const xAOD::Vertex *vxCandidate)
 
static Amg::Vector3D negativeTrackMomentum (const xAOD::Vertex *vxCandidate)
 
static Amg::Vector3D V0Momentum (const xAOD::Vertex *vxCandidate)
 
static xAOD::TrackParticle::FourMom_t track4Momentum (const xAOD::Vertex *vxCandidate, unsigned int trkIndex, double trackMass)
 Methods, returning the refitted 4-momenta of the positive and negative tracks and the V0 for a given hypothesis for the masses of the input tracks and the V0 mass. More...
 
static xAOD::TrackParticle::FourMom_t positiveTrack4Momentum (const xAOD::Vertex *vxCandidate, double posTrackMass)
 
static xAOD::TrackParticle::FourMom_t negativeTrack4Momentum (const xAOD::Vertex *vxCandidate, double negTrackMass)
 
static xAOD::TrackParticle::FourMom_t V04Momentum (const xAOD::Vertex *vxCandidate, double V0Mass)
 
static float ndof (const xAOD::Vertex *vxCandidate)
 NDoF of the vertex fit. More...
 
static float chisq (const xAOD::Vertex *vxCandidate)
 Chisq of the vertex fit. More...
 
static Amg::Vector3D vtx (const xAOD::Vertex *vxCandidate)
 vertex position More...
 
static double rxy (const xAOD::Vertex *vxCandidate)
 Rxy of the vertex. More...
 
static double rxy (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 wrt an xAOD::Vertex vertex More...
 
static double rxy (const xAOD::Vertex *vxCandidate, const Amg::Vector3D &vertex)
 wrt an Amg::Vector3D vertex More...
 
static double rxy_var (double dx, double dy, const Amg::MatrixX &cov)
 rxy_var More...
 
static double pT (const xAOD::Vertex *vxCandidate)
 transverse momentum of the V0 More...
 
static double a0xy (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 closest distance in Z and the transverse plane of the momentum vector to an xAOD::Vertex a0xy using transverse measurements only a0z using the point of closest approach (3D) More...
 
static double a0z (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 
static double a0 (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 closest distance of the momentum vector to an xAOD::Vertex More...
 
static Amg::Vector3D pca (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 point of closest approach of the momentum vector to an xAOD::Vertex More...
 
static double lxy (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 projection of distance in xy of the vertex wrt an xAOD::Vertex vertex along the momentum direction (Px*dx+Py*dy)/pT More...
 
static double lxyz (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 projection of distance in 3D of the vertex wrt an xAOD::Vertex vertex along the momentum direction (Px*dx+Py*dy+Pz*dz)/p More...
 
static double tau (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double massV0)
 proper time wrt an xAOD::Vertex vertex assuming massV0 imposing a V0 mass without making an adjustment More...
 
static double tau3D (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double massV0)
 proper time in 3D wrt an xAOD::Vertex vertex assuming massV0 imposing a V0 mass without making an adjustment More...
 
static double thetaStar (const xAOD::Vertex *vxCandidate, double mass1, double mass2)
 Polarization angles in helicity frame (using positive track): More...
 
static double cosThetaStar (const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass)
 cosThetaStar More...
 
static double cosThetaStar (const CLHEP::HepLorentzVector &posTrack, const CLHEP::HepLorentzVector &negTrack)
 
static double phiStar (const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass)
 phiStar More...
 
static double phiStar (const CLHEP::HepLorentzVector &v0, const CLHEP::HepLorentzVector &track)
 
static double cosTheta (const xAOD::Vertex *vxCandidate, const Amg::Vector3D &vertex)
 cosTheta (pointing angle to an Amg::Vector3D or an xAOD::Vertex) More...
 
static double cosTheta (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 
static double cosTheta_xy (const xAOD::Vertex *vxCandidate, const Amg::Vector3D &vertex)
 cosTheta (pointing angle to an Amg::Vector3D or an xAOD::Vertex in transverse plane) More...
 
static double cosTheta_xy (const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
 
static float charge (const xAOD::Vertex *vxCandidate)
 sum of the charges of the tracks in the vertex More...
 
static const xAOD::TrackParticleorigTrack (const xAOD::Vertex *vxCandidate, int trkIndex)
 pointers to original tracks More...
 
static const xAOD::TrackParticlepositiveOrigTrack (const xAOD::Vertex *vxCandidate)
 
static const xAOD::TrackParticlenegativeOrigTrack (const xAOD::Vertex *vxCandidate)
 
static Amg::MatrixX convertCovMatrix (const xAOD::Vertex *vxCandidate)
 
static Amg::MatrixX makeV0Cov (const xAOD::Vertex *vxCandidate)
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

double massErrorV0Fitter (const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
 
double massErrorV0Fitter (const xAOD::Vertex *vxCandidate, std::span< const double > masses) const
 
double massErrorVKalVrt (const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
 
double massErrorVKalVrt (const xAOD::Vertex *vxCandidate, std::span< const double > masses) const
 
double massErrorVxCandidate (const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
 
double massErrorVxCandidate (const xAOD::Vertex *vxCandidate, std::span< const double > masses) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 35 of file V0Tools.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ V0Tools()

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

Default constructor due to Athena interface.

Definition at line 32 of file V0Tools.cxx.

35  {
36  ATH_MSG_DEBUG( "Initialize successful" );

◆ ~V0Tools()

V0Tools::~V0Tools ( )
default

Virtual destructor.

Member Function Documentation

◆ a0()

double V0Tools::a0 ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

closest distance of the momentum vector to an xAOD::Vertex

Definition at line 687 of file V0Tools.cxx.

690  {
691  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
692  auto vert = vxCandidate->position() - vertex->position();
693  double dx = vert.x();

◆ a0Error()

double V0Tools::a0Error ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
bool  in3D = true 
) const

error on a0

Definition at line 814 of file V0Tools.cxx.

822  {
823  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
824  double trkCharge = 1.;
825  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
826  double phi = bPer->parameters()[Trk::phi];
827  double theta = bPer->parameters()[Trk::theta];
828  double qOverP = bPer->parameters()[Trk::qOverP];
829  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
830  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
831  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
832  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
833  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
834  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
835  if ( in3D ) {
836  dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
837  dpzdtheta[it] = -(sin(theta)*trkCharge)/qOverP;
838  }
839  Px += bPer->momentum()[Trk::px];
840  Py += bPer->momentum()[Trk::py];
841  Pz += bPer->momentum()[Trk::pz];
842  }
843  double cosineTheta;
844  double a0val;
845  if ( in3D ) {
846  cosineTheta = cosTheta(vxCandidate,vertex);
847  a0val = a0(vxCandidate,vertex);
848  } else { // transforms momentum and vertex separation to transverse plane and leads also to zero dXdz derivatives
849  cosineTheta = cosTheta_xy(vxCandidate,vertex);
850  a0val = a0xy(vxCandidate,vertex);
851  Pz = 0.;
852  dz = 0.;
853  }
854  double P = sqrt(Px*Px+Py*Py+Pz*Pz);
855  double r = sqrt(dx*dx+dy*dy+dz*dz);
856 
857  double da0dx = (Px/P*r*cosineTheta - dx)/a0val;
858  double da0dy = (Py/P*r*cosineTheta - dy)/a0val;
859  double da0dz = (Pz/P*r*cosineTheta - dz)/a0val;
860  double da0dx0 = -da0dx;
861  double da0dy0 = -da0dy;
862  double da0dz0 = -da0dz;
863  for( unsigned int it=0; it<NTrk; it++) {
864  da0dqOverP[it] = -(r*cosineTheta/P)*(da0dx*dpxdqOverP[it]+da0dy*dpydqOverP[it]+da0dz*dpzdqOverP[it]);
865  da0dtheta[it] = -(r*cosineTheta/P)*(da0dx*dpxdtheta[it]+da0dy*dpydtheta[it]+da0dz*dpzdtheta[it]);
866  da0dphi[it] = -(r*cosineTheta/P)*(da0dx*dpxdphi[it]+da0dy*dpydphi[it]);
867  }
868 
869  unsigned int ndim = 0;
870  if (fullCov.size() != 0) {
871  ndim = fullCov.rows();
872  } else {
873  ndim = 5*NTrk+3;
874  }
875 
876  Amg::MatrixX V0_err;
877  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
878  Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
879  for( unsigned int it=0; it<NTrk; it++) {
880  D_vec(5*it+0) = 0.;
881  D_vec(5*it+1) = 0.;
882  D_vec(5*it+2) = da0dphi[it];
883  D_vec(5*it+3) = da0dtheta[it];
884  D_vec(5*it+4) = da0dqOverP[it];
885  }
886  D_vec(5*NTrk+0) = da0dx;
887  D_vec(5*NTrk+1) = da0dy;
888  D_vec(5*NTrk+2) = da0dz;
889  D_vec(5*NTrk+3) = da0dx0;
890  D_vec(5*NTrk+4) = da0dy0;
891  D_vec(5*NTrk+5) = da0dz0;
892 
893  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
894  if (fullCov.size() != 0) {
895  W_mat.block(0,0,ndim,ndim) = fullCov;
896  } else {
897  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
898  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
899  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
900  }
901  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
902  V0_err = D_vec.transpose() * W_mat * D_vec;
903  } else if (ndim == 3*NTrk+3) {
904  Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
905  D_vec(0) = da0dx;
906  D_vec(1) = da0dy;
907  D_vec(2) = da0dz;
908  for( unsigned int it=0; it<NTrk; it++) {
909  D_vec(3*it+3) = da0dphi[it];
910  D_vec(3*it+4) = da0dtheta[it];
911  D_vec(3*it+5) = da0dqOverP[it];
912  }
913  D_vec(3*NTrk+3) = da0dx0;
914  D_vec(3*NTrk+4) = da0dy0;
915  D_vec(3*NTrk+5) = da0dz0;
916 
917  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
918  W_mat.block(0,0,ndim,ndim) = fullCov;
919  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
920  V0_err = D_vec.transpose() * W_mat * D_vec;
921  }
922 
923  double a0Errsq = V0_err(0,0);
924  if (a0Errsq <= 0.) ATH_MSG_DEBUG("a0Error: negative sqrt a0Errsq " << a0Errsq);
925  double a0Err = (a0Errsq>0.) ? sqrt(a0Errsq) : 0.;
926  return a0Err;
927  }
928 
929  double V0Tools::lxy(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex)
930  {
931  auto vert = vxCandidate->position() - vertex->position();
932  double dx = vert.x();
933  double dy = vert.y();

◆ a0xy()

double V0Tools::a0xy ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

closest distance in Z and the transverse plane of the momentum vector to an xAOD::Vertex a0xy using transverse measurements only a0z using the point of closest approach (3D)

Definition at line 671 of file V0Tools.cxx.

674  {
675  Amg::Vector3D pv = vertex->position();
676  Amg::Vector3D ca_point = pca(vxCandidate,vertex);
677  Amg::Vector3D a0_vec = pv - ca_point;

◆ a0xyError()

double V0Tools::a0xyError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
) const

errors on a0xy and a0z

Definition at line 809 of file V0Tools.cxx.

809  {
810  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
811  auto vert = vxCandidate->position() - vertex->position();
812  double dx = vert.x();

◆ a0z()

double V0Tools::a0z ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

Definition at line 679 of file V0Tools.cxx.

682  {
683  double cosineTheta = cosTheta(vxCandidate,vertex);
684  double sinTheta = ((1.-cosineTheta*cosineTheta)>0.) ? sqrt((1.-cosineTheta*cosineTheta)) : 0.;
685  return (vtx(vxCandidate)-vertex->position()).mag() * sinTheta;

◆ a0zError()

double V0Tools::a0zError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
) const

Definition at line 695 of file V0Tools.cxx.

703  {
704  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
705  double trkCharge = 1.;
706  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
707  double phi = bPer->parameters()[Trk::phi];
708  double theta = bPer->parameters()[Trk::theta];
709  double qOverP = bPer->parameters()[Trk::qOverP];
710  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
711  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
712  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
713  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
714  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
715  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
716  dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
717  dpzdtheta[it] = -(sin(theta)*trkCharge)/qOverP;
718  Px += bPer->momentum()[Trk::px];
719  Py += bPer->momentum()[Trk::py];
720  Pz += bPer->momentum()[Trk::pz];
721  }
722  double P2 = Px*Px+Py*Py+Pz*Pz;
723  double B = Px*dx+Py*dy+Pz*dz;
724 
725  double da0dx = (Px*Pz)/P2;
726  double da0dy = (Py*Pz)/P2;
727  double da0dz = (Pz*Pz)/P2 - 1.;
728  double da0dx0 = -da0dx;
729  double da0dy0 = -da0dy;
730  double da0dz0 = -da0dz;
731  for( unsigned int it=0; it<NTrk; it++) {
732  double dP2dqOverP = 2.*(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]);
733  double dP2dtheta = 2.*(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it]);
734  double dP2dphi = 2.*(Px*dpxdphi[it]+Py*dpydphi[it]);
735  da0dqOverP[it] = (B*(P2*dpzdqOverP[it]-Pz*dP2dqOverP) +
736  Pz*P2*(dx*dpxdqOverP[it]+dy*dpydqOverP[it]+dz*dpzdqOverP[it]))/(P2*P2);
737  da0dtheta[it] = (B*(P2*dpzdtheta[it]-Pz*dP2dtheta) +
738  Pz*P2*(dx*dpxdtheta[it]+dy*dpydtheta[it]+dz*dpzdtheta[it]))/(P2*P2);
739  da0dphi[it] = -(B*Pz*dP2dphi -
740  Pz*P2*(dx*dpxdphi[it]+dy*dpydphi[it]))/(P2*P2);
741  }
742 
743  unsigned int ndim = 0;
744  if (fullCov.size() != 0) {
745  ndim = fullCov.rows();
746  } else {
747  ndim = 5*NTrk+3;
748  }
749 
750  Amg::MatrixX V0_err;
751  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
752  Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
753  for( unsigned int it=0; it<NTrk; it++) {
754  D_vec(5*it+0) = 0.;
755  D_vec(5*it+1) = 0.;
756  D_vec(5*it+2) = da0dphi[it];
757  D_vec(5*it+3) = da0dtheta[it];
758  D_vec(5*it+4) = da0dqOverP[it];
759  }
760  D_vec(5*NTrk+0) = da0dx;
761  D_vec(5*NTrk+1) = da0dy;
762  D_vec(5*NTrk+2) = da0dz;
763  D_vec(5*NTrk+3) = da0dx0;
764  D_vec(5*NTrk+4) = da0dy0;
765  D_vec(5*NTrk+5) = da0dz0;
766 
767  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
768  if (fullCov.size() != 0) {
769  W_mat.block(0,0,ndim,ndim) = fullCov;
770  } else {
771  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
772  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
773  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
774  }
775  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
776  V0_err = D_vec.transpose() * W_mat * D_vec;
777  } else if (ndim == 3*NTrk+3) {
778  Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
779  D_vec(0) = da0dx;
780  D_vec(1) = da0dy;
781  D_vec(2) = da0dz;
782  for( unsigned int it=0; it<NTrk; it++) {
783  D_vec(3*it+3) = da0dphi[it];
784  D_vec(3*it+4) = da0dtheta[it];
785  D_vec(3*it+5) = da0dqOverP[it];
786  }
787  D_vec(3*NTrk+3) = da0dx0;
788  D_vec(3*NTrk+4) = da0dy0;
789  D_vec(3*NTrk+5) = da0dz0;
790 
791  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
792  W_mat.block(0,0,ndim,ndim) = fullCov;
793  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
794  V0_err = D_vec.transpose() * W_mat * D_vec;
795  }
796 
797  double a0Errsq = V0_err(0,0);
798  if (a0Errsq <= 0.) ATH_MSG_DEBUG("a0Error: negative sqrt a0Errsq " << a0Errsq);
799  double a0Err = (a0Errsq>0.) ? sqrt(a0Errsq) : 0.;
800  return a0Err;
801  }
802 
803  double V0Tools::a0xyError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex) const
804  {
805  return a0Error(vxCandidate, vertex, false);
806  }
807 

◆ charge()

float V0Tools::charge ( const xAOD::Vertex vxCandidate)
static

sum of the charges of the tracks in the vertex

Definition at line 1864 of file V0Tools.cxx.

1873  {
1874  return vxCandidate->trackParticle(trkIndex);
1875  }
1876 

◆ chisq()

float V0Tools::chisq ( const xAOD::Vertex vxCandidate)
static

Chisq of the vertex fit.

Definition at line 458 of file V0Tools.cxx.

458  {
459  float dof = ndof(vxCandidate);
460  if (dof > 0.) {
461  Genfun::CumulativeChiSquare myCumulativeChiSquare(dof);

◆ convertCovMatrix()

Amg::MatrixX V0Tools::convertCovMatrix ( const xAOD::Vertex vxCandidate)
static

Definition at line 2659 of file V0Tools.cxx.

2660  {
2661  ndim = 3*NTrk+3;
2662  } else if (matrix.size() == (5*NTrk+3)*(5*NTrk+3+1)/2) {
2663  ndim = 5*NTrk+3;
2664  } else {
2665  return Amg::MatrixX(0,0);
2666  }
2667 
2668  Amg::MatrixX mtx(ndim,ndim);
2669 
2670  Eigen::Index ij=0;
2671  for (int i=1; i<= ndim; i++) {
2672  for (int j=1; j<=i; j++){
2673  if (i==j) {
2674  mtx(i-1,j-1)=matrix[ij];
2675  } else {
2676  mtx.fillSymmetric(i-1,j-1,matrix[ij]);
2677  }
2678  ij++;
2679  }
2680  }
2681  // NOTE: mtx is a pointer! Take care of deleting it after you do not
2682  // need it anymore!!!!
2683  return mtx;
2684  }
2685 
2686 }//end of namespace definitions

◆ cosTheta() [1/2]

double V0Tools::cosTheta ( const xAOD::Vertex vxCandidate,
const Amg::Vector3D vertex 
)
static

cosTheta (pointing angle to an Amg::Vector3D or an xAOD::Vertex)

Definition at line 1830 of file V0Tools.cxx.

1833  {
1834  auto mom = V0Momentum(vxCandidate);
1835  auto vtx1 = vtx(vxCandidate);
1836  vtx1 -= vertex->position();

◆ cosTheta() [2/2]

double V0Tools::cosTheta ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

Definition at line 1838 of file V0Tools.cxx.

1841  {
1842  auto mom = V0Momentum(vxCandidate);
1843  auto vtx1 = vtx(vxCandidate);
1844  vtx1 -= vertex;

◆ cosTheta_xy() [1/2]

double V0Tools::cosTheta_xy ( const xAOD::Vertex vxCandidate,
const Amg::Vector3D vertex 
)
static

cosTheta (pointing angle to an Amg::Vector3D or an xAOD::Vertex in transverse plane)

Definition at line 1846 of file V0Tools.cxx.

1850  {
1851  auto mom = V0Momentum(vxCandidate);
1852  auto vtx1 = vtx(vxCandidate);
1853  vtx1 -= vertex->position();

◆ cosTheta_xy() [2/2]

double V0Tools::cosTheta_xy ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

Definition at line 1855 of file V0Tools.cxx.

1859  {
1860  float ch = 0.;
1861  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1862  for( unsigned int it=0; it<NTrk; it++) {

◆ cosThetaStar() [1/2]

double V0Tools::cosThetaStar ( const CLHEP::HepLorentzVector &  posTrack,
const CLHEP::HepLorentzVector &  negTrack 
)
static

Definition at line 1788 of file V0Tools.cxx.

1790  : 0.;
1791  ps /= 2.*Mv0;
1792  double pp = v0.px()*posTrack.px() + v0.py()*posTrack.py() + v0.pz()*posTrack.pz();
1793  return ( v0.e()*pp - Pv0*Pv0*posTrack.e())/( Mv0*ps*Pv0);
1794  }
1795 
1796  //double V0Tools::phiStar(xAOD::Vertex * vxCandidate) const
1797  double V0Tools::phiStar(const xAOD::Vertex * vxCandidate, double posTrackMass, double negTrackMass)
1798  {
1799  xAOD::TrackParticle::FourMom_t V_pos = positiveTrack4Momentum(vxCandidate,posTrackMass);
1800  xAOD::TrackParticle::FourMom_t V_neg = negativeTrack4Momentum(vxCandidate,negTrackMass);

◆ cosThetaStar() [2/2]

double V0Tools::cosThetaStar ( const xAOD::Vertex vxCandidate,
double  posTrackMass,
double  negTrackMass 
)
static

cosThetaStar

Definition at line 1779 of file V0Tools.cxx.

1783  {
1784  CLHEP::HepLorentzVector v0(posTrack + negTrack);
1785  double Mv0 = v0.m();
1786  double Mplus = posTrack.m();

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode V0Tools::initialize ( )

Standard AlgTool methods.

Definition at line 40 of file V0Tools.cxx.

41  {
42  std::array<double, 2> masses = {posTrackMass, negTrackMass};
43 
44  return invariantMass(vxCandidate,masses);

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& Trk::V0Tools::interfaceID ( )
inlinestatic

AlgTool interface methods.

Definition at line 57 of file V0Tools.h.

58  {
59  return IID_V0Tools;
60  }

◆ invariantMass() [1/2]

double V0Tools::invariantMass ( const xAOD::Vertex vxCandidate,
double  posTrackMass,
double  negTrackMass 
) const

Methods, returning the invariant mass, error on the invariant mass and Chi2 probability of the invariant mass of an xAOD::Vertex for a given hypothesis for the masses of the input tracks and the V0 mass.

if a negative value for a track is provided, the invariantMass and invariantMassError are returned excluding that track

Definition at line 46 of file V0Tools.cxx.

50  {
51  double px = 0., py = 0., pz = 0., e = 0.;

◆ invariantMass() [2/2]

double V0Tools::invariantMass ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses 
) const

Definition at line 55 of file V0Tools.cxx.

57  {
58  if (masses[it] >= 0.) {
59  xAOD::TrackParticle::FourMom_t lorentz_trk = track4Momentum(vxCandidate,it,masses[it]);
60  px += lorentz_trk.Px();
61  py += lorentz_trk.Py();
62  pz += lorentz_trk.Pz();
63  e += lorentz_trk.E();
64  }
65  }
66  double msq = e*e - px*px - py*py - pz*pz;
67  return (msq>0.) ? sqrt(msq) : 0.;
68  }
69 
70  double V0Tools::invariantMassError(const xAOD::Vertex * vxCandidate, double posTrackMass, double negTrackMass) const
71  {
72  std::array<double, 2> masses = {posTrackMass, negTrackMass};
73 
74  return invariantMassError(vxCandidate,masses);

◆ invariantMassBeforeFit() [1/2]

double V0Tools::invariantMassBeforeFit ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses,
const Amg::Vector3D vertex,
const EventContext &  ctx,
const Trk::IExtrapolator extrap 
) const

Definition at line 2200 of file V0Tools.cxx.

2200  {
2201  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");
2202  return -999999.;
2203  }
2204  for( unsigned int it=0; it<NTrk; it++) {
2205  if (masses[it] >= 0.) {
2206  const xAOD::TrackParticle* TP = origTrack(vxCandidate,it);
2207  if (TP == nullptr) return -999999.;
2208  std::unique_ptr<const Trk::TrackParameters> extrPer =
2209  extrap->extrapolate(ctx, TP->perigeeParameters(), perigeeSurface);
2210  if (extrPer == nullptr)
2211  return -999999.;
2212  px += extrPer->momentum().x();
2213  py += extrPer->momentum().y();
2214  pz += extrPer->momentum().z();
2215  double pesq = extrPer->momentum().mag2() + masses[it]*masses[it];
2216  double pe = (pesq>0.) ? sqrt(pesq) : 0.;
2217  e += pe;
2218  }
2219  }
2220  double msq = e*e - px*px - py*py - pz*pz;
2221  return (msq>0.) ? sqrt(msq) : 0.;
2222  }
2223 
2224  double V0Tools::invariantMassErrorBeforeFitIP(const xAOD::Vertex * vxCandidate, std::span<const double> masses) const
2225  {
2226  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
2227  if (masses.size() != NTrk) {
2228  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ invariantMassBeforeFit() [2/2]

double V0Tools::invariantMassBeforeFit ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses,
const EventContext &  ctx,
const Trk::IExtrapolator extrapolator 
) const

Definition at line 2171 of file V0Tools.cxx.

2174  {
2175  if (masses[it] >= 0.) {
2176  const xAOD::TrackParticle* TP = origTrack(vxCandidate,it);
2177  if (TP == nullptr) return -999999.;
2178  std::unique_ptr<const Trk::TrackParameters> extrPer =
2179  extrapolator->extrapolate(ctx, TP->perigeeParameters(), perigeeSurface);
2180  if (extrPer == nullptr)
2181  return -999999.;
2182  px += extrPer->momentum().x();
2183  py += extrPer->momentum().y();
2184  pz += extrPer->momentum().z();
2185  double pesq = extrPer->momentum().mag2() + masses[it]*masses[it];
2186  double pe = (pesq>0.) ? sqrt(pesq) : 0.;
2187  e += pe;
2188  }
2189  }
2190  double msq = e*e - px*px - py*py - pz*pz;
2191  return (msq>0.) ? sqrt(msq) : 0.;
2192  }
2193 
2194  double V0Tools::invariantMassBeforeFit(const xAOD::Vertex * vxCandidate,
2195  std::span<const double> masses, const Amg::Vector3D& vertex, const EventContext& ctx, const Trk::IExtrapolator* extrap) const
2196  {
2197  Trk::PerigeeSurface perigeeSurface(vertex);
2198  double px = 0., py = 0., pz = 0., e = 0.;

◆ invariantMassBeforeFitIP()

double V0Tools::invariantMassBeforeFitIP ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses 
) const

create neutral TrackParticle from vxCandidate

Methods, returning the invariant mass and the error on the invariant mass calculated from the original track parameters (at the perigee (IP) or at a given vertex position if no vertex is specified, the reconstructed vertex position is used

if a negative value for a track is provided, the invariantMass and invariantMassError are returned excluding that track

Definition at line 2146 of file V0Tools.cxx.

2148  {
2149  if (masses[it] >= 0.) {
2150  const xAOD::TrackParticle* TP = origTrack(vxCandidate,it);
2151  if (TP == nullptr) return -999999.;
2152  TLorentzVector Tp4 = TP->p4();
2153  px += Tp4.Px();
2154  py += Tp4.Py();
2155  pz += Tp4.Pz();
2156  double pesq = 1./(TP->qOverP()*TP->qOverP()) + masses[it]*masses[it];
2157  double pe = (pesq>0.) ? sqrt(pesq) : 0.;
2158  e += pe;
2159  }
2160  }
2161  double msq = e*e - px*px - py*py - pz*pz;
2162  return (msq>0.) ? sqrt(msq) : 0.;
2163  }
2164 
2165  double V0Tools::invariantMassBeforeFit(const xAOD::Vertex * vxCandidate, std::span<const double> masses, const EventContext& ctx, const Trk::IExtrapolator* extrapolator) const
2166  {
2167  Trk::PerigeeSurface perigeeSurface(vxCandidate->position());
2168  double px = 0., py = 0., pz = 0., e = 0.;
2169  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();

◆ invariantMassError() [1/2]

double V0Tools::invariantMassError ( const xAOD::Vertex vxCandidate,
double  posTrackMass,
double  negTrackMass 
) const

Definition at line 76 of file V0Tools.cxx.

78  {
79  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
80  if (masses.size() != NTrk) {
81  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ invariantMassError() [2/2]

double V0Tools::invariantMassError ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses 
) const

Definition at line 83 of file V0Tools.cxx.

86  {
87  ATH_MSG_DEBUG("0 pointer for full covariance. Making-up one from the vertex and tracks covariances");
88  error = massErrorVxCandidate(vxCandidate,masses);
89  } else {
90  unsigned int ndim = fullCov.rows();
91  if (ndim != 0) {
92  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
93  error = massErrorV0Fitter(vxCandidate,masses);
94  } else if (ndim == 3*NTrk+3) {
95  error = massErrorVKalVrt(vxCandidate,masses);
96  }
97  }
98  }
99  return error;
100  }
101 
102  double V0Tools::massErrorV0Fitter(const xAOD::Vertex * vxCandidate, double posTrackMass, double negTrackMass) const
103  {
104  std::array<double, 2> masses = {posTrackMass, negTrackMass};
105 
106  return massErrorV0Fitter(vxCandidate,masses);

◆ invariantMassErrorBeforeFit() [1/2]

double V0Tools::invariantMassErrorBeforeFit ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses,
const Amg::Vector3D vertex,
const EventContext &  ctx,
const Trk::IExtrapolator extrap 
) const

Definition at line 2309 of file V0Tools.cxx.

2316  {
2317  if (masses[it] >= 0.) {
2318  const xAOD::TrackParticle* TP = origTrack(vxCandidate,it);
2319  if (TP == nullptr) return -999999.;
2320  std::unique_ptr<const Trk::TrackParameters> extrPer =
2321  extrap->extrapolate(ctx, TP->perigeeParameters(), perigeeSurface);
2322  if (extrPer == nullptr)
2323  return -999999.;
2324  const AmgSymMatrix(5)* cov_tmp = extrPer->covariance();
2325  V0_cor(5*it+2,5*it+2) = (*cov_tmp)(2,2);
2326  V0_cor(5*it+2,5*it+3) = (*cov_tmp)(2,3);
2327  V0_cor(5*it+2,5*it+4) = (*cov_tmp)(2,4);
2328  V0_cor(5*it+3,5*it+3) = (*cov_tmp)(3,3);
2329  V0_cor(5*it+3,5*it+4) = (*cov_tmp)(3,4);
2330  V0_cor(5*it+4,5*it+4) = (*cov_tmp)(4,4);
2331  V0_cor(5*it+3,5*it+2) = (*cov_tmp)(2,3);
2332  V0_cor(5*it+4,5*it+2) = (*cov_tmp)(2,4);
2333  V0_cor(5*it+4,5*it+3) = (*cov_tmp)(3,4);
2334  charge[it] = TP->charge();
2335  phi[it] = extrPer->parameters()[Trk::phi];
2336  theta[it] = extrPer->parameters()[Trk::theta];
2337  qOverP[it] = extrPer->parameters()[Trk::qOverP];
2338  double tmp = 1./(qOverP[it]*qOverP[it]) + masses[it]*masses[it];
2339  double pe = (tmp>0.) ? sqrt(tmp) : 0.;
2340  e[it] = pe;
2341  E += e[it];
2342  Px += extrPer->momentum().x();
2343  Py += extrPer->momentum().y();
2344  Pz += extrPer->momentum().z();
2345  }
2346  }
2347  double msq = E*E - Px*Px - Py*Py - Pz*Pz;
2348  double mass = (msq>0.) ? sqrt(msq) : 0.;
2349 
2350  for( unsigned int it=0; it<NTrk; it++) {
2351  if (masses[it] >= 0.) {
2352  dm2dphi[it] = 2.*(Px*sin(phi[it])-Py*cos(phi[it]))*sin(theta[it])*charge[it]/qOverP[it];
2353  dm2dtheta[it] = 2.*(Pz*sin(theta[it])-(Px*cos(phi[it])+Py*sin(phi[it]))*cos(theta[it]))*charge[it]/qOverP[it];
2354  dm2dqOverP[it] = 2.*(Pz*cos(theta[it])+(Px*cos(phi[it])+Py*sin(phi[it]))*sin(theta[it])-E*charge[it]/(qOverP[it]*e[it]))*charge[it]/(qOverP[it]*qOverP[it]);
2355  }
2356  }
2357 
2358  Amg::MatrixX D_vec(5*NTrk,1); D_vec.setZero();
2359  for( unsigned int it=0; it<NTrk; it++) {
2360  D_vec(5*it+0,0) = 0.;
2361  D_vec(5*it+1,0) = 0.;
2362  D_vec(5*it+2,0) = dm2dphi[it];
2363  D_vec(5*it+3,0) = dm2dtheta[it];
2364  D_vec(5*it+4,0) = dm2dqOverP[it];
2365  }
2366  Amg::MatrixX V0_merr = D_vec.transpose() * V0_cor * D_vec;
2367 
2368  double massVarsq = V0_merr(0,0);
2369  if (massVarsq <= 0.) ATH_MSG_DEBUG("massError: negative sqrt massVarsq " << massVarsq);
2370  double massVar = (massVarsq>0.) ? sqrt(massVarsq) : 0.;
2371  double massErr = massVar/(2.*mass);
2372  return massErr;
2373  }
2374 
2375 
2376  double V0Tools::massTauCov(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, std::span<const double> masses) const
2377  {
2378  // Tau = CONST*M*(Px*dx+Py*dy)/(PT*PT)
2379  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();

◆ invariantMassErrorBeforeFit() [2/2]

double V0Tools::invariantMassErrorBeforeFit ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses,
const EventContext &  ctx,
const Trk::IExtrapolator extrap 
) const

Definition at line 2297 of file V0Tools.cxx.

2305  {
2306  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();

◆ invariantMassErrorBeforeFitIP()

double V0Tools::invariantMassErrorBeforeFitIP ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses 
) const

Definition at line 2230 of file V0Tools.cxx.

2236  {
2237  if (masses[it] >= 0.) {
2238  const xAOD::TrackParticle* TP = origTrack(vxCandidate,it);
2239  if (TP == nullptr) return -999999.;
2240  const xAOD::ParametersCovMatrix_t cov_tmp = TP->definingParametersCovMatrix();
2241  V0_cor(5*it+2,5*it+2) = cov_tmp(2,2);
2242  V0_cor(5*it+2,5*it+3) = cov_tmp(2,3);
2243  V0_cor(5*it+2,5*it+4) = cov_tmp(2,4);
2244  V0_cor(5*it+3,5*it+3) = cov_tmp(3,3);
2245  V0_cor(5*it+3,5*it+4) = cov_tmp(3,4);
2246  V0_cor(5*it+4,5*it+4) = cov_tmp(4,4);
2247  V0_cor(5*it+3,5*it+2) = cov_tmp(2,3);
2248  V0_cor(5*it+4,5*it+2) = cov_tmp(2,4);
2249  V0_cor(5*it+4,5*it+3) = cov_tmp(3,4);
2250  charge[it] = TP->charge();
2251  phi[it] = TP->phi();
2252  theta[it] = TP->theta();
2253  qOverP[it] = TP->qOverP();
2254  double tmp = 1./(qOverP[it]*qOverP[it]) + masses[it]*masses[it];
2255  double pe = (tmp>0.) ? sqrt(tmp) : 0.;
2256  e[it] = pe;
2257  E += e[it];
2258  TLorentzVector p4 = TP->p4();
2259  Px += p4.Px();
2260  Py += p4.Py();
2261  Pz += p4.Pz();
2262  }
2263  }
2264 
2265  for( unsigned int it=0; it<NTrk; it++) {
2266  if (masses[it] >= 0.) {
2267  dm2dphi[it] = 2.*(Px*sin(phi[it])-Py*cos(phi[it]))*sin(theta[it])*charge[it]/qOverP[it];
2268  dm2dtheta[it] = 2.*(Pz*sin(theta[it])-(Px*cos(phi[it])+Py*sin(phi[it]))*cos(theta[it]))*charge[it]/qOverP[it];
2269  dm2dqOverP[it] = 2.*(Pz*cos(theta[it])+(Px*cos(phi[it])+Py*sin(phi[it]))*sin(theta[it])-E*charge[it]/(qOverP[it]*e[it]))*charge[it]/(qOverP[it]*qOverP[it]);
2270  }
2271  }
2272 
2273  Amg::MatrixX D_vec(5*NTrk,1); D_vec.setZero();
2274  for( unsigned int it=0; it<NTrk; it++) {
2275  D_vec(5*it+0,0) = 0.;
2276  D_vec(5*it+1,0) = 0.;
2277  D_vec(5*it+2,0) = dm2dphi[it];
2278  D_vec(5*it+3,0) = dm2dtheta[it];
2279  D_vec(5*it+4,0) = dm2dqOverP[it];
2280  }
2281  Amg::MatrixX V0_merr = D_vec.transpose() * V0_cor * D_vec;
2282 
2283  double massVarsq = V0_merr(0,0);
2284  if (massVarsq <= 0.) ATH_MSG_DEBUG("massError: negative sqrt massVarsq " << massVarsq);
2285  double massVar = (massVarsq>0.) ? sqrt(massVarsq) : 0.;
2286  double massErr = massVar/(2.*mass);
2287  return massErr;
2288  }
2289 
2290 
2291  double V0Tools::invariantMassErrorBeforeFit(const xAOD::Vertex * vxCandidate, std::span<const double> masses, const EventContext& ctx, const Trk::IExtrapolator* extrap) const
2292  {
2293  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
2294  if (masses.size() != NTrk) {

◆ invariantMassProbability() [1/2]

double V0Tools::invariantMassProbability ( const xAOD::Vertex vxCandidate,
double  V0Mass,
double  posTrackMass,
double  negTrackMass 
) const

Definition at line 324 of file V0Tools.cxx.

326  {
327  double mass = invariantMass(vxCandidate, masses);
328  double massErr = invariantMassError(vxCandidate, masses);
329  if(massErr > 0.)

◆ invariantMassProbability() [2/2]

double V0Tools::invariantMassProbability ( const xAOD::Vertex vxCandidate,
double  V0Mass,
std::span< const double >  masses 
) const

Definition at line 331 of file V0Tools.cxx.

334  {
335  double achi2prob = 1.-myCumulativeChiSquare(chi2);
336  return achi2prob;
337  } else {
338  ATH_MSG_DEBUG("chi <= 0");
339  return -1.;
340  }
341  }
342  else {
343  return -1.;
344  }
345  }
346 
347  double V0Tools::massProbability(double V0Mass, double mass, double massErr) const
348  {
349  if(massErr > 0.)
350  {
351  double chi2 = (V0Mass - mass)*(V0Mass - mass)/(massErr*massErr);

◆ lxy()

double V0Tools::lxy ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

projection of distance in xy of the vertex wrt an xAOD::Vertex vertex along the momentum direction (Px*dx+Py*dy)/pT

Definition at line 935 of file V0Tools.cxx.

940  {
941  auto vert = vxCandidate->position() - vertex->position();
942  double dx = vert.x();
943  double dy = vert.y();

◆ lxyError()

double V0Tools::lxyError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
) const

error on lxy

Definition at line 945 of file V0Tools.cxx.

951  {
952  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
953  double trkCharge = 1.;
954  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
955  double phi = bPer->parameters()[Trk::phi];
956  double theta = bPer->parameters()[Trk::theta];
957  double qOverP = bPer->parameters()[Trk::qOverP];
958  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
959  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
960  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
961  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
962  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
963  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
964  Px += bPer->momentum()[Trk::px];
965  Py += bPer->momentum()[Trk::py];
966  }
967  double PTsq = Px*Px+Py*Py;
968  double PT = (PTsq>0.) ? sqrt(PTsq) : 0.;
969  double LXYoverPT = (Px*dx+Py*dy)/PTsq;
970 
971  for( unsigned int it=0; it<NTrk; it++) {
972  double dPTdqOverP = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
973  double dPTdtheta = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
974  double dPTdphi = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
975  dLxydqOverP[it] = (dx*dpxdqOverP[it]+dy*dpydqOverP[it])/PT-LXYoverPT*dPTdqOverP;
976  dLxydtheta[it] = (dx*dpxdtheta[it]+dy*dpydtheta[it])/PT-LXYoverPT*dPTdtheta;
977  dLxydphi[it] = (dx*dpxdphi[it]+dy*dpydphi[it])/PT-LXYoverPT*dPTdphi;
978  }
979  double dLxydx = Px/PT;
980  double dLxydy = Py/PT;
981  double dLxydx0 = -dLxydx;
982  double dLxydy0 = -dLxydy;
983 
984  unsigned int ndim = 0;
985  if (fullCov.size() != 0) {
986  ndim = fullCov.rows();
987  } else {
988  ndim = 5*NTrk+3;
989  }
990 
991  Amg::MatrixX V0_err;
992  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
993  Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
994  for( unsigned int it=0; it<NTrk; it++) {
995  D_vec(5*it+0) = 0.;
996  D_vec(5*it+1) = 0.;
997  D_vec(5*it+2) = dLxydphi[it];
998  D_vec(5*it+3) = dLxydtheta[it];
999  D_vec(5*it+4) = dLxydqOverP[it];
1000  }
1001  D_vec(5*NTrk+0) = dLxydx;
1002  D_vec(5*NTrk+1) = dLxydy;
1003  D_vec(5*NTrk+2) = 0.;
1004  D_vec(5*NTrk+3) = dLxydx0;
1005  D_vec(5*NTrk+4) = dLxydy0;
1006  D_vec(5*NTrk+5) = 0.;
1007 
1008  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
1009  if (fullCov.size() != 0) {
1010  W_mat.block(0,0,ndim,ndim) = fullCov;
1011  } else {
1012  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
1013  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
1014  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
1015  }
1016  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
1017  V0_err = D_vec.transpose() * W_mat * D_vec;
1018  } else if (ndim == 3*NTrk+3) {
1019  Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
1020  D_vec(0) = dLxydx;
1021  D_vec(1) = dLxydy;
1022  D_vec(2) = 0.;
1023  for( unsigned int it=0; it<NTrk; it++) {
1024  D_vec(3*it+3) = dLxydphi[it];
1025  D_vec(3*it+4) = dLxydtheta[it];
1026  D_vec(3*it+5) = dLxydqOverP[it];
1027  }
1028  D_vec(3*NTrk+3) = dLxydx0;
1029  D_vec(3*NTrk+4) = dLxydy0;
1030  D_vec(3*NTrk+5) = 0.;
1031 
1032  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
1033  W_mat.block(0,0,ndim,ndim) = fullCov;
1034  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
1035  V0_err = D_vec.transpose() * W_mat * D_vec;
1036  }
1037 
1038  double LxyErrsq = V0_err(0,0);
1039  if (LxyErrsq <= 0.) ATH_MSG_DEBUG("lxyError: negative sqrt LxyErrsq " << LxyErrsq);
1040  return (LxyErrsq>0.) ? sqrt(LxyErrsq) : 0.;
1041  }
1042 
1043  double V0Tools::lxyz(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex)
1044  {
1045  auto vert = vxCandidate->position() - vertex->position();
1046  double dx = vert.x();
1047  double dy = vert.y();

◆ lxyz()

double V0Tools::lxyz ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

projection of distance in 3D of the vertex wrt an xAOD::Vertex vertex along the momentum direction (Px*dx+Py*dy+Pz*dz)/p

Definition at line 1049 of file V0Tools.cxx.

1055  {
1056  auto vert = vxCandidate->position() - vertex->position();
1057  double dx = vert.x();
1058  double dy = vert.y();

◆ lxyzError()

double V0Tools::lxyzError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
) const

error on lxyz

Definition at line 1060 of file V0Tools.cxx.

1068  {
1069  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
1070  double trkCharge = 1.;
1071  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
1072  double phi = bPer->parameters()[Trk::phi];
1073  double theta = bPer->parameters()[Trk::theta];
1074  double qOverP = bPer->parameters()[Trk::qOverP];
1075  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
1076  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
1077  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
1078  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
1079  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
1080  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
1081  dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
1082  dpzdtheta[it] = -(sin(theta)*trkCharge)/qOverP;
1083  Px += bPer->momentum()[Trk::px];
1084  Py += bPer->momentum()[Trk::py];
1085  Pz += bPer->momentum()[Trk::pz];
1086  }
1087  double Psq = Px*Px+Py*Py+Pz*Pz;
1088  double P = (Psq>0.) ? sqrt(Psq) : 0.;
1089  double LXYZoverP = (Px*dx+Py*dy+Pz*dz)/Psq;
1090 
1091  for( unsigned int it=0; it<NTrk; it++) {
1092  double dPdqOverP = (Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it])/P;
1093  double dPdtheta = (Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/P;
1094  double dPdphi = (Px*dpxdphi[it]+Py*dpydphi[it])/P;
1095  dLxyzdqOverP[it] = (dx*dpxdqOverP[it]+dy*dpydqOverP[it]+dz*dpzdqOverP[it])/P-LXYZoverP*dPdqOverP;
1096  dLxyzdtheta[it] = (dx*dpxdtheta[it]+dy*dpydtheta[it]+dz*dpzdtheta[it])/P-LXYZoverP*dPdtheta;
1097  dLxyzdphi[it] = (dx*dpxdphi[it]+dy*dpydphi[it])/P-LXYZoverP*dPdphi;
1098  }
1099  double dLxyzdx = Px/P;
1100  double dLxyzdy = Py/P;
1101  double dLxyzdz = Pz/P;
1102  double dLxyzdx0 = -dLxyzdx;
1103  double dLxyzdy0 = -dLxyzdy;
1104  double dLxyzdz0 = -dLxyzdz;
1105 
1106  unsigned int ndim = 0;
1107  if (fullCov.size() != 0) {
1108  ndim = fullCov.rows();
1109  } else {
1110  ndim = 5*NTrk+3;
1111  }
1112 
1113  Amg::MatrixX V0_err;
1114  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
1115  Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
1116  for( unsigned int it=0; it<NTrk; it++) {
1117  D_vec(5*it+0) = 0.;
1118  D_vec(5*it+1) = 0.;
1119  D_vec(5*it+2) = dLxyzdphi[it];
1120  D_vec(5*it+3) = dLxyzdtheta[it];
1121  D_vec(5*it+4) = dLxyzdqOverP[it];
1122  }
1123  D_vec(5*NTrk+0) = dLxyzdx;
1124  D_vec(5*NTrk+1) = dLxyzdy;
1125  D_vec(5*NTrk+2) = dLxyzdz;
1126  D_vec(5*NTrk+3) = dLxyzdx0;
1127  D_vec(5*NTrk+4) = dLxyzdy0;
1128  D_vec(5*NTrk+5) = dLxyzdz0;
1129 
1130  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
1131  if (fullCov.size() != 0) {
1132  W_mat.block(0,0,ndim,ndim) = fullCov;
1133  } else {
1134  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
1135  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
1136  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
1137  }
1138  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
1139  V0_err = D_vec.transpose() * W_mat * D_vec;
1140  } else if (ndim == 3*NTrk+3) {
1141  Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
1142  D_vec(0) = dLxyzdx;
1143  D_vec(1) = dLxyzdy;
1144  D_vec(2) = dLxyzdz;
1145  for( unsigned int it=0; it<NTrk; it++) {
1146  D_vec(3*it+3) = dLxyzdphi[it];
1147  D_vec(3*it+4) = dLxyzdtheta[it];
1148  D_vec(3*it+5) = dLxyzdqOverP[it];
1149  }
1150  D_vec(3*NTrk+3) = dLxyzdx0;
1151  D_vec(3*NTrk+4) = dLxyzdy0;
1152  D_vec(3*NTrk+5) = dLxyzdz0;
1153 
1154  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
1155  W_mat.block(0,0,ndim,ndim) = fullCov;
1156  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
1157  V0_err = D_vec.transpose() * W_mat * D_vec;
1158  }
1159 
1160  double LxyzErrsq = V0_err(0,0);
1161  if (LxyzErrsq <= 0.) ATH_MSG_DEBUG("lxyzError: negative sqrt LxyzErrsq " << LxyzErrsq);
1162  return (LxyzErrsq>0.) ? sqrt(LxyzErrsq) : 0.;
1163  }
1164 
1165  double V0Tools::tau(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double posTrackMass, double negTrackMass) const
1166  {
1167  std::array<double, 2> masses = {posTrackMass, negTrackMass};
1168 
1169  return tau(vxCandidate,vertex,masses);

◆ makeV0Cov()

Amg::MatrixX V0Tools::makeV0Cov ( const xAOD::Vertex vxCandidate)
static

Definition at line 2511 of file V0Tools.cxx.

2525  {
2526  // Tau = CONST*M*(Px*dx+Py*dy)/(PT*PT)
2527  Amg::MatrixX V0_err;
2528  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();

◆ massErrorV0Fitter() [1/2]

double V0Tools::massErrorV0Fitter ( const xAOD::Vertex vxCandidate,
double  posTrackMass,
double  negTrackMass 
) const
private

Definition at line 108 of file V0Tools.cxx.

110  {
111  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
112  if (masses.size() != NTrk) {
113  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ massErrorV0Fitter() [2/2]

double V0Tools::massErrorV0Fitter ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses 
) const
private

Definition at line 115 of file V0Tools.cxx.

122  {
123  if (masses[it] >= 0.) {
124  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
125  double trkCharge = 1.;
126  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
127  charge[it] = trkCharge;
128  phi[it] = bPer->parameters()[Trk::phi];
129  theta[it] = bPer->parameters()[Trk::theta];
130  qOverP[it] = bPer->parameters()[Trk::qOverP];
131  double tmp = 1./(qOverP[it]*qOverP[it]) + masses[it]*masses[it];
132  double pe = (tmp>0.) ? sqrt(tmp) : 0.;
133  e[it] = pe;
134  E += e[it];
135  Px += bPer->momentum()[Trk::px];
136  Py += bPer->momentum()[Trk::py];
137  Pz += bPer->momentum()[Trk::pz];
138  }
139  }
140  double msq = E*E - Px*Px - Py*Py - Pz*Pz;
141  double mass = (msq>0.) ? sqrt(msq) : 0.;
142 
143  for( unsigned int it=0; it<NTrk; it++) {
144  if (masses[it] >= 0.) {
145  dm2dphi[it] = 2.*(Px*sin(phi[it])-Py*cos(phi[it]))*sin(theta[it])*charge[it]/qOverP[it];
146  dm2dtheta[it] = 2.*(Pz*sin(theta[it])-(Px*cos(phi[it])+Py*sin(phi[it]))*cos(theta[it]))*charge[it]/qOverP[it];
147  dm2dqOverP[it] = 2.*(Pz*cos(theta[it])+(Px*cos(phi[it])+Py*sin(phi[it]))*sin(theta[it])-E*charge[it]/(qOverP[it]*e[it]))*charge[it]/(qOverP[it]*qOverP[it]);
148  }
149  }
150 
151  Amg::MatrixX D_vec(5*NTrk,1); D_vec.setZero();
152  for( unsigned int it=0; it<NTrk; it++) {
153  D_vec(5*it+0,0) = 0.;
154  D_vec(5*it+1,0) = 0.;
155  D_vec(5*it+2,0) = dm2dphi[it];
156  D_vec(5*it+3,0) = dm2dtheta[it];
157  D_vec(5*it+4,0) = dm2dqOverP[it];
158  }
159  Amg::MatrixX V0_merr = D_vec.transpose() * fullCov.block(0,0,ndim-3,ndim-3) * D_vec;
160 
161  double massVarsq = V0_merr(0,0);
162  if (massVarsq <= 0.) ATH_MSG_DEBUG("massError: negative sqrt massVarsq " << massVarsq);
163  double massVar = (massVarsq>0.) ? sqrt(massVarsq) : 0.;
164  double massErr = massVar/(2.*mass);
165  return massErr;
166  }
167 
168  double V0Tools::massErrorVKalVrt(const xAOD::Vertex * vxCandidate, double posTrackMass, double negTrackMass) const
169  {
170  std::array<double, 2> masses = {posTrackMass, negTrackMass};
171  return massErrorVKalVrt(vxCandidate,masses);
172  }

◆ massErrorVKalVrt() [1/2]

double V0Tools::massErrorVKalVrt ( const xAOD::Vertex vxCandidate,
double  posTrackMass,
double  negTrackMass 
) const
private

Definition at line 174 of file V0Tools.cxx.

175  {
176  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
177  if (masses.size() != NTrk) {
178  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ massErrorVKalVrt() [2/2]

double V0Tools::massErrorVKalVrt ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses 
) const
private

Definition at line 180 of file V0Tools.cxx.

188  {
189  if (masses[it] >= 0.) {
190  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
191  double phi = bPer->parameters()[Trk::phi];
192  double theta = bPer->parameters()[Trk::theta];
193  double invP = bPer->parameters()[Trk::qOverP];
194  double px = cos(phi)*sin(theta)/fabs(invP);
195  double py = sin(phi)*sin(theta)/fabs(invP);
196  double pz = cos(theta)/fabs(invP);
197  double esq = px*px + py*py + pz*pz + masses[it]*masses[it];
198  double e = (esq>0.) ? sqrt(esq) : 0.;
200  tmp.SetPxPyPzE(px,py,pz,e);
201  particleMom[it] = tmp;
202  totalMom += tmp;
203 
204 // d(Px,Py,Pz)/d(Phi,Theta,InvP)
205  tmpDeriv(0,0) = - tmp.Py();
206  tmpDeriv(1,0) = tmp.Px();
207  tmpDeriv(2,0) = 0.;
208  tmpDeriv(0,1) = cos(phi) * tmp.Pz();
209  tmpDeriv(1,1) = sin(phi) * tmp.Pz();
210  tmpDeriv(2,1) = - sin(theta)/fabs(invP);
211  tmpDeriv(0,2) = - tmp.Px()/invP;
212  tmpDeriv(1,2) = - tmp.Py()/invP;
213  tmpDeriv(2,2) = - tmp.Pz()/invP;
214  particleDeriv[it] = tmpDeriv;
215  }
216  }
217 
218  std::vector<double> Deriv(3*NTrk+3, 0.);
219  for(unsigned int it=0; it<NTrk; it++){
220  if (masses[it] >= 0.) {
221  double dMdPx = ( totalMom.E() * particleMom[it].Px()/particleMom[it].E() - totalMom.Px() ) / totalMom.M();
222  double dMdPy = ( totalMom.E() * particleMom[it].Py()/particleMom[it].E() - totalMom.Py() ) / totalMom.M();
223  double dMdPz = ( totalMom.E() * particleMom[it].Pz()/particleMom[it].E() - totalMom.Pz() ) / totalMom.M();
224 
225  double dMdPhi = dMdPx*particleDeriv[it](0,0) + dMdPy*particleDeriv[it](1,0) + dMdPz*particleDeriv[it](2,0);
226  double dMdTheta = dMdPx*particleDeriv[it](0,1) + dMdPy*particleDeriv[it](1,1) + dMdPz*particleDeriv[it](2,1);
227  double dMdInvP = dMdPx*particleDeriv[it](0,2) + dMdPy*particleDeriv[it](1,2) + dMdPz*particleDeriv[it](2,2);
228 
229  Deriv[3*it + 3 + 0] = dMdPhi; Deriv[3*it + 3 + 1] = dMdTheta; Deriv[3*it + 3 + 2] = dMdInvP;
230  }
231  }
232 
233  double err = 0;
234  for(unsigned int i=0; i<3*NTrk+3; i++){
235  for(unsigned int j=0; j<3*NTrk+3; j++){
236  err += Deriv[i]*( fullCov)(i,j)*Deriv[j];
237  }
238  }
239  if (err <= 0.) ATH_MSG_DEBUG("massError: negative sqrt err " << err);
240  return (err>0.) ? sqrt(err) : 0.;
241  }
242 
243  double V0Tools::massErrorVxCandidate(const xAOD::Vertex * vxCandidate, double posTrackMass, double negTrackMass) const
244  {
245  std::array<double, 2> masses = {posTrackMass, negTrackMass};
246 
247  return massErrorVxCandidate(vxCandidate,masses);

◆ massErrorVxCandidate() [1/2]

double V0Tools::massErrorVxCandidate ( const xAOD::Vertex vxCandidate,
double  posTrackMass,
double  negTrackMass 
) const
private

Definition at line 249 of file V0Tools.cxx.

251  {
252  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
253  if (masses.size() != NTrk) {
254  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ massErrorVxCandidate() [2/2]

double V0Tools::massErrorVxCandidate ( const xAOD::Vertex vxCandidate,
std::span< const double >  masses 
) const
private

Definition at line 256 of file V0Tools.cxx.

261  {
262  if (masses[it] >= 0.) {
263  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
264  const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
265  V0_cor(5*it+2,5*it+2) = (*cov_tmp)(2,2);
266  V0_cor(5*it+2,5*it+3) = (*cov_tmp)(2,3);
267  V0_cor(5*it+2,5*it+4) = (*cov_tmp)(2,4);
268  V0_cor(5*it+3,5*it+3) = (*cov_tmp)(3,3);
269  V0_cor(5*it+3,5*it+4) = (*cov_tmp)(3,4);
270  V0_cor(5*it+4,5*it+4) = (*cov_tmp)(4,4);
271  V0_cor(5*it+3,5*it+2) = (*cov_tmp)(2,3);
272  V0_cor(5*it+4,5*it+2) = (*cov_tmp)(2,4);
273  V0_cor(5*it+4,5*it+3) = (*cov_tmp)(3,4);
274  double trkCharge = 1.;
275  if (bPer->parameters()(Trk::qOverP) < 0.) trkCharge = -1.;
276  charge[it] = trkCharge;
277  phi[it] = bPer->parameters()(Trk::phi);
278  theta[it] = bPer->parameters()(Trk::theta);
279  qOverP[it] = bPer->parameters()(Trk::qOverP);
280  double tmp = 1./(qOverP[it]*qOverP[it]) + masses[it]*masses[it];
281  double pe = (tmp>0.) ? sqrt(tmp) : 0.;
282  e[it] = pe;
283  E += e[it];
284  Px += bPer->momentum()(Trk::px);
285  Py += bPer->momentum()(Trk::py);
286  Pz += bPer->momentum()(Trk::pz);
287  }
288  }
289  double msq = E*E - Px*Px - Py*Py - Pz*Pz;
290  double mass = (msq>0.) ? sqrt(msq) : 0.;
291 
292  for( unsigned int it=0; it<NTrk; it++) {
293  if (masses[it] >= 0.) {
294  dm2dphi[it] = 2.*(Px*sin(phi[it])-Py*cos(phi[it]))*sin(theta[it])*charge[it]/qOverP[it];
295  dm2dtheta[it] = 2.*(Pz*sin(theta[it])-(Px*cos(phi[it])+Py*sin(phi[it]))*cos(theta[it]))*charge[it]/qOverP[it];
296  dm2dqOverP[it] = 2.*(Pz*cos(theta[it])+(Px*cos(phi[it])+Py*sin(phi[it]))*sin(theta[it])-E*charge[it]/(qOverP[it]*e[it]))*charge[it]/(qOverP[it]*qOverP[it]);
297  }
298  }
299 
300  Amg::MatrixX D_vec(5*NTrk,1); D_vec.setZero();
301  for( unsigned int it=0; it<NTrk; it++) {
302  D_vec(5*it+0,0) = 0.;
303  D_vec(5*it+1,0) = 0.;
304  D_vec(5*it+2,0) = dm2dphi[it];
305  D_vec(5*it+3,0) = dm2dtheta[it];
306  D_vec(5*it+4,0) = dm2dqOverP[it];
307  }
308 
309  Amg::MatrixX V0_merr = D_vec.transpose() * V0_cor * D_vec;
310 
311  double massVarsq = V0_merr(0,0);
312  if (massVarsq <= 0.) ATH_MSG_DEBUG("massError: negative sqrt massVarsq " << massVarsq);
313  double massVar = (massVarsq>0.) ? sqrt(massVarsq) : 0.;
314  double massErr = massVar/(2.*mass);
315  return massErr;
316  }
317 
318  double V0Tools::invariantMassProbability(const xAOD::Vertex * vxCandidate, double V0Mass, double posTrackMass, double negTrackMass) const
319  {
320  std::array<double, 2> masses = {posTrackMass , negTrackMass};
321 
322  return invariantMassProbability(vxCandidate,V0Mass,masses);

◆ massProbability()

double V0Tools::massProbability ( double  V0Mass,
double  mass,
double  massErr 
) const

Definition at line 353 of file V0Tools.cxx.

354  {
355  double achi2prob = 1.-myCumulativeChiSquare(chi2);
356  return achi2prob;
357  } else {
358  ATH_MSG_DEBUG("chi <= 0");
359  return -1.;
360  }
361  }
362  else {
363  return -1.;
364  }
365  }
366 
367  Amg::Vector3D V0Tools::trackMomentum(const xAOD::Vertex * vxCandidate, unsigned int trkIndex)
368  {
369  const Trk::TrackParameters* aPerigee = vxCandidate->vxTrackAtVertex()[trkIndex].perigeeAtVertex();
370  return aPerigee->momentum();
371  }

◆ massTauCov()

double V0Tools::massTauCov ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
std::span< const double >  masses 
) const

Definition at line 2382 of file V0Tools.cxx.

2399  {
2400  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
2401  double trkCharge = 1.;
2402  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
2403  double phi = bPer->parameters()[Trk::phi];
2404  double theta = bPer->parameters()[Trk::theta];
2405  double qOverP = bPer->parameters()[Trk::qOverP];
2406  double tmp = 1./(qOverP*qOverP) + masses[it]*masses[it];
2407  double pe = (tmp>0.) ? sqrt(tmp) : 0.;
2408  dedqOverP[it] = -1./(qOverP*qOverP*qOverP*pe);
2409  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
2410  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
2411  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
2412  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
2413  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
2414  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
2415  dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
2416  dpzdtheta[it] = -(sin(theta)*trkCharge)/qOverP;
2417  E += pe;
2418  Px += bPer->momentum()[Trk::px];
2419  Py += bPer->momentum()[Trk::py];
2420  Pz += bPer->momentum()[Trk::pz];
2421  }
2422  double LXY = Px*dx+Py*dy;
2423 
2424  for( unsigned int it=0; it<NTrk; it++) {
2425  dMdqOverP[it] = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
2426  dMdtheta[it] = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
2427  dMdphi[it] = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
2428  double dPTdqOverP = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
2429  double dPTdtheta = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
2430  double dPTdphi = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
2431  double dLXYdqOverP = dx*dpxdqOverP[it]+dy*dpydqOverP[it];
2432  double dLXYdtheta = dx*dpxdtheta[it]+dy*dpydtheta[it];
2433  double dLXYdphi = dx*dpxdphi[it]+dy*dpydphi[it];
2434  dTaudqOverP[it] = (LXY*dMdqOverP[it]+M*dLXYdqOverP)/(PT*PT)-(2.*LXY*M*dPTdqOverP)/(PT*PT*PT);
2435  dTaudtheta[it] = (LXY*dMdtheta[it]+M*dLXYdtheta)/(PT*PT)-(2.*LXY*M*dPTdtheta)/(PT*PT*PT);
2436  dTaudphi[it] = (LXY*dMdphi[it]+M*dLXYdphi)/(PT*PT)-(2.*LXY*M*dPTdphi)/(PT*PT*PT);
2437  }
2438  double dTaudx = (M*Px)/(PT*PT);
2439  double dTaudy = (M*Py)/(PT*PT);
2440  double dTaudx0 = -dTaudx;
2441  double dTaudy0 = -dTaudy;
2442 
2443  unsigned int ndim = 0;
2444  if (fullCov.size() != 0) {
2445  ndim = fullCov.rows();
2446  } else {
2447  ndim = 5*NTrk+3;
2448  }
2449 
2450  Amg::MatrixX V0_err;
2451  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
2452  Amg::MatrixX D_mat(5*NTrk+6,2); D_mat.setZero();
2453  for( unsigned int it=0; it<NTrk; it++) {
2454  D_mat(5*it+0,0) = 0.;
2455  D_mat(5*it+1,0) = 0.;
2456  D_mat(5*it+2,0) = CONST*dTaudphi[it];
2457  D_mat(5*it+3,0) = CONST*dTaudtheta[it];
2458  D_mat(5*it+4,0) = CONST*dTaudqOverP[it];
2459  D_mat(5*it+0,1) = 0.;
2460  D_mat(5*it+1,1) = 0.;
2461  D_mat(5*it+2,1) = dMdphi[it];
2462  D_mat(5*it+3,1) = dMdtheta[it];
2463  D_mat(5*it+4,1) = dMdqOverP[it];
2464  }
2465  D_mat(5*NTrk+0,0) = CONST*dTaudx;
2466  D_mat(5*NTrk+1,0) = CONST*dTaudy;
2467  D_mat(5*NTrk+2,0) = 0.;
2468  D_mat(5*NTrk+3,0) = CONST*dTaudx0;
2469  D_mat(5*NTrk+4,0) = CONST*dTaudy0;
2470  D_mat(5*NTrk+5,0) = 0.;
2471  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
2472  if (fullCov.size() != 0) {
2473  W_mat.block(0,0,ndim,ndim) = fullCov;
2474  } else {
2475  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
2476  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
2477  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
2478  }
2479  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
2480  V0_err = D_mat.transpose() * W_mat * D_mat;
2481  } else if (ndim == 3*NTrk+3) {
2482  Amg::MatrixX D_mat(3*NTrk+6,2); D_mat.setZero();
2483  D_mat(0,0) = CONST*dTaudx;
2484  D_mat(1,0) = CONST*dTaudy;
2485  D_mat(2,0) = 0.;
2486  for( unsigned int it=0; it<NTrk; it++) {
2487  D_mat(3*it+3,0) = CONST*dTaudphi[it];
2488  D_mat(3*it+4,0) = CONST*dTaudtheta[it];
2489  D_mat(3*it+5,0) = CONST*dTaudqOverP[it];
2490  D_mat(3*it+3,1) = dMdphi[it];
2491  D_mat(3*it+4,1) = dMdtheta[it];
2492  D_mat(3*it+5,1) = dMdqOverP[it];
2493  }
2494  D_mat(3*NTrk+3,0) = CONST*dTaudx0;
2495  D_mat(3*NTrk+4,0) = CONST*dTaudy0;
2496  D_mat(3*NTrk+5,0) = 0.;
2497  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
2498  W_mat.block(0,0,ndim,ndim) = fullCov;
2499  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
2500  V0_err = D_mat.transpose() * W_mat * D_mat;
2501  }
2502  return V0_err(0,1);
2503  }
2504 
2505  Amg::MatrixX V0Tools::makeV0Cov(const xAOD::Vertex * vxCandidate) {
2506  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
2507  Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero();
2508  for( unsigned int it=0; it<NTrk; it++){
2509  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

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

◆ ndof()

float V0Tools::ndof ( const xAOD::Vertex vxCandidate)
static

NDoF of the vertex fit.

Definition at line 453 of file V0Tools.cxx.

453  {
454  return vxCandidate->chiSquared();
455  }
456 

◆ negativeOrigTrack()

const xAOD::TrackParticle * V0Tools::negativeOrigTrack ( const xAOD::Vertex vxCandidate)
static

Definition at line 1894 of file V0Tools.cxx.

◆ negativeTrack4Momentum()

xAOD::TrackParticle::FourMom_t V0Tools::negativeTrack4Momentum ( const xAOD::Vertex vxCandidate,
double  negTrackMass 
)
static

Definition at line 433 of file V0Tools.cxx.

438  {
439  Amg::Vector3D mom = V0Momentum(vxCandidate);
440  double tmp = V0Mass*V0Mass + mom.x()*mom.x() + mom.y()*mom.y() + mom.z()*mom.z();
441  double e = (tmp>0.) ? sqrt(tmp) : 0.;

◆ negativeTrackMomentum()

Amg::Vector3D V0Tools::negativeTrackMomentum ( const xAOD::Vertex vxCandidate)
static

Definition at line 391 of file V0Tools.cxx.

398  {
399  Amg::Vector3D mom; mom.setZero();
400  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
401  for( unsigned int it=0; it<NTrk; it++) {

◆ origTrack()

const xAOD::TrackParticle * V0Tools::origTrack ( const xAOD::Vertex vxCandidate,
int  trkIndex 
)
static

pointers to original tracks

Definition at line 1878 of file V0Tools.cxx.

1878  {
1879  const xAOD::TrackParticle* origTrk(nullptr);
1880  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1881  if (NTrk != 2) return origTrk;

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ pca()

Amg::Vector3D V0Tools::pca ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

point of closest approach of the momentum vector to an xAOD::Vertex

Definition at line 626 of file V0Tools.cxx.

636  {
637  const Amg::MatrixX& cov = (vxCandidate->covariancePosition() + vertex->covariancePosition()).inverse().eval();
638  Amg::Vector3D D_vec; D_vec.setZero();
639  auto vert = vxCandidate->position() - vertex->position();

◆ phiStar() [1/2]

double V0Tools::phiStar ( const CLHEP::HepLorentzVector &  v0,
const CLHEP::HepLorentzVector &  track 
)
static

Definition at line 1812 of file V0Tools.cxx.

1825  {
1826  auto mom = V0Momentum(vxCandidate);
1827  auto vtx1 = vtx(vxCandidate);
1828  vtx1 -= vertex;

◆ phiStar() [2/2]

double V0Tools::phiStar ( const xAOD::Vertex vxCandidate,
double  posTrackMass,
double  negTrackMass 
)
static

phiStar

Definition at line 1803 of file V0Tools.cxx.

1807  {
1808  double phiStar = -999999.;
1809  CLHEP::Hep3Vector V0 = v0.getV();
1810  CLHEP::Hep3Vector trk = track.getV();

◆ positiveOrigTrack()

const xAOD::TrackParticle * V0Tools::positiveOrigTrack ( const xAOD::Vertex vxCandidate)
static

Definition at line 1883 of file V0Tools.cxx.

1889  {
1890  const xAOD::TrackParticle* origTrk(nullptr);
1891  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1892  if (NTrk != 2) return origTrk;

◆ positiveTrack4Momentum()

xAOD::TrackParticle::FourMom_t V0Tools::positiveTrack4Momentum ( const xAOD::Vertex vxCandidate,
double  posTrackMass 
)
static

Definition at line 423 of file V0Tools.cxx.

428  {
429  Amg::Vector3D mom = negativeTrackMomentum(vxCandidate);
430  xAOD::TrackParticle::FourMom_t lorentz(0,0,0,0);
431  double tmp = mass*mass + mom.x()*mom.x() + mom.y()*mom.y() + mom.z()*mom.z();

◆ positiveTrackMomentum()

Amg::Vector3D V0Tools::positiveTrackMomentum ( const xAOD::Vertex vxCandidate)
static

Definition at line 379 of file V0Tools.cxx.

386  {
387  Amg::Vector3D mom; mom.setZero();
388  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
389  if (NTrk != 2) return mom;

◆ pT()

double V0Tools::pT ( const xAOD::Vertex vxCandidate)
static

transverse momentum of the V0

Definition at line 549 of file V0Tools.cxx.

549  {
550  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
551  double Px=0., Py=0.;
552  std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);

◆ pTError()

double V0Tools::pTError ( const xAOD::Vertex vxCandidate) const

error on the transverse momentum of the V0

Definition at line 554 of file V0Tools.cxx.

557  {
558  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
559  double trkCharge = 1.;
560  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
561  double phi = bPer->parameters()[Trk::phi];
562  double theta = bPer->parameters()[Trk::theta];
563  double qOverP = bPer->parameters()[Trk::qOverP];
564  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
565  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
566  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
567  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
568  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
569  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
570  Px += bPer->momentum()[Trk::px];
571  Py += bPer->momentum()[Trk::py];
572  }
573  double PTsq = Px*Px+Py*Py;
574  double PT = (PTsq>0.) ? sqrt(PTsq) : 0.;
575 
576  for( unsigned int it=0; it<NTrk; it++) {
577  dPTdqOverP[it] = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
578  dPTdtheta[it] = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
579  dPTdphi[it] = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
580  }
581 
582  unsigned int ndim = 0;
583  if (fullCov.size() == 0) {
584  ndim = 5*NTrk+3;
585  } else {
586  ndim = fullCov.rows();
587  }
588 
589  Amg::MatrixX PtErrSq(1,1);
590  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
591  Amg::MatrixX D_vec(5*NTrk,1); D_vec.setZero();
592  for( unsigned int it=0; it<NTrk; it++) {
593  D_vec(5*it+0,0) = 0.;
594  D_vec(5*it+1,0) = 0.;
595  D_vec(5*it+2,0) = dPTdphi[it];
596  D_vec(5*it+3,0) = dPTdtheta[it];
597  D_vec(5*it+4,0) = dPTdqOverP[it];
598  }
599  if (fullCov.size() == 0) {
600  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
601  PtErrSq = D_vec.transpose() * V0_cov * D_vec;
602  } else {
603  PtErrSq = D_vec.transpose() * fullCov.block(0,0,5*NTrk-1,5*NTrk-1) * D_vec;
604  }
605  } else if (ndim == 3*NTrk+3) {
606  Amg::MatrixX D_vec(3*NTrk,1); D_vec.setZero();
607  for( unsigned int it=0; it<NTrk; it++) {
608  D_vec(3*it+0,0) = dPTdphi[it];
609  D_vec(3*it+1,0) = dPTdtheta[it];
610  D_vec(3*it+2,0) = dPTdqOverP[it];
611  }
612  PtErrSq = D_vec.transpose() * fullCov.block(3,3,ndim-3,ndim-3) * D_vec;
613  }
614 
615  double PtErrsq = PtErrSq(0,0);
616  if (PtErrsq <= 0.) ATH_MSG_DEBUG("ptError: negative sqrt PtErrsq " << PtErrsq);
617  return (PtErrsq>0.) ? sqrt(PtErrsq) : 0.;
618  }
619 
620  Amg::Vector3D V0Tools::pca(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex)
621  {
622  assert(vxCandidate!=0);
623  if(nullptr == vxCandidate) {
624  Amg::Vector3D p; p.setZero();

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ rxy() [1/3]

double V0Tools::rxy ( const xAOD::Vertex vxCandidate)
static

Rxy of the vertex.

Definition at line 488 of file V0Tools.cxx.

488  {
489  return (vxCandidate->position() - vertex->position()).perp();
490  }
491 

◆ rxy() [2/3]

double V0Tools::rxy ( const xAOD::Vertex vxCandidate,
const Amg::Vector3D vertex 
)
static

wrt an Amg::Vector3D vertex

Definition at line 498 of file V0Tools.cxx.

498  {
499  double rxysq = dx*dx + dy*dy;
500  double rxy = (rxysq>0.) ? sqrt(rxysq) : 0.;
501  double drdx = dx/rxy;

◆ rxy() [3/3]

double V0Tools::rxy ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
)
static

wrt an xAOD::Vertex vertex

Definition at line 493 of file V0Tools.cxx.

493  {
494  return (vxCandidate->position() - vertex).perp();
495  }
496 

◆ rxy_var()

double V0Tools::rxy_var ( double  dx,
double  dy,
const Amg::MatrixX cov 
)
static

rxy_var

Definition at line 503 of file V0Tools.cxx.

512  {
513  const Amg::MatrixX& cov = vxCandidate->covariancePosition();
514  double dx = vxCandidate->position().x();
515  double dy = vxCandidate->position().y();

◆ rxyError() [1/3]

double V0Tools::rxyError ( const xAOD::Vertex vxCandidate) const

error on Rxy

Definition at line 517 of file V0Tools.cxx.

517  : negative sqrt rxyVar " << rxyVar);
518  return (rxyVar>0.) ? sqrt(rxyVar) : 0.;
519  }
520 
521  double V0Tools::rxyError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex) const
522  {
523  const Amg::MatrixX cov = vxCandidate->covariancePosition() + vertex->covariancePosition();
524  auto vert = vxCandidate->position() - vertex->position();
525  double dx = vert.x();

◆ rxyError() [2/3]

double V0Tools::rxyError ( const xAOD::Vertex vxCandidate,
const Amg::Vector3D vertex 
) const

wrt an Amg::Vector3D vertex

Definition at line 538 of file V0Tools.cxx.

539  : negative sqrt rxyVar " << rxyVar);
540  return (rxyVar>0.) ? sqrt(rxyVar) : 0.;
541  }
542 
543  double V0Tools::pT (const xAOD::Vertex * vxCandidate)
544  {
545  return V0Momentum(vxCandidate).perp();
546  }
547 

◆ rxyError() [3/3]

double V0Tools::rxyError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
) const

wrt an xAOD::Vertex vertex

Definition at line 527 of file V0Tools.cxx.

528  : negative sqrt rxyVar " << rxyVar);
529  return (rxyVar>0.) ? sqrt(rxyVar) : 0.;
530  }
531 
532  double V0Tools::rxyError(const xAOD::Vertex * vxCandidate, const Amg::Vector3D& vertex) const
533  {
534  const Amg::MatrixX& cov = vxCandidate->covariancePosition();
535  auto vert = vxCandidate->position() - vertex;
536  double dx = vert.x();

◆ separation() [1/2]

double V0Tools::separation ( const xAOD::Vertex vxCandidate,
const Amg::Vector3D vertex 
) const

Definition at line 656 of file V0Tools.cxx.

660  : negative sqrt sepVarsq " << sepVarsq);
661  double sepVar = (sepVarsq>0.) ? sqrt(sepVarsq) : 0.;
662  return sepVar;
663  }
664 
665  double V0Tools::a0xy(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex)
666  {
667  double cosineTheta_xy = cosTheta_xy(vxCandidate,vertex);
668  double sinTheta_xy = ((1.-cosineTheta_xy*cosineTheta_xy)>0.) ? sqrt((1.-cosineTheta_xy*cosineTheta_xy)) : 0.;
669  return (vtx(vxCandidate)-vertex->position()).perp() * sinTheta_xy;

◆ separation() [2/2]

double V0Tools::separation ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex 
) const

statistical separation (Mahalanobis distance)

Definition at line 641 of file V0Tools.cxx.

645  : negative sqrt sepVarsq " << sepVarsq);
646  double sepVar = (sepVarsq>0.) ? sqrt(sepVarsq) : 0.;
647  return sepVar;
648  }
649 
650  double V0Tools::separation(const xAOD::Vertex * vxCandidate, const Amg::Vector3D& vertex) const
651  {
652  const Amg::SymMatrixX& cov = vxCandidate->covariancePosition().inverse().eval();
653  Amg::Vector3D D_vec; D_vec.setZero();
654  auto vert = vxCandidate->position() - vertex;

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ tau() [1/5]

double V0Tools::tau ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
double  massV0 
)
static

proper time wrt an xAOD::Vertex vertex assuming massV0 imposing a V0 mass without making an adjustment

Definition at line 1217 of file V0Tools.cxx.

1221  {
1222  // Tau = CONST*M*(Px*dx+Py*dy)/(PT*PT)
1223  std::array<double, 2> masses = {posTrackMass, negTrackMass};
1224 

◆ tau() [2/5]

double V0Tools::tau ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
double  posTrackMass,
double  negTrackMass 
) const

proper time wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass tau = CONST*M*lxy/pT

Definition at line 1171 of file V0Tools.cxx.

1173  {
1174  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1175  if (masses.size() != NTrk) {
1176  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ tau() [3/5]

double V0Tools::tau ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
double  posTrackMass,
double  negTrackMass,
double  massV0 
) const

proper time wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass (imposing massV0) making a correction to the proper time consistent with the imposed V0 mass

Definition at line 1193 of file V0Tools.cxx.

1195  {
1196  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1197  if (masses.size() != NTrk) {
1198  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ tau() [4/5]

double V0Tools::tau ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
std::span< const double >  masses 
) const

proper time wrt an xAOD::Vertex vertex assuming track masses

Definition at line 1178 of file V0Tools.cxx.

1188  {
1189  std::array<double, 2> masses = {posTrackMass, negTrackMass};
1190 
1191  return tau(vxCandidate,vertex,masses,massV0);

◆ tau() [5/5]

double V0Tools::tau ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
std::span< const double >  masses,
double  massV0 
) const

proper time wrt an xAOD::Vertex vertex assuming track masses (imposing massV0) making a correction to the proper time consistent with the imposed V0 mass

Definition at line 1200 of file V0Tools.cxx.

1212  {
1213  //double CONST = 1000./CLHEP::c_light;
1214  double CONST = 1000./299.792;
1215  double LXY = lxy(vxCandidate,vertex);

◆ tau3D() [1/2]

double V0Tools::tau3D ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
double  massV0 
)
static

proper time in 3D wrt an xAOD::Vertex vertex assuming massV0 imposing a V0 mass without making an adjustment

Definition at line 1508 of file V0Tools.cxx.

1512  {
1513  // Tau = CONST*M*(Px*dx+Py*dy+Pz*dz)/(P*P)
1514  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1515  if (masses.size() != NTrk) {

◆ tau3D() [2/2]

double V0Tools::tau3D ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
std::span< const double >  masses 
) const

proper time in 3D wrt an xAOD::Vertex vertex assuming track masses

Definition at line 1493 of file V0Tools.cxx.

1503  {
1504  //double CONST = 1000./CLHEP::c_light;
1505  double CONST = 1000./299.792;
1506  double LXYZ = lxyz(vxCandidate,vertex);

◆ tau3DError() [1/2]

double V0Tools::tau3DError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
double  massV0 
) const

proper time error in 3D wrt an xAOD::Vertex vertex assuming massV0 imposing a V0 mass without making an adjustment

Definition at line 1646 of file V0Tools.cxx.

1658  {
1659  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
1660  double trkCharge = 1.;
1661  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
1662  double phi = bPer->parameters()[Trk::phi];
1663  double theta = bPer->parameters()[Trk::theta];
1664  double qOverP = bPer->parameters()[Trk::qOverP];
1665  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
1666  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
1667  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
1668  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
1669  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
1670  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
1671  dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
1672  dpzdtheta[it] = -(sin(theta)*trkCharge)/qOverP;
1673  Px += bPer->momentum()[Trk::px];
1674  Py += bPer->momentum()[Trk::py];
1675  Pz += bPer->momentum()[Trk::pz];
1676  }
1677  double LXYZ = Px*dx+Py*dy+Pz*dz;
1678 
1679  for( unsigned int it=0; it<NTrk; it++) {
1680  double dPdqOverP = (Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it])/P;
1681  double dPdtheta = (Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/P;
1682  double dPdphi = (Px*dpxdphi[it]+Py*dpydphi[it])/P;
1683  double dLXYZdqOverP = dx*dpxdqOverP[it]+dy*dpydqOverP[it]+dz*dpzdqOverP[it];
1684  double dLXYZdtheta = dx*dpxdtheta[it]+dy*dpydtheta[it]+dz*dpzdtheta[it];
1685  double dLXYZdphi = dx*dpxdphi[it]+dy*dpydphi[it];
1686  dTaudqOverP[it] = M*dLXYZdqOverP/(P*P)-(2.*LXYZ*M*dPdqOverP)/(P*P*P);
1687  dTaudtheta[it] = M*dLXYZdtheta/(P*P)-(2.*LXYZ*M*dPdtheta)/(P*P*P);
1688  dTaudphi[it] = M*dLXYZdphi/(P*P)-(2.*LXYZ*M*dPdphi)/(P*P*P);
1689  }
1690  double dTaudx = (M*Px)/(P*P);
1691  double dTaudy = (M*Py)/(P*P);
1692  double dTaudz = (M*Pz)/(P*P);
1693  double dTaudx0 = -dTaudx;
1694  double dTaudy0 = -dTaudy;
1695  double dTaudz0 = -dTaudz;
1696 
1697  unsigned int ndim = 0;
1698  if (fullCov.size() != 0) {
1699  ndim = fullCov.rows();
1700  } else {
1701  ndim = 5*NTrk+3;
1702  }
1703 
1704  Amg::MatrixX V0_err;
1705  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
1706  Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
1707  for( unsigned int it=0; it<NTrk; it++) {
1708  D_vec(5*it+0) = 0.;
1709  D_vec(5*it+1) = 0.;
1710  D_vec(5*it+2) = dTaudphi[it];
1711  D_vec(5*it+3) = dTaudtheta[it];
1712  D_vec(5*it+4) = dTaudqOverP[it];
1713  }
1714  D_vec(5*NTrk+0) = dTaudx;
1715  D_vec(5*NTrk+1) = dTaudy;
1716  D_vec(5*NTrk+2) = dTaudz;
1717  D_vec(5*NTrk+3) = dTaudx0;
1718  D_vec(5*NTrk+4) = dTaudy0;
1719  D_vec(5*NTrk+5) = dTaudz0;
1720 
1721  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
1722  if (fullCov.size() != 0) {
1723  W_mat.block(0,0,ndim,ndim) = fullCov;
1724  } else {
1725  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
1726  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
1727  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
1728  }
1729  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
1730  V0_err = D_vec.transpose() * W_mat * D_vec;
1731  } else if (ndim == 3*NTrk+3) {
1732  Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
1733  D_vec(0) = dTaudx;
1734  D_vec(1) = dTaudy;
1735  D_vec(2) = dTaudz;
1736  for( unsigned int it=0; it<NTrk; it++) {
1737  D_vec(3*it+3) = dTaudphi[it];
1738  D_vec(3*it+4) = dTaudtheta[it];
1739  D_vec(3*it+5) = dTaudqOverP[it];
1740  }
1741  D_vec(3*NTrk+3) = dTaudx0;
1742  D_vec(3*NTrk+4) = dTaudy0;
1743  D_vec(3*NTrk+5) = dTaudz0;
1744 
1745  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
1746  W_mat.block(0,0,ndim,ndim) = fullCov;
1747  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
1748  V0_err = D_vec.transpose() * W_mat * D_vec;
1749  }
1750 
1751  double tauErrsq = V0_err(0,0);
1752  if (tauErrsq <= 0.) ATH_MSG_DEBUG("tauError: negative sqrt tauErrsq " << tauErrsq);
1753  double tauErr = (tauErrsq>0.) ? sqrt(tauErrsq) : 0.;
1754  return CONST*tauErr;
1755  }
1756 
1757  double V0Tools::thetaStar(const xAOD::Vertex * vxCandidate, double mass1, double mass2)
1758  {
1759  double theta = 0.;

◆ tau3DError() [2/2]

double V0Tools::tau3DError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
std::span< const double >  masses 
) const

proper time error in 3D wrt an xAOD::Vertex vertex assuming track masses

Definition at line 1517 of file V0Tools.cxx.

1534  {
1535  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
1536  double trkCharge = 1.;
1537  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
1538  double phi = bPer->parameters()[Trk::phi];
1539  double theta = bPer->parameters()[Trk::theta];
1540  double qOverP = bPer->parameters()[Trk::qOverP];
1541  double tmp = 1./(qOverP*qOverP) + masses[it]*masses[it];
1542  double pe = (tmp>0.) ? sqrt(tmp) : 0.;
1543  dedqOverP[it] = -1./(qOverP*qOverP*qOverP*pe);
1544  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
1545  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
1546  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
1547  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
1548  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
1549  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
1550  dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
1551  dpzdtheta[it] = -(sin(theta)*trkCharge)/qOverP;
1552  E += pe;
1553  Px += bPer->momentum()[Trk::px];
1554  Py += bPer->momentum()[Trk::py];
1555  Pz += bPer->momentum()[Trk::pz];
1556  }
1557  double LXYZ = Px*dx+Py*dy+Pz*dz;
1558 
1559  for( unsigned int it=0; it<NTrk; it++) {
1560  double dMdqOverP = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
1561  double dMdtheta = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
1562  double dMdphi = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
1563  double dPdqOverP = (Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it])/P;
1564  double dPdtheta = (Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/P;
1565  double dPdphi = (Px*dpxdphi[it]+Py*dpydphi[it])/P;
1566  double dLXYZdqOverP = dx*dpxdqOverP[it]+dy*dpydqOverP[it]+dz*dpzdqOverP[it];
1567  double dLXYZdtheta = dx*dpxdtheta[it]+dy*dpydtheta[it]+dz*dpzdtheta[it];
1568  double dLXYZdphi = dx*dpxdphi[it]+dy*dpydphi[it];
1569  dTaudqOverP[it] = (LXYZ*dMdqOverP+M*dLXYZdqOverP)/(P*P)-(2.*LXYZ*M*dPdqOverP)/(P*P*P);
1570  dTaudtheta[it] = (LXYZ*dMdtheta+M*dLXYZdtheta)/(P*P)-(2.*LXYZ*M*dPdtheta)/(P*P*P);
1571  dTaudphi[it] = (LXYZ*dMdphi+M*dLXYZdphi)/(P*P)-(2.*LXYZ*M*dPdphi)/(P*P*P);
1572  }
1573  double dTaudx = (M*Px)/(P*P);
1574  double dTaudy = (M*Py)/(P*P);
1575  double dTaudz = (M*Pz)/(P*P);
1576  double dTaudx0 = -dTaudx;
1577  double dTaudy0 = -dTaudy;
1578  double dTaudz0 = -dTaudz;
1579 
1580  unsigned int ndim = 0;
1581  if (fullCov.size() != 0) {
1582  ndim = fullCov.rows();
1583  } else {
1584  ndim = 5*NTrk+3;
1585  }
1586 
1587  Amg::MatrixX V0_err;
1588  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
1589  Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
1590  for( unsigned int it=0; it<NTrk; it++) {
1591  D_vec(5*it+0) = 0.;
1592  D_vec(5*it+1) = 0.;
1593  D_vec(5*it+2) = dTaudphi[it];
1594  D_vec(5*it+3) = dTaudtheta[it];
1595  D_vec(5*it+4) = dTaudqOverP[it];
1596  }
1597  D_vec(5*NTrk+0) = dTaudx;
1598  D_vec(5*NTrk+1) = dTaudy;
1599  D_vec(5*NTrk+2) = dTaudz;
1600  D_vec(5*NTrk+3) = dTaudx0;
1601  D_vec(5*NTrk+4) = dTaudy0;
1602  D_vec(5*NTrk+5) = dTaudz0;
1603 
1604  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
1605  if (fullCov.size() != 0) {
1606  W_mat.block(0,0,ndim,ndim) = fullCov;
1607  } else {
1608  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
1609  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
1610  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
1611  }
1612  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
1613  V0_err = D_vec.transpose() * W_mat * D_vec;
1614  } else if (ndim == 3*NTrk+3) {
1615  Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
1616  D_vec(0) = dTaudx;
1617  D_vec(1) = dTaudy;
1618  D_vec(2) = dTaudz;
1619  for( unsigned int it=0; it<NTrk; it++) {
1620  D_vec(3*it+3) = dTaudphi[it];
1621  D_vec(3*it+4) = dTaudtheta[it];
1622  D_vec(3*it+5) = dTaudqOverP[it];
1623  }
1624  D_vec(3*NTrk+3) = dTaudx0;
1625  D_vec(3*NTrk+4) = dTaudy0;
1626  D_vec(3*NTrk+5) = dTaudz0;
1627 
1628  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
1629  W_mat.block(0,0,ndim,ndim) = fullCov;
1630  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
1631  V0_err = D_vec.transpose() * W_mat * D_vec;
1632  }
1633 
1634  double tauErrsq = V0_err(0,0);
1635  if (tauErrsq <= 0.) ATH_MSG_DEBUG("tauError: negative sqrt tauErrsq " << tauErrsq);
1636  double tauErr = (tauErrsq>0.) ? sqrt(tauErrsq) : 0.;
1637  return CONST*tauErr;
1638  }
1639 
1640  double V0Tools::tau3DError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double M) const
1641  {
1642  // Tau = CONST*M*(Px*dx+Py*dy+Pz*dz)/(P*P)
1643  //double CONST = 1000./CLHEP::c_light;
1644  double CONST = 1000./299.792;

◆ tauError() [1/5]

double V0Tools::tauError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
double  massV0 
) const

proper time error wrt an xAOD::Vertex vertex assuming massV0 imposing a V0 mass without making an adjustment

Definition at line 1382 of file V0Tools.cxx.

1393  {
1394  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
1395  double trkCharge = 1.;
1396  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
1397  double phi = bPer->parameters()[Trk::phi];
1398  double theta = bPer->parameters()[Trk::theta];
1399  double qOverP = bPer->parameters()[Trk::qOverP];
1400  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
1401  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
1402  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
1403  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
1404  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
1405  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
1406  Px += bPer->momentum()[Trk::px];
1407  Py += bPer->momentum()[Trk::py];
1408  }
1409  double LXY = Px*dx+Py*dy;
1410 
1411  for( unsigned int it=0; it<NTrk; it++) {
1412  double dPTdqOverP = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
1413  double dPTdtheta = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
1414  double dPTdphi = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
1415  double dLXYdqOverP = dx*dpxdqOverP[it]+dy*dpydqOverP[it];
1416  double dLXYdtheta = dx*dpxdtheta[it]+dy*dpydtheta[it];
1417  double dLXYdphi = dx*dpxdphi[it]+dy*dpydphi[it];
1418  dTaudqOverP[it] = M*dLXYdqOverP/(PT*PT)-(2.*LXY*M*dPTdqOverP)/(PT*PT*PT);
1419  dTaudtheta[it] = M*dLXYdtheta/(PT*PT)-(2.*LXY*M*dPTdtheta)/(PT*PT*PT);
1420  dTaudphi[it] = M*dLXYdphi/(PT*PT)-(2.*LXY*M*dPTdphi)/(PT*PT*PT);
1421  }
1422  double dTaudx = (M*Px)/(PT*PT);
1423  double dTaudy = (M*Py)/(PT*PT);
1424  double dTaudx0 = -dTaudx;
1425  double dTaudy0 = -dTaudy;
1426 
1427  unsigned int ndim = 0;
1428  if (fullCov.size() != 0) {
1429  ndim = fullCov.rows();
1430  } else {
1431  ndim = 5*NTrk+3;
1432  }
1433 
1434  Amg::MatrixX V0_err;
1435  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
1436  Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
1437  for( unsigned int it=0; it<NTrk; it++) {
1438  D_vec(5*it+0) = 0.;
1439  D_vec(5*it+1) = 0.;
1440  D_vec(5*it+2) = dTaudphi[it];
1441  D_vec(5*it+3) = dTaudtheta[it];
1442  D_vec(5*it+4) = dTaudqOverP[it];
1443  }
1444  D_vec(5*NTrk+0) = dTaudx;
1445  D_vec(5*NTrk+1) = dTaudy;
1446  D_vec(5*NTrk+2) = 0.;
1447  D_vec(5*NTrk+3) = dTaudx0;
1448  D_vec(5*NTrk+4) = dTaudy0;
1449  D_vec(5*NTrk+5) = 0.;
1450 
1451  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
1452  if (fullCov.size() != 0) {
1453  W_mat.block(0,0,ndim,ndim) = fullCov;
1454  } else {
1455  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
1456  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
1457  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
1458  }
1459  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
1460  V0_err = D_vec.transpose() * W_mat * D_vec;
1461  } else if (ndim == 3*NTrk+3) {
1462  Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
1463  D_vec(0) = dTaudx;
1464  D_vec(1) = dTaudy;
1465  D_vec(2) = 0.;
1466  for( unsigned int it=0; it<NTrk; it++) {
1467  D_vec(3*it+3) = dTaudphi[it];
1468  D_vec(3*it+4) = dTaudtheta[it];
1469  D_vec(3*it+5) = dTaudqOverP[it];
1470  }
1471  D_vec(3*NTrk+3) = dTaudx0;
1472  D_vec(3*NTrk+4) = dTaudy0;
1473  D_vec(3*NTrk+5) = 0.;
1474 
1475  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
1476  W_mat.block(0,0,ndim,ndim) = fullCov;
1477  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
1478  V0_err = D_vec.transpose() * W_mat * D_vec;
1479  }
1480 
1481  double tauErrsq = V0_err(0,0);
1482  if (tauErrsq <= 0.) ATH_MSG_DEBUG("tauError: negative sqrt tauErrsq " << tauErrsq);
1483  double tauErr = (tauErrsq>0.) ? sqrt(tauErrsq) : 0.;
1484  return CONST*tauErr;
1485  }
1486 
1487  double V0Tools::tau3D(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, std::span<const double> masses) const
1488  {
1489  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1490  if (masses.size() != NTrk) {
1491  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ tauError() [2/5]

double V0Tools::tauError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
double  posTrackMass,
double  negTrackMass 
) const

proper time error wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass tau = CONST*M*lxy/pT

Definition at line 1226 of file V0Tools.cxx.

1229  {
1230  // Tau = CONST*M*(Px*dx+Py*dy)/(PT*PT)
1231  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1232  if (masses.size() != NTrk) {

◆ tauError() [3/5]

double V0Tools::tauError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
double  posTrackMass,
double  negTrackMass,
double  massV0 
) const

proper time error wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass (imposing massV0) independent of massV0, variable included to match the corresponding proper time method

Definition at line 1360 of file V0Tools.cxx.

1362  {
1363  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
1364  if (masses.size() != NTrk) {
1365  ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");

◆ tauError() [4/5]

double V0Tools::tauError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
std::span< const double >  masses 
) const

proper time error wrt an xAOD::Vertex vertex assuming track masses

Definition at line 1234 of file V0Tools.cxx.

1250  {
1251  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
1252  double trkCharge = 1.;
1253  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
1254  double phi = bPer->parameters()[Trk::phi];
1255  double theta = bPer->parameters()[Trk::theta];
1256  double qOverP = bPer->parameters()[Trk::qOverP];
1257  double tmp = 1./(qOverP*qOverP) + masses[it]*masses[it];
1258  double pe = (tmp>0.) ? sqrt(tmp) : 0.;
1259  dedqOverP[it] = -1./(qOverP*qOverP*qOverP*pe);
1260  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
1261  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
1262  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
1263  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
1264  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
1265  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
1266  dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
1267  dpzdtheta[it] = -(sin(theta)*trkCharge)/qOverP;
1268  E += pe;
1269  Px += bPer->momentum()[Trk::px];
1270  Py += bPer->momentum()[Trk::py];
1271  Pz += bPer->momentum()[Trk::pz];
1272  }
1273  double LXY = Px*dx+Py*dy;
1274 
1275  for( unsigned int it=0; it<NTrk; it++) {
1276  double dMdqOverP = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
1277  double dMdtheta = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
1278  double dMdphi = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
1279  double dPTdqOverP = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
1280  double dPTdtheta = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
1281  double dPTdphi = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
1282  double dLXYdqOverP = dx*dpxdqOverP[it]+dy*dpydqOverP[it];
1283  double dLXYdtheta = dx*dpxdtheta[it]+dy*dpydtheta[it];
1284  double dLXYdphi = dx*dpxdphi[it]+dy*dpydphi[it];
1285  dTaudqOverP[it] = (LXY*dMdqOverP+M*dLXYdqOverP)/(PT*PT)-(2.*LXY*M*dPTdqOverP)/(PT*PT*PT);
1286  dTaudtheta[it] = (LXY*dMdtheta+M*dLXYdtheta)/(PT*PT)-(2.*LXY*M*dPTdtheta)/(PT*PT*PT);
1287  dTaudphi[it] = (LXY*dMdphi+M*dLXYdphi)/(PT*PT)-(2.*LXY*M*dPTdphi)/(PT*PT*PT);
1288  }
1289  double dTaudx = (M*Px)/(PT*PT);
1290  double dTaudy = (M*Py)/(PT*PT);
1291  double dTaudx0 = -dTaudx;
1292  double dTaudy0 = -dTaudy;
1293 
1294  unsigned int ndim = 0;
1295  if (fullCov.size() != 0) {
1296  ndim = fullCov.rows();
1297  } else {
1298  ndim = 5*NTrk+3;
1299  }
1300 
1301  Amg::MatrixX V0_err;
1302  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
1303  Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
1304  for( unsigned int it=0; it<NTrk; it++) {
1305  D_vec(5*it+0) = 0.;
1306  D_vec(5*it+1) = 0.;
1307  D_vec(5*it+2) = dTaudphi[it];
1308  D_vec(5*it+3) = dTaudtheta[it];
1309  D_vec(5*it+4) = dTaudqOverP[it];
1310  }
1311  D_vec(5*NTrk+0) = dTaudx;
1312  D_vec(5*NTrk+1) = dTaudy;
1313  D_vec(5*NTrk+2) = 0.;
1314  D_vec(5*NTrk+3) = dTaudx0;
1315  D_vec(5*NTrk+4) = dTaudy0;
1316  D_vec(5*NTrk+5) = 0.;
1317 
1318  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
1319  if (fullCov.size() != 0) {
1320  W_mat.block(0,0,ndim,ndim) = fullCov;
1321  } else {
1322  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
1323  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
1324  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
1325  }
1326  W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
1327  V0_err = D_vec.transpose() * W_mat * D_vec;
1328  } else if (ndim == 3*NTrk+3) {
1329  Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
1330  D_vec(0) = dTaudx;
1331  D_vec(1) = dTaudy;
1332  D_vec(2) = 0.;
1333  for( unsigned int it=0; it<NTrk; it++) {
1334  D_vec(3*it+3) = dTaudphi[it];
1335  D_vec(3*it+4) = dTaudtheta[it];
1336  D_vec(3*it+5) = dTaudqOverP[it];
1337  }
1338  D_vec(3*NTrk+3) = dTaudx0;
1339  D_vec(3*NTrk+4) = dTaudy0;
1340  D_vec(3*NTrk+5) = 0.;
1341 
1342  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
1343  W_mat.block(0,0,ndim,ndim) = fullCov;
1344  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
1345  V0_err = D_vec.transpose() * W_mat * D_vec;
1346  }
1347 
1348  double tauErrsq = V0_err(0,0);
1349  if (tauErrsq <= 0.) ATH_MSG_DEBUG("tauError: negative sqrt tauErrsq " << tauErrsq);
1350  double tauErr = (tauErrsq>0.) ? sqrt(tauErrsq) : 0.;
1351  return CONST*tauErr;
1352  }
1353 
1354  double V0Tools::tauError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double posTrackMass, double negTrackMass, double massV0) const
1355  {
1356  std::array<double, 2> masses = {posTrackMass, negTrackMass};
1357 
1358  return tauError(vxCandidate,vertex,masses,massV0);

◆ tauError() [5/5]

double V0Tools::tauError ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
std::span< const double >  masses,
double  massV0 
) const

proper time error wrt an xAOD::Vertex vertex assuming track masses (imposing massV0) independent of massV0, variable included to match the corresponding proper time method

Definition at line 1367 of file V0Tools.cxx.

1377  {
1378  // Tau = CONST*M*(Px*dx+Py*dy)/(PT*PT)
1379  //double CONST = 1000./CLHEP::c_light;
1380  double CONST = 1000./299.792;

◆ tauMassCovariance()

Amg::MatrixX V0Tools::tauMassCovariance ( const xAOD::Vertex vxCandidate,
const xAOD::Vertex vertex,
std::span< const double >  masses 
) const

mass-proper time covariance

Definition at line 2530 of file V0Tools.cxx.

2548  {
2549  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
2550  double trkCharge = 1.;
2551  if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
2552  double phi = bPer->parameters()[Trk::phi];
2553  double theta = bPer->parameters()[Trk::theta];
2554  double qOverP = bPer->parameters()[Trk::qOverP];
2555  double tmp = 1./(qOverP*qOverP) + masses[it]*masses[it];
2556  double pe = (tmp>0.) ? sqrt(tmp) : 0.;
2557  dedqOverP[it] = -1./(qOverP*qOverP*qOverP*pe);
2558  dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
2559  dpxdtheta[it] = (cos(theta)*cos(phi)*trkCharge)/qOverP;
2560  dpxdphi[it] = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
2561  dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
2562  dpydtheta[it] = (cos(theta)*sin(phi)*trkCharge)/qOverP;
2563  dpydphi[it] = (sin(theta)*cos(phi)*trkCharge)/qOverP;
2564  dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
2565  dpzdtheta[it] = -(sin(theta)*trkCharge)/qOverP;
2566  E += pe;
2567  Px += bPer->momentum()[Trk::px];
2568  Py += bPer->momentum()[Trk::py];
2569  Pz += bPer->momentum()[Trk::pz];
2570  }
2571  double LXY = Px*dx+Py*dy;
2572 
2573  for( unsigned int it=0; it<NTrk; it++) {
2574  dMdqOverP[it] = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
2575  dMdtheta[it] = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
2576  dMdphi[it] = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
2577  double dPTdqOverP = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
2578  double dPTdtheta = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
2579  double dPTdphi = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
2580  double dLXYdqOverP = dx*dpxdqOverP[it]+dy*dpydqOverP[it];
2581  double dLXYdtheta = dx*dpxdtheta[it]+dy*dpydtheta[it];
2582  double dLXYdphi = dx*dpxdphi[it]+dy*dpydphi[it];
2583  dTaudqOverP[it] = (LXY*dMdqOverP[it]+M*dLXYdqOverP)/(PT*PT)-(2.*LXY*M*dPTdqOverP)/(PT*PT*PT);
2584  dTaudtheta[it] = (LXY*dMdtheta[it]+M*dLXYdtheta)/(PT*PT)-(2.*LXY*M*dPTdtheta)/(PT*PT*PT);
2585  dTaudphi[it] = (LXY*dMdphi[it]+M*dLXYdphi)/(PT*PT)-(2.*LXY*M*dPTdphi)/(PT*PT*PT);
2586  }
2587  double dTaudx = (M*Px)/(PT*PT);
2588  double dTaudy = (M*Py)/(PT*PT);
2589  double dTaudx0 = -dTaudx;
2590  double dTaudy0 = -dTaudy;
2591 
2592  unsigned int ndim = 0;
2593  if (fullCov.size() != 0) {
2594  ndim = fullCov.rows();
2595  } else {
2596  ndim = 5*NTrk+3;
2597  }
2598 
2599  if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
2600  Amg::MatrixX D_mat(5*NTrk+6,2); D_mat.setZero();
2601  for( unsigned int it=0; it<NTrk; it++) {
2602  D_mat(5*it+0,0) = 0.;
2603  D_mat(5*it+1,0) = 0.;
2604  D_mat(5*it+2,0) = CONST*dTaudphi[it];
2605  D_mat(5*it+3,0) = CONST*dTaudtheta[it];
2606  D_mat(5*it+4,0) = CONST*dTaudqOverP[it];
2607  D_mat(5*it+0,1) = 0.;
2608  D_mat(5*it+1,1) = 0.;
2609  D_mat(5*it+2,1) = dMdphi[it];
2610  D_mat(5*it+3,1) = dMdtheta[it];
2611  D_mat(5*it+4,1) = dMdqOverP[it];
2612  }
2613  D_mat(5*NTrk+0,0) = CONST*dTaudx;
2614  D_mat(5*NTrk+1,0) = CONST*dTaudy;
2615  D_mat(5*NTrk+2,0) = 0.;
2616  D_mat(5*NTrk+3,0) = CONST*dTaudx0;
2617  D_mat(5*NTrk+4,0) = CONST*dTaudy0;
2618  D_mat(5*NTrk+5,0) = 0.;
2619  Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
2620  if (fullCov.size() != 0) {
2621  W_mat.block(0,0,ndim,ndim) = fullCov;
2622  } else {
2623  Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
2624  W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
2625  W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
2626  }
2627  W_mat.block(5*NTrk+3,5*NTrk,3,3) = vertex->covariancePosition();
2628  V0_err = D_mat.transpose() * W_mat * D_mat;
2629  } else if (ndim == 3*NTrk+3) {
2630  Amg::MatrixX D_mat(3*NTrk+6,2); D_mat.setZero();
2631  D_mat(0,0) = CONST*dTaudx;
2632  D_mat(1,0) = CONST*dTaudy;
2633  D_mat(2,0) = 0.;
2634  for( unsigned int it=0; it<NTrk; it++) {
2635  D_mat(3*it+3,0) = CONST*dTaudphi[it];
2636  D_mat(3*it+4,0) = CONST*dTaudtheta[it];
2637  D_mat(3*it+5,0) = CONST*dTaudqOverP[it];
2638  D_mat(3*it+3,1) = dMdphi[it];
2639  D_mat(3*it+4,1) = dMdtheta[it];
2640  D_mat(3*it+5,1) = dMdqOverP[it];
2641  }
2642  D_mat(3*NTrk+3,0) = CONST*dTaudx0;
2643  D_mat(3*NTrk+4,0) = CONST*dTaudy0;
2644  D_mat(3*NTrk+5,0) = 0.;
2645  Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
2646  W_mat.block(0,0,ndim,ndim) = fullCov;
2647  W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
2648  V0_err = D_mat.transpose() * W_mat * D_mat;
2649  }
2650  return V0_err;
2651  }
2652 
2654  {
2655  unsigned int NTrk = vxCandidate->nTrackParticles();
2656  const std::vector<float> &matrix = vxCandidate->covariance();
2657 

◆ thetaStar()

double V0Tools::thetaStar ( const xAOD::Vertex vxCandidate,
double  mass1,
double  mass2 
)
static

Polarization angles in helicity frame (using positive track):

thetaStar (in rad)

Definition at line 1763 of file V0Tools.cxx.

1774  {
1775  xAOD::TrackParticle::FourMom_t PosMom = positiveTrack4Momentum(vxCandidate, posTrackMass);
1776  xAOD::TrackParticle::FourMom_t NegMom = negativeTrack4Momentum(vxCandidate, negTrackMass);
1777  CLHEP::HepLorentzVector posMom(PosMom.Px(),PosMom.Py(),PosMom.Pz(),PosMom.E());

◆ track4Momentum()

xAOD::TrackParticle::FourMom_t V0Tools::track4Momentum ( const xAOD::Vertex vxCandidate,
unsigned int  trkIndex,
double  trackMass 
)
static

Methods, returning the refitted 4-momenta of the positive and negative tracks and the V0 for a given hypothesis for the masses of the input tracks and the V0 mass.

Definition at line 413 of file V0Tools.cxx.

418  {
419  Amg::Vector3D mom = positiveTrackMomentum(vxCandidate);
420  xAOD::TrackParticle::FourMom_t lorentz(0,0,0,0);
421  double tmp = mass*mass + mom.x()*mom.x() + mom.y()*mom.y() + mom.z()*mom.z();

◆ trackMomentum()

Amg::Vector3D V0Tools::trackMomentum ( const xAOD::Vertex vxCandidate,
unsigned int  trkIndex 
)
static

Methods, returning the refitted 3-momenta of the positive and negative tracks and the V0 (for more than one track with the same charge, the first one is returned)

Definition at line 373 of file V0Tools.cxx.

374  {
375  Amg::Vector3D mom; mom.setZero();
376  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
377  if (NTrk != 2) return mom;

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ V04Momentum()

xAOD::TrackParticle::FourMom_t V0Tools::V04Momentum ( const xAOD::Vertex vxCandidate,
double  V0Mass 
)
static

Definition at line 443 of file V0Tools.cxx.

448  {
449  return vxCandidate->numberDoF();
450  }
451 

◆ V0Momentum()

Amg::Vector3D V0Tools::V0Momentum ( const xAOD::Vertex vxCandidate)
static

Definition at line 403 of file V0Tools.cxx.

408  {
409  Amg::Vector3D mom = trackMomentum(vxCandidate, trkIndex);
410  xAOD::TrackParticle::FourMom_t lorentz(0,0,0,0);
411  double tmp = mass*mass + mom.x()*mom.x() + mom.y()*mom.y() + mom.z()*mom.z();

◆ vertexProbability()

double V0Tools::vertexProbability ( const xAOD::Vertex vxCandidate) const

Probability of the vertex fit.

Definition at line 463 of file V0Tools.cxx.

463  {
464  double chi2prob = 1.-myCumulativeChiSquare(chi);
465  return chi2prob;
466  } else {
467  ATH_MSG_DEBUG("chi <= 0");
468  return -1.;
469  }
470  } else {
471  ATH_MSG_DEBUG("dof <= 0");
472  return -1.;
473  }
474 
475  }
476 
477  Amg::Vector3D V0Tools::vtx(const xAOD::Vertex * vxCandidate)
478  {
479  return vxCandidate->position();
480  }
481 

◆ vtx()

Amg::Vector3D V0Tools::vtx ( const xAOD::Vertex vxCandidate)
static

vertex position

Definition at line 483 of file V0Tools.cxx.

483  {
484  return vxCandidate->position().perp();
485  }
486 

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
GetLCDefs::CONST
@ CONST
Definition: GetLCDefs.h:21
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::V0Tools::a0xy
static double a0xy(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
closest distance in Z and the transverse plane of the momentum vector to an xAOD::Vertex a0xy using t...
Definition: V0Tools.cxx:671
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::py
@ py
Definition: ParamDefs.h:60
Trk::V0Tools::V0Momentum
static Amg::Vector3D V0Momentum(const xAOD::Vertex *vxCandidate)
Definition: V0Tools.cxx:403
FlavorTagDiscriminants::OnnxModelVersion::V2
@ V2
Trk::V0Tools::trackMomentum
static Amg::Vector3D trackMomentum(const xAOD::Vertex *vxCandidate, unsigned int trkIndex)
Methods, returning the refitted 3-momenta of the positive and negative tracks and the V0 (for more th...
Definition: V0Tools.cxx:373
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
Trk::V0Tools::a0xyError
double a0xyError(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex) const
errors on a0xy and a0z
Definition: V0Tools.cxx:809
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DMTest::P
P_v1 P
Definition: P.h:23
Trk::V0Tools::cosTheta
static double cosTheta(const xAOD::Vertex *vxCandidate, const Amg::Vector3D &vertex)
cosTheta (pointing angle to an Amg::Vector3D or an xAOD::Vertex)
Definition: V0Tools.cxx:1830
skel.it
it
Definition: skel.GENtoEVGEN.py:396
xAOD::TrackParticle_v1::FourMom_t
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition: TrackParticle_v1.h:72
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Trk::V0Tools::massProbability
double massProbability(double V0Mass, double mass, double massErr) const
Definition: V0Tools.cxx:353
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::V0Tools::invariantMassErrorBeforeFit
double invariantMassErrorBeforeFit(const xAOD::Vertex *vxCandidate, std::span< const double > masses, const EventContext &ctx, const Trk::IExtrapolator *) const
Definition: V0Tools.cxx:2297
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::V0Tools::rxy
static double rxy(const xAOD::Vertex *vxCandidate)
Rxy of the vertex.
Definition: V0Tools.cxx:488
Trk::pz
@ pz
global momentum (cartesian)
Definition: ParamDefs.h:61
LArG4AODNtuplePlotter.pe
pe
Definition: LArG4AODNtuplePlotter.py:116
Trk::V0Tools::track4Momentum
static xAOD::TrackParticle::FourMom_t track4Momentum(const xAOD::Vertex *vxCandidate, unsigned int trkIndex, double trackMass)
Methods, returning the refitted 4-momenta of the positive and negative tracks and the V0 for a given ...
Definition: V0Tools.cxx:413
Trk::V0Tools::invariantMassProbability
double invariantMassProbability(const xAOD::Vertex *vxCandidate, double V0Mass, double posTrackMass, double negTrackMass) const
Definition: V0Tools.cxx:324
Trk::V0Tools::tau3DError
double tau3DError(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
proper time error in 3D wrt an xAOD::Vertex vertex assuming track masses
Definition: V0Tools.cxx:1517
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
Trk::V0Tools::massErrorVxCandidate
double massErrorVxCandidate(const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
Definition: V0Tools.cxx:249
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
xAOD::TrackParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TrackParticle_v1.cxx:129
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
Index
IndexedConstituentUserInfo::Index Index
Definition: IndexedConstituentUserInfo.cxx:12
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::V0Tools::massTauCov
double massTauCov(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
Definition: V0Tools.cxx:2382
Trk::V0Tools::positiveTrackMomentum
static Amg::Vector3D positiveTrackMomentum(const xAOD::Vertex *vxCandidate)
Definition: V0Tools.cxx:379
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
parseMapping.v0
def v0
Definition: parseMapping.py:149
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::theta
@ theta
Definition: ParamDefs.h:66
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::V0Tools::convertCovMatrix
static Amg::MatrixX convertCovMatrix(const xAOD::Vertex *vxCandidate)
Definition: V0Tools.cxx:2659
Trk::IExtrapolator::extrapolate
virtual std::unique_ptr< NeutralParameters > extrapolate(const NeutralParameters &parameters, const Surface &sf, PropDirection dir=anyDirection, const BoundaryCheck &bcheck=true) const =0
Main extrapolation Interface starting from neutral parameters and aiming at surface.
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
Trk::px
@ px
Definition: ParamDefs.h:59
Trk::V0Tools::massErrorVKalVrt
double massErrorVKalVrt(const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
Definition: V0Tools.cxx:174
Trk::V0Tools::tau
double tau(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double posTrackMass, double negTrackMass) const
proper time wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass tau = CONST*M*lxy/pT
Definition: V0Tools.cxx:1171
Trk::V0Tools::makeV0Cov
static Amg::MatrixX makeV0Cov(const xAOD::Vertex *vxCandidate)
Definition: V0Tools.cxx:2511
Trk::V0Tools::a0
static double a0(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
closest distance of the momentum vector to an xAOD::Vertex
Definition: V0Tools.cxx:687
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::V0Tools::a0Error
double a0Error(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, bool in3D=true) const
error on a0
Definition: V0Tools.cxx:814
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Trk::V0Tools::lxyz
static double lxyz(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
projection of distance in 3D of the vertex wrt an xAOD::Vertex vertex along the momentum direction (P...
Definition: V0Tools.cxx:1049
Trk::V0Tools::negativeTrack4Momentum
static xAOD::TrackParticle::FourMom_t negativeTrack4Momentum(const xAOD::Vertex *vxCandidate, double negTrackMass)
Definition: V0Tools.cxx:433
Trk::V0Tools::positiveTrack4Momentum
static xAOD::TrackParticle::FourMom_t positiveTrack4Momentum(const xAOD::Vertex *vxCandidate, double posTrackMass)
Definition: V0Tools.cxx:423
Trk::V0Tools::origTrack
static const xAOD::TrackParticle * origTrack(const xAOD::Vertex *vxCandidate, int trkIndex)
pointers to original tracks
Definition: V0Tools.cxx:1878
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::V0Tools::charge
static float charge(const xAOD::Vertex *vxCandidate)
sum of the charges of the tracks in the vertex
Definition: V0Tools.cxx:1864
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::V0Tools::massErrorV0Fitter
double massErrorV0Fitter(const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
Definition: V0Tools.cxx:108
Trk::V0Tools::phiStar
static double phiStar(const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass)
phiStar
Definition: V0Tools.cxx:1803
xAOD::TrackParticle_v1::qOverP
float qOverP() const
Returns the parameter.
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::V0Tools::cosTheta_xy
static double cosTheta_xy(const xAOD::Vertex *vxCandidate, const Amg::Vector3D &vertex)
cosTheta (pointing angle to an Amg::Vector3D or an xAOD::Vertex in transverse plane)
Definition: V0Tools.cxx:1846
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
Trk::V0Tools::negativeTrackMomentum
static Amg::Vector3D negativeTrackMomentum(const xAOD::Vertex *vxCandidate)
Definition: V0Tools.cxx:391
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::IExtrapolator
Definition: IExtrapolator.h:62
xAOD::Vertex_v1::numberDoF
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
xAOD::Vertex_v1::covariance
const std::vector< float > & covariance() const
Returns the covariance matrix as a simple vector of values.
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
a
TList * a
Definition: liststreamerinfos.cxx:10
xAOD::Vertex_v1::chiSquared
float chiSquared() const
Returns the of the vertex fit as float.
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Trk::V0Tools::thetaStar
static double thetaStar(const xAOD::Vertex *vxCandidate, double mass1, double mass2)
Polarization angles in helicity frame (using positive track):
Definition: V0Tools.cxx:1763
Trk::V0Tools::ndof
static float ndof(const xAOD::Vertex *vxCandidate)
NDoF of the vertex fit.
Definition: V0Tools.cxx:453
Trk::V0Tools::invariantMass
double invariantMass(const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
Methods, returning the invariant mass, error on the invariant mass and Chi2 probability of the invari...
Definition: V0Tools.cxx:46
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
python.changerun.pv
pv
Definition: changerun.py:81
Trk::V0Tools::vtx
static Amg::Vector3D vtx(const xAOD::Vertex *vxCandidate)
vertex position
Definition: V0Tools.cxx:483
Trk::V0Tools::invariantMassBeforeFit
double invariantMassBeforeFit(const xAOD::Vertex *vxCandidate, std::span< const double > masses, const EventContext &, const Trk::IExtrapolator *) const
Definition: V0Tools.cxx:2171
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Trk::V0Tools::invariantMassErrorBeforeFitIP
double invariantMassErrorBeforeFitIP(const xAOD::Vertex *vxCandidate, std::span< const double > masses) const
Definition: V0Tools.cxx:2230
Trk::V0Tools::pca
static Amg::Vector3D pca(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
point of closest approach of the momentum vector to an xAOD::Vertex
Definition: V0Tools.cxx:626
Trk::V0Tools::tau3D
double tau3D(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, std::span< const double > masses) const
proper time in 3D wrt an xAOD::Vertex vertex assuming track masses
Definition: V0Tools.cxx:1493
Trk::phi
@ phi
Definition: ParamDefs.h:75
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
xAOD::Vertex_v1::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Definition: Vertex_v1.cxx:181
get_generator_info.error
error
Definition: get_generator_info.py:40
FlavorTagDiscriminants::OnnxModelVersion::V0
@ V0
H5Utils::internal::PT
H5::PredType PT
Definition: H5Traits.cxx:15
error
Definition: IImpactPoint3dEstimator.h:70
Trk::V0Tools::invariantMassError
double invariantMassError(const xAOD::Vertex *vxCandidate, double posTrackMass, double negTrackMass) const
Definition: V0Tools.cxx:76
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
FlavorTagDiscriminants::OnnxModelVersion::V1
@ V1
Trk::V0Tools::tauError
double tauError(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex, double posTrackMass, double negTrackMass) const
proper time error wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass tau = CONST*M*lxy...
Definition: V0Tools.cxx:1226
Trk::V0Tools::lxy
static double lxy(const xAOD::Vertex *vxCandidate, const xAOD::Vertex *vertex)
projection of distance in xy of the vertex wrt an xAOD::Vertex vertex along the momentum direction (P...
Definition: V0Tools.cxx:935
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
fitman.k
k
Definition: fitman.py:528
SUSY_SimplifiedModel_PreInclude.masses
dictionary masses
Definition: SUSY_SimplifiedModel_PreInclude.py:7