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  //added by Bhumika on 2 august 2018
111  std::unique_ptr<TF1> fcEtaBarrelEH;
112  std::unique_ptr<TF1> fcEtaEndcapEH;
113  std::unique_ptr<TF1> fdEtaEndcapEH;
114  std::unique_ptr<TF1> fcEtaBarrelH;
115  std::unique_ptr<TF1> fcEtaEndcapH;
116  std::unique_ptr<TF1> fdEtaEndcapH;
117 
118  private:
119 
120  double minimum(double a,double b) const;
121  double dCrackPhi(double phi, double eta) const;
122  double CorrPhi(double phi, double eta) const;
123  double CorrEta(double eta) const;
124  double CorrBarrel(double E, double eta) const;
125  double Alpha(double eta) const;
126  double Beta(double E, double eta) const;
127  double Gamma(double etaEcal) const;
128  double EcorrBarrel(double E, double eta, double phi, bool crackCorrection=true) const;
129  double EcorrZoneBeforePS(double E, double eta) const;
130  double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal) const;
131  double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal,double&, double&) const;
132  double EcorrPS_ePSNil(double eEcal,double eta) const;
133  double EcorrZoneAfterPS(double E, double eta) const;
134  double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,bool crackCorrection=true) const;
135  double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,double&,double&,bool crackCorrection=true) const;
136 
137  // The calibration functions
138  double aBarrel(double x) const;
139  double bBarrel(double x) const;
140  double cBarrel(double x) const;
141  double aEtaBarrelEH(double x) const;
142  double bEtaBarrelEH(double x) const;
143  double aEtaBarrelH(double x) const;
144  double bEtaBarrelH(double x) const;
145  double aEndcap(double x) const;
146  double bEndcap(double x) const;
147  double cEndcap(double x) const;
148  double aEtaEndcapEH(double x) const;
149  double bEtaEndcapEH(double x) const;
150  double aEtaEndcapH(double x) const;
151  double bEtaEndcapH(double x) const;
152  //added by Bhumika on 3 august 2018
153  double cEtaBarrelEH(double x) const;
154  double cEtaEndcapEH(double x) const;
155  double dEtaEndcapEH(double x) const;
156  double cEtaBarrelH(double x) const;
157  double cEtaEndcapH(double x) const;
158  double dEtaEndcapH(double x) const;
159 
160 
161  // Threshold correction (offset)
162  double threshE, threshH;
163 
164 };
165 
166 #endif
167 
168 
std::unique_ptr< TF1 > faEtaBarrelH
std::unique_ptr< TF1 > fcEtaEndcapEH
const PerformancePayloadFromTFormula * pfCalibrations
double aEtaEndcapEH(double x) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::unique_ptr< TF1 > faEtaBarrelEH
double bBarrel(double x) const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
double cEtaEndcapEH(double x) const
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 cEtaBarrelH(double x) const
double Alpha(double eta) const
void energyEmHad(double t, double &e, double &h, double eta, double phi) const
double cEtaBarrelEH(double x) const
std::unique_ptr< TF1 > fcEtaBarrelEH
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 dEtaEndcapEH(double x) const
std::unique_ptr< TF1 > fcEtaBarrelH
double bEtaEndcapEH(double x) const
double EcorrZoneAfterPS(double E, double eta) const
double bEtaBarrelH(double x) const
double dEtaEndcapH(double x) const
std::unique_ptr< TF1 > fbEtaBarrelH
std::unique_ptr< TF1 > fdEtaEndcapEH
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 > fcEtaEndcapH
std::unique_ptr< TF1 > fbEndcap
std::unique_ptr< TF1 > fcBarrel
void setCalibrationFunctions(const PerformancePayloadFromTFormula *thePFCal)
std::unique_ptr< TF1 > fdEtaEndcapH
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 cEtaEndcapH(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