]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - START/AliSTARTv1.cxx
Additional protection: to be discussed with the Root team (M.Ivanov)
[u/mrichter/AliRoot.git] / START / AliSTARTv1.cxx
index 3315b625adc14dddc833f69d2a37bdd077a4ef45..2f4bc1aa6ddf637a4109df60991101e6b8fc9faa 100755 (executable)
 
 #include "AliSTARTv1.h"
 #include "AliRun.h"
-#include "AliMC.h"
 #include "AliMagF.h"
 #include "AliSTARThit.h"
 
-#include <iostream.h>
-#include <fstream.h>
+#include <Riostream.h>
 
-//#include "TGeant3.h"
 #include <stdlib.h>
 
 ClassImp(AliSTARTv1)
@@ -95,18 +92,20 @@ void AliSTARTv1::CreateGeometry()
   Float_t pribber[3] = {0.,1.2,2.413/2.};
   Float_t presist[3] = {0.,1.2,0.087/2.};
 
-  Float_t zdet=75.;
+  Float_t zdetRight=69.7,zdetLeft=350;
  //-------------------------------------------------------------------
  //  START volume 
  //-------------------------------------------------------------------
   
   //  Float_t theta=TMath::ATan(6.5/zdet);
-  Float_t theta=(180./3.1415)*TMath::ATan(6.5/zdet);
+  Float_t thetaRight=(180./3.1415)*TMath::ATan(6.5/zdetRight);
+  Float_t thetaLeft=(180./3.1415)*TMath::ATan(6.5/zdetLeft);
     AliMatrix(idrotm[901], 90., 0., 90., 90., 180., 0.);
     
-    gMC->Gsvolu("0STA","TUBE",idtmed[1],pstart,3);
-    gMC->Gspos("0STA",1,"ALIC",0.,0.,zdet,0,"ONLY");
-    gMC->Gspos("0STA",2,"ALIC",0.,0.,-zdet,idrotm[901],"ONLY");
+    gMC->Gsvolu("0STR","TUBE",idtmed[1],pstart,3);
+    gMC->Gsvolu("0STL","TUBE",idtmed[1],pstart,3);
+    gMC->Gspos("0STR",1,"ALIC",0.,0.,zdetRight+pstart[2],0,"ONLY");
+    gMC->Gspos("0STL",1,"ALIC",0.,0.,-zdetLeft-pstart[2],idrotm[901],"ONLY");
 
 //START interior
     gMC->Gsvolu("0INS","TUBE",idtmed[1],pinstart,3);
@@ -118,24 +117,36 @@ void AliSTARTv1::CreateGeometry()
     for (is=1; is<=12; is++)
       {  
        AliMatrix(idrotm[901+is], 
-                 90.-theta, 30.*is, 
+                 90.-thetaRight, 30.*is, 
                  90.,       90.+30.*is,
-                 theta,    180.+30.*is); 
+                 thetaRight,    180.+30.*is); 
        x=6.5*TMath::Sin(is*dang1);
        y=6.5*TMath::Cos(is*dang1);
        z=-pstart[2]+pinstart[2];
-       gMC->Gspos("0INS",is,"0STA",x,y,z,idrotm[901+is],"ONLY");
-       printf("z PMT %f\n",z);
-
-       
-       x=0;
-       y=0;
-       z=-pinstart[2]+ppmt[2];
-       printf(" is %d, z Divider %f\n",is,z);
-       gMC->Gspos("0PMT",is,"0INS",x,y,z,0,"ONLY");
-       z=pinstart[2]-pdivider[2];
-       gMC->Gspos("0DIV",is,"0INS",x,y,z,0,"ONLY");
+       gMC->Gspos("0INS",is,"0STR",x,y,z,idrotm[901+is],"ONLY");
+
+      }        
+    for (is=1; is<=12; is++)
+      {
+        AliMatrix(idrotm[901+is],
+                  90.-thetaLeft, 30.*is,
+                  90.,       90.+30.*is,
+                  thetaLeft,    180.+30.*is);
+
+        x=6.5*TMath::Sin(is*dang1);
+        y=6.5*TMath::Cos(is*dang1);
+        z=-pstart[2]+pinstart[2];
+        gMC->Gspos("0INS",is,"0STL",x,y,z,idrotm[901+is],"ONLY");
+
       }
+     x=0;
+    y=0;
+    z=-pinstart[2]+ppmt[2];
+    if(fDebug) printf("%s: is %d, z Divider %f\n",ClassName(),is,z);
+    gMC->Gspos("0PMT",1,"0INS",x,y,z,0,"ONLY");
+    z=pinstart[2]-pdivider[2];
+    gMC->Gspos("0DIV",1,"0INS",x,y,z,0,"ONLY");
+      
      /*  
 //second ring: 20 units of Scintillator+PMT+divider
       Double_t dang2 = 2*TMath::Pi()/26;
@@ -153,14 +164,16 @@ void AliSTARTv1::CreateGeometry()
 // PMT
       
     // Entry window (glass)
-    gMC->Gsvolu("0TOP","TUBE",idtmed[6],ptop,3);
-    z=-ppmt[2]+ptop[2];
+    gMC->Gsvolu("0TOP","TUBE",idtmed[6],ptop,3); //glass
+     //   gMC->Gsvolu("0TOP","TUBE",idtmed[12],ptop,3); //lucite
+     z=-ppmt[2]+ptop[2];
     gMC->Gspos("0TOP",1,"0PMT",0,0,z,0,"ONLY");
     //     printf("Z PTOP %f -ppmt[2] %f ptop[2] %f\n",z,-ppmt[2],ptop[2]);
+    
     // Bottom glass
     gMC->Gsvolu("0BOT","TUBE",idtmed[6],pbot,3);
     z=ppmt[2]-pbot[2];
-    printf("Z bottom %f\n",z);
+    if(fDebug) printf("%s: Z bottom %f\n",ClassName(),z);
     gMC->Gspos("0BOT",1,"0PMT",0,0,z,0,"ONLY");
     // Side cylinder glass
     gMC->Gsvolu("0OUT","TUBE",idtmed[6],pglass,3);
@@ -218,7 +231,7 @@ void AliSTARTv1::CreateGeometry()
     z=pdiv2[2]-pribber[2];
     gMC->Gspos("0RB",1,"0V2",0,0,z,0,"ONLY");
     //      printf("z DRIB %f\n",z);
-    
+       
     
 }    
 //------------------------------------------------------------------------
@@ -234,7 +247,12 @@ void AliSTARTv1::CreateMaterials()
    Float_t zscin[2]={1,6};
    Float_t wscin[2]={1,1};
    Float_t denscin=1.03;
-// PMT glass SiO2
+//Lucite C(CH3)CO2CH3
+   Float_t alucite[3]={1.01,12.01,15.999};
+   Float_t zlucite[3]={1,6,8};
+   Float_t wlucite[3]={8,5,2};
+   Float_t denlucite=1.16;
+ // PMT glass SiO2
    Float_t aglass[2]={28.0855,15.9994};
    Float_t zglass[2]={14.,8.};
    Float_t wglass[2]={1.,2.};
@@ -289,6 +307,7 @@ void AliSTARTv1::CreateMaterials()
    AliMixture( 6, "Brass    $", abrass, zbrass, denbrass, 2, wbrass);
    
    AliMixture( 7, "Ribber $",aribber,zribber,denribber,-3,wribber);
+   AliMixture( 8, "Lucite$",alucite,zlucite,denlucite,-3,wlucite);
    
    
    AliMedium(1, "START Air$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003);
@@ -299,7 +318,9 @@ void AliSTARTv1::CreateMaterials()
    AliMedium(8, "Steel$", 0, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001);
    AliMedium(9, "Ribber  $", 7, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
    AliMedium(11, "Brass  $", 6, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
-   cout<<"++++++++++++++Medium set++++++++++"<<endl;
+   AliMedium(12, "Lucite$", 8, 1, isxfld, sxmgmx, 10., .01, 1., .003, .003);  
+
+   if(fDebug) cout<<ClassName()<<": ++++++++++++++Medium set++++++++++"<<endl;
 
 //  geant3->Gsckov(idtmed[2105], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
 
@@ -338,7 +359,7 @@ void AliSTARTv1::Init()
 //Int_t *idtmed  = gAlice->Idtmed();
   AliSTART::Init();
   fIdSens1=gMC->VolId("0TOP");
-  printf("*** START version 0 initialized ***\n");
+  if(fDebug) printf("%s: *** START version 0 initialized ***\n",ClassName());
  
 }
 
@@ -358,23 +379,26 @@ void AliSTARTv1::StepManager()
   TClonesArray &lhits = *fHits;
   
   if(!gMC->IsTrackAlive()) return; // particle has disappeared
-  Float_t charge = gMC->TrackCharge();
-  if(TMath::Abs(charge)<=0.) return; //take only charged particles
+  //  Float_t charge = gMC->TrackCharge();
+  //  if(TMath::Abs(charge)<=0.) return; //take only charged particles
   id=gMC->CurrentVolID(copy);
   
   
-  //  printf("gMC->ckine->ipart %d",gMC->ckine->ipart);
-  // Check the sensetive volume
+   // Check the sensetive volume
   if(id==fIdSens1 ) {
     if(gMC->IsTrackEntering()) {
       gMC->CurrentVolOffID(2,copy);
       vol[1]=copy;
       gMC->CurrentVolOffID(3,copy1);
       vol[0]=copy1;
+
       gMC->TrackPosition(pos);
       hits[0] = pos[0];
       hits[1] = pos[1];
       hits[2] = pos[2];
+      if(pos[2]<0) vol[0]=2;
+      if(pos[2]>=0) vol[0]=1;
+     
       Float_t etot=gMC->Etot();
       hits[4]=etot;
       Int_t iPart= gMC->TrackPid();
@@ -388,12 +412,13 @@ void AliSTARTv1::StepManager()
       Float_t de=gMC->Edep(); 
       edep=edep+de;
     } 
-  }
-  if(gMC->IsTrackExiting())    {
-    Float_t de=gMC->Edep(); 
-    edep=edep+de;
-    hits[3]=edep*1e3;
-    new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->CurrentTrack(),vol,hits);      
+  
+    if(gMC->IsTrackExiting())  {
+      Float_t de=gMC->Edep(); 
+      edep=edep+de;
+      hits[3]=edep*1e3;
+      new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->CurrentTrack(),vol,hits);      
+    }
   }
 //---------------------------------------------------------------------
 }