]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/AliVZEROv3.cxx
VZEROTUNING2da.cxx has been renamed VZEROINTEGRATIONGATETUNINGda.cxx
[u/mrichter/AliRoot.git] / VZERO / AliVZEROv3.cxx
index 6855c5a44bc67c9b4bb70c5ebcb9682e070e0365..ca5b726b031c0b31af2c0f1092dce3d393653713 100755 (executable)
@@ -39,7 +39,6 @@
 
 // --- ROOT libraries ---
 #include <TClonesArray.h>
-#include <TGeant3.h>
 #include <TGeometry.h>
 #include <TLorentzVector.h>
 #include <TMath.h>
 #include <TParticle.h>
 
 // --- AliRoot header files ---
-#include "AliRun.h"
-#include "AliMC.h"
 #include "AliConst.h"
+#include "AliLog.h"
+#include "AliMC.h"
 #include "AliMagF.h"
+#include "AliRun.h"
 #include "AliVZEROLoader.h"
 #include "AliVZEROdigit.h"
 #include "AliVZEROhit.h"
 ClassImp(AliVZEROv3)
 
 //_____________________________________________________________________________
-AliVZEROv3:: AliVZEROv3():AliVZERO()
+AliVZEROv3:: AliVZEROv3():AliVZERO(),
+   fCellId(0),
+   fTrackPosition(),
+   fTrackMomentum(), 
+   fLightYield(93.75),
+   fLightAttenuation(0.05),
+   fnMeters(15.0),
+   fFibToPhot(0.3)
 {
 // Standard default constructor 
 }
 
 //_____________________________________________________________________________
 AliVZEROv3::AliVZEROv3(const char *name, const char *title):
- AliVZERO(name,title)
+   AliVZERO(name,title),
+   fCellId(0),
+   fTrackPosition(),
+   fTrackMomentum(),
+   fLightYield(93.75),
+   fLightAttenuation(0.05),
+   fnMeters(15.0),
+   fFibToPhot(0.3)
 {
 
 // Standard constructor for V-zero Detector  version 2
 
-  Int_t i;
-
-  printf("\n");
-  for(i=0;i<26;i++) printf("*");
-  printf(" Create VZERO object ");
-  for(i=0;i<26;i++) printf("*");
-  printf("\n");
+  AliDebug(2,"Create VZERO object");
       
-  fLightYield              =  93.75;
-  fLightAttenuation        =   0.05; 
-  fnMeters                 =   15.0;  
-  fFibToPhot               =    0.3;
+//   fLightYield              =  93.75;
+//   fLightAttenuation        =   0.05; 
+//   fnMeters                 =   15.0;  
+//   fFibToPhot               =    0.3;
  
 }
 
@@ -96,13 +104,7 @@ void AliVZEROv3::CreateGeometry()
 
 // Creates the GEANT geometry of the V-zero Detector  version 3
   
-  Int_t i;
-  
-  printf("\n");
-  for(i=0;i<26;i++) printf("*");
-  printf(" Create VZERO Geometry ");
-  for(i=0;i<26;i++) printf("*");
-  printf("\n");
+  AliDebug(2,"Create VZERO Geometry");
       
   Int_t    *idtmed = fIdtmed->GetArray()-2999;
 
@@ -294,7 +296,7 @@ void AliVZEROv3::CreateGeometry()
   gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,-zdet,0,"ONLY");
  
   ncellsR = (ndetR - 1) * 3;  
-  printf("    Number of cells on Right side =   %d\n",  ncellsR);    
+  AliInfo(Form("Number of cells on Right side =   %d",ncellsR));    
 
 // Left part :
   
@@ -309,9 +311,7 @@ void AliVZEROv3::CreateGeometry()
   gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,350.0+fThickness1/2.0,0,"ONLY");
  
   ncellsL = (ndetL - 1) * 3;
-  printf("    Number of cells on Left side  =   %d\n",  ncellsL);    
-  for(i=0;i<75;i++) printf("*");
-  printf("\n");
+  AliInfo(Form("Number of cells on Left side  =   %d",  ncellsL));    
            
 }
             
@@ -321,13 +321,7 @@ void AliVZEROv3::BuildGeometry()
   
 // Builds simple ROOT TNode geometry for event display
 
-  Int_t i;
-
-  printf("\n");
-  for(i=0;i<30;i++) printf("*");
-  printf(" VZERO BuildGeometry ");
-  for(i=0;i<30;i++) printf("*");
-  printf("\n");
+  AliDebug(2,"VZERO BuildGeometry");
 
   TNode *top; 
 
@@ -625,13 +619,7 @@ void AliVZEROv3::CreateMaterials()
 
 // Creates materials used for geometry 
 
-    Int_t i;
-
-    printf("\n");
-    for(i=0;i<25;i++) printf("*");
-    printf(" VZERO create materials ");
-    for(i=0;i<26;i++) printf("*");
-    printf("\n");
+    AliDebug(2,"VZERO create materials");
     
 /*
     Float_t ppckov[14] = { 5.5e-9, 5.7e-9, 5.9e-9, 6.1e-9, 6.3e-9, 6.5e-9, 6.7e-9, 
@@ -662,7 +650,6 @@ void AliVZEROv3::CreateMaterials()
 
     Int_t *idtmed = fIdtmed->GetArray()-2999;
     
-//    TGeant3 *geant3 = (TGeant3*) gMC;
     
 //  Parameters related to Quarz (SiO2) :
  
@@ -692,10 +679,19 @@ void AliVZEROv3::CreateMaterials()
     Float_t wscin[2] = {1.,1.};
     Float_t denscin  = 1.032;
     
+// AIR
+
+    Float_t aAir[4]={12.,14.,16.,36.};
+    Float_t zAir[4]={6.,7.,8.,18.};
+    Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+    Float_t dAir = 1.20479E-3;
+    
 //  Definition of materials :
-       
-    AliMaterial( 1, "AIR A$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
-    AliMaterial(11, "AIR I$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
+
+// AIR
+
+    AliMixture( 1, "AIR A$", aAir,zAir,dAir,4,wAir);
+    AliMixture(11, "AIR I$", aAir,zAir,dAir,4,wAir);
     AliMaterial( 2, "CARBON$"  , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
     AliMixture(  3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
     AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
@@ -785,19 +781,12 @@ void AliVZEROv3::CreateMaterials()
 }
 
 //_____________________________________________________________________________
-void AliVZEROv3::DrawModule()
+void AliVZEROv3::DrawModule() const
 {
 
 //  Drawing is done in DrawVZERO.C
 
-   Int_t i;
-
-   printf("\n");
-   for(i=0;i<30;i++) printf("*");
-   printf(" VZERO DrawModule ");
-   for(i=0;i<30;i++) printf("*");
-   printf("\n");
-
+   AliDebug(2,"VZERO DrawModule");
 
 }
 
@@ -807,7 +796,7 @@ void AliVZEROv3::Init()
 // Initialises version 2 of the VZERO Detector
 // Just prints an information message
   
-   printf(" VZERO version %d initialized \n",IsVersion());
+  AliInfo(Form("VZERO version %d initialized",IsVersion()));
    
 //   gMC->SetMaxStep(fMaxStepAlu);
 //   gMC->SetMaxStep(fMaxStepQua);
@@ -839,18 +828,25 @@ void AliVZEROv3::StepManager()
      
      if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return; 
 
+     static Int_t idV0R1 = gMC->VolId("V0R1");
+     static Int_t idV0L1 = gMC->VolId("V0L1");
+     static Int_t idV0R2 = gMC->VolId("V0R2");
+     static Int_t idV0L2 = gMC->VolId("V0L2");
+     static Int_t idV0R3 = gMC->VolId("V0R3");
+     static Int_t idV0L3 = gMC->VolId("V0L3");
+
      vol[0]    = gMC->CurrentVolOffID(1, vol[1]);
      vol[2]    = gMC->CurrentVolID(copy);
      vol[3]    = copy;
      
-     if      ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
+     if      ( gMC->CurrentVolID(copy) == idV0R1 ||
+               gMC->CurrentVolID(copy) == idV0L1 )
               ringNumber = 1.0;
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L2") ) 
+     else if ( gMC->CurrentVolID(copy) == idV0R2 ||
+               gMC->CurrentVolID(copy) == idV0L2 ) 
               ringNumber = 2.0;  
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
+     else if ( gMC->CurrentVolID(copy) == idV0R3 ||
+               gMC->CurrentVolID(copy) == idV0L3 )
               ringNumber = 3.0;
      else
               ringNumber = 0.0;
@@ -955,20 +951,20 @@ void AliVZEROv3::MakeBranch(Option_t *option)
     
   char branchname[10];
   sprintf(branchname,"%s",GetName());
-  printf(" fBufferSize = %d \n",fBufferSize);
+  AliDebug(2,Form("fBufferSize = %d",fBufferSize));
   
   const char *cH = strstr(option,"H");
   
   if (fHits   && TreeH() && cH) {
     TreeH()->Branch(branchname,&fHits, fBufferSize);
-    printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
+    AliDebug(2,Form("Making Branch %s for hits",branchname));
   }     
 
   const char *cD = strstr(option,"D");
   
   if (fDigits   && fLoader->TreeD() && cD) {
     fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
-    printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);
+    AliDebug(2,Form("Making Branch %s for digits",branchname));
   }  
    
 }