]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSReconstructioner.cxx
these TTask are posted to the apropriate folders //YSAlice/tasks/(S)Digitizer and...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstructioner.cxx
index 4ad362dc5a2c2349154308a694119b49c701ec18..dc23cdd92d9ed69a2c390a0e2105dfed3654bc36 100644 (file)
 //_________________________________________________________________________
 //*--
 //*-- Author: Gines Martinez & Yves Schutz (SUBATECH) 
-//*-- Complitely redisigned by Dmitri Peressounko (SUBATECH & RRC KI) March 2001
+//*-- Compleetely redisigned by Dmitri Peressounko (SUBATECH & RRC KI) March 2001
 /////////////////////////////////////////////////////////////////////////////////////
 //  Wrapping class for reconstruction. Allows to produce reconstruction from 
 //  different steps: from previously produced hits,sdigits, etc. Each new reconstruction
-//  flow (e.g. gigits, made from them RecPoints, made from them TrackSegments, made from 
-//  them RecParticles) are distinguished by the title of created branches. One can 
-//  use this title as a comment, see user case below. Thanks to getters, one can set 
-//  parameters to reconstruction bricks. The full set of parameters is saved in the 
-//  correspoinding branch: e.g. parameters of clusterizer are stored in branch 
-//  TreeR::AliPHOSClusterizer with the same title as the branch contaning RecPoints 
-//  themself. TTree does not support overwriting, therefore one can not produce several 
+//  flow (e.g. digits, made from them RecPoints, subsequently made TrackSegments, 
+//  subsequently made RecParticles) are distinguished by the title of created branches. One can 
+//  use this title as a comment, see use case below. 
+//  Thanks to getters, one can set 
+//  parameters to reconstruction briks. The full set of parameters is saved in the 
+//  corresponding branch: e.g. parameters of clusterizer are stored in branch 
+//  TreeR::AliPHOSClusterizer with the same title as the branch containing the RecPoints. 
+//  TTree does not support overwriting, therefore one can not produce several 
 //  branches with the same names and titles - use different titles.
 //
-//  User case: 
+//  Use case: 
 //
 //  root [0] AliPHOSReconstructioner * r = new AliPHOSReconstructioner("galice.root")
 //              //  Set the header file
 //  root [1] r->ExecuteTask() 
-//              //  Make full cheine of reconstruction
+//              //  Make full chain of reconstruction
 //
 //              // One can specify the title for each branch 
 //  root [2] r->SetBranchFileName("RecPoints","RecPoints1") ;
@@ -62,6 +63,7 @@
 #include "TClonesArray.h"
 #include "TROOT.h"
 #include "TTree.h"
+#include "TFile.h"
 
 // --- Standard library ---
 #include <iostream.h>   
@@ -128,7 +130,8 @@ AliPHOSReconstructioner::AliPHOSReconstructioner(const char* headerFile):TTask("
   
 } 
 //____________________________________________________________________________
-void AliPHOSReconstructioner::Exec(Option_t *option){
+void AliPHOSReconstructioner::Exec(Option_t *option)
+{
   //chesk, if the names of branches, which should be made conicide with already
   //existing
   if(!fIsInitialized)
@@ -353,7 +356,7 @@ void AliPHOSReconstructioner::Exec(Option_t *option){
 //____________________________________________________________________________
  void AliPHOSReconstructioner::Init()
 {
-  //initiase Reconstructioner if necessary: we can not do this in default constructor
+  // initiliaze Reconstructioner if necessary: we can not do this in default constructor
 
   if(!fIsInitialized){
     // Initialisation
@@ -385,7 +388,8 @@ void AliPHOSReconstructioner::Exec(Option_t *option){
 //____________________________________________________________________________
 AliPHOSReconstructioner::~AliPHOSReconstructioner()
 {
-  
+  // Delete data members if any
+
   if(fSDigitizer)
     delete fSDigitizer ;
   
@@ -400,9 +404,19 @@ AliPHOSReconstructioner::~AliPHOSReconstructioner()
   
   if(fPID)
     delete fPID ;
+
+//    TFile * file = (TFile*) gROOT->GetFile(fHeaderFileName.Data()) ;
+    
+//    if(file != 0) {
+//      file->Close();
+//      delete file;
+//      printf("File %s is closed\n",fHeaderFileName.Data());
+//    }
+
 } 
 //____________________________________________________________________________
-void AliPHOSReconstructioner::SetBranchTitle(const char* branch, const char * title){
+void AliPHOSReconstructioner::SetBranchTitle(const char* branch, const char * title)
+{
   //Diverge correcpoinding branch to the file "title"
 
   if(strcmp(branch,"SDigits") == 0){ 
@@ -444,10 +458,11 @@ void AliPHOSReconstructioner::SetBranchTitle(const char* branch, const char * ti
   
 }
 //____________________________________________________________________________
-void AliPHOSReconstructioner::StartFrom(char * module,char* title){
+void AliPHOSReconstructioner::StartFrom(char * module,char* title)
+{
   // in the next pass of reconstruction (call ExecuteTask()) reconstruction will 
-  // start from the module "module", and in the case of nonsero title all 
-  // pruduced branches will have title "title". Recognize the following "modules"
+  // start from the module "module", and in the case of non zero title all 
+  // pruduced branches will have title "title". The following "modules" are recognized
   // "SD" - AliPHOSSDigitizer,
   // "D"  - AliPHOSDigitizer
   // "C"  - AliPHOSClusterizer
@@ -518,8 +533,10 @@ void AliPHOSReconstructioner::StartFrom(char * module,char* title){
   delete moduleName;
 }
 //____________________________________________________________________________
+
 void AliPHOSReconstructioner::Print(Option_t * option)const {
-  
+  // Print reconstructioner data  
+
   cout << "-----------------AliPHOSReconstructioner---------------" << endl ;
   cout << " Reconstruction of the header file " <<fHeaderFileName.Data() << endl ;
   cout << " with the following modules: " << endl ;