1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /* $Id: AliT0v1.cxx 50646 2011-07-18 14:40:16Z alla $ */
18 /////////////////////////////////////////////////////////////////////
20 // T0 ( T-zero) detector version 1 //
24 <img src="gif/AliT0v1Class.gif">
29 //////////////////////////////////////////////////////////////////////
31 #include <Riostream.h>
34 #include "TGeoCompositeShape.h"
35 #include "TGeoManager.h"
36 #include "TGeoMatrix.h"
37 #include "TGeoVolume.h"
43 #include <TGeoGlobalMagField.h>
45 #include <TLorentzVector.h>
47 #include <TVirtualMC.h>
54 #include "AliFITHits.h"
58 #include "AliCDBLocal.h"
59 #include "AliCDBStorage.h"
60 #include "AliCDBManager.h"
61 #include "AliCDBEntry.h"
62 #include "AliTrackReference.h"
67 //--------------------------------------------------------------------
68 AliFITv0::AliFITv0(): AliFIT(),
73 // Standart constructor for T0 Detector version 0
75 //--------------------------------------------------------------------
76 AliFITv0::AliFITv0(const char *name, const char *title):
81 // Standart constructor for T0 Detector version 0
83 printf("@@@@@@@@@@@@@@@ AliFITv0::AliFITv0 \n");
86 //_____________________________________________________________________________
93 //-------------------------------------------------------------------------
94 void AliFITv0::CreateGeometry()
97 // Create the geometry of FIT Detector version 1 full geometry
102 printf("@@@@@@@@@@@ AliFITv0::CreateGeometry\n");
103 Int_t *idtmed = fIdtmed->GetArray();
105 TGeoMedium* kMedAir = gGeoManager->GetMedium("T0_AIR");
106 TGeoMedium* kMedMCPGlass = gGeoManager->GetMedium("T0_glass");
107 TGeoMedium* kMedOptGlass = gGeoManager->GetMedium("T0_OpticalGlass");
108 TGeoMedium* kMedOptGlassCathode = gGeoManager->GetMedium("T0_OpticalGlassCathode");
111 Float_t zdetA = 373.;
114 Float_t pstart[3] = {6, 20 ,2.6};
115 Float_t pinstart[3] = {3,3,2.55};
116 Float_t pmcp[3] = {2.95, 2.95, 1.5}; //MCP
117 Float_t ptop[3] = {1.324, 1.324, 1.};//cherenkov radiator
118 Float_t preg[3] = {1.324, 1.324, 0.05};//photcathode
120 AliMatrix(idrotm[901], 90., 0., 90., 90., 180., 0.);
122 //-------------------------------------------------------------------
124 //-------------------------------------------------------------------
126 Float_t x1[20] = {9, 9, 15 ,15 , 9,
128 -9, -9, -15, -15, -9,
131 Float_t y1[20] = {3.2, -3.2, 3.2, -3.2, -9.2,
132 -9, -9, -15, -15, -9.2,
133 -3.2, 3.2, -3.2, 3.2, 9.2,
138 gMC->Gsvolu("0STR","TUBE",idtmed[kAir],pstart,18);
139 gMC->Gspos("0STR",1,"ALIC",0.,0.,-zdetC-pstart[2],idrotm[901],"ONLY");
140 gMC->Gspos("0STR",2,"ALIC",0.,0.,zdetA+pstart[2],0,"ONLY");
143 gMC->Gsvolu("0INS","BOX",idtmed[kAir],pinstart,3);
144 z=-pstart[2]+pinstart[2];
145 for (Int_t is=0; is<20; is++) {
146 gMC->Gspos ("0INS", is + 1, "0STR", x1[is], y1[is], z, 0, "ONLY");
147 gMC->Gspos ("0INS", is + 21, "0STR", x1[is], y1[is], z, 0, "ONLY");
148 printf(" 0INS is %i x %f y %f z %f \n",is, x1[is],y1[is], z);
152 // Entry window (glass)
153 gMC->Gsvolu("0TOP","BOX",idtmed[kAir],ptop,3); //glass
154 gMC->Gsvolu ("0REG", "BOX", idtmed[kSensAir], preg, 3);
155 gMC->Gsvolu("0MCP","BOX",idtmed[kGlass],pmcp,3); //glass
157 Float_t xin=0, yin=0;
158 for (Int_t ix=0; ix<4; ix++) {
159 xin = - pinstart[0] + 0.35 + (ix+0.5)*2*ptop[0] ;
160 for (Int_t iy=0; iy<4; iy++) {
161 z = - pinstart[2]+ptop[2];
162 yin = - pinstart[1] + 0.35 + (iy+0.5)*2*ptop[1];
164 gMC->Gspos("0TOP",ntops,"0INS",xin,yin,z,0,"ONLY");
165 // printf(" 0TOP full x %f y %f z %f \n", xin, yin, z);
166 z = -pinstart[2] + 2 * ptop[2] + preg[2];
167 gMC->Gspos ("0REG",ntops, "0INS", xin, yin, z, 0, "ONLY");
168 printf(" GEOGEO %i %i %i %f %f %f %f %f %f", ntops, ix, iy,
169 xin,yin,x1[ntops],y1[ntops],x1[ntops]+xin,y1[ntops]+yin);
174 // TGeoVolume* mcp = gGeoManager->MakeBox("0MCP",kMedMCPGlass, 2.95, 2.95, 1.5);
175 z=-pinstart[2] + 2*ptop[2] + 2*preg[2] + pmcp[2];
176 gMC->Gspos("0MCP",1,"0INS",0,0,z,0,"ONLY");
179 //------------------------------------------------------------------------
180 void AliFITv0::AddAlignableVolumes() const
183 // Create entries for alignable volumes associating the symbolic volume
184 // name with the corresponding volume path. Needs to be syncronized with
185 // eventual changes in the geometry.
187 printf("@@@@@@@@@@@@@@@AliFITv0::AddAlignableVolumes()\n");
190 TString vpAalign = "/ALIC_1/0STR_1";
191 TString vpCalign = "/ALIC_1/0STR_2";
192 for (Int_t imod=0; imod<2; imod++) {
193 if (imod==0) {volPath = vpCalign; symName="/ALIC_1/0STR_1"; }
194 if (imod==1) {volPath = vpAalign; symName="/ALIC_1/0STR_2"; }
196 AliDebug(2,"--------------------------------------------");
197 AliDebug(2,Form("volPath=%s\n",volPath.Data()));
198 AliDebug(2,Form("symName=%s\n",symName.Data()));
199 AliDebug(2,"--------------------------------------------");
200 if(!gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data()))
201 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",
202 symName.Data(),volPath.Data()));
205 //------------------------------------------------------------------------
206 void AliFITv0::CreateMaterials()
209 printf("@@@@@@@@@@@@AliFITv0::CreateMaterials\n");
210 Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
211 Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
212 // Float_t a,z,d,radl,absl,buf[1];
216 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
217 Float_t zAir[4]={6.,7.,8.,18.};
218 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
219 Float_t dAir = 1.20479E-3;
220 Float_t dAir1 = 1.20479E-11;
223 Float_t aglass[2]={28.0855,15.9994};
224 Float_t zglass[2]={14.,8.};
225 Float_t wglass[2]={1.,2.};
229 //*** Definition Of avaible T0 materials ***
230 AliMixture(1, "Vacuum$", aAir, zAir, dAir1,4,wAir);
231 AliMixture(2, "Air$", aAir, zAir, dAir,4,wAir);
232 AliMixture( 4, "PMT glass $",aglass,zglass,dglass,-2,wglass);
234 AliMedium(1, "FIT_Air$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003);
235 AliMedium(22, "FIT_AirSens$", 2, 1, isxfld, sxmgmx, 10., .1, 1., .003, .003);
236 AliMedium(3, "FIT_Vacuum$", 1, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
237 AliMedium(6, "Glass$", 4, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003);
239 AliDebugClass(1,": ++++++++++++++Medium set++++++++++");
245 //-------------------------------------------------------------------
246 void AliFITv0::Init()
248 // Initialises version 0 of the Forward Multiplicity Detector
251 fIdSens1=gMC->VolId("0REG");
253 AliDebug(1,Form("%s: *** FIT version 0 initialized ***\n",ClassName()));
256 //-------------------------------------------------------------------
258 void AliFITv0::StepManager()
261 // Called for every step in the T0 Detector
264 static Float_t hits[6];
269 // TClonesArray &lhits = *fHits;
271 if(!gMC->IsTrackAlive()) return; // particle has disappeared
273 id=gMC->CurrentVolID(copy);
274 // Check the sensetive volume
276 if(gMC->IsTrackEntering()) {
277 gMC->CurrentVolOffID(1,copy1);
280 gMC->TrackPosition(pos);
284 if(pos[2]<0) vol[2] = 0;
286 printf(" volumes pmt %i mcp %i side %i x %f y %f z %f\n", vol[0], vol[1], vol[2], hits[0], hits[1], hits[2] );
288 Float_t etot=gMC->Etot();
290 Int_t iPart= gMC->TrackPid();
291 Int_t partID=gMC->IdFromPDG(iPart);
293 Float_t ttime=gMC->TrackTime();
295 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
296 // Create a track reference at the exit of photocatode
300 if ( gMC->TrackCharge() )
301 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kFIT);