]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/AliVZERO.cxx
Test for clusterisation, tracker and ESD filling of MUON for ALICE reconstruction...
[u/mrichter/AliRoot.git] / VZERO / AliVZERO.cxx
index 840d97a238cd249af0df32414561535a457f2948..51c1a2e7d9665eadd51e96cf56dab0cbb3222b0b 100755 (executable)
@@ -19,6 +19,8 @@
 //                                                                       //
 //                          V-Zero   Detector                            //
 //  This class contains the base procedures for the VZERO  detector      //
+//  Geometry of November 2003 : V0R box is now 4.4 cm thick              //
+//                              scintillators are 2 cm thick             //
 //  All comments should be sent to Brigitte CHEYNIS :                    //
 //                                 b.cheynis@ipnl.in2p3.fr               //
 //                                                                       //
 ///////////////////////////////////////////////////////////////////////////
 
 
+// --- Standard libraries ---
 #include <Riostream.h>
 
+// --- ROOT libraries ---
+#include <TNamed.h>
+#include <TTree.h>
+
+// --- AliRoot header files ---
 #include "AliRun.h"
+#include "AliMC.h"
 #include "AliVZERO.h"
 #include "AliVZEROLoader.h"
-#include "AliVZEROdigit.h"
-#include "AliVZEROhit.h"
 
 ClassImp(AliVZERO)
  
-
 //_____________________________________________________________________________
 AliVZERO::AliVZERO(const char *name, const char *title)
        : AliDetector(name,title)
@@ -50,10 +56,10 @@ AliVZERO::AliVZERO(const char *name, const char *title)
   fHits         =  new TClonesArray("AliVZEROhit", 400);
   fDigits       =  new TClonesArray("AliVZEROdigit",400); 
    
-  gAlice->AddHitList(fHits);
+  gAlice->GetMCApp()->AddHitList(fHits);
 
-  fThickness    =  4.1;   // total thickness of the V0R box
-  fThickness1   =  0.7;   // thickness of the thickest cell (2.5 in version 0)
+  fThickness    =  4.4;   // total thickness of the V0R box in cm
+  fThickness1   =  2.0;   // thickness of scintillating cells in cm
   
   fMaxStepQua   =  0.05; 
   fMaxStepAlu   =  0.01; 
@@ -67,9 +73,20 @@ AliVZERO::AliVZERO(const char *name, const char *title)
 //_____________________________________________________________________________
 AliVZERO::~AliVZERO()
 {
+  //
+  // Default destructor for VZERO Detector
+  //
+  
     if (fHits) {
         fHits->Delete();
         delete fHits;
+       fHits=0;
+    }
+    
+    if (fDigits) {
+        fDigits->Delete();
+        delete fDigits;
+        fDigits=0;
     }
 }
 
@@ -77,7 +94,7 @@ AliVZERO::~AliVZERO()
 void AliVZERO::BuildGeometry()
 {
   //
-  // Build simple ROOT TNode geometry for event display
+  // Builds simple ROOT TNode geometry for event display
   //
 }
  
@@ -85,74 +102,99 @@ void AliVZERO::BuildGeometry()
 void AliVZERO::CreateGeometry()
 {
   //
-  // Build simple ROOT TNode geometry for event display
+  // Builds simple Geant3 geometry 
   //
 }
 //_____________________________________________________________________________
 void AliVZERO::CreateMaterials()
 {
   //
-  // Build simple ROOT TNode geometry for event display
+  // Creates materials used for Geant3 geometry 
   //
 }
 
-
-
 //_____________________________________________________________________________
 Int_t AliVZERO::DistanceToPrimitive(Int_t /*px*/, Int_t /*py*/)
 {
   //
-  // Calculate the distance from the mouse to the VZERO on the screen
+  // Calculates the distance from the mouse to the VZERO on the screen
   // Dummy routine
   //
   
   return 9999;
 }
  
-//-------------------------------------------------------------------------
+//_____________________________________________________________________________
 void AliVZERO::Init()
 {
   //
-  // Initialise the VZERO after it has been built
+  // Initialises the VZERO  class after it has been built
   //
 }
 
 
-//-------------------------------------------------------------------------
-
+//_____________________________________________________________________________
 void AliVZERO::SetMaxStepQua(Float_t p1)
 {
+  //
+  // Possible parametrisation of steps in active materials
+  //
      fMaxStepQua = p1;
 }
 
-//___________________________________________
+//_____________________________________________________________________________
 void AliVZERO::SetMaxStepAlu(Float_t p1)
 {
+  //
+  // Possible parametrisation of steps in Aluminum foils (not used in 
+  // version v2)
+  //
     fMaxStepAlu = p1;
 }
 
-//___________________________________________
+//_____________________________________________________________________________
 void AliVZERO::SetMaxDestepQua(Float_t p1)
 {
+  //
+  // Possible parametrisation of steps in active materials (quartz)
+  //
     fMaxDestepQua = p1;
 }
 
-//___________________________________________
+//_____________________________________________________________________________
 void AliVZERO::SetMaxDestepAlu(Float_t p1)
 {
+  //
+  // Possible parametrisation of steps in Aluminum (not used in 
+  // version v2)
+  //
     fMaxDestepAlu = p1;
 }
 
-//___________________________________________
+//_____________________________________________________________________________
 AliLoader* AliVZERO::MakeLoader(const char* topfoldername)
 { 
-  // builds VZEROgetter (AliLoader type)
+  //
+  // Builds VZEROgetter (AliLoader type)
   // if detector wants to use customized getter, it must overload this method
+  //
 
   Info("MakeLoader","Creating AliVZEROLoader. Top folder is %s.",topfoldername);
   fLoader = new AliVZEROLoader(GetName(),topfoldername);
   return fLoader;
 }
 
+//_____________________________________________________________________________
+void AliVZERO::SetTreeAddress()
+{
+  // 
+  // Sets tree address for hits.
+  //
+
+  if (fLoader->TreeH() && (fHits == 0x0))
+    fHits = new  TClonesArray("AliVZEROhit", 400);
+
+  AliDetector::SetTreeAddress();
+}