4 // Dynamically link some shared libs
5 if (gClassTable->GetID("AliRun") < 0) {
6 gROOT->LoadMacro("loadlibs.C");
10 sprintf(filename,"galice.root");
11 AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read");
14 cerr<<"Can not open session for file galice.root\n";
19 gAlice = rl->GetAliRun();
21 AliSTART* START = (AliSTART *)gAlice->GetDetector("START");
24 rl->LoadKinematics("READ");
26 AliLoader* lstart = rl->GetLoader("STARTLoader");
28 Int_t iNevents=rl->GetNumberOfEvents();
29 cout<<" nevents "<<iNevents<<endl;
31 char nameTD[8],nameTR[8];
33 TH1F *hTimediff = new TH1F("hTimediff","Time difference",100,0,200);
34 TH1F *hTimePs = new TH1F("hTimePs","Time in Ps",100,-200,200);
35 TH1F *hMeanTime = new TH1F("hMeanTime","Time in Ps",100,2000,2500);
36 TH1F *hallADC = new TH1F("hallright","ADC summary right",100,0,200);
37 TH1F *hADCright = new TH1F("hADCright","ADC right",100,0,200);
38 TH1F *hADCleft = new TH1F("hADCleft","ADC left",100,0,200);
39 TH1F *hTimeright = new TH1F("hTimeright","Time right",100,2000.,3200.);
40 TH1F *hTimeleft = new TH1F("hTimeleft","Time left",100,2000.,3200.);
41 TH1F *hBestTimeright = new TH1F("hBestTimeright","First time right",
43 TH1F *hBestTimeleft = new TH1F("hBestTimeleft","First time left",
46 // digits = new AliSTARTdigit();
47 AliSTARTdigit *digits ; // digits
48 digits = new AliSTARTdigit();
50 timeRight = new TArrayI(12);
51 timeLeft = new TArrayI(12);
52 ADCRight = new TArrayI(12);
53 ADCLeft = new TArrayI(12);
55 // Event ------------------------- LOOP
56 for (Int_t j=0; j<iNevents; j++){
57 // gAlice->GetEvent(j);
60 lstart->LoadHits("READ");
61 lstart->LoadDigits("READ");
62 sprintf(nameTD,"START_D_%d",j);
63 printf("%s\n",nameTD);
64 TObject *td = (TObject*)gDirectory->Get(nameTD);
66 // cout<<" td "<<td<<endl;
69 // digits->Read(nameTD);
71 printf("time %d\n",digits->GetTimeDiff());
73 if(digits->GetTimeDiff()!=999999){
74 Int_t timediff = digits->GetTimeDiff();
75 // Double_t timePs=(timediff-128)*10.; // time in Ps channel_width =10ps
76 Int_t timePs=(512-timediff)*2.5.; // time in Ps channel_width =10ps
77 cout<<"timediff "<<timediff<<" timePs "<<timePs<<endl;
78 hTimediff->Fill(timediff);
79 hTimePs->Fill(timePs);
80 Int_t mean=digits->GetMeanTime();
81 cout<<" mean "<<mean<<endl;
83 hMeanTime->Fill(mean);
84 Int_t br=digits->GetBestTimeRight();
85 Int_t bl=digits->GetBestTimeLeft();
86 cout<<"BestTimeRight "<<br*2.5<<" BestTimeLeft "<<bl*2.5<<endl;
87 hBestTimeright->Fill(br*2.5);
88 hBestTimeleft ->Fill(bl*2.5);
89 digits->GetTimeRight(*timeRight );
90 digits->GetTimeLeft(*timeLeft );
91 digits->GetADCRight(*ADCRight );
92 digits->GetADCLeft(*ADCLeft );
93 for (Int_t i=0; i<12; i++)
95 Int_t t=timeRight.At(i);
96 Int_t ADC=ADCRight.At(i);
97 hTimeright->Fill(t*2.5);
100 for (Int_t i=0; i<12; i++)
102 Int_t ADC=ADCRight.At(i);
103 Int_t t=timeLeft.At(i);
104 hTimeleft->Fill(t*2.5);
110 Hfile = new TFile("Figdigits.root","RECREATE","Histograms for START digits");
111 printf("Writting histograms to root file \n");
113 //Create a canvas, set the view range, show histograms
114 gStyle->SetOptStat(111111);
115 // TCanvas *c1 = new TCanvas("c1","Alice START Time ",400,10,600,600);
120 hTimePs->SetXTitle("arriving time, ps");
121 hTimePs->SetYTitle("number of events");
124 hBestTimeright->Write();
125 hBestTimeleft ->Write();