CMS 3D CMS Logo

PFEnergyCalibration.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFClusterTools_PFEnergyCalibration_h
2 #define RecoParticleFlow_PFClusterTools_PFEnergyCalibration_h
3 
6 
8 
9 class TF1;
10 
11 // -*- C++ -*-
12 //
13 // Package: PFClusterTools
14 // Class: PFEnergyCalibration
15 //
31 //
32 // Original Author: Christian Veelken
33 // Created: Tue Aug 8 16:26:18 CDT 2006
34 //
35 //
36 
37 #include <iostream>
38 
39 //#include "FWCore/ParameterSet/interface/ParameterSet.h"
40 
42 {
43  public:
45 
47 
48  // ecal calibration for photons
49  double energyEm(const reco::PFCluster& clusterEcal,
50  std::vector<double> &EclustersPS1,
51  std::vector<double> &EclustersPS2,
52  bool crackCorrection = true) const;
53  double energyEm(const reco::PFCluster& clusterEcal,
54  double ePS1, double ePS2,
55  bool crackCorrection = true) const;
56 
57  double energyEm(const reco::PFCluster& clusterEcal,
58  std::vector<double> &EclustersPS1,
59  std::vector<double> &EclustersPS2,
60  double &ps1,double&ps2,
61  bool crackCorrection=true) const;
62  double energyEm(const reco::PFCluster& clusterEcal,
63  double ePS1, double ePS2,
64  double &ps1,double&ps2,
65  bool crackCorrection=true) const;
66 
67  // ECAL+HCAL (abc) calibration, with E and eta dependent coefficients, for hadrons
68  void energyEmHad(double t, double& e, double&h, double eta, double phi) const;
69 
70  // Initialize default E- and eta-dependent coefficient functional form
72 
73  // Set the run-dependent calibration functions from the global tag
75  pfCalibrations = thePFCal;
76  }
77 
79  esEEInterCalib_ = esEEInterCalib;
80  }
81 
82 
83  friend std::ostream& operator<<(std::ostream& out,
84  const PFEnergyCalibration& calib);
85 
86  protected:
87 
88  // Calibration functions from global tag
91 
92  // Barrel calibration (eta 0.00 -> 1.48)
93  std::unique_ptr<TF1> faBarrel;
94  std::unique_ptr<TF1> fbBarrel;
95  std::unique_ptr<TF1> fcBarrel;
96  std::unique_ptr<TF1> faEtaBarrelEH;
97  std::unique_ptr<TF1> fbEtaBarrelEH;
98  std::unique_ptr<TF1> faEtaBarrelH;
99  std::unique_ptr<TF1> fbEtaBarrelH;
100 
101  // Endcap calibration (eta 1.48 -> 3.xx)
102  std::unique_ptr<TF1> faEndcap;
103  std::unique_ptr<TF1> fbEndcap;
104  std::unique_ptr<TF1> fcEndcap;
105  std::unique_ptr<TF1> faEtaEndcapEH;
106  std::unique_ptr<TF1> fbEtaEndcapEH;
107  std::unique_ptr<TF1> faEtaEndcapH;
108  std::unique_ptr<TF1> fbEtaEndcapH;
109 
110  private:
111 
112  double minimum(double a,double b) const;
113  double dCrackPhi(double phi, double eta) const;
114  double CorrPhi(double phi, double eta) const;
115  double CorrEta(double eta) const;
116  double CorrBarrel(double E, double eta) const;
117  double Alpha(double eta) const;
118  double Beta(double E, double eta) const;
119  double Gamma(double etaEcal) const;
120  double EcorrBarrel(double E, double eta, double phi, bool crackCorrection=true) const;
121  double EcorrZoneBeforePS(double E, double eta) const;
122  double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal) const;
123  double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal,double&, double&) const;
124  double EcorrPS_ePSNil(double eEcal,double eta) const;
125  double EcorrZoneAfterPS(double E, double eta) const;
126  double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,bool crackCorrection=true) const;
127  double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,double&,double&,bool crackCorrection=true) const;
128 
129  // The calibration functions
130  double aBarrel(double x) const;
131  double bBarrel(double x) const;
132  double cBarrel(double x) const;
133  double aEtaBarrelEH(double x) const;
134  double bEtaBarrelEH(double x) const;
135  double aEtaBarrelH(double x) const;
136  double bEtaBarrelH(double x) const;
137  double aEndcap(double x) const;
138  double bEndcap(double x) const;
139  double cEndcap(double x) const;
140  double aEtaEndcapEH(double x) const;
141  double bEtaEndcapEH(double x) const;
142  double aEtaEndcapH(double x) const;
143  double bEtaEndcapH(double x) const;
144 
145  // Threshold correction (offset)
146  double threshE, threshH;
147 
148 };
149 
150 #endif
151 
152 
std::unique_ptr< TF1 > faEtaBarrelH
const PerformancePayloadFromTFormula * pfCalibrations
double aEtaEndcapEH(double x) const
std::unique_ptr< TF1 > faEtaBarrelEH
double bBarrel(double x) const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
double aEtaBarrelEH(double x) const
double aEndcap(double x) const
double bEndcap(double x) const
const ESEEIntercalibConstants * esEEInterCalib_
double bEtaEndcapH(double x) const
double Ecorr(double eEcal, double ePS1, double ePS2, double eta, double phi, bool crackCorrection=true) const
void initAlphaGamma_ESplanes_fromDB(const ESEEIntercalibConstants *esEEInterCalib)
std::unique_ptr< TF1 > fbEtaBarrelEH
double aEtaBarrelH(double x) const
double EcorrZoneBeforePS(double E, double eta) const
double Alpha(double eta) const
void energyEmHad(double t, double &e, double &h, double eta, double phi) const
double bEtaBarrelEH(double x) const
std::unique_ptr< TF1 > fbBarrel
std::unique_ptr< TF1 > faEtaEndcapEH
friend std::ostream & operator<<(std::ostream &out, const PFEnergyCalibration &calib)
double cEndcap(double x) const
double Beta(double E, double eta) const
std::unique_ptr< TF1 > faBarrel
std::unique_ptr< TF1 > faEndcap
double bEtaEndcapEH(double x) const
double EcorrZoneAfterPS(double E, double eta) const
double bEtaBarrelH(double x) const
std::unique_ptr< TF1 > fbEtaBarrelH
double b
Definition: hdecay.h:120
std::unique_ptr< TF1 > faEtaEndcapH
double CorrBarrel(double E, double eta) const
double Gamma(double etaEcal) const
double energyEm(const reco::PFCluster &clusterEcal, std::vector< double > &EclustersPS1, std::vector< double > &EclustersPS2, bool crackCorrection=true) const
double dCrackPhi(double phi, double eta) const
double a
Definition: hdecay.h:121
std::unique_ptr< TF1 > fbEndcap
std::unique_ptr< TF1 > fcBarrel
void setCalibrationFunctions(const PerformancePayloadFromTFormula *thePFCal)
double CorrEta(double eta) const
double aEtaEndcapH(double x) const
double aBarrel(double x) const
double CorrPhi(double phi, double eta) const
double EcorrPS_ePSNil(double eEcal, double eta) const
std::unique_ptr< TF1 > fbEtaEndcapEH
double cBarrel(double x) const
double EcorrBarrel(double E, double eta, double phi, bool crackCorrection=true) const
std::unique_ptr< TF1 > fcEndcap
std::unique_ptr< TF1 > fbEtaEndcapH
double EcorrPS(double eEcal, double ePS1, double ePS2, double etaEcal) const
double minimum(double a, double b) const