ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::TauTrack_v1 Class Reference

#include <TauTrack_v1.h>

Inheritance diagram for xAOD::TauTrack_v1:
Collaboration diagram for xAOD::TauTrack_v1:

Public Types

typedef ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
 Base 4 Momentum type for taus.
typedef uint16_t TrackFlagType
typedef std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Functions describing the 4-momentum of the object
typedef TLorentzVector FourMom_t
 Definition of the 4-momentum type.

Public Member Functions

 TauTrack_v1 ()
 Default constructor.
virtual double pt () const
 The transverse momentum ( \(p_T\)) of the particle.
virtual double eta () const
 The pseudorapidity ( \(\eta\)) of the particle.
virtual double phi () const
 The azimuthal angle ( \(\phi\)) of the particle.
virtual double e () const
 The total energy of the particle.
virtual double m () const
 The invariant mass of the particle.
virtual double rapidity () const
 The true rapidity (y) of the particle.
virtual FourMom_t p4 () const
 The full 4-momentum of the particle.
GenVecFourMom_t genvecP4 () const
 The full 4-momentum of the particle : internal taus type.
void setP4 (double pt, double eta, double phi, double m)
 Set methods for IParticle values.
virtual Type::ObjectType type () const
 The type of the object as a simple enumeration.
bool flag (TauJetParameters::TauTrackFlag flag) const
bool flagWithMask (unsigned int) const
void setFlag (TauJetParameters::TauTrackFlag flag, bool value)
TrackFlagType flagSet () const
void setFlagSet (TrackFlagType flag)
float z0sinThetaTJVA (const xAOD::IParticle &) const
float d0TJVA () const
float d0SigTJVA () const
float z0sinthetaTJVA () const
float z0sinthetaSigTJVA () const
float rConv () const
float rConvII () const
float dRJetSeedAxis (const xAOD::IParticle &) const
const std::vector< float > & bdtScores () const
void setBdtScores (const std::vector< float > &bdtScores)
float bdtScore (size_t i) const
size_t nBdtScores () const
void addBdtScore (const float score)
 add a cluster to the tau
void clearBdtScores ()
 Remove all clusters from the tau.
bool detail (TauJetParameters::TrackDetail detail, float &value) const
void setDetail (TauJetParameters::TrackDetail detail, float value)
const TrackParticleLinks_ttrackLinks () const
void setTrackLinks (const TrackParticleLinks_t &trackParticle)
const TrackParticletrack () const
void addTrackLink (const ElementLink< TrackParticleContainer > &tr)
 add a track to the collection
void clearTrackLinks ()
 Remove all tracks from the collection.
Functions for getting and setting user properties
template<class T>
XAOD_AUXDATA_DEPRECATED T & auxdata (const std::string &name, const std::string &clsname="")
 Fetch an aux data variable, as a non-const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED const T & auxdata (const std::string &name, const std::string &clsname="") const
 Fetch an aux data variable, as a const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for reading or not.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for writing or not.

Detailed Description

Definition at line 27 of file TauTrack_v1.h.

Member Typedef Documentation

◆ FourMom_t

typedef TLorentzVector xAOD::IParticle::FourMom_t
inherited

Definition of the 4-momentum type.

Definition at line 69 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

◆ GenVecFourMom_t

typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > xAOD::TauTrack_v1::GenVecFourMom_t

Base 4 Momentum type for taus.

Definition at line 46 of file TauTrack_v1.h.

◆ TrackFlagType

Definition at line 61 of file TauTrack_v1.h.

◆ TrackParticleLinks_t

Constructor & Destructor Documentation

◆ TauTrack_v1()

xAOD::TauTrack_v1::TauTrack_v1 ( )

Default constructor.

Definition at line 22 of file TauTrack_v1.cxx.

23 : IParticle() {
24 }
IParticle()=default

Member Function Documentation

◆ addBdtScore()

void xAOD::TauTrack_v1::addBdtScore ( const float score)

add a cluster to the tau

Definition at line 186 of file TauTrack_v1.cxx.

186 {
187 bdtScoreAcc( *this ).push_back(score);
188 }

◆ addTrackLink()

void xAOD::TauTrack_v1::addTrackLink ( const ElementLink< TrackParticleContainer > & tr)

add a track to the collection

Definition at line 209 of file TauTrack_v1.cxx.

209 {
210 //clearTrackLinks();
211 trackAcc( *this ).push_back( tr );
212 return;
213 }
static const SG::AuxElement::Accessor< Vertex_v1::TrackParticleLinks_t > trackAcc("trackParticleLinks")
Accessor for the track links.

◆ auxdata() [1/2]

template<class T>
XAOD_AUXDATA_DEPRECATED T & xAOD::IParticle::auxdata ( const std::string & name,
const std::string & clsname = "" )
inlineinherited

Fetch an aux data variable, as a non-const reference.

This function provides an easy way for users to decorate objects with auxiliary data.

Take note that this function is slow. Should not be used inside time-critical code.

Parameters
nameName of the aux variable
clsnameThe name of the associated class. May be blank
Returns
A modifiable reference to the decoration

Definition at line 98 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

99 {
100
101 return SG::Accessor< T >(name, clsname)(*this);
102 }
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573

◆ auxdata() [2/2]

template<class T>
XAOD_AUXDATA_DEPRECATED const T & xAOD::IParticle::auxdata ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Fetch an aux data variable, as a const reference.

This function provides an easy way for users to retrieve auxiliary decorations from an object.

Take note that this function is slow. Should not be used inside time-critical code.

Parameters
nameName of the aux variable
clsnameThe name of the associated class. May be blank
Returns
A constant reference to the decoration

Definition at line 118 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

119 {
120
121 return SG::ConstAccessor< T >( name, clsname )( *this );
122 }
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570

◆ bdtScore()

float xAOD::TauTrack_v1::bdtScore ( size_t i) const

◆ bdtScores()

const std::vector< float > & xAOD::TauTrack_v1::bdtScores ( ) const

◆ clearBdtScores()

void xAOD::TauTrack_v1::clearBdtScores ( )

Remove all clusters from the tau.

Definition at line 191 of file TauTrack_v1.cxx.

191 {
192 bdtScoreAcc( *this ).clear();
193 }

◆ clearTrackLinks()

void xAOD::TauTrack_v1::clearTrackLinks ( )

Remove all tracks from the collection.

Definition at line 215 of file TauTrack_v1.cxx.

215 {
216 trackAcc( *this ).clear();
217 return;
218 }

◆ d0SigTJVA()

float xAOD::TauTrack_v1::d0SigTJVA ( ) const

Definition at line 120 of file TauTrack_v1.cxx.

120 {
121 return d0SigTJVAAcc(*this);
122 }
static const SG::Accessor< float > d0SigTJVAAcc("d0SigTJVA")

◆ d0TJVA()

float xAOD::TauTrack_v1::d0TJVA ( ) const

Definition at line 115 of file TauTrack_v1.cxx.

115 {
116 return d0TJVAAcc(*this);
117 }
static const SG::Accessor< float > d0TJVAAcc("d0TJVA")

◆ detail()

bool xAOD::TauTrack_v1::detail ( TauJetParameters::TrackDetail detail,
float & value ) const

Definition at line 152 of file TauTrack_v1.cxx.

152 {
153 // Get the detail accessor:
154 const Accessor< float >* acc = xAODTau::trackDetailsAccessorV3<float>( detail );
155 if( ! acc ) return false;
156 if( ! acc->isAvailable( *this ) ) return false;
157
158 // Retrieve the detail value:
159 value = ( *acc )( *this );
160 return true;
161
162 }
bool detail(TauJetParameters::TrackDetail detail, float &value) const
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.

◆ dRJetSeedAxis()

float xAOD::TauTrack_v1::dRJetSeedAxis ( const xAOD::IParticle & part) const

Definition at line 142 of file TauTrack_v1.cxx.

142 {
143 const xAOD::TauJet* tau = dynamic_cast<const xAOD::TauJet*> (&part);
144 if(tau)
145 return tau->jet()->p4().DeltaR(this->p4());//this function should take jet seed as input
146 else {
147 std::cerr << "ERROR xAOD::TauTrack::z0sinThetaTJVA cannot get TauJet" << std::endl;
148 }
149 return 0.;
150 }
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition Jet_v1.cxx:71
const Jet * jet() const
virtual FourMom_t p4() const
The full 4-momentum of the particle.
TauJet_v3 TauJet
Definition of the current "tau version".

◆ e()

double xAOD::TauTrack_v1::e ( ) const
virtual

The total energy of the particle.

Implements xAOD::IParticle.

Definition at line 70 of file TauTrack_v1.cxx.

70 {
71 return genvecP4().E();
72 }
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : internal taus type.

◆ eta()

virtual double xAOD::TauTrack_v1::eta ( ) const
virtual

The pseudorapidity ( \(\eta\)) of the particle.

Implements xAOD::IParticle.

◆ flag()

bool xAOD::TauTrack_v1::flag ( TauJetParameters::TauTrackFlag flag) const

Definition at line 76 of file TauTrack_v1.cxx.

76 {
77 static const Accessor< TauTrack_v1::TrackFlagType > trackFlags("flagSet");
78 TrackFlagType f(trackFlags(*this));
79 std::bitset<8*sizeof(TrackFlagType)> thisTracksFlags(f);
80 return thisTracksFlags[flag];
81 }
uint16_t TrackFlagType
Definition TauTrack_v1.h:61
bool flag(TauJetParameters::TauTrackFlag flag) const

◆ flagSet()

TrackFlagType xAOD::TauTrack_v1::flagSet ( ) const

◆ flagWithMask()

bool xAOD::TauTrack_v1::flagWithMask ( unsigned int flags) const

Definition at line 83 of file TauTrack_v1.cxx.

83 {
84 static const Accessor< TauTrack_v1::TrackFlagType > trackFlags("flagSet");
85 TrackFlagType f(trackFlags(*this));
86 return ((f&flags)==flags);
87 }

◆ genvecP4()

TauTrack_v1::GenVecFourMom_t xAOD::TauTrack_v1::genvecP4 ( ) const

The full 4-momentum of the particle : internal taus type.

Definition at line 39 of file TauTrack_v1.cxx.

39 {
40 return GenVecFourMom_t(pt(), eta(), phi(), m());
41 }
virtual double eta() const
The pseudorapidity ( ) of the particle.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for taus.
Definition TauTrack_v1.h:46
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual double pt() const
The transverse momentum ( ) of the particle.
virtual double m() const
The invariant mass of the particle.

◆ isAvailable()

template<class T>
XAOD_AUXDATA_DEPRECATED bool xAOD::IParticle::isAvailable ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Check if a user property is available for reading or not.

This function should be used to check if a user property which may or may not exist, is set on the object.

Parameters
nameName of the auxiliary variable
clsnameThe name of the associated class. May be blank
Returns
Whether the decoration exists or not

Definition at line 135 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

136 {
137
138 return SG::ConstAccessor< T >(name, clsname).isAvailable(*this);
139 }
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.

◆ isAvailableWritable()

template<class T>
XAOD_AUXDATA_DEPRECATED bool xAOD::IParticle::isAvailableWritable ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Check if a user property is available for writing or not.

This function can be used to check whether it will be possible to set a user property on the object.

Parameters
nameName of the auxiliary variable
clsnameThe name of the associated class. May be blank
Returns
Whether the decoration is possible to set

Definition at line 152 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

153 {
154
155 return SG::Accessor< T >(name, clsname).isAvailableWritable(*this);
156 }
bool isAvailableWritable(ELT &e) const
Test to see if this variable exists in the store and is writable.

◆ m()

double xAOD::TauTrack_v1::m ( ) const
virtual

The invariant mass of the particle.

Implements xAOD::IParticle.

Definition at line 66 of file TauTrack_v1.cxx.

66 {
67 return PION_MASS;
68 }
static const double PION_MASS

◆ nBdtScores()

size_t xAOD::TauTrack_v1::nBdtScores ( ) const

Definition at line 181 of file TauTrack_v1.cxx.

181 {
182 return bdtScoreAcc( *this ).size();
183 }

◆ p4()

TauTrack_v1::FourMom_t xAOD::TauTrack_v1::p4 ( ) const
virtual

The full 4-momentum of the particle.

Implements xAOD::IParticle.

Definition at line 33 of file TauTrack_v1.cxx.

33 {
35 p4.SetPtEtaPhiM( pt(), eta(), phi(), m());
36 return p4;
37 }
TLorentzVector FourMom_t
Definition of the 4-momentum type.

◆ phi()

virtual double xAOD::TauTrack_v1::phi ( ) const
virtual

The azimuthal angle ( \(\phi\)) of the particle.

Implements xAOD::IParticle.

◆ pt()

virtual double xAOD::TauTrack_v1::pt ( ) const
virtual

The transverse momentum ( \(p_T\)) of the particle.

Implements xAOD::IParticle.

◆ rapidity()

double xAOD::TauTrack_v1::rapidity ( ) const
virtual

The true rapidity (y) of the particle.

Implements xAOD::IParticle.

Definition at line 62 of file TauTrack_v1.cxx.

62 {
63 return genvecP4().Rapidity();
64 }

◆ rConv()

float xAOD::TauTrack_v1::rConv ( ) const

Definition at line 134 of file TauTrack_v1.cxx.

134 {
135 return std::sqrt(std::fabs(this->d0TJVA())*this->pt()/(0.3 /*0.15*2.*/));
136 }
float d0TJVA() const

◆ rConvII()

float xAOD::TauTrack_v1::rConvII ( ) const

Definition at line 138 of file TauTrack_v1.cxx.

138 {
139 return std::sqrt( std::fabs( this->d0TJVA() * this->pt() ) / (0.3) )*(this->d0TJVA()/fabs(this->d0TJVA()))*this->track()->charge();
140 }
const TrackParticle * track() const
float charge() const
Returns the charge.

◆ setBdtScores()

void xAOD::TauTrack_v1::setBdtScores ( const std::vector< float > & bdtScores)

◆ setDetail()

void xAOD::TauTrack_v1::setDetail ( TauJetParameters::TrackDetail detail,
float value )

Definition at line 164 of file TauTrack_v1.cxx.

164 {
165 ( *( xAODTau::trackDetailsAccessorV3<float>( detail ) ) )( *this ) = value;
166 }

◆ setFlag()

void xAOD::TauTrack_v1::setFlag ( TauJetParameters::TauTrackFlag flag,
bool value )

Definition at line 89 of file TauTrack_v1.cxx.

89 {
90 static const Accessor< TauTrack_v1::TrackFlagType > trackFlags("flagSet");
91 TrackFlagType& f(trackFlags(*this));
92 std::bitset<8*sizeof(TrackFlagType)> thisTracksFlags(f);
93 thisTracksFlags[flag] = value;
94 f = thisTracksFlags.to_ulong();
95 }

◆ setFlagSet()

void xAOD::TauTrack_v1::setFlagSet ( TrackFlagType flag)

◆ setP4()

void xAOD::TauTrack_v1::setP4 ( double pt,
double eta,
double phi,
double m )

Set methods for IParticle values.

Definition at line 43 of file TauTrack_v1.cxx.

43 {
44
45 // Set the raw variables:
46 static const Accessor< float > acc1( "pt" );
47 static const Accessor< float > acc2( "eta" );
48 static const Accessor< float > acc3( "phi" );
49 acc1( *this ) = pt;
50 acc2( *this ) = eta;
51 acc3( *this ) = phi;
52
53 return;
54 }

◆ setTrackLinks()

void xAOD::TauTrack_v1::setTrackLinks ( const TrackParticleLinks_t & trackParticle)

◆ track()

const TrackParticle * xAOD::TauTrack_v1::track ( ) const

◆ trackLinks()

const TrackParticleLinks_t & xAOD::TauTrack_v1::trackLinks ( ) const

◆ type()

Type::ObjectType xAOD::TauTrack_v1::type ( ) const
virtual

The type of the object as a simple enumeration.

Implements xAOD::IParticle.

Definition at line 57 of file TauTrack_v1.cxx.

57 {
58 return Type::CompositeParticle;
59 }

◆ z0sinthetaSigTJVA()

float xAOD::TauTrack_v1::z0sinthetaSigTJVA ( ) const

Definition at line 130 of file TauTrack_v1.cxx.

130 {
131 return z0sinthetaSigTJVAAcc(*this);
132 }
static const SG::Accessor< float > z0sinthetaSigTJVAAcc("z0sinthetaSigTJVA")

◆ z0sinThetaTJVA()

float xAOD::TauTrack_v1::z0sinThetaTJVA ( const xAOD::IParticle & part) const

Definition at line 98 of file TauTrack_v1.cxx.

98 {
99 const xAOD::TrackParticle* xTrackParticle = this->track();
100 const xAOD::TauJet* tau = dynamic_cast<const xAOD::TauJet*> (&part);
101 if( tau ) {
102 float zv = 0.0;
103 if( tau->vertexLink().isValid() ) {
104 zv = tau->vertex()->z();
105 }
106 return ( ( xTrackParticle->z0() + xTrackParticle->vz() - zv ) *
107 std::sin( xTrackParticle->theta() ) );
108 } else {
109 std::cerr << "ERROR xAOD::TauTrack::z0sinThetaTJVA cannot get TauJet" << std::endl;
110 return 0;
111 }
112 }
const VertexLink_t & vertexLink() const
const Vertex * vertex() const
float z0() const
Returns the parameter.
float theta() const
Returns the parameter, which has range 0 to .
float vz() const
The z origin for the parameters.
float z() const
Returns the z position.
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ z0sinthetaTJVA()

float xAOD::TauTrack_v1::z0sinthetaTJVA ( ) const

Definition at line 125 of file TauTrack_v1.cxx.

125 {
126 return z0sinthetaTJVAAcc(*this);
127 }
static const SG::Accessor< float > z0sinthetaTJVAAcc("z0sinthetaTJVA")

The documentation for this class was generated from the following files: