]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSvFast.cxx
Random seed for the ref. histo selection set to the current machine clock
[u/mrichter/AliRoot.git] / PHOS / AliPHOSvFast.cxx
index 1609a9469790821cb74ebcfcf69170778450d67d..53b0c2332e87997b91f0e22fc957d663fe9f0fbc 100644 (file)
@@ -1,4 +1,4 @@
-/**************************************************************************
+  /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
 
 /* $Id$ */
 
+/* History of cvs commits:
+ *
+ * $Log$
+ * Revision 1.30  2006/09/13 07:31:01  kharlov
+ * Effective C++ corrections (T.Pocheptsov)
+ *
+ * Revision 1.29  2005/05/28 14:19:05  schutz
+ * Compilation warnings fixed by T.P.
+ *
+ */
+
 //_________________________________________________________________________
 // Implementation of the PHOS manager class for fast simulations     
 // Tracks particles until the reach a grossly designed PHOS module
 
 // --- ROOT system ---
  
-#include "TBRIK.h"
-#include "TNode.h"
-#include "TParticle.h"
-#include "TGeometry.h"
+#include <TBRIK.h>
+#include <TGeometry.h>
+#include <TNode.h>
+#include <TParticle.h>
+#include "TClonesArray.h" 
+#include <TVirtualMC.h>
 
 // --- Standard library ---
 
 // --- AliRoot header files ---
 #include "AliPHOSFastRecParticle.h"
+#include "AliPHOSGeometry.h"
+#include "AliPHOSLoader.h"
 #include "AliPHOSvFast.h"
-#include "AliPHOSGetter.h"
 #include "AliRun.h"
 
 ClassImp(AliPHOSvFast)
 
-//____________________________________________________________________________
-AliPHOSvFast::AliPHOSvFast() : AliPHOS()
+AliPHOSvFast::AliPHOSvFast() :
+  fBigBoxX(0.),
+  fBigBoxY(0.),
+  fBigBoxZ(0.),
+  fFastRecParticles(0),
+  fNRecParticles(0),
+  fRan(0),
+  fResPara1(0.),
+  fResPara2(0.),
+  fResPara3(0.),
+  fPosParaA0(0.),
+  fPosParaA1(0.),
+  fPosParaB0(0.),
+  fPosParaB1(0.),
+  fPosParaB2(0.)    
 {
   // default ctor : initialize data member
-   fBigBoxX = 0. ;                      
-   fBigBoxY = 0. ;                      
-   fBigBoxZ = 0. ;                       
-   fFastRecParticles = 0 ;        
-   fNRecParticles = 0 ;                
-   fRan = 0 ;                            
-   fResPara1 = 0. ;                       
-   fResPara2 = 0. ;                        
-   fResPara3 = 0. ;                      
-   fPosParaA0 = 0. ;                      
-   fPosParaA1 = 0. ;
-   fPosParaB0 = 0. ;     
-   fPosParaB1 = 0. ;    
-   fPosParaB2 = 0. ;    
-
 }
 
 //____________________________________________________________________________
 AliPHOSvFast::AliPHOSvFast(const char *name, const char *title):
-  AliPHOS(name,title)
+  AliPHOS(name,title),
+  fBigBoxX(0.),
+  fBigBoxY(0.),
+  fBigBoxZ(0.),
+  fFastRecParticles(new AliPHOSFastRecParticle::FastRecParticlesList("AliPHOSFastRecParticle", 100)),
+  fNRecParticles(0),
+  fRan(0),
+  fResPara1(0.030), // GeV
+  fResPara2(0.00003),
+  fResPara3(0.00001),
+  fPosParaA0(2.87),    // mm
+  fPosParaA1(-0.0975),
+  fPosParaB0(0.257),
+  fPosParaB1(0.137),
+  fPosParaB2(0.00619)
 {
   // ctor
-
-  
-  // create the Getter 
-  AliPHOSGetter::GetInstance(gDirectory->GetName(), 0) ; 
-  
+  // create the Loader 
   SetBigBox(0, GetGeometry()->GetOuterBoxSize(0) ) ;
   SetBigBox(1, GetGeometry()->GetOuterBoxSize(3) + GetGeometry()->GetCPVBoxSize(1) ) ; 
   SetBigBox(2, GetGeometry()->GetOuterBoxSize(2) ); 
-  
-  fNRecParticles = 0 ; 
-  fFastRecParticles = new AliPHOSFastRecParticle::FastRecParticlesList("AliPHOSFastRecParticle", 100) ;
-  
-  fResPara1 = 0.030 ;    // GeV
-  fResPara2 = 0.00003 ; 
-  fResPara3 = 0.00001 ; 
-  
-  fPosParaA0 = 2.87 ;    // mm
-  fPosParaA1 = -0.0975 ;  
-  fPosParaB0 = 0.257 ;   
-  fPosParaB1 = 0.137 ; 
-  fPosParaB2 = 0.00619 ; 
-}
-
-//____________________________________________________________________________
-AliPHOSvFast::AliPHOSvFast(const AliPHOSvFast & pv):
-  AliPHOS(pv.GetName(), pv.GetTitle())
-{
-  // cpy ctor
-
-  
-  // create the Getter 
-  AliPHOSGetter::GetInstance(gDirectory->GetName(), 0) ; 
-  
-  SetBigBox(0, pv.fBigBoxX) ;
-  SetBigBox(1, pv.fBigBoxY) ; 
-  SetBigBox(2, pv.fBigBoxZ) ; 
-  
-  fNRecParticles = pv.fNRecParticles; 
-  fFastRecParticles = new TClonesArray( *(pv.fFastRecParticles) ) ;
-  
-  fResPara1 = pv.fResPara1 ;    
-  fResPara2 = pv.fResPara2 ; 
-  fResPara3 = pv.fResPara3 ; 
-  
-  fPosParaA0 = pv.fPosParaA0 ;    
-  fPosParaA1 = pv.fPosParaA1 ;  
-  fPosParaB0 = pv.fPosParaB0 ;   
-  fPosParaB1 = pv.fPosParaB1 ; 
-  fPosParaB2 = pv.fPosParaB2 ; 
 }
 
 //____________________________________________________________________________
@@ -162,7 +143,7 @@ void AliPHOSvFast::BuildGeometry()
  
   const Int_t kColorPHOS = kRed ;
   
-  Double_t const kRADDEG = 180.0 / kPI ;
+  Double_t const kRADDEG = 180.0 / TMath::Pi() ;
   
   new TBRIK( "BigBox", "PHOS box", "void", GetBigBox(0)/2, 
             GetBigBox(1)/2, 
@@ -222,7 +203,7 @@ void AliPHOSvFast::CreateGeometry()
   // --- Position  PHOS mdules in ALICE setup ---
   
   Int_t idrotm[99] ;
-  Double_t const kRADDEG = 180.0 / kPI ;
+  Double_t const kRADDEG = 180.0 / TMath::Pi() ;
   
   for( Int_t i = 1; i <= GetGeometry()->GetNModules(); i++ ) {
     
@@ -280,26 +261,21 @@ Float_t AliPHOSvFast::GetBigBox(Int_t index) const
  }
   return rv ; 
 }
-
 //___________________________________________________________________________
-void AliPHOSvFast::MakeBranch(Option_t* opt, const char *file)
+
+void AliPHOSvFast::MakeBranch(Option_t* opt)
 {  
   // Create new branch in the current reconstructed Root Tree
-  AliDetector::MakeBranch(opt,file) ;
-  
-  char branchname[10];
-  sprintf(branchname,"%s",GetName());
+  AliDetector::MakeBranch(opt);
   const char *cd = strstr(opt,"R");
   
-  if (fFastRecParticles && gAlice->TreeR() && cd) {
-    MakeBranchInTree(gAlice->TreeR(), 
-                     branchname, &fFastRecParticles, fBufferSize, file);
+  if (fFastRecParticles && fLoader->TreeR() && cd) {
+    MakeBranchInTree(fLoader->TreeR(), GetName(), &fFastRecParticles, fBufferSize, 0);
   }
 }
-
 //____________________________________________________________________________
-Double_t AliPHOSvFast::MakeEnergy(const Double_t energy)
+
+Double_t AliPHOSvFast::MakeEnergy(Double_t energy)
 {  
   // Smears the energy according to the energy dependent energy resolution.
   // A gaussian distribution is assumed
@@ -307,9 +283,9 @@ Double_t AliPHOSvFast::MakeEnergy(const Double_t energy)
   Double_t sigma  = SigmaE(energy) ; 
   return  fRan.Gaus(energy, sigma) ;   
 }
-
 //____________________________________________________________________________
-TVector3 AliPHOSvFast::MakePosition(const Double_t energy, const TVector3 pos, const Double_t theta, const Double_t phi)
+
+TVector3 AliPHOSvFast::MakePosition(Double_t energy, TVector3 pos, Double_t theta, Double_t phi)
 {
   // Smears the impact position according to the energy dependent position resolution
   // A gaussian position distribution is assumed
@@ -329,7 +305,7 @@ TVector3 AliPHOSvFast::MakePosition(const Double_t energy, const TVector3 pos, c
 }
 
 //____________________________________________________________________________
-void AliPHOSvFast::MakeRecParticle(const Int_t modid, const TVector3 pos, AliPHOSFastRecParticle & rp)
+void AliPHOSvFast::MakeRecParticle(Int_t modid, TVector3 pos, AliPHOSFastRecParticle & rp)
 {
   // Modify the primary particle properties according
   //  1. the response function of PHOS
@@ -379,7 +355,7 @@ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp )
     test = rp.GetPdgCode() ; 
 
   Fatal("MakeType", "SHOULD NOT BE USED until values of probabilities are properly set ") ;
-
+   // NB: ALL VALUES SHOULD BE CHECKED !!!!
   switch (test) { 
 
   case 22:    // it's a photon              // NB: ALL VALUES SHOLD BE CHECKED !!!!