00001 #ifndef JETCALIBTOOLS_GLOBALSEQUENTIALCORRECTION_H
00002 #define JETCALIBTOOLS_GLOBALSEQUENTIALCORRECTION_H 1
00003
00004
00005
00006
00007
00008
00009 #include <TEnv.h>
00010 #include <TAxis.h>
00011 #include <TH2F.h>
00012
00013 #include "JetCalibTools/IJetCalibrationTool.h"
00014 #include "JetCalibTools/JetCalibrationToolBase.h"
00015
00016 class GlobalSequentialCorrection
00017 : virtual public ::IJetCalibrationTool,
00018 virtual public ::JetCalibrationToolBase
00019 {
00020
00021 ASG_TOOL_CLASS( GlobalSequentialCorrection, IJetCalibrationTool )
00022
00023 public:
00024
00025 typedef std::vector<TH2F*> VecTH2F;
00026 typedef std::vector<double> VecD;
00027 typedef std::vector<TString> StrV;
00028 typedef unsigned int uint;
00029
00030 GlobalSequentialCorrection();
00031 GlobalSequentialCorrection(const std::string& name);
00032 GlobalSequentialCorrection(const std::string& name, TEnv * config, TString jetAlgo, TString calibAreaTag, bool dev);
00033 virtual ~GlobalSequentialCorrection();
00034
00035 virtual StatusCode initializeTool(const std::string& name);
00036
00037 protected:
00038 virtual StatusCode calibrateImpl(xAOD::Jet& jet, JetEventInfo&) const;
00039
00040 private:
00041 double getTrackWIDTHResponse(double pT, uint etabin, double trackWIDTH) const;
00042 double getNTrkResponse(double pT, uint etabin, double nTrk) const;
00043 double getTile0Response(double pT, uint etabin, double Tile0) const;
00044 double getEM3Response(double pT, uint etabin, double EM3) const;
00045 double getChargedFractionResponse(double pT, uint etabin, double ChargedFraction) const;
00046 double getPunchThroughResponse(double E, double eta_det, int Nsegments) const;
00047
00048 double getGSCCorrection(xAOD::JetFourMom_t jetP4, double eta,
00049 double trackWIDTH, double nTrk, double Tile0, double EM3, int Nsegments, double ChargedFraction) const;
00050
00051 double getJetPropertyMax(TString jetPropName, unsigned int etabin) {
00052 if ( jetPropName.Contains("EM3") && etabin < m_EM3MaxEtaBin ) return m_respFactorsEM3[etabin]->GetYaxis()->GetXmax();
00053 else if ( jetPropName.Contains("Tile0") && etabin < m_Tile0MaxEtaBin ) return m_respFactorsTile0[etabin]->GetYaxis()->GetXmax();
00054 else if ( jetPropName.Contains("nTrk") && etabin < m_nTrkMaxEtaBin ) return m_respFactorsnTrk[etabin]->GetYaxis()->GetXmax();
00055 else if ( jetPropName.Contains("trackWIDTH") && etabin < m_trackWIDTHMaxEtaBin ) return m_respFactorstrackWIDTH[etabin]->GetYaxis()->GetXmax();
00056 else return 1;
00057 }
00058
00059 void setPunchThroughEtaBins(VecD etabins) {
00060 if (etabins.size()==0) ATH_MSG_ERROR("Please check that the punch through eta binning is properly set in your config file");
00061 m_punchThroughEtaBins=etabins;
00062 }
00063
00064 void setPunchThroughMinPt(double minPt) {
00065 if (minPt < 0) ATH_MSG_ERROR("Error determining the punch through minimum pT");
00066 m_punchThroughMinPt = minPt;
00067 }
00068
00069 private:
00070
00071 double readPtJetPropertyHisto(double pT, double jetProperty,
00072 TH2F *respFactors) const;
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 private:
00099 enum m_GSCSeq { ApplyChargedFraction = 1, ApplyTile0 = 2, ApplyEM3 = 4, ApplynTrk = 8, ApplytrackWIDTH = 16, ApplyPunchThrough = 32 };
00100
00101
00102 TEnv * m_config;
00103 TString m_jetAlgo, m_depthString, m_calibAreaTag;
00104 bool m_dev;
00105
00106
00107 VecTH2F m_respFactorsEM3, m_respFactorsnTrk, m_respFactorstrackWIDTH, m_respFactorsTile0, m_respFactorsPunchThrough, m_respFactorsChargedFraction;
00108 double m_binSize;
00109 uint m_depth, m_trackWIDTHMaxEtaBin, m_nTrkMaxEtaBin, m_Tile0MaxEtaBin, m_EM3MaxEtaBin, m_chargedFractionMaxEtaBin;
00110
00111 VecD m_punchThroughEtaBins;
00112 double m_punchThroughMinPt;
00113 bool m_turnOffTrackCorrections;
00114 bool m_PFlow;
00115 bool m_pTResponseRequirementOff;
00116 double m_turnOffStartingpT, m_turnOffEndpT;
00117
00118 };
00119
00120 #endif