Introduction of the Copyright and cvs Log
[u/mrichter/AliRoot.git] / PHOS / AliPHOS.h
CommitLineData
fe4da5cc 1#ifndef PHOS_H
2#define PHOS_H
3////////////////////////////////////////////////
4// Manager and hits classes for set:PHOS //
5////////////////////////////////////////////////
6
fe4da5cc 7// --- ROOT system ---
8#include <TArray.h>
9#include <TRandom.h>
10#include <TH2.h>
bc9ab547 11#include <TVector3.h>
fe4da5cc 12
13// --- galice header files ---
14#include "AliDetector.h"
15#include "AliHit.h"
16#include "AliRun.h"
17
18class AliPHOSgamma : public TObject {
19
20 public:
21 virtual ~AliPHOSgamma(void) {}
22 AliPHOSgamma(void) {}
23 AliPHOSgamma(const AliPHOSgamma &g) { *this=g; }
bc9ab547 24 AliPHOSgamma(Float_t X, Float_t Y, Float_t E,
25 Float_t Px, Float_t Py, Float_t Pz,
26 Int_t Ipart) :
27 fX(X), fY(Y), fE(E),
28 fPx(Px), fPy(Py), fPz(Pz),
29 fIpart(Ipart)
fe4da5cc 30 {}
31
32 Float_t fX; // cm. x-coordinate (in beam direction)
fe4da5cc 33 Float_t fY; // cm. y-coordinate (around beam)
fe4da5cc 34
35 Float_t fE; // GeV. energy
fe4da5cc 36
37 Float_t fPx; // GeV. Gamma momentum Px
38 Float_t fPy; // GeV. Gamma momentum Py
39 Float_t fPz; // GeV. Gamma momentum Pz
40
bc9ab547 41 Int_t fIpart; // Current particle number (GEANT particle code)
42
fe4da5cc 43 void Print(Option_t *options=NULL);
44 AliPHOSgamma &operator=(const AliPHOSgamma &g);
45
46 private:
47
48 ClassDef(AliPHOSgamma,1) // Gamma particle in PHOS cradle
49};
50
51//______________________________________________________________________________
52
53class AliPHOShit : public AliHit {
54
55public:
56 Int_t fVolume[5]; //array of volumes
57 Float_t fELOS; //ELOS
58
59public:
60 AliPHOShit() {}
61 AliPHOShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
62 virtual ~AliPHOShit() {}
63
64 ClassDef(AliPHOShit,1) //Hits object for set:PHOS
65};
66
67//______________________________________________________________________________
68
69
70class AliPHOSCradle : public TObject {
71
72 public:
73
bc9ab547 74 virtual ~AliPHOSCradle(void);
fe4da5cc 75 AliPHOSCradle(void);
76 AliPHOSCradle(int Geometry ,
77 float CrystalSideSize ,
78 float CrystalLength ,
79 float WrapThickness ,
80 float AirThickness ,
81 float PIN_SideSize ,
82 float PIN_Length ,
83 float Radius ,
fe4da5cc 84 int Nz ,
85 int Nphi ,
86 float Angle );
fe4da5cc 87 Float_t GetCrystalSideSize (void) const {return fCrystalSideSize;}
88 Float_t GetCellSideSize (void) const {return fCrystalSideSize+2*fWrapThickness+2*fAirThickness;}
89 Float_t GetCrystalLength (void) const {return fCrystalLength;}
90 Float_t GetWrapThickness (void) const {return fWrapThickness;}
91 Float_t GetAirThickness (void) const {return fAirThickness;}
92 Float_t GetPIN_SideSize (void) const {return fPIN_SideSize;}
93 Float_t GetPIN_Length (void) const {return fPIN_Length;}
94 Float_t GetRadius (void) const {return fRadius;}
fe4da5cc 95 Int_t GetNz (void) const {return fNz;}
96 Int_t GetNphi (void) const {return fNphi;}
97 Float_t GetPhi (void) const {return fPhi;}
98
99 void Clear(Option_t *opt=""); // Clear all data.
100 void Print(Option_t *opt="");
101 void Distortion(const TH2F *Noise=NULL, const TH2F *Stochastic=NULL, const TH2F *Calibration=NULL);
102 TH2F *CreateHistForDistortion(const char *name, const char *title, Int_t Nx, Int_t Ny,
103 Float_t MU_mu, Float_t MU_sigma, Float_t SIGMA_mu, Float_t SIGMA_sigma);
104 Float_t GetDistortedValue(const TH2F *h, UInt_t n);
105
106 void Reconstruction(Float_t signal_step, UInt_t min_signal_reject);
107
bc9ab547 108 void GetXY(const TVector3 &p,const TVector3 &v,float R,float &x,float &y,float &l) const;
fe4da5cc 109
110 TObjArray &GetGammasReconstructed (void) {return fGammasReconstructed;}
111 TObjArray &GetParticles (void) {return fParticles;}
112
113 TH2F fCellEnergy; // GeV. Energy in cells
114 TH2S fChargedTracksInPIN; // amount. hits in PIN
115
fe4da5cc 116
117 private:
118
119 Int_t fGeometry; // Geometry type: 1 or 2
120 Float_t fCrystalSideSize; // cm.
121 Float_t fCrystalLength; // cm.
122 Float_t fWrapThickness; // cm.
123 Float_t fAirThickness; // cm.
124 Float_t fPIN_SideSize; // cm.
125 Float_t fPIN_Length; // cm.
126
127 Float_t fRadius; // cm. Distance to PHOS
128
fe4da5cc 129
130 Int_t fNz; // Cells amount in beam direction
131 Int_t fNphi; // Cells amount around beam
132
133 Float_t fPhi; // degree. Position of CRADLE center
134
135 TObjArray fGammasReconstructed; // List of reconstructed gammas
136 TObjArray fParticles; // List of particles in the direction of this cradle
137
138 TRandom r; //! Random number class, do not stream
139
140// friend class AliPHOS;
141
142 ClassDef(AliPHOSCradle,1) // PHOS cradle
143};
144
145class AliPHOS : public AliDetector {
146
147 public:
148
149 enum {CradlesBranch_Bit=1};
150
151 AliPHOS();
152 AliPHOS(const char *name, const char *title);
153 virtual ~AliPHOS();
154 virtual void AddHit(Int_t, Int_t*, Float_t*);
155 virtual void BuildGeometry();
156 virtual void CreateGeometry() {}
157 virtual void CreateMaterials();
158 Int_t DistancetoPrimitive(Int_t px, Int_t py);
159 void FinishEvent(void);
160
161 virtual void Init();
162 virtual Int_t IsVersion() const =0;
163 void MakeBranch(Option_t *option);
164 void SetTreeAddress(void);
165 void FinishRun(void);
166 void ResetDigits(void);
167 void Print(Option_t *opt="");
bc9ab547 168 AliPHOSCradle *GetCradleOfTheParticle(const TVector3 &p,const TVector3 &v) const;
fe4da5cc 169 AliPHOSCradle &GetCradle(int n) {return *(AliPHOSCradle*)fCradles->operator[](n);}
170 // AliPHOSCradle &GetCradle(int n) {return *((AliPHOSCradle*) (*fCradles)[n]) ;}
171 void Reconstruction(Float_t signal_step, UInt_t min_signal_reject);
172 virtual void SetFlags(Float_t p1,Float_t p2=0,Float_t p3=0,Float_t p4=0,
173 Float_t p5=0,Float_t p6=0,Float_t p7=0,Float_t p8=0,Float_t p9=0);
174 virtual void SetCell(Float_t p1,Float_t p2=0,Float_t p3=0,Float_t p4=0,
175 Float_t p5=0,Float_t p6=0,Float_t p7=0,Float_t p8=0,Float_t p9=0);
176 virtual void SetRadius(Float_t radius);
177 virtual void SetCradleSize(Int_t nz, Int_t nphi, Int_t ncradles);
178 virtual void SetCradleA(Float_t angle);
fe4da5cc 179 virtual void SetExtra(Float_t p1,Float_t p2=0,Float_t p3=0,Float_t p4=0,
180 Float_t p5=0,Float_t p6=0,Float_t p7=0,Float_t p8=0,Float_t p9=0);
181 virtual void SetTextolitWall(Float_t dx, Float_t dy, Float_t dz);
182 virtual void SetInnerAir(Float_t dx, Float_t dy, Float_t dz);
183 virtual void SetFoam(Float_t dx, Float_t dy, Float_t dz, Float_t dr);
184 virtual void StepManager()=0;
185 virtual void DefPars();
186 virtual void AddPHOSCradles();
187
fe4da5cc 188
ad51aeb0 189 virtual Int_t GetPHOS_IDTMED_PbWO4 (void){return (*fIdtmed)[0];}
ad51aeb0 190 virtual Int_t GetPHOS_IDTMED_Al (void){return (*fIdtmed)[2];}
191 virtual Int_t GetPHOS_IDTMED_Tyvek (void){return (*fIdtmed)[3];}
192 virtual Int_t GetPHOS_IDTMED_PIN (void){return (*fIdtmed)[4];}
193 virtual Int_t GetPHOS_IDTMED_AIR (void){return (*fIdtmed)[99];}
194
fe4da5cc 195 virtual Int_t &GetPHOS_Ndiv_magic (void) {return PHOS_Ndiv_magic;}
196 virtual Float_t GetCrystalSideSize (void) const {return PHOScell[0]; }
197 virtual Float_t GetCrystalLength (void) const {return PHOScell[1]; }
198 virtual Float_t GetWrapThickness (void) const {return PHOScell[2]; }
199 virtual Float_t GetAirThickness (void) const {return PHOScell[3]; }
200 virtual Float_t GetPIN_SideSize (void) const {return PHOScell[4]; }
201 virtual Float_t GetPIN_Length (void) const {return PHOScell[5]; }
202 virtual Float_t GetRadius (void) const {return PHOSradius; }
fe4da5cc 203 virtual Int_t GetNz (void) const {return PHOSsize[0]; }
204 virtual Int_t GetNphi (void) const {return PHOSsize[1]; }
205 virtual Int_t GetCradlesAmount (void) const {return PHOSsize[2]; }
206 virtual Float_t GetAngleBetweenCradles(void) const {return PHOScradlesA;}
207 virtual Float_t GetPHOS_flag (Int_t n) const {return PHOSflags[n];}
208 virtual Float_t GetPHOSextra (Int_t n) const {return PHOSextra[n];}
209 virtual Float_t GetPHOSFoam (Int_t n) const {return PHOSFTI[n];}
210 virtual Float_t GetPHOStxwall (Int_t n) const {return PHOSTXW[n];}
211 virtual Float_t GetPHOSAir (Int_t n) const {return PHOSAIR[n];}
212 virtual Float_t &GetCradleAngle (Int_t n) {return PHOSangle[n];}
213
214
215 TObjArray *fCradles; //! Cradles in PHOS
216 Int_t fDebugLevel;
217
218 TTree *fTreePHOS; //! Pointer to PHOS tree.
219
220private:
221
222 TString fBranchNameOfCradles; //
223 TString fTreeName; // Name of PHOS tree: "PHOS"
224
225#define MAXCRAD 100
226
7f8f914c 227 Float_t PHOSflags[9], PHOScell[9], PHOSradius;
fe4da5cc 228 Int_t PHOSsize[3];
229 Float_t PHOScradlesA,PHOSTXW[3],PHOSAIR[3],PHOSFTI[4],PHOSextra[9],
230 PHOSangle[MAXCRAD];
231 Int_t PHOS_Ndiv_magic;
232
233 ClassDef(AliPHOS,1) //Hits manager for set:PHOS
234};
235
236#endif
237