12#include "CaloGeoHelpers/CaloSampling.h"
22const int em_calosample[] = { CaloSampling::PreSamplerB, CaloSampling::EMB1, CaloSampling::EMB2, CaloSampling::EMB3,
23 CaloSampling::PreSamplerE, CaloSampling::EME1, CaloSampling::EME2, CaloSampling::EME3,
25const int had_calosample[] = { CaloSampling::HEC0, CaloSampling::HEC1, CaloSampling::HEC2, CaloSampling::HEC3,
26 CaloSampling::TileBar0, CaloSampling::TileBar1, CaloSampling::TileBar2,
27 CaloSampling::TileGap1, CaloSampling::TileGap2, CaloSampling::TileGap3,
28 CaloSampling::TileExt0, CaloSampling::TileExt1, CaloSampling::TileExt2,
29 CaloSampling::FCAL1, CaloSampling::FCAL2 };
39 std::sort(cell_energies.rbegin(),cell_energies.rend());
42 for(
unsigned int i=0;i<cell_energies.size();i++)
44 sum += cell_energies[i];
58 for(
int i=0; i<9; i++) e_EM += e_sampling[ ::em_calosample[i] ];
61 for(
int i=0; i<15; i++) e_HAD += e_sampling[ ::had_calosample[i] ];
62 if( (e_EM==0) || ((e_EM+e_HAD)==0) )
return 0.;
63 return (e_EM / (e_EM+e_HAD));
72 double e_hec =einsampling[CaloSampling::HEC0]
73 +einsampling[CaloSampling::HEC1]
74 +einsampling[CaloSampling::HEC2]
75 +einsampling[CaloSampling::HEC3];
79 if(e_jet!=0)
return e_hec/e_jet;
87 double e_pres = einsampling[CaloSampling::PreSamplerB] + einsampling[CaloSampling::PreSamplerE];
91 if(e_jet!=0)
return e_pres/e_jet;
99 double e_tileGap3 =einsampling[CaloSampling::TileGap3];
102 if(e_jet!=0)
return e_tileGap3/e_jet;
112 double sumE_samplings=0.;
113 for (
unsigned int i(0); i < einsampling.size(); ++i )
115 double e = einsampling[i];
124 if(sumE_samplings!=0)
148 if (fcor>0.5)
return true;
149 if (tileGap3f >0.5)
return true;
171 double e = iter->e();
173 e = iter->rawConstituent()->e();
197 if(
m_sumE== 0.)
return -1;
205 double aClusterE =
iter->e();
207 aClusterE =
iter->rawConstituent()->e();
232 double thisNorm =
iter->e()*
iter->e();
234 thisNorm =
iter->rawConstituent()->e()*
iter->rawConstituent()->e();
265 e2 =
iter->rawConstituent()->e();
343 double e =
iter->e() ;
345 e =
iter->rawConstituent()->e();
366 if (
m_totE == 0)
return 0;
371 return sqrt(c_x*c_x + c_y*c_y+ c_z*c_z);
376 double e =
iter->e() ;
378 e =
iter->rawConstituent()->e();
381 e =
iter->rawConstituent()->e();
414 if (
m_totE == 0)
return 0;
bool processConstituent(xAOD::JetConstituentVector::iterator &iter)
Perform 1 calculation step using 1 constituent.
std::vector< double > m_cell_energies
virtual double jetCalculation() const
return the result of the calculation
virtual bool setupJet(const xAOD::Jet *)=0
virtual bool processConstituent(xAOD::JetConstituentVector::iterator &)
Perform 1 calculation step using 1 constituent.
const CaloConstitHelpers::CaloConstitExtractor * m_constitExtractor
static int compute_nLeading(std::vector< double > &cell_energies, const float &e, const float &frac)
static double emFraction(const std::vector< float > &ePerSampling)
static double hecF(const Jet *jet)
static double fracSamplingMax(const Jet *jet, int &SamplingMax)
static double jetNegativeEnergy(const Jet *jet)
static double presamplerFraction(const Jet *jet)
static double tileGap3F(const Jet *jet)
static bool isUgly(const Jet *jet, const bool recalculateQuantities=false)
@ AVG_TILE_Q
Sum(E_cell_Tile^2 Q_cell_Tile)/Sum(E_cell_Tile^2)
@ AVG_LAR_Q
Sum(E_cell_LAr^2 Q_cell_LAr)/Sum(E_cell_LAr^2)
@ CENTER_Z
Cluster Centroid ( )
@ ENG_BAD_CELLS
Total em-scale energy of bad cells in this cluster.
@ ENG_POS
Total positive Energy of this cluster.
@ BADLARQ_FRAC
Energy fraction of LAr cells with quality larger than a given cut.
@ CENTER_X
Cluster Centroid ( )
@ CENTER_Y
Cluster Centroid ( )
size_t numConstituents() const
Number of constituents in this jets (this is valid even when reading a file where the constituents ha...
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
static const xAOD::JetAttributeAccessor::AccessorWrapper< std::vector< float > > & eperSamplAcc
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
@ ParticleFlow
The object is a particle-flow object.
@ FlowElement
The object is a track-calo-cluster.
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
Jet_v1 Jet
Definition of the current "jet version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.