#define __COMPILED__ #ifdef __COMPILED__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif // Writes the data of helices and the position of the true II-ary, to perform fit // of II-ary and calculation of resolution (in another macro) // void ITSRF(const char *filename="galice.root", const char *outfile="RiemannFit.dat", Int_t evnt=0) { // Connect the Root Galice file containing Geometry, Kine and Hits TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename); if (!file){ file = new TFile(filename);printf("Opening new file\n");} printf("Root input file is %s\n",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"); } // Get pointers to Alice detectors and Hits containers AliITS *ITS = (AliITS*)gAlice->GetModule("ITS"); if(!ITS) {cout<<"not ITS"<GetEvent(evnt); // number of particles generated (including daughters) // // Treat ITS information per module // Int_t nmodules; ITS->InitModules(-1,nmodules); cout<<" Filling modules..."<FillModules(evnt,-1,nmodules," "," "); // // Get the recontruction tree // TTree *TR = gAlice->TreeR(); Int_t nent = (Int_t)TR->GetEntries(); // // Initialize Riemann-fit class // AliITSRiemannFit *rfit = new AliITSRiemannFit(); rfit->InitPoints(evnt,nent,ITS,TR,nparticles); const TVector3 Bfield(0.0,0.0,0.2); // ALICE magnetic field // // Setting the variables // TParticle *MPart; Double_t r0[3]={0.0,0.0,0.0}, w, chi; Double_t Pt, Px, Py, Pz, charge, Ptot; Double_t x0, y0, rho, fd0, fphi, z0, vpar, chisql; Double_t CorrLin, ResSum; Int_t status[4]={0,0,0,0}, gfit_status, PdgPart; FILE *outdat=fopen(outfile,"w"); cout<Particle(part); PdgPart = MPart->GetPdgCode(); // // get track fit // Pt = MPart->Pt(); Px = MPart->Px(); Py = MPart->Py(); Pz = MPart->Pz(); Ptot = MPart->P(); charge = PdgPart/TMath::Abs(PdgPart); // +/- 1 gfit_status = (Int_t)rfit->FitHelix(part, charge, Px, Py, Pz, fd0, fphi, x0, y0, rho, w, z0, vpar, chisql, CorrLin, ResSum); // With this offset chi = 0 at the // distance of closest approach in bending plane // chi=-TMath::Pi()-fphi; if(gfit_status > 0) { switch(gfit_status) { case 1: status[0]++;break; case 2: status[1]++;break; case 11: status[2]++;break; case 12: status[3]++; break; default: cout<<"CASO NON PREVISTO IN K: "<