#include . #include #include "TMath.h" #include "TTree.h" #include "TFile.h" #include "TH1.h" #include "TH3.h" #include "TH1F.h" #include "TGraph.h" #include "TGraphSmooth.h" #include "TSpectrum.h" #include "TCanvas.h" #include "TStyle.h" //void leak(char rfile[100],char outname[100]) void leak2() { gStyle->SetOptStat(0); const char *rfile="leak.root"; const char *outname = "leak.gif"; TFile *f = new TFile(rfile); TTree *AllDetectors = (TTree*)gDirectory->Get("AllDetectors"); TCanvas *c1 = new TCanvas("c1","c1",600,600); TH3F *hproj = new TH3F("hproj","all", 20,0,45,20,-1.e7,1.e7,20,-1.e7,1.e7); AllDetectors->Draw("X:Y:Z:0.2*Time","Time<120","goff"); TH3F *hproj1 = (TH3F*)f->FindObject("htemp"); hproj1->SetDirectory(0); AllDetectors->Draw("X:Y:Z:0.2*Time","Time<120 && Part==22","goff"); TH3F *hprojg = (TH3F*)f->FindObject("htemp"); hprojg->SetDirectory(0); AllDetectors->Draw("X:Y:Z:0.2*Time","Time<120 && Part==2112","goff"); TH3F *hprojn = (TH3F*)f->FindObject("htemp"); hprojn->SetDirectory(0); TObjArray *apm1 = (TObjArray*)hproj1->FindObject("polymarkers"); TObjArray *apmg = (TObjArray*)hprojg->FindObject("polymarkers"); TObjArray *apmn = (TObjArray*)hprojn->FindObject("polymarkers"); Int_t ntimes = apm1->GetEntries(); printf("ntimes=%d\n",ntimes); for(Int_t i=0;i "<Clear(); gPad->SetPhi(-2); hproj->Draw(""); TPolyMarker3D *pm1 = (TPolyMarker3D*)apm1->At(i); if (pm1) { pm1->SetMarkerColor(1); pm1->Draw(); } TPolyMarker3D *pmg = (TPolyMarker3D*)apmg->At(i); if (pmg) { pmg->SetMarkerColor(2); pmg->Draw(); } TPolyMarker3D *pmn = (TPolyMarker3D*)apmn->At(i); if (pmn) { pmn->SetMarkerColor(4); pmn->Draw(); } c1->Update(); c1->Print(Form("%s+20",outname)); } delete f; c1->Print(Form("%s++",outname)); }