ATLAS Offline Software
Loading...
Searching...
No Matches
JetConstituentIterator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
19
20#ifndef JETEVENT_JETCONSTITUENTITERATOR_H
21#define JETEVENT_JETCONSTITUENTITERATOR_H
22
23
24#include "FourMom/P4PxPyPzE.h"
25
27
28#include "JetEvent/Jet.h"
29
30
32 public:
33
35
41
44
45 // operators ------------------------------------------------
47 m_actual++;
48 update_hlv();
49 return *this;
50 }
51
53 m_actual--;
54 update_hlv();
55 return *this;
56 }
57
58 // for python, we alias operator++/--
59 void inc(){ this->operator++();}
60 void dec(){ this->operator--();}
61
62 const JetConstituentIterator * operator*() const { return this; }
63
64 bool operator== (const JetConstituentIterator& other) const { return (m_actual == other.m_actual) ; }
65
66 bool operator!= (const JetConstituentIterator& other) const { return (m_actual != other.m_actual) ; }
67 // ------------------------------------------------------------
68
71
72
77
78
79 // Static functions -------------------------------------------
82 Jet::const_iterator begin = jet->begin();
83 if( begin == jet->end() ) return JetConstituentIterator(begin);
84 P4SignalState::State constituentDef = getSignalState(*begin);
85 if( (constituentDef == jet->constituentSignalState()) || // if default state is same as the one in jet
86 (constituentDef == P4SignalState::UNKNOWN ) ) // or has no sigstate
87 return JetConstituentIterator(begin); // -> use the fast version
88 else
89 return JetConstituentIterator(begin, jet->constituentSignalState()); // else default to state in jet
90 }
91
93 return JetConstituentIterator(jet->begin(), s);
94 }
95
97 return JetConstituentIterator(jet->end());
98 }
99
101 // -------------------------------------------------------------
102
103 protected:
104
111
112 void update_hlv();
113
114};
115#endif
JetConstituentIterator & operator--()
static JetConstituentIterator first(const Jet *jet, P4SignalState::State s)
get an iterator on constituent with Sig State
P4SignalState::State m_curState
P4SignalState::State m_defState
JetConstituentIterator(base_it b, P4SignalState::State s)
bool operator==(const JetConstituentIterator &other) const
void setSignalState(P4SignalState::State s)
set current signal state of the iterator
const JetConstituentIterator * operator*() const
static JetConstituentIterator last(const Jet *jet)
get the end iterator
static JetConstituentIterator first(const Jet *jet)
get a default iterator
const Jet::constituent_t * get_real_constit()
access to the real constituent pointer
P4SignalState::State getSignalState()
get current signal state of the iterator
bool operator!=(const JetConstituentIterator &other) const
JetConstituentIterator & operator++()
CLHEP::HepLorentzVector hlv_t
navigable_t::object_iter const_iterator
INavigable4Momentum constituent_t
Constituent iterator type.
P4PxPyPzE(const double px, const double py, const double pz, const double e)
constructor with all data members
Definition P4PxPyPzE.h:104