]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSv0.cxx
Introduction of the Copyright and cvs Log
[u/mrichter/AliRoot.git] / PHOS / AliPHOSv0.cxx
index c2f0d2d9353793da020bb9f653f0793b0fc2e104..4da06d09f7ca36035cb20e0d12c4fca38920808d 100644 (file)
@@ -1,3 +1,22 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
 /////////////////////////////////////////////////////////
 //  Manager and hits classes for set:PHOS version 0    //
 /////////////////////////////////////////////////////////
@@ -20,7 +39,7 @@ ClassImp(AliPHOSv0)
 //______________________________________________________________________________
 
 
-AliPHOSv0::AliPHOSv0() : AliPHOS()
+AliPHOSv0::AliPHOSv0()
 {
   fIdSens=0;
 }
@@ -36,9 +55,7 @@ AliPHOSv0::AliPHOSv0(const char *name, const char *title)
 //___________________________________________
 void AliPHOSv0::Init()
 {
-  AliMC* pMC = AliMC::GetMC();
-  
-  fIdSens=pMC->VolId("PXTL");
+  fIdSens=gMC->VolId("PXTL");
 }
 
 //___________________________________________
@@ -47,16 +64,14 @@ void AliPHOSv0::CreateGeometry()
 // *** DEFINITION OF THE -0.25<y<0.25 TILTED GEOMETRY OF THE PHOS *** 
 // ORIGIN    : NICK VAN EIJNDHOVEN 
 
-  AliMC* pMC = AliMC::GetMC();
-  
     Float_t pphi;
-    Float_t r, dptcb[3], dpair[3], dphos[3], dpucp[3], dpasp[3], dpcpv[3];
+    Float_t r, dptcb[3], dpair[3], dphos[3], dpucp[3], dpasp[3];
     Float_t dpxtl[3];
     Float_t yo;
     Int_t idrotm[99];
     Float_t xp1, yp1, xp2, yp2;
     
-    Int_t *idtmed = gAlice->Idtmed();
+    Int_t *idtmed = fIdtmed->GetArray()-699;
 
 // --- Dimensions of PbWO4 crystal --- 
       const Float_t XTL_X=2.2;
@@ -64,8 +79,6 @@ void AliPHOSv0::CreateGeometry()
       const Float_t XTL_Z=2.2;
 // --- Tyvek wrapper thickness 
       const Float_t PAP_THICK=0.01;
-// --- CPV thickness --- 
-      const Float_t CPV_Y=0.5;
 // --- Polystyrene Foam Outer Cover dimensions --- 
       const Float_t FOC_X=214.6;
       const Float_t FOC_Y=80.;
@@ -94,64 +107,58 @@ void AliPHOSv0::CreateGeometry()
     dphos[0] = FOC_X/2.;
     dphos[1] = FOC_Y/2.;
     dphos[2] = FOC_Z/2.;
-    pMC->Gsvolu("PHOS", "BOX ", idtmed[703], dphos, 3);
+    gMC->Gsvolu("PHOS", "BOX ", idtmed[703], dphos, 3);
 
 // --- Define air-filled box, place inside PHOS --- 
     dpair[0] = AIR_X/2.;
     dpair[1] = AIR_Y/2.;
     dpair[2] = AIR_Z/2.;
-    pMC->Gsvolu("PAIR", "BOX ", idtmed[798], dpair, 3);
-    pMC->Gspos("PAIR", 1, "PHOS", 0., 0., 0., 0, "ONLY");
+    gMC->Gsvolu("PAIR", "BOX ", idtmed[798], dpair, 3);
+    gMC->Gspos("PAIR", 1, "PHOS", 0., 0., 0., 0, "ONLY");
 
 // --- Define Upper Cooling Panel --- 
 // --- place it right behind upper foam plate --- 
     dpucp[0] = TCB_X/2.;
     dpucp[1] = UCP_Y/2.;
     dpucp[2] = TCB_Z/2.;
-    pMC->Gsvolu("PUCP", "BOX ", idtmed[701], dpucp, 3);
+    gMC->Gsvolu("PUCP", "BOX ", idtmed[701], dpucp, 3);
     yo = (AIR_Y-UCP_Y)/2.;
-    pMC->Gspos("PUCP", 1, "PAIR", 0., yo, 0., 0, "ONLY");
+    gMC->Gspos("PUCP", 1, "PAIR", 0., yo, 0., 0, "ONLY");
 
 // --- Define Crystal Block, fill with Tyvek, position inside PAIR --- 
     dptcb[0] = TCB_X/2.;
     dptcb[1] = TCB_Y/2.;
     dptcb[2] = TCB_Z/2.;
-    pMC->Gsvolu("PTCB", "BOX ", idtmed[702], dptcb, 3);
+    gMC->Gsvolu("PTCB", "BOX ", idtmed[702], dptcb, 3);
 // --- Divide PTCB in X and Z directions -- 
-    pMC->Gsdvn("PSEC", "PTCB", 11, 1);
-    pMC->Gsdvn("PMOD", "PSEC", 13, 3);
-    pMC->Gsdvn("PSTR", "PMOD", 8, 1);
-    pMC->Gsdvn("PCEL", "PSTR", 8, 3);
+    gMC->Gsdvn("PSEC", "PTCB", 11, 1);
+    gMC->Gsdvn("PMOD", "PSEC", 13, 3);
+    gMC->Gsdvn("PSTR", "PMOD", 8, 1);
+    gMC->Gsdvn("PCEL", "PSTR", 8, 3);
     yo = (FOC_Y-TCB_Y)/2. -(CBS_R-FOC_R);
-    pMC->Gspos("PTCB", 1, "PAIR", 0., yo, 0., 0, "ONLY");
+    gMC->Gspos("PTCB", 1, "PAIR", 0., yo, 0., 0, "ONLY");
 
 // --- Define PbWO4 crystal volume, place inside PCEL --- 
     dpxtl[0] = XTL_X/2.;
     dpxtl[1] = XTL_Y/2.;
     dpxtl[2] = XTL_Z/2.;
-    pMC->Gsvolu("PXTL", "BOX ", idtmed[699], dpxtl, 3);
+    gMC->Gsvolu("PXTL", "BOX ", idtmed[699], dpxtl, 3);
     yo = (TCB_Y-XTL_Y)/2. - PAP_THICK;
-    pMC->Gspos("PXTL", 1, "PCEL", 0., yo, 0., 0, "ONLY");
+    gMC->Gspos("PXTL", 1, "PCEL", 0., yo, 0., 0, "ONLY");
 
 // --- Define Al Support Plate, position it inside PAIR --- 
 // --- right beneath PTCB --- 
     dpasp[0] = AIR_X/2.;
     dpasp[1] = ASP_Y/2.;
     dpasp[2] = AIR_Z/2.;
-    pMC->Gsvolu("PASP", "BOX ", idtmed[701], dpasp, 3);
+    gMC->Gsvolu("PASP", "BOX ", idtmed[701], dpasp, 3);
     yo = (FOC_Y-ASP_Y)/2. - (CBS_R-FOC_R+TCB_Y);
-    pMC->Gspos("PASP", 1, "PAIR", 0., yo, 0., 0, "ONLY");
+    gMC->Gspos("PASP", 1, "PAIR", 0., yo, 0., 0, "ONLY");
 
-// --- Define CPV volume, DON'T PLACE IT YET --- 
-    dpcpv[0] = TCB_X/2.;
-    dpcpv[1] = CPV_Y/2.;
-    dpcpv[2] = TCB_Z/2.;
-    pMC->Gsvolu("PCPV", "BOX ", idtmed[700], dpcpv, 3);
 // --- Divide in X and Z direction (same way as PTCB) --- 
-    pMC->Gsdvn("PCSE", "PCPV", 11, 1);
-    pMC->Gsdvn("PCMO", "PCSE", 13, 3);
-    pMC->Gsdvn("PCST", "PCMO", 8, 1);
-    pMC->Gsdvn("PCCE", "PCST", 8, 3);
+    gMC->Gsdvn("PCMO", "PCSE", 13, 3);
+    gMC->Gsdvn("PCST", "PCMO", 8, 1);
+    gMC->Gsdvn("PCCE", "PCST", 8, 3);
 
 // --- Position various PHOS units in ALICE setup --- 
 // --- PHOS itself first --- 
@@ -166,27 +173,14 @@ void AliPHOSv0::CreateGeometry()
     AliMatrix(idrotm[1], 90.,  -pphi, 90., 90-pphi,   0., 0.);
     AliMatrix(idrotm[2], 90.,   pphi, 90., 90+pphi,   0., 0.);
     AliMatrix(idrotm[3], 90., 3*pphi, 90., 90+3*pphi, 0., 0.);
-    pMC->Gspos("PHOS", 1, "ALIC", xp1, yp1, 0., idrotm[0], "ONLY");
-    pMC->Gspos("PHOS", 2, "ALIC", xp2, yp2, 0., idrotm[1], "ONLY");
-    pMC->Gspos("PHOS", 3, "ALIC",-xp2, yp2, 0., idrotm[2], "ONLY");
-    pMC->Gspos("PHOS", 4, "ALIC",-xp1, yp1, 0., idrotm[3], "ONLY");
-
-// --- Now position PCPV so that its plates are right on top of --- 
-// --- corresponding PHOS supermodules (previously called cradles) --- 
-    r    = FOC_R-CPV_Y/2.;
-    pphi = TMath::ATan(FOC_X/(2.*FOC_R));
-    xp1  = -r * TMath::Sin(pphi * 3.);
-    yp1  = -r * TMath::Cos(pphi * 3.);
-    xp2  = -r * TMath::Sin(pphi);
-    yp2  = -r * TMath::Cos(pphi);
-    pMC->Gspos("PCPV", 1, "ALIC", xp1, yp1, 0., idrotm[0], "ONLY");
-    pMC->Gspos("PCPV", 2, "ALIC", xp2, yp2, 0., idrotm[1], "ONLY");
-    pMC->Gspos("PCPV", 3, "ALIC",-xp2, yp2, 0., idrotm[2], "ONLY");
-    pMC->Gspos("PCPV", 4, "ALIC",-xp1, yp1, 0., idrotm[3], "ONLY");
+    gMC->Gspos("PHOS", 1, "ALIC", xp1, yp1, 0., idrotm[0], "ONLY");
+    gMC->Gspos("PHOS", 2, "ALIC", xp2, yp2, 0., idrotm[1], "ONLY");
+    gMC->Gspos("PHOS", 3, "ALIC",-xp2, yp2, 0., idrotm[2], "ONLY");
+    gMC->Gspos("PHOS", 4, "ALIC",-xp1, yp1, 0., idrotm[3], "ONLY");
 
 // --- Set modules seen without tree for drawings --- 
-    pMC->Gsatt("PMOD", "SEEN", -2);
-    pMC->Gsatt("PCMO", "SEEN", -2);
+    gMC->Gsatt("PMOD", "SEEN", -2);
+    gMC->Gsatt("PCMO", "SEEN", -2);
 }
  
 //___________________________________________
@@ -195,8 +189,6 @@ void AliPHOSv0::CreateMaterials()
 // *** DEFINITION OF AVAILABLE PHOS MATERIALS *** 
 // ORIGIN    : NICK VAN EIJNDHOVEN 
 
-  AliMC* pMC = AliMC::GetMC();
-  
     Int_t   ISXFLD = gAlice->Field()->Integ();
     Float_t SXMGMX = gAlice->Field()->Max();
     
@@ -221,7 +213,7 @@ void AliPHOSv0::CreateMaterials()
     Float_t wf[2] = { 1.,1. };
     Float_t df    = .3;
 
-    Int_t *idtmed = gAlice->Idtmed();
+    Int_t *idtmed = fIdtmed->GetArray()-699;
     
     AliMixture( 0, "PbWO4$",       ax, zx, dx, -3, wx);
     AliMixture( 1, "Polystyrene$", ap, zp, dp, -2, wp);
@@ -231,38 +223,37 @@ void AliPHOSv0::CreateMaterials()
     AliMixture( 4, "Foam$",  af, zf, df, -2, wf);
     AliMaterial(9, "Air$", 14.61, 7.3, .001205, 30420., 67500);
 
-    AliMedium(700, "PHOS Xtal    $", 0, 1, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
-    AliMedium(701, "CPV scint.   $", 1, 1, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
-    AliMedium(702, "Al parts     $", 2, 0, ISXFLD, SXMGMX, 10., .1, .1, .001, .001);
-    AliMedium(703, "Tyvek wrapper$", 3, 0, ISXFLD, SXMGMX, 10., .1, .1, .001, .001);
-    AliMedium(704, "Polyst. foam $", 4, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
-    AliMedium(799, "Air          $", 9, 0, ISXFLD, SXMGMX, 10., 1., .1, .1, 10.);
+    AliMedium(0, "PHOS Xtal    $", 0, 1, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
+    AliMedium(2, "Al parts     $", 2, 0, ISXFLD, SXMGMX, 10., .1, .1, .001, .001);
+    AliMedium(3, "Tyvek wrapper$", 3, 0, ISXFLD, SXMGMX, 10., .1, .1, .001, .001);
+    AliMedium(4, "Polyst. foam $", 4, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
+    AliMedium(99, "Air          $", 9, 0, ISXFLD, SXMGMX, 10., 1., .1, .1, 10.);
 
 // --- Generate explicitly delta rays in aluminium parts --- 
-    pMC->Gstpar(idtmed[701], "LOSS", 3.);
-    pMC->Gstpar(idtmed[701], "DRAY", 1.);
+    gMC->Gstpar(idtmed[701], "LOSS", 3.);
+    gMC->Gstpar(idtmed[701], "DRAY", 1.);
 }
 
 void AliPHOSv0::StepManager()
 {
 
-  AliMC* pMC = AliMC::GetMC();
-  
   TClonesArray &lhits = *fHits;
+  TLorentzVector p;
   Int_t copy, i;
   Int_t vol[5];
   Float_t hits[4];
-  if(pMC->CurrentVol(0,copy) == fIdSens) {
+  if(gMC->CurrentVolID(copy) == fIdSens) {
     //
     //We are in the sensitive volume
     for(i=0;i<4;i++) {
-      pMC->CurrentVolOff(i+1,0,copy);
+      gMC->CurrentVolOffID(i+1,copy);
       vol[4-i]=copy;
     }
-    pMC->CurrentVolOff(7,0,copy);
+    gMC->CurrentVolOffID(7,copy);
     vol[0]=copy;
-    pMC->TrackPosition(hits);
-    hits[3]=pMC->Edep();
+    gMC->TrackPosition(p);
+    for(i=0;i<3;++i) hits[i]=p[i];
+    hits[3]=gMC->Edep();
     new(lhits[fNhits++]) AliPHOShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
 }