00001 #ifndef JETJVTEFFICIENCYSCALEFACTORS_H_ 00002 #define JETJVTEFFICIENCYSCALEFACTORS_H_ 00003 00004 #include "JetJvtEfficiency/IJetJvtEfficiency.h" 00005 #include "PATInterfaces/SystematicsTool.h" 00006 #include "AsgTools/AsgTool.h" 00007 #include "TRandom3.h" 00008 00009 #include <TH2.h> 00010 #include <string> 00011 00012 namespace CP { 00013 00014 enum SystApplied { 00015 NONE, 00016 JVT_EFFICIENCY_DOWN, 00017 JVT_EFFICIENCY_UP 00018 }; 00019 00020 class JetJvtEfficiency: public CP::IJetJvtEfficiency, public asg::AsgTool, public CP::SystematicsTool{ 00021 ASG_TOOL_CLASS( JetJvtEfficiency, CP::IJetJvtEfficiency) 00022 00023 public: 00024 JetJvtEfficiency( const std::string& name); 00025 00026 virtual StatusCode initialize(); 00027 virtual StatusCode finalize(); 00028 00029 StatusCode histInitialize(); 00030 00031 virtual CorrectionCode getEfficiencyScaleFactor(const xAOD::Jet& jet,float& sf); 00032 virtual CorrectionCode getInefficiencyScaleFactor(const xAOD::Jet& jet,float& sf); 00033 virtual CorrectionCode applyEfficiencyScaleFactor(const xAOD::Jet& jet); 00034 virtual CorrectionCode applyInefficiencyScaleFactor(const xAOD::Jet& jet); 00035 virtual CorrectionCode applyAllEfficiencyScaleFactor(const xAOD::IParticleContainer *jets,float& sf); 00036 virtual CorrectionCode applyRandomDropping( const xAOD::Jet& jet ); 00037 virtual CorrectionCode applyAllRandomDropping( const xAOD::IParticleContainer *jets); 00038 00039 virtual bool passesJvtCut(const xAOD::Jet& jet); 00040 virtual bool isInRange(const xAOD::Jet& jet); 00041 00042 bool isAffectedBySystematic(const CP::SystematicVariation& var) const{return CP::SystematicsTool::isAffectedBySystematic(var);} 00043 CP::SystematicSet affectingSystematics() const {return CP::SystematicsTool::affectingSystematics();} 00044 CP::SystematicSet recommendedSystematics() const {return CP::SystematicsTool::recommendedSystematics();} 00045 CP::SystematicCode applySystematicVariation(const CP::SystematicSet& set) {return CP::SystematicsTool::applySystematicVariation(set);} 00046 CP::SystematicCode sysApplySystematicVariation(const CP::SystematicSet&); 00047 00048 float getJvtThresh() const {return m_jvtCut;} 00049 float getUserPtMax() const {return m_maxPtForJvt;} 00050 void setRandomSeed(int seed); 00051 StatusCode tagTruth(const xAOD::IParticleContainer *jets,const xAOD::IParticleContainer *truthJets); 00052 00053 private: 00054 00055 JetJvtEfficiency(); 00056 00057 SystApplied m_appliedSystEnum; 00058 00059 std::string m_wp; 00060 std::string m_file; 00061 SG::AuxElement::Decorator< float >* m_sfDec; 00062 SG::AuxElement::Decorator< char >* m_dropDec; 00063 TH2 *h_JvtHist; 00064 TH2 *h_EffHist; 00065 std::string m_sf_decoration_name; 00066 std::string m_drop_decoration_name; 00067 float m_jvtCut; 00068 std::string m_jetJvtMomentName; 00069 std::string m_jetfJvtMomentName; 00070 std::string m_jetEtaName; 00071 float m_maxPtForJvt; 00072 TRandom3 m_rand; 00073 std::string m_truthLabel; 00074 bool m_dofJVT; 00075 bool m_doTruthRequirement; 00076 std::string m_ORdec; 00077 bool m_doOR; 00078 }; 00079 00080 } /* namespace CP */ 00081 00082 #endif /* JETJVTEFFICIENCYSCALEFACTORS_H_ */