////////////////////////////////////////////////////////// // This class has been automatically generated on // Mon Oct 16 14:37:30 2017 by ROOT version 6.06/01 // from TTree MCTree/MCTree // found on file: MC_DY.root ////////////////////////////////////////////////////////// #ifndef Analysis_h #define Analysis_h #include #include #include // Header file for the classes stored in the TTree if any. #include "vector" #include "vector" class Analysis { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Fixed size dimensions of array or collections stored in the TTree if any. // Declaration of leaf types Int_t run; Int_t lumi; Int_t event; Float_t weight; vector *electron_pt; vector *electron_energy; vector *electron_eta; vector *electron_phi; vector *electron_charge; vector *electron_HoverE; vector *electron_dxy; vector *electron_dR03TrackSumPt; vector *gen_electron_charge; vector *gen_electron_pt; vector *gen_electron_eta; vector *gen_electron_phi; vector *gen_electron_energy; vector *quark_pz; vector *quark_pdgId; Bool_t isDYqqOnly; // List of branches TBranch *b_run; //! TBranch *b_lumi; //! TBranch *b_event; //! TBranch *b_weight; //! TBranch *b_electron_pt; //! TBranch *b_electron_energy; //! TBranch *b_electron_eta; //! TBranch *b_electron_phi; //! TBranch *b_electron_charge; //! TBranch *b_electron_HoverE; //! TBranch *b_electron_dxy; //! TBranch *b_electron_dR03TrackSumPt; //! TBranch *b_gen_electron_charge; //! TBranch *b_gen_electron_pt; //! TBranch *b_gen_electron_eta; //! TBranch *b_gen_electron_phi; //! TBranch *b_gen_electron_energy; //! TBranch *b_quark_pz; //! TBranch *b_quark_pdgId; //! TBranch *b_isDYqqOnly; //! Analysis(TTree *tree=0); virtual ~Analysis(); virtual Int_t Cut(Long64_t entry); virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Init(TTree *tree); virtual void Loop(); virtual Bool_t Notify(); virtual void Show(Long64_t entry = -1); virtual void DrawHisto1D(TCanvas *c, TH1F *Histo, string name); virtual void Superimpose2Histos(TCanvas *c, TH1F *Histo1, TH1F *Histo2, string name, string leg1, string leg2); virtual Float_t DeltaR(float eta1, float phi1, float eta2, float phi2); }; #endif #ifdef Analysis_cxx Analysis::Analysis(TTree *tree) : fChain(0) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == 0) { #ifdef SINGLE_TREE // The following code should be used if you want this class to access // a single tree instead of a chain TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("Memory Directory"); if (!f || !f->IsOpen()) { f = new TFile("Memory Directory"); } f->GetObject("tree",tree); #else // SINGLE_TREE // The following code should be used if you want this class to access a chain // of trees. TChain * chain = new TChain("tree",""); chain->Add("MC_DY.root"); tree = chain; #endif // SINGLE_TREE } Init(tree); } Analysis::~Analysis() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t Analysis::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t Analysis::LoadTree(Long64_t entry) { // Set the environment to read one entry if (!fChain) return -5; Long64_t centry = fChain->LoadTree(entry); if (centry < 0) return centry; if (fChain->GetTreeNumber() != fCurrent) { fCurrent = fChain->GetTreeNumber(); Notify(); } return centry; } void Analysis::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses and branch // pointers of the tree will be set. // It is normally not necessary to make changes to the generated // code, but the routine can be extended by the user if needed. // Init() will be called many times when running on PROOF // (once per file to be processed). // Set object pointer electron_pt = 0; electron_energy = 0; electron_eta = 0; electron_phi = 0; electron_charge = 0; electron_HoverE = 0; electron_dxy = 0; electron_dR03TrackSumPt = 0; gen_electron_charge = 0; gen_electron_pt = 0; gen_electron_eta = 0; gen_electron_phi = 0; gen_electron_energy = 0; quark_pz = 0; quark_pdgId = 0; // Set branch addresses and branch pointers if (!tree) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("run", &run, &b_run); fChain->SetBranchAddress("lumi", &lumi, &b_lumi); fChain->SetBranchAddress("event", &event, &b_event); fChain->SetBranchAddress("weight", &weight, &b_weight); fChain->SetBranchAddress("electron_pt", &electron_pt, &b_electron_pt); fChain->SetBranchAddress("electron_energy", &electron_energy, &b_electron_energy); fChain->SetBranchAddress("electron_eta", &electron_eta, &b_electron_eta); fChain->SetBranchAddress("electron_phi", &electron_phi, &b_electron_phi); fChain->SetBranchAddress("electron_charge", &electron_charge, &b_electron_charge); fChain->SetBranchAddress("electron_HoverE", &electron_HoverE, &b_electron_HoverE); fChain->SetBranchAddress("electron_dxy", &electron_dxy, &b_electron_dxy); fChain->SetBranchAddress("electron_dR03TrackSumPt", &electron_dR03TrackSumPt, &b_electron_dR03TrackSumPt); fChain->SetBranchAddress("gen_electron_charge", &gen_electron_charge, &b_gen_electron_charge); fChain->SetBranchAddress("gen_electron_pt", &gen_electron_pt, &b_gen_electron_pt); fChain->SetBranchAddress("gen_electron_eta", &gen_electron_eta, &b_gen_electron_eta); fChain->SetBranchAddress("gen_electron_phi", &gen_electron_phi, &b_gen_electron_phi); fChain->SetBranchAddress("gen_electron_energy", &gen_electron_energy, &b_gen_electron_energy); fChain->SetBranchAddress("quark_pz", &quark_pz, &b_quark_pz); fChain->SetBranchAddress("quark_pdgId", &quark_pdgId, &b_quark_pdgId); fChain->SetBranchAddress("isDYqqOnly", &isDYqqOnly, &b_isDYqqOnly); Notify(); } Bool_t Analysis::Notify() { // The Notify() function is called when a new file is opened. This // can be either for a new TTree in a TChain or when when a new TTree // is started when using PROOF. It is normally not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. The return value is currently not used. return kTRUE; } void Analysis::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t Analysis::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef Analysis_cxx