]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/oldmacros/AliITSScanPIDV2.C
Adding more information to the debug output
[u/mrichter/AliRoot.git] / ITS / oldmacros / AliITSScanPIDV2.C
1 ///////////////////////////////////////////////////////////
2 // Test macro for AliITStracksV2Pid.root file            //
3 // JINR Dubna Jan 2002                                   //
4 ///////////////////////////////////////////////////////////
5 void
6 AliITSScanPIDV2(Int_t evNumber1=0,Int_t evNumber2=0) {
7   //................. Prepare histogramms ................
8      TH2F *qplot =  new TH2F("Qtrm","Qtrm vs Pmom",100,0,1.300,100,0,13);
9      TH2F *qplotP=  new TH2F("QtrmP","Qtrm vs Pmom",100,0,1.300,100,0,13); 
10      TH2F *qplotKa= new TH2F("QtrmKa","Qtrm vs Pmom",100,0,1.300,100,0,13);
11      TH2F *qplotPi= new TH2F("QtrmPi","Qtrm vs Pmom",100,0,1.300,100,0,13);
12      TH2F *qplotE=  new TH2F("QtrmE","Qtrm vs Pmom",100,0,1.300,100,0,13);
13      qplotP.SetMarkerStyle(8); qplotP.SetMarkerColor(kBlue); qplotP.SetMarkerSize(.3);
14      qplotKa.SetMarkerStyle(8); qplotKa.SetMarkerColor(kRed); qplotKa.SetMarkerSize(.3);
15      qplotPi.SetMarkerStyle(8); qplotPi.SetMarkerColor(kBlack); qplotPi.SetMarkerSize(.3);
16      qplotE.SetMarkerStyle(8); qplotE.SetMarkerColor(kGreen); qplotE.SetMarkerSize(.3);
17   //......................................................
18   TH1F *signal_mip = new TH1F("signal_mip","Signal (mips) for track",100,0.,15.);
19
20 TFile *fpid = new TFile("AliITStracksV2Pid.root","read");
21 fpid->ls();
22 //
23 //   Loop over events 
24 //
25 for (int nev=0; nev<= evNumber2; nev++) {
26   char tpidname[30];
27   sprintf(tpidname,"TreeT%d",nev);
28   TTree *tracktree=(TTree*)fpid->Get(tpidname);
29   TBranch *tbranch=tracktree->GetBranch("pids");
30         
31    Int_t nentr=tracktree->GetEntries();
32    cout<<"Found PID for "<<nentr<<" ITS V2 tracks on "<<tpidname<<endl;
33
34    AliITStrackV2Pid *iopid=0;
35 for(Int_t ii=0;ii<nentr;ii++)
36   {
37       AliITStrackV2Pid *iopid=new AliITStrackV2Pid;
38       tbranch->SetAddress(&iopid);
39       tracktree->GetEvent(ii);
40
41       signal_mip->Fill(iopid->fSignal);
42
43         if(iopid->fPcode ==2212)qplotP.Fill(iopid->fMom,iopid->fSignal);
44         if(iopid->fPcode == 321)qplotKa.Fill(iopid->fMom,iopid->fSignal  );
45         if(iopid->fPcode == 211)qplotPi.Fill(iopid->fMom,iopid->fSignal  );
46         if(iopid->fPcode ==  11)qplotE.Fill(iopid->fMom,iopid->fSignal   );
47         /*
48         
49 if(  (iopid->fWp<0.10)||(iopid->fWk<0.0)||(iopid->fWpi<0.0) ){
50           cout<<"PID pcode,fsignal,fmom= "<<iopid->fPcode<<","<<iopid->fSignal<<","<<iopid->fMom<<endl;
51           cout<<"wpi,wka,wp="<<iopid->fWpi<<" "<<iopid->fWk<<" "<<iopid->fWp<<endl;
52       }
53         */
54       delete iopid;
55   }// Enf for ii (tracks)
56  }// End for nev (events)
57  fpid->Close();
58   //...................... Draw histogramms .................
59    TCanvas *c1 = new TCanvas("PID_test","Scan PID ",200,10,900,700);
60    c1->Divide(2,1);
61   //.........................................................
62    c1->cd(1); gPad->SetFillColor(33);
63    signal_mip->Draw();
64
65    c1->cd(2); //gPad->SetFillColor(33);
66    qplot->Draw();
67    qplotP.Draw("same"); qplotKa.Draw("same"); qplotPi.Draw("same"); qplotE.Draw("same");
68
69    AliITSPid *pid =new AliITSPid(100);
70    fcutka.Draw("same"); fcutpr.Draw("same");
71    c1->Print("ITSPIDplot.ps");
72
73   cout<<"End of file AliITStracksV2Pid.root "<<endl; 
74   return;
75 }
76