#ifndef Sample_h #define Sample_h #include "TFile.h" //ROOT tools #include "TTree.h" #include "TMath.h" #include "TString.h" #include "TMatrixT.h" #include "TH1.h" #include #include #include #include #include using namespace std; #define Pi 3.14159 #define EtaMax 2.5 //Note: This may need to be updated for ATLAS specifications (EtaMax = 3.2?) #define PTMin 15.0 #define NDiv 100 #define MaxEnergy 1000.0 #define J1ETMin 35.0 #define J2ETMin 35.0 #define J3ETMin 35.0 #define J4ETMin 20.0 #define J0ETMin 150.0 #define MonojetVeto 35.0 #define CentralJet 0.8 #define METSelection 40.0 #define OVERMAXPT 100000 struct PObject //A physics object { PObject* prev; PObject* next; Int_t pID; Int_t pType; Double_t phi; Double_t eta; Double_t pt; Double_t jmas; Double_t ntrk; Double_t btag; Double_t hem; Bool_t mergeable; Bool_t isolated; }; struct FourVect { Double_t e; Double_t px; Double_t py; Double_t pz; }; struct PEvent //A physics event { PObject* head; PEvent* next; Int_t trigger1; Int_t trigger2; Int_t njet; Int_t nbjet; Int_t nelectronp; Int_t nelectronm; Int_t nmuonp; Int_t nmuonm; Int_t ntaup; Int_t ntaum; Int_t nphoton; Double_t met; Double_t h_t; Int_t sample[4]; }; /************************************************* This object is used to read an LHCO file, run it through processing and cuts, and then generate a table of MET/H_T bins of weighted events. *************************************************/ class Sample { public: TMatrixT table[4]; //Monojet, dijet, trijet, and tetrajet tables //TH1D* h_mpt[4]; //Missing p_T histogram //TH1D* h_meff[4]; //m_eff histogram //TH1D* h_pt1[4]; //histogram of p_T of leading jet //TH1D* h_pt2[4]; //histogram p_T of second leading jet Sample(); Sample(TString type0, TString name0, Double_t sigma0, Double_t k_factor0, Double_t luminosity0, Double_t metmin0, Double_t metmax0, Double_t htmin0, Double_t htmax0, Int_t metbins0, Int_t htbins0); ~Sample(); void Process(TString s); void SetType(TString); //Getters and setters TString GetType(); void SetName(TString); TString GetName(); void SetXSection(Double_t); Double_t GetXSection(); void SetKFactor(Double_t); Double_t GetKFactor(); void SetLuminosity(Double_t); Double_t GetLuminosity(); Double_t GetNumOfEvents(); Double_t GetScaleFactor(); void SetMETMin(Double_t); Double_t GetMETMin(); void SetMETMax(Double_t); Double_t GetMETMax(); void SetHTMin(Double_t); Double_t GetHTMin(); void SetHTMax(Double_t); Double_t GetHTMax(); void SetMETBins(Int_t); Int_t GetMETBins(); void SetHTBins(Int_t); Int_t GetHTBins(); Double_t GetMETBinSize(); Double_t GetHTBinSize(); private: TString input_file_name; TString output_file_name; FILE* iFile; TString type; //"background" or "signal" TString name; //e.g., "ttbar" Double_t sigma; //Cross section in fb Double_t k_factor; //K factor Double_t luminosity; //Luminosity in fb^-1 Int_t n; //Number of events Double_t scale_factor; //(K factor)*(luminosity)*(cross section)/n Double_t metmin; //Ranges for MET and H_t Double_t metmax; Double_t htmin; Double_t htmax; Int_t metbins; //Number of MET bins Int_t htbins; //Number of H_T bins Double_t metbinsize; //(metmax - metmin)/metbins Double_t htbinsize; //(htmax - htmin)/htbins Int_t monojet_hardLeptonsFailures; //Cut failure counters Int_t monojet_highJetEtaFailures; Int_t monojet_weakJetFailures; Int_t monojet_strongJetFailures; Int_t monojet_metFailures; Int_t monojet_metAndJetsAreCloseFailures; Int_t dijet_hardLeptonsFailures; Int_t dijet_highJetEtaFailures; Int_t dijet_weakJetFailures; Int_t dijet_strongJetFailures; Int_t dijet_metFailures; Int_t dijet_metAndJetsAreCloseFailures; Int_t trijet_hardLeptonsFailures; Int_t trijet_highJetEtaFailures; Int_t trijet_weakJetFailures; Int_t trijet_strongJetFailures; Int_t trijet_metFailures; Int_t trijet_metAndJetsAreCloseFailures; Int_t tetrajet_hardLeptonsFailures; Int_t tetrajet_highJetEtaFailures; Int_t tetrajet_weakJetFailures; Int_t tetrajet_sphericityFailures; Int_t tetrajet_metFailures1; Int_t tetrajet_metFailures2; Int_t tetrajet_metAndJetsAreCloseFailures; FourVect* convertTo4Vect(PObject*); void convertFrom4Vect(PObject*, FourVect*); FourVect* add2FourVect(FourVect*, FourVect*); PEvent* ReadEvent(); PEvent* CreateEvent(); Int_t OutputEvent(FILE*, PEvent*); Int_t DeleteEvent(PEvent*); Double_t dPhi(Double_t, Double_t); Double_t dR(Double_t, Double_t, Double_t, Double_t); Int_t ConvertTaus(PEvent*); Int_t FiducialJets(PEvent*); PObject* SortJets(PObject*); PObject* PtSort(PObject*, Int_t, Int_t); Int_t PrintEvent(FILE*, PObject*); Int_t CountObjects(PObject*); Int_t MonoJetTag(PEvent*); Int_t DiJetTag(PEvent*); Int_t TriJetTag(PEvent*); Int_t TetraJetTag(PEvent*); Int_t JetTag(PEvent*); Int_t MergeMuons(PEvent*); Int_t OutputPGSEvent(FILE*, PEvent*); PObject* CopyObject(PObject*); Int_t LabelMuons(PEvent*, PEvent*); Int_t Construct4JLeptonVeto(PEvent*, PObject* METJetList[]); Int_t FixList(PObject * head); Double_t CalcM_eff(PEvent*); //Note: This only works for the tetrajet case right now! Double_t CalcSph_T(PEvent*); Bool_t METAndJetsAreClose(PEvent*, Int_t); Bool_t HighJetEta(PEvent*, Int_t); Bool_t WeakJet(PEvent*, Int_t); Bool_t StrongJet(PEvent*, Int_t); //Only for monojet, dijet, and trijet cases Bool_t HardLeptons(PEvent*); Bool_t OutOfBounds(PEvent*); }; #endif