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