36 {
"PV_MAX_SUM_PT2",
"PV_MIN_A0",
"PV_MIN_Z0",
"PV_MIN_Z0_BA"};
45#define GET_PV( name ) \
47 static const SG::AuxElement::Accessor<VertexLink> pvLinkAcc(name); \
48 if(!pvLinkAcc.isAvailable(*m_b)) { \
51 const VertexLink& pvLink = pvLinkAcc(*m_b); \
52 if(!pvLink.isValid()) { \
58#define SET_PV( name, pv, vertexContainer ) \
60 static const SG::AuxElement::Decorator<VertexLink> pvLinkDecor(name); \
61 VertexLink vertexLink; \
63 vertexLink.setElement(pv); \
64 vertexLink.setStorableObject(*vertexContainer); \
65 if( !vertexLink.isValid() ) \
67 pvLinkDecor(*m_b) = vertexLink; \
71#define GET_FLOAT(name) \
73 static const SG::AuxElement::Accessor<float> floatAcc(name); \
74 if(!floatAcc.isAvailable(*m_b)) return -9999999.; \
75 return floatAcc(*m_b); \
78#define SET_FLOAT( name, val) \
80 static const SG::AuxElement::Decorator<float> floatDec(name); \
81 floatDec(*m_b) = val; \
85#define GET_INT(name) \
87 static const SG::AuxElement::Accessor<int> intAcc(name); \
88 if(!intAcc.isAvailable(*m_b)) return -9999999; \
89 return intAcc(*m_b); \
92#define SET_INT( name, val) \
94 static const SG::AuxElement::Decorator<int> intDec(name); \
134 return TVector3(0,0,0);
157 TLorentzVector(0,0,0,0);
161 return TLorentzVector(0,0,0,0);
203 return TVector3(0,0,0);
210 if(!trk)
return TVector3(0,0,0);
214 tmp.SetPtEtaPhi(trk->
pt(), trk->
eta(), trk->
phi());
230 return TVector3(0,0,0);
245 return TLorentzVector(0,0,0,0);
287 std::vector<float>
py,
288 std::vector<float> pz)
291 if(px.size()!=
py.size() || px.size()!=pz.size())
304 refTrackPxDeco(*
m_b) = std::move(px);
305 refTrackPyDeco(*
m_b) = std::move(
py);
306 refTrackPzDeco(*
m_b) = std::move(pz);
319 std::vector<float> px;
320 std::vector<float>
py;
321 std::vector<float> pz;
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() );
334 return setRefTrks(std::move(px),std::move(
py),std::move(pz));
344 std::vector<float> px;
345 std::vector<float>
py;
346 std::vector<float> pz;
347 const auto N =
vtx()->vxTrackAtVertex().size();
352 for(
uint i=0; i<N; ++i) {
365 setRefTrks(std::move(px), std::move(
py), std::move(pz));
380 return TVector3(0,0,0);
386 for(
int i=0; i<n; ++i) {
395 TVector3 daughterP = daughterVtx.
totalP();
398 if(daughterP==TVector3(0,0,0))
399 return TVector3(0,0,0);
414 return TLorentzVector(0,0,0,0);
417 if(
int(masses.size()) != n)
418 return TLorentzVector(0,0,0,0);
422 for(
int i=0; i<n; ++i) {
423 sum +=
refTrk(i, masses[i]);
493 std::vector<const xAOD::Muon*>::const_iterator muonsItr =
muons.begin();
494 for(; muonsItr!=
muons.end(); ++muonsItr) {
509 muonLinks.push_back( muLink );
514 muonLinksDecor(*
m_b) = std::move(muonLinks);
573 std::vector<const xAOD::Electron*>::const_iterator electronsItr =
electrons.begin();
574 for(; electronsItr!=
electrons.end(); ++electronsItr) {
576 if( !(*electronsItr) )
589 electronLinks.push_back( elLink );
594 electronLinksDecor(*
m_b) = std::move(electronLinks);
655 std::vector<const xAOD::Vertex*>::const_iterator precedingVerticesItr = vertices.begin();
656 for(; precedingVerticesItr!=vertices.end(); ++precedingVerticesItr) {
658 if( !(*precedingVerticesItr) )
671 precedingVertexLinks.push_back( vertexLink );
676 precedingVertexLinksDecor(*
m_b) = std::move(precedingVertexLinks);
736 std::vector<const xAOD::Vertex*>::const_iterator cascadeVerticesItr = vertices.begin();
737 for(; cascadeVerticesItr!=vertices.end(); ++cascadeVerticesItr) {
739 if( !(*cascadeVerticesItr) )
752 cascadeVertexLinks.push_back( vertexLink );
757 cascadeVertexLinksDecor(*
m_b) = std::move(cascadeVertexLinks);
803 default:
return nullptr;
814 default:
return nullptr;
840 default:
return false;
862 default:
return -999999;
873 default:
return -9999999.;
884 default:
return -9999999.;
895 default:
return false;
906 default:
return false;
919 default:
return -9999999.;
930 default:
return -9999999.;
941 default:
return false;
952 default:
return false;
964 default:
return -9999999.;
975 default:
return -9999999.;
986 default:
return -9999999.;
997 default:
return -9999999.;
1008 default:
return -9999999.;
1019 default:
return -9999999.;
1030 default:
return false;
1041 default:
return false;
1052 default:
return false;
1063 default:
return false;
1074 default:
return false;
1085 default:
return false;
1111 const std::vector<float>& cov =
m_b->covariance();
1114 if(
int(cov.size())==(3*nTrk+3)*(3*nTrk+3+1)/2) {
1119 for(
int i=0; i<(3+3*nTrk); i++) {
1120 for(
int j=0; j<=i; j++) {
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);
1168 if(refTrackPx.size()!=refTrackPy.size() || refTrackPx.size()!=refTrackPz.size())
1172 for(
uint i=0; i<refTrackPx.size(); ++i) {
1207 MuonLinkVector::const_iterator muonLinksItr = muonLinks.begin();
1208 for(; muonLinksItr!=muonLinks.end(); ++muonLinksItr) {
1210 if(!(*muonLinksItr).isValid()) {
1216 muonLinksItr = muonLinks.begin();
1217 for(; muonLinksItr!=muonLinks.end(); ++muonLinksItr) {
1252 ElectronLinkVector::const_iterator electronLinksItr = electronLinks.begin();
1253 for(; electronLinksItr!=electronLinks.end(); ++electronLinksItr) {
1255 if(!(*electronLinksItr).isValid()) {
1261 electronLinksItr = electronLinks.begin();
1262 for(; electronLinksItr!=electronLinks.end(); ++electronLinksItr) {
1297 VertexLinkVector::const_iterator precedingVertexLinksItr = precedingVertexLinks.begin();
1298 for(; precedingVertexLinksItr!=precedingVertexLinks.end(); ++precedingVertexLinksItr) {
1300 if(!(*precedingVertexLinksItr).isValid()) {
1306 precedingVertexLinksItr = precedingVertexLinks.begin();
1307 for(; precedingVertexLinksItr!=precedingVertexLinks.end(); ++precedingVertexLinksItr) {
1342 VertexLinkVector::const_iterator cascadeVertexLinksItr = cascadeVertexLinks.begin();
1343 for(; cascadeVertexLinksItr!=cascadeVertexLinks.end(); ++cascadeVertexLinksItr) {
1345 if(!(*cascadeVertexLinksItr).isValid()) {
1351 cascadeVertexLinksItr = cascadeVertexLinks.begin();
1352 for(; cascadeVertexLinksItr!=cascadeVertexLinks.end(); ++cascadeVertexLinksItr) {
#define SET_INT(name, val)
#define SET_PV(name, pv, vertexContainer)
std::vector< MuonLink > MuonLinkVector
ElementLink< xAOD::VertexContainer > VertexLink
std::vector< ElectronLink > ElectronLinkVector
std::vector< VertexLink > VertexLinkVector
ElementLink< xAOD::MuonContainer > MuonLink
#define SET_FLOAT(name, val)
ElementLink< xAOD::ElectronContainer > ElectronLink
: B-physics xAOD helpers.
xAOD::ElectronContainer * electronContainer
xAOD::MuonContainer * muonContainer
ElementLink implementation for ROOT usage.
bool setElement(ElementType element)
Set to point to an element.
bool setStorableObject(BaseConstReference data, bool replace=false, IProxyDict *sg=0)
Set link to point to a new container (storable).
bool isValid() const
Test to see if the link can be dereferenced.
SG::Decorator< T, ALLOC > Decorator
SG::Accessor< T, ALLOC > Accessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
const Amg::Vector3D & momentum() const
Access method for the momentum.
static const std::vector< const xAOD::Electron * > s_emptyVectorOfElectrons
bool setPtErr(const float val)
Set pT error.
int nMuons()
: Methods providing access to the linked muons
const std::vector< const xAOD::Muon * > & muons()
Returns linked muons.
bool cacheCascadeVertices()
: Cache cascade vertices
bool setElectrons(const std::vector< const xAOD::Electron * > &electrons, const xAOD::ElectronContainer *electronContainer)
float lxyzErr(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
its error
float refTrkCharge(const size_t index) const
Returns charge of the i-th track.
float setZ0(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
longitudinal impact parameter
int nCascadeVertices()
: Links to cascade vertices
const xAOD::Vertex * origPv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
original PV
const xAOD::Vertex * cascadeVertex(const size_t index)
Returns pointer to a cascade vertex.
std::vector< const xAOD::Vertex * > m_cachedCascadeVertices
float z0(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
longitudinal impact parameter
const xAOD::Vertex * m_b
Cached B decay xAOD vertex.
float lxyz(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
decay distance
float a0xyErr(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
rtansverse impact parameter error
bool cacheMuons()
: Cache linked muons
bool setLxyErr(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
its error
const TMatrixTSym< double > & covariance()
: Returns full covariance matrix
const std::vector< const xAOD::Vertex * > & precedingVertices()
Returns vector of pointers to preceding vertices.
bool setRefTrks()
: Sets refitted track momenta
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 ...
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 ...
bool m_cascadeVerticesCached
static const std::vector< const xAOD::Muon * > s_emptyVectorOfMuons
static const unsigned int n_pv_types
TMatrixTSym< double > m_cachedCov
bool cacheRefTracks()
: Cache refitted tracks
static const std::vector< const xAOD::Vertex * > s_emptyVectorOfVertices
bool setMuons(const std::vector< const xAOD::Muon * > &muons, const xAOD::MuonContainer *muonContainer)
Set links to muons.
const xAOD::Vertex * precedingVertex(const size_t index)
Returns pointer to a preceding vertex.
std::vector< const xAOD::Electron * > m_cachedElectrons
float setZ0Err(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
longitudinal impact parameter error
const xAOD::Vertex * vtx() const
Getter method for the cached xAOD::Vertex.
const std::vector< const xAOD::Electron * > & electrons()
bool cachePrecedingVertices()
: Cache preceding vertices
static const std::string pv_type_str[]
static const TMatrixTSym< double > s_emptyMatrix
bool setPrecedingVertices(const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
Sets links to preceding vertices.
float setA0(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Set the 3D and transverse impact parameters and their error.
const std::vector< TVector3 > & refTrks()
Returns refitted track momenta.
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.
float z0Err(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
longitudinal impact parameter error
const xAOD::Vertex * pv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the refitted collision vertex of type pv_type.
TVector3 refTrk(const size_t index)
Returns i-th refitted track 3-momentum.
float a0(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the 3D, transverse, and longitudinal impact parameters and their error.
bool m_precedingVerticesCached
pv_type
: Enum type of the PV
bool setRefTrks(std::vector< float > px, std::vector< float > py, std::vector< float > pz)
Sets refitted track momenta.
float a0Err(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
3D impact parameter error
float setA0Err(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
3D impact parameter error
bool setCascadeVertices(const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
Sets links to cascade vertices.
int nPrecedingVertices()
: Links to preceding vertices
const xAOD::Muon * muon(const size_t index)
Returns pointer to the i-th linked muon.
float ptErr()
Returns pT error.
bool cacheCov()
: Cache covariance matrix
bool setRefitPVStatus(int code, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Set the exitCode of the refitter for vertex of type pv_type.
std::vector< TVector3 > m_cachedRefTracks
const std::vector< const xAOD::Vertex * > & cascadeVertices()
Returns vector of pointers to cascade vertices.
float a0xy(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
transverse impact parameter
TVector3 refTrkOriginP(const size_t index) const
Returns perigee 3-momentum of the original track corresponding i-th refitted track.
std::vector< const xAOD::Vertex * > m_cachedPrecedingVertices
float setA0xyErr(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
transverse impact parameter error
int nRefTrks()
Returns number of stored refitted track momenta.
std::vector< const xAOD::Muon * > m_cachedMuons
const xAOD::Electron * electron(const size_t index)
float setA0xy(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
transverse impact parameter
TVector3 totalP()
: Returns total 3-momentum calculated from the refitted tracks
int RefitPVStatus(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the exitCode of the refitter for vertex of type pv_type.
const xAOD::IParticle * refTrkOrigin(const size_t index) const
: Returns the original track (charged or neutral) corresponding to the i-th refitted track
int nRefTrksCascade()
Returns number of stored refitted tracks INCLUDING those from the linked cascade vertices.
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.
float lxyErr(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
its error
bool setLxyz(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
decay distance
static const std::vector< TVector3 > s_emptyVectorOfTVector3
bool setLxyzErr(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
its error
Class providing the definition of the 4-vector interface.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float charge() const
Returns the charge.
@ pz
global momentum (cartesian)
ParametersBase< TrackParametersDim, Charged > TrackParameters
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
Electron_v1 Electron
Definition of the current "egamma version".