12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef MULTREADER_CXX
- #define MULTREADER_CXX
- #include "MultReader.h"
- #include <iostream>
- MultReader::MultReader(TTree *tree) : BaseReader(tree)
- {
- }
- MultReader::~MultReader()
- {
- }
- void MultReader::LoopMultiplicity(TString outName)
- {
- if (fChain == 0) return;
- Long64_t nentries = fChain->GetEntries();
- Long64_t nbytes = 0, nb = 0;
- Int_t refMult, refMultPHENIX;
- TH1F *hMult = new TH1F("hMult","hMult",2500,0.,2500.);
- TH1F *hMultPHENIX = new TH1F("hMultPHENIX","hMultPHENIX",2500,0.,2500.);
- for (Long64_t jentry=0; jentry<nentries;jentry++)
- {
- Long64_t ientry = LoadTree(jentry);
- if (ientry < 0) break;
- if (jentry%1000 == 0)
- std::cout << "Event [" << jentry << "/"
- << nentries << "]" << std::endl;
- nb = fChain->GetEntry(jentry); nbytes += nb;
- // if (Cut(ientry) < 0) continue;
- refMult = GetMult();
- refMultPHENIX = GetMultPHENIX();
- if (refMult >= 4)hMult->Fill(refMult);
- if (refMultPHENIX > 0)hMultPHENIX->Fill(refMultPHENIX);
- }
- TFile *fo = new TFile(outName.Data(),"recreate");
- fo->cd();
- hMult->Write();
- hMultPHENIX->Write();
- fo->Close();
- }
- #endif
|