3 ////////////////////////////////////////////////
4 // Manager and hits classes for set:MUON //
5 ////////////////////////////////////////////////
6 #include "AliDetector.h"
8 #include "AliMUONConst.h"
10 #include "AliMUONchamber.h"
11 #include "AliMUONSegRes.h"
13 #include <TObjArray.h>
17 typedef enum {simple, medium, big} Cluster_t;
19 static const int NCH=14;
22 class AliMUONRecCluster;
23 class AliMUONRawCluster;
24 class AliMUONClusterFinder;
25 class AliMUONcorrelation;
28 //----------------------------------------------
31 class AliMUONcluster : public TObject {
34 Int_t fHitNumber; // Hit number
35 Int_t fCathode; // Cathode number
36 Int_t fQ ; // Total charge
37 Int_t fPadX ; // Pad number along X
38 Int_t fPadY ; // Pad number along Y
39 Int_t fQpad ; // Charge per pad
40 Int_t fRSec ; // R -sector of pad
44 fHitNumber=fQ=fPadX=fPadY=fQpad=fRSec=0;
46 AliMUONcluster(Int_t *clhits);
47 virtual ~AliMUONcluster() {;}
49 ClassDef(AliMUONcluster,1) //Cluster object for set:MUON
53 class AliMUONreccluster : public TObject {
56 Int_t fTracks[3]; //labels of overlapped tracks
58 Int_t fQ ; // Q of cluster (in ADC counts)
59 Float_t fX ; // X of cluster
60 Float_t fY ; // Y of cluster
64 fTracks[0]=fTracks[1]=fTracks[2]=0;
67 virtual ~AliMUONreccluster() {;}
69 ClassDef(AliMUONreccluster,1) //Cluster object for set:MUON
72 //_____________________________________________________________________________
74 class AliMUONdigit : public TObject {
76 Int_t fPadX; // Pad number along x
77 Int_t fPadY ; // Pad number along y
78 Int_t fSignal; // Signal amplitude
79 Int_t fTcharges[10]; // charge per track making this digit (up to 10)
80 Int_t fTracks[10]; // primary tracks making this digit (up to 10)
81 Int_t fPhysics; // physics contribution to signal
82 Int_t fHit; // hit number - temporary solution
88 AliMUONdigit(Int_t *digits);
89 AliMUONdigit(Int_t *tracks, Int_t *charges, Int_t *digits);
90 virtual ~AliMUONdigit();
92 ClassDef(AliMUONdigit,1) //Digits for set:MUON
94 //_____________________________________________________________________________
96 class AliMUONlist : public AliMUONdigit {
98 Int_t fChamber; // chamber number of pad
99 TObjArray *fTrackList;
101 AliMUONlist() {fTrackList=0;}
102 AliMUONlist(Int_t rpad, Int_t *digits);
103 virtual ~AliMUONlist() {delete fTrackList;}
104 TObjArray *TrackList() {return fTrackList;}
105 ClassDef(AliMUONlist,1) //Digits for set:MUON
107 //___________________________________________
110 //___________________________________________
112 class AliMUONhit : public AliHit {
114 Int_t fChamber; // Chamber number
115 Float_t fParticle; // Geant3 particle type
116 Float_t fTheta ; // Incident theta angle in degrees
117 Float_t fPhi ; // Incident phi angle in degrees
118 Float_t fTlength; // Track length inside the chamber
119 Float_t fEloss; // ionisation energy loss in gas
120 Int_t fPHfirst; // first padhit
121 Int_t fPHlast; // last padhit
124 Float_t fPTot; // hit momentum P
125 Float_t fCxHit; // Px/P
126 Float_t fCyHit; // Py/P
127 Float_t fCzHit; // Pz/P
131 AliMUONhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
132 virtual ~AliMUONhit() {}
134 ClassDef(AliMUONhit,1) //Hits object for set:MUON
137 class AliMUON : public AliDetector {
140 AliMUON(const char *name, const char *title);
142 virtual void AddHit(Int_t, Int_t*, Float_t*);
143 virtual void AddCluster(Int_t*);
144 virtual void AddDigits(Int_t, Int_t*, Int_t*, Int_t*);
145 virtual void AddRawCluster(Int_t, const AliMUONRawCluster&);
146 virtual void AddRecCluster(Int_t iCh, Int_t iCat,
147 AliMUONRecCluster* Cluster);
148 virtual void AddCathCorrel(Int_t, Int_t*, Float_t*, Float_t*);
149 virtual void BuildGeometry();
150 virtual void CreateGeometry() {}
151 virtual void CreateMaterials() {}
152 virtual void StepManager();
153 Int_t DistancetoPrimitive(Int_t px, Int_t py);
154 virtual Int_t IsVersion() const =0;
156 TClonesArray *Clusters() {return fClusters;}
157 virtual void MakeTreeC(Option_t *option="C");
158 void GetTreeC(Int_t);
159 virtual void MakeBranch(Option_t *opt=" ");
160 void SetTreeAddress();
161 virtual void ResetHits();
162 virtual void ResetDigits();
163 virtual void ResetRawClusters();
164 virtual void ResetRecClusters();
165 virtual void ResetCorrelation();
166 virtual void FindClusters(Int_t,Int_t);
167 virtual void Digitise(Int_t,Int_t,Option_t *opt1=" ",Option_t *opt2=" ",Text_t *name=" ");
168 virtual void CathodeCorrelation(Int_t);
169 virtual void SortTracks(Int_t *,Int_t *,Int_t);
173 void Init(Double_t &, Double_t &, Double_t &);
174 void Reconst(Int_t &,Int_t &,Int_t,Int_t &,Int_t&,Int_t&, Option_t *option,Text_t *filename);
177 void SetCutPxz(Double_t p) {fSPxzCut=p;}
178 void SetSigmaCut(Double_t p) {fSSigmaCut=p;}
179 void SetXPrec(Double_t p) {fSXPrec=p;}
180 void SetYPrec(Double_t p) {fSYPrec=p;}
181 Double_t GetCutPxz() {return fSPxzCut;}
182 Double_t GetSigmaCut() {return fSSigmaCut;}
183 Double_t GetXPrec() {return fSXPrec;}
184 Double_t GetYPrec() {return fSYPrec;}
187 // Configuration Methods (per station id)
189 // Set Chamber Segmentation Parameters
190 // id refers to the station and isec to the cathode plane
191 virtual void SetPADSIZ(Int_t id, Int_t isec, Float_t p1, Float_t p2);
193 // Set Signal Generation Parameters
194 virtual void SetSigmaIntegration(Int_t id, Float_t p1);
195 virtual void SetChargeSlope(Int_t id, Float_t p1);
196 virtual void SetChargeSpread(Int_t id, Float_t p1, Float_t p2);
197 virtual void SetMaxAdc(Int_t id, Float_t p1);
198 // Set Segmentation and Response Model
199 virtual void SetSegmentationModel(Int_t id, Int_t isec, AliMUONsegmentation *segmentation);
200 virtual void SetResponseModel(Int_t id, AliMUONresponse *response);
201 virtual void SetNsec(Int_t id, Int_t nsec);
202 // Set Reconstruction Model
203 virtual void SetReconstructionModel(Int_t id, AliMUONClusterFinder *reconstruction);
204 // Set Stepping Parameters
205 virtual void SetMaxStepGas(Float_t p1);
206 virtual void SetMaxStepAlu(Float_t p1);
207 virtual void SetMaxDestepGas(Float_t p1);
208 virtual void SetMaxDestepAlu(Float_t p1);
209 virtual void SetMuonAcc(Bool_t acc=0, Float_t angmin=2, Float_t angmax=9);
210 // Response Simulation
211 virtual void MakePadHits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id);
212 // Return reference to Chamber #id
213 virtual AliMUONchamber& Chamber(Int_t id) {return *((AliMUONchamber *) (*fChambers)[id]);}
214 // Retrieve pad hits for a given Hit
215 virtual AliMUONcluster* FirstPad(AliMUONhit *, TClonesArray *);
216 virtual AliMUONcluster* NextPad(TClonesArray *);
217 // Return pointers to digits
218 TObjArray *Dchambers() {return fDchambers;}
219 Int_t *Ndch() {return fNdch;}
220 virtual TClonesArray *DigitsAddress(Int_t id) {return ((TClonesArray *) (*fDchambers)[id]);}
221 // Return pointers to reconstructed clusters
222 // virtual TObjArray *RecClusters(Int_t iCh, Int_t iCat)
223 // {return ( (TObjArray*) (*fRecClusters)[iCh+iCat*10]);}
225 TObjArray *RawClusters() {return fRawClusters;}
226 Int_t *Nrawch() {return fNrawch;}
227 virtual TClonesArray *RawClustAddress(Int_t id) {return ((TClonesArray *) (*fRawClusters)[id]);}
230 AliMUONRawCluster *RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster);
233 // Return pointers to list of correlated clusters
234 TObjArray *CathCorrel() {return fCathCorrel;}
235 Int_t *Ncorch() {return fNcorch;}
236 virtual TClonesArray *CathCorrelAddress(Int_t id)
237 {return ((TClonesArray *) (*fCathCorrel)[id]);}
240 // virtual TClonesArray *CathCorrelAddress2(Int_t id)
241 // {return ((TClonesArray *) (*fCathCorrel2)[id]);}
243 // Return pointer to TreeC
244 TTree *TreeC() {return fTreeC;}
246 TObjArray *fChambers; // List of Tracking Chambers
247 Int_t fNclusters; // Number of clusters
248 TClonesArray *fClusters; // List of clusters
249 TObjArray *fDchambers; // List of digits
250 Int_t *fNdch; // Number of digits
252 // TObjArray *fRecClusters; // List of clusters
254 TObjArray *fRawClusters; // List of raw clusters
255 Int_t *fNrawch; // Number of raw clusters
256 TObjArray *fCathCorrel; // List of correlated clusters
257 Int_t *fNcorch; // Number of correl clusters
258 TTree *fTreeC; // Cathode correl index tree
261 Bool_t fAccCut; //Transport acceptance cut
262 Float_t fAccMin; //Minimum acceptance cut used during transport
263 Float_t fAccMax; //Minimum acceptance cut used during transport
266 // Stepping Parameters
267 Float_t fMaxStepGas; // Maximum step size inside the chamber gas
268 Float_t fMaxStepAlu; // Maximum step size inside the chamber aluminum
269 Float_t fMaxDestepGas; // Maximum relative energy loss in gas
270 Float_t fMaxDestepAlu; // Maximum relative energy loss in aluminum
273 // Parameters for reconstruction program
274 Double_t fSPxzCut; // Pxz cut (GeV/c) to begin the track finding
275 Double_t fSSigmaCut; // Number of sig. delimiting the searching areas
276 Double_t fSXPrec; // Chamber precision in X (cm)
277 Double_t fSYPrec; // Chamber precision in Y (cm)
283 ClassDef(AliMUON,1) //Hits manager for set:MUON
285 //___________________________________________
286 class AliMUONRecCluster : public TObject {
288 AliMUONRecCluster() ;
289 AliMUONRecCluster(Int_t FirstDigit,Int_t Ichamber, Int_t Icathod) ;
290 virtual ~AliMUONRecCluster();
291 virtual void AddDigit(Int_t Digit);
292 virtual Int_t FirstDigitIndex();
293 virtual Int_t NextDigitIndex();
294 virtual Int_t InvalidDigitIndex() {return -1;}
296 virtual Int_t NDigits();
297 virtual void Finish(); // Nothing yet ...
298 virtual Int_t GetCathod() {return fCathod;}
299 virtual Int_t GetChamber() {return fChamber;}
302 Float_t fX; // reconstructed x
303 Float_t fY; // reconstructed y
306 TArrayI *fDigits; // List of digits indexes for that cluster
307 Int_t fNdigit; // Number of digits indexes stored;
308 Int_t fCathod; // Number of the cathod to be used;
309 Int_t fChamber; // Number of the chamber to be used;
310 Int_t fCurrentDigit; // Current Digit inside an iteration
312 ClassDef(AliMUONRecCluster,1) //Cluster object for set:MUON
314 //___________________________________________
316 class AliMUONRawCluster : public TObject {
319 Int_t fTracks[3]; //labels of overlapped tracks
320 Int_t fQ ; // Q of cluster (in ADC counts)
321 Float_t fX ; // X of cluster
322 Float_t fY ; // Y of cluster
324 Int_t fIndexMap[50]; //indeces of digits
325 Int_t fOffsetMap[50]; //Emmanuel special
326 Float_t fContMap[50]; //Contribution from digit
327 Int_t fPhysicsMap[50];
328 Int_t fMultiplicity; //cluster multiplicity
332 AliMUONRawCluster() {
333 fTracks[0]=fTracks[1]=fTracks[2]=-1;
334 fQ=0; fX=fY=0; fMultiplicity=0;
335 for (int k=0;k<50;k++) {
341 fNcluster[0]=fNcluster[1]=-1;
343 virtual ~AliMUONRawCluster() {}
345 Float_t GetRadius() {return TMath::Sqrt(fX*fX+fY*fY);}
347 Bool_t IsSortable() const {return kTRUE;}
348 Int_t Compare(TObject *obj);
349 Int_t PhysicsContribution();
350 static Int_t BinarySearch(Float_t r, TArrayF, Int_t from, Int_t upto);
351 static void SortMin(Int_t *,Float_t *,Float_t *,Float_t *,Float_t *,Int_t);
353 ClassDef(AliMUONRawCluster,1) //Cluster object for set:MUON
356 //___________________________________________
357 class AliMUONcorrelation : public TObject {
360 // correlation starts from the 1-st cathode
361 // last number in arrays corresponds to cluster on 1-st cathode
363 Int_t fCorrelIndex[4]; // entry number in TreeR for the associated
364 // cluster candidates on the 2-nd cathode
365 Float_t fX[4] ; // X of clusters on the 2-nd cathode
366 Float_t fY[4] ; // Y of clusters
369 AliMUONcorrelation() {
370 fCorrelIndex[0]=fCorrelIndex[1]=fCorrelIndex[2]=fCorrelIndex[3]=0;
371 fX[0]=fX[1]=fX[2]=fX[3]=0; fY[0]=fY[1]=fY[2]=fY[3]=0;
373 AliMUONcorrelation(Int_t *idx, Float_t *x, Float_t *y);
374 virtual ~AliMUONcorrelation() {}
375 ClassDef(AliMUONcorrelation,1) //Cathode correlation object for set:MUON