]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/AliVZEROv2.cxx
Coding Violations Corrected.
[u/mrichter/AliRoot.git] / VZERO / AliVZEROv2.cxx
index 2708e2d8e3ee431966ac1676d6e450f712d16da4..3f902a20d775cb1a8c027839ba92c17d787d5a94 100755 (executable)
 //  (V-zero) detector  version 2  as designed by the Lyon group     //
 //   All comments should be sent to Brigitte CHEYNIS :              //
 //                                  b.cheynis@ipnl.in2p3.fr         // 
-//   Geometry of the  4th of november 2002                          //
+//   Geometry of the  26th of november 2003                         //
 //  (circular instead of trapezoidal shapes as in previous versions //
-//   plus changes in cell dimensions and offsets)                   // 
-//   New coordinate system implemented in october 2003              //
+//   plus changes in cell dimensions and offsets) :                 // 
+//   Scintillating cells are now 2 cm thick instead of 0.7 cm       //
+//   V0R sits between Z values  -89.4 and  -85.0 cm                 //
+//   V0L sits between Z values +350.0 and +352.0 cm                 //
+//   New coordinate system has been implemented in october 2003     //
 //                                                                  //
 //////////////////////////////////////////////////////////////////////
 
 #include <TParticle.h>
 
 // --- AliRoot header files ---
+#include "AliRun.h"
+#include "AliMC.h"
 #include "AliConst.h"
 #include "AliMagF.h"
 #include "AliVZEROLoader.h"
 #include "AliVZEROdigit.h"
 #include "AliVZEROhit.h"
 #include "AliVZEROv2.h"
-#include "AliMC.h"
 
 ClassImp(AliVZEROv2)
 
-//--------------------------------------------------------------------
+//_____________________________________________________________________________
 AliVZEROv2:: AliVZEROv2():AliVZERO()
 {
 // Standard default constructor 
 }
-//--------------------------------------------------------------------
+
+//_____________________________________________________________________________
 AliVZEROv2::AliVZEROv2(const char *name, const char *title):
  AliVZERO(name,title)
 {
@@ -78,7 +83,7 @@ AliVZEROv2::AliVZEROv2(const char *name, const char *title):
   
 }
 
-//-------------------------------------------------------------------------
+//_____________________________________________________________________________
 void AliVZEROv2::CreateGeometry()
 {
 
@@ -112,20 +117,23 @@ void AliVZEROv2::CreateGeometry()
   Float_t  r0, r5;
   Float_t  pi = TMath::Pi();
     
-  height1           =     1.82;           // height of cell 1, in cm
-  height2           =     3.81;           // height of cell 2, in cm
-  height3           =     4.72;           // height of cell 3, in cm
-  height4           =     7.12;           // height of cell 4, in cm
-  height5           =    10.83;           // height of cell 5, in cm
+  height1     =     1.82;         // height of cell 1, in cm
+  height2     =     3.81;         // height of cell 2, in cm
+  height3     =     4.72;         // height of cell 3, in cm
+  height4     =     7.12;         // height of cell 4, in cm
+  height5     =    10.83;         // height of cell 5, in cm
   
-  theta             = pi/6.0/2.0;       // half angular opening = 15 degrees
-    
-  halfThickQua    = fThickness1/2.0;   // half thickness of elementary cell (inner ring)
+  theta       = pi/6.0/2.0;       // half angular opening = 15 degrees
     
-  zdet              =    90.0 - 0.6 -fThickness/2.0;  // distance to vertex (along Z axis)
-  r0                =    4.05;            // closest distance to center of the beam pipe
-  height            =    height1 + height2 + height3 + height4 + height5;
-  r5                =    r0 + height;
+  halfThickQua= fThickness1/2.0;  // half thickness of elementary cell (inner ring)
+  
+// distance 0.6 cm in zdet accounts for the fact V0R box back lid sits 0.6 away from 
+// absorber nose sitting at 90 cm. Will use -zdet later...
+   
+  zdet        =    90.0 - 0.6 -fThickness/2.0;  // distance to vertex (along Z axis)   
+  r0          =    4.05;          // closest distance to center of the beam pipe
+  height      =    height1 + height2 + height3 + height4 + height5;
+  r5          =    r0 + height;
 
 // Creation of mother volume v0LE - left part - :
 // Entrance face at  +350.0 cm  (new coordinate system) ...
@@ -218,11 +226,13 @@ void AliVZEROv2::CreateGeometry()
       
   gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
   
-// Creation of  carbon lids (3 mm thick) to keep v0RI box shut...
+// Creation of  carbon lids (2 mm thick) to keep v0RI box shut...
+
+  Float_t  lidThickness = 0.2;
  
   partube[0] =   r0;
   partube[1] =   r5;
-  partube[2] =   +0.3/2.0;
+  partube[2] =   +lidThickness/2.0;
     
   gMC->Gsvolu("V0CA","TUBE",idtmed[3001],partube,3); 
   gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-partube[2],0,"ONLY");
@@ -255,10 +265,10 @@ void AliVZEROv2::CreateGeometry()
   gMC->Gsvolu("V0R0","TUBS",idtmed[3010],partubs,5);  // air volume 
 
 // Elementary cell of ring 1 :
-// (the cells will be shifted by 3 mm to output fibers) 
+// (cells 2 and 3  will be shifted by 1 cm to output fibers) 
    
-  Float_t   offsetFibers =  0.7;
-  Float_t   offset        =  fThickness/2.0 - 0.3 - fThickness1/2.0; 
+  Float_t   offsetFibers  =  1.0;
+  Float_t   offset        =  fThickness/2.0 - lidThickness - fThickness1/2.0; 
   Float_t   r1            =  r0 + height1;
       
   partubs[0]     =  r0;
@@ -297,7 +307,7 @@ void AliVZEROv2::CreateGeometry()
   partubs[1]     =  r4;
 
   gMC->Gsvolu("V0R4","TUBS",idtmed[3005],partubs,5);  // scintillator volume
-  gMC->Gspos("V0R4",1,"V0R0", 0.0, 0.0 ,  -offset + 3.0 * offsetFibers, 0,"ONLY");
+  gMC->Gspos("V0R4",1,"V0R0", 0.0, 0.0 ,  -offset + 2.0 * offsetFibers, 0,"ONLY");
 
 // Elementary cells of ring 5 :
 
@@ -307,13 +317,13 @@ void AliVZEROv2::CreateGeometry()
   partubs[4]     = 120.0-30.0;
   
   gMC->Gsvolu("V0R5","TUBS",idtmed[3005],partubs,5);  // scintillator volume
-  gMC->Gspos("V0R5",1,"V0R0", 0.0, 0.0 , -offset + 4.0 * offsetFibers, 0,"ONLY");  
+  gMC->Gspos("V0R5",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");  
 
   partubs[3]     = 120.0-30.0;
   partubs[4]     = 120.0-15.0;
   
   gMC->Gsvolu("V0R6","TUBS",idtmed[3005],partubs,5);  // scintillator volume
-  gMC->Gspos("V0R6",1,"V0R0", 0.0, 0.0 ,  -offset + 4.0 * offsetFibers, 0,"ONLY");
+  gMC->Gspos("V0R6",1,"V0R0", 0.0, 0.0 ,  -offset + 2.0 * offsetFibers, 0,"ONLY");
    
   Float_t  phiDeg = 180./6.; 
 
@@ -418,11 +428,13 @@ void AliVZEROv2::BuildGeometry()
   fNodes->Add(v0Rnode);  
   v0Rnode->SetVisibility(2);     
  
-// Rondelles de carbone (epaisseur 3 mm) de maintien des cellules ...
+// Rondelles de carbone (epaisseur 2 mm) de maintien des cellules ...
+
+  Float_t  lidThickness = 0.2;
   
   partube[0] =   r0;
   partube[1] =   r5;
-  partube[2] =   +0.3/2.0;
+  partube[2] =   +lidThickness/2.0;
   
   TTUBE  *v0CA = new TTUBE("V0CA", "V0CA", "void",partube[0], partube[1], partube[2]);
   
@@ -471,8 +483,8 @@ void AliVZEROv2::BuildGeometry()
   v0R0->SetNumberOfDivisions(ndiv);                                              
 
   Float_t   r1     =  r0 + height1;
-  Float_t   offset = fThickness/2.0 - 0.3 - fThickness1/2.0; 
-  Float_t   offsetFibers = 0.7;
+  Float_t   offset = fThickness/2.0 - lidThickness - fThickness1/2.0; 
+  Float_t   offsetFibers = 1.0;
     
   partubs[0]     =  r0;
   partubs[1]     =  r1;
@@ -574,21 +586,21 @@ void AliVZEROv2::BuildGeometry()
 
     sprintf(nameNode,"SUBDER%d",ndetR);
     v0Rnode0->cd();    
-    v0Rnode4 = new TNode(nameNode,nameNode,v0R4,0.0,0.0, -offset + 3.0*offsetFibers,0);         
+    v0Rnode4 = new TNode(nameNode,nameNode,v0R4,0.0,0.0, -offset + 2.0*offsetFibers,0);         
     v0Rnode4->SetLineColor(kColorVZERO);
     fNodes->Add(v0Rnode4);
     ndetR++;
      
     sprintf(nameNode,"SUBDER%d",ndetR);
     v0Rnode0->cd();    
-    v0Rnode5 = new TNode(nameNode,nameNode,v0R5,0.0,0.0, -offset + 4.0*offsetFibers,0);         
+    v0Rnode5 = new TNode(nameNode,nameNode,v0R5,0.0,0.0, -offset + 2.0*offsetFibers,0);         
     v0Rnode5->SetLineColor(kColorVZERO);
     fNodes->Add(v0Rnode5);
     ndetR++;
     
     sprintf(nameNode,"SUBDER%d",ndetR);
     v0Rnode0->cd();    
-    v0Rnode6 = new TNode(nameNode,nameNode,v0R6,0.0,0.0, -offset + 4.0*offsetFibers,0);         
+    v0Rnode6 = new TNode(nameNode,nameNode,v0R6,0.0,0.0, -offset + 2.0*offsetFibers,0);         
     v0Rnode6->SetLineColor(kColorVZERO);
     fNodes->Add(v0Rnode6);
     ndetR++;
@@ -636,8 +648,8 @@ void AliVZEROv2::BuildGeometry()
   v0L0->SetNumberOfDivisions(ndiv); 
   v0L0->SetLineColor(7);
   
-  Float_t   offset_left;
-  offset_left    = - fThickness1/2.0; 
+  Float_t   offsetLeft;
+  offsetLeft    = - fThickness1/2.0; 
 
   Float_t   r1Left =  r0Left + height1Left;        
       
@@ -709,7 +721,7 @@ void AliVZEROv2::BuildGeometry()
     sprintf(nameNode,"SUBDEL%d",ndetL);
     
     v0Lnode->cd();
-    v0Lnode0 = new TNode(nameNode,nameNode,v0L0,0.0,0.0, offset_left + halfThickQua,mat920);    
+    v0Lnode0 = new TNode(nameNode,nameNode,v0L0,0.0,0.0, offsetLeft + halfThickQua,mat920);     
     v0Lnode0->SetLineColor(kColorVZERO);
     fNodes->Add(v0Lnode0);
     ndetL++;
@@ -763,7 +775,7 @@ void AliVZEROv2::BuildGeometry()
      
 }  
     
-//------------------------------------------------------------------------
+//_____________________________________________________________________________
 void AliVZEROv2::CreateMaterials()
 {
 
@@ -925,10 +937,10 @@ void AliVZEROv2::CreateMaterials()
 
 //    gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);    
 //    gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
-                                   
-    
+                                       
 }
-//---------------------------------------------------------------------
+
+//_____________________________________________________________________________
 void AliVZEROv2::DrawModule()
 {
 
@@ -945,10 +957,10 @@ void AliVZEROv2::DrawModule()
 
 }
 
-//-------------------------------------------------------------------
+//_____________________________________________________________________________
 void AliVZEROv2::Init()
 {
-// Initialises version 1 of the VZERO Detector
+// Initialises version 2 of the VZERO Detector
 // Just prints an information message
   
    printf(" VZERO version %d initialized \n",IsVersion());
@@ -960,8 +972,8 @@ void AliVZEROv2::Init()
   
 }
 
-//-------------------------------------------------------------------
 
+//_____________________________________________________________________________
 void AliVZEROv2::StepManager()
 {
  
@@ -977,7 +989,7 @@ void AliVZEROv2::StepManager()
      
      Float_t        theta;
      Float_t        phi;
-     Float_t        kRaddeg = 180/TMath::Pi();
+     Float_t        kRaddeg = 180.0/TMath::Pi();
      Float_t        ringNumber;
 
      Int_t          ipart;
@@ -1071,7 +1083,6 @@ void AliVZEROv2::StepManager()
                 
         tlength  = 0.0;
         eloss    = 0.0; 
-
          
         } 
     }
@@ -1088,7 +1099,7 @@ void AliVZEROv2::AddHit(Int_t track, Int_t *vol, Float_t *hits)
   new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
 }
 
-//---------------------------------------------------------------------
+//_____________________________________________________________________________
 void AliVZEROv2::AddDigits(Int_t *tracks, Int_t* digits) 
 {
 
@@ -1098,7 +1109,7 @@ void AliVZEROv2::AddDigits(Int_t *tracks, Int_t* digits)
    new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
 }
 
-//---------------------------------------------------------------------
+//_____________________________________________________________________________
 void AliVZEROv2::MakeBranch(Option_t *option)
 {
   
@@ -1116,7 +1127,7 @@ void AliVZEROv2::MakeBranch(Option_t *option)
   }     
 
   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);