Implement the new logging system (AliLog)
[u/mrichter/AliRoot.git] / FMD / AliFMD.h
CommitLineData
4347b38f 1// -*- mode: c++ -*-
d28dcc0d 2#ifndef ALIFMD_H
3#define ALIFMD_H
4347b38f 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
5 * reserved.
6 *
7 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 *
9 * See cxx source for full Copyright notice
10 */
3da30618 11
fe4da5cc 12////////////////////////////////////////////////
d28dcc0d 13// Manager and hits classes for set:Si-FMD //
fe4da5cc 14////////////////////////////////////////////////
3d44ce66 15
4347b38f 16#ifndef ALIDETECTOR_H
17# include <AliDetector.h>
18#endif
19#ifndef ALIFMDSUBDETECTOR_H
20# include "AliFMDSubDetector.h"
21#endif
22#ifndef ALIFMDRING_H
23# include "AliFMDRing.h"
24#endif
25#ifndef ROOT_TBranch
26# include <TBranch.h>
27#endif
28#ifndef ROOT_TArrayI
29# include <TArrayI.h>
30#endif
31
32//____________________________________________________________________
33class AliFMD : public AliDetector
34{
fe4da5cc 35public:
36 AliFMD();
4347b38f 37 AliFMD(const char *name, const char *title, bool detailed);
38 AliFMD(const AliFMD& FMD) : AliDetector(FMD) {} //copy ctor
39 virtual ~AliFMD();
40 AliFMD& operator=(const AliFMD&) {return *this;}
41
42 // GEometry ANd Tracking (GEANT :-)
43 virtual void CreateGeometry();
44 virtual void CreateMaterials();
fe4da5cc 45 virtual void Init();
4347b38f 46 virtual void StepManager() = 0;
47 AliFMDSubDetector* GetFMD1() const { return fFMD1; }
48 AliFMDSubDetector* GetFMD2() const { return fFMD2; }
49 AliFMDSubDetector* GetFMD3() const { return fFMD3; }
50 AliFMDRing* GetInner() const { return fInner; }
51 AliFMDRing* GetOuter() const { return fOuter; }
58d6a713 52
4347b38f 53 // Graphics and event display
54 virtual void BuildGeometry();
55 virtual void DrawDetector();
56 virtual const Int_t DistanceToPrimitive(Int_t px, Int_t py);
3d44ce66 57
4347b38f 58 // Hit and digit management
59 virtual void MakeBranch(Option_t *opt=" ");
60 virtual void SetHitsAddressBranch(TBranch *b);
61 virtual void SetTreeAddress();
62 virtual TClonesArray* SDigits() { return fSDigits; }
63 virtual void ResetSDigits();
64 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
65 virtual void AddHit(Int_t track,
66 UShort_t detector,
67 Char_t ring,
68 UShort_t sector,
69 UShort_t strip,
70 Float_t x=0,
71 Float_t y=0,
72 Float_t z=0,
73 Float_t px=0,
74 Float_t py=0,
75 Float_t pz=0,
76 Float_t edep=0,
77 Int_t pdg=0,
78 Float_t t=0);
79 virtual void AddDigit(Int_t *digits);
80 virtual void AddDigit(UShort_t detector=0,
81 Char_t ring='\0',
82 UShort_t sector=0,
83 UShort_t strip=0,
84 UShort_t count1=0,
85 Short_t count2=-1,
86 Short_t count3=-1);
87 virtual void AddSDigit(Int_t *digits);
88 virtual void AddSDigit(UShort_t detector=0,
89 Char_t ring='\0',
90 UShort_t sector=0,
91 UShort_t strip=0,
92 Float_t edep=0,
93 UShort_t count1=0,
94 Short_t count2=-1,
95 Short_t count3=-1);
96
97 // Digitisation
c92eb8ad 98 virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
4347b38f 99 virtual void Hits2Digits();
100 virtual void Hits2SDigits();
101
102 // Raw data
103 virtual void Digits2Raw();
104
105 // Set various parameters
106 void SetLegLength(Double_t length=1);
107 void SetLegRadius(Double_t radius=.5);
108 void SetLegOffset(Double_t offset=.5);
109 void SetModuleSpacing(Double_t spacing=1);
110
111 // Get various parameters
112 Int_t GetSiId() const { return (*fIdtmed)[kSiId]; }
113 Int_t GetAirId() const { return (*fIdtmed)[kAirId]; }
114 Int_t GetPlasticId() const { return (*fIdtmed)[kPlasticId]; }
115 Int_t GetPcbId() const { return (*fIdtmed)[kPcbId]; }
116 Int_t GetKaptionId() const { return (*fIdtmed)[kKaptionId]; }
117 Int_t GetCarbonId() const { return (*fIdtmed)[kCarbonId]; }
118 Int_t GetPrintboardRotationId() const { return fPrintboardRotationId; }
119 Int_t GetShortLegId() const { return fShortLegId; }
120 Int_t GetLongLegId() const { return fLongLegId; }
121 Double_t GetLegLength() const { return fLegLength; }
122 Double_t GetLegRadius() const { return fLegRadius; }
123 Double_t GetModuleSpacing() const { return fModuleSpacing; }
dc8af42e 124
4347b38f 125 // Utility
126 void Browse(TBrowser* b);
127 Float_t GetSiDensity() const { return fSiDensity; }
128 enum {
129 kBaseDDL = 0x1000 // DDL offset for the FMD
130 };
131protected:
132 enum {
133 kSiId, // ID of Si medium
134 kAirId, // ID of Air medium
135 kPlasticId, // ID of Plastic medium
136 kPcbId, // ID of PCB medium
137 kSiChipId, // ID of Si Chip medium
138 kKaptionId, // ID of Kaption medium
139 kCarbonId // ID of Carbon medium
140 };
37c55dc0 141
4347b38f 142 void SetSiDensity(Float_t r=2.33) { fSiDensity = r; }
143 TClonesArray* HitsArray();
144 TClonesArray* DigitsArray();
145 TClonesArray* SDigitsArray();
146
147 AliFMDRing* fInner; // Inner ring structure
148 AliFMDRing* fOuter; // Outer ring structure
149 AliFMDSubDetector* fFMD1; // FMD1 structure
150 AliFMDSubDetector* fFMD2; // FMD2 structure
151 AliFMDSubDetector* fFMD3; // FMD3 structure
37c55dc0 152
4347b38f 153 TClonesArray* fSDigits;
154 Int_t fNsdigits;
155
156 Float_t fSiDensity; // Density of Silicon
157 Int_t fPrintboardRotationId; // ID of Rotation of print bard
158 Int_t fIdentityRotationId; // ID of identity matrix
159 Int_t fShortLegId; // ID short leg volume
160 Int_t fLongLegId; // ID long leg volume
161 Double_t fLegLength; // Leg length
162 Double_t fLegRadius; // Leg radius
163 Double_t fModuleSpacing; // Staggering offset
164
165 ClassDef(AliFMD,8) // Base class FMD entry point
fe4da5cc 166};
dc8af42e 167
4347b38f 168//____________________________________________________________________
169class AliFMDv0 : public AliFMD
170{
171public:
172 AliFMDv0() {}
173 AliFMDv0(const char *name, const char *title="Coarse geometry")
174 : AliFMD(name, title, false)
175 {}
176 virtual ~AliFMDv0()
177 {}
178
179 // Required member functions
180 virtual Int_t IsVersion() const {return 0;}
181 virtual void StepManager() {}
182
183 ClassDef(AliFMDv0,1) // Coarse FMD geometry
184};
185
186//____________________________________________________________________
187#ifndef ROOT_TLorentzVector
188# include <TLorentzVector.h>
189#endif
190
191class AliFMDv1 : public AliFMD
192{
193public:
194 AliFMDv1() {}
195 AliFMDv1(const char *name, const char *title="Detailed geometry")
196 : AliFMD(name, title, true)
197 {}
198 virtual ~AliFMDv1() {}
199
200 // Required member functions
201 virtual Int_t IsVersion() const {return 1;}
202 virtual void StepManager();
203protected:
204 Double_t fCurrentDeltaE; // The current accumelated energy loss
205 TLorentzVector fCurrentV; // Current production vertex
206 TLorentzVector fCurrentP; // Current momentum vector
207 Int_t fCurrentPdg; // Current PDG code
208
209 ClassDef(AliFMDv1,3) // Detailed FMD geometry
210};
dc8af42e 211
4347b38f 212#endif
213//____________________________________________________________________
214//
215// EOF
216//