]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSv4.cxx
position of the particle initiating the hit in PHOS
[u/mrichter/AliRoot.git] / PHOS / AliPHOSv4.cxx
index 77c1c3a56b9d65bf559ff3383187342ad5d8b4c3..7892b9ecf8b1f41dd9fdffe0987db607080d2b02 100644 (file)
@@ -29,6 +29,9 @@
 #include "TBRIK.h"
 #include "TNode.h"
 #include "TParticle.h"
+#include "TTree.h"
+#include "TGeometry.h"
+#include "TFile.h"
 
 // --- Standard library ---
 
@@ -39,6 +42,7 @@
 #include "AliPHOSv4.h"
 #include "AliRun.h"
 #include "AliConst.h"
+#include "AliMC.h"
 
 ClassImp(AliPHOSv4)
 
@@ -54,7 +58,7 @@ AliPHOSv4::AliPHOSv4(const char *name, const char *title):
      
     
     SetBigBox(0, fGeom->GetOuterBoxSize(0) ) ;
-    SetBigBox(1, fGeom->GetOuterBoxSize(1) + fGeom->GetPPSDBoxSize(1) ) ; 
+    SetBigBox(1, fGeom->GetOuterBoxSize(1) + fGeom->GetCPVBoxSize(1) ) ; 
     SetBigBox(2, fGeom->GetOuterBoxSize(0) ); 
     
     fNRecParticles = 0 ; 
@@ -235,18 +239,19 @@ Float_t AliPHOSv4::GetBigBox(Int_t index)
 }
 
 //___________________________________________________________________________
-void AliPHOSv4::MakeBranch(Option_t* opt)
+void AliPHOSv4::MakeBranch(Option_t* opt, char *file)
 {  
   // Create new branch in the current reconstructed Root Tree
  
-  AliDetector::MakeBranch(opt) ;
+  AliDetector::MakeBranch(opt,file) ;
   
   char branchname[10];
   sprintf(branchname,"%s",GetName());
   char *cd = strstr(opt,"R");
   
   if (fFastRecParticles && gAlice->TreeR() && cd) {
-    gAlice->TreeR()->Branch(branchname, &fFastRecParticles, fBufferSize);
+    gAlice->MakeBranchInTree(gAlice->TreeR(), 
+                             branchname, &fFastRecParticles, fBufferSize, file) ;
   }
 }
 
@@ -466,16 +471,16 @@ void AliPHOSv4::StepManager(void)
   Int_t modid  ; 
   gMC->CurrentVolID(modid);
   
-  Float_t Energy = gMC->Etot() ; //Total energy of current track
+  Float_t energy = gMC->Etot() ; //Total energy of current track
 
   //Calculating mass of current particle
-  TDatabasePDG * PDG = TDatabasePDG::Instance() ;
-  TParticlePDG * partPDG = PDG->GetParticle(gMC->TrackPid()) ;
+  TDatabasePDG * pdg = TDatabasePDG::Instance() ;
+  TParticlePDG * partPDG = pdg->GetParticle(gMC->TrackPid()) ;
   Float_t mass = partPDG->Mass() ;
 
-  if(Energy > mass){
-    pos.SetMag(TMath::Sqrt(Energy*Energy-mass*mass)) ;
-    TLorentzVector pTrack(pos,Energy) ;  
+  if(energy > mass){
+    pos.SetMag(TMath::Sqrt(energy*energy-mass*mass)) ;
+    TLorentzVector pTrack(pos, energy) ;  
 
     TParticle * part = new TParticle(gMC->TrackPid(), 0,-1,-1,-1,-1, pTrack, lv)  ;