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