]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSvFast.cxx
Cleanup of collisions geometries and headers.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSvFast.cxx
index a2b59cddd75981ae0c9088ee21052b1babe7ff89..32ae66feac0e115485fff0cc7572effee72791f8 100644 (file)
 
 /* $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 <TGeometry.h>
-#include <TNode.h>
 #include <TParticle.h>
+#include <TDatabasePDG.h>
 #include "TClonesArray.h" 
 #include <TVirtualMC.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 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 ; 
 }
 
 //____________________________________________________________________________
@@ -112,63 +118,6 @@ void AliPHOSvFast::AddRecParticle(const AliPHOSFastRecParticle & rp)
   fNRecParticles++ ; 
 }
 
-//____________________________________________________________________________
-void AliPHOSvFast::BuildGeometry()
-{
-  // Build the PHOS geometry for the ROOT display
-   //BEGIN_HTML
-  /*
-    <H2>
-     PHOS FAST in ALICE displayed by root
-    </H2>
-    <H4> All Views </H4>
-    <P>
-    <CENTER>
-    <IMG Align=BOTTOM ALT="Fast All Views" SRC="../images/AliPHOSvFastAllViews.gif"> 
-    </CENTER></P>
-    <H4> Front View </H4>
-    <P>
-    <CENTER>
-    <IMG Align=BOTTOM ALT="Fast Front View" SRC="../images/AliPHOSvFastFrontView.gif"> 
-    </CENTER></P>
-  */
-  //END_HTML  
-  const Int_t kColorPHOS = kRed ;
-  
-  Double_t const kRADDEG = 180.0 / TMath::Pi() ;
-  
-  new TBRIK( "BigBox", "PHOS box", "void", GetBigBox(0)/2, 
-            GetBigBox(1)/2, 
-            GetBigBox(2)/2 );
-  
-  // position PHOS into ALICE
-
-  Float_t r = GetGeometry()->GetIPtoCrystalSurface() + GetBigBox(1) / 2.0 ;
-  Int_t number = 988 ; 
-  Float_t pphi =  TMath::ATan( GetBigBox(0)  / ( 2.0 * GetGeometry()->GetIPtoCrystalSurface() ) ) ;
-  pphi *= kRADDEG ;
-  TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
-  char * nodename = new char[20] ;  
-  char * rotname  = new char[20] ; 
-
-  for( Int_t i = 1; i <= GetGeometry()->GetNModules(); i++ ) { 
-   Float_t angle = pphi * 2 * ( i - GetGeometry()->GetNModules() / 2.0 - 0.5 ) ;
-   sprintf(rotname, "%s%d", "rot", number++) ;
-   new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0);
-   top->cd();
-   sprintf(nodename,"%s%d", "Module", i) ;    
-   Float_t x =  r * TMath::Sin( angle / kRADDEG ) ;
-   Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
-   TNode * bigboxnode = new TNode(nodename, nodename, "BigBox", x, y, 0, rotname ) ;
-   bigboxnode->SetLineColor(kColorPHOS) ;
-   fNodes->Add(bigboxnode) ;
-  }
-  delete[] nodename ; 
-  delete[] rotname ; 
-}
-
 //____________________________________________________________________________
 void AliPHOSvFast::CreateGeometry()
 {
@@ -268,7 +217,7 @@ void AliPHOSvFast::MakeBranch(Option_t* opt)
 }
 //____________________________________________________________________________
 
-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
@@ -278,7 +227,7 @@ Double_t AliPHOSvFast::MakeEnergy(const Double_t energy)
 }
 //____________________________________________________________________________
 
-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
@@ -298,7 +247,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