// #include "TROOT.h" // #include "TSystem.h" // #include "TStyle.h" // #include "TCanvas.h" // #include "TPad.h" // #include "TH1.h" // #include "TH2.h" // #include "TF1.h" // #include "TFile.h" // #include "TTree.h" // #include "TClonesArray.h" // #include "TVector3.h" // #include "TMath.h" // #include "TChain.h" // #include // #include // #include "prt/PrtHit.h" // #include "prt/PrtEvent.h" void drawMult(){ const Int_t NRGBs = 5; const Int_t NCont = 255; Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 }; Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 }; Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 }; Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 }; TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); gStyle->SetNumberContours(NCont); gSystem->Load("../build/libprtlib.so"); //gStyle->SetOptStat(0); Int_t referenceTime; Int_t referenceChannel; TH2F *hYield = new TH2F("photon_yield","photon_yield",119,22,140,100,0,100); TProfile *pYield = new TProfile("hprof","Profile of pz versus px",119,22,100,0,100); TH1F *hLambda = new TH1F("lambda","lambda",400,0,800 ); Int_t startInd = 0; PrtEvent* fEvent = 0; PrtHit hit; TChain *ch = new TChain("data"); ch->Add("../build/hits.root"); // ch->Add("/SAT/hera/had1/dervish/data/prt/l0e0/hits*.root"); // ch->Add("/SAT/hera/had1/dervish/data/prt/l0e1/hits*.root"); ch->SetBranchAddress("PrtEvent", &fEvent); std::cout<<"ch->GetEntries() "<< ch->GetEntries()<GetEntries(); ievent++){ ch->GetEntry(ievent); if(ievent%100==0) cout<<"Event # "<Fill(fEvent->GetAngle(),fEvent->GetHitSize()); pYield->Fill(fEvent->GetAngle(),fEvent->GetHitSize()); for(Int_t h=0; hGetHitSize(); h++){ hit = fEvent->GetHit(h); hLambda->Fill(197.0*2.0*TMath::Pi()/hit.GetMomentum().Mag()/1000000.); } } TCanvas* c = new TCanvas("c","c",800,600); hYield->Draw("colz"); pYield->SetMarkerColor(4); pYield->SetMarkerStyle(21); pYield->SetMarkerSize(0.6); // pYield->Draw("same"); TCanvas* cl = new TCanvas("cl","cl",800,600); hLambda->GetXaxis()->SetTitle("#lambda, [nm]"); hLambda->GetYaxis()->SetTitle("entries, [#]"); hLambda->Draw(); }