1 void readDigits(Int_t evNumber=1)
4 // Dynamically link some shared libs
5 if (gClassTable->GetID("AliRun") < 0) {
6 gROOT->LoadMacro("loadlibs.C");
10 // Connect the Root Galice file containing Geometry, Kine and Hits
11 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
12 //TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
13 if (!file) file = new TFile("production.root","UPDATE");
15 // Get AliRun object from file or create it if not on file
17 gAlice = (AliRun*)file->Get("gAlice");
18 if (gAlice) printf("AliRun object found on file\n");
19 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
21 char nameTD[8],nameTR[8];
23 TH1F *hTimediff = new TH1F("hTimediff","Time difference",100,0,200);
24 TH1F *hTimePs = new TH1F("hTimePs","Time in Ps",100,2000,3000);
26 digits = new AliSTARTdigit();
29 // Event ------------------------- LOOP
30 for (j=0; j<evNumber; j++){
32 sprintf(nameTD,"START_D_%d",j);
33 printf("%s\n",nameTD);
34 TObject *td = (TObject*)gDirectory->Get(nameTD);
37 printf("time %d\n",digits->GetTime());
39 if(digits->GetTime()!=999999){
40 Int_t timediff = digits->GetMeanTime();
41 // Double_t timePs=(timediff-128)*10.; // time in Ps channel_width =10ps
42 Double_t timePs=(timediff)*10.; // time in Ps channel_width =10ps
43 cout<<"timediff "<<timediff<<" timePs "<<timePs<<endl;
44 hTimediff->Fill(timediff);
45 hTimePs->Fill(timePs);
49 Hfile = new TFile("figs.root","UPDATE","Histograms for STASRT digits");
50 printf("Writting histograms to root file \n");
52 //Create a canvas, set the view range, show histograms
53 gStyle->SetOptStat(111111);
54 // TCanvas *c1 = new TCanvas("c1","Alice START Time ",400,10,600,600);
55 hTimePs->SetXTitle("arriving time, ps");
56 hTimePs->SetYTitle("number of events");