3 //read T0 ESD from reconstructed cosmic data
7 TFile *file = new TFile("AliESDs.root");
9 // TH1F *hMean= new TH1F("hMean"," T0 ", 10000,1.249e6,1.259e6);
10 TH1F *hMean= new TH1F("hMean"," T0 ",6000,0,6000);
11 TH1F *hVertex = new TH1F("hVertex","Z position of vertex", 100,-120,-110);
13 // TH1F *hAmp = new TH1F("hAmp"," amplitude", 2500, 10,2510);
14 // TH1F *hTime = new TH1F("hTime"," time", 500,1250000,1250500);
15 TH1F *hAmp[24]; TH1F * hTime[24];
16 Char_t buf1[20], buf2[20];
18 for(Int_t ic=0; ic<24; ic++)
20 sprintf(buf1,"Amp%i",ic+1);
21 hAmp[ic] = new TH1F(buf1,"Amp",50, 0,50 );
22 sprintf(buf2,"Time%i",ic+1);
23 // hTime[ic] = new TH1F("hTime"," time", 10000,1.249e6,1.259e6);
24 hTime[ic] = new TH1F("hTime"," time", 6000,0,6000);
28 TTree *esdTree = (TTree*)file->Get("esdTree");
31 TBranch *brRec=esdTree->GetBranch("AliESDTZERO.");
32 AliESDTZERO *fesdT0 = new AliESDTZERO();
34 brRec->SetAddress(&fesdT0);
36 cerr<<"EXEC Branch T0 not found"<<endl;
39 // brRec->GetEntry(0);
41 // Event ------------------------- LOOP
42 for (Int_t ievent=0; ievent<brRec->GetEntries(); ievent++){
43 brRec->GetEntry(ievent);
44 Int_t mean = fesdT0->GetT0();
46 Float_t vertex= fesdT0->GetT0zVertex();
47 if (ievent <100) cout<<ievent<<" "<<mean<<" vertex "<<vertex<<endl;
49 hVertex->Fill(vertex);
50 amp=fesdT0->GetT0amplitude();
51 time=fesdT0->GetT0time();
52 for (Int_t i=0; i<24; i++){
53 hAmp[i]->Fill(amp[i]);
54 hTime[i]->Fill(time[i]);
55 if (ievent <100) cout<<ievent<<" "<<i<<" time "<<time[i]<<" amp "<<amp[i]<<endl;
60 Hfile = new TFile("FigESD_25081.root","RECREATE","Histograms for T0
62 printf("Writting histograms to root file \n");
64 //Create a canvas, set the view range, show histograms
66 // gStyle->SetOptStat(111111);
69 for (Int_t i=0; i<24; i++){
74 TCanvas *c1 = new TCanvas("c1", "Time C side",0,48,1280,951);
76 // gStyle->SetOptFit(1111);
77 for (Int_t i=0; i<12; i++)
82 TCanvas *c2 = new TCanvas("c2", "Time A side",0,48,1280,951);
84 gStyle->SetOptFit(1111);
85 for (Int_t i=12; i<24; i++)
91 TCanvas *c3 = new TCanvas("c3", "Time mean & vertex",0,48,1280,951);