]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSClusterizerv2.cxx
preliminary PID in TPC needed by the ITS tracker
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv2.cxx
index 7fa234aebdc580fda8a685c14e0cd7ff070e5a81..7fcab2f27b60011eef1a552b6bba4e918000c044 100644 (file)
@@ -1,68 +1,97 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//////////////////////////////////////////////////////////////////////////////
+//  Clusterization class for IHEP reconstruction.
+// Performs clusterization (collects neighbouring active cells)
+// It differs from AliPHOSClusterizerv1 in neighbour definition only
+//*-- Author: Boris Polichtchouk, IHEP
+
 // --- ROOT system ---
 #include "TBenchmark.h"
-#include "TROOT.h"
 
 // --- Standard library ---
 
 // --- AliRoot header files ---
+#include "AliLog.h"
 #include "AliPHOSClusterizerv2.h"
 #include "AliPHOSGetter.h"
 #include "TFolder.h"
 #include "AliPHOSEvalRecPoint.h"
 #include "AliPHOSRecCpvManager.h"
 #include "AliPHOSRecEmcManager.h"
+#include "AliPHOSGeometry.h"
 
 ClassImp(AliPHOSClusterizerv2)
 
+//____________________________________________________________________________
 AliPHOSClusterizerv2::AliPHOSClusterizerv2() : AliPHOSClusterizerv1() 
 {}
 
-AliPHOSClusterizerv2::AliPHOSClusterizerv2(const char * headerFile, const char * name, const Bool_t toSplit):
-AliPHOSClusterizerv1(headerFile,name,toSplit)
+//____________________________________________________________________________
+AliPHOSClusterizerv2::AliPHOSClusterizerv2(const char * headerFile, const char * name):
+AliPHOSClusterizerv1(headerFile,name)
+{}
+
+//____________________________________________________________________________
+AliPHOSClusterizerv2::AliPHOSClusterizerv2(const AliPHOSClusterizerv2 & clu):
+AliPHOSClusterizerv1(clu)
 {}
 
+//____________________________________________________________________________
 void AliPHOSClusterizerv2::GetNumberOfClustersFound(int* numb) const
 {
+  // Returns the number of found EMC and CPV rec.points
 
-  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;   
+  AliPHOSGetter * gime = AliPHOSGetter::Instance() ;   
   numb[0] = gime->EmcRecPoints()->GetEntries();  
   numb[1] = gime->CpvRecPoints()->GetEntries();  
 }
 
+//____________________________________________________________________________
 void AliPHOSClusterizerv2::Exec(Option_t* option)
 {
+  // Steering method
 
   if(strstr(option,"tim"))
     gBenchmark->Start("PHOSClusterizer"); 
   
   if(strstr(option,"print"))
-    Print("") ; 
+    Print() ; 
 
-  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
 
-  TFolder* storage = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Event/RecData/RecPoints/PHOS")); 
-  TFolder* wPoolF =  storage->AddFolder("SmP","SmartRecPoints for PHOS");
+  TFolder* wPoolF =  gime->PhosLoader()->GetDetectorDataFolder();
   
   TObjArray* wPool = new TObjArray(400);
   wPool->SetName("SmartPoints");
   wPoolF->Add(wPool);
   wPoolF->Add(this);
 
-  Int_t nevents = (Int_t) gAlice->TreeE()->GetEntries() ;
+  Int_t nevents = gime->MaxEvent() ;
   Int_t ievent ;
 
   for(ievent = 0; ievent<nevents; ievent++) {
     
-    gAlice->GetEvent(ievent) ;
-    gAlice->SetEvent(ievent) ;
-    
     gime->Event(ievent,"D") ;
-//      if(!ReadDigits(ievent))  //reads digits for event fEvent
-//        continue;
     
-    Info("Exec", "MakeClusters invoked..") ;
+    AliInfo(Form("MakeClusters invoked..")) ;
     MakeClusters() ;
-    Info("Exec", "MakeClusters done.") ;
+    AliInfo(Form("MakeClusters done.")) ;
 
 
     //SmartRecPoints will communicate with wPool.
@@ -77,7 +106,7 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     Int_t iPoint; //loop variable
 
     for(iPoint=0; iPoint<gime->CpvRecPoints()->GetEntriesFast(); iPoint++) {
-      rp = new AliPHOSEvalRecPoint(iPoint,AliPHOSEvalRecPoint::cpv);
+      rp = new AliPHOSEvalRecPoint(iPoint, kTRUE);
       rp->MakeJob();
     }
 
@@ -100,8 +129,8 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     wPoolF->Remove(recCpv);
     delete recCpv;
 
-    Info("Exec", "       %d", gime->CpvRecPoints()->GetEntries() ) ;
-    Info("Exec", "       %d cpvRecPoints", cpvRecPoints->GetEntries() ) ;
+    AliInfo(Form("       %d", gime->CpvRecPoints()->GetEntries() )) ;
+    AliInfo(Form("       %d cpvRecPoints", cpvRecPoints->GetEntries() )) ;
 
 
     // Now Emc reconstruction
@@ -110,7 +139,7 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     wPoolF->Add(recEmc);
 
     for(iPoint=0; iPoint<gime->EmcRecPoints()->GetEntriesFast(); iPoint++) {
-      rp = new AliPHOSEvalRecPoint(iPoint,(Bool_t)AliPHOSEvalRecPoint::emc);
+      rp = new AliPHOSEvalRecPoint(iPoint, kFALSE);
       rp->MakeJob();
     }
 
@@ -139,23 +168,24 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     message += "       %d\n" ;
     message += "       %d emcRecPoints\n" ;
 
-    Info("Exec", message.Data(), 
+    AliInfo(Form("%s", message.Data(), 
         nOldCpv, 
         gime->CpvRecPoints()->GetEntries(),cpvRecPoints->GetEntries(), 
         nOldEmc, 
-        gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() ) 
+        gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() ))
 
-    WriteRecPoints(ievent);
+    WriteRecPoints();
 
 
   } // loop over events
 
   if(strstr(option,"tim")) {
     gBenchmark->Stop("PHOSClusterizer");
-    Info("Exec","took %f seconds for Clusterizing", gBenchmark->GetCpuTime("PHOSClusterizer") ) ;
+    AliInfo(Form("took %f seconds for Clusterizing", gBenchmark->GetCpuTime("PHOSClusterizer") )) ;
   }
 }
-//---------------------------------------------------------------------------------
+
+//____________________________________________________________________________
 Int_t AliPHOSClusterizerv2::AreNeighbours(AliPHOSDigit* d1, AliPHOSDigit* d2) const
 {
   // Points are neighbours if they have common edge.
@@ -169,7 +199,7 @@ Int_t AliPHOSClusterizerv2::AreNeighbours(AliPHOSDigit* d1, AliPHOSDigit* d2) co
   // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster 
   // which is compared to a digit (d2)  not yet in a cluster  
 
-  const AliPHOSGeometry * geom = AliPHOSGetter::GetInstance()->PHOSGeometry();
+  const AliPHOSGeometry * geom = AliPHOSGetter::Instance()->PHOSGeometry();
 
   Int_t rv = 0 ;