ATLAS Offline Software
Loading...
Searching...
No Matches
Analysis::TrackConstituents Class Referenceabstract

Class TrackConstituent: This is the implemntation of the TrackConstituents class for ParticleJet. More...

#include <TrackConstituents.h>

Inheritance diagram for Analysis::TrackConstituents:
Collaboration diagram for Analysis::TrackConstituents:

Public Types

typedef Navigable< Rec::TrackParticleContainer, double >::object_iter iterator
typedef typename NavigationDefaults::DefaultChildColl< Rec::TrackParticleContainer, double >::type constituent_coll
typedef constituent_coll::iterator constituent_iter
typedef constituent_coll::const_iterator constituent_const_iter
typedef Rec::TrackParticleContainer container_type
 Object container type.
typedef double parameter_type
 \ brief Relational parameter type
typedef NavigationDefaults::DefaultChildColl< container_type, parameter_typenavhelper_t
 Collection manager type.
typedef Rec::TrackParticleContainer::base_value_type constituent_type
typedef Rec::TrackParticleContainer::reference constituent_ptr_ref
typedef Rec::TrackParticleContainer::const_reference constituent_const_ptr_ref
typedef Rec::TrackParticleContainer::value_type constituent_ptr
typedef SG::GenerateIndexingPolicy< Rec::TrackParticleContainer >::type::index_type external_index_type
typedef NavigableIterator< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl< Rec::TrackParticleContainer, double >::typeobject_iter

Public Member Functions

 TrackConstituents ()
 constructor
 TrackConstituents (NameType &name)
 constructor
 ~TrackConstituents ()=default
virtual NameType name () const
 returns the infoType of the info objects.
virtual IConstituentclone () const
 a clone method for the proper workings of the copy constructor
std::vector< const Rec::TrackParticle * > * tracks () const
 get a vector of trackparticles. user must delete the vector, but not constituents
unsigned int nTracks () const
double getTrackWeight (const Rec::TrackParticle *) const
double getTrackWeight (const Rec::TrackParticleContainer *, index_type &) const
virtual void setName (NameType &name)
 to set the name
void set_track (const Rec::TrackParticleContainer *, const Rec::TrackParticle *, double weight=0.)
 set method for tracks.
void set_track (const Rec::TrackParticleContainer *, index_type &, double weight=0.)
 set method for tracks.
void set_constituent (const Rec::TrackParticleContainer *, const Rec::TrackParticle *, double weight=0.)
 set method for tracks.
void set_constituent (const Rec::TrackParticleContainer *, index_type &, double weight=0.)
virtual void fillToken (INavigationToken &navToken) const
void putElement (const Rec::TrackParticleContainer *objectContainer, const constituent_type *constituentObject, const double &objectParameter=double(), size_t sizeHint=0)
void insertElement (const Rec::TrackParticleContainer *objectContainer, const constituent_type *constituentObject, const double &objectParameter=double(), size_t sizeHint=0)
void reweight (const constituent_type *constituentObject, const double &objectParameter=double())
bool remove (const constituent_type *aConstituent)
bool removeAll ()
bool replace (const Rec::TrackParticleContainer *newObjectContainer)
 replace old object container with a new container assumes that all objects have been or will be inserted to the new container
bool contains (const constituent_type *aConstituent) const
virtual object_iter begin () const
virtual object_iter end () const
virtual unsigned int size () const
double getParameter (const constituent_type *aConstituent) const
const Rec::TrackParticleContainergetContainer (const constituent_type *aConstituent) const
bool getIndex (const constituent_type *aConstituent, external_index_type &theIndex) const
virtual void fillToken (INavigationToken &thisToken, const std::any &weight) const =0

Protected Member Functions

const constituent_collgetConstituents () const
const constituent_collgetPtrToConstituents () const
virtual const constituent_typegetConstituentPtr (constituent_iter iter) const
virtual double getConstituentPar (constituent_iter iter) const
void dumpStore () const

Private Types

typedef Navigable< Rec::TrackParticleContainer, double >::external_index_type index_type
typedef Navigable< Rec::TrackParticleContainer, double >::constituent_iter iter_type

Private Member Functions

virtual void apply (NavigationToken< constituent_type > &navToken) const
virtual void toKidsAfterAccept (INavigationToken &navToken) const
virtual void toKidsAfterReject (INavigationToken &navToken) const

Private Attributes

std::string m_name
constituent_coll m_constituents

Detailed Description

Class TrackConstituent: This is the implemntation of the TrackConstituents class for ParticleJet.

Author
cranm.nosp@m.er@c.nosp@m.ern.c.nosp@m.h

Definition at line 36 of file TrackConstituents.h.

Member Typedef Documentation

◆ constituent_coll

◆ constituent_const_iter

typedef constituent_coll::const_iterator Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::constituent_const_iter
inherited

Definition at line 103 of file Navigable.h.

◆ constituent_const_ptr_ref

Definition at line 151 of file Navigable.h.

◆ constituent_iter

Definition at line 102 of file Navigable.h.

◆ constituent_ptr

◆ constituent_ptr_ref

Definition at line 150 of file Navigable.h.

◆ constituent_type

◆ container_type

Object container type.

Definition at line 110 of file Navigable.h.

◆ external_index_type

◆ index_type

◆ iter_type

◆ iterator

◆ navhelper_t

Collection manager type.

Definition at line 114 of file Navigable.h.

◆ object_iter

◆ parameter_type

typedef double Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::parameter_type
inherited

\ brief Relational parameter type

Definition at line 112 of file Navigable.h.

Constructor & Destructor Documentation

◆ TrackConstituents() [1/2]

Analysis::TrackConstituents::TrackConstituents ( )

constructor

Definition at line 23 of file TrackConstituents.cxx.

24 { }

◆ TrackConstituents() [2/2]

Analysis::TrackConstituents::TrackConstituents ( NameType & name)

constructor

Definition at line 26 of file TrackConstituents.cxx.

27 : m_name (name)
28 { }
virtual NameType name() const
returns the infoType of the info objects.

◆ ~TrackConstituents()

Analysis::TrackConstituents::~TrackConstituents ( )
default

Member Function Documentation

◆ apply()

virtual void Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::apply ( NavigationToken< constituent_type > & navToken) const
privatevirtualinherited

◆ begin()

virtual object_iter Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::begin ( ) const
virtualinherited

◆ clone()

IConstituent * Analysis::TrackConstituents::clone ( ) const
virtual

a clone method for the proper workings of the copy constructor

Implements Analysis::IConstituent.

Definition at line 34 of file TrackConstituents.cxx.

35 { return new TrackConstituents( *this );}

◆ contains()

bool Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::contains ( const constituent_type * aConstituent) const
inherited

◆ dumpStore()

void Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::dumpStore ( ) const
protectedinherited

◆ end()

◆ fillToken() [1/2]

virtual void INavigable::fillToken ( INavigationToken & thisToken,
const std::any & weight ) const
pure virtualinherited

Implemented in Analysis::ISvxAssociation, Analysis::ISvxConstituent, Analysis::Muon, Analysis::MuonAssociation, Analysis::ParticleShallowClone, Analysis::TauJet, CaloClusterNavigable, constituent_iter< ElectronContainer, double >, constituent_iter< INavigable4MomentumCollection, double >, constituent_iter< JetCollection, double >, constituent_iter< MuonContainer, double >, constituent_iter< PhotonContainer, double >, constituent_iter< TrackParticleContainer, double >, eflowObject, egamma, external_index_type< CaloCellContainer, double >, external_index_type< ElectronContainer, double >, external_index_type< INavigable4MomentumCollection, double >, external_index_type< JetCollection, double >, external_index_type< MuonContainer, double >, external_index_type< PhotonContainer, double >, external_index_type< TrackParticleContainer, double >, Jet, Nav4MomWrapper< Navigable_t, P4Momentum_t >, Navigable< CONT, RPAR, COLL >, Navigable< CaloClusterContainer >, Navigable< collection_t, weight_t >, Navigable< INavigable4MomentumCollection, double >, NavigableTerminalNode, object_iter< CaloCellContainer, double >, object_iter< TrackParticleContainer, double >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< ::Analysis::MuonNavigation, ::P4ImplIPtCotThPhiM >, ParticleImpl< ::Analysis::TauJetNavigation, ::P4ImplEEtaPhiM >, ParticleImpl< CompositeParticleNavigation, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< egammaNavigation, P4ImplEEtaPhiM >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< NavigableTerminalNode, P4ImplEEtaPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplIPtCotThPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NeutrinoNavigation, P4ImplPxPyPzE >, ParticleImpl< TruthParticleNavigation, TruthParticleMomentum, TruthParticleBase >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, and ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE, ParticleEvent::Base >.

◆ fillToken() [2/2]

virtual void Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::fillToken ( INavigationToken & navToken) const
virtualinherited

Implements INavigable.

◆ getConstituentPar()

virtual double Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::getConstituentPar ( constituent_iter iter) const
protectedvirtualinherited

◆ getConstituentPtr()

virtual const constituent_type * Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::getConstituentPtr ( constituent_iter iter) const
protectedvirtualinherited

◆ getConstituents()

const constituent_coll & Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::getConstituents ( ) const
inlineprotectedinherited

Definition at line 290 of file Navigable.h.

◆ getContainer()

const Rec::TrackParticleContainer * Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::getContainer ( const constituent_type * aConstituent) const
inherited

◆ getIndex()

bool Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::getIndex ( const constituent_type * aConstituent,
external_index_type & theIndex ) const
inherited

◆ getParameter()

double Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::getParameter ( const constituent_type * aConstituent) const
inherited

◆ getPtrToConstituents()

const constituent_coll * Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::getPtrToConstituents ( ) const
inlineprotectedinherited

Definition at line 294 of file Navigable.h.

295 { return &m_constituents; }

◆ getTrackWeight() [1/2]

double Analysis::TrackConstituents::getTrackWeight ( const Rec::TrackParticle * theTrack) const

Definition at line 102 of file TrackConstituents.cxx.

103 {
104 // from Navigable
105 return (this->contains(theTrack) )
106 ? this->getParameter(theTrack)
107 : 0.;
108 }
double getParameter(const constituent_type *aConstituent) const
bool contains(const constituent_type *aConstituent) const

◆ getTrackWeight() [2/2]

double Analysis::TrackConstituents::getTrackWeight ( const Rec::TrackParticleContainer * theContainer,
index_type & theIndex ) const

Definition at line 110 of file TrackConstituents.cxx.

112 {
113 // from Navigable
114 return (this->contains(theContainer,theIndex))
115 ? this->getParameter(theContainer,theIndex)
116 : 0.;
117 }

◆ insertElement()

void Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::insertElement ( const Rec::TrackParticleContainer * objectContainer,
const constituent_type * constituentObject,
const double & objectParameter = RPAR(),
size_t sizeHint = 0 )
inherited

◆ name()

NameType Analysis::TrackConstituents::name ( ) const
virtual

returns the infoType of the info objects.

This has to be set by the tagger.

Implements Analysis::IConstituent.

Definition at line 32 of file TrackConstituents.cxx.

32{ return m_name;}

◆ nTracks()

unsigned int Analysis::TrackConstituents::nTracks ( ) const
inline

Definition at line 63 of file TrackConstituents.h.

63{ return size() ; }

◆ putElement()

void Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::putElement ( const Rec::TrackParticleContainer * objectContainer,
const constituent_type * constituentObject,
const double & objectParameter = RPAR(),
size_t sizeHint = 0 )
inherited

◆ remove()

bool Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::remove ( const constituent_type * aConstituent)
inherited

◆ removeAll()

bool Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::removeAll ( )
inlineinherited

Definition at line 237 of file Navigable.h.

237{ m_constituents.clear(); return this->size() == 0 ; }

◆ replace()

bool Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::replace ( const Rec::TrackParticleContainer * newObjectContainer)
inherited

replace old object container with a new container assumes that all objects have been or will be inserted to the new container

◆ reweight()

void Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::reweight ( const constituent_type * constituentObject,
const double & objectParameter = RPAR() )
inherited

◆ set_constituent() [1/2]

void Analysis::TrackConstituents::set_constituent ( const Rec::TrackParticleContainer * theContainer,
const Rec::TrackParticle * theTrack,
double weight = 0. )

set method for tracks.

By default, navigable weight = 0 which reflects that the tracks do not contribute to the kinematics.

Definition at line 75 of file TrackConstituents.cxx.

77 { this->set_track(theContainer, theTrack, weight); }
void set_track(const Rec::TrackParticleContainer *, const Rec::TrackParticle *, double weight=0.)
set method for tracks.

◆ set_constituent() [2/2]

void Analysis::TrackConstituents::set_constituent ( const Rec::TrackParticleContainer * theContainer,
index_type & theIndex,
double weight = 0. )

Definition at line 79 of file TrackConstituents.cxx.

81 { this->set_track(theContainer, theIndex, weight); }

◆ set_track() [1/2]

void Analysis::TrackConstituents::set_track ( const Rec::TrackParticleContainer * theContainer,
const Rec::TrackParticle * theTrack,
double weight = 0. )

set method for tracks.

By default, navigable weight = 0 which reflects that the tracks do not contribute to the kinematics.

Definition at line 38 of file TrackConstituents.cxx.

40 {
41 double newWeight = weight;
42 // track already in collection
43 if ( this->contains(theTrack) )
44 {
45 // update weight
46 newWeight *= this->getTrackWeight(theTrack);
47 // remove the previous track
48 this->remove(theTrack);
49 }
50
51 // from Navigable base
52 this->putElement(theContainer,theTrack,newWeight);
53
54
55 }
double getTrackWeight(const Rec::TrackParticle *) const
bool remove(const constituent_type *aConstituent)
void putElement(const Rec::TrackParticleContainer *objectContainer, const constituent_type *constituentObject, const double &objectParameter=double(), size_t sizeHint=0)

◆ set_track() [2/2]

void Analysis::TrackConstituents::set_track ( const Rec::TrackParticleContainer * theContainer,
index_type & theIndex,
double weight = 0. )

set method for tracks.

By default, navigable weight = 0 which reflects that the tracks do not contribute to the kinematics.

Definition at line 57 of file TrackConstituents.cxx.

59 {
60 double newWeight = weight;
61 // track already in collection
62 if ( this->contains(theContainer,theIndex) )
63 {
64 // update weight
65 newWeight *= this->getTrackWeight(theContainer,theIndex);
66 // remove the previous track
67 this->remove(theContainer,theIndex);
68 }
69
70 // from Navigable base
71 this->putElement(theContainer,theIndex,newWeight);
72
73 }

◆ setName()

void Analysis::TrackConstituents::setName ( NameType & name)
virtual

to set the name

Implements Analysis::IConstituent.

Definition at line 30 of file TrackConstituents.cxx.

30{m_name = name;}

◆ size()

virtual unsigned int Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::size ( ) const
virtualinherited

◆ toKidsAfterAccept()

virtual void Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::toKidsAfterAccept ( INavigationToken & navToken) const
privatevirtualinherited

◆ toKidsAfterReject()

virtual void Navigable< Rec::TrackParticleContainer, double, typename NavigationDefaults::DefaultChildColl<Rec::TrackParticleContainer, double>::type >::toKidsAfterReject ( INavigationToken & navToken) const
privatevirtualinherited

◆ tracks()

std::vector< const Rec::TrackParticle * > * Analysis::TrackConstituents::tracks ( ) const

get a vector of trackparticles. user must delete the vector, but not constituents

Definition at line 119 of file TrackConstituents.cxx.

120 {
121 std::vector<const Rec::TrackParticle*>* tracks =
122 new std::vector<const Rec::TrackParticle*>();
123
124 for(iterator it = begin(); it!= end(); ++it)
125 tracks->push_back(*it);
126
127 return tracks;
128 }
std::vector< const Rec::TrackParticle * > * tracks() const
get a vector of trackparticles. user must delete the vector, but not constituents
Navigable< Rec::TrackParticleContainer, double >::object_iter iterator

Member Data Documentation

◆ m_constituents

Definition at line 345 of file Navigable.h.

◆ m_name

std::string Analysis::TrackConstituents::m_name
private

Definition at line 100 of file TrackConstituents.h.


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