]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSClusterizerv2.cxx
Possible conflicts between Heavy Flavor and Atlas Tuning removed.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv2.cxx
index 76d32dfb308a214c930d14b33b872f41c7cfc58a..7fcab2f27b60011eef1a552b6bba4e918000c044 100644 (file)
@@ -1,71 +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 ---
-#include <iostream.h>
-#include <iomanip.h>
 
 // --- 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* File, const char* name):
-  AliPHOSClusterizerv1(File,name)
+//____________________________________________________________________________
+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* aliceF  = (TFolder*)gROOT->FindObjectAny("YSAlice");
-  TFolder* storage = (TFolder*)aliceF->FindObject("WhiteBoard/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;
     
-    cout<<" MakeClusters invoked..";
+    AliInfo(Form("MakeClusters invoked..")) ;
     MakeClusters() ;
-    cout<<" done."<<endl;
+    AliInfo(Form("MakeClusters done.")) ;
 
 
     //SmartRecPoints will communicate with wPool.
@@ -77,8 +103,10 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     AliPHOSRecCpvManager* recCpv = new AliPHOSRecCpvManager();
     wPoolF->Add(recCpv);
 
-    for(Int_t iPoint=0; iPoint<gime->CpvRecPoints()->GetEntriesFast(); iPoint++) {
-      rp = new AliPHOSEvalRecPoint(iPoint,AliPHOSEvalRecPoint::cpv);
+    Int_t iPoint; //loop variable
+
+    for(iPoint=0; iPoint<gime->CpvRecPoints()->GetEntriesFast(); iPoint++) {
+      rp = new AliPHOSEvalRecPoint(iPoint, kTRUE);
       rp->MakeJob();
     }
 
@@ -90,7 +118,9 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     cpvRecPoints->Delete();
     cpvRecPoints->Compress();
 
-    for(Int_t i=0; i<wPool->GetEntries(); i++)
+    Int_t i; //loop variable
+
+    for(i=0; i<wPool->GetEntries(); i++)
       cpvRecPoints->Add(wPool->At(i));
 
     wPool->Clear();
@@ -99,8 +129,8 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     wPoolF->Remove(recCpv);
     delete recCpv;
 
-    cout<<"       "<<gime->CpvRecPoints()->GetEntries()<<endl;
-    cout<<"       "<<cpvRecPoints->GetEntries()<<" cpvRecPoints."<<endl<<endl;
+    AliInfo(Form("       %d", gime->CpvRecPoints()->GetEntries() )) ;
+    AliInfo(Form("       %d cpvRecPoints", cpvRecPoints->GetEntries() )) ;
 
 
     // Now Emc reconstruction
@@ -108,8 +138,8 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     AliPHOSRecEmcManager* recEmc = new AliPHOSRecEmcManager();
     wPoolF->Add(recEmc);
 
-    for(Int_t iPoint=0; iPoint<gime->EmcRecPoints()->GetEntriesFast(); iPoint++) {
-      rp = new AliPHOSEvalRecPoint(iPoint,AliPHOSEvalRecPoint::emc);
+    for(iPoint=0; iPoint<gime->EmcRecPoints()->GetEntriesFast(); iPoint++) {
+      rp = new AliPHOSEvalRecPoint(iPoint, kFALSE);
       rp->MakeJob();
     }
 
@@ -120,7 +150,7 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     emcRecPoints->Delete();
     emcRecPoints->Compress();
 
-    for(Int_t i=0; i<wPool->GetEntries(); i++)
+    for(i=0; i<wPool->GetEntries(); i++)
       emcRecPoints->Add(wPool->At(i));
 
     wPool->Clear();
@@ -129,29 +159,33 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
     wPoolF->Remove(recEmc);
     delete recEmc;
 
-    cout<<"       "<<nOldCpv<<" OLD cpvRecPoints."<<endl;
-    cout<<"       "<<gime->CpvRecPoints()->GetEntries()<<endl;
-    cout<<"       "<<cpvRecPoints->GetEntries()<<" cpvRecPoints."<<endl<<endl;
+    TString message ; 
+    message  = "       %d  OLD cpvRecPoints\n" ; 
+    message += "       %d\n" ; 
+    message += "       %d cpvRecPoints\n" ; 
+
+    message += "       %d OLD emcRecPoints " ; 
+    message += "       %d\n" ;
+    message += "       %d emcRecPoints\n" ;
 
-    cout<<"       "<<nOldEmc<<" OLD emcRecPoints."<<endl;
-    cout<<"       "<<gime->EmcRecPoints()->GetEntries()<<endl;
-    cout<<"       "<<emcRecPoints->GetEntries()<<" emcRecPoints."<<endl<<endl;
+    AliInfo(Form("%s", message.Data(), 
+        nOldCpv, 
+        gime->CpvRecPoints()->GetEntries(),cpvRecPoints->GetEntries(), 
+        nOldEmc, 
+        gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() )); 
 
-    WriteRecPoints(ievent);
+    WriteRecPoints();
 
 
   } // loop over events
 
   if(strstr(option,"tim")) {
     gBenchmark->Stop("PHOSClusterizer");
-    cout << "AliPHOSClusterizer:" << endl ;
-    cout << "  took " << gBenchmark->GetCpuTime("PHOSClusterizer") << " seconds for Clusterizing " << endl;
-    cout << endl ;
-
+    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.
@@ -165,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 ; 
 
@@ -195,11 +229,6 @@ Int_t AliPHOSClusterizerv2::AreNeighbours(AliPHOSDigit* d1, AliPHOSDigit* d2) co
 
   }
 
-//    //Do NOT clusterize upper PPSD  // YVK 30.09.2001
-//    if( IsInPpsd(d1) && IsInPpsd(d2) &&
-//       relid1[1] > 0                 &&
-//       relid1[1] < geom->GetNumberOfPadsPhi()*geom->GetNumberOfPadsPhi() ) rv = 2 ;
-
   return rv ; 
 
 }