SusyNtuple
|
00001 #ifndef SusyAna_Susy3LepCutflow_h 00002 #define SusyAna_Susy3LepCutflow_h 00003 00004 00005 // Root Packages 00006 #include "TTree.h" 00007 00008 // Susy Common 00009 #include "SusyNtuple/SusyNtAna.h" 00010 #include "SusyNtuple/SusyNtTools.h" 00011 00012 #include <fstream> 00013 00015 00020 class Susy3LepCutflow : public SusyNtAna 00021 { 00022 00023 public: 00024 00025 Susy3LepCutflow(); 00026 virtual ~Susy3LepCutflow(){}; 00027 00028 // Output Text File 00029 std::ofstream out; 00030 00031 // Init is called when TTree (or TChain) is attached 00032 virtual void Init(TTree* tree); 00033 // Begin is called before looping on entries 00034 virtual void Begin(TTree* tree); 00035 // Terminate is called after looping is finished 00036 virtual void Terminate(); 00037 00038 // Main event loop function 00039 virtual Bool_t Process(Long64_t entry); 00040 00041 // Book histograms 00042 void bookHistos(); 00043 00044 // Event cleaning cuts 00045 bool passEventCleaning(int cutflags, const MuonVector& preMuons, 00046 const MuonVector& baseMuons, const JetVector& baseJets); 00047 // Full event selection. Specify which leptons to use. 00048 bool selectEvent(const LeptonVector& leptons, const TauVector& taus, 00049 const JetVector& jets, const Susy::Met* met); 00050 00051 // Fill histograms 00052 void fillHistos(const LeptonVector& leptons, const TauVector& taus, 00053 const JetVector& jets, const Susy::Met* met, float weight); 00054 00055 // Finalize histograms 00056 void finalizeHistos(); 00057 00058 // Cut methods 00059 // bool passFCal(); 00060 bool passNLepCut(const LeptonVector& leptons); 00061 bool passNTauCut(const TauVector& taus); 00062 bool passTrigger(const LeptonVector& leptons); 00063 bool passSFOSCut(const LeptonVector& leptons); 00064 bool passMetCut(const Susy::Met* met); 00065 bool passZCut(const LeptonVector& leptons); 00066 bool passBJetCut(); 00067 bool passMtCut(const LeptonVector& leptons, const Susy::Met* met); 00068 00069 // Event weighting 00070 float getLeptonSF(const LeptonVector& leptons); 00071 float getTauSF(const TauVector& taus); 00072 00073 // Dump cutflow - if derived class uses different cut ordering, 00074 // override this method 00075 virtual void dumpEventCounters(); 00076 00077 // Selection region 00078 void setSelection(std::string s) { m_sel = s; } 00079 00080 // debug check 00081 bool debugEvent(); 00082 00083 00084 ClassDef(Susy3LepCutflow, 1); 00085 00086 protected: 00087 00088 std::string m_sel; // event selection string 00089 00090 00091 // Cut variables 00092 uint m_nBaseLepMin; // min base leptons 00093 uint m_nBaseLepMax; // max base leptons 00094 uint m_nLepMin; // min leptons 00095 uint m_nLepMax; // max leptons 00096 uint m_nTauMin; // min taus 00097 uint m_nTauMax; // max taus 00098 float m_baseLepMinDR; // min dR between base leptons 00099 bool m_selectSFOS; // switch to select SFOS pairs 00100 bool m_vetoSFOS; // switch to veto SFOS pairs 00101 bool m_selectZ; // switch to select Zs 00102 bool m_vetoZ; // switch to veto Zs 00103 bool m_selectB; // switch to select b-tagged jets 00104 bool m_vetoB; // switch to veto b-tagged jets 00105 double m_metMin; // min MET cut 00106 double m_mtMin; // minimum Mt cut 00107 00108 bool m_writeOut; // switch to control output dump 00109 00110 // Event counters 00111 uint n_readin; 00112 uint n_pass_grl; 00113 uint n_pass_lar; 00114 uint n_pass_tile; 00115 uint n_pass_ttc; 00116 uint n_pass_badMuon; 00117 uint n_pass_badJet; 00118 uint n_pass_goodVtx; 00119 uint n_pass_cosmic; 00120 uint n_pass_nLep; 00121 uint n_pass_nTau; 00122 uint n_pass_trig; 00123 uint n_pass_sfos; 00124 uint n_pass_z; 00125 uint n_pass_met; 00126 uint n_pass_bJet; 00127 uint n_pass_mt; 00128 00129 // Final estimate weighted to full lumi 00130 float n_evt_tot; 00131 }; 00132 00133 #endif