#ifndef __CINT__ #include "AliITSgeom.h" #include "TParticle.h" cerr<<"Reading tp good tracks...\n"; while (in>>gt[ngood].lab>>gt[ngood].code >>gt[ngood].px >>gt[ngood].py>>gt[ngood].pz #endif struct GoodTrack { Int_t fEventN; Int_t lab; Int_t code; Bool_t flag; Float_t px,py,pz; Float_t x,y,z; Float_t pxg,pyg,pzg,ptg; }; Int_t AliITSTracksV1(Int_t evNumber1=0,Int_t evNumber2=0,Int_t nclust=5) { cerr<<"Select tracks which have nclust rec points in ITS...\n"; GoodTrack gt[30000]; Int_t ngood=0; ifstream in("good_tracks_tpc"); ofstream out("itsgood_tracks"); cerr<<"Reading good 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<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("galice.root"); if (!file) file = new TFile("galice.root","UPDATE"); //if (!file) file = new TFile(filename); // Get AliRun object from file or create it if not on file if (!gAlice) { gAlice = (AliRun*)file->Get("gAlice"); if (gAlice) printf("AliRun object found on file\n"); if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); } AliITS* ITS =(AliITS *)gAlice->GetDetector("ITS"); if (!ITS) return; //TClonesArray *recPoints = ITS->RecPoints(); //cout<<" recPoints = "<GetITSgeom(); for(Int_t i=0; i<6; i++) { Nladder[i]=g1->GetNladders(i+1); Ndetector[i]=g1->GetNdetectors(i+1); //cout<GetModuleIndex(i+1,1,1); modmax[i]=g1->GetModuleIndex(i+1,Nladder[i],Ndetector[i]); //cout<GetEvent(nev); cout << "nev " << nev <RecPoints(); TObjArray *particles=gAlice->Particles(); // TClonesArray *particles=gAlice->Particles(); // Int_t np=particles->GetEntriesFast(); Int_t np=gAlice->GetNtrack(); //FCA correction TMatrix goodITS(np,6); //Int_t modmin[]={0,80,240,324,500,1282}; //Int_t modmax[]={79,239,323,499,1281,2269}; // for(Int_t j=0; jTreeR()->GetEntries(); printf("Found %d entries in the TreeR (must be one per module per event!)\n",nent); // for (Int_t layer=1;layer<=6;layer++) { for (Int_t mod=modmin[layer-1];mod<=modmax[layer-1];mod++) { ITS->ResetRecPoints(); //gAlice->TreeR()->GetEvent(mod+1); //first entry in TreeR is empty gAlice->TreeR()->GetEvent(mod); //modificato il 2-3-2001 numbpoints = recPoints->GetEntries(); if(!numbpoints) continue; for (Int_t irec=0;irecUncheckedAt(irec); for (Int_t it=0;it<3;it++) { track=recp->GetLabel(it); if(track<0) continue; if(track > np) { cout<<" Error on track number \n"; getchar(); } goodITS(track,layer-1)=1; } //loop over tracks } //loop over points } //loop over modules } //loop over layers Int_t mingood=0, maxgood=0,jj=0; if(nev==evNumber1) mingood=0; else {for(jj=evNumber1; jjnp) {cout<<" Error on TPC good tracks label \n"; getchar();} Int_t ilab=gt[i].lab; Int_t totclust=0; for(Int_t j=0; j<6; j++) totclust+=goodITS(ilab,j); if(totclust>=nclust && nev==gt[i].fEventN) { gt[i].flag=1; // printf("label nclusters %d %d\n",gt[i].lab,totclust); // } } Int_t itsngood=0; if (out) { // for (Int_t ngd=0; ngdParticle(TMath::Abs(gt[ngd].lab)); //aggiunto 27-9 gt[ngd].x=p->Vx(); gt[ngd].y=p->Vy(); gt[ngd].z=p->Vz(); if(gt[ngd].flag) { out<Close(); printf("after file close\n"); return 0; }