00001
00002 #ifndef JETUTILS_JETCALOCELLQUALHELPER_H
00003 #define JETUTILS_JETCALOCELLQUALHELPER_H
00004
00005 #include "JetUtils/JetCaloQualityUtils.h"
00006
00007
00008
00009 class CaloCell;
00010
00011 namespace jet {
00012
00032 class JetCaloCellCalculator : virtual public JetCaloCalculator {
00033 public:
00035 virtual bool processCell(const CaloCell* , weight_t ) =0;
00036 virtual double operator()(const xAOD::Jet* jet, xAOD::JetConstitScale s=xAOD::UncalibratedJetConstituent);
00037
00038 virtual JetCaloCellCalculator* clone()const = 0;
00039
00040 };
00041
00042
00048 #define DECLARECELLCALC( baseclass, derivedclass, inits ) \
00049 class derivedclass : public baseclass , public JetCaloCellCalculator { \
00050 public: \
00051 derivedclass() : baseclass() {inits;} \
00052 virtual bool processCell(const CaloCell* , weight_t ) ; \
00053 JetCaloCellCalculator* clone()const {return new derivedclass(*this);} \
00054 }
00055
00056
00057
00058 DECLARECELLCALC(JetCalcnLeadingCells, JetCalcnLeadingCells_fromCells, m_id = JetAttribute::N90Cells; );
00059 DECLARECELLCALC(JetCalcOutOfTimeEnergyFraction, JetCalcOutOfTimeEnergyFraction_fromCells, );
00060 DECLARECELLCALC(JetCalcTimeCells, JetCalcTimeCells_fromCells, );
00061 DECLARECELLCALC(JetCalcAverageLArQualityF, JetCalcAverageLArQualityF_fromCells, );
00062 DECLARECELLCALC(JetCalcQualityHEC, JetCalcQualityHEC_fromCells, );
00063 DECLARECELLCALC(JetCalcQuality, JetCalcQuality_fromCells, );
00064 DECLARECELLCALC(JetCalcNegativeEnergy, JetCalcNegativeEnergy_fromCells, );
00065 DECLARECELLCALC(JetCalcCentroid, JetCalcCentroid_fromCells, );
00066
00067
00068
00075 class JetCaloCellCalculations : public JetCaloCalculations {
00076 public:
00077
00078 JetCaloCellCalculations(bool ownCalc=true) : JetCaloCalculations(ownCalc) {}
00079
00081 virtual std::vector<double> process(const xAOD::Jet* jet) const ;
00082
00083 void addCellCalculator(JetCaloCellCalculator* c);
00084
00085 protected:
00086 std::vector<JetCaloCellCalculator*> m_cellcalculators;
00087
00088 };
00089
00090
00091
00092 }
00093
00094 #endif