xAOD::BPhysHelper Class Reference

Inheritance diagram for xAOD::BPhysHelper:
xAOD::BPhysHypoHelper

List of all members.

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

 BPhysHelper (const xAOD::Vertex *b)
 : Main constructor
const xAOD::Vertexvtx () const
const TMatrixTSym< double > & covariance ()
 : Returns full covariance matrix

Protected Member Functions

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

Protected Attributes

const xAOD::Vertexm_b



bool m_covCached
TMatrixTSym< double > m_cachedCov
bool m_refTracksCached
std::vector< TVector3 > m_cachedRefTracks
bool m_muonsCached
std::vector< const xAOD::Muon * > m_cachedMuons
bool m_precedingVerticesCached
std::vector< const xAOD::Vertex * > m_cachedPrecedingVertices
bool m_cascadeVerticesCached
std::vector< const xAOD::Vertex * > m_cachedCascadeVertices
static const std::vector
< TVector3 > 
emptyVectorOfTVector3
static const std::vector
< const xAOD::Muon * > 
emptyVectorOfMuons
static const TMatrixTSym< double > emptyMatrix
static const std::vector
< const xAOD::Vertex * > 
emptyVectorOfVertices
int nRefTrks ()
TVector3 refTrk (const size_t index)
const std::vector< TVector3 > & refTrks ()
TLorentzVector refTrk (const size_t index, const float mass)
const xAOD::IParticlerefTrkOrigin (const size_t index) const
 : Returns the original track (charged or neutral) corresponding to the i-th refitted track
TVector3 refTrkOriginP (const size_t index) const
TLorentzVector refTrkOriginP (const size_t index, const float mass) const
 : Returns lorentz vector build from the original track perigee momentum and given mass hypothesis
float refTrkCharge (const size_t index) const
bool setRefTrks (const std::vector< float > &px, const std::vector< float > &py, const std::vector< float > &pz)
bool setRefTrks (const std::vector< TVector3 > &refTrks)
bool setRefTrks ()
 : Sets refitted track momenta
TVector3 totalP ()
 : Returns total 3-momentum calculated from the refitted tracks
TLorentzVector totalP (const std::vector< double > &masses)
float ptErr ()
bool setPtErr (const float val)
int nMuons ()
 : Methods providing access to the linked muons
const xAOD::Muonmuon (const size_t index)
const std::vector< const
xAOD::Muon * > & 
muons ()
bool setMuons (const std::vector< const xAOD::Muon * > &muons, const xAOD::MuonContainer *muonContainer)
int nPrecedingVertices ()
 : Links to preceding vertices
const xAOD::VertexprecedingVertex (const size_t index)
const std::vector< const
xAOD::Vertex * > & 
precedingVertices ()
bool setPrecedingVertices (const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
int nCascadeVertices ()
 : Links to cascade vertices
const xAOD::VertexcascadeVertex (const size_t index)
const std::vector< const
xAOD::Vertex * > & 
cascadeVertices ()
bool setCascadeVertices (const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
int nRefTrksCascade ()
const xAOD::Vertexpv (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 refitted PV
const xAOD::VertexorigPv (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 original PV
bool setOrigPv (const xAOD::Vertex *pv, const xAOD::VertexContainer *vertexContainer, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
bool setPv (const xAOD::Vertex *pv, const xAOD::VertexContainer *vertexContainer, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
bool setRefitPVStatus (int code, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
int RefitPVStatus (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
float lxy (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 decay distance
float lxyErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error
bool setLxy (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 decay distance
bool setLxyErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 its error
float a0 (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 3D impact parameter
float a0Err (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 3D impact parameter error
float a0xy (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter
float a0xyErr (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 rtansverse impact parameter error
float z0 (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter
float z0Err (const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter error
float setA0 (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 3D impact parameter
float setA0Err (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 3D impact parameter error
float setA0xy (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter
float setA0xyErr (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 transverse impact parameter error
float setZ0 (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter
float setZ0Err (const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
 longitudinal impact parameter error

Member Enumeration Documentation

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

: PV_MAX_SUM_PT2 vertex with the largest sum Pt^2 (the default one) : PV_MIN_A0 collision vertex closest in 3D to the particle's trajectory, i.e. the vertex with the smalles 3D impact parameter a0 : 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. : 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.


Constructor & Destructor Documentation

xAOD::BPhysHelper::BPhysHelper ( const xAOD::Vertex b  )  [inline]

: Main constructor

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

Parameters:
[in] b Pointer to the xAOD::Vertex

Member Function Documentation

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

3D impact parameter

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

Parameters:
[in] vertexType type (selection) of the PV (
See also:
: pv_type)
Returns:
: impact parameter or its error, -9999999. in case augmentation is not available
bool xAOD::BPhysHelper::cacheCascadeVertices (  )  [protected]

: 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
bool xAOD::BPhysHelper::cacheCov (  )  [protected]

: 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
bool xAOD::BPhysHelper::cacheMuons (  )  [protected]

: 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
bool xAOD::BPhysHelper::cachePrecedingVertices (  )  [protected]

: 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
bool xAOD::BPhysHelper::cacheRefTracks (  )  [protected]

: 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
const xAOD::Vertex * xAOD::BPhysHelper::cascadeVertex ( const size_t  index  ) 

Returns pointer to a cascade vertex

Parameters:
[in] index index of the cascade vertex
Returns:
: pointer to the vertex, 0 on error
const std::vector< const xAOD::Vertex * > & xAOD::BPhysHelper::cascadeVertices (  ) 

Returns vector of pointers to cascade vertices

Returns:
: vector of pointers to vertices, empty vector on error
const TMatrixTSym< double > & xAOD::BPhysHelper::covariance (  ) 

: 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
float xAOD::BPhysHelper::lxy ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0  ) 

decay distance

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

Parameters:
[in] vertexType type (selection) of the PV (
See also:
: pv_type)
Returns:
: lxy, -9999999. in case augmentation is not available
const xAOD::Muon * xAOD::BPhysHelper::muon ( const size_t  index  ) 

Returns pointer to the i-th linked muon

Parameters:
[in] index index of the linked muon
Returns:
: Pointer to the muon, 0 in case of an error
const std::vector< const xAOD::Muon * > & xAOD::BPhysHelper::muons (  ) 

Returns linked muons

Returns:
: linked muons, empty vector in case of an error
int xAOD::BPhysHelper::nCascadeVertices (  ) 

: 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
int xAOD::BPhysHelper::nMuons (  ) 

: 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
int xAOD::BPhysHelper::nPrecedingVertices (  ) 

: 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
int xAOD::BPhysHelper::nRefTrks (  ) 

Methods providing access to the refitted tracks momenta and related quantities: Returns number of stored refitted track momenta

Returns:
: number of refitted tracks, -1 in case of an error
int xAOD::BPhysHelper::nRefTrksCascade (  ) 

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

Returns:
: number of refitted tracks, -1 in case of an error
const xAOD::Vertex * xAOD::BPhysHelper::precedingVertex ( const size_t  index  ) 

Returns pointer to a preceding vertex

Parameters:
[in] index index of the preceding vertex
Returns:
: pointer to the vertex, 0 on error
const std::vector< const xAOD::Vertex * > & xAOD::BPhysHelper::precedingVertices (  ) 

Returns vector of pointers to preceding vertices

Returns:
: vector of pointers to vertices, empty vector on error
float xAOD::BPhysHelper::ptErr (  ) 

Returns pT error

Returns:
: pT error, -9999999. if augmentation is not available
const xAOD::Vertex * xAOD::BPhysHelper::pv ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0  ) 

refitted PV

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.

Get the refitted collision vertex of type pv_type

Parameters:
[in] vertexType type (selection) of the PV (
See also:
: pv_type)
Returns:
: pointer to the PV, 0 if not stored
int xAOD::BPhysHelper::RefitPVStatus ( const pv_type  vertexType = BPhysHelper::PV_MIN_A0  ) 

Get the exitCode of the refitter for vertex of type pv_type

Parameters:
[in] vertexType type (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)
TLorentzVector xAOD::BPhysHelper::refTrk ( const size_t  index,
const float  mass 
)

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

Parameters:
[in] index index of the refitted track
[in] mass mass hypothesis assigned to the refitted track
Returns:
: refitted track 4-momentum, (0,0,0,0) in case of an error
TVector3 xAOD::BPhysHelper::refTrk ( const size_t  index  ) 

Returns i-th refitted track 3-momentum

Parameters:
[in] index index of the refitted track
Returns:
: refitted track momentum, (0,0,0) in case of an error
float xAOD::BPhysHelper::refTrkCharge ( const size_t  index  )  const

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] index index of the track
Returns:
: 1. for positive track, -1. for negative, and -9999. on error
const xAOD::IParticle * xAOD::BPhysHelper::refTrkOrigin ( const size_t  index  )  const

: 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] index index 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
TLorentzVector xAOD::BPhysHelper::refTrkOriginP ( const size_t  index,
const float  mass 
) const

: 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] index index of the refitted track
[in] mass mass hypothesis of the track
Returns:
: Original perigee momentum, (0,0,0,0) in case of an error
TVector3 xAOD::BPhysHelper::refTrkOriginP ( const size_t  index  )  const

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] index index of the refitted track
Returns:
: Original perigee momentum, (0,0,0) in case of an error
const std::vector< TVector3 > & xAOD::BPhysHelper::refTrks (  ) 

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
float xAOD::BPhysHelper::setA0 ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)

3D impact parameter

Set the 3D and transverse impact parameters and their error

Parameters:
[in] vertexType type (selection) of the PV (
See also:
: pv_type)
Parameters:
[in] val input value
Returns:
: true on success
bool xAOD::BPhysHelper::setCascadeVertices ( const std::vector< const xAOD::Vertex * > &  vertices,
const xAOD::VertexContainer vertexContainer 
)

Sets links to cascade vertices

Parameters:
[in] index index of the cascade vertex
Returns:
: pointer to the vertex, 0 on error
bool xAOD::BPhysHelper::setLxy ( const float  val,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)

decay distance

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

Parameters:
[in] vertexType type (selection) of the PV (
See also:
: pv_type)
Parameters:
[in] val input value
Returns:
: true on success
bool xAOD::BPhysHelper::setMuons ( const std::vector< const xAOD::Muon * > &  muons,
const xAOD::MuonContainer muonContainer 
)

Set links to muons

Parameters:
[in] muons std::vector of muons to be linked to this vertex
[in] muonContainer collection these muons belong to
Returns:
: true on success
bool xAOD::BPhysHelper::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

Parameters:
[in] vertexType type (selection) of the PV (
See also:
: pv_type)
Parameters:
[in] pv pointer to the PV
[in] vertexContainer collection in which the PV is stored
Returns:
: true on success, false on failure
bool xAOD::BPhysHelper::setPrecedingVertices ( const std::vector< const xAOD::Vertex * > &  vertices,
const xAOD::VertexContainer vertexContainer 
)

Sets links to preceding vertices

Parameters:
[in] index index of the preceding vertex
Returns:
: pointer to the vertex, 0 on error
bool xAOD::BPhysHelper::setPtErr ( const float  val  ) 

Set pT error

Parameters:
[in] input value
Returns:
: true on success
bool xAOD::BPhysHelper::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

Parameters:
[in] vertexType type (selection) of the PV (
See also:
: pv_type)
Parameters:
[in] pv pointer to the PV
[in] vertexContainer collection in which the PV is stored
Returns:
: true on success, false on failure
bool xAOD::BPhysHelper::setRefitPVStatus ( int  code,
const pv_type  vertexType = BPhysHelper::PV_MIN_A0 
)

Set the exitCode of the refitter for vertex of type pv_type

Parameters:
[in] vertexType type (selection) of the PV (
See also:
: pv_type)
Parameters:
[in] code int containing the code
Returns:
: true on success, false on failure
bool xAOD::BPhysHelper::setRefTrks (  ) 

: 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
bool xAOD::BPhysHelper::setRefTrks ( const std::vector< TVector3 > &  refTrks  ) 

Sets refitted track momenta

Parameters:
[in] refTrks std::vector of refitted momenta as TVector3
Returns:
: true on success
bool xAOD::BPhysHelper::setRefTrks ( const std::vector< float > &  px,
const std::vector< float > &  py,
const std::vector< float > &  pz 
)

Sets refitted track momenta

Parameters:
[in] px,py,pz components of the refitted momenta
Returns:
: true on success
TLorentzVector xAOD::BPhysHelper::totalP ( const std::vector< double > &  masses  ) 

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

Parameters:
[in] masses invariant mass hypotheses
Returns:
: Total 4-momentum, (0,0,0,0) on error
TVector3 xAOD::BPhysHelper::totalP (  ) 

: Returns total 3-momentum calculated from the refitted tracks

Total momentum calculated from refitted tracks Returns 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
const xAOD::Vertex* xAOD::BPhysHelper::vtx (  )  const [inline]

Getter method for the cached xAOD::Vertex

Returns:
: cached xAOD::Vertex

Member Data Documentation

const std::vector< TVector3 > xAOD::BPhysHelper::emptyVectorOfTVector3 [static, protected]

Return error values for vector quantities:

Cached B decay xAOD vertex

cached covariance matrix

cached linked muons

cached linked vertices

cached refitted track momenta


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1