ATLAS Offline Software
JetCaloCellQualityUtils.h
Go to the documentation of this file.
1 // This file is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef JETUTILS_JETCALOCELLQUALHELPER_H
8 #define JETUTILS_JETCALOCELLQUALHELPER_H
9 
11 
12 
13 
14 class CaloCell;
15 
16 namespace jet {
17 
37  class JetCaloCellCalculator : virtual public JetCaloCalculator {
38  public:
40  virtual bool processCell(const CaloCell* /*cell*/, weight_t /*w*/) =0;
42 
43  virtual JetCaloCellCalculator* clone()const = 0;
44 
45  };
46 
47 
53 #define DECLARECELLCALC( baseclass, derivedclass, inits ) \
54  class derivedclass : public baseclass , public JetCaloCellCalculator { \
55  public: \
56  derivedclass() : baseclass() {inits;} \
57  virtual bool processCell(const CaloCell* , weight_t ) ; \
58  JetCaloCellCalculator* clone()const {return new derivedclass(*this);} \
59  }
60 
61 
62  // below we declare cell based calo calculators inheriting the cluster based calculators.
63  DECLARECELLCALC(JetCalcnLeadingCells, JetCalcnLeadingCells_fromCells, m_id = JetAttribute::N90Cells; );
64  DECLARECELLCALC(JetCalcOutOfTimeEnergyFraction, JetCalcOutOfTimeEnergyFraction_fromCells, );
65  DECLARECELLCALC(JetCalcTimeCells, JetCalcTimeCells_fromCells, );
66  DECLARECELLCALC(JetCalcAverageLArQualityF, JetCalcAverageLArQualityF_fromCells, );
67  DECLARECELLCALC(JetCalcQualityHEC, JetCalcQualityHEC_fromCells, );
68  DECLARECELLCALC(JetCalcQuality, JetCalcQuality_fromCells, );
69  DECLARECELLCALC(JetCalcNegativeEnergy, JetCalcNegativeEnergy_fromCells, );
70  DECLARECELLCALC(JetCalcCentroid, JetCalcCentroid_fromCells, );
71  // DECLARECELLCALC(JetCalcBadCellsFrac, JetCalcBadCellsFrac_fromCells, );
72 
73 
81  public:
82 
83  JetCaloCellCalculations(bool ownCalc=true) : JetCaloCalculations(ownCalc) {}
84 
86  virtual std::vector<double> process(const xAOD::Jet* jet) const ;
87 
89 
90  protected:
91  std::vector<JetCaloCellCalculator*> m_cellcalculators;
92 
93  };
94 
95 
96 
97 }
98 
99 #endif
jet::JetCaloCellCalculator::processCell
virtual bool processCell(const CaloCell *, weight_t)=0
perform calculation for a single cell
jet::JetCalcTimeCells
Definition: JetCaloQualityUtils.h:106
jet::JetCalcnLeadingCells
Definition: JetCaloQualityUtils.h:84
jet::JetCalcOutOfTimeEnergyFraction
Definition: JetCaloQualityUtils.h:95
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
jet::JetCalcQualityHEC
Definition: JetCaloQualityUtils.h:139
jet::JetCalcCentroid
Definition: JetCaloQualityUtils.h:162
xAOD::JetAttribute::N90Cells
@ N90Cells
Definition: JetAttributes.h:92
jet::JetCaloCellCalculator
Base class (inheriting JetCaloCalculator) for calculations accessing CaloCell directly.
Definition: JetCaloCellQualityUtils.h:37
jet::JetCalcNegativeEnergy
Definition: JetCaloQualityUtils.h:154
jet::JetCaloCellCalculations::addCellCalculator
void addCellCalculator(JetCaloCellCalculator *c)
Definition: JetCaloCellQualityUtils.cxx:33
jet::JetCaloCellCalculations
collection of JetCaloCellCalculator
Definition: JetCaloCellQualityUtils.h:80
jet::JetCaloCellCalculations::JetCaloCellCalculations
JetCaloCellCalculations(bool ownCalc=true)
Definition: JetCaloCellQualityUtils.h:83
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
jet::JetCaloCalculations
Holds a list of JetCalculators.
Definition: JetCaloCalculations.h:145
jet::JetCalcAverageLArQualityF
Definition: JetCaloQualityUtils.h:116
jet::JetCaloCalculator::weight_t
double weight_t
Definition: JetCaloCalculations.h:79
xAOD::JetConstitScale
JetConstitScale
Definition: JetTypes.h:20
jet::JetCaloCellCalculator::clone
virtual JetCaloCellCalculator * clone() const =0
Clone. Base class should not be cloned.
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
xAOD::UncalibratedJetConstituent
@ UncalibratedJetConstituent
Definition: JetTypes.h:21
jet::DECLARECELLCALC
DECLARECELLCALC(JetCalcnLeadingCells, JetCalcnLeadingCells_fromCells, m_id=JetAttribute::N90Cells;)
JetCaloQualityUtils.h
jet::JetCaloCalculator
Definition: JetCaloCalculations.h:76
jet::JetCaloCellCalculations::m_cellcalculators
std::vector< JetCaloCellCalculator * > m_cellcalculators
Definition: JetCaloCellQualityUtils.h:91
jet::JetCaloCellCalculator::operator()
virtual double operator()(const xAOD::Jet *jet, xAOD::JetConstitScale s=xAOD::UncalibratedJetConstituent)
convenience function to perform the full calculation on a given jet
Definition: JetCaloCellQualityUtils.cxx:15
python.compressB64.c
def c
Definition: compressB64.py:93
jet::JetCaloCellCalculations::process
virtual std::vector< double > process(const xAOD::Jet *jet) const
Perform all tasks correspondings to the associated JetCaloCalculators on Jet jet.
Definition: JetCaloCellQualityUtils.cxx:38
jet::JetCalcQuality
Definition: JetCaloQualityUtils.h:125