ATLAS Offline Software
Loading...
Searching...
No Matches
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
15
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
25namespace jet {
26
27 using xAOD::Jet;
29 public:
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
82
83 /* @brief Compute the minimal number of cells containing at least threshold% of the jet energy*/
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 */
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 */
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*/
160
161 /* @brief total negative energy in a jet*/
169
171 class JetCalcBadCellsFrac : virtual public JetCaloCalculator {
172 protected:
173 double m_totE{};
174 double m_badE{};
176
177 };
178
179}
180#endif
JETCALCFUNCDECL(JetCalcAverageLArQualityF, JetAttribute::AverageLArQF, m_useTile=false;m_norm=0;)
Fraction of Bad energy in jet. From cluster moment ENG_BAD_CELLS.
JETCALCFUNCDECL(JetCalcBadCellsFrac, JetAttribute::BchCorrCell, setName("BchCorrCell");)
JETCALCFUNCDECL(JetCalcCentroid, JetAttribute::CentroidR, m_totE=0;)
JETCALCFUNCDECL(JetCalcNegativeEnergy, JetAttribute::NegativeE, m_totE=0;)
JETCALCFUNCDECL(JetCalcOutOfTimeEnergyFraction, JetAttribute::OotFracCells10, timecut=10;onlyPosEnergy=false;m_sumE=0;)
JetCaloCalculator * clone() const
Clone. Base class should not be cloned.
bool processConstituent(xAOD::JetConstituentVector::iterator &iter)
Perform 1 calculation step using 1 constituent.
JETCALCFUNCDECL(JetCalcQuality, JetAttribute::LArQuality, includeTile=false;includeLAr=true;LArQualityCut=4000 ;TileQualityCut=254;m_totE=0;m_badE=0;)
JETCALCFUNCDECL(JetCalcTimeCells, JetAttribute::Timing, m_norm=0;)
std::vector< double > m_cell_energies
JETCALCFUNCDECL(JetCalcnLeadingCells, JetAttribute::N90Constituents, m_threshold=0.9;)
Base class to support cpu-efficient calculation on calorimeter jets either at CaloCell or constituent...
void setName(const std::string &n)
static int compute_nLeading(std::vector< double > &cell_energies, const float &e, const float &frac)
static double jetOutOfTimeEnergyFractionClusters(const Jet *, const double, const bool)
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)
Jet_v1 Jet
Definition of the current "jet version".