SusyNtuple
|
00001 #ifndef SusyNtuple_SusyNtTruthAna_h 00002 #define SusyNtuple_SusyNtTruthAna_h 00003 00004 #include "TSelector.h" 00005 #include "TTree.h" 00006 #include "TStopwatch.h" 00007 00008 #include "SusyNtuple/SusyNtObject.h" 00009 00010 #include <fstream> 00011 #include <map> 00012 #include <set> 00013 00015 class SusyNtTruthAna : public TSelector 00016 { 00017 00018 public: 00019 00021 SusyNtTruthAna(); 00022 virtual ~SusyNtTruthAna(){}; 00023 00025 Susy::SusyNtObject nt; 00026 00027 // 00028 // TSelector methods 00029 // 00030 00032 virtual void Init(TTree *tree); 00034 virtual void Begin(TTree *tree); 00036 virtual Bool_t Notify() { return kTRUE; } 00038 virtual void Terminate(); 00040 virtual Int_t Version() const { 00041 return 2; 00042 } 00043 00045 virtual Bool_t Process(Long64_t entry); 00046 00049 virtual Int_t GetEntry(Long64_t e, Int_t getall = 0) { 00050 m_entry=e; 00051 return kTRUE; 00052 } 00053 00054 // Object selection 00055 void clearTruthObjects(); 00056 void selectTruthObjects(); 00057 00058 // 00059 // Methods to grab objects 00060 // 00061 TruthParticleVector getPreTruthLeptons (Susy::SusyNtObject* susyNt, int pdgId); 00062 TruthJetVector getPreTruthJets (Susy::SusyNtObject* susyNt ); 00063 TruthParticleVector getSignalTruthLeptons(TruthParticleVector& truthLeptons ); 00064 TruthJetVector getSignalTruthJets (TruthJetVector& truthJets ); 00065 00066 // Get Baseline Objects 00067 void getBaselineTruthObjects(Susy::SusyNtObject* susyNt, 00068 TruthParticleVector& truthElectrons, 00069 TruthParticleVector& truthMuons, 00070 TruthParticleVector& truthTaus, 00071 TruthJetVector& truthJets); 00072 // Get Signal Objects 00073 void getSignalTruthObjects (TruthParticleVector& truthBaseElectrons, 00074 TruthParticleVector& truthBaseMuons, 00075 TruthParticleVector& truthBaseTaus, 00076 TruthJetVector& truthBaseJets, 00077 TruthParticleVector& truthSignalElectrons, 00078 TruthParticleVector& truthSignalMuons, 00079 TruthParticleVector& truthSignalTaus, 00080 TruthJetVector& truthSignalJets); 00081 00082 // Get Met 00083 Susy::TruthMet* getTruthMet(Susy::SusyNtObject* susyNt); 00084 00085 // Misc 00086 void removeSFOSPair (TruthParticleVector& leptons, 00087 float MllCut = 20.); // 20 GeV 00088 00089 // Event and object dumps 00090 void dumpEvent(); 00091 void dumpBaselineTruthObjects(); 00092 void dumpSignalTruthObjects(); 00093 00094 // Set-Get options 00095 void setDebug(bool flag) { m_dbg = flag; } 00096 00097 // Dump timer 00098 void dumpTimer(); 00099 00100 // Access tree 00101 TTree* getTree() { return m_tree; } 00102 00103 ClassDef(SusyNtTruthAna, 1); 00104 00105 protected: 00106 00107 // 00108 // General 00109 // 00110 00111 TTree* m_tree; 00112 00113 Long64_t m_entry; 00114 Long64_t m_chainEntry; 00115 00116 int m_dbg; 00117 00118 // 00119 // Object collections 00120 // 00121 TruthParticleVector m_baseTruthElectrons; 00122 TruthParticleVector m_baseTruthMuons; 00123 TruthParticleVector m_baseTruthTaus; 00124 TruthJetVector m_baseTruthJets; 00125 00126 TruthParticleVector m_signalTruthElectrons; 00127 TruthParticleVector m_signalTruthMuons; 00128 TruthParticleVector m_signalTruthTaus; 00129 TruthJetVector m_signalTruthJets; 00130 const Susy::TruthMet* m_truthMet; 00131 00133 TStopwatch m_timer; 00134 }; 00135 00136 #endif