ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
xAOD::BPhysHypoHelper Class Reference

#include <BPhysHypoHelper.h>

Inheritance diagram for xAOD::BPhysHypoHelper:
Collaboration diagram for xAOD::BPhysHypoHelper:

Public Types

enum  pv_type { PV_MAX_SUM_PT2, PV_MIN_A0, PV_MIN_Z0, PV_MIN_Z0_BA }
 : Enum type of the PV More...
 

Public Member Functions

 BPhysHypoHelper (const std::string &hypo, const xAOD::Vertex *b)
 : Main constructor More...
 
const xAOD::Vertexvtx () const
 Getter method for the cached xAOD::Vertex. More...
 
const TMatrixTSym< double > & covariance ()
 : Returns full covariance matrix More...
 
int nRefTrks ()
 Returns number of stored refitted track momenta. More...
 
TVector3 refTrk (const size_t index)
 Returns i-th refitted track 3-momentum. More...
 
const std::vector< TVector3 > & refTrks ()
 Returns refitted track momenta. More...
 
TLorentzVector refTrk (const size_t index, const float mass)
 Returns i-th refitted track as a 4-vector given the mass hypothesis. More...
 
const xAOD::IParticlerefTrkOrigin (const size_t index) const
 : Returns the original track (charged or neutral) corresponding to the i-th refitted track More...
 
TVector3 refTrkOriginP (const size_t index) const
 Returns perigee 3-momentum of the original track corresponding i-th refitted track. More...
 
TLorentzVector refTrkOriginP (const size_t index, const float mass) const
 : Returns lorentz vector build from the original track perigee momentum and given mass hypothesis More...
 
float refTrkCharge (const size_t index) const
 Returns charge of the i-th track. More...
 
bool setRefTrks (std::vector< float > px, std::vector< float > py, std::vector< float > pz)
 Sets refitted track momenta. More...
 
bool setRefTrks (const std::vector< TVector3 > &refTrks)
 Sets refitted track momenta. More...
 
bool setRefTrks ()
 : Sets refitted track momenta More...
 
TVector3 totalP ()
 : Returns total 3-momentum calculated from the refitted tracks More...
 
TLorentzVector totalP (std::span< const double > masses)
 Returns total 4-momentum calculated from the refitted tracks given mass hypotheses for individual tracks. More...
 
float ptErr ()
 Returns pT error. More...
 
bool setPtErr (const float val)
 Set pT error. More...
 
int nMuons ()
 : Methods providing access to the linked muons More...
 
int nElectrons ()
 
const xAOD::Muonmuon (const size_t index)
 Returns pointer to the i-th linked muon. More...
 
const xAOD::Electronelectron (const size_t index)
 
const std::vector< const xAOD::Muon * > & muons ()
 Returns linked muons. More...
 
const std::vector< const xAOD::Electron * > & electrons ()
 
bool setMuons (const std::vector< const xAOD::Muon * > &muons, const xAOD::MuonContainer *muonContainer)
 Set links to muons. More...
 
bool setElectrons (const std::vector< const xAOD::Electron * > &electrons, const xAOD::ElectronContainer *electronContainer)
 
int nPrecedingVertices ()
 : Links to preceding vertices More...
 
const xAOD::VertexprecedingVertex (const size_t index)
 Returns pointer to a preceding vertex. More...
 
const std::vector< const xAOD::Vertex * > & precedingVertices ()
 Returns vector of pointers to preceding vertices. More...
 
bool setPrecedingVertices (const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
 Sets links to preceding vertices. More...
 
int nCascadeVertices ()
 : Links to cascade vertices More...
 
const xAOD::VertexcascadeVertex (const size_t index)
 Returns pointer to a cascade vertex. More...
 
const std::vector< const xAOD::Vertex * > & cascadeVertices ()
 Returns vector of pointers to cascade vertices. More...
 
bool setCascadeVertices (const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
 Sets links to cascade vertices. More...
 
int nRefTrksCascade ()
 Returns number of stored refitted tracks INCLUDING those from the linked cascade vertices. More...
 
const xAOD::Vertexpv (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Get the refitted collision vertex of type pv_type. More...
 
const xAOD::VertexorigPv (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 original PV More...
 
bool setOrigPv (const xAOD::Vertex *pv, const xAOD::VertexContainer *vertexContainer, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the original collision vertex of type pv_type. More...
 
bool setPv (const xAOD::Vertex *pv, const xAOD::VertexContainer *vertexContainer, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the refitted collision vertex of type pv_type. More...
 
bool setRefitPVStatus (int code, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the exitCode of the refitter for vertex of type pv_type. More...
 
int RefitPVStatus (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Get the exitCode of the refitter for vertex of type pv_type. More...
 
float lxy (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Get the transverse decay distance and its error measured between the refitted primary vertex of type pv_type and the B vertex. More...
 
float lxyErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error More...
 
bool setLxy (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the transverse decay distance and its error measured between the refitted primary vertex of type pv_type and the B vertex. More...
 
bool setLxyErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error More...
 
float lxyz (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 decay distance More...
 
float lxyzErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error More...
 
bool setLxyz (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 decay distance More...
 
bool setLxyzErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error More...
 
float a0 (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Get the 3D, transverse, and longitudinal impact parameters and their error. More...
 
float a0Err (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 3D impact parameter error More...
 
float a0xy (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter More...
 
float a0xyErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 rtansverse impact parameter error More...
 
float z0 (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter More...
 
float z0Err (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter error More...
 
float setA0 (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the 3D and transverse impact parameters and their error. More...
 
float setA0Err (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 3D impact parameter error More...
 
float setA0xy (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter More...
 
float setA0xyErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter error More...
 
float setZ0 (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter More...
 
float setZ0Err (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter error More...
 
float mass () const
 Get invariant mass and its error. More...
 
float massErr () const
 invariant mass error More...
 
bool setMass (const float val)
 Set given invariant mass and its error. More...
 
bool setMassErr (const float val)
 invariant mass error More...
 
bool setMass (std::span< const double > trkMasses)
 Set invariant mass for given track mass hypotheses. More...
 
bool pass () const
 get the pass flag for this hypothesis More...
 
bool setPass (bool passVal)
 get the pass flag for this hypothesis More...
 
int nRefTrks ()
 Returns number of stored refitted track momenta. More...
 
TVector3 refTrk (const size_t index)
 Returns i-th refitted track 3-momentum. More...
 
TLorentzVector refTrk (const size_t index, const float mass)
 Returns i-th refitted track as a 4-vector given the mass hypothesis. More...
 
const std::vector< TVector3 > & refTrks ()
 Returns refitted track momenta. More...
 
const xAOD::IParticlerefTrkOrigin (const size_t index) const
 : Returns the original track (charged or neutral) corresponding to the i-th refitted track More...
 
TVector3 refTrkOriginP (const size_t index) const
 Returns perigee 3-momentum of the original track corresponding i-th refitted track. More...
 
TLorentzVector refTrkOriginP (const size_t index, const float mass) const
 : Returns lorentz vector build from the original track perigee momentum and given mass hypothesis More...
 
float refTrkCharge (const size_t index) const
 Returns charge of the i-th track. More...
 
bool setRefTrks (std::vector< float > px, std::vector< float > py, std::vector< float > pz)
 Sets refitted track momenta. More...
 
bool setRefTrks (const std::vector< TVector3 > &refTrks)
 Sets refitted track momenta. More...
 
bool setRefTrks ()
 : Sets refitted track momenta More...
 
TVector3 totalP ()
 : Returns total 3-momentum calculated from the refitted tracks More...
 
TLorentzVector totalP (std::span< const double > masses)
 Returns total 4-momentum calculated from the refitted tracks given mass hypotheses for individual tracks. More...
 
float ptErr ()
 Returns pT error. More...
 
bool setPtErr (const float val)
 Set pT error. More...
 
int nMuons ()
 : Methods providing access to the linked muons More...
 
int nElectrons ()
 
const xAOD::Muonmuon (const size_t index)
 Returns pointer to the i-th linked muon. More...
 
const xAOD::Electronelectron (const size_t index)
 
const std::vector< const xAOD::Muon * > & muons ()
 Returns linked muons. More...
 
const std::vector< const xAOD::Electron * > & electrons ()
 
bool setMuons (const std::vector< const xAOD::Muon * > &muons, const xAOD::MuonContainer *muonContainer)
 Set links to muons. More...
 
bool setElectrons (const std::vector< const xAOD::Electron * > &electrons, const xAOD::ElectronContainer *electronContainer)
 
int nPrecedingVertices ()
 : Links to preceding vertices More...
 
const xAOD::VertexprecedingVertex (const size_t index)
 Returns pointer to a preceding vertex. More...
 
const std::vector< const xAOD::Vertex * > & precedingVertices ()
 Returns vector of pointers to preceding vertices. More...
 
bool setPrecedingVertices (const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
 Sets links to preceding vertices. More...
 
int nCascadeVertices ()
 : Links to cascade vertices More...
 
const xAOD::VertexcascadeVertex (const size_t index)
 Returns pointer to a cascade vertex. More...
 
const std::vector< const xAOD::Vertex * > & cascadeVertices ()
 Returns vector of pointers to cascade vertices. More...
 
bool setCascadeVertices (const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
 Sets links to cascade vertices. More...
 
int nRefTrksCascade ()
 Returns number of stored refitted tracks INCLUDING those from the linked cascade vertices. More...
 
const xAOD::Vertexpv (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Get the refitted collision vertex of type pv_type. More...
 
const xAOD::VertexorigPv (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 original PV More...
 
bool setOrigPv (const xAOD::Vertex *pv, const xAOD::VertexContainer *vertexContainer, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the original collision vertex of type pv_type. More...
 
bool setPv (const xAOD::Vertex *pv, const xAOD::VertexContainer *vertexContainer, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the refitted collision vertex of type pv_type. More...
 
bool setRefitPVStatus (int code, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the exitCode of the refitter for vertex of type pv_type. More...
 
int RefitPVStatus (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Get the exitCode of the refitter for vertex of type pv_type. More...
 
float lxy (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Get the transverse decay distance and its error measured between the refitted primary vertex of type pv_type and the B vertex. More...
 
float lxyErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error More...
 
bool setLxy (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the transverse decay distance and its error measured between the refitted primary vertex of type pv_type and the B vertex. More...
 
bool setLxyErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error More...
 
float lxyz (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 decay distance More...
 
float lxyzErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error More...
 
bool setLxyz (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 decay distance More...
 
bool setLxyzErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error More...
 
float a0 (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Get the 3D, transverse, and longitudinal impact parameters and their error. More...
 
float a0Err (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 3D impact parameter error More...
 
float a0xy (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter More...
 
float a0xyErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 rtansverse impact parameter error More...
 
float z0 (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter More...
 
float z0Err (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter error More...
 
float setA0 (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 Set the 3D and transverse impact parameters and their error. More...
 
float setA0Err (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 3D impact parameter error More...
 
float setA0xy (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter More...
 
float setA0xyErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter error More...
 
float setZ0 (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter More...
 
float setZ0Err (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter error More...
 

Static Public Attributes

static const std::string pv_type_str []
 
static const unsigned int n_pv_types = 4
 
static const std::string pv_type_str []
 
static const unsigned int n_pv_types = 4
 

Protected Member Functions

bool cacheCov ()
 : Cache covariance matrix More...
 
bool cacheRefTracks ()
 : Cache refitted tracks More...
 
bool cacheMuons ()
 : Cache linked muons More...
 
bool cacheElectrons ()
 
bool cachePrecedingVertices ()
 : Cache preceding vertices More...
 
bool cacheCascadeVertices ()
 : Cache cascade vertices More...
 

Protected Attributes

const xAOD::Vertexm_b
 Cached B decay xAOD vertex. More...
 
bool m_covCached
 
TMatrixTSym< doublem_cachedCov
 
bool m_refTracksCached
 
std::vector< TVector3 > m_cachedRefTracks
 
bool m_muonsCached
 
bool m_electronsCached
 
std::vector< const xAOD::Muon * > m_cachedMuons
 
std::vector< const xAOD::Electron * > m_cachedElectrons
 
bool m_precedingVerticesCached
 
std::vector< const xAOD::Vertex * > m_cachedPrecedingVertices
 
bool m_cascadeVerticesCached
 
std::vector< const xAOD::Vertex * > m_cachedCascadeVertices
 
std::string m_hypo
 name of the mass hypothesis More...
 
bool m_covCached
 
TMatrixTSym< doublem_cachedCov
 
bool m_refTracksCached
 
std::vector< TVector3 > m_cachedRefTracks
 
bool m_muonsCached
 
bool m_electronsCached
 
std::vector< const xAOD::Muon * > m_cachedMuons
 
std::vector< const xAOD::Electron * > m_cachedElectrons
 
bool m_precedingVerticesCached
 
std::vector< const xAOD::Vertex * > m_cachedPrecedingVertices
 
bool m_cascadeVerticesCached
 
std::vector< const xAOD::Vertex * > m_cachedCascadeVertices
 

Static Protected Attributes

static const std::vector< TVector3 > s_emptyVectorOfTVector3
 
static const std::vector< const xAOD::Muon * > s_emptyVectorOfMuons
 
static const std::vector< const xAOD::Electron * > s_emptyVectorOfElectrons
 
static const TMatrixTSym< doubles_emptyMatrix
 
static const std::vector< const xAOD::Vertex * > s_emptyVectorOfVertices
 
static const std::vector< TVector3 > s_emptyVectorOfTVector3
 
static const std::vector< const xAOD::Muon * > s_emptyVectorOfMuons
 
static const std::vector< const xAOD::Electron * > s_emptyVectorOfElectrons
 
static const TMatrixTSym< doubles_emptyMatrix
 
static const std::vector< const xAOD::Vertex * > s_emptyVectorOfVertices
 
enum  tau_type { TAU_CONST_MASS, TAU_INV_MASS }
 : Enum type the proper decay time calculation More...
 
float tau (const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
 : Get the proper decay time and error. More...
 
float tauErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
 proper decay time error More...
 
bool setTau (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
 : Set the proper decay time and error. More...
 
bool setTauErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
 proper decay time error More...
 
float tau3d (const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
 proper decay time More...
 
float tau3dErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
 proper decay time error More...
 
bool setTau3d (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
 proper decay time More...
 
bool setTau3dErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
 proper decay time error More...
 

Detailed Description

Definition at line 73 of file BPhysHypoHelper.h.

Member Enumeration Documentation

◆ pv_type

: Enum type of the PV

This enum type is used to identify type of the PV and quantities calculated using the PV. For instance, the transverse distance can be calculated wrt the default PV, the closest PV etc.

@value: PV_MAX_SUM_PT2 vertex with the largest sum Pt^2 (the default one) @value: PV_MIN_A0 collision vertex closest in 3D to the particle's trajectory, i.e. the vertex with the smalles 3D impact parameter a0 @value: PV_MIN_Z0 collision vertex closest in delta(z0) = pv_z - z0, where z0 is the z coordinate of the intesection of the particle's trajectory with the beam axis in the Z-rho plane. @value: PV_MIN_Z0_BA collision vertex closest in delta(z0) = pv_z - z0, where z0 is the z coordinate of the point of closest aproach (in 2D) to the particle's trajectory with the beam axis in the Z-rho plane.

Enumerator
PV_MAX_SUM_PT2 
PV_MIN_A0 
PV_MIN_Z0 
PV_MIN_Z0_BA 

Definition at line 475 of file BPhysHelper.h.

◆ tau_type

: Enum type the proper decay time calculation

Methods for access to the proper decay time and its error TAU_CONST_MASS the proper decay time calculated with the constant mass hypothesis TAU_INV_MASS the proper decay time calculated with the measured invariant mass

Enumerator
TAU_CONST_MASS 
TAU_INV_MASS 

Definition at line 137 of file BPhysHypoHelper.h.

Constructor & Destructor Documentation

◆ BPhysHypoHelper()

xAOD::BPhysHypoHelper::BPhysHypoHelper ( const std::string &  hypo,
const xAOD::Vertex b 
)
inline

: Main constructor

The Main constructor. BPhysHypoHelper does NOT take ownership of the class "b"

Parameters
[in]hypoName of the hypothesis
[in]bPointer to the xAOD::Vertex

Definition at line 86 of file BPhysHypoHelper.h.

86  :
87  BPhysHelper(b),
88  m_hypo(hypo)
89  {
90  /* nothing here */
91  }

Member Function Documentation

◆ a0()

float xAOD::BPhysHelper::a0 ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

Get the 3D, transverse, and longitudinal impact parameters and their error.

Impact parameters and their error

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Returns
: impact parameter or its error, -9999999. in case augmentation is not available 3D impact parameter

Definition at line 957 of file BPhysHelper.cxx.

958 {
959  switch(vertexType) {
960  case PV_MAX_SUM_PT2 : GET_FLOAT("A0MaxSumPt2");
961  case PV_MIN_A0 : GET_FLOAT("A0MinA0");
962  case PV_MIN_Z0 : GET_FLOAT("A0MinZ0");
963  case PV_MIN_Z0_BA : GET_FLOAT("A0MinZ0BA");
964  default: return -9999999.;
965  }
966 }

◆ a0Err()

float xAOD::BPhysHelper::a0Err ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

3D impact parameter error

Definition at line 968 of file BPhysHelper.cxx.

969 {
970  switch(vertexType) {
971  case PV_MAX_SUM_PT2 : GET_FLOAT("A0ErrMaxSumPt2");
972  case PV_MIN_A0 : GET_FLOAT("A0ErrMinA0");
973  case PV_MIN_Z0 : GET_FLOAT("A0ErrMinZ0");
974  case PV_MIN_Z0_BA : GET_FLOAT("A0ErrMinZ0BA");
975  default: return -9999999.;
976  }
977 }

◆ a0xy()

float xAOD::BPhysHelper::a0xy ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

transverse impact parameter

Definition at line 979 of file BPhysHelper.cxx.

980 {
981  switch(vertexType) {
982  case PV_MAX_SUM_PT2 : GET_FLOAT("A0xyMaxSumPt2");
983  case PV_MIN_A0 : GET_FLOAT("A0xyMinA0");
984  case PV_MIN_Z0 : GET_FLOAT("A0xyMinZ0");
985  case PV_MIN_Z0_BA : GET_FLOAT("A0xyMinZ0BA");
986  default: return -9999999.;
987  }
988 }

◆ a0xyErr()

float xAOD::BPhysHelper::a0xyErr ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

rtansverse impact parameter error

Definition at line 990 of file BPhysHelper.cxx.

991 {
992  switch(vertexType) {
993  case PV_MAX_SUM_PT2 : GET_FLOAT("A0xyErrMaxSumPt2");
994  case PV_MIN_A0 : GET_FLOAT("A0xyErrMinA0");
995  case PV_MIN_Z0 : GET_FLOAT("A0xyErrMinZ0");
996  case PV_MIN_Z0_BA : GET_FLOAT("A0xyErrMinZ0BA");
997  default: return -9999999.;
998  }
999 }

◆ cacheCascadeVertices()

bool xAOD::BPhysHelper::cacheCascadeVertices ( )
protectedinherited

: Cache cascade vertices

To speed up access to linked cascade vertices, m_cachedCascadeVertices vector is created first time linked cascade vertices accessor methods are called. In subsequent calls, cached vector is used.

Returns
: true on success

Definition at line 1316 of file BPhysHelper.cxx.

1317 {
1318  // if linked cascade vertices are already cached do nothing and return true
1320  return true;
1321 
1322  // if linked cascade vertices are cached but the cache is empty, return false (error)
1324  return false;
1325 
1326  // Linked cascade vertices are not cached, yet. Retrieve them from the aux store:
1327  m_cascadeVerticesCached = true;
1328  m_cachedCascadeVertices.clear();
1329 
1330  // Create auxiliary branches accessors
1331  static const SG::AuxElement::Accessor<VertexLinkVector> cascadeVertexLinksAcc("CascadeVertexLinks");
1332 
1333  // check if branch exists
1334  if(!cascadeVertexLinksAcc.isAvailable(*m_b)) {
1335  return false;
1336  }
1337 
1338  // retrieve the cascadeVertex links...
1339  const VertexLinkVector& cascadeVertexLinks = cascadeVertexLinksAcc(*m_b);
1340 
1341  // ... and check if they are all valid
1342  VertexLinkVector::const_iterator cascadeVertexLinksItr = cascadeVertexLinks.begin();
1343  for(; cascadeVertexLinksItr!=cascadeVertexLinks.end(); ++cascadeVertexLinksItr) {
1344  // check if links are valid
1345  if(!(*cascadeVertexLinksItr).isValid()) {
1346  return false;
1347  }
1348  }
1349 
1350  // all OK, cache the cascadeVertices
1351  cascadeVertexLinksItr = cascadeVertexLinks.begin();
1352  for(; cascadeVertexLinksItr!=cascadeVertexLinks.end(); ++cascadeVertexLinksItr) {
1353  m_cachedCascadeVertices.push_back(*(*cascadeVertexLinksItr));
1354  }
1355 
1356  return true;
1357 
1358 }

◆ cacheCov()

bool xAOD::BPhysHelper::cacheCov ( )
protectedinherited

: Cache covariance matrix

To speed up access to covariance matrix, m_cachedCov attribute is created first time covariance matrix accessor method is called. In subsequent calls, cached matrix is used.

Returns
: true on success

Definition at line 1089 of file BPhysHelper.cxx.

1090 {
1091  // if cov matrix is already cached, do nothing and return true
1092  if(m_covCached && m_cachedCov.GetNrows()!=0)
1093  return true;
1094 
1095  // if cov matrix is cached but the cache is empty, return false (error)
1096  if(m_covCached && m_cachedCov.GetNrows()==0)
1097  return false;
1098 
1099  // get number of tracks
1100  // if ref tracks are stripped from the vertex, this will not work and
1101  // error will be returned
1102  const int nTrk = nRefTrks();
1103  if(nTrk<0)
1104  return false;
1105 
1106  // Covariance matrix not cached, yet. Retrieve them from
1107  // the vertex and convert:
1108  m_covCached = true;
1109 
1110  // retrieve native covariance matrix
1111  const std::vector<float>& cov = m_b->covariance();
1112 
1113  // convert covariance matrix
1114  if(int(cov.size())==(3*nTrk+3)*(3*nTrk+3+1)/2) {
1115  // this is a VKalVrtFitter covariance matrix
1116  m_cachedCov.ResizeTo(3+3*nTrk, 3+3*nTrk);
1117 
1118  long int ij=0;
1119  for(int i=0; i<(3+3*nTrk); i++) {
1120  for(int j=0; j<=i; j++) {
1121  m_cachedCov(i,j) = cov[ij];
1122  ij++;
1123  }
1124  }
1125 
1126  return true;
1127  }
1128 
1129  // FIXME: so far we can only conver VKalVrt cov matrix
1130 
1131  // error
1132  return false;
1133 
1134 }

◆ cacheElectrons()

bool xAOD::BPhysHelper::cacheElectrons ( )
protectedinherited

Definition at line 1226 of file BPhysHelper.cxx.

1227 {
1228  // if linked electrons are already cached do nothing and return true
1229  if(m_electronsCached && !m_cachedElectrons.empty())
1230  return true;
1231 
1232  // if linked electrons are cached but the cache is empty, return false (error)
1233  if(m_electronsCached && m_cachedElectrons.empty())
1234  return false;
1235 
1236  // Linked electrons are not cached, yet. Retrieve them from the aux store:
1237  m_electronsCached = true;
1238  m_cachedElectrons.clear();
1239 
1240  // Create auxiliary branches accessors
1241  static const SG::AuxElement::Accessor<ElectronLinkVector> electronLinksAcc("ElectronLinks");
1242 
1243  // check if branch exists
1244  if(!electronLinksAcc.isAvailable(*m_b)) {
1245  return false;
1246  }
1247 
1248  // retrieve the electron links...
1249  const ElectronLinkVector& electronLinks = electronLinksAcc(*m_b);
1250 
1251  // ... and check if they are all valid
1252  ElectronLinkVector::const_iterator electronLinksItr = electronLinks.begin();
1253  for(; electronLinksItr!=electronLinks.end(); ++electronLinksItr) {
1254  // check if links are valid
1255  if(!(*electronLinksItr).isValid()) {
1256  return false;
1257  }
1258  }
1259 
1260  // all OK, cache the electrons
1261  electronLinksItr = electronLinks.begin();
1262  for(; electronLinksItr!=electronLinks.end(); ++electronLinksItr) {
1263  m_cachedElectrons.push_back(*(*electronLinksItr));
1264  }
1265 
1266  return true;
1267 
1268 }

◆ cacheMuons()

bool xAOD::BPhysHelper::cacheMuons ( )
protectedinherited

: Cache linked muons

To speed up access to linked muons, m_cachedMuons vector is created first time linked muon accessor methods are called. In subsequent calls, cached vector is used.

Returns
: true on success

Definition at line 1181 of file BPhysHelper.cxx.

1182 {
1183  // if linked muons are already cached do nothing and return true
1184  if(m_muonsCached && !m_cachedMuons.empty())
1185  return true;
1186 
1187  // if linked muons are cached but the cache is empty, return false (error)
1188  if(m_muonsCached && m_cachedMuons.empty())
1189  return false;
1190 
1191  // Linked muons are not cached, yet. Retrieve them from the aux store:
1192  m_muonsCached = true;
1193  m_cachedMuons.clear();
1194 
1195  // Create auxiliary branches accessors
1196  static const SG::AuxElement::Accessor<MuonLinkVector> muonLinksAcc("MuonLinks");
1197 
1198  // check if branch exists
1199  if(!muonLinksAcc.isAvailable(*m_b)) {
1200  return false;
1201  }
1202 
1203  // retrieve the muon links...
1204  const MuonLinkVector& muonLinks = muonLinksAcc(*m_b);
1205 
1206  // ... and check if they are all valid
1207  MuonLinkVector::const_iterator muonLinksItr = muonLinks.begin();
1208  for(; muonLinksItr!=muonLinks.end(); ++muonLinksItr) {
1209  // check if links are valid
1210  if(!(*muonLinksItr).isValid()) {
1211  return false;
1212  }
1213  }
1214 
1215  // all OK, cache the muons
1216  muonLinksItr = muonLinks.begin();
1217  for(; muonLinksItr!=muonLinks.end(); ++muonLinksItr) {
1218  m_cachedMuons.push_back(*(*muonLinksItr));
1219  }
1220 
1221  return true;
1222 
1223 }

◆ cachePrecedingVertices()

bool xAOD::BPhysHelper::cachePrecedingVertices ( )
protectedinherited

: Cache preceding vertices

To speed up access to linked preceding vertices, m_cachedPrecedingVertices vector is created first time linked preceding vertices accessor methods are called. In subsequent calls, cached vector is used.

Returns
: true on success

Definition at line 1271 of file BPhysHelper.cxx.

1272 {
1273  // if linked preceding vertices are already cached do nothing and return true
1275  return true;
1276 
1277  // if linked preceding vertices are cached but the cache is empty, return false (error)
1279  return false;
1280 
1281  // Linked preceding vertices are not cached, yet. Retrieve them from the aux store:
1283  m_cachedPrecedingVertices.clear();
1284 
1285  // Create auxiliary branches accessors
1286  static const SG::AuxElement::Accessor<VertexLinkVector> precedingVertexLinksAcc("PrecedingVertexLinks");
1287 
1288  // check if branch exists
1289  if(!precedingVertexLinksAcc.isAvailable(*m_b)) {
1290  return false;
1291  }
1292 
1293  // retrieve the precedingVertex links...
1294  const VertexLinkVector& precedingVertexLinks = precedingVertexLinksAcc(*m_b);
1295 
1296  // ... and check if they are all valid
1297  VertexLinkVector::const_iterator precedingVertexLinksItr = precedingVertexLinks.begin();
1298  for(; precedingVertexLinksItr!=precedingVertexLinks.end(); ++precedingVertexLinksItr) {
1299  // check if links are valid
1300  if(!(*precedingVertexLinksItr).isValid()) {
1301  return false;
1302  }
1303  }
1304 
1305  // all OK, cache the precedingVertices
1306  precedingVertexLinksItr = precedingVertexLinks.begin();
1307  for(; precedingVertexLinksItr!=precedingVertexLinks.end(); ++precedingVertexLinksItr) {
1308  m_cachedPrecedingVertices.push_back(*(*precedingVertexLinksItr));
1309  }
1310 
1311  return true;
1312 
1313 }

◆ cacheRefTracks()

bool xAOD::BPhysHelper::cacheRefTracks ( )
protectedinherited

: Cache refitted tracks

To speed up access to refitted track momenta, m_cachedRefTracks vector is created first time refitted track accessor methods are called. In subsequent calls, cached vector is used.

Returns
: true on success

Definition at line 1137 of file BPhysHelper.cxx.

1138 {
1139  // if refitted tracks are already cached, do nothing and return true
1140  if(m_refTracksCached && !m_cachedRefTracks.empty())
1141  return true;
1142 
1143  // if refitted tracks are cached but the cache is empty, return false (error)
1144  if(m_refTracksCached && m_cachedRefTracks.empty())
1145  return false;
1146 
1147  // Refitted tracks are not cached, yet. Retrieve them from the aux store:
1148  m_refTracksCached = true;
1149  m_cachedRefTracks.clear();
1150 
1151  // Create auxiliary branches accessors
1152  static const SG::AuxElement::Accessor< std::vector<float> > refTrackPxAcc("RefTrackPx");
1153  static const SG::AuxElement::Accessor< std::vector<float> > refTrackPyAcc("RefTrackPy");
1154  static const SG::AuxElement::Accessor< std::vector<float> > refTrackPzAcc("RefTrackPz");
1155 
1156  // check if branches are available:
1157  if(!refTrackPxAcc.isAvailable(*m_b) ||
1158  !refTrackPyAcc.isAvailable(*m_b) ||
1159  !refTrackPzAcc.isAvailable(*m_b) )
1160  return false;
1161 
1162  // retrieve branches:
1163  const std::vector<float>& refTrackPx = refTrackPxAcc(*m_b);
1164  const std::vector<float>& refTrackPy = refTrackPyAcc(*m_b);
1165  const std::vector<float>& refTrackPz = refTrackPzAcc(*m_b);
1166 
1167  // all must have the same lenght
1168  if(refTrackPx.size()!=refTrackPy.size() || refTrackPx.size()!=refTrackPz.size())
1169  return false;
1170 
1171  // all OK: store refitted tracks in the cache
1172  for(uint i=0; i<refTrackPx.size(); ++i) {
1173  m_cachedRefTracks.emplace_back(refTrackPx[i], refTrackPy[i], refTrackPz[i] );
1174  }
1175 
1176  return true;
1177 
1178 }

◆ cascadeVertex()

const xAOD::Vertex * xAOD::BPhysHelper::cascadeVertex ( const size_t  index)
inherited

Returns pointer to a cascade vertex.

Parameters
[in]indexindex of the cascade vertex
Returns
: pointer to the vertex, 0 on error

Definition at line 694 of file BPhysHelper.cxx.

695 {
696  // cache linked cascadeVertices
697  if(!cacheCascadeVertices())
698  return nullptr;
699 
700  // range check
701  if(index>=m_cachedCascadeVertices.size())
702  return nullptr;
703 
704  // all OK:
706 
707 }

◆ cascadeVertices()

const std::vector< const xAOD::Vertex * > & xAOD::BPhysHelper::cascadeVertices ( )
inherited

Returns vector of pointers to cascade vertices.

Returns
: vector of pointers to vertices, empty vector on error

Definition at line 710 of file BPhysHelper.cxx.

711 {
712  // cache linked cascadeVertices
713  if(!cacheCascadeVertices())
715 
716  // all OK:
717  return m_cachedCascadeVertices;
718 
719 }

◆ covariance()

const TMatrixTSym< double > & xAOD::BPhysHelper::covariance ( )
inherited

: Returns full covariance matrix

Converts native covariance matrix stored as a std::vector<float> into a symmetric matrix-form represented by TMatrixTSym<double> class.

Note
This method needs to know the number of tracks. If refitted tracks are stripped from the verrtex, this method will no longer work.
Returns
: covariance matrix, 0x0 matrix in case of an error

Definition at line 103 of file BPhysHelper.cxx.

104 {
105 
106  // cache covariance matrix
107  if(!cacheCov())
109 
110  // all OK:
111  return m_cachedCov;
112 }

◆ electron()

const xAOD::Electron * xAOD::BPhysHelper::electron ( const size_t  index)
inherited

Definition at line 532 of file BPhysHelper.cxx.

533 {
534  // cache linked electrons
535  if(!cacheElectrons())
536  return nullptr;
537 
538  // range check
539  if(index>=m_cachedElectrons.size())
540  return nullptr;
541 
542  // all OK:
543  return m_cachedElectrons[index];
544 
545 }

◆ electrons()

const std::vector< const xAOD::Electron * > & xAOD::BPhysHelper::electrons ( )
inherited

Definition at line 548 of file BPhysHelper.cxx.

549 {
550  // cache linked electrons
551  if(!cacheElectrons())
553 
554  // all OK:
555  return m_cachedElectrons;
556 }

◆ lxy()

float xAOD::BPhysHelper::lxy ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

Get the transverse decay distance and its error measured between the refitted primary vertex of type pv_type and the B vertex.

Transverse decay distance and its error

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Returns
: lxy, -9999999. in case augmentation is not available decay distance

Definition at line 866 of file BPhysHelper.cxx.

867 {
868  switch(vertexType) {
869  case PV_MAX_SUM_PT2 : GET_FLOAT("LxyMaxSumPt2");
870  case PV_MIN_A0 : GET_FLOAT("LxyMinA0");
871  case PV_MIN_Z0 : GET_FLOAT("LxyMinZ0");
872  case PV_MIN_Z0_BA : GET_FLOAT("LxyMinZ0BA");
873  default: return -9999999.;
874  }
875 }

◆ lxyErr()

float xAOD::BPhysHelper::lxyErr ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

its error

Definition at line 877 of file BPhysHelper.cxx.

878 {
879  switch(vertexType) {
880  case PV_MAX_SUM_PT2 : GET_FLOAT("LxyErrMaxSumPt2");
881  case PV_MIN_A0 : GET_FLOAT("LxyErrMinA0");
882  case PV_MIN_Z0 : GET_FLOAT("LxyErrMinZ0");
883  case PV_MIN_Z0_BA : GET_FLOAT("LxyErrMinZ0BA");
884  default: return -9999999.;
885  }
886 }

◆ lxyz()

float xAOD::BPhysHelper::lxyz ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

decay distance

Definition at line 912 of file BPhysHelper.cxx.

913 {
914  switch(vertexType) {
915  case PV_MAX_SUM_PT2 : GET_FLOAT("LxyzMaxSumPt2");
916  case PV_MIN_A0 : GET_FLOAT("LxyzMinA0");
917  case PV_MIN_Z0 : GET_FLOAT("LxyzMinZ0");
918  case PV_MIN_Z0_BA : GET_FLOAT("LxyzMinZ0BA");
919  default: return -9999999.;
920  }
921 }

◆ lxyzErr()

float xAOD::BPhysHelper::lxyzErr ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

its error

Definition at line 923 of file BPhysHelper.cxx.

924 {
925  switch(vertexType) {
926  case PV_MAX_SUM_PT2 : GET_FLOAT("LxyzErrMaxSumPt2");
927  case PV_MIN_A0 : GET_FLOAT("LxyzErrMinA0");
928  case PV_MIN_Z0 : GET_FLOAT("LxyzErrMinZ0");
929  case PV_MIN_Z0_BA : GET_FLOAT("LxyzErrMinZ0BA");
930  default: return -9999999.;
931  }
932 }

◆ mass()

float xAOD::BPhysHypoHelper::mass ( ) const

Get invariant mass and its error.

Methods for access to the invariant mass hypothesis and its error

Returns
: mass or error, -9999999. in case the augmentation doesn't exist invariant mass

Definition at line 39 of file BPhysHypoHelper.cxx.

40 {
41  GET_FLOAT( m_hypo+"_mass" );
42 }

◆ massErr()

float xAOD::BPhysHypoHelper::massErr ( ) const

invariant mass error

Definition at line 44 of file BPhysHypoHelper.cxx.

45 {
46  GET_FLOAT( m_hypo+"_massErr" );
47 }

◆ muon()

const xAOD::Muon * xAOD::BPhysHelper::muon ( const size_t  index)
inherited

Returns pointer to the i-th linked muon.

Parameters
[in]indexindex of the linked muon
Returns
: Pointer to the muon, 0 in case of an error

Definition at line 452 of file BPhysHelper.cxx.

453 {
454  // cache linked muons
455  if(!cacheMuons())
456  return nullptr;
457 
458  // range check
459  if(index>=m_cachedMuons.size())
460  return nullptr;
461 
462  // all OK:
463  return m_cachedMuons[index];
464 
465 }

◆ muons()

const std::vector< const xAOD::Muon * > & xAOD::BPhysHelper::muons ( )
inherited

Returns linked muons.

Returns
: linked muons, empty vector in case of an error

Definition at line 468 of file BPhysHelper.cxx.

469 {
470  // cache linked muons
471  if(!cacheMuons())
473 
474  // all OK:
475  return m_cachedMuons;
476 }

◆ nCascadeVertices()

int xAOD::BPhysHelper::nCascadeVertices ( )
inherited

: Links to cascade vertices

Cascade decays, e.g. Bd->Jpsi(mumu)+Ks(pipi), consist of more than one reconstructed vertex. for instance in case of the Bd decay, 2 vertices are required. Cascade vertices links are used to store relations between mother and daughter vertices in the cascade decays. Returns number of cascade vertices

Returns
: number of cascade vertices, -1 on error

Definition at line 682 of file BPhysHelper.cxx.

683 {
684  // cache linked cascade vertices
685  if(!cacheCascadeVertices())
686  return -1;
687 
688  // all OK:
689  return m_cachedCascadeVertices.size();
690 
691 }

◆ nElectrons()

int xAOD::BPhysHelper::nElectrons ( )
inherited

Definition at line 521 of file BPhysHelper.cxx.

522 {
523  // cache linked electrons
524  if(!cacheElectrons())
525  return -1;
526 
527  // all OK:
528  return m_cachedElectrons.size();
529 }

◆ nMuons()

int xAOD::BPhysHelper::nMuons ( )
inherited

: Methods providing access to the linked muons

By default, xAOD::Vertex provides only links to the TrackParticles used to build the vertex. Links to muons (e.g. for Jpsi->mu+mu) are stored using auxiliary branches. Returns number of stored muon links

Returns
: number of muons, -1 in case of an error

Definition at line 441 of file BPhysHelper.cxx.

442 {
443  // cache linked muons
444  if(!cacheMuons())
445  return -1;
446 
447  // all OK:
448  return m_cachedMuons.size();
449 }

◆ nPrecedingVertices()

int xAOD::BPhysHelper::nPrecedingVertices ( )
inherited

: Links to preceding vertices

The B vertices are often build from tracks that have already been pre-selected by requirements based on some preceding vertex fit. For instance, B --> J/psi(mumu)+K vertex is only build using muon tracks that have been successfully refitted in a J/psi->mumu vertex.

The following methods enable to retrieve/store links to the vertices that were preceded this one in the reconstruction flow. Returns number of preceding vertices

Returns
: number of preceding vertices, -1 on error

Definition at line 601 of file BPhysHelper.cxx.

602 {
603  // cache linked preceding vertices
605  return -1;
606 
607  // all OK:
608  return m_cachedPrecedingVertices.size();
609 
610 }

◆ nRefTrks()

int xAOD::BPhysHelper::nRefTrks ( )
inherited

Returns number of stored refitted track momenta.

Methods providing access to the refitted tracks momenta and related quantities:

Returns
: number of refitted tracks, -1 in case of an error

Definition at line 115 of file BPhysHelper.cxx.

116 {
117  // cache refitted tracks
118  if( !cacheRefTracks() ) return -1;
119 
120  // all OK:
121  return m_cachedRefTracks.size();
122 
123 }

◆ nRefTrksCascade()

int xAOD::BPhysHelper::nRefTrksCascade ( )
inherited

Returns number of stored refitted tracks INCLUDING those from the linked cascade vertices.

Returns
: number of refitted tracks, -1 in case of an error

Definition at line 764 of file BPhysHelper.cxx.

765 {
766  // get number of refitted tracks in this vertex
767  int n = nRefTrks();
768 
769  // check for errors. If there are cascade vertices stored in this vertex,
770  // it is possible there are no refitted tracks, so report error only in case
771  // when this veretx has no cascade vertices and no refitted tracks:
772  if(n<0 && nCascadeVertices()<=0) {
773  return -1;
774  } else if(n<0 && nCascadeVertices()>0) {
775  n = 0;
776  }
777 
778  // loop over cascade vertices, if they exist:
779  for(int i=0; i<nCascadeVertices(); ++i) {
780  // create helper class for the daughter vertex
781  xAOD::BPhysHelper daughterVtx(cascadeVertex(i));
782 
783  // check for errors
784  if(daughterVtx.nRefTrksCascade()<0)
785  return -1;
786 
787  // OK, add the numbers
788  n += daughterVtx.nRefTrksCascade();
789  }
790 
791 
792  // all OK, return the number of tracks
793  return n;
794 }

◆ origPv()

const xAOD::Vertex * xAOD::BPhysHelper::origPv ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

original PV

Definition at line 807 of file BPhysHelper.cxx.

808 {
809  switch(vertexType) {
810  case PV_MAX_SUM_PT2 : GET_PV("OrigPvMaxSumPt2Link");
811  case PV_MIN_A0 : GET_PV("OrigPvMinA0Link");
812  case PV_MIN_Z0 : GET_PV("OrigPvMinZ0Link");
813  case PV_MIN_Z0_BA : GET_PV("OrigPvMinZ0BALink");
814  default: return nullptr;
815  }
816 }

◆ pass()

bool xAOD::BPhysHypoHelper::pass ( ) const

get the pass flag for this hypothesis

Methods for access to the pass flags

Returns
: true, if the candidate passed selection for this hypothesis

Definition at line 358 of file BPhysHypoHelper.cxx.

359 {
360  SG::AuxElement::Accessor<Char_t> flagAcc("passed_"+m_hypo);
361  return flagAcc.isAvailable(*m_b) && flagAcc(*m_b) != 0;
362 }

◆ precedingVertex()

const xAOD::Vertex * xAOD::BPhysHelper::precedingVertex ( const size_t  index)
inherited

Returns pointer to a preceding vertex.

Parameters
[in]indexindex of the preceding vertex
Returns
: pointer to the vertex, 0 on error

Definition at line 613 of file BPhysHelper.cxx.

614 {
615  // cache linked precedingVertices
617  return nullptr;
618 
619  // range check
620  if(index>=m_cachedPrecedingVertices.size())
621  return nullptr;
622 
623  // all OK:
625 
626 }

◆ precedingVertices()

const std::vector< const xAOD::Vertex * > & xAOD::BPhysHelper::precedingVertices ( )
inherited

Returns vector of pointers to preceding vertices.

Returns
: vector of pointers to vertices, empty vector on error

Definition at line 629 of file BPhysHelper.cxx.

630 {
631  // cache linked precedingVertices
634 
635  // all OK:
637 
638 }

◆ ptErr()

float xAOD::BPhysHelper::ptErr ( )
inherited

Returns pT error.

Returns
: pT error, -9999999. if augmentation is not available

Definition at line 431 of file BPhysHelper.cxx.

432 {
433  GET_FLOAT("PtErr");
434 }

◆ pv()

const xAOD::Vertex * xAOD::BPhysHelper::pv ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

Get the refitted collision vertex of type pv_type.

Links to the refitted primary vertices

Todo:
: In case the refitted vertices are augmented with links to the original primary vertices, method origPv will resolve the links and return the original PVs.
Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Returns
: pointer to the PV, 0 if not stored refitted PV

Definition at line 796 of file BPhysHelper.cxx.

797 {
798  switch(vertexType) {
799  case PV_MAX_SUM_PT2 : GET_PV("PvMaxSumPt2Link");
800  case PV_MIN_A0 : GET_PV("PvMinA0Link");
801  case PV_MIN_Z0 : GET_PV("PvMinZ0Link");
802  case PV_MIN_Z0_BA : GET_PV("PvMinZ0BALink");
803  default: return nullptr;
804  }
805 }

◆ RefitPVStatus()

int xAOD::BPhysHelper::RefitPVStatus ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

Get the exitCode of the refitter for vertex of type pv_type.

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Returns
: the code 0=refit not request, 1=completed sucessfully, >1 not refitted for good reasons, <0 not refitted for bad reasons (see PrimaryVertexRefitter.cxx for more details)

Definition at line 855 of file BPhysHelper.cxx.

856 {
857  switch(vertexType) {
858  case PV_MAX_SUM_PT2 : GET_INT("PvMaxSumPt2Status");
859  case PV_MIN_A0 : GET_INT("PvMinA0Status" );
860  case PV_MIN_Z0 : GET_INT("PvMinZ0Status" );
861  case PV_MIN_Z0_BA : GET_INT("PvMinZ0BAStatus" );
862  default: return -999999;
863  }
864 }

◆ refTrk() [1/2]

TVector3 xAOD::BPhysHelper::refTrk ( const size_t  index)
inherited

Returns i-th refitted track 3-momentum.

Parameters
[in]indexindex of the refitted track
Returns
: refitted track momentum, (0,0,0) in case of an error

Definition at line 126 of file BPhysHelper.cxx.

127 {
128  // cache refitted tracks
129  if( !cacheRefTracks() ) return
130  TVector3(0,0,0);
131 
132  // range check:
133  if(index>=m_cachedRefTracks.size())
134  return TVector3(0,0,0);
135 
136  // all OK:
137  return m_cachedRefTracks[index];
138 
139 }

◆ refTrk() [2/2]

TLorentzVector xAOD::BPhysHelper::refTrk ( const size_t  index,
const float  mass 
)
inherited

Returns i-th refitted track as a 4-vector given the mass hypothesis.

Parameters
[in]indexindex of the refitted track
[in]massmass hypothesis assigned to the refitted track
Returns
: refitted track 4-momentum, (0,0,0,0) in case of an error

Definition at line 153 of file BPhysHelper.cxx.

154 {
155  // cache refitted tracks
156  if( !cacheRefTracks() ) return
157  TLorentzVector(0,0,0,0);
158 
159  // range check:
160  if(index>=m_cachedRefTracks.size())
161  return TLorentzVector(0,0,0,0);
162 
163  // all OK, create the 4-momentum
164  TLorentzVector mom;
165  mom.SetVectM(m_cachedRefTracks[index], mass);
166  return mom;
167 
168 }

◆ refTrkCharge()

float xAOD::BPhysHelper::refTrkCharge ( const size_t  index) const
inherited

Returns charge of the i-th track.

Note
This method needs access to original TrackParticles (and/or NeutralParticles). If the collection(s) of original tracks has(have) been stripped, this method will return the error value.
Parameters
[in]indexindex of the track
Returns
: 1. for positive track, -1. for negative, and -9999. on error

Definition at line 255 of file BPhysHelper.cxx.

256 {
257  // range check:
258  // FIXME: add neutral particles once they are available
259  //if(index>=m_b->nTrackParticles()+m_b->nNeutralParticles())
260  // return 0;
261 
262  // FIXME:supports charged particles only for now
263  if(index>=m_b->nTrackParticles())
264  return -9999.;
265 
266  if(index<m_b->nTrackParticles()) {
267  // charged track
268  const xAOD::TrackParticle* trk = dynamic_cast<const xAOD::TrackParticle*>(refTrkOrigin(index));
269 
270  // null-pointer protection
271  if(!trk)
272  return -9999.;
273 
274  // all OK
275  return trk->charge();
276 
277  }else{
278  // we do not need to do anything here, since we know this track must be neutral
279  return 0.;
280  }
281 
282 
283 }

◆ refTrkOrigin()

const xAOD::IParticle * xAOD::BPhysHelper::refTrkOrigin ( const size_t  index) const
inherited

: Returns the original track (charged or neutral) corresponding to the i-th refitted track

In xAOD model, charged and neutral particles are represented by two distict classes: xAOD::TrackParticle and xAOD::NeutralParticle. Vertex fitters can use both as input and store charded tracks first (needs checking!!!) in the list of refitted momenta.

This method returns pointer to the original track corresponding to the i-th refitted track, i.e. either TrackParticle (if index<nTrackParticles) or NeutralParticle (if index>=nTrackParticles).

One has to dynamicly cast the returned value to either TrackParticle or NeutralParticle. One can use refTrkCharge to determine if the refitted track is charged or neutral.

Note
This method needs access to original TrackParticles (and/or NeutralParticles). If the collection(s) of original tracks has(have) been stripped, this method will return the error value.
Parameters
[in]indexindex of the refitted track
Returns
: pointer to the original TrackParticle (if index<nTrackParticles), pointer to the original NeutralParticle (if index>=nNeutralParticles), 0 in case of an error

Definition at line 171 of file BPhysHelper.cxx.

172 {
173  // range check:
174  // FIXME: add neutral particles once they are available
175  //if(index>=m_b->nTrackParticles()+m_b->nNeutralParticles())
176  // return 0;
177 
178  // FIXME:supports charged particles only for now
179  if(index>=m_b->nTrackParticles())
180  return nullptr;
181 
182  // charged tracks
183  if(index<m_b->nTrackParticles()) {
184  return m_b->trackParticle(index);
185  } else {
186  // FIXME: add neutral particles once they are available
187  //return m_b->neutralParticle(index - m_b->nNeutralParticles());
188  return nullptr;
189  }
190 
191 }

◆ refTrkOriginP() [1/2]

TVector3 xAOD::BPhysHelper::refTrkOriginP ( const size_t  index) const
inherited

Returns perigee 3-momentum of the original track corresponding i-th refitted track.

Note
This method needs access to original TrackParticles (and/or NeutralParticles). If the collection(s) of original tracks has(have) been stripped, this method will return the error value.
Parameters
[in]indexindex of the refitted track
Returns
: Original perigee momentum, (0,0,0) in case of an error

Definition at line 194 of file BPhysHelper.cxx.

195 {
196  // range check:
197  // FIXME: add neutral particles once they are available
198  //if(index>=m_b->nTrackParticles()+m_b->nNeutralParticles())
199  // return TVector3(0,0,0);
200 
201  // FIXME:supports charged particles only for now
202  if(index>=m_b->nTrackParticles())
203  return TVector3(0,0,0);
204 
205  if(index<m_b->nTrackParticles()) {
206  // charged track
207  const xAOD::TrackParticle* trk = dynamic_cast<const xAOD::TrackParticle*>(refTrkOrigin(index));
208 
209  // null-pointer protection
210  if(!trk) return TVector3(0,0,0);
211 
212  // all OK
213  TVector3 tmp;
214  tmp.SetPtEtaPhi(trk->pt(), trk->eta(), trk->phi());
215  return tmp;
216 
217  }else{
218  // // neutral track
219  // const xAOD::NeutralParticle* trk = dynamic_cast<const xAOD::NeutralParticle*>(refTrkOrigin(index));
220 
221  // // null-pointer protection
222  // if(!trk) return TVector3(0,0,0);
223 
224  // // all OK
225  // TVector3 tmp;
226  // tmp.SetPtEtaPhi(trk->pt(), trk->eta(), trk->phi());
227  // return tmp;
228 
229  // FIXME neutral tracks not implemented yet:
230  return TVector3(0,0,0);
231  }
232 
233 }

◆ refTrkOriginP() [2/2]

TLorentzVector xAOD::BPhysHelper::refTrkOriginP ( const size_t  index,
const float  mass 
) const
inherited

: Returns lorentz vector build from the original track perigee momentum and given mass hypothesis

The lorentz vector is created from the perigee parameters of the original track (neutral or charged) which corresponds to the i-th refitted track and a given mass hypothesis

Note
This method needs access to original TrackParticles (and/or NeutralParticles). If the collection(s) of original tracks has(have) been stripped, this method will return the error value.
Parameters
[in]indexindex of the refitted track
[in]massmass hypothesis of the track
Returns
: Original perigee momentum, (0,0,0,0) in case of an error

Definition at line 236 of file BPhysHelper.cxx.

237 {
238  // range check:
239  // FIXME: add neutral particles once they are available
240  //if(index>=m_b->nTrackParticles()+m_b->nNeutralParticles())
241  // return TVector3(0,0,0);
242 
243  // FIXME:supports charged particles only for now
244  if(index>=m_b->nTrackParticles())
245  return TLorentzVector(0,0,0,0);
246 
247  // create TLorentzVector
248  TLorentzVector tmp;
249  tmp.SetVectM(refTrkOriginP(index), mass);
250  return tmp;
251 
252 }

◆ refTrks()

const std::vector< TVector3 > & xAOD::BPhysHelper::refTrks ( )
inherited

Returns refitted track momenta.

Note
The std::vector is returned as a reference! It will cease to exist when BPhysHelper class is destroyed.
Returns
: refitted track, empty vector in case of an error

Definition at line 142 of file BPhysHelper.cxx.

143 {
144  // cache refitted tracks
145  if( !cacheRefTracks() )
147 
148  // return
149  return m_cachedRefTracks;
150 }

◆ setA0()

float xAOD::BPhysHelper::setA0 ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

Set the 3D and transverse impact parameters and their error.

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Parameters
[in]valinput value
Returns
: true on success 3D impact parameter

Definition at line 1023 of file BPhysHelper.cxx.

1024 {
1025  switch(vertexType) {
1026  case PV_MAX_SUM_PT2 : SET_FLOAT("A0MaxSumPt2", val);
1027  case PV_MIN_A0 : SET_FLOAT("A0MinA0" , val);
1028  case PV_MIN_Z0 : SET_FLOAT("A0MinZ0" , val);
1029  case PV_MIN_Z0_BA : SET_FLOAT("A0MinZ0BA" , val);
1030  default: return false;
1031  }
1032 }

◆ setA0Err()

float xAOD::BPhysHelper::setA0Err ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

3D impact parameter error

Definition at line 1034 of file BPhysHelper.cxx.

1035 {
1036  switch(vertexType) {
1037  case PV_MAX_SUM_PT2 : SET_FLOAT("A0ErrMaxSumPt2", val);
1038  case PV_MIN_A0 : SET_FLOAT("A0ErrMinA0" , val);
1039  case PV_MIN_Z0 : SET_FLOAT("A0ErrMinZ0" , val);
1040  case PV_MIN_Z0_BA : SET_FLOAT("A0ErrMinZ0BA" , val);
1041  default: return false;
1042  }
1043 }

◆ setA0xy()

float xAOD::BPhysHelper::setA0xy ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

transverse impact parameter

Definition at line 1045 of file BPhysHelper.cxx.

1046 {
1047  switch(vertexType) {
1048  case PV_MAX_SUM_PT2 : SET_FLOAT("A0xyMaxSumPt2", val);
1049  case PV_MIN_A0 : SET_FLOAT("A0xyMinA0" , val);
1050  case PV_MIN_Z0 : SET_FLOAT("A0xyMinZ0" , val);
1051  case PV_MIN_Z0_BA : SET_FLOAT("A0xyMinZ0BA" , val);
1052  default: return false;
1053  }
1054 }

◆ setA0xyErr()

float xAOD::BPhysHelper::setA0xyErr ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

transverse impact parameter error

Definition at line 1056 of file BPhysHelper.cxx.

1057 {
1058  switch(vertexType) {
1059  case PV_MAX_SUM_PT2 : SET_FLOAT("A0xyErrMaxSumPt2", val);
1060  case PV_MIN_A0 : SET_FLOAT("A0xyErrMinA0" , val);
1061  case PV_MIN_Z0 : SET_FLOAT("A0xyErrMinZ0" , val);
1062  case PV_MIN_Z0_BA : SET_FLOAT("A0xyErrMinZ0BA" , val);
1063  default: return false;
1064  }
1065 }

◆ setCascadeVertices()

bool xAOD::BPhysHelper::setCascadeVertices ( const std::vector< const xAOD::Vertex * > &  vertices,
const xAOD::VertexContainer vertexContainer 
)
inherited

Sets links to cascade vertices.

Parameters
[in]indexindex of the cascade vertex
Returns
: pointer to the vertex, 0 on error

Definition at line 722 of file BPhysHelper.cxx.

724 {
725  // erase cascadeVertex cache to preserve consistency
726  m_cascadeVerticesCached = false;
727  m_cachedCascadeVertices.clear();
728 
729  // Create cascade vertex links decorator
730  static const SG::AuxElement::Decorator<VertexLinkVector> cascadeVertexLinksDecor("CascadeVertexLinks");
731 
732  // create tmp vector of cascade vertex links
733  VertexLinkVector cascadeVertexLinks;
734 
735  // loop over input cascadeVertices
736  std::vector<const xAOD::Vertex*>::const_iterator cascadeVerticesItr = vertices.begin();
737  for(; cascadeVerticesItr!=vertices.end(); ++cascadeVerticesItr) {
738  // sanity check 1: protect against null pointers
739  if( !(*cascadeVerticesItr) )
740  return false;
741 
742  // create element link
743  VertexLink vertexLink;
744  vertexLink.setElement(*cascadeVerticesItr);
745  vertexLink.setStorableObject(*vertexContainer);
746 
747  // sanity check 2: is the link valid?
748  if( !vertexLink.isValid() )
749  return false;
750 
751  // link is OK, store it in the tmp vector
752  cascadeVertexLinks.push_back( vertexLink );
753 
754  } // end of loop over cascade vertices
755 
756  // all OK: store cascade vertex links in the aux store
757  cascadeVertexLinksDecor(*m_b) = std::move(cascadeVertexLinks);
758 
759  return true;
760 
761 }

◆ setElectrons()

bool xAOD::BPhysHelper::setElectrons ( const std::vector< const xAOD::Electron * > &  electrons,
const xAOD::ElectronContainer electronContainer 
)
inherited

Definition at line 559 of file BPhysHelper.cxx.

561 {
562  // erase electron cache to preserve cosistency
563  m_electronsCached = false;
564  m_cachedElectrons.clear();
565 
566  // Create electron links decorator
567  static const SG::AuxElement::Decorator<ElectronLinkVector> electronLinksDecor("ElectronLinks");
568 
569  // create tmp vector of electron links
570  ElectronLinkVector electronLinks;
571 
572  // loop over input electrons
573  std::vector<const xAOD::Electron*>::const_iterator electronsItr = electrons.begin();
574  for(; electronsItr!=electrons.end(); ++electronsItr) {
575  // sanity check 1: protect against null pointers
576  if( !(*electronsItr) )
577  return false;
578 
579  // create element link
581  elLink.setElement(*electronsItr);
583 
584  // sanity check 2: is the link valid?
585  if( !elLink.isValid() )
586  return false;
587 
588  // link is OK, store it in the tmp vector
589  electronLinks.push_back( elLink );
590 
591  } // end of loop over electrons
592 
593  // all OK: store electron links in the aux store
594  electronLinksDecor(*m_b) = std::move(electronLinks);
595 
596  return true;
597 
598 }

◆ setLxy()

bool xAOD::BPhysHelper::setLxy ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

Set the transverse decay distance and its error measured between the refitted primary vertex of type pv_type and the B vertex.

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Parameters
[in]valinput value
Returns
: true on success decay distance

Definition at line 888 of file BPhysHelper.cxx.

889 {
890  switch(vertexType) {
891  case PV_MAX_SUM_PT2 : SET_FLOAT("LxyMaxSumPt2", val);
892  case PV_MIN_A0 : SET_FLOAT("LxyMinA0" , val);
893  case PV_MIN_Z0 : SET_FLOAT("LxyMinZ0" , val);
894  case PV_MIN_Z0_BA : SET_FLOAT("LxyMinZ0BA" , val);
895  default: return false;
896  }
897 }

◆ setLxyErr()

bool xAOD::BPhysHelper::setLxyErr ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

its error

Definition at line 899 of file BPhysHelper.cxx.

900 {
901  switch(vertexType) {
902  case PV_MAX_SUM_PT2 : SET_FLOAT("LxyErrMaxSumPt2", val);
903  case PV_MIN_A0 : SET_FLOAT("LxyErrMinA0" , val);
904  case PV_MIN_Z0 : SET_FLOAT("LxyErrMinZ0" , val);
905  case PV_MIN_Z0_BA : SET_FLOAT("LxyErrMinZ0BA" , val);
906  default: return false;
907  }
908 }

◆ setLxyz()

bool xAOD::BPhysHelper::setLxyz ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

decay distance

Definition at line 934 of file BPhysHelper.cxx.

935 {
936  switch(vertexType) {
937  case PV_MAX_SUM_PT2 : SET_FLOAT("LxyzMaxSumPt2", val);
938  case PV_MIN_A0 : SET_FLOAT("LxyzMinA0" , val);
939  case PV_MIN_Z0 : SET_FLOAT("LxyzMinZ0" , val);
940  case PV_MIN_Z0_BA : SET_FLOAT("LxyzMinZ0BA" , val);
941  default: return false;
942  }
943 }

◆ setLxyzErr()

bool xAOD::BPhysHelper::setLxyzErr ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

its error

Definition at line 945 of file BPhysHelper.cxx.

946 {
947  switch(vertexType) {
948  case PV_MAX_SUM_PT2 : SET_FLOAT("LxyzErrMaxSumPt2", val);
949  case PV_MIN_A0 : SET_FLOAT("LxyzErrMinA0" , val);
950  case PV_MIN_Z0 : SET_FLOAT("LxyzErrMinZ0" , val);
951  case PV_MIN_Z0_BA : SET_FLOAT("LxyzErrMinZ0BA" , val);
952  default: return false;
953  }
954 }

◆ setMass() [1/2]

bool xAOD::BPhysHypoHelper::setMass ( const float  val)

Set given invariant mass and its error.

Parameters
[in]valinvariant mass or error calculated externally
Returns
: true on success invariant mass

Definition at line 49 of file BPhysHypoHelper.cxx.

50 {
51  SET_FLOAT( m_hypo+"_mass", val );
52 }

◆ setMass() [2/2]

bool xAOD::BPhysHypoHelper::setMass ( std::span< const double trkMasses)

Set invariant mass for given track mass hypotheses.

The number of mass hyotheses must be equal to the number of refitted tracks!

Parameters
[in]trkMassesmasses of the tracks.
Returns
: true on success

Definition at line 59 of file BPhysHypoHelper.cxx.

60 {
61  // get 4-vector
62  TLorentzVector P = totalP(trkMasses);
63  if( P == TLorentzVector(0,0,0,0) )
64  return false;
65 
66  // set mass:
67  return setMass(P.M());
68 }

◆ setMassErr()

bool xAOD::BPhysHypoHelper::setMassErr ( const float  val)

invariant mass error

Definition at line 54 of file BPhysHypoHelper.cxx.

55 {
56  SET_FLOAT( m_hypo+"_massErr", val );
57 }

◆ setMuons()

bool xAOD::BPhysHelper::setMuons ( const std::vector< const xAOD::Muon * > &  muons,
const xAOD::MuonContainer muonContainer 
)
inherited

Set links to muons.

Parameters
[in]muonsstd::vector of muons to be linked to this vertex
[in]muonContainercollection these muons belong to
Returns
: true on success

Definition at line 479 of file BPhysHelper.cxx.

481 {
482  // erase muon cache to preserve cosistency
483  m_muonsCached = false;
484  m_cachedMuons.clear();
485 
486  // Create muon links decorator
487  static const SG::AuxElement::Decorator<MuonLinkVector> muonLinksDecor("MuonLinks");
488 
489  // create tmp vector of muon links
490  MuonLinkVector muonLinks;
491 
492  // loop over input muons
493  std::vector<const xAOD::Muon*>::const_iterator muonsItr = muons.begin();
494  for(; muonsItr!=muons.end(); ++muonsItr) {
495  // sanity check 1: protect against null pointers
496  if( !(*muonsItr) )
497  return false;
498 
499  // create element link
501  muLink.setElement(*muonsItr);
503 
504  // sanity check 2: is the link valid?
505  if( !muLink.isValid() )
506  return false;
507 
508  // link is OK, store it in the tmp vector
509  muonLinks.push_back( muLink );
510 
511  } // end of loop over muons
512 
513  // all OK: store muon links in the aux store
514  muonLinksDecor(*m_b) = std::move(muonLinks);
515 
516  return true;
517 
518 }

◆ setOrigPv()

bool xAOD::BPhysHelper::setOrigPv ( const xAOD::Vertex pv,
const xAOD::VertexContainer vertexContainer,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

Set the original collision vertex of type pv_type.

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Parameters
[in]pvpointer to the PV
[in]vertexContainercollection in which the PV is stored
Returns
: true on success, false on failure

Definition at line 818 of file BPhysHelper.cxx.

821 {
822  switch(vertexType) {
823  case PV_MAX_SUM_PT2 : SET_PV("OrigPvMaxSumPt2Link", pv, vertexContainer);
824  case PV_MIN_A0 : SET_PV("OrigPvMinA0Link" , pv, vertexContainer);
825  case PV_MIN_Z0 : SET_PV("OrigPvMinZ0Link" , pv, vertexContainer);
826  case PV_MIN_Z0_BA : SET_PV("OrigPvMinZ0BALink" , pv, vertexContainer);
827  default: return 0;
828  }
829 }

◆ setPass()

bool xAOD::BPhysHypoHelper::setPass ( bool  passVal)

get the pass flag for this hypothesis

Parameters
[in]inputvalue. Will be converted to Char_t
Returns
: true on success

Definition at line 364 of file BPhysHypoHelper.cxx.

365 {
366  SG::AuxElement::Decorator<Char_t> flagDec("passed_"+m_hypo);
367  flagDec(*m_b) = passVal;
368  return true;
369 }

◆ setPrecedingVertices()

bool xAOD::BPhysHelper::setPrecedingVertices ( const std::vector< const xAOD::Vertex * > &  vertices,
const xAOD::VertexContainer vertexContainer 
)
inherited

Sets links to preceding vertices.

Parameters
[in]indexindex of the preceding vertex
Returns
: pointer to the vertex, 0 on error

Definition at line 641 of file BPhysHelper.cxx.

643 {
644  // erase precedingVertex cache to preserve consistency
647 
648  // Create preceding vertex links decorator
649  static const SG::AuxElement::Decorator<VertexLinkVector> precedingVertexLinksDecor("PrecedingVertexLinks");
650 
651  // create tmp vector of preceding vertex links
652  VertexLinkVector precedingVertexLinks;
653 
654  // loop over input precedingVertices
655  std::vector<const xAOD::Vertex*>::const_iterator precedingVerticesItr = vertices.begin();
656  for(; precedingVerticesItr!=vertices.end(); ++precedingVerticesItr) {
657  // sanity check 1: protect against null pointers
658  if( !(*precedingVerticesItr) )
659  return false;
660 
661  // create element link
662  VertexLink vertexLink;
663  vertexLink.setElement(*precedingVerticesItr);
664  vertexLink.setStorableObject(*vertexContainer);
665 
666  // sanity check 2: is the link valid?
667  if( !vertexLink.isValid() )
668  return false;
669 
670  // link is OK, store it in the tmp vector
671  precedingVertexLinks.push_back( vertexLink );
672 
673  } // end of loop over preceding vertices
674 
675  // all OK: store preceding vertex links in the aux store
676  precedingVertexLinksDecor(*m_b) = std::move(precedingVertexLinks);
677 
678  return true;
679 
680 }

◆ setPtErr()

bool xAOD::BPhysHelper::setPtErr ( const float  val)
inherited

Set pT error.

Parameters
[in]inputvalue
Returns
: true on success

Definition at line 436 of file BPhysHelper.cxx.

437 {
438  SET_FLOAT("PtErr", val);
439 }

◆ setPv()

bool xAOD::BPhysHelper::setPv ( const xAOD::Vertex pv,
const xAOD::VertexContainer vertexContainer,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

Set the refitted collision vertex of type pv_type.

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Parameters
[in]pvpointer to the PV
[in]vertexContainercollection in which the PV is stored
Returns
: true on success, false on failure

Definition at line 831 of file BPhysHelper.cxx.

834 {
835  switch(vertexType) {
836  case PV_MAX_SUM_PT2 : SET_PV("PvMaxSumPt2Link", pv, vertexContainer);
837  case PV_MIN_A0 : SET_PV("PvMinA0Link" , pv, vertexContainer);
838  case PV_MIN_Z0 : SET_PV("PvMinZ0Link" , pv, vertexContainer);
839  case PV_MIN_Z0_BA : SET_PV("PvMinZ0BALink" , pv, vertexContainer);
840  default: return false;
841  }
842 }

◆ setRefitPVStatus()

bool xAOD::BPhysHelper::setRefitPVStatus ( int  code,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

Set the exitCode of the refitter for vertex of type pv_type.

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: pv_type)
Parameters
[in]codeint containing the code
Returns
: true on success, false on failure

Definition at line 844 of file BPhysHelper.cxx.

845 {
846  switch(vertexType) {
847  case PV_MAX_SUM_PT2 : SET_INT("PvMaxSumPt2Status", code);
848  case PV_MIN_A0 : SET_INT("PvMinA0Status" , code);
849  case PV_MIN_Z0 : SET_INT("PvMinZ0Status" , code);
850  case PV_MIN_Z0_BA : SET_INT("PvMinZ0BAStatus" , code);
851  default: return 0;
852  }
853 }

◆ setRefTrks() [1/3]

bool xAOD::BPhysHelper::setRefTrks ( )
inherited

: Sets refitted track momenta

This method uses as input the tracks-at-vertex branch (std::vector< Trk::VxTrackAtVertex >) in xAOD::Vertex. This method only works in ATHENA and only for transient xAOD::Vertex instances, which still hold the refitted tracks as vxTrackAtVertex branch. Once the vertex class is stored in the xAOD file, the vxTrackAtVertex branch is lost.

This method is meant to be called by the vertex fitters immediately after the vertex is created to convert vxTrackAtVertex branch into the persistifiable form.

Returns
: true on success

Definition at line 341 of file BPhysHelper.cxx.

342 {
343  // refitted momenta
344  std::vector<float> px;
345  std::vector<float> py;
346  std::vector<float> pz;
347  const auto N = vtx()->vxTrackAtVertex().size();
348  px.reserve(N);
349  py.reserve(N);
350  pz.reserve(N);
351  // loop over refitted tracks at vertex
352  for(uint i=0; i<N; ++i) {
353  const Trk::TrackParameters* aPerigee = vtx()->vxTrackAtVertex()[i].perigeeAtVertex();
354  //sanity check
355  if(!aPerigee)
356  return false;
357 
358  // store individual momentum components
359  px.push_back( aPerigee->momentum()[Trk::px] );
360  py.push_back( aPerigee->momentum()[Trk::py] );
361  pz.push_back( aPerigee->momentum()[Trk::pz] );
362  }
363 
364  // store as augmentation:
365  setRefTrks(std::move(px), std::move(py), std::move(pz));
366 
367  // all OK
368  return true;
369 
370 }

◆ setRefTrks() [2/3]

bool xAOD::BPhysHelper::setRefTrks ( const std::vector< TVector3 > &  refTrks)
inherited

Sets refitted track momenta.

Parameters
[in]refTrksstd::vector of refitted momenta as TVector3
Returns
: true on success

Definition at line 312 of file BPhysHelper.cxx.

313 {
314  // sanity check
315  if(refTrks.empty())
316  return false;
317 
318  // tmp vectors of px,py,pz components:
319  std::vector<float> px;
320  std::vector<float> py;
321  std::vector<float> pz;
322  px.reserve(refTrks.size());
323  py.reserve(refTrks.size());
324  pz.reserve(refTrks.size());
325  // loop over refitted track momenta and store the components
326  std::vector<TVector3>::const_iterator refTrksItr = refTrks.begin();
327  for(; refTrksItr!=refTrks.end(); ++refTrksItr) {
328  px.push_back( refTrksItr->Px() );
329  py.push_back( refTrksItr->Py() );
330  pz.push_back( refTrksItr->Pz() );
331  }
332 
333  // call overloaded method:
334  return setRefTrks(std::move(px),std::move(py),std::move(pz));
335 
336 }

◆ setRefTrks() [3/3]

bool xAOD::BPhysHelper::setRefTrks ( std::vector< float px,
std::vector< float py,
std::vector< float pz 
)
inherited

Sets refitted track momenta.

Parameters
[in]px,py,pzcomponents of the refitted momenta
Returns
: true on success

Definition at line 286 of file BPhysHelper.cxx.

289 {
290  // sanity check:
291  if(px.size()!=py.size() || px.size()!=pz.size())
292  return false;
293 
294  // erase refitted track cache to preserve consistency
295  m_refTracksCached = false;
296  m_cachedRefTracks.clear();
297 
298  // create decorators
299  static const SG::AuxElement::Decorator< std::vector<float> > refTrackPxDeco("RefTrackPx");
300  static const SG::AuxElement::Decorator< std::vector<float> > refTrackPyDeco("RefTrackPy");
301  static const SG::AuxElement::Decorator< std::vector<float> > refTrackPzDeco("RefTrackPz");
302 
303  // store the elements:
304  refTrackPxDeco(*m_b) = std::move(px);
305  refTrackPyDeco(*m_b) = std::move(py);
306  refTrackPzDeco(*m_b) = std::move(pz);
307 
308  return true;
309 }

◆ setTau()

bool xAOD::BPhysHypoHelper::setTau ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0,
const tau_type  tauType = BPhysHypoHelper::TAU_CONST_MASS 
)

: Set the proper decay time and error.

Parameters
[in]valinput value
[in]vertexTypetype (selection) of the PV (
See also
: BPhysHelper::pv_type)
Parameters
[in]tauTypespecify which value of particle's mass was used (
See also
: tau_type)
Returns
: true on success proper decay time

Definition at line 140 of file BPhysHypoHelper.cxx.

141 {
142  switch(vertexType) {
143  case PV_MAX_SUM_PT2: {
144  switch(tauType) {
145  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_TauConstMassPVMaxSumPt2", val);
146  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_TauInvMassPVMaxSumPt2", val);
147  default: return false;
148  }
149  }
150  case PV_MIN_A0: {
151  switch(tauType) {
152  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_TauConstMassPVMinA0", val);
153  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_TauInvMassPVMinA0", val);
154  default: return false;
155  }
156  }
157  case PV_MIN_Z0: {
158  switch(tauType) {
159  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_TauConstMassPVMinZ0", val);
160  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_TauInvMassPVMinZ0", val);
161  default: return false;
162  }
163  }
164  case PV_MIN_Z0_BA: {
165  switch(tauType) {
166  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_TauConstMassPVMinZ0BA", val);
167  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_TauInvMassPVMinZ0BA", val);
168  default: return false;
169  }
170  }
171  default: return false;
172  }
173 
174 }

◆ setTau3d()

bool xAOD::BPhysHypoHelper::setTau3d ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0,
const tau_type  tauType = BPhysHypoHelper::TAU_CONST_MASS 
)

proper decay time

Definition at line 283 of file BPhysHypoHelper.cxx.

284 {
285  switch(vertexType) {
286  case PV_MAX_SUM_PT2: {
287  switch(tauType) {
288  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_Tau3dConstMassPVMaxSumPt2", val);
289  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_Tau3dInvMassPVMaxSumPt2", val);
290  default: return false;
291  }
292  }
293  case PV_MIN_A0: {
294  switch(tauType) {
295  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_Tau3dConstMassPVMinA0", val);
296  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_Tau3dInvMassPVMinA0", val);
297  default: return false;
298  }
299  }
300  case PV_MIN_Z0: {
301  switch(tauType) {
302  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_Tau3dConstMassPVMinZ0", val);
303  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_Tau3dInvMassPVMinZ0", val);
304  default: return false;
305  }
306  }
307  case PV_MIN_Z0_BA: {
308  switch(tauType) {
309  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_Tau3dConstMassPVMinZ0BA", val);
310  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_Tau3dInvMassPVMinZ0BA", val);
311  default: return false;
312  }
313  }
314  default: return false;
315  }
316 
317 }

◆ setTau3dErr()

bool xAOD::BPhysHypoHelper::setTau3dErr ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0,
const tau_type  tauType = BPhysHypoHelper::TAU_CONST_MASS 
)

proper decay time error

Definition at line 319 of file BPhysHypoHelper.cxx.

320 {
321  switch(vertexType) {
322  case PV_MAX_SUM_PT2: {
323  switch(tauType) {
324  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_Tau3dErrConstMassPVMaxSumPt2", val);
325  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_Tau3dErrInvMassPVMaxSumPt2", val);
326  default: return false;
327  }
328  }
329  case PV_MIN_A0: {
330  switch(tauType) {
331  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_Tau3dErrConstMassPVMinA0", val);
332  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_Tau3dErrInvMassPVMinA0", val);
333  default: return false;
334  }
335  }
336  case PV_MIN_Z0: {
337  switch(tauType) {
338  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_Tau3dErrConstMassPVMinZ0", val);
339  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_Tau3dErrInvMassPVMinZ0", val);
340  default: return false;
341  }
342  }
343  case PV_MIN_Z0_BA: {
344  switch(tauType) {
345  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_Tau3dErrConstMassPVMinZ0BA", val);
346  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_Tau3dErrInvMassPVMinZ0BA", val);
347  default: return false;
348  }
349  }
350  default: return false;
351  }
352 }

◆ setTauErr()

bool xAOD::BPhysHypoHelper::setTauErr ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0,
const tau_type  tauType = BPhysHypoHelper::TAU_CONST_MASS 
)

proper decay time error

Definition at line 176 of file BPhysHypoHelper.cxx.

177 {
178  switch(vertexType) {
179  case PV_MAX_SUM_PT2: {
180  switch(tauType) {
181  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_TauErrConstMassPVMaxSumPt2", val);
182  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_TauErrInvMassPVMaxSumPt2", val);
183  default: return false;
184  }
185  }
186  case PV_MIN_A0: {
187  switch(tauType) {
188  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_TauErrConstMassPVMinA0", val);
189  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_TauErrInvMassPVMinA0", val);
190  default: return false;
191  }
192  }
193  case PV_MIN_Z0: {
194  switch(tauType) {
195  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_TauErrConstMassPVMinZ0", val);
196  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_TauErrInvMassPVMinZ0", val);
197  default: return false;
198  }
199  }
200  case PV_MIN_Z0_BA: {
201  switch(tauType) {
202  case TAU_CONST_MASS : SET_FLOAT(m_hypo+"_TauErrConstMassPVMinZ0BA", val);
203  case TAU_INV_MASS : SET_FLOAT(m_hypo+"_TauErrInvMassPVMinZ0BA", val);
204  default: return false;
205  }
206  }
207  default: return false;
208  }
209 }

◆ setZ0()

float xAOD::BPhysHelper::setZ0 ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

longitudinal impact parameter

Definition at line 1067 of file BPhysHelper.cxx.

1068 {
1069  switch(vertexType) {
1070  case PV_MAX_SUM_PT2 : SET_FLOAT("Z0MaxSumPt2", val);
1071  case PV_MIN_A0 : SET_FLOAT("Z0MinA0" , val);
1072  case PV_MIN_Z0 : SET_FLOAT("Z0MinZ0" , val);
1073  case PV_MIN_Z0_BA : SET_FLOAT("Z0MinZ0BA" , val);
1074  default: return false;
1075  }
1076 }

◆ setZ0Err()

float xAOD::BPhysHelper::setZ0Err ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)
inherited

longitudinal impact parameter error

Definition at line 1078 of file BPhysHelper.cxx.

1079 {
1080  switch(vertexType) {
1081  case PV_MAX_SUM_PT2 : SET_FLOAT("Z0ErrMaxSumPt2", val);
1082  case PV_MIN_A0 : SET_FLOAT("Z0ErrMinA0" , val);
1083  case PV_MIN_Z0 : SET_FLOAT("Z0ErrMinZ0" , val);
1084  case PV_MIN_Z0_BA : SET_FLOAT("Z0ErrMinZ0BA" , val);
1085  default: return false;
1086  }
1087 }

◆ tau()

float xAOD::BPhysHypoHelper::tau ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0,
const tau_type  tauType = BPhysHypoHelper::TAU_CONST_MASS 
)

: Get the proper decay time and error.

The proper decay time is calculated using formula c*tau = Lxy * M / pT. The Lxy can be calculated wrt different choice of the PV. Use parameter vertexType to specify which PV was used. The particle's mass M can be either taken as a constant or as measured invariant mass. Use parameter tauType to specify which value should be used.

Parameters
[in]vertexTypetype (selection) of the PV (
See also
: BPhysHelper::pv_type)
Parameters
[in]tauTypespecify which value of particle's mass was used (
See also
: tau_type)
Returns
: proper decay time, -9999999. on error
proper decay time

Definition at line 70 of file BPhysHypoHelper.cxx.

71 {
72  switch(vertexType) {
73  case PV_MAX_SUM_PT2: {
74  switch(tauType) {
75  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_TauConstMassPVMaxSumPt2");
76  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_TauInvMassPVMaxSumPt2");
77  default: return -9999999.;
78  }
79  }
80  case PV_MIN_A0: {
81  switch(tauType) {
82  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_TauConstMassPVMinA0");
83  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_TauInvMassPVMinA0");
84  default: return -9999999.;
85  }
86  }
87  case PV_MIN_Z0: {
88  switch(tauType) {
89  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_TauConstMassPVMinZ0");
90  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_TauInvMassPVMinZ0");
91  default: return -9999999.;
92  }
93  }
94  case PV_MIN_Z0_BA: {
95  switch(tauType) {
96  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_TauConstMassPVMinZ0BA");
97  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_TauInvMassPVMinZ0BA");
98  default: return -9999999.;
99  }
100  }
101  default: return -9999999.;
102  }
103 }

◆ tau3d()

float xAOD::BPhysHypoHelper::tau3d ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0,
const tau_type  tauType = BPhysHypoHelper::TAU_CONST_MASS 
)

proper decay time

Definition at line 213 of file BPhysHypoHelper.cxx.

214 {
215  switch(vertexType) {
216  case PV_MAX_SUM_PT2: {
217  switch(tauType) {
218  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_Tau3dConstMassPVMaxSumPt2");
219  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_Tau3dInvMassPVMaxSumPt2");
220  default: return -9999999.;
221  }
222  }
223  case PV_MIN_A0: {
224  switch(tauType) {
225  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_Tau3dConstMassPVMinA0");
226  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_Tau3dInvMassPVMinA0");
227  default: return -9999999.;
228  }
229  }
230  case PV_MIN_Z0: {
231  switch(tauType) {
232  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_Tau3dConstMassPVMinZ0");
233  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_Tau3dInvMassPVMinZ0");
234  default: return -9999999.;
235  }
236  }
237  case PV_MIN_Z0_BA: {
238  switch(tauType) {
239  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_Tau3dConstMassPVMinZ0BA");
240  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_Tau3dInvMassPVMinZ0BA");
241  default: return -9999999.;
242  }
243  }
244  default: return -9999999.;
245  }
246 }

◆ tau3dErr()

float xAOD::BPhysHypoHelper::tau3dErr ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0,
const tau_type  tauType = BPhysHypoHelper::TAU_CONST_MASS 
)

proper decay time error

Definition at line 248 of file BPhysHypoHelper.cxx.

249 {
250  switch(vertexType) {
251  case PV_MAX_SUM_PT2: {
252  switch(tauType) {
253  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_Tau3dErrConstMassPVMaxSumPt2");
254  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_Tau3dErrInvMassPVMaxSumPt2");
255  default: return -9999999.;
256  }
257  }
258  case PV_MIN_A0: {
259  switch(tauType) {
260  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_Tau3dErrConstMassPVMinA0");
261  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_Tau3dErrInvMassPVMinA0");
262  default: return -9999999.;
263  }
264  }
265  case PV_MIN_Z0: {
266  switch(tauType) {
267  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_Tau3dErrConstMassPVMinZ0");
268  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_Tau3dErrInvMassPVMinZ0");
269  default: return -9999999.;
270  }
271  }
272  case PV_MIN_Z0_BA: {
273  switch(tauType) {
274  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_Tau3dErrConstMassPVMinZ0BA");
275  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_Tau3dErrInvMassPVMinZ0BA");
276  default: return -9999999.;
277  }
278  }
279  default: return -9999999.;
280  }
281 }

◆ tauErr()

float xAOD::BPhysHypoHelper::tauErr ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0,
const tau_type  tauType = BPhysHypoHelper::TAU_CONST_MASS 
)

proper decay time error

Definition at line 105 of file BPhysHypoHelper.cxx.

106 {
107  switch(vertexType) {
108  case PV_MAX_SUM_PT2: {
109  switch(tauType) {
110  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_TauErrConstMassPVMaxSumPt2");
111  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_TauErrInvMassPVMaxSumPt2");
112  default: return -9999999.;
113  }
114  }
115  case PV_MIN_A0: {
116  switch(tauType) {
117  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_TauErrConstMassPVMinA0");
118  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_TauErrInvMassPVMinA0");
119  default: return -9999999.;
120  }
121  }
122  case PV_MIN_Z0: {
123  switch(tauType) {
124  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_TauErrConstMassPVMinZ0");
125  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_TauErrInvMassPVMinZ0");
126  default: return -9999999.;
127  }
128  }
129  case PV_MIN_Z0_BA: {
130  switch(tauType) {
131  case TAU_CONST_MASS : GET_FLOAT(m_hypo+"_TauErrConstMassPVMinZ0BA");
132  case TAU_INV_MASS : GET_FLOAT(m_hypo+"_TauErrInvMassPVMinZ0BA");
133  default: return -9999999.;
134  }
135  }
136  default: return -9999999.;
137  }
138 }

◆ totalP() [1/2]

TVector3 xAOD::BPhysHelper::totalP ( )
inherited

: Returns total 3-momentum calculated from the refitted tracks

Total momentum calculated from refitted tracksReturns total 3-momentum calculated from the refitted tracks.

Note
In case that this vertex has some linked cascade vertices, it adds the total momentum in the cascade vertices.
Returns
: Total momentum, (0,0,0) on error

Definition at line 374 of file BPhysHelper.cxx.

375 {
376  // cache refitted tracks
377  if( !cacheRefTracks() && nCascadeVertices()<=0) {
378  // In case of cascade decays, vector with no refitted tracks can still be correct.
379  // Therefore, return error only is this is not the case
380  return TVector3(0,0,0);
381  }
382 
383  // sum the momenta
384  TVector3 sum(0,0,0);
385  int n = nRefTrks();
386  for(int i=0; i<n; ++i) {
387  sum += refTrk(i);
388  }
389 
390  // treat cascade vertices, if they exist
391  if(nCascadeVertices()>0) {
392  for(int i=0; i<nCascadeVertices(); ++i) {
393  // create helper class for the daughter vertex
394  xAOD::BPhysHelper daughterVtx( cascadeVertex(i) );
395  TVector3 daughterP = daughterVtx.totalP();
396 
397  // check that the daughter total momentum was retrieved correctly
398  if(daughterP==TVector3(0,0,0))
399  return TVector3(0,0,0);
400 
401  //OK, sum the momenta
402  sum += daughterP;
403  }
404  }
405 
406  return sum;
407 }

◆ totalP() [2/2]

TLorentzVector xAOD::BPhysHelper::totalP ( std::span< const double masses)
inherited

Returns total 4-momentum calculated from the refitted tracks given mass hypotheses for individual tracks.

Parameters
[in]massesinvariant mass hypotheses
Returns
: Total 4-momentum, (0,0,0,0) on error

Definition at line 410 of file BPhysHelper.cxx.

411 {
412  // cache refitted tracks
413  if( !cacheRefTracks() )
414  return TLorentzVector(0,0,0,0);
415  int n = nRefTrks();
416  // input check
417  if(int(masses.size()) != n)
418  return TLorentzVector(0,0,0,0);
419 
420  // sum the 4-momenta
421  TLorentzVector sum;
422  for(int i=0; i<n; ++i) {
423  sum += refTrk(i, masses[i]);
424  }
425 
426  return sum;
427 
428 }

◆ vtx()

const xAOD::Vertex* xAOD::BPhysHelper::vtx ( ) const
inlineinherited

Getter method for the cached xAOD::Vertex.

Returns
: cached xAOD::Vertex

Definition at line 108 of file BPhysHelper.h.

108 { return m_b; }

◆ z0()

float xAOD::BPhysHelper::z0 ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

longitudinal impact parameter

Definition at line 1001 of file BPhysHelper.cxx.

1002 {
1003  switch(vertexType) {
1004  case PV_MAX_SUM_PT2 : GET_FLOAT("Z0MaxSumPt2");
1005  case PV_MIN_A0 : GET_FLOAT("Z0MinA0");
1006  case PV_MIN_Z0 : GET_FLOAT("Z0MinZ0");
1007  case PV_MIN_Z0_BA : GET_FLOAT("Z0MinZ0BA");
1008  default: return -9999999.;
1009  }
1010 }

◆ z0Err()

float xAOD::BPhysHelper::z0Err ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0)
inherited

longitudinal impact parameter error

Definition at line 1012 of file BPhysHelper.cxx.

1013 {
1014  switch(vertexType) {
1015  case PV_MAX_SUM_PT2 : GET_FLOAT("Z0ErrMaxSumPt2");
1016  case PV_MIN_A0 : GET_FLOAT("Z0ErrMinA0");
1017  case PV_MIN_Z0 : GET_FLOAT("Z0ErrMinZ0");
1018  case PV_MIN_Z0_BA : GET_FLOAT("Z0ErrMinZ0BA");
1019  default: return -9999999.;
1020  }
1021 }

Member Data Documentation

◆ m_b

const xAOD::Vertex* xAOD::BPhysHelper::m_b
protectedinherited

Cached B decay xAOD vertex.

Definition at line 674 of file BPhysHelper.h.

◆ m_cachedCascadeVertices

std::vector<const xAOD::Vertex*> xAOD::BPhysHelper::m_cachedCascadeVertices
protectedinherited

Definition at line 716 of file BPhysHelper.h.

◆ m_cachedCov

TMatrixTSym<double> xAOD::BPhysHelper::m_cachedCov
protectedinherited

Definition at line 682 of file BPhysHelper.h.

◆ m_cachedElectrons

std::vector<const xAOD::Electron*> xAOD::BPhysHelper::m_cachedElectrons
protectedinherited

Definition at line 704 of file BPhysHelper.h.

◆ m_cachedMuons

std::vector<const xAOD::Muon*> xAOD::BPhysHelper::m_cachedMuons
protectedinherited

Definition at line 703 of file BPhysHelper.h.

◆ m_cachedPrecedingVertices

std::vector<const xAOD::Vertex*> xAOD::BPhysHelper::m_cachedPrecedingVertices
protectedinherited

Definition at line 714 of file BPhysHelper.h.

◆ m_cachedRefTracks

std::vector<TVector3> xAOD::BPhysHelper::m_cachedRefTracks
protectedinherited

Definition at line 692 of file BPhysHelper.h.

◆ m_cascadeVerticesCached

bool xAOD::BPhysHelper::m_cascadeVerticesCached
protectedinherited

Definition at line 715 of file BPhysHelper.h.

◆ m_covCached

bool xAOD::BPhysHelper::m_covCached
protectedinherited

cached covariance matrix

Definition at line 681 of file BPhysHelper.h.

◆ m_electronsCached

bool xAOD::BPhysHelper::m_electronsCached
protectedinherited

Definition at line 702 of file BPhysHelper.h.

◆ m_hypo

std::string xAOD::BPhysHypoHelper::m_hypo
protected

name of the mass hypothesis

Private attributes:

Definition at line 215 of file BPhysHypoHelper.h.

◆ m_muonsCached

bool xAOD::BPhysHelper::m_muonsCached
protectedinherited

cached linked muons

Definition at line 701 of file BPhysHelper.h.

◆ m_precedingVerticesCached

bool xAOD::BPhysHelper::m_precedingVerticesCached
protectedinherited

cached linked vertices

Definition at line 713 of file BPhysHelper.h.

◆ m_refTracksCached

bool xAOD::BPhysHelper::m_refTracksCached
protectedinherited

cached refitted track momenta

Definition at line 691 of file BPhysHelper.h.

◆ n_pv_types

const unsigned int xAOD::BPhysHelper::n_pv_types = 4
staticinherited

Return number of vertex association types (useful for loops).

Some useful static consts

Definition at line 613 of file BPhysHelper.h.

◆ pv_type_str

const std::string xAOD::BPhysHelper::pv_type_str
staticinherited
Initial value:
=
{"PV_MAX_SUM_PT2", "PV_MIN_A0", "PV_MIN_Z0", "PV_MIN_Z0_BA"}

Return string names for vertex association types.

Definition at line 605 of file BPhysHelper.h.

◆ s_emptyMatrix

const TMatrixTSym< double > xAOD::BPhysHelper::s_emptyMatrix
staticprotectedinherited

Definition at line 728 of file BPhysHelper.h.

◆ s_emptyVectorOfElectrons

const std::vector< const xAOD::Electron * > xAOD::BPhysHelper::s_emptyVectorOfElectrons
staticprotectedinherited

Definition at line 727 of file BPhysHelper.h.

◆ s_emptyVectorOfMuons

const std::vector< const xAOD::Muon * > xAOD::BPhysHelper::s_emptyVectorOfMuons
staticprotectedinherited

Definition at line 726 of file BPhysHelper.h.

◆ s_emptyVectorOfTVector3

const std::vector< TVector3 > xAOD::BPhysHelper::s_emptyVectorOfTVector3
staticprotectedinherited

Return error values for vector quantities:

Definition at line 725 of file BPhysHelper.h.

◆ s_emptyVectorOfVertices

const std::vector< const xAOD::Vertex * > xAOD::BPhysHelper::s_emptyVectorOfVertices
staticprotectedinherited

Definition at line 729 of file BPhysHelper.h.


The documentation for this class was generated from the following files:
xAOD::BPhysHelper::electrons
const std::vector< const xAOD::Electron * > & electrons()
Definition: BPhysHelper.cxx:548
muonContainer
xAOD::MuonContainer * muonContainer
Definition: TrigGlobEffCorrValidation.cxx:168
xAOD::BPhysHypoHelper::setMass
bool setMass(const float val)
Set given invariant mass and its error.
Definition: BPhysHypoHelper.cxx:49
GET_PV
#define GET_PV(name)
Definition: BPhysHelper.cxx:45
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
Trk::py
@ py
Definition: ParamDefs.h:66
xAOD::BPhysHelper::totalP
TVector3 totalP()
: Returns total 3-momentum calculated from the refitted tracks
Definition: BPhysHelper.cxx:374
electronContainer
xAOD::ElectronContainer * electronContainer
Definition: TrigGlobEffCorrValidation.cxx:167
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
xAOD::BPhysHelper
Definition: BPhysHelper.h:71
test_pyathena.px
px
Definition: test_pyathena.py:18
xAOD::BPhysHelper::s_emptyVectorOfTVector3
static const std::vector< TVector3 > s_emptyVectorOfTVector3
Definition: BPhysHelper.h:725
xAOD::BPhysHelper::nRefTrks
int nRefTrks()
Returns number of stored refitted track momenta.
Definition: BPhysHelper.cxx:115
xAOD::BPhysHelper::nCascadeVertices
int nCascadeVertices()
: Links to cascade vertices
Definition: BPhysHelper.cxx:682
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
xAOD::BPhysHelper::m_cachedElectrons
std::vector< const xAOD::Electron * > m_cachedElectrons
Definition: BPhysHelper.h:704
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
index
Definition: index.py:1
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
xAOD::BPhysHelper::m_cachedCascadeVertices
std::vector< const xAOD::Vertex * > m_cachedCascadeVertices
Definition: BPhysHelper.h:716
SET_FLOAT
#define SET_FLOAT(name, val)
Definition: BPhysHypoHelper.cxx:28
xAOD::BPhysHelper::m_electronsCached
bool m_electronsCached
Definition: BPhysHelper.h:702
xAOD::BPhysHelper::m_cachedRefTracks
std::vector< TVector3 > m_cachedRefTracks
Definition: BPhysHelper.h:692
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
SET_INT
#define SET_INT(name, val)
Definition: BPhysHelper.cxx:92
xAOD::BPhysHelper::PV_MIN_Z0
@ PV_MIN_Z0
Definition: BPhysHelper.h:475
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
xAOD::BPhysHelper::m_cachedCov
TMatrixTSym< double > m_cachedCov
Definition: BPhysHelper.h:682
Trk::pz
@ pz
global momentum (cartesian)
Definition: ParamDefs.h:67
xAOD::py
py
Definition: CompositeParticle_v1.cxx:160
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
xAOD::BPhysHypoHelper::TAU_INV_MASS
@ TAU_INV_MASS
Definition: BPhysHypoHelper.h:137
VertexLinkVector
std::vector< VertexLink > VertexLinkVector
Definition: BPhysHelper.cxx:20
xAOD::BPhysHelper::m_cachedMuons
std::vector< const xAOD::Muon * > m_cachedMuons
Definition: BPhysHelper.h:703
xAOD::BPhysHelper::s_emptyVectorOfElectrons
static const std::vector< const xAOD::Electron * > s_emptyVectorOfElectrons
Definition: BPhysHelper.h:727
ElectronLinkVector
std::vector< ElectronLink > ElectronLinkVector
Definition: BPhysHelper.cxx:24
xAOD::BPhysHypoHelper::m_hypo
std::string m_hypo
name of the mass hypothesis
Definition: BPhysHypoHelper.h:215
SET_FLOAT
#define SET_FLOAT(name, val)
Definition: BPhysHelper.cxx:78
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
GET_FLOAT
#define GET_FLOAT(name)
Definition: BPhysHelper.cxx:71
GET_INT
#define GET_INT(name)
Definition: BPhysHelper.cxx:85
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
xAOD::BPhysHelper::m_muonsCached
bool m_muonsCached
Definition: BPhysHelper.h:701
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:58
lumiFormat.i
int i
Definition: lumiFormat.py:92
xAOD::BPhysHelper::m_precedingVerticesCached
bool m_precedingVerticesCached
Definition: BPhysHelper.h:713
xAOD::BPhysHelper::m_b
const xAOD::Vertex * m_b
Cached B decay xAOD vertex.
Definition: BPhysHelper.h:674
xAOD::BPhysHelper::s_emptyVectorOfVertices
static const std::vector< const xAOD::Vertex * > s_emptyVectorOfVertices
Definition: BPhysHelper.h:729
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::BPhysHelper::BPhysHelper
BPhysHelper(const xAOD::Vertex *b)
: Main constructor
Definition: BPhysHelper.h:85
xAOD::BPhysHelper::m_cachedPrecedingVertices
std::vector< const xAOD::Vertex * > m_cachedPrecedingVertices
Definition: BPhysHelper.h:714
Trk::px
@ px
Definition: ParamDefs.h:65
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
xAOD::BPhysHelper::PV_MIN_A0
@ PV_MIN_A0
Definition: BPhysHelper.h:475
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
Trk::ParametersBase
Definition: ParametersBase.h:55
xAOD::BPhysHypoHelper::TAU_CONST_MASS
@ TAU_CONST_MASS
Definition: BPhysHypoHelper.h:137
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
xAOD::BPhysHelper::cacheElectrons
bool cacheElectrons()
Definition: BPhysHelper.cxx:1226
xAOD::BPhysHelper::s_emptyVectorOfMuons
static const std::vector< const xAOD::Muon * > s_emptyVectorOfMuons
Definition: BPhysHelper.h:726
xAOD::BPhysHelper::setRefTrks
bool setRefTrks()
: Sets refitted track momenta
Definition: BPhysHelper.cxx:341
xAOD::BPhysHelper::cachePrecedingVertices
bool cachePrecedingVertices()
: Cache preceding vertices
Definition: BPhysHelper.cxx:1271
xAOD::BPhysHelper::refTrkOrigin
const xAOD::IParticle * refTrkOrigin(const size_t index) const
: Returns the original track (charged or neutral) corresponding to the i-th refitted track
Definition: BPhysHelper.cxx:171
xAOD::BPhysHelper::m_cascadeVerticesCached
bool m_cascadeVerticesCached
Definition: BPhysHelper.h:715
pmontree.code
code
Definition: pmontree.py:443
xAOD::BPhysHelper::vtx
const xAOD::Vertex * vtx() const
Getter method for the cached xAOD::Vertex.
Definition: BPhysHelper.h:108
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
xAOD::BPhysHelper::s_emptyMatrix
static const TMatrixTSym< double > s_emptyMatrix
Definition: BPhysHelper.h:728
xAOD::BPhysHelper::PV_MAX_SUM_PT2
@ PV_MAX_SUM_PT2
Definition: BPhysHelper.h:475
xAOD::vertexType
vertexType
Definition: Vertex_v1.cxx:166
GET_FLOAT
#define GET_FLOAT(name)
Definition: BPhysHypoHelper.cxx:21
xAOD::BPhysHelper::cacheCov
bool cacheCov()
: Cache covariance matrix
Definition: BPhysHelper.cxx:1089
xAOD::BPhysHelper::cacheRefTracks
bool cacheRefTracks()
: Cache refitted tracks
Definition: BPhysHelper.cxx:1137
xAOD::BPhysHelper::cacheMuons
bool cacheMuons()
: Cache linked muons
Definition: BPhysHelper.cxx:1181
xAOD::Vertex_v1::covariance
const std::vector< float > & covariance() const
Returns the covariance matrix as a simple vector of values.
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
DeMoScan.index
string index
Definition: DeMoScan.py:362
xAOD::BPhysHelper::refTrk
TVector3 refTrk(const size_t index)
Returns i-th refitted track 3-momentum.
Definition: BPhysHelper.cxx:126
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
MuonLinkVector
std::vector< MuonLink > MuonLinkVector
Definition: BPhysHelper.cxx:22
xAOD::BPhysHelper::pv
const xAOD::Vertex * pv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the refitted collision vertex of type pv_type.
Definition: BPhysHelper.cxx:796
xAOD::BPhysHelper::refTrks
const std::vector< TVector3 > & refTrks()
Returns refitted track momenta.
Definition: BPhysHelper.cxx:142
xAOD::BPhysHelper::m_covCached
bool m_covCached
Definition: BPhysHelper.h:681
xAOD::BPhysHelper::m_refTracksCached
bool m_refTracksCached
Definition: BPhysHelper.h:691
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::BPhysHelper::muons
const std::vector< const xAOD::Muon * > & muons()
Returns linked muons.
Definition: BPhysHelper.cxx:468
xAOD::Vertex_v1::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Definition: Vertex_v1.cxx:181
SET_PV
#define SET_PV(name, pv, vertexContainer)
Definition: BPhysHelper.cxx:58
xAOD::BPhysHelper::cascadeVertex
const xAOD::Vertex * cascadeVertex(const size_t index)
Returns pointer to a cascade vertex.
Definition: BPhysHelper.cxx:694
xAOD::BPhysHelper::cacheCascadeVertices
bool cacheCascadeVertices()
: Cache cascade vertices
Definition: BPhysHelper.cxx:1316
xAOD::BPhysHelper::PV_MIN_Z0_BA
@ PV_MIN_Z0_BA
Definition: BPhysHelper.h:475
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
SUSY_SimplifiedModel_PreInclude.masses
dictionary masses
Definition: SUSY_SimplifiedModel_PreInclude.py:7
xAOD::BPhysHelper::refTrkOriginP
TVector3 refTrkOriginP(const size_t index) const
Returns perigee 3-momentum of the original track corresponding i-th refitted track.
Definition: BPhysHelper.cxx:194