00001
00011 #ifndef JETUTIL_JETCALOQUALITYUTILS_H
00012 #define JETUTIL_JETCALOQUALITYUTILS_H
00013
00014 #include "JetUtils/JetCaloCalculations.h"
00015 #include "xAODJet/Jet.h"
00016 #include "xAODJet/JetAttributes.h"
00017
00018
00019 namespace jet {
00020
00021 using xAOD::Jet;
00022 class JetCaloQualityUtils {
00023 public:
00024 friend class JetCalcnLeadingCells;
00025
00026
00027 static double emFraction(const std::vector<float>& ePerSampling);
00028
00029
00030 static double fracSamplingMax(const Jet* jet, int& SamplingMax);
00031
00032
00033
00034
00035
00036 static double jetOutOfTimeEnergyFractionClusters(const Jet* , const double , const bool ){return 0;}
00037
00038
00039
00040 static double hecF(const Jet* jet);
00041
00042
00043 static double presamplerFraction(const Jet* jet);
00044
00045
00046 static double tileGap3F(const Jet* jet);
00047
00048
00049 static double jetNegativeEnergy(const Jet* jet);
00050
00051
00052
00053
00054
00055
00056
00057 static bool isUgly(const Jet* jet,const bool recalculateQuantities=false);
00058
00059
00060 private:
00061
00062 static int compute_nLeading(std::vector<double> &cell_energies, const float& e, const float& frac);
00063
00064
00065
00066
00067 };
00068
00069
00071
00072
00073
00074
00075 using xAOD::JetAttribute;
00076
00077
00078 class JetCalcnLeadingCells: virtual public JetCaloCalculator {
00079 protected:
00080 std::vector<double> m_cell_energies;
00081 double m_sumE_cells;
00082 double m_threshold;
00083
00084 JETCALCFUNCDECL( JetCalcnLeadingCells, JetAttribute::N90Constituents, m_threshold = 0.9;);
00085 };
00086
00087
00088
00089 class JetCalcOutOfTimeEnergyFraction: virtual public JetCaloCalculator {
00090 protected:
00091 double m_sumE,m_sumE_OOT;
00092 public:
00093 double timecut;
00094 bool onlyPosEnergy;
00095 JETCALCFUNCDECL( JetCalcOutOfTimeEnergyFraction, JetAttribute::OotFracCells10, timecut = 10; onlyPosEnergy=false;m_sumE=0;);
00096 };
00097
00098
00099
00100 class JetCalcTimeCells: virtual public JetCaloCalculator {
00101 protected:
00102 double m_time,m_norm;
00103
00104 JETCALCFUNCDECL( JetCalcTimeCells, JetAttribute::Timing, m_norm=0; );
00105
00106 };
00107
00108
00109
00110 class JetCalcAverageLArQualityF: virtual public JetCaloCalculator {
00111 protected:
00112 double m_qf,m_norm;
00113 bool m_useTile;
00114 JETCALCFUNCDECL( JetCalcAverageLArQualityF, JetAttribute::AverageLArQF, m_useTile=false; m_norm=0;);
00115
00116 };
00117
00118
00119 class JetCalcQuality: virtual public JetCaloCalculator {
00120 protected:
00121 double m_totE, m_badE;
00122
00123 public:
00124 int LArQualityCut;
00125 int TileQualityCut;
00126 bool includeTile, includeLAr;
00127
00128 JETCALCFUNCDECL( JetCalcQuality, JetAttribute::LArQuality, includeTile = false;includeLAr=true; LArQualityCut=4000 ; TileQualityCut=254; m_totE=0; m_badE=0;);
00129 };
00130
00131
00132
00133 class JetCalcQualityHEC: virtual public JetCalcQuality {
00134 public:
00135
00136
00137 bool processConstituent(xAOD::JetConstituentVector::iterator& iter);
00138
00139 JetCaloCalculator* clone() const {return new JetCalcQualityHEC(*this); }
00140
00141
00142 JetCalcQualityHEC() : JetCaloCalculator(JetAttribute::HECQuality), JetCalcQuality(JetAttribute::HECQuality) { }
00143
00144 };
00145
00146
00147
00148 class JetCalcNegativeEnergy: virtual public JetCaloCalculator {
00149 protected:
00150 double m_totE;
00151 double m_totSig ;
00152
00153 JETCALCFUNCDECL( JetCalcNegativeEnergy, JetAttribute::NegativeE, m_totE=0; m_totSig=0; );
00154 };
00155
00156
00157 class JetCalcCentroid: virtual public JetCaloCalculator {
00158 protected:
00159 double m_totE, m_centroid_x, m_centroid_y, m_centroid_z;
00160
00161
00162 JETCALCFUNCDECL( JetCalcCentroid, JetAttribute::CentroidR, m_totE=0; );
00163 };
00164
00166 class JetCalcBadCellsFrac : virtual public JetCaloCalculator {
00167 protected:
00168 double m_totE;
00169 double m_badE;
00170 JETCALCFUNCDECL( JetCalcBadCellsFrac, JetAttribute::BchCorrCell, setName("BchCorrCell"););
00171
00172 };
00173
00174 }
00175 #endif