7#ifndef JETMONITORING_JETVARIABLE_H
8#define JETMONITORING_JETVARIABLE_H
40 virtual float at(
int)
const =0;
41 virtual size_t size()
const =0;
46 std::unique_ptr<VectorWrapper>
m_v;
74 static std::unique_ptr<Variable>
create(
const std::string &
name,
const std::string &
type=
"float",
int index=-1);
107 float at(
int i)
const {
return (*
m_v)[i];}
116 virtual std::string
name()
const {
133 if (
m_acc.isAvailable( j ) ) {
190 float constScalePt = 0.;
191 std::vector<float> SumPtChargedPFOPt500;
192 status = j.
getAttribute<
float>(
"JetConstitScaleMomentum_pt", constScalePt );
193 if (!status)
return 0;
194 status = j.
getAttribute<std::vector<float> >(
"SumPtChargedPFOPt500", SumPtChargedPFOPt500 );
195 if (!status)
return 0;
196 return SumPtChargedPFOPt500.at(0)/=constScalePt;
203 float constitScaleEnergy = 0.;
204 std::vector<float> samplingFrac;
209 if( status ) constitScaleEnergy = fourVec.E() *
m_scale ;
211 status = j.
getAttribute<std::vector<float> >(
"EnergyPerSampling", samplingFrac );
212 if( status )
return (samplingFrac[3]+samplingFrac[7])/constitScaleEnergy;
220 float constitScaleEnergy = 0.;
221 std::vector<float> samplingFrac;
226 if( status ) constitScaleEnergy = fourVec.E() *
m_scale ;
228 status = j.
getAttribute<std::vector<float> >(
"EnergyPerSampling", samplingFrac );
229 if( status )
return (samplingFrac[12]+samplingFrac[18])/constitScaleEnergy;
virtual std::string name() const
virtual ~Variable()=default
virtual VectorValue vector(const xAOD::Jet &) const
return a helper object allowing to iterate over the underlying vector. !!! use only if isVector()==tr...
Variable(const std::string &name)
virtual float value(const xAOD::Jet &) const =0
static std::unique_ptr< Variable > create(const std::string &name, const std::string &type="float", int index=-1)
create and return a new Variable of a given name & type.
virtual bool isVector() const
return true if the underlying variable is of type vector<X>
SG::Accessor< T, ALLOC > Accessor
size_t numConstituents() const
Number of constituents in this jets (this is valid even when reading a file where the constituents ha...
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual double rapidity() const
The true rapidity (y) of the particle.
float pz() const
The z-component of the jet's momentum.
bool getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
SG::AuxElement::Accessor< T > Accessor
Jet_v1 Jet
Definition of the current "jet version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Variable(const std::string &name)
virtual float value(const xAOD::Jet &j) const
Variable(const std::string &name)
virtual float value(const xAOD::Jet &j) const
Variable(const std::string &name)
virtual float value(const xAOD::Jet &j) const
Variable(const std::string &name)
virtual float value(const xAOD::Jet &j) const
virtual float value(const xAOD::Jet &j) const
Variable(const std::string &name)
Variable(const std::string &name)
virtual float value(const xAOD::Jet &j) const
Variable(const std::string &name)
virtual float value(const xAOD::Jet &j) const
virtual float value(const xAOD::Jet &j) const
Variable(const std::string &name)
Variable(const std::string &name)
virtual float value(const xAOD::Jet &j) const
VectorWrapperT(const vect_t *v)
virtual VectorValue vector(const xAOD::Jet &j) const
return a helper object allowing to iterate over the underlying vector. !!! use only if isVector()==tr...
VariableAtt(const std::string &name, int index)
virtual std::string name() const
static const vect_t s_dummy
virtual bool isVector() const
return true if the underlying variable is of type vector<X>
virtual float value(const xAOD::Jet &j) const
virtual float value(const xAOD::Jet &j) const
VariableAtt(const std::string &name)
virtual size_t size() const =0
virtual float at(int) const =0
VectorValue is a helper class to access any jet variable of type vector<X> It is implemented this way...
VectorValue(VectorWrapper *v=nullptr, float s=1.)
std::unique_ptr< VectorWrapper > m_v
float operator[](int i) const