#include "save.C" void drawHitPrismReflectionsAnim(TString path = ".", TString name = ""){ Int_t saveflag = 1; TString info = "hits"; path = createDir("rdata", info, saveflag); 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"); TH2F *hHits[141]; for(Int_t i=0; i<141; i++){ hHits[i] = new TH2F( Form("reflections_%d", i),Form("%d", i),500,-2,32,500,-10,10 ); hHits[i]->SetTitle(Form("%d reflections",i)); hHits[i]->GetXaxis()->SetTitle("x, [cm]"); hHits[i]->GetYaxis()->SetTitle("y, [cm]"); hHits[i]->GetXaxis()->SetTitleOffset(1.15); hHits[i]->GetYaxis()->SetTitleOffset(1.2); hHits[i]->SetStats(0); } TH2F *hVertex = new TH2F("hVertex","",5000,-2,2, 1000,-10,10 ); hVertex->SetStats(0); PrtEvent* fEvent = 0; PrtHit hit; TChain *ch = new TChain("data"); ch->Add("../build/hits1.root"); ch->SetBranchAddress("PrtEvent", &fEvent); std::cout<<"ch->GetEntries() "<< ch->GetEntries()<GetEntries(); ievent++){ ch->GetEntry(ievent); if(ievent%100==0) cout<<"Event # "<GetHitSize(); h++){ hit = fEvent->GetHit(h); Double_t time = hit.GetLeadTime(0); Int_t nref = hit.GetNreflectionsInPrizm(); hHits[nref]->Fill(hit.GetGlobalPos().X()/10.,hit.GetGlobalPos().Y()/10.); } } TCanvas* cHits = new TCanvas("cHits","cHits",900,600); for(Int_t i=0; i<10; i++){ hHits[i]->Draw("colz"); save(cHits,path,Form("animtime_%d",i),info,saveflag); } }