]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSv0.cxx
Introduction of the Copyright and cvs Log
[u/mrichter/AliRoot.git] / PHOS / AliPHOSv0.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
18*/
19
fe4da5cc 20/////////////////////////////////////////////////////////
21// Manager and hits classes for set:PHOS version 0 //
22/////////////////////////////////////////////////////////
23
24// --- ROOT system ---
25#include "TH1.h"
26#include "TRandom.h"
27#include "TFile.h"
28#include "TTree.h"
29#include "TBRIK.h"
30#include "TNode.h"
31
32// --- galice header files ---
33#include "AliPHOSv0.h"
34#include "AliRun.h"
fe4da5cc 35#include "AliMC.h"
36
37ClassImp(AliPHOSv0)
38
39//______________________________________________________________________________
40
41
8c933dd7 42AliPHOSv0::AliPHOSv0()
fe4da5cc 43{
44 fIdSens=0;
45}
46
47//______________________________________________________________________________
48
49AliPHOSv0::AliPHOSv0(const char *name, const char *title)
50 : AliPHOS(name, title)
51{
52 fIdSens=0;
53}
54
55//___________________________________________
56void AliPHOSv0::Init()
57{
cfce8870 58 fIdSens=gMC->VolId("PXTL");
fe4da5cc 59}
60
61//___________________________________________
62void AliPHOSv0::CreateGeometry()
63{
64// *** DEFINITION OF THE -0.25<y<0.25 TILTED GEOMETRY OF THE PHOS ***
65// ORIGIN : NICK VAN EIJNDHOVEN
66
fe4da5cc 67 Float_t pphi;
7f8f914c 68 Float_t r, dptcb[3], dpair[3], dphos[3], dpucp[3], dpasp[3];
fe4da5cc 69 Float_t dpxtl[3];
70 Float_t yo;
71 Int_t idrotm[99];
72 Float_t xp1, yp1, xp2, yp2;
73
ad51aeb0 74 Int_t *idtmed = fIdtmed->GetArray()-699;
fe4da5cc 75
76// --- Dimensions of PbWO4 crystal ---
77 const Float_t XTL_X=2.2;
78 const Float_t XTL_Y=18.;
79 const Float_t XTL_Z=2.2;
80// --- Tyvek wrapper thickness
81 const Float_t PAP_THICK=0.01;
fe4da5cc 82// --- Polystyrene Foam Outer Cover dimensions ---
83 const Float_t FOC_X=214.6;
84 const Float_t FOC_Y=80.;
85 const Float_t FOC_Z=260.;
86// --- Inner AIR volume dimensions ---
87 const Float_t AIR_X=206.;
88 const Float_t AIR_Y=66.;
89 const Float_t AIR_Z=244.;
90// --- Tyvek Crystal Block dimensions ---
91 const Float_t TCB_X=198.;
92 const Float_t TCB_Y=25.;
93 const Float_t TCB_Z=234.;
94// --- Upper Cooling Plate thickness ---
95 const Float_t UCP_Y=0.06;
96// --- Al Support Plate thickness ---
97 const Float_t ASP_Y=10.;
98//--- Distance from IP to Foam Outer Cover top plate (needs to be 447.) ---
99 const Float_t FOC_R=467.;
100//--- Distance from IP to Crystal Block top Surface (needs to be 460.) ---
101 const Float_t CBS_R=480.;
102
103// --- Dimensions of volumes ---
104
105
106// --- Define PHOS box volume, fill with Polystyrene foam ---
107 dphos[0] = FOC_X/2.;
108 dphos[1] = FOC_Y/2.;
109 dphos[2] = FOC_Z/2.;
cfce8870 110 gMC->Gsvolu("PHOS", "BOX ", idtmed[703], dphos, 3);
fe4da5cc 111
112// --- Define air-filled box, place inside PHOS ---
113 dpair[0] = AIR_X/2.;
114 dpair[1] = AIR_Y/2.;
115 dpair[2] = AIR_Z/2.;
cfce8870 116 gMC->Gsvolu("PAIR", "BOX ", idtmed[798], dpair, 3);
117 gMC->Gspos("PAIR", 1, "PHOS", 0., 0., 0., 0, "ONLY");
fe4da5cc 118
119// --- Define Upper Cooling Panel ---
120// --- place it right behind upper foam plate ---
121 dpucp[0] = TCB_X/2.;
122 dpucp[1] = UCP_Y/2.;
123 dpucp[2] = TCB_Z/2.;
cfce8870 124 gMC->Gsvolu("PUCP", "BOX ", idtmed[701], dpucp, 3);
fe4da5cc 125 yo = (AIR_Y-UCP_Y)/2.;
cfce8870 126 gMC->Gspos("PUCP", 1, "PAIR", 0., yo, 0., 0, "ONLY");
fe4da5cc 127
128// --- Define Crystal Block, fill with Tyvek, position inside PAIR ---
129 dptcb[0] = TCB_X/2.;
130 dptcb[1] = TCB_Y/2.;
131 dptcb[2] = TCB_Z/2.;
cfce8870 132 gMC->Gsvolu("PTCB", "BOX ", idtmed[702], dptcb, 3);
fe4da5cc 133// --- Divide PTCB in X and Z directions --
cfce8870 134 gMC->Gsdvn("PSEC", "PTCB", 11, 1);
135 gMC->Gsdvn("PMOD", "PSEC", 13, 3);
136 gMC->Gsdvn("PSTR", "PMOD", 8, 1);
137 gMC->Gsdvn("PCEL", "PSTR", 8, 3);
fe4da5cc 138 yo = (FOC_Y-TCB_Y)/2. -(CBS_R-FOC_R);
cfce8870 139 gMC->Gspos("PTCB", 1, "PAIR", 0., yo, 0., 0, "ONLY");
fe4da5cc 140
141// --- Define PbWO4 crystal volume, place inside PCEL ---
142 dpxtl[0] = XTL_X/2.;
143 dpxtl[1] = XTL_Y/2.;
144 dpxtl[2] = XTL_Z/2.;
cfce8870 145 gMC->Gsvolu("PXTL", "BOX ", idtmed[699], dpxtl, 3);
fe4da5cc 146 yo = (TCB_Y-XTL_Y)/2. - PAP_THICK;
cfce8870 147 gMC->Gspos("PXTL", 1, "PCEL", 0., yo, 0., 0, "ONLY");
fe4da5cc 148
149// --- Define Al Support Plate, position it inside PAIR ---
150// --- right beneath PTCB ---
151 dpasp[0] = AIR_X/2.;
152 dpasp[1] = ASP_Y/2.;
153 dpasp[2] = AIR_Z/2.;
cfce8870 154 gMC->Gsvolu("PASP", "BOX ", idtmed[701], dpasp, 3);
fe4da5cc 155 yo = (FOC_Y-ASP_Y)/2. - (CBS_R-FOC_R+TCB_Y);
cfce8870 156 gMC->Gspos("PASP", 1, "PAIR", 0., yo, 0., 0, "ONLY");
fe4da5cc 157
fe4da5cc 158// --- Divide in X and Z direction (same way as PTCB) ---
cfce8870 159 gMC->Gsdvn("PCMO", "PCSE", 13, 3);
160 gMC->Gsdvn("PCST", "PCMO", 8, 1);
161 gMC->Gsdvn("PCCE", "PCST", 8, 3);
fe4da5cc 162
163// --- Position various PHOS units in ALICE setup ---
164// --- PHOS itself first ---
165 r = FOC_R+FOC_Y/2.;
166 pphi = TMath::ATan(FOC_X/(2.*FOC_R));
167 xp1 = -r * TMath::Sin(pphi * 3.);
168 yp1 = -r * TMath::Cos(pphi * 3.);
169 xp2 = -r * TMath::Sin(pphi);
170 yp2 = -r * TMath::Cos(pphi);
bc9ab547 171 pphi *= 180/kPI;
fe4da5cc 172 AliMatrix(idrotm[0], 90.,-3*pphi, 90., 90-3*pphi, 0., 0.);
173 AliMatrix(idrotm[1], 90., -pphi, 90., 90-pphi, 0., 0.);
174 AliMatrix(idrotm[2], 90., pphi, 90., 90+pphi, 0., 0.);
175 AliMatrix(idrotm[3], 90., 3*pphi, 90., 90+3*pphi, 0., 0.);
cfce8870 176 gMC->Gspos("PHOS", 1, "ALIC", xp1, yp1, 0., idrotm[0], "ONLY");
177 gMC->Gspos("PHOS", 2, "ALIC", xp2, yp2, 0., idrotm[1], "ONLY");
178 gMC->Gspos("PHOS", 3, "ALIC",-xp2, yp2, 0., idrotm[2], "ONLY");
179 gMC->Gspos("PHOS", 4, "ALIC",-xp1, yp1, 0., idrotm[3], "ONLY");
fe4da5cc 180
fe4da5cc 181// --- Set modules seen without tree for drawings ---
cfce8870 182 gMC->Gsatt("PMOD", "SEEN", -2);
183 gMC->Gsatt("PCMO", "SEEN", -2);
fe4da5cc 184}
185
186//___________________________________________
187void AliPHOSv0::CreateMaterials()
188{
189// *** DEFINITION OF AVAILABLE PHOS MATERIALS ***
190// ORIGIN : NICK VAN EIJNDHOVEN
191
fe4da5cc 192 Int_t ISXFLD = gAlice->Field()->Integ();
193 Float_t SXMGMX = gAlice->Field()->Max();
194
195// --- The PbWO4 crystals ---
196 Float_t ax[3] = { 207.19,183.85,16. };
197 Float_t zx[3] = { 82.,74.,8. };
198 Float_t wx[3] = { 1.,1.,4. };
199 Float_t dx = 8.28;
200// --- The polysterene scintillator (CH) ---
201 Float_t ap[2] = { 12.011,1.00794 };
202 Float_t zp[2] = { 6.,1. };
203 Float_t wp[2] = { 1.,1. };
204 Float_t dp = 1.032;
205// --- Tyvek (CnH2n)
206 Float_t at[2] = { 12.011,1.00794 };
207 Float_t zt[2] = { 6.,1. };
208 Float_t wt[2] = { 1.,2. };
209 Float_t dt = .331;
210// --- Polystyrene foam ---
211 Float_t af[2] = { 12.011,1.00794 };
212 Float_t zf[2] = { 6.,1. };
213 Float_t wf[2] = { 1.,1. };
214 Float_t df = .3;
215
ad51aeb0 216 Int_t *idtmed = fIdtmed->GetArray()-699;
fe4da5cc 217
218 AliMixture( 0, "PbWO4$", ax, zx, dx, -3, wx);
219 AliMixture( 1, "Polystyrene$", ap, zp, dp, -2, wp);
220 AliMaterial(2, "Al$", 26.98, 13., 2.7, 8.9, 999.);
221// --- Absorption length^ is ignored ---
222 AliMixture( 3, "Tyvek$", at, zt, dt, -2, wt);
223 AliMixture( 4, "Foam$", af, zf, df, -2, wf);
224 AliMaterial(9, "Air$", 14.61, 7.3, .001205, 30420., 67500);
225
ad51aeb0 226 AliMedium(0, "PHOS Xtal $", 0, 1, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
ad51aeb0 227 AliMedium(2, "Al parts $", 2, 0, ISXFLD, SXMGMX, 10., .1, .1, .001, .001);
228 AliMedium(3, "Tyvek wrapper$", 3, 0, ISXFLD, SXMGMX, 10., .1, .1, .001, .001);
229 AliMedium(4, "Polyst. foam $", 4, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
230 AliMedium(99, "Air $", 9, 0, ISXFLD, SXMGMX, 10., 1., .1, .1, 10.);
fe4da5cc 231
232// --- Generate explicitly delta rays in aluminium parts ---
cfce8870 233 gMC->Gstpar(idtmed[701], "LOSS", 3.);
234 gMC->Gstpar(idtmed[701], "DRAY", 1.);
fe4da5cc 235}
236
237void AliPHOSv0::StepManager()
238{
239
fe4da5cc 240 TClonesArray &lhits = *fHits;
0a6d8768 241 TLorentzVector p;
fe4da5cc 242 Int_t copy, i;
243 Int_t vol[5];
244 Float_t hits[4];
0a6d8768 245 if(gMC->CurrentVolID(copy) == fIdSens) {
fe4da5cc 246 //
247 //We are in the sensitive volume
248 for(i=0;i<4;i++) {
0a6d8768 249 gMC->CurrentVolOffID(i+1,copy);
fe4da5cc 250 vol[4-i]=copy;
251 }
0a6d8768 252 gMC->CurrentVolOffID(7,copy);
fe4da5cc 253 vol[0]=copy;
0a6d8768 254 gMC->TrackPosition(p);
255 for(i=0;i<3;++i) hits[i]=p[i];
cfce8870 256 hits[3]=gMC->Edep();
fe4da5cc 257 new(lhits[fNhits++]) AliPHOShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
258 }
259}