]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUON.h
Introducing Copyright include file
[u/mrichter/AliRoot.git] / MUON / AliMUON.h
CommitLineData
fe4da5cc 1#ifndef MUON_H
2#define MUON_H
3////////////////////////////////////////////////
4// Manager and hits classes for set:MUON //
5////////////////////////////////////////////////
6#include "AliDetector.h"
7#include "AliHit.h"
8#include "AliMUONConst.h"
a897a37a 9#include "AliDigit.h"
10#include "AliMUONchamber.h"
11#include "AliMUONSegRes.h"
fe4da5cc 12#include <TVector.h>
13#include <TObjArray.h>
a897a37a 14#include <TArrayF.h>
15#include <TFile.h>
16#include <TTree.h>
17typedef enum {simple, medium, big} Cluster_t;
fe4da5cc 18
19static const int NCH=14;
20
21class AliMUONcluster;
a897a37a 22class AliMUONRawCluster;
23class AliMUONClusterFinder;
24class AliMUONcorrelation;
fe4da5cc 25
fe4da5cc 26
27//----------------------------------------------
fe4da5cc 28
29
30class AliMUONcluster : public TObject {
31public:
32
33 Int_t fHitNumber; // Hit number
34 Int_t fCathode; // Cathode number
35 Int_t fQ ; // Total charge
36 Int_t fPadX ; // Pad number along X
37 Int_t fPadY ; // Pad number along Y
38 Int_t fQpad ; // Charge per pad
39 Int_t fRSec ; // R -sector of pad
40
41public:
42 AliMUONcluster() {
43 fHitNumber=fQ=fPadX=fPadY=fQpad=fRSec=0;
44}
45 AliMUONcluster(Int_t *clhits);
46 virtual ~AliMUONcluster() {;}
47
48 ClassDef(AliMUONcluster,1) //Cluster object for set:MUON
49};
50
51
52class AliMUONreccluster : public TObject {
53public:
54
55 Int_t fTracks[3]; //labels of overlapped tracks
56
57 Int_t fQ ; // Q of cluster (in ADC counts)
58 Float_t fX ; // X of cluster
59 Float_t fY ; // Y of cluster
a897a37a 60
fe4da5cc 61public:
62 AliMUONreccluster() {
e3a4d40e 63 fTracks[0]=fTracks[1]=fTracks[2]=-1;
a897a37a 64 fQ=0; fX=fY=0;
fe4da5cc 65 }
66 virtual ~AliMUONreccluster() {;}
67
68 ClassDef(AliMUONreccluster,1) //Cluster object for set:MUON
69};
70
71//_____________________________________________________________________________
72
73class AliMUONdigit : public TObject {
74 public:
75 Int_t fPadX; // Pad number along x
76 Int_t fPadY ; // Pad number along y
77 Int_t fSignal; // Signal amplitude
a897a37a 78 Int_t fTcharges[10]; // charge per track making this digit (up to 10)
79 Int_t fTracks[10]; // primary tracks making this digit (up to 10)
80 Int_t fPhysics; // physics contribution to signal
81 Int_t fHit; // hit number - temporary solution
fe4da5cc 82
83
84
85 public:
86 AliMUONdigit() {}
87 AliMUONdigit(Int_t *digits);
88 AliMUONdigit(Int_t *tracks, Int_t *charges, Int_t *digits);
a897a37a 89 virtual ~AliMUONdigit();
90
fe4da5cc 91 ClassDef(AliMUONdigit,1) //Digits for set:MUON
92};
93//_____________________________________________________________________________
94
95class AliMUONlist : public AliMUONdigit {
96 public:
a897a37a 97 Int_t fChamber; // chamber number of pad
fe4da5cc 98 TObjArray *fTrackList;
fe4da5cc 99 public:
100 AliMUONlist() {fTrackList=0;}
101 AliMUONlist(Int_t rpad, Int_t *digits);
a897a37a 102 virtual ~AliMUONlist() {delete fTrackList;}
fe4da5cc 103 TObjArray *TrackList() {return fTrackList;}
fe4da5cc 104 ClassDef(AliMUONlist,1) //Digits for set:MUON
105};
106//___________________________________________
107
108
109//___________________________________________
110
111class AliMUONhit : public AliHit {
112 public:
113 Int_t fChamber; // Chamber number
a897a37a 114 Float_t fParticle; // Geant3 particle type
fe4da5cc 115 Float_t fTheta ; // Incident theta angle in degrees
116 Float_t fPhi ; // Incident phi angle in degrees
117 Float_t fTlength; // Track length inside the chamber
118 Float_t fEloss; // ionisation energy loss in gas
119 Int_t fPHfirst; // first padhit
120 Int_t fPHlast; // last padhit
a897a37a 121
122// modifs perso
123 Float_t fPTot; // hit momentum P
124 Float_t fCxHit; // Px/P
125 Float_t fCyHit; // Py/P
126 Float_t fCzHit; // Pz/P
127
fe4da5cc 128 public:
129 AliMUONhit() {}
130 AliMUONhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
131 virtual ~AliMUONhit() {}
132
133 ClassDef(AliMUONhit,1) //Hits object for set:MUON
134};
135
136class AliMUON : public AliDetector {
137 public:
138 AliMUON();
139 AliMUON(const char *name, const char *title);
140 virtual ~AliMUON();
141 virtual void AddHit(Int_t, Int_t*, Float_t*);
142 virtual void AddCluster(Int_t*);
143 virtual void AddDigits(Int_t, Int_t*, Int_t*, Int_t*);
a897a37a 144 virtual void AddRawCluster(Int_t, const AliMUONRawCluster&);
a897a37a 145 virtual void AddCathCorrel(Int_t, Int_t*, Float_t*, Float_t*);
fe4da5cc 146 virtual void BuildGeometry();
147 virtual void CreateGeometry() {}
148 virtual void CreateMaterials() {}
149 virtual void StepManager();
150 Int_t DistancetoPrimitive(Int_t px, Int_t py);
151 virtual Int_t IsVersion() const =0;
152//
153 TClonesArray *Clusters() {return fClusters;}
a897a37a 154 virtual void MakeTreeC(Option_t *option="C");
155 void GetTreeC(Int_t);
fe4da5cc 156 virtual void MakeBranch(Option_t *opt=" ");
157 void SetTreeAddress();
158 virtual void ResetHits();
159 virtual void ResetDigits();
a897a37a 160 virtual void ResetRawClusters();
a897a37a 161 virtual void ResetCorrelation();
162 virtual void FindClusters(Int_t,Int_t);
027eb005 163 virtual void Digitise(Int_t,Int_t,Option_t *opt1=" ",Option_t *opt2=" ",Text_t *name=" ");
a897a37a 164 virtual void CathodeCorrelation(Int_t);
165 virtual void SortTracks(Int_t *,Int_t *,Int_t);
166//
167// modifs perso
168
e3a4d40e 169 void InitTracking(Double_t &, Double_t &, Double_t &);
a897a37a 170 void Reconst(Int_t &,Int_t &,Int_t,Int_t &,Int_t&,Int_t&, Option_t *option,Text_t *filename);
171 void FinishEvent();
e3a4d40e 172 void CloseTracking();
a897a37a 173 void SetCutPxz(Double_t p) {fSPxzCut=p;}
174 void SetSigmaCut(Double_t p) {fSSigmaCut=p;}
175 void SetXPrec(Double_t p) {fSXPrec=p;}
176 void SetYPrec(Double_t p) {fSYPrec=p;}
177 Double_t GetCutPxz() {return fSPxzCut;}
178 Double_t GetSigmaCut() {return fSSigmaCut;}
179 Double_t GetXPrec() {return fSXPrec;}
180 Double_t GetYPrec() {return fSYPrec;}
181// fin modifs perso
182
fe4da5cc 183// Configuration Methods (per station id)
184//
185// Set Chamber Segmentation Parameters
186// id refers to the station and isec to the cathode plane
187 virtual void SetPADSIZ(Int_t id, Int_t isec, Float_t p1, Float_t p2);
188
189// Set Signal Generation Parameters
a897a37a 190 virtual void SetSigmaIntegration(Int_t id, Float_t p1);
191 virtual void SetChargeSlope(Int_t id, Float_t p1);
192 virtual void SetChargeSpread(Int_t id, Float_t p1, Float_t p2);
193 virtual void SetMaxAdc(Int_t id, Float_t p1);
fe4da5cc 194// Set Segmentation and Response Model
195 virtual void SetSegmentationModel(Int_t id, Int_t isec, AliMUONsegmentation *segmentation);
196 virtual void SetResponseModel(Int_t id, AliMUONresponse *response);
197 virtual void SetNsec(Int_t id, Int_t nsec);
a897a37a 198// Set Reconstruction Model
199 virtual void SetReconstructionModel(Int_t id, AliMUONClusterFinder *reconstruction);
fe4da5cc 200// Set Stepping Parameters
a897a37a 201 virtual void SetMaxStepGas(Float_t p1);
202 virtual void SetMaxStepAlu(Float_t p1);
203 virtual void SetMaxDestepGas(Float_t p1);
204 virtual void SetMaxDestepAlu(Float_t p1);
205 virtual void SetMuonAcc(Bool_t acc=0, Float_t angmin=2, Float_t angmax=9);
fe4da5cc 206// Response Simulation
207 virtual void MakePadHits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id);
208// Return reference to Chamber #id
209 virtual AliMUONchamber& Chamber(Int_t id) {return *((AliMUONchamber *) (*fChambers)[id]);}
210// Retrieve pad hits for a given Hit
a897a37a 211 virtual AliMUONcluster* FirstPad(AliMUONhit *, TClonesArray *);
212 virtual AliMUONcluster* NextPad(TClonesArray *);
fe4da5cc 213// Return pointers to digits
214 TObjArray *Dchambers() {return fDchambers;}
215 Int_t *Ndch() {return fNdch;}
216 virtual TClonesArray *DigitsAddress(Int_t id) {return ((TClonesArray *) (*fDchambers)[id]);}
217// Return pointers to reconstructed clusters
a897a37a 218 TObjArray *RawClusters() {return fRawClusters;}
219 Int_t *Nrawch() {return fNrawch;}
220 virtual TClonesArray *RawClustAddress(Int_t id) {return ((TClonesArray *) (*fRawClusters)[id]);}
221
222// modifs perso
223 AliMUONRawCluster *RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster);
224
225
226 // Return pointers to list of correlated clusters
227 TObjArray *CathCorrel() {return fCathCorrel;}
228 Int_t *Ncorch() {return fNcorch;}
229 virtual TClonesArray *CathCorrelAddress(Int_t id)
230 {return ((TClonesArray *) (*fCathCorrel)[id]);}
231
a897a37a 232// Return pointer to TreeC
233 TTree *TreeC() {return fTreeC;}
fe4da5cc 234 protected:
235 TObjArray *fChambers; // List of Tracking Chambers
236 Int_t fNclusters; // Number of clusters
237 TClonesArray *fClusters; // List of clusters
238 TObjArray *fDchambers; // List of digits
fe4da5cc 239 Int_t *fNdch; // Number of digits
a897a37a 240
a897a37a 241
242 TObjArray *fRawClusters; // List of raw clusters
243 Int_t *fNrawch; // Number of raw clusters
244 TObjArray *fCathCorrel; // List of correlated clusters
245 Int_t *fNcorch; // Number of correl clusters
246 TTree *fTreeC; // Cathode correl index tree
247
fe4da5cc 248//
249 Bool_t fAccCut; //Transport acceptance cut
250 Float_t fAccMin; //Minimum acceptance cut used during transport
251 Float_t fAccMax; //Minimum acceptance cut used during transport
252//
253
254// Stepping Parameters
255 Float_t fMaxStepGas; // Maximum step size inside the chamber gas
256 Float_t fMaxStepAlu; // Maximum step size inside the chamber aluminum
257 Float_t fMaxDestepGas; // Maximum relative energy loss in gas
258 Float_t fMaxDestepAlu; // Maximum relative energy loss in aluminum
a897a37a 259//
260// modifs perso
261// Parameters for reconstruction program
262 Double_t fSPxzCut; // Pxz cut (GeV/c) to begin the track finding
263 Double_t fSSigmaCut; // Number of sig. delimiting the searching areas
264 Double_t fSXPrec; // Chamber precision in X (cm)
265 Double_t fSYPrec; // Chamber precision in Y (cm)
266
267 Text_t *fFileName;
fe4da5cc 268
269 protected:
270
271 ClassDef(AliMUON,1) //Hits manager for set:MUON
272};
273//___________________________________________
a897a37a 274
275class AliMUONRawCluster : public TObject {
276public:
277
278 Int_t fTracks[3]; //labels of overlapped tracks
279 Int_t fQ ; // Q of cluster (in ADC counts)
280 Float_t fX ; // X of cluster
281 Float_t fY ; // Y of cluster
282 Int_t fPeakSignal;
283 Int_t fIndexMap[50]; //indeces of digits
284 Int_t fOffsetMap[50]; //Emmanuel special
285 Float_t fContMap[50]; //Contribution from digit
286 Int_t fPhysicsMap[50];
287 Int_t fMultiplicity; //cluster multiplicity
288 Int_t fNcluster[2];
289 Int_t fClusterType;
290 public:
291 AliMUONRawCluster() {
292 fTracks[0]=fTracks[1]=fTracks[2]=-1;
293 fQ=0; fX=fY=0; fMultiplicity=0;
294 for (int k=0;k<50;k++) {
295 fIndexMap[k]=-1;
296 fOffsetMap[k]=0;
297 fContMap[k]=0;
298 fPhysicsMap[k]=-1;
299 }
300 fNcluster[0]=fNcluster[1]=-1;
301 }
302 virtual ~AliMUONRawCluster() {}
303
304 Float_t GetRadius() {return TMath::Sqrt(fX*fX+fY*fY);}
305
a6f39961 306 Bool_t IsSortable() const {return kTRUE;}
a897a37a 307 Int_t Compare(TObject *obj);
308 Int_t PhysicsContribution();
309 static Int_t BinarySearch(Float_t r, TArrayF, Int_t from, Int_t upto);
310 static void SortMin(Int_t *,Float_t *,Float_t *,Float_t *,Float_t *,Int_t);
311
312 ClassDef(AliMUONRawCluster,1) //Cluster object for set:MUON
313};
314
315//___________________________________________
316class AliMUONcorrelation : public TObject {
317public:
318
319 // correlation starts from the 1-st cathode
320 // last number in arrays corresponds to cluster on 1-st cathode
321
322 Int_t fCorrelIndex[4]; // entry number in TreeR for the associated
323 // cluster candidates on the 2-nd cathode
324 Float_t fX[4] ; // X of clusters on the 2-nd cathode
325 Float_t fY[4] ; // Y of clusters
326
327public:
328 AliMUONcorrelation() {
329 fCorrelIndex[0]=fCorrelIndex[1]=fCorrelIndex[2]=fCorrelIndex[3]=0;
330 fX[0]=fX[1]=fX[2]=fX[3]=0; fY[0]=fY[1]=fY[2]=fY[3]=0;
331 }
332 AliMUONcorrelation(Int_t *idx, Float_t *x, Float_t *y);
333 virtual ~AliMUONcorrelation() {}
334 ClassDef(AliMUONcorrelation,1) //Cathode correlation object for set:MUON
335};
336
fe4da5cc 337#endif
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352