#include <TH2.h>
#include <TMinuit.h>
#include <TCanvas.h>
-#include <TStopwatch.h>
#include <TMath.h>
#include <TROOT.h>
-//#include "AliCodeTimer.h"
+#include "AliCodeTimer.h"
/// \cond CLASSIMP
ClassImp(AliMUONClusterFinderMLEM)
fPixArray(new TObjArray(20)),
fDebug(0),
fPlot(plot),
-fTimers(new TObjArray(kLast)),
fSplitter(0x0),
fNClusters(0),
fNAddVirtualPads(0)
if (!fgMinuit) fgMinuit = new TMinuit(8);
- fTimers->SetOwner(kTRUE);
-
- for ( Int_t i = 0; i < kLast; ++i )
- {
- TStopwatch* t = new TStopwatch;
- fTimers->AddLast(new TStopwatch);
- t->Start(kTRUE);
- t->Stop();
- }
if (fPlot) fDebug = 1;
}
delete fgMinuit; fgMinuit = 0; delete fPixArray; fPixArray = 0;
// delete fDraw;
delete fPreClusterFinder;
- for ( Int_t i = 0; i < kLast; ++i )
- {
- AliInfo(Form("Timer %d",i));
- Timer(i)->Print();
- }
- delete fTimers;
delete fSplitter;
AliInfo(Form("Total clusters %d AddVirtualPad needed %d",
fNClusters,fNAddVirtualPads));
AliMUONClusterFinderMLEM::NextCluster()
{
/// Return next cluster
-// AliCodeTimerAuto("clustering + pre-clustering")
+// AliCodeTimerAuto("")
// if the list of clusters is not void, pick one from there
TObject* o = fClusterList.At(++fClusterNumber);
/// Starting from a precluster, builds a pixel array, and then
/// extract clusters from this array
+// AliCodeTimerAuto("")
+
// Set saturation flag - it is not set if working directly with MC digits (w/out
// creating raw data) !!!
for (Int_t j = 0; j < fPreCluster->Multiplicity(); ++j) {
{
FindCluster(*cluster,localMax, maxPos[i]);
}
- Timer(kMainLoop)->Start(kFALSE);
MainLoop(*cluster,iSimple);
- Timer(kMainLoop)->Stop();
if (i < nMax-1)
{
for (Int_t j=0; j<cluster->Multiplicity(); ++j)
{
/// Check precluster in order to attempt to simplify it (mostly for
/// two-cathode preclusters)
-
+
+// AliCodeTimerAuto("")
+
if (origCluster.Multiplicity()==1)
{
// Disregard one-pad clusters (leftovers from splitting)
return 0x0;
}
- Timer(kCheckPreCluster)->Start(kFALSE);
-
-
AliMUONCluster* cluster = static_cast<AliMUONCluster*>(origCluster.Clone());
AliDebug(2,"Start of CheckPreCluster=");
}
else
{
- rv = CheckPreclusterOneCathode(cluster);
+ rv = cluster;
}
- Timer(kCheckPreCluster)->Stop();
return rv;
}
-//_____________________________________________________________________________
-AliMUONCluster*
-AliMUONClusterFinderMLEM::CheckPreclusterOneCathode(AliMUONCluster* cluster)
-{
- /// Check single-cathode precluster
- AliWarning("Reimplement me!");
- AliDebug(2,"End of CheckPreClusterOneCathode=");
-// StdoutToAliDebug(2,cluster->Print("full"));
-
- return cluster;
-}
-
//_____________________________________________________________________________
AliMUONCluster*
AliMUONClusterFinderMLEM::CheckPreclusterTwoCathodes(AliMUONCluster* cluster)
{
/// Repeat MLEM algorithm until pixel size becomes sufficiently small
+// AliCodeTimerAuto("")
+
Int_t nPix = fPixArray->GetLast()+1;
AliDebug(2,Form("nPix=%d iSimple=%d, precluster=",nPix,iSimple));
return imin;
}
-
-//_____________________________________________________________________________
-TStopwatch*
-AliMUONClusterFinderMLEM::Timer(Int_t i) const
-{
- /// Return timer at index i
- return static_cast<TStopwatch*>(fTimers->At(i));
-}
-
//_____________________________________________________________________________
void
AliMUONClusterFinderMLEM::Paint(Option_t*)
class TH2D;
class TClonesArray;
class TMinuit;
-class TStopwatch;
#ifndef ROOT_TObjArray
# include "TObjArray.h"
/// Check precluster to simplify it (if possible), and return the simplified cluster
AliMUONCluster* CheckPrecluster(const AliMUONCluster& cluster);
AliMUONCluster* CheckPreclusterTwoCathodes(AliMUONCluster* cluster);
- AliMUONCluster* CheckPreclusterOneCathode(AliMUONCluster* cluster);
/// Checks whether a pad and a pixel have an overlapping area.
Bool_t Overlap(const AliMUONPad& pad, const AliMUONPad& pixel);
void CheckOverlaps();
- TStopwatch* Timer(Int_t i) const;
-
private:
// Some constants
Int_t fDebug; //!< debug level
Bool_t fPlot; //!< whether we should plot thing (for debug only, quite slow!)
- TObjArray* fTimers; //!< internal timers
-
- /// \todo add comment
- enum ETimer { kMainLoop, kCheckPreCluster, kLast };
-
AliMUONClusterSplitterMLEM* fSplitter; //!< helper class to go from pixel arrays to clusters
Int_t fNClusters; //!< total number of clusters
Int_t fNAddVirtualPads; //!< number of clusters for which we added virtual pads