1 #if !defined(__CINT__) || defined(__MAKECINT__)
9 #include <AliGenEventHeader.h>
10 #include <AliITSVertexerPPZ.h>
14 void AliITSVertexerZTest(Float_t delphi=0.05,Float_t window=3.,Float_t initx=0., Float_t inity=0.,TString FileWithKine="galice.root", TString FileWithRecP="galice.root"){
15 // delphi ---> azimuthal range to accept tracklets
16 // window ---> window in Z around the peak of tracklets proj. in mm
18 TH2F *diff2 = new TH2F("diff2","Zfound vs Ztrue",100,-6,6,100,-6,6);
19 TH1F *diff1 = new TH1F("diff1","Zfound - Ztrue(#mu m)",100,-500,500);
22 TFile *in = new TFile("galice.root");
23 gAlice = (AliRun*)in->Get("gAlice");
24 if(FileWithKine != FileWithRecP)gAlice->SetTreeRFileName(FileWithRecP);
25 TFile *fo = new TFile("vertici.root","recreate");
26 AliITSVertexerPPZ *dovert = new AliITSVertexerPPZ(in,fo,initx,inity);
28 dovert->SetDiffPhiMax(delphi);
29 dovert->SetWindow(window);
30 dovert->PrintStatus();
35 AliITSVertex *vert = 0;
36 for(Int_t i=0; i<gAlice->TreeE()->GetEntries(); i++){
38 // The true Z coord. is fetched for comparison
39 AliHeader *header = gAlice->GetHeader();
40 AliGenEventHeader* genEventHeader = header->GenEventHeader();
41 TArrayF primaryVertex(3);
42 genEventHeader->PrimaryVertex(primaryVertex);
43 vert = dovert->FindVertexForCurrentEvent(i);
46 cout <<"========================================================\n";
47 cout << "Event number: "<<i<<") Z Vertex:"<<endl;
49 cout<<"FOUND: "<<vert->GetZv()<<"; ";
50 cout<<vert->GetZRes()<<"; "<<vert->GetNContributors()<<endl;
53 cout<<"NOT FOUND - fZFound= "<<dovert->GetZFound();
54 cout<<" fZsig= "<<dovert->GetZsig()<<endl;
55 if(dovert->GetZFound() == -100) meno100++;
56 if(dovert->GetZFound() == -200) meno200++;
57 if(dovert->GetZFound() == -110) meno110++;
59 cout <<" True Z position "<<primaryVertex[2]<<", diff= ";
60 cout<<(primaryVertex[2]-dovert->GetZFound())*10000.<<endl;
64 for(Int_t kk=0;kk<3;kk++)pos[kk]=(Double_t)primaryVertex[kk];
65 vert->SetTruePos(pos);
66 Float_t found = vert->GetZv();
67 diff2->Fill(primaryVertex[2],found);
68 found = 10000.*(found-primaryVertex[2]);
69 if(vert->GetZRes()!=0){
75 dovert->WriteCurrentVertex();
83 cout<<"Number of bad vertices with code -100: "<<meno100<<endl;
84 cout<<"Number of bad vertices with code -110: "<<meno110<<endl;
85 cout<<"Number of bad vertices with code -200: "<<meno200<<endl;
86 cout<<"Only one tracklet (sigma = 0) "<<sigmazero<<endl;