Go to the documentation of this file.00001 #ifndef PFCLUSTERCALIBRATION_H_
00002 #define PFCLUSTERCALIBRATION_H_
00003
00004 #include "RecoParticleFlow/PFClusterTools/interface/DetectorElementType.h"
00005 #include "DataFormats/ParticleFlowReco/interface/Calibratable.h"
00006 #include "DataFormats/ParticleFlowReco/interface/CalibrationResultWrapper.h"
00007
00008
00009 #include <vector>
00010 #include <string>
00011 #include <map>
00012 #include <ostream>
00013 #include <iosfwd>
00014
00015 class TF1;
00016 class TTree;
00017
00018 namespace pftools {
00019
00020 class PFClusterCalibration;
00021 std::ostream& operator<<(std::ostream& s, const PFClusterCalibration& cc);
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class PFClusterCalibration {
00041 public:
00042
00043
00044 PFClusterCalibration();
00045
00046
00047
00048 virtual ~PFClusterCalibration();
00049
00050
00051 double getCalibratedEcalEnergy(const double& ecalE, const double& hcalE,
00052 const double& eta, const double& phi) const;
00053
00054
00055 double getCalibratedHcalEnergy(const double& ecalE, const double& hcalE,
00056 const double& eta, const double& phi) const;
00057
00058
00059
00060
00061
00062
00063
00064
00065 double getCalibratedEnergy(const double& ecalE, const double& hcalE,
00066 const double& eta, const double& phi) const;
00067
00068 void getCalibratedEnergyEmbedAInHcal(double& ecalE,
00069 double& hcalE, const double& eta, const double& phi) const;
00070
00071
00072 void calibrate(Calibratable& c);
00073
00074
00075 void getCalibrationResultWrapper(const Calibratable& c,
00076 CalibrationResultWrapper& crw);
00077
00078
00079 void calibrateTree(TTree* tree);
00080
00081
00082
00083 void setCorrections(const double& lowEP0, const double& lowEP1,
00084 const double& globalP0, const double& globalP1);
00085
00086
00087 void setAllowNegativeEnergy(const bool& allowIt) {
00088 allowNegativeEnergy_ = allowIt;
00089 }
00090
00091
00092
00093 void setDoCorrection(const int& doCorrection) {
00094 doCorrection_ = doCorrection;
00095 }
00096
00097 void setDoEtaCorrection(const int doEtaCorrection) {
00098 doEtaCorrection_ = doEtaCorrection;
00099 }
00100
00101
00102 void setEcalHcalEnergyCuts(const double& ecalCut, const double& hcalCut) {
00103
00104 ecalOnlyDiv_ = ecalCut;
00105 hcalOnlyDiv_ = hcalCut;
00106 }
00107
00108
00109 void setBarrelBoundary(const double& eta) {
00110 barrelEndcapEtaDiv_ = eta;
00111 }
00112
00113 void setMaxEToCorrect(double maxE) {
00114 maxEToCorrect_ = maxE;
00115 }
00116
00117
00118 void setEvolutionParameters(const std::string& sector,
00119 std::vector<double> params);
00120
00121 void setEtaCorrectionParameters(std::vector<double> params);
00122
00123
00124
00125
00126
00127 std::vector<std::string>* getKnownSectorNames() {
00128 return &names_;
00129 }
00130
00131
00132
00133 friend std::ostream& pftools::operator<<(std::ostream& s, const PFClusterCalibration& cc);
00134
00135 private:
00136
00137 void init();
00138
00139
00140 double barrelEndcapEtaDiv_;
00141
00142
00143 double ecalOnlyDiv_;
00144 double hcalOnlyDiv_;
00145
00146 int doCorrection_;
00147 int allowNegativeEnergy_;
00148 int doEtaCorrection_;
00149 double maxEToCorrect_;
00150
00151 double correctionLowLimit_;
00152 double globalP0_;
00153 double globalP1_;
00154 double lowEP0_;
00155 double lowEP1_;
00156
00157
00158 TF1* correction_;
00159
00160 TF1* etaCorrection_;
00161
00162 std::map<std::string, TF1> namesAndFunctions_;
00163 std::vector<std::string> names_;
00164
00165 };
00166 }
00167
00168 #endif