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