]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MFT/AliMFT.h
Analysis code updated
[u/mrichter/AliRoot.git] / MFT / AliMFT.h
1 #ifndef AliMFT_H
2 #define AliMFT_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 //====================================================================================================================================================
8 //
9 //      Geometry of the Muon Forward Tracker based on TGeo
10 //
11 //      Contact author: antonio.uras@cern.ch
12 //
13 //====================================================================================================================================================
14
15 #include "TFile.h"  
16 #include "TGeoManager.h"    
17 #include "TGeoVolume.h"
18 #include "TGeoMatrix.h"
19 #include "TVirtualMC.h"
20 #include "TClonesArray.h"
21 #include "TGeoGlobalMagField.h"
22 #include "AliRun.h"
23 #include "AliLoader.h"
24 #include "AliDetector.h"
25 #include "AliMC.h"
26 #include "AliMagF.h"
27 #include "AliMFTHit.h"
28 #include "AliMFTDigit.h"
29 #include "AliMFTCluster.h"
30 #include "AliTrackReference.h"
31 #include "AliMFTSegmentation.h"
32 #include "AliMFTDigitizer.h"
33 #include "AliMFTPlane.h"
34 #include "TString.h"
35 #include "TObjArray.h"
36 #include "AliMFTConstants.h"
37
38 //====================================================================================================================================================
39
40 class AliMFT : public AliDetector  {
41
42 public:
43
44   AliMFT();
45   AliMFT(const Char_t *name, const Char_t *title);
46   AliMFT(const Char_t *name, const Char_t *title, Char_t *nameGeomFile);
47
48   virtual ~AliMFT();
49
50   Int_t IsVersion() const { return fVersion; }
51   
52   // ------- framework part -----------------------------------------------------------------------------------
53   void CreateMaterials();                       // from AliModule invoked from AliMC
54   void CreateGeometry();                        // from AliModule invoked from AliMC
55   void AddAlignableVolumes();                     
56   void StepManager();                           // from AliModule invoked from AliMC::Stepping()
57   void Hits2SDigits();
58   void Hits2SDigitsLocal(TClonesArray *hits, const TObjArray *pSDig, Int_t track);
59   void MakeBranch(Option_t *option="");
60   void SetTreeAddress();
61           
62   // ------- create containers -----------------------------------------------------------------------------------
63   void CreateHits();
64   void CreateSDigits();
65   void CreateDigits();
66   void CreateRecPoints();
67
68   TObjArray*    GetSDigitsList()            const { return fSDigitsPerPlane; }     // get sdigits list for all planes
69   TClonesArray* GetSDigitsList(Int_t plane) const { return fSDigitsPerPlane ? (TClonesArray*) fSDigitsPerPlane->At(plane):0; } 
70
71   TObjArray*    GetDigitsList()            const{return fDigitsPerPlane;}          // get digits list for all layers
72   TClonesArray* GetDigitsList(Int_t plane) const{return fDigitsPerPlane ? (TClonesArray*) fDigitsPerPlane->At(plane):0; }
73
74   TObjArray*    GetRecPointsList()            const{return fRecPointsPerPlane;}    // get cluster list for all layers
75   TClonesArray* GetRecPointsList(Int_t plane) const{return fRecPointsPerPlane ? (TClonesArray*) fRecPointsPerPlane->At(plane):0; }
76
77   void ResetSDigits()   { if(fSDigitsPerPlane)   for(int iPlane=0; iPlane<fNPlanes; iPlane++) ((TClonesArray*) fSDigitsPerPlane  ->At(iPlane))->Clear(); }   // reset sdigits list  
78   void ResetDigits()    { if(fDigitsPerPlane)    for(int iPlane=0; iPlane<fNPlanes; iPlane++) ((TClonesArray*) fDigitsPerPlane   ->At(iPlane))->Clear(); }   // reset digits list
79   void ResetRecPoints() { if(fRecPointsPerPlane) for(int iPlane=0; iPlane<fNPlanes; iPlane++) ((TClonesArray*) fRecPointsPerPlane->At(iPlane))->Clear(); }   // reset recPoints list
80   
81   AliDigitizer* CreateDigitizer(AliDigitizationInput *digInp) const { return new AliMFTDigitizer(digInp); }
82   
83   AliMFTSegmentation* GetSegmentation() const { return fSegmentation; }
84
85   enum EMedia{kAir, kSi, kReadout, kSupport};  // media IDs used in CreateMaterials  
86     
87   // Geometry/segmentation creation part
88   TGeoVolumeAssembly* CreateVol();
89   void AddAlignableVolumes() const { /* not needed */ return; }
90   void SetGeometry();
91
92   void  SetNSlices(Int_t nSlices) { fNSlices = nSlices; }
93   Int_t GetNSlices() const { return fNSlices; }
94
95   Int_t GetNPlanes() const { return fNPlanes; }
96
97   void SetChargeDispersion(Double_t chargeDispersion) { fChargeDispersion = chargeDispersion; }
98   Double_t GetChargeDispersion() { return fChargeDispersion; }
99   void SetNStepForChargeDispersion(Int_t nStepForChargeDispersion) { fNStepForChargeDispersion = nStepForChargeDispersion; }
100   Int_t GetNStepForChargeDispersion() { return fNStepForChargeDispersion; }
101   Double_t GetSingleStepForChargeDispersion() { return fSingleStepForChargeDispersion; }
102
103   void SetDensitySupportOverSi(Double_t density) { if (density>1e-6) fDensitySupportOverSi=density; else fDensitySupportOverSi=1e-6; }
104
105 protected:
106
107   static const Int_t fNMaxPlanes = AliMFTConstants::fNMaxPlanes;        // max number of MFT planes
108
109   Int_t fVersion;
110
111   Int_t fNPlanes;                             // # of MFT planes
112   Int_t fNSlices;                             // # of slices per MFT plane
113   
114   TObjArray *fSDigitsPerPlane;                // ![fNPlanes] list of sdigits [per plane]
115   TObjArray *fDigitsPerPlane;                 // ![fNPlanes] list of digits [per plane]
116   TObjArray *fRecPointsPerPlane;              // ![fNPlanes] list of recPoints [per plane]
117   TClonesArray *fSideDigits;                  // ! list of digits fired by the charge dispersion coming from the main hit
118
119   AliMFTSegmentation *fSegmentation;
120
121   TString fNameGeomFile;
122
123   Double_t fChargeDispersion;
124   Double_t fSingleStepForChargeDispersion;
125   Int_t fNStepForChargeDispersion;
126
127   Double_t fDensitySupportOverSi;
128   
129 private:
130
131   AliMFT (const AliMFT& mft);             // dummy copy constructor
132   AliMFT &operator=(const AliMFT& mft);   // dummy assignment operator
133   
134   ClassDef(AliMFT,1) 
135     
136 };
137
138 //====================================================================================================================================================
139
140 #endif
141