]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDv0.cxx
New files for folders and Stack
[u/mrichter/AliRoot.git] / FMD / AliFMDv0.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 **************************************************************************/
d28dcc0d 15 /////////////////////////////////////////////////////////////////////
16// //
17// Forward Multiplicity detector based on Silicon version 0 //
18//
19//Begin Html
fe4da5cc 20/*
d28dcc0d 21<img src="gif/AliFMDv0Class.gif">
fe4da5cc 22*/
d28dcc0d 23//End Html
24// //
25// //
26//////////////////////////////////////////////////////////////////////
fe4da5cc 27
d28dcc0d 28#include <TMath.h>
29#include <TGeometry.h>
30#include <TTUBE.h>
31#include <TNode.h>
32#include <TLorentzVector.h>
fe4da5cc 33#include "AliFMDv0.h"
d28dcc0d 34#include "AliRun.h"
fe4da5cc 35#include "AliMC.h"
d28dcc0d 36#include <iostream.h>
37#include <fstream.h>
b9a2d5e4 38//#include <AliRandom.h>
94de3818 39#include "AliMagF.h"
d28dcc0d 40#include "AliFMDhit.h"
41#include <stdlib.h>
94de3818 42
d28dcc0d 43//class TGeant3;
fe4da5cc 44ClassImp(AliFMDv0)
d28dcc0d 45
46//--------------------------------------------------------------------
47AliFMDv0::AliFMDv0(const char *name, const char *title):
48 AliFMD(name,title)
fe4da5cc 49{
50 //
d28dcc0d 51 // Standart constructor for Forward Multiplicity Detector version 0
fe4da5cc 52 //
d28dcc0d 53 fIdSens1=0;
54// setBufferSize(128000);
fe4da5cc 55}
d28dcc0d 56//-------------------------------------------------------------------------
fe4da5cc 57void AliFMDv0::CreateGeometry()
58{
d28dcc0d 59 //
60 // Create the geometry of Forward Multiplicity Detector version 0
fe4da5cc 61 //
d28dcc0d 62 //Detector consists of 6 volumes:
63 // 1st covered pseudorapidity interval from 3.3 to 2.0
64 // and placed on 65cm in Z-direction;
65 // 2nd - from 2.0 to 1.6 and Z=85 cm;
66 // 3d - the same pseudorapidity interval as the 1st
67 // but on the other side from the interaction point z=-65cm;
68 // 4th - simmetricaly with the 2nd :
69 // pseudorapidity from 2.0 to 1.6, Z=-85cm
70 // 5th - from 3.6 to 4.7, Z=-270cm
71 // 6th - from 4.5 to 5.5 , Z=-630cm.
72 // Each part has 400mkm Si (sensetive area, detector itself),
73 // 0.75cm of plastic simulated electronics material,
74 // Al support ring 2cm thickness and 1cm width placed on
75 // the outer radius of each Si disk;
76 //
77 // begin Html
fe4da5cc 78 /*
d28dcc0d 79 <img src="gif/AliFMDv0.gif">
fe4da5cc 80 */
d28dcc0d 81 //
82
83 Int_t *idtmed = fIdtmed->GetArray();
84
85 Int_t ifmd;
86 Int_t idrotm[999];
87 Float_t zfmd,par[3];
88 char name[5];
89
90 Float_t rin[6], rout[6],zpos;
91 Float_t etain[6]= {3.3, 2.0, 3.3, 2.0, 4.7, 5.5};
92 Float_t etaout[6]={2.0, 1.6, 2.0, 1.6, 3.6, 4.5};
93 Float_t z[6]={64., 85., -64., -85., -270., -630};
94 Float_t zDet=0.04;
95 Float_t zElectronic=0.75;
96 Float_t zSupport=1.;
97 Float_t zFMD=3.;
98//-------------------------------------------------------------------
99 // FMD
100 //------------------------------------------------------------------
101
102 AliMatrix(idrotm[901], 90, 0, 90, 90, 180, 0);
103
104 gMC->Gsvolu("GFSI","TUBE", idtmed[1], par, 0);
105 gMC->Gsvolu("GEL ","TUBE", idtmed[4], par, 0);
106 gMC->Gsvolu("GSUP","TUBE", idtmed[2], par, 0);
107
108 for (ifmd =0; ifmd < 6; ifmd++){
109
110 sprintf(name,"FMD%d",ifmd);
9e1a0ddb 111 if(fDebug)
112 printf("%s: %s",ClassName(),name);
d28dcc0d 113
114 zfmd=TMath::Abs(z[ifmd]);
9e1a0ddb 115 if(fDebug) printf("zfmd %f z[ifmd] %f",zfmd,z[ifmd]);
d28dcc0d 116 AliFMD::Eta2Radius(etain[ifmd],zfmd,&rin[ifmd]);
117 AliFMD::Eta2Radius(etaout[ifmd],zfmd,&rout[ifmd]);
118
119 par[0]=rin[ifmd]; // pipe size
120 par[1]=rout[ifmd];
121 par[2]=zFMD/2;
122 gMC->Gsvolu(name,"TUBE", idtmed[3], par, 3);
123
9e1a0ddb 124 if(fDebug) printf ("rin %f rout %f ZFMD %f\n",par[0],par[1],z[ifmd]);
d28dcc0d 125 if (z[ifmd] < 0){
126 gMC->Gspos(name,1,"ALIC",0,0,z[ifmd],0, "ONLY");}
127 else {
128 gMC->Gspos(name,1,"ALIC",0,0,z[ifmd],idrotm[901], "ONLY");}
129 //Silicon detector
130 par[2]=zDet/2;
131 zpos=zFMD/2 -par[2];
132 gMC->Gsposp("GFSI",ifmd+1,name,0,0,zpos,0, "ONLY",par,3);
133
134 //Plastic slice for electronics
135 par[2]=zElectronic/2;
136 zpos=zpos-zDet/2-par[2];
137 gMC->Gsposp("GEL ",ifmd+1,name,0,0,zpos,0, "ONLY",par,3);
138
139 //Simple Al support
140 par[1]=rout[ifmd];
141 par[0]=rout[ifmd]-2;
142 par[2]=zSupport/2;
143 zpos=zpos-zElectronic/2-par[2];
144 gMC->Gsposp("GSUP",ifmd+1,name,0,0,zpos,0, "ONLY",par,3);
145
146
147 }
148 //Silicon
fe4da5cc 149
fe4da5cc 150
d28dcc0d 151
fe4da5cc 152
d28dcc0d 153}
154//------------------------------------------------------------------------
155void AliFMDv0::CreateMaterials()
156{
157 Int_t isxfld = gAlice->Field()->Integ();
158 Float_t sxmgmx = gAlice->Field()->Max();
fe4da5cc 159
d28dcc0d 160 // Plastic CH
161 Float_t aPlastic[2]={1.01,12.01};
162 Float_t zPlastic[2]={1,6};
163 Float_t wPlastic[2]={1,1};
164 Float_t denPlastic=1.03;
165 //
166
167 //*** Definition Of avaible FMD materials ***
168 AliMaterial(0, "Si chip$", 28.0855,14.,2.33,9.36,999);
169 AliMaterial(1, "Al supprt$", 26.980,13.,2.70,8.9,999);
170 AliMaterial(2, "FMD Air$", 14.61, 7.3, .001205, 30423.,999);
171 AliMixture( 5, "Plastic$",aPlastic,zPlastic,denPlastic,-2,wPlastic);
172
fe4da5cc 173
d28dcc0d 174//**
175 AliMedium(1, "Si chip$", 0, 1, isxfld, sxmgmx, 1., .001, 1., .001, .001);
176 AliMedium(2, "Al support$", 1, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001);
177 AliMedium(3, "FMD air$", 2, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001);
178 AliMedium(4, "Plastic$", 5, 0,isxfld, sxmgmx, 10., .01, 1., .003, .003);
179
180
181
182}
183//---------------------------------------------------------------------
184void AliFMDv0::DrawDetector()
fe4da5cc 185{
d28dcc0d 186//
187// Draw a shaded view of the Forward multiplicity detector version 0
188//
fe4da5cc 189
d28dcc0d 190AliMC* pMC = AliMC::GetMC();
191
192//Set ALIC mother transparent
193pMC->Gsatt("ALIC","SEEN",0);
194//
195//Set volumes visible
196gMC->Gsatt("FMD0","SEEN",1);
197gMC->Gsatt("FMD1","SEEN",1);
198gMC->Gsatt("FMD2","SEEN",1);
199gMC->Gsatt("FMD3","SEEN",1);
200gMC->Gsatt("FMD4","SEEN",1);
201gMC->Gsatt("FMD5","SEEN",1);
202
203//
204gMC->Gdopt("hide","on");
205gMC->Gdopt("shad","on");
206gMC->SetClipBox(".");
207gMC->SetClipBox("*",0,1000,-1000,1000,-1000,1000);
208gMC->DefaultRange();
209gMC->Gdraw("alic",40,30,0,12,9.5,.2,0.2);
210gMC->Gdhead(1111,"Forward multiplicity detector");
211gMC->Gdopt("hide","off");
212}
213//-------------------------------------------------------------------
214void AliFMDv0::Init()
215{
216// Initialises version 0 of the Forward Multiplicity Detector
217//
218AliMC* gMC=AliMC::GetMC();
219AliFMD::Init();
220fIdSens1=gMC->VolId("GFSI");
9e1a0ddb 221if(fDebug) printf("%s: *** FMD version 0 initialized ***\n",ClassName());
fe4da5cc 222}
223
d28dcc0d 224//-------------------------------------------------------------------
225
226void AliFMDv0::StepManager()
fe4da5cc 227{
228 //
d28dcc0d 229 // Called for every step in the Forward Multiplicity Detector
fe4da5cc 230 //
d28dcc0d 231 Int_t id,copy;
232 static Float_t hits[9];
233 static Int_t vol[1];
234 static Float_t de;
235 TLorentzVector pos;
236 TLorentzVector mom;
fe4da5cc 237
d28dcc0d 238
239 TClonesArray &lhits = *fHits;
240 AliMC* gMC=AliMC::GetMC();
241 if(!gMC->IsTrackAlive()) return; // particle has disappeared
242
243 Float_t charge = gMC->TrackCharge();
244 if(TMath::Abs(charge)<=0.) return; //take only charged particles
245
246 // ((TGeant3*)gMC)->Gpcxyz();
247
248 id=gMC->CurrentVolID(copy);
fe4da5cc 249
d28dcc0d 250// Check the sensetive volume
251 if(id==fIdSens1)
252 {
253 if(gMC->IsTrackEntering())
254 {
255 vol[0]=copy;
256 gMC->TrackPosition(pos);
257 hits[0]=pos[0];
258 hits[1]=pos[1];
259 hits[2]=pos[2];
260
261 gMC->TrackMomentum(mom);
262 hits[3]=mom[0];
263 hits[4]=mom[1];
264 hits[5]=mom[2];
fe4da5cc 265
d28dcc0d 266 Int_t iPart= gMC->TrackPid();
267 Int_t partId=gMC->IdFromPDG(iPart);
268 hits[7]=partId;
269 hits[8]=1e9*gMC->TrackTime();
270 de=0.;
271 }
272 if(gMC->IsTrackInside()){
273 de=de+1000.*gMC->Edep();
274 }
275
276 if(gMC->IsTrackExiting()
277 ||gMC->IsTrackDisappeared()||
278 gMC->IsTrackStop())
279 {
280 hits[6]=de+1000.*gMC->Edep();
281 new(lhits[fNhits++]) AliFMDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
282 } // IsTrackExiting()
283 }
284 }
fe4da5cc 285