ATLAS Offline Software
JetCaloQualityUtils.h
Go to the documentation of this file.
1 // emacs, this file is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
16 #ifndef JETUTIL_JETCALOQUALITYUTILS_H
17 #define JETUTIL_JETCALOQUALITYUTILS_H
18 
20 #include "xAODJet/Jet.h"
21 #include <vector>
22 //#include "xAODJet/JetAttributes.h"
23 
24 
25 namespace jet {
26 
27  using xAOD::Jet;
29  public:
30  friend class JetCalcnLeadingCells;
31 
32  /* @brief Compute em fraction for the vector of e per sampling (jet->getAttribute(EnergyPerSampling))*/
33  static double emFraction(const std::vector<float>& ePerSampling);
34 
35  /* @brief Compute the maximum of E_layer/Ejet*/
36  static double fracSamplingMax(const Jet* jet, int& SamplingMax);
37 
38  // /* @brief Compute Out-Of-Time energy fraction from cells*/
39  // static double jetOutOfTimeEnergyFraction(const Jet* jet, const double time=25, const bool doOnlyPos=false);
40 
41  // /* @brief DEPRECATED still here to avoid a compilation failure in JetD3PDMaker/ */
42  static double jetOutOfTimeEnergyFractionClusters(const Jet* , const double , const bool ){return 0;}
43 
44 
45  /* @brief Compute the jet energy fraction in HEC*/
46  static double hecF(const Jet* jet);
47 
48  /* @brief Compute the jet energy fraction in presampler*/
49  static double presamplerFraction(const Jet* jet);
50 
51  /* @brief Compute the jet energy fraction in TILEGAP3*/
52  static double tileGap3F(const Jet* jet);
53 
54  /* @brief total negative energy in a jet*/
55  static double jetNegativeEnergy(const Jet* jet);
56 
57  // isGoodTight , isGoodMedium, isGoodMedium and
58  // isBadTight, isBadMedium, isBad
59  // These functions are removed because DEPRECATED.
60  // Instead use IJetSelector and/or JetCleaningTool from PhysicsAnalysis/JetMissingEtID/JetSelectorTools
61 
62  /* @brief Check if it is a ugly jet. Still needed in run2 ? */
63  static bool isUgly(const Jet* jet,const bool recalculateQuantities=false);
64 
65 
66  private:
67  /* @brief Compute the minimal number of objects containing at least threshold% of the jet energy */
68  static int compute_nLeading(std::vector<double> &cell_energies, const float& e, const float& frac);
69 
70 
71 
72 
73  };
74 
75 
77  // Implement some of the task in JetCaloQualityUtils as JetCaloCalculator
78 
79  // JETCALCFUNCDECL is a declaration shortcut defined in JetCaloHelper.h
80 
81  using xAOD::JetAttribute;
82 
83  /* @brief Compute the minimal number of cells containing at least threshold% of the jet energy*/
84  class JetCalcnLeadingCells: virtual public JetCaloCalculator {
85  protected:
86  std::vector<double> m_cell_energies;
87  double m_sumE_cells{};
88  double m_threshold{};
89 
91  };
92 
93 
94  /* @brief Compute Out-Of-Time energy fraction */
96  protected:
97  double m_sumE{},m_sumE_OOT{};
98  public:
99  double timecut;
102  };
103 
104  /* @brief Compute the jet timing information from calorimeter*/
105 
106  class JetCalcTimeCells: virtual public JetCaloCalculator {
107  protected:
108  double m_time{},m_norm{};
109 
111 
112  };
113 
114 
115  /* @brief Compute the jet average quality factor */
117  protected:
118  double m_qf{},m_norm{};
119  bool m_useTile;
121 
122  };
123 
124  /* @brief Compute the jet quality factor information*/
125  class JetCalcQuality: virtual public JetCaloCalculator {
126  protected:
127  double m_totE{}, m_badE{};
128 
129  public:
131  int TileQualityCut; // =254
133 
135  };
136 
137 
138  /* @brief Compute the jet quality factor information for HEC only*/
139  class JetCalcQualityHEC: virtual public JetCalcQuality {
140  public:
141 
142  //ABC this class does not include JETCALCFUNCDECL ?
144  //bool processCell(const CaloCell *theCell, weight_t);
145  JetCaloCalculator* clone() const {return new JetCalcQualityHEC(*this); }
146 
147  //bool processCell(const CaloCell *cell, weight_t w);
149 
150  };
151 
152 
153  /* @brief total negative energy in a jet*/
154  class JetCalcNegativeEnergy: virtual public JetCaloCalculator {
155  protected:
156  double m_totE{};
157 
159  };
160 
161  /* @brief total negative energy in a jet*/
162  class JetCalcCentroid: virtual public JetCaloCalculator {
163  protected:
165 
166 
168  };
169 
171  class JetCalcBadCellsFrac : virtual public JetCaloCalculator {
172  protected:
173  double m_totE{};
174  double m_badE{};
176 
177  };
178 
179 }
180 #endif
jet::JetCalcOutOfTimeEnergyFraction::m_sumE_OOT
double m_sumE_OOT
Definition: JetCaloQualityUtils.h:97
xAOD::JetAttribute::BchCorrCell
@ BchCorrCell
Definition: JetAttributes.h:94
jet::JetCalcBadCellsFrac
Fraction of Bad energy in jet. From cluster moment ENG_BAD_CELLS.
Definition: JetCaloQualityUtils.h:171
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
jet::JetCalcTimeCells
Definition: JetCaloQualityUtils.h:106
Jet.h
jet::JetCalcnLeadingCells
Definition: JetCaloQualityUtils.h:84
jet::JetCalcTimeCells::m_time
double m_time
Definition: JetCaloQualityUtils.h:108
jet::JetCalcOutOfTimeEnergyFraction
Definition: JetCaloQualityUtils.h:95
jet::JetCalcQualityHEC
Definition: JetCaloQualityUtils.h:139
xAOD::JetAttribute::LArQuality
@ LArQuality
Definition: JetAttributes.h:83
jet::JetCalcBadCellsFrac::JETCALCFUNCDECL
JETCALCFUNCDECL(JetCalcBadCellsFrac, JetAttribute::BchCorrCell, setName("BchCorrCell");)
Jet
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:47
jet::JetCalcCentroid
Definition: JetCaloQualityUtils.h:162
jet::JetCaloQualityUtils::tileGap3F
static double tileGap3F(const Jet *jet)
Definition: JetCaloQualityUtils.cxx:95
xAOD::JetAttribute::OotFracCells10
@ OotFracCells10
Definition: JetAttributes.h:89
jet::JetCaloQualityUtils::isUgly
static bool isUgly(const Jet *jet, const bool recalculateQuantities=false)
Definition: JetCaloQualityUtils.cxx:144
jet::JetCalcQualityHEC::processConstituent
bool processConstituent(xAOD::JetConstituentVector::iterator &iter)
Perform 1 calculation step using 1 constituent.
Definition: JetCaloQualityUtils.cxx:316
jet::JetCalcQuality::includeTile
bool includeTile
Definition: JetCaloQualityUtils.h:132
jet::JetCaloQualityUtils::jetNegativeEnergy
static double jetNegativeEnergy(const Jet *jet)
Definition: JetCaloQualityUtils.cxx:137
jet::JetCalcNegativeEnergy
Definition: JetCaloQualityUtils.h:154
jet::JetCalcAverageLArQualityF::JETCALCFUNCDECL
JETCALCFUNCDECL(JetCalcAverageLArQualityF, JetAttribute::AverageLArQF, m_useTile=false;m_norm=0;)
jet::JetCalcAverageLArQualityF::m_qf
double m_qf
Definition: JetCaloQualityUtils.h:118
xAOD::JetAttribute::CentroidR
@ CentroidR
Definition: JetAttributes.h:131
jet::JetCalcTimeCells::m_norm
double m_norm
Definition: JetCaloQualityUtils.h:108
jet::JetCalcQualityHEC::JetCalcQualityHEC
JetCalcQualityHEC()
Definition: JetCaloQualityUtils.h:148
jet::JetCalcTimeCells::JETCALCFUNCDECL
JETCALCFUNCDECL(JetCalcTimeCells, JetAttribute::Timing, m_norm=0;)
jet::JetCalcnLeadingCells::JETCALCFUNCDECL
JETCALCFUNCDECL(JetCalcnLeadingCells, JetAttribute::N90Constituents, m_threshold=0.9;)
JetCaloCalculations.h
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
jet::JetCalcOutOfTimeEnergyFraction::m_sumE
double m_sumE
Definition: JetCaloQualityUtils.h:97
jet::JetCalcNegativeEnergy::JETCALCFUNCDECL
JETCALCFUNCDECL(JetCalcNegativeEnergy, JetAttribute::NegativeE, m_totE=0;)
jet::JetCalcCentroid::JETCALCFUNCDECL
JETCALCFUNCDECL(JetCalcCentroid, JetAttribute::CentroidR, m_totE=0;)
jet::JetCalcCentroid::m_totE
double m_totE
Definition: JetCaloQualityUtils.h:164
checkxAOD.frac
frac
Definition: Tools/PyUtils/bin/checkxAOD.py:257
jet::JetCalcnLeadingCells::m_threshold
double m_threshold
Definition: JetCaloQualityUtils.h:88
xAOD::JetAttribute
Definition: JetAttributes.h:22
jet::JetCalcOutOfTimeEnergyFraction::onlyPosEnergy
bool onlyPosEnergy
Definition: JetCaloQualityUtils.h:100
xAOD::JetAttribute::Timing
@ Timing
Definition: JetAttributes.h:90
jet::JetCalcQuality::TileQualityCut
int TileQualityCut
Definition: JetCaloQualityUtils.h:131
jet::JetCalcQuality::m_totE
double m_totE
Definition: JetCaloQualityUtils.h:127
jet::JetCalcQuality::m_badE
double m_badE
Definition: JetCaloQualityUtils.h:127
jet::JetCaloQualityUtils::jetOutOfTimeEnergyFractionClusters
static double jetOutOfTimeEnergyFractionClusters(const Jet *, const double, const bool)
Definition: JetCaloQualityUtils.h:42
jet::JetCalcAverageLArQualityF
Definition: JetCaloQualityUtils.h:116
jet::JetCalcQualityHEC::clone
JetCaloCalculator * clone() const
Clone. Base class should not be cloned.
Definition: JetCaloQualityUtils.h:145
jet::JetCalcCentroid::m_centroid_z
double m_centroid_z
Definition: JetCaloQualityUtils.h:164
xAOD::JetAttribute::N90Constituents
@ N90Constituents
Definition: JetAttributes.h:91
jet::JetCalcQuality::includeLAr
bool includeLAr
Definition: JetCaloQualityUtils.h:132
xAOD::JetAttribute::AverageLArQF
@ AverageLArQF
Definition: JetAttributes.h:85
jet::JetCalcCentroid::m_centroid_y
double m_centroid_y
Definition: JetCaloQualityUtils.h:164
jet::JetCaloQualityUtils::fracSamplingMax
static double fracSamplingMax(const Jet *jet, int &SamplingMax)
Definition: JetCaloQualityUtils.cxx:107
jet::JetCalcQuality::JETCALCFUNCDECL
JETCALCFUNCDECL(JetCalcQuality, JetAttribute::LArQuality, includeTile=false;includeLAr=true;LArQualityCut=4000 ;TileQualityCut=254;m_totE=0;m_badE=0;)
jet::JetCaloQualityUtils::hecF
static double hecF(const Jet *jet)
Definition: JetCaloQualityUtils.cxx:67
jet::JetCalcBadCellsFrac::m_totE
double m_totE
Definition: JetCaloQualityUtils.h:173
jet::JetCalcAverageLArQualityF::m_norm
double m_norm
Definition: JetCaloQualityUtils.h:118
jet::JetCalcnLeadingCells::m_cell_energies
std::vector< double > m_cell_energies
Definition: JetCaloQualityUtils.h:86
jet::JetCalcAverageLArQualityF::m_useTile
bool m_useTile
Definition: JetCaloQualityUtils.h:119
jet::JetCaloQualityUtils::compute_nLeading
static int compute_nLeading(std::vector< double > &cell_energies, const float &e, const float &frac)
Definition: JetCaloQualityUtils.cxx:37
jet::JetCalcOutOfTimeEnergyFraction::timecut
double timecut
Definition: JetCaloQualityUtils.h:99
jet::JetCalcnLeadingCells::m_sumE_cells
double m_sumE_cells
Definition: JetCaloQualityUtils.h:87
jet::JetCalcBadCellsFrac::m_badE
double m_badE
Definition: JetCaloQualityUtils.h:174
jet::JetCaloQualityUtils::emFraction
static double emFraction(const std::vector< float > &ePerSampling)
Definition: JetCaloQualityUtils.cxx:56
jet::JetCalcQuality::LArQualityCut
int LArQualityCut
Definition: JetCaloQualityUtils.h:130
xAOD::JetConstituentVector::iterator
Definition: JetConstituentVector.h:121
jet::JetCalcOutOfTimeEnergyFraction::JETCALCFUNCDECL
JETCALCFUNCDECL(JetCalcOutOfTimeEnergyFraction, JetAttribute::OotFracCells10, timecut=10;onlyPosEnergy=false;m_sumE=0;)
jet::JetCaloCalculator
Definition: JetCaloCalculations.h:76
jet::JetCalcNegativeEnergy::m_totE
double m_totE
Definition: JetCaloQualityUtils.h:156
jet::JetCaloQualityUtils
Definition: JetCaloQualityUtils.h:28
jet::JetCalcCentroid::m_centroid_x
double m_centroid_x
Definition: JetCaloQualityUtils.h:164
jet::JetCaloQualityUtils::presamplerFraction
static double presamplerFraction(const Jet *jet)
Definition: JetCaloQualityUtils.cxx:83
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
jet::JetCalcQuality
Definition: JetCaloQualityUtils.h:125
xAOD::JetAttribute::NegativeE
@ NegativeE
Definition: JetAttributes.h:84
jet::JetCaloCalculator::setName
void setName(const std::string &n)
Definition: JetCaloCalculations.h:104