X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSClusterizerv2.cxx;h=e774731781f3a4da2106dca52efd29b6dafbca58;hb=94d06b79a195dec517c374e4978148b5aaf4cfe1;hp=e684c362f9fd099bfcf058e45e97f8edf76d5f63;hpb=386aef34aa74c52f3326dd6348ae7fe33394e566;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSClusterizerv2.cxx b/PHOS/AliPHOSClusterizerv2.cxx index e684c362f9f..e774731781f 100644 --- a/PHOS/AliPHOSClusterizerv2.cxx +++ b/PHOS/AliPHOSClusterizerv2.cxx @@ -12,49 +12,51 @@ * 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 @@ -62,126 +64,122 @@ void AliPHOSClusterizerv2::Exec(Option_t* option) gBenchmark->Start("PHOSClusterizer"); if(strstr(option,"print")) - Print("") ; - - AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; + Print() ; +} +// AliPHOSGetter * gime = AliPHOSGetter::Instance() ; - TFolder* storage = dynamic_cast(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; ieventGetEvent(ievent) ; - gAlice->SetEvent(ievent) ; +// for(ievent = 0; ieventEvent(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; iPointCpvRecPoints()->GetEntriesFast(); iPoint++) { - rp = new AliPHOSEvalRecPoint(iPoint,AliPHOSEvalRecPoint::kCpv); - rp->MakeJob(); - } +// for(iPoint=0; iPointCpvRecPoints()->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; iGetEntries(); i++) - cpvRecPoints->Add(wPool->At(i)); +// for(i=0; iGetEntries(); 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; iPointEmcRecPoints()->GetEntriesFast(); iPoint++) { - rp = new AliPHOSEvalRecPoint(iPoint,(Bool_t)AliPHOSEvalRecPoint::kEmc); - rp->MakeJob(); - } +// for(iPoint=0; iPointEmcRecPoints()->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; iGetEntries(); i++) - emcRecPoints->Add(wPool->At(i)); +// for(i=0; iGetEntries(); 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. @@ -195,15 +193,13 @@ 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(); - 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] ) ;