6 // --- Standard library ---
8 // --- AliRoot header files ---
10 #include "AliFMDdigit.h"
11 #include "AliFMDReconstParticles.h"
14 #include "AliFMDReconstruction.h"
16 #include "AliDetector.h"
24 ClassImp(AliFMDReconstruction)
27 //____________________________________________________________________________
29 AliFMDReconstruction::AliFMDReconstruction():TTask("AliFMDReconstruction","")
31 fNevents = 0 ; // Number of events to rreconnstraction, 0 means all events in current file
32 // add Task to //root/Tasks folder
33 TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ;
34 roottasks->Add(this) ;
36 //____________________________________________________________________________
38 AliFMDReconstruction::AliFMDReconstruction(char* HeaderFile, char *ReconstParticlesFile):TTask("AliFMDReconstruction","")
40 fNevents = 0 ; // Number of events to rreconnstraction, 0 means all events in current file
41 fReconstParticlesFile=ReconstParticlesFile ;
42 fHeadersFile=HeaderFile ;
43 //add Task to //root/Tasks folder
44 TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ;
45 roottasks->Add(this) ;
48 //____________________________________________________________________________
50 AliFMDReconstruction::~AliFMDReconstruction()
55 //____________________________________________________________________________
57 void AliFMDReconstruction::Exec(TClonesArray *fReconParticles,Option_t *option)
59 //Collects all digits in the same active volume into number of particles
61 AliFMD * FMD = (AliFMD *) gAlice->GetDetector("FMD");
62 if(fNevents == 0) fNevents=(Int_t)gAlice->TreeD()->GetEntries();
63 for(Int_t ievent=0;ievent<fNevents;ievent++)
65 gAlice->GetEvent(ievent) ;
66 if(gAlice->TreeH()==0) return;
67 if(gAlice->TreeR()==0) gAlice->MakeTree("R");
70 Int_t threshold[]={ 0, 18, 37, 56, 76,
71 96, 119, 138, 165, 172,
72 218, 231, 238, 277, 304,
73 330, 357, 423, 449, 476,
74 522, 542, 555, 568, 581,
75 614, 624, 657, 674, 687,
76 700, 713, 720, 727, 733,
77 740, 759, 778, 797, 816,
78 834, 853, 872, 891, 910,
79 929, 948, 967, 986, 1024};
82 int threshold_array_size=sizeof(threshold)/sizeof(threshold[0]);
83 AliFMDdigit *fmdDigit;
87 gAlice->TreeD()->GetEvent(0);
88 TClonesArray *FMDdigits=FMD->Digits();
89 Int_t nDigits=FMDdigits->GetEntries();
90 Int_t RecParticles[4];
92 for (Int_t digit=0;digit<nDigits;digit++)
94 fmdDigit=(AliFMDdigit*)FMDdigits->UncheckedAt(digit);
95 RecParticles[0] = fmdDigit->Volume();
96 RecParticles[1] = fmdDigit->NumberOfSector();
97 RecParticles[2] = fmdDigit->NumberOfRing();
98 Int_t ADC=fmdDigit->ADCsignal();
99 RecParticles[3]=0; //case when fmdDigit->ADCsignal()==0
100 for (int i=0;i<threshold_array_size-1;i++)
102 if(ADC>threshold[i]&&ADC<=threshold[i+1])
105 new((*fReconParticles)[nRecPart++]) AliFMDReconstParticles(RecParticles);
108 gAlice->TreeR()->Reset();
109 gAlice->TreeR()->Fill();
110 gAlice->TreeR()->Write(0,TObject::kOverwrite);
112 cout<<"\nAliFMDReconstruction::Exec(TClonesArray *fReconParticles,Option_t *option) finished"<<endl;
114 //__________________________________________________________________
116 void AliFMDReconstruction::SetReconstParticlesFile(char * file )
118 if (!fReconstParticlesFile.IsNull())
119 cout<<"\nChanging reconstructed particles file from "<<
120 (char *) fReconstParticlesFile.Data()<< " to "<<file<<endl;
121 fReconstParticlesFile=file;
123 //__________________________________________________________________
124 void AliFMDReconstruction::Print(Option_t* option)const
126 cout<<"------------------- "<<GetName() <<" -------------"<< endl ;
127 if(fReconstParticlesFile.IsNull())
128 cout<<"\nWriting reconstructed particles to file"<<endl ;
130 cout<<"\nWriting reconstructed particles to file "<<
131 (char*) fReconstParticlesFile.Data() << endl ;