1 void TestReconstruction (Int_t vol=1, const Int_t nRings=128, const Int_t nSectors=20)
3 // Dynamically link some shared libs
4 if (gClassTable->GetID("AliRun") < 0)
6 gROOT->LoadMacro("loadlibs.C");
9 // Connect the Root Galice file containing Geometry, Kine and Hits
10 char filename[]="galice.root";
11 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
12 if (!file) file = new TFile(filename);
13 // Get AliRun object from file or create it if not on file
16 gAlice = (AliRun*)file->Get("gAlice");
17 if (gAlice) printf("\nAliRun object found on file\n");
18 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
23 Int_t np[nRings][nSectors];
26 for (int i=0;i<nRings;i++)
27 for(int j=0;j<nSectors;j++)
30 TH1F *hNReal = new TH1F("hNReal","Real number of particles",50,0,50);
31 TH1F *hNRec = new TH1F("hNRec ","Reconst. number of particles",50,0,50);
33 Int_t nparticles = gAlice->GetEvent(0);
34 if (nparticles <= 0) return;
35 printf("\nnparticles=%d\n",nparticles);
37 gAlice->TreeR()->GetEvent(0);
38 AliFMD *FMD = (AliFMD*)gAlice->GetDetector("FMD");
39 TClonesArray *Particles = gAlice->Particles();
42 AliFMDReconstParticles *fmdRP;
45 TClonesArray *FMDhits = FMD->Hits();
46 TClonesArray *FMDrec = FMD->ReconParticles();
47 TTree *TH = gAlice->TreeH();
48 Int_t ntracks = TH->GetEntries();
49 if (ntracks<=0) return;
51 Int_t nPads=FMDrec->GetEntries();
55 cout<<"\n(AliFMDReconstParticles*)FMDrec->UncheckedAt(0)="<<(AliFMDReconstParticles*)FMDrec->UncheckedAt(0);
56 cout<<"\nFMDrec->UncheckedAt(0)="<<FMDrec->UncheckedAt(0);
59 for (Int_t track=0; track<ntracks;track++)
62 nbytes += TH->GetEvent(track);//?
63 particle=(TParticle*)Particles->UncheckedAt(track);
64 // Int_t numpart=particle->GetKF();
65 //Float_t eta=particle->GetEta();
67 Int_t nhits=FMDhits->GetEntriesFast();
68 for (Int_t hit=0;hit<nhits;hit++)
70 fmdHit = (AliFMDhit*)FMDhits->UncheckedAt(hit);
71 volume=fmdHit->Volume();
74 np[fmdHit->NumberOfRing()-1][fmdHit->NumberOfSector()-1]++;
78 //Int_t nRecPart=FMDrec->GetEntriesFast();
79 Int_t nDeterm=0; Int_t nReal=0;
80 for (Int_t pad=0;pad<nPads;pad++)
82 fmdRP = (AliFMDReconstParticles*)FMDrec->UncheckedAt(pad);
83 volume=fmdRP->GetVolume();
88 fmdDigit = (AliFMDdigit*)FMDdig->UncheckedAt(pad);
89 cout<<"\nfmdDigit->ADCsignal()="<<fmdDigit->ADCsignal();
90 cout<<"\nfmdDigit->NumberOfRing()="<<fmdDigit->NumberOfRing();
91 cout<<"\nfmdDigit->NumberOfSector()="<<fmdDigit->NumberOfSector();
93 nDeterm+=fmdRP->GetNumberOfReconstParticles();
94 nReal+=np[fmdRP->GetNumberOfRing()-1][fmdRP->GetNumberOfSector()-1]; //-1=?
95 Int_t RecRing=fmdRP->GetNumberOfRing()-1;
96 Int_t RecSector=fmdRP->GetNumberOfSector()-1;
97 hNReal->Fill(np[RecRing][RecSector]);
98 hNRec->Fill(fmdRP->GetNumberOfReconstParticles());
102 cout<<"\nReal="<<nReal<<
103 " nDeterm="<<nDeterm<<
104 "\nerror="<<float(nDeterm-nReal)/float(nReal)<<endl;
107 TCanvas *c1 = new TCanvas("c1","Alice FMD ",400,10,800,800);
108 hNReal->SetFillColor(2);
110 hNRec->SetFillColor(4);