* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id: */
-/* $Log:
- */
-//*-- Author: Boris Polichtchouk, IHEP
+/* $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"
+#include "AliPHOSDigit.h"
ClassImp(AliPHOSClusterizerv2)
+//____________________________________________________________________________
AliPHOSClusterizerv2::AliPHOSClusterizerv2() : AliPHOSClusterizerv1()
{}
-AliPHOSClusterizerv2::AliPHOSClusterizerv2(const char * headerFile, const char * name, const Bool_t toSplit):
-AliPHOSClusterizerv1(headerFile,name,toSplit)
+//____________________________________________________________________________
+AliPHOSClusterizerv2::AliPHOSClusterizerv2(AliPHOSGeometry *geom):
+AliPHOSClusterizerv1(geom)
{}
+//____________________________________________________________________________
void AliPHOSClusterizerv2::GetNumberOfClustersFound(int* numb) const
{
// Returns the number of found EMC and CPV rec.points
- AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- numb[0] = gime->EmcRecPoints()->GetEntries();
- numb[1] = gime->CpvRecPoints()->GetEntries();
+ numb[0] = fEMCRecPoints->GetEntries();
+ numb[1] = fCPVRecPoints->GetEntries();
}
-void AliPHOSClusterizerv2::Exec(Option_t* option)
+//____________________________________________________________________________
+void AliPHOSClusterizerv2::Digits2Clusters(Option_t* option)
{
// Steering method
gBenchmark->Start("PHOSClusterizer");
if(strstr(option,"print"))
- Print("") ;
-
- AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+ Print() ;
+}
+// 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);
+// TObjArray* wPool = new TObjArray(400);
+// wPool->SetName("SmartPoints");
+// wPoolF->Add(wPool);
+// wPoolF->Add(this);
- Int_t nevents = (Int_t) gAlice->TreeE()->GetEntries() ;
- Int_t ievent ;
+// Int_t nevents = gime->MaxEvent() ;
+// Int_t ievent ;
- for(ievent = 0; ievent<nevents; ievent++) {
-
- gAlice->GetEvent(ievent) ;
- gAlice->SetEvent(ievent) ;
+// for(ievent = 0; ievent<nevents; ievent++) {
- gime->Event(ievent,"D") ;
-// if(!ReadDigits(ievent)) //reads digits for event fEvent
-// continue;
+// gime->Event(ievent,"D") ;
- Info("Exec", "MakeClusters invoked..") ;
- MakeClusters() ;
- Info("Exec", "MakeClusters done.") ;
+// AliInfo(Form("MakeClusters invoked..")) ;
+// MakeClusters() ;
+// AliInfo(Form("MakeClusters done.")) ;
- //SmartRecPoints will communicate with wPool.
+// //SmartRecPoints will communicate with wPool.
- AliPHOSEvalRecPoint* rp=0;
+// AliPHOSEvalRecPoint* rp=0;
- // CPV reconstruction
+// // CPV reconstruction
- AliPHOSRecCpvManager* recCpv = new AliPHOSRecCpvManager();
- wPoolF->Add(recCpv);
+// AliPHOSRecCpvManager* recCpv = new AliPHOSRecCpvManager();
+// wPoolF->Add(recCpv);
- Int_t iPoint; //loop variable
+// Int_t iPoint; //loop variable
- for(iPoint=0; iPoint<gime->CpvRecPoints()->GetEntriesFast(); iPoint++) {
- rp = new AliPHOSEvalRecPoint(iPoint,AliPHOSEvalRecPoint::cpv);
- rp->MakeJob();
- }
+// for(iPoint=0; iPoint<gime->CpvRecPoints()->GetEntriesFast(); iPoint++) {
+// rp = new AliPHOSEvalRecPoint(iPoint, kTRUE);
+// rp->MakeJob();
+// }
- AliPHOSEvalRecPoint pt;
- pt.UpdateWorkingPool();
+// AliPHOSEvalRecPoint pt;
+// pt.UpdateWorkingPool();
- TObjArray * cpvRecPoints = gime->CpvRecPoints() ;
- Int_t nOldCpv = cpvRecPoints->GetEntries();
- cpvRecPoints->Delete();
- cpvRecPoints->Compress();
+// TObjArray * cpvRecPoints = gime->CpvRecPoints() ;
+// Int_t nOldCpv = cpvRecPoints->GetEntries();
+// cpvRecPoints->Delete();
+// cpvRecPoints->Compress();
- Int_t i; //loop variable
+// Int_t i; //loop variable
- for(i=0; i<wPool->GetEntries(); i++)
- cpvRecPoints->Add(wPool->At(i));
+// for(i=0; i<wPool->GetEntries(); i++)
+// cpvRecPoints->Add(wPool->At(i));
- wPool->Clear();
- wPool->Compress();
+// wPool->Clear();
+// wPool->Compress();
- wPoolF->Remove(recCpv);
- delete recCpv;
+// 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
+// // Now Emc reconstruction
- AliPHOSRecEmcManager* recEmc = new AliPHOSRecEmcManager();
- wPoolF->Add(recEmc);
+// AliPHOSRecEmcManager* recEmc = new AliPHOSRecEmcManager();
+// wPoolF->Add(recEmc);
- for(iPoint=0; iPoint<gime->EmcRecPoints()->GetEntriesFast(); iPoint++) {
- rp = new AliPHOSEvalRecPoint(iPoint,(Bool_t)AliPHOSEvalRecPoint::emc);
- rp->MakeJob();
- }
+// for(iPoint=0; iPoint<gime->EmcRecPoints()->GetEntriesFast(); iPoint++) {
+// rp = new AliPHOSEvalRecPoint(iPoint, kFALSE);
+// rp->MakeJob();
+// }
- pt.UpdateWorkingPool();
+// pt.UpdateWorkingPool();
- TObjArray * emcRecPoints = gime->EmcRecPoints() ;
- Int_t nOldEmc = emcRecPoints->GetEntries();
- emcRecPoints->Delete();
- emcRecPoints->Compress();
+// TObjArray * emcRecPoints = gime->EmcRecPoints() ;
+// Int_t nOldEmc = emcRecPoints->GetEntries();
+// emcRecPoints->Delete();
+// emcRecPoints->Compress();
- for(i=0; i<wPool->GetEntries(); i++)
- emcRecPoints->Add(wPool->At(i));
+// for(i=0; i<wPool->GetEntries(); i++)
+// emcRecPoints->Add(wPool->At(i));
- wPool->Clear();
- wPool->Compress();
+// wPool->Clear();
+// wPool->Compress();
- wPoolF->Remove(recEmc);
- delete recEmc;
+// wPoolF->Remove(recEmc);
+// delete recEmc;
- TString message ;
- message = " %d OLD cpvRecPoints\n" ;
- message += " %d\n" ;
- message += " %d cpvRecPoints\n" ;
+// 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" ;
+// message += " %d OLD emcRecPoints " ;
+// message += " %d\n" ;
+// message += " %d emcRecPoints\n" ;
- Info("Exec", message.Data(),
- nOldCpv,
- gime->CpvRecPoints()->GetEntries(),cpvRecPoints->GetEntries(),
- nOldEmc,
- gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() ) ;
+// AliInfo(Form("%s", message.Data(),
+// nOldCpv,
+// gime->CpvRecPoints()->GetEntries(),cpvRecPoints->GetEntries(),
+// nOldEmc,
+// gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() ));
+
- WriteRecPoints(ievent);
+// WriteRecPoints();
- } // loop over events
+// } // loop over events
- if(strstr(option,"tim")) {
- gBenchmark->Stop("PHOSClusterizer");
- Info("Exec","took %f seconds for Clusterizing", gBenchmark->GetCpuTime("PHOSClusterizer") ) ;
- }
-}
-//---------------------------------------------------------------------------------
+// if(strstr(option,"tim")) {
+// gBenchmark->Stop("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.
// 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();
-
Int_t rv = 0 ;
Int_t relid1[4] ;
- geom->AbsToRelNumbering(d1->GetId(), relid1) ;
+ fGeom->AbsToRelNumbering(d1->GetId(), relid1) ;
Int_t relid2[4] ;
- geom->AbsToRelNumbering(d2->GetId(), relid2) ;
+ fGeom->AbsToRelNumbering(d2->GetId(), relid2) ;
if ( (relid1[0] == relid2[0]) && (relid1[1]==relid2[1]) ) { // inside the same PHOS module and the same PPSD Module
Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;