#include "save.C" void drawHitPrismPathAnim(TString spath = ".", TString name = ""){ Int_t saveflag = 1; TString info = "hits"; spath = 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("path_%d", i),Form("%d", i),500,-2,32,500,-10,10 ); hHits[i]->SetTitle(Form("path # %d",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); Double_t paths[100]; Int_t npath = 1; 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); Double_t path = hit.GetPathInPrizm(); Int_t ip; for(ip=0; ipFill(hit.GetGlobalPos().X()/10.,hit.GetGlobalPos().Y()/10.); } } TCanvas* cHits = new TCanvas("cHits","cHits",900,600); for(Int_t i=0; iDraw("colz"); save(cHits,spath,Form("animtime_%d",i),info,saveflag); } }