/afs/hep.man.ac.uk/u/markowen/ATLAS/SFrameProof/2011EPS/topUtils/topUtils/TopObjectSel.h

00001 #ifndef TOPUTILS_TOPOBJECT_SEL_H__
00002 #define TOPUTILS_TOPOBJECT_SEL_H__
00003 
00004 // stl includes
00005 #include <vector>
00006 
00007 // sframe includes
00008 #include "core/include/SError.h"
00009 #include "plug-ins/include/SToolBase.h"
00010 
00011 // use the tool holding the ntuple objects
00012 #include "manTreeSFrameBase/include/MEventTool.h"
00013 
00014 // manTree includes
00015 #include "manTree/MElectron.h"
00016 #include "manTree/MMuon.h"
00017 #include "manTree/MJet.h"
00018 
00019 // root includes
00020 #include "TRandom3.h"
00021 
00022 // fwd declarations
00023 class MultijetJESUncertaintyProvider;
00024 class EnergyRescaler;
00025 class SmearingClass;
00026 class JERProvider;
00027 namespace Analysis {
00028   class CalibrationDataInterfaceROOT;
00029 }
00030 
00031 namespace Root{
00032   class TPileupReweighting;
00033 }
00034 class BTagRandomiser;
00035 class JetEfficiencyEstimator;
00036 class egammaOQ;
00037 class MET_Cleaning_Utils;
00038 
00042 class TopObjectSel : public SToolBase {
00043 
00044  public:
00045 
00047   TopObjectSel(SCycleBase* parent, const std::string datapileupfile="PileupMu/ilumicalc_histograms_None_178044-183347.root");
00048 
00050   virtual ~TopObjectSel();
00051 
00053   bool doMuonElectronJetObjectSelection(MEventTool* event);
00054 
00056   void SetMuonSmear(int flag);
00057 
00059   void SetMuonScale(const int flag);
00060 
00062   void UseJESUncertainties(const int flag);
00063 
00065   void SetSumJets(unsigned int flag);
00066 
00068   void UseJERSmearing(const int flag);
00069   
00071   bool hasElectronMuonTrkOverlap(const std::vector<const manchester::MMuon*>* muons, const std::vector<const manchester::MElectron*>* electrons);
00072 
00074   bool hasElectronMuonTrkOverlap(const manchester::MMuon& muon, const manchester::MElectron &em);
00075   
00077   inline void sortSelectedObjectsByPt(const bool flag) { m_sortByPt = flag; }
00078 
00080   void usingData(bool flag);
00081 
00083   bool hasBadJet(const MEventTool* event) const;
00084 
00086   bool hasBadJet(const std::vector<const manchester::MJet*>* jets) const;
00087 
00089   static bool isLooseBadJet(const manchester::MJet& jet);
00090 
00092   void setElectronEnergyCorrection(const int& sw);
00093 
00095   void setElectronEnergySmearing(const int& sw);
00096 
00097   double getPileUpWeight(double mu);
00098 
00100   const Analysis::CalibrationDataInterfaceROOT* GetSV0BTagSFTool() const {return m_sv0_calibTool;}
00101 
00103   void SetSV0RandomMode(const int sw);
00104 
00106   void dropJetsUsingEffEstimator(MEventTool* event);
00107   
00109   void SetJetEffDroppingMode(const int sw) ;
00110 
00112   void SetFracDataLArProb(const double frac);
00113 
00115   inline bool SimulatingLArProblems() const {return m_simulate_lar_problems;}
00116 
00118   inline const egammaOQ* EgammaOQTool() const {return m_egammaOQ;}
00119 
00121   bool hasJetinLArHole(MEventTool* event);
00122 
00123  protected:
00124 
00126   void varyJES(MEventTool* event);
00127 
00129   void doJER(MEventTool* event);
00131   void doJER(manchester::MJet& jet);
00132 
00133   //apply muonsmear
00134 
00135   void doMuonSmear(std::vector<manchester::MMuon>* muons, MEventTool* event);
00137   void correctElectrons(MEventTool* event);
00138 
00139   // Cuts
00140   double m_muonPtCut;
00141   double m_muonPt03ConeCut;
00142   double m_muonEt03ConeCut;
00143   double m_jetPtCut;
00144   double m_jetLowPtCut;
00145   double m_emPtCut;
00146   double m_emEtCone20C1;
00147   double m_emEtCone20C2;
00148   double m_jvfCut;
00149   double m_sv0Cut;
00150 
00152   SmearingClass* m_mcp_muonsmear;
00154   std::string m_muonsmear_option;
00156   bool m_apply_muonsmear;
00158   int m_muonscale_mode;
00159   
00160   //Tool to caluculate pileup
00161   Root::TPileupReweighting* m_tPileUp;
00162 
00164   bool m_realData;
00165 
00167   MultijetJESUncertaintyProvider* m_JES_uncertainty_tool;
00169   int m_JES_uncertainty_flag;
00170 
00172   bool m_create_sumjets;
00173 
00174   //Check that smearing has been done
00175   bool smeared;
00176 
00177 
00178   EnergyRescaler* m_egamma_ERescaler;
00179 
00181   int m_ERescaler_mode; // <0 = off, 0 = default, 1 = +1 sigma, 2 = -1 sigma
00182 
00184   int m_EMSmear_mode; // <0 = off, 0 = default, 1 = +1 sigma, 2 = -1 sigma
00185 
00187   bool m_sortByPt;
00188 
00190   Analysis::CalibrationDataInterfaceROOT* m_sv0_calibTool;
00191 
00193   BTagRandomiser* m_sv0_randtool;
00194 
00196   int m_sv0_rand_flag;
00197 
00199   JERProvider* m_JER_tool;
00201   int m_JER_flag;
00203   TRandom3 m_rand_JER; 
00204 
00206   JetEfficiencyEstimator* m_jeteff_tool;
00207   
00209   int m_jeteff_flag;
00210 
00212   egammaOQ* m_egammaOQ;
00214   TRandom3 m_rand_lar;
00216   double m_frac_lar_problems;
00218   bool m_simulate_lar_problems;
00219 
00221   MET_Cleaning_Utils* m_met_clean_utils;
00222 
00223 };//TopObjectSel
00224 
00225 
00226 #endif // TOPUTILS_TOPOBJECT_SEL_H__

Generated on Thu Jun 30 11:40:04 2011 for manTreeSFrame by  doxygen 1.4.7