#define bat_analysis_cxx // The class definition in bat_analysis.h has been generated automatically // by the ROOT utility TTree::MakeSelector(). This class is derived // from the ROOT class TSelector. For more information on the TSelector // framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual. // The following methods are defined in this file: // Begin(): called every time a loop on the tree starts, // a convenient place to create your histograms. // SlaveBegin(): called after Begin(), when on PROOF called only on the // slave servers. // Process(): called for each event, in this function you decide what // to read and fill your histograms. // SlaveTerminate: called at the end of the loop on the tree, when on PROOF // called only on the slave servers. // Terminate(): called at the end of the loop on the tree, // a convenient place to draw/fit your histograms. // // To use this file, try the following session on your Tree T: // // root> T->Process("bat_analysis.C") // root> T->Process("bat_analysis.C","some options") // root> T->Process("bat_analysis.C+") // #include "bat_analysis.h" #include #include //***********************DEFINITION SECTION************************** TH1* bat_q1xHist = NULL; void bat_analysis::Begin(TTree * /*tree*/) { TString option = GetOption(); //***************INITIALIZATION SECTION******************** bat_q1xHist = new TH1D("bat_q1x", "Histogram of btq1_x", 100, 0, 20); } void bat_analysis::SlaveBegin(TTree * /*tree*/) { TString option = GetOption(); } Bool_t bat_analysis::Process(Long64_t entry) { // Use fStatus to set the return value of TTree::Process(). // The return value is currently not used. fReader.SetLocalEntry(entry); //****************LOOP SECTION HERE***************** GetEntry(entry); bat_q1xHist->Fill(bat_q1x[entry]); return kTRUE; } void bat_analysis::SlaveTerminate() { } void bat_analysis::Terminate() { //***************wRAP UP SECTION********************* bat_q1xHist->Draw(); }