4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 //====================================================================================================================================================
9 // Geometry of the Muon Forward Tracker based on TGeo
11 // Contact author: antonio.uras@cern.ch
13 //====================================================================================================================================================
16 #include "TGeoManager.h"
17 #include "TGeoVolume.h"
18 #include "TGeoMatrix.h"
19 #include "TVirtualMC.h"
20 #include "TClonesArray.h"
21 #include "TGeoGlobalMagField.h"
23 #include "AliLoader.h"
24 #include "AliDetector.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"
35 #include "TObjArray.h"
36 #include "AliMFTConstants.h"
38 //====================================================================================================================================================
40 class AliMFT : public AliDetector {
45 AliMFT(const Char_t *name, const Char_t *title);
46 AliMFT(const Char_t *name, const Char_t *title, Char_t *nameGeomFile);
50 Int_t IsVersion() const { return fVersion; }
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()
58 void Hits2SDigitsLocal(TClonesArray *hits, const TObjArray *pSDig, Int_t track);
59 void MakeBranch(Option_t *option="");
60 void SetTreeAddress();
62 // ------- create containers -----------------------------------------------------------------------------------
66 void CreateRecPoints();
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; }
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; }
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; }
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
81 AliDigitizer* CreateDigitizer(AliDigitizationInput *digInp) const { return new AliMFTDigitizer(digInp); }
83 AliMFTSegmentation* GetSegmentation() const { return fSegmentation; }
85 enum EMedia{kAir, kSi, kReadout, kSupport, kCarbon, kAlu, kWater, kSiO2, kInox}; // media IDs used in CreateMaterials
87 // Geometry/segmentation creation part
88 TGeoVolumeAssembly* CreateVol();
89 void AddAlignableVolumes() const { /* not needed */ return; }
92 void SetNSlices(Int_t nSlices) { fNSlices = nSlices; }
93 Int_t GetNSlices() const { return fNSlices; }
95 Int_t GetNPlanes() const { return fNPlanes; }
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; }
103 void SetDensitySupportOverSi(Double_t density) { if (density>1e-6) fDensitySupportOverSi=density; else fDensitySupportOverSi=1e-6; }
105 //--------- for underlying and pile-up events --------------------
107 void SetFileNameForUnderlyingEvent(TString fileName) { fFileNameForUnderyingEvent += fileName; }
108 void SetFileNameForPileUpEvents(TString fileName) { fFileNameForPileUpEvents += fileName; }
110 void SetUnderlyingEventID(Short_t eventID) { fUnderlyingEventID = eventID; }
111 void SetPileUpEventID(Short_t i, Short_t eventID) { if (i>=0 && i<AliMFTConstants::fNMaxPileUpEvents) fPileUpEventsIDs[i] = eventID; }
113 const Char_t* GetFileNameForUnderlyingEvent() { return fFileNameForUnderyingEvent; }
114 const Char_t* GetFileNameForPileUpEvents() { return fFileNameForPileUpEvents; }
115 Short_t GetUnderlyingEventID() { return fUnderlyingEventID; }
116 Short_t GetPileUpEventID(Short_t i) { if (i>=0 && i<AliMFTConstants::fNMaxPileUpEvents) return fPileUpEventsIDs[i]; else return -1; }
120 static const Int_t fNMaxPlanes = AliMFTConstants::fNMaxPlanes; // max number of MFT planes
124 Int_t fNPlanes; // # of MFT planes
125 Int_t fNSlices; // # of slices per MFT plane
127 TObjArray *fSDigitsPerPlane; // ![fNPlanes] list of sdigits [per plane]
128 TObjArray *fDigitsPerPlane; // ![fNPlanes] list of digits [per plane]
129 TObjArray *fRecPointsPerPlane; // ![fNPlanes] list of recPoints [per plane]
130 TClonesArray *fSideDigits; // ! list of digits fired by the charge dispersion coming from the main hit
132 AliMFTSegmentation *fSegmentation;
134 TString fNameGeomFile;
136 Double_t fChargeDispersion;
137 Double_t fSingleStepForChargeDispersion;
138 Int_t fNStepForChargeDispersion;
140 Double_t fDensitySupportOverSi;
142 TString fFileNameForUnderyingEvent, fFileNameForPileUpEvents;
143 Short_t fNPileUpEvents, fUnderlyingEventID, fPileUpEventsIDs[AliMFTConstants::fNMaxPileUpEvents];
147 AliMFT (const AliMFT& mft); // dummy copy constructor
148 AliMFT &operator=(const AliMFT& mft); // dummy assignment operator
154 //====================================================================================================================================================