From ae0cd643fd4cf067f7c331fad770120916b9a011 Mon Sep 17 00:00:00 2001 From: barbera Date: Tue, 2 Oct 2001 06:51:24 +0000 Subject: [PATCH] New macro to run track comparison for tracking V1 --- ITS/AliITSComparisonV1.C | 214 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 ITS/AliITSComparisonV1.C diff --git a/ITS/AliITSComparisonV1.C b/ITS/AliITSComparisonV1.C new file mode 100644 index 00000000000..9882e6e01f8 --- /dev/null +++ b/ITS/AliITSComparisonV1.C @@ -0,0 +1,214 @@ +#include "iostream.h" + + + void AliITSComparisonV1(Int_t evNumber1=0,Int_t evNumber2=0) { + + const char *filename="itstracks.root"; + + ///////////////// Dynamically link some shared libs //////////////////////////////// + + if (gClassTable->GetID("AliRun") < 0) { + gROOT->LoadMacro("loadlibs.C"); + loadlibs(); + } else { + delete gAlice; + gAlice=0; + } + +// Connect the Root Galice file containing Geometry, Kine and Hits + TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename); + if (!file) file = new TFile(filename); + + ifstream in("itsgood_tracks"); +// +// Loop over events +// + + char tname[30]; + + + struct GoodTrack { + Int_t fEventN; + Int_t lab,code; + Float_t px,py,pz,x,y,z,pxg,pyg,pzg,ptg; + Bool_t flag; + }; + Int_t i; + GoodTrack gt[15000]; + Int_t ngood=0; + cerr<<"Reading itsgood tracks...\n"; + while (in>>gt[ngood].fEventN>>gt[ngood].lab>>gt[ngood].code + >>gt[ngood].px >>gt[ngood].py>>gt[ngood].pz + >>gt[ngood].x >>gt[ngood].y >>gt[ngood].z + >>gt[ngood].pxg >>gt[ngood].pyg >>gt[ngood].pzg + >>gt[ngood].ptg >>gt[ngood].flag) { + ngood++; + cerr<Get(tname); + TBranch *tbranch=tracktree->GetBranch("ITStracks"); + cout<<" nev = "<GetEntries(); + + TObjArray tarray(nentr); + // AliITSIOTrack *iotrack=0; + printf("nentr %d\n",nentr); + + for (Int_t i=0; iSetAddress(&iotrack); + tracktree->GetEvent(i); + tarray.AddLast(iotrack); + } + //file->Close(); + + AliITSIOTrack *iotrack; + for (Int_t i=0; iGetLabel(); + Int_t labTPC=iotrack->GetTPCLabel(); + //Int_t labTPC=labITS; //provvisoria + Double_t phistate=iotrack->GetStatePhi(); + Double_t tgl=iotrack->GetStateTgl(); + Double_t Zstate=iotrack->GetStateZ(); + Double_t Dr=iotrack->GetStateD(); + Double_t C=iotrack->GetStateC(); + Double_t px=iotrack->GetPx(); + Double_t py=iotrack->GetPy(); + Double_t pz=iotrack->GetPz(); + Double_t pt=TMath::Sqrt(px*px+py*py); + Int_t c = iotrack->GetCharge(); + Double_t x=iotrack->GetX(); + Double_t y=iotrack->GetY(); + Double_t z= iotrack->GetZ(); + Double_t Dz=z; //non e' vero bisogna levare vertice + Double_t Dtot= TMath::Sqrt(Dr*Dr+Dz*Dz); + + // cout<<" track label = "<GetLabel()); + Int_t flaglab=0; + Int_t iii=0; + Double_t ptg=0.,pxg=0.,pyg=0.,pzg=0.; + + Int_t mingood=0, maxgood=0, jj=0; + if(nev==evNumber1) mingood=0; + else + {for(jj=evNumber1; jjduepi) phi-=duepi; + if(phi<0.) phi+=duepi; + Double_t signC=0.; + if(c>0) signC=1.; else signC=-1.; + + Double_t difphi = (phi - phig)*1000.; + dataOut(kkk)=difphi; kkk++; + dataOut(kkk)=Dtot*1.e4; kkk++; + dataOut(kkk)=Dr*1.e4; kkk++; + dataOut(kkk)=Dz*1.e4; kkk++; + dataOut(kkk)=signC; kkk++; + Int_t r; + for (r=0; r<10; r++) { out<Close(); +} + -- 2.43.5