#define histAnalysis_cxx #include "histAnalysis.h" #include #include #include #include #include "TLorentzVector.h" //..Histogram declarations TH1F *hnJpsi, *hmassJpsi, *hdtype; TFile *fHistFile; void histAnalysis::Begin(TTree *tree) { TString option = GetOption(); //..Output file for histograms fHistFile = new TFile("histAnalysis.root","RECREATE"); //..Histogram definitions hnJpsi = new TH1F("hnJpsi", "Number of Jpsi", 20, -0.5, 19.5); hmassJpsi = new TH1F("hmassJpsi", "Raw Jpsi Mass", 60, 2.9, 3.3); hdtype = new TH1F("hdtype", "Event Type", 10, -1.5, 8.5); } void histAnalysis::SlaveBegin(TTree *tree) { Init(tree); TString option = GetOption(); } Bool_t histAnalysis::Process(Long64_t entry) { //..Just read the full event fChain->GetTree()->GetEntry(entry); //..Categorize the event TLorentzVector mom4Ups(eePx, eePy, eePz, eeE); Float_t sqrts = mom4Ups.M(); Int_t dtype = histAnalysis::CheckMC(mcLund, mothIdx, dauLen, dauIdx, mcLen, sqrts); hdtype->Fill(dtype); //..Fill some simple histograms hnJpsi->Fill(nJpsi); for(Int_t i=0; iFill(JpsiUncMass[i]); } return kTRUE; } void histAnalysis::SlaveTerminate() { } void histAnalysis::Terminate() { //..Write out histograms to file fHistFile->cd(); fHistFile->Write(); fHistFile->Close(); cout << "histograms written to histAnalysis.root" << endl; } //----------------------------------------------------------------------------- #include "CheckMC.C"