]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOS.cxx
Added the position in global coordinate system of the particle in PHOS
[u/mrichter/AliRoot.git] / PHOS / AliPHOS.cxx
index 232c895a13e37431f4e97057a4abae4a46008a33..60aeb9b4f6e97de6962cfaeb05e9cac75fe91fd2 100644 (file)
 // --- ROOT system ---
 class TFile;
 #include <TFolder.h> 
-#include <TROOT.h>
 #include <TTree.h>
 #include <TVirtualMC.h> 
 
 // --- Standard library ---
-#include <Riostream.h>
 
 // --- AliRoot header files ---
 #include "AliMagF.h"
+#include "AliESDCaloTrack.h" 
+#include "AliESD.h"
 #include "AliPHOS.h"
-#include "AliPHOSGeometry.h"
-#include "AliPHOSLoader.h"
+#include "AliPHOSGetter.h"
 #include "AliPHOSQAChecker.h"
 #include "AliRun.h"
-
+#include "AliPHOSDigitizer.h"
+#include "AliPHOSSDigitizer.h"
+#include "AliPHOSReconstructioner.h"
 ClassImp(AliPHOS)
 //____________________________________________________________________________
 AliPHOS:: AliPHOS() : AliDetector()
@@ -68,6 +69,20 @@ AliPHOS::~AliPHOS()
   
 }
 
+//____________________________________________________________________________
+void AliPHOS::Copy(AliPHOS & phos)
+{
+  TObject::Copy(phos) ; 
+  //  fQATask = AliPHOSQAChecker::Copy(*(phos.fQATask)) ; 
+  phos.fTreeQA = fTreeQA->CloneTree() ; 
+}
+
+//____________________________________________________________________________
+AliDigitizer* AliPHOS::CreateDigitizer(AliRunDigitizer* manager) const
+{
+  return new AliPHOSDigitizer(manager);
+}
+
 //____________________________________________________________________________
 void AliPHOS::CreateMaterials()
 {
@@ -360,18 +375,43 @@ void AliPHOS::CreateMaterials()
 }
 
 //____________________________________________________________________________
-AliPHOSGeometry * AliPHOS::GetGeometry() const 
-{  
-  // gets the pointer to the AliPHOSGeometry unique instance 
-  
-  return AliPHOSGeometry::GetInstance(GetTitle(),"") ;  
+void AliPHOS::FillESD(AliESD* esd) const 
+{
+  // Fill the ESD with all RecParticles
+  AliPHOSGetter *gime = AliPHOSGetter::Instance( (fLoader->GetRunLoader()->GetFileName()).Data() ) ;
+  gime->Event(gime->EventNumber(), "P") ; 
+  TClonesArray *recParticles = gime->RecParticles();
+  Int_t nOfRecParticles = recParticles->GetEntries();
+  for (Int_t recpart=0; recpart<nOfRecParticles; recpart++) {
+    AliESDCaloTrack *ct = new AliESDCaloTrack((AliPHOSRecParticle*)recParticles->At(recpart));
+    esd->AddCaloTrack(ct);
+  }
+}       
+
+//____________________________________________________________________________
+void AliPHOS::Hits2SDigits()  
+{ 
+// create summable digits
 
+  AliPHOSSDigitizer* phosDigitizer = 
+    new AliPHOSSDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
+  phosDigitizer->SetEventRange(0, -1) ; // do all the events
+  phosDigitizer->ExecuteTask("all") ;
+}
+
+//____________________________________________________________________________
+AliLoader* AliPHOS::MakeLoader(const char* topfoldername)
+{
+//different behaviour than standard (singleton getter)
+// --> to be discussed and made eventually coherent
+ fLoader = new AliPHOSLoader(GetName(),topfoldername);
+ return fLoader;
 }
 
 //____________________________________________________________________________
 void AliPHOS::SetTreeAddress()
 { 
-
+  // Links Hits in the Tree to Hits array
   TBranch *branch;
   char branchname[20];
   sprintf(branchname,"%s",GetName());
@@ -389,6 +429,14 @@ void AliPHOS::SetTreeAddress()
   }
 }
 
+//____________________________________________________________________________
+void AliPHOS::Reconstruct() const 
+{ 
+  AliPHOSReconstructioner * rec = new AliPHOSReconstructioner((fLoader->GetRunLoader()->GetFileName()).Data()) ; 
+  rec->SetEventRange(0, -1) ; // do all the events  
+  rec->ExecuteTask() ; 
+}
+
 //____________________________________________________________________________
 void AliPHOS::WriteQA()
 {
@@ -419,12 +467,3 @@ void AliPHOS::WriteQA()
 
   //fTreeQA->Fill() ; 
 }
-
-//____________________________________________________________________________
-AliLoader* AliPHOS::MakeLoader(const char* topfoldername)
-{
-//different behaviour than standard (singleton getter)
-// --> to be discussed and made eventually coherent
- fLoader = new AliPHOSLoader(GetName(),topfoldername);
- return fLoader;
-}