--- /dev/null
+/**************************************************************************
+* 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$
+
+///
+/// Class to get organized with the way we're timing our methods...
+///
+/// Typical usage is based on macros (like for AliLog related ones AliDebug...)
+///
+/// The idea is to instrument the code with a few macro calls, and then,
+/// at the end of the execution, get a printout of *all* the timers, by using
+/// AliCodeTimer::Instance()->Print()
+/// instead of getting scattered outputs all over the place.
+///
+/// To time a given method, use :
+///
+/// void ClassA::MethodA(....)
+/// {
+/// AliCodeTimerAuto("")
+/// }
+///
+/// To get several timers within a same method, use :
+///
+/// void ClassA::MethodB(...)
+/// {
+/// AliCodeTimerStart("doing something")
+/// ....
+/// AliCodeTimerStop("doing something")
+///
+/// AliCodeTimerStart("doing something else")
+/// ....
+/// AliCodeTimerStop("doing something else")
+/// }
+///
+///
+
+#include "AliCodeTimer.h"
+
+#include <TMap.h>
+#include <TObjString.h>
+#include <TStopwatch.h>
+#include <Riostream.h>
+
+/// \cond CLASSIMP
+ClassImp(AliCodeTimer)
+ClassImp(AliCodeTimer::AliPair)
+/// \endcond
+
+AliCodeTimer* AliCodeTimer::fgInstance(0x0);
+
+//_____________________________________________________________________________
+void
+AliCodeTimer::AliPair::Print(Option_t* opt) const
+{
+ // Print timer information
+ cout << opt << Form("%s R:%.4fs C:%.4fs (%d slices)",
+ Name().Data(),Timer()->RealTime(),
+ Timer()->CpuTime(),Timer()->Counter()-1) << endl;
+}
+
+
+//_____________________________________________________________________________
+AliCodeTimer::AliCodeTimer() : TObject(), fTimers(new TMap)
+{
+ /// Ctor
+ fTimers->SetOwner(kTRUE);
+}
+
+//_____________________________________________________________________________
+AliCodeTimer::~AliCodeTimer()
+{
+ /// Dtor
+ Reset();
+ delete fTimers;
+}
+
+//_____________________________________________________________________________
+AliCodeTimer*
+AliCodeTimer::Instance()
+{
+ // single instance of this class
+ if (!fgInstance) fgInstance = new AliCodeTimer;
+ return fgInstance;
+}
+
+//_____________________________________________________________________________
+void AliCodeTimer::Continue(const char* classname, const char* methodname,
+ const char* message)
+{
+ /// Resume a previously stop timer
+ TStopwatch* t = Stopwatch(classname,methodname,message);
+ if (t)
+ {
+ t->Continue();
+ }
+ else
+ {
+ AliError(Form("No timer for %s/%s/%s",classname,methodname,message));
+ }
+}
+
+//_____________________________________________________________________________
+Double_t AliCodeTimer::CpuTime(const char* classname,
+ const char* methodname,
+ const char* message) const
+{
+ /// Return cpu time for a given timer
+ TStopwatch* t = Stopwatch(classname,methodname,message);
+ if (t)
+ {
+ return t->CpuTime();
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+//_____________________________________________________________________________
+TMap*
+AliCodeTimer::MethodMap(const char* classname) const
+{
+ /// Return the map for a given "classname"
+ return static_cast<TMap*>(fTimers->GetValue(classname));
+}
+
+//_____________________________________________________________________________
+TObjArray*
+AliCodeTimer::MessageArray(const char* classname, const char* methodname) const
+{
+ /// Return the array for a given AliPair (classname,methodname)
+ TMap* m = MethodMap(classname);
+ if ( m )
+ {
+ return static_cast<TObjArray*>(m->GetValue(methodname));
+ }
+ return 0;
+}
+
+//_____________________________________________________________________________
+void AliCodeTimer::PrintMethod(const char* classname, const char* methodname) const
+{
+ /// Print all the timers for a given method
+ TObjArray* messages = MessageArray(classname,methodname);
+ messages->Sort();
+
+ cout << " " << methodname << " ";
+
+ if ( messages->GetLast() == 0 )
+ {
+ AliPair* p = static_cast<AliPair*>(messages->First());
+ p->Print();
+ }
+ else
+ {
+ cout << endl;
+
+ TIter next(messages);
+ AliPair* p;
+
+ while ( ( p = static_cast<AliPair*>(next()) ) )
+ {
+ p->Print(" ");
+ }
+ }
+}
+
+//_____________________________________________________________________________
+void AliCodeTimer::PrintClass(const char* classname) const
+{
+ /// Print all the timers for a given class
+ TMap* methods = MethodMap(classname);
+ TIter next(methods);
+ TObjString* methodname;
+ TObjArray methodNameArray;
+
+ while ( ( methodname = static_cast<TObjString*>(next()) ) )
+ {
+ methodNameArray.Add(methodname);
+ }
+
+ cout << classname << endl;
+
+ methodNameArray.Sort();
+
+ TIter mnext(&methodNameArray);
+
+ while ( ( methodname = static_cast<TObjString*>(mnext()) ) )
+ {
+ PrintMethod(classname,methodname->String().Data());
+ }
+}
+
+//_____________________________________________________________________________
+void AliCodeTimer::Print(Option_t* /*opt*/) const
+{
+ /// Print all the timers we hold
+ TIter next(fTimers);
+ TObjString* classname;
+ TObjArray classNameArray;
+
+ while ( ( classname = static_cast<TObjString*>(next()) ) )
+ {
+ classNameArray.Add(classname);
+ }
+
+ classNameArray.Sort();
+
+ TIter cnext(&classNameArray);
+ while ( ( classname = static_cast<TObjString*>(cnext()) ) )
+ {
+ PrintClass(classname->String().Data());
+ }
+}
+
+//_____________________________________________________________________________
+Double_t
+AliCodeTimer::RealTime(const char* classname, const char* methodname,
+ const char* message) const
+{
+ /// Return real time of a given time
+ TStopwatch* t = Stopwatch(classname,methodname,message);
+ if (t)
+ {
+ return t->RealTime();
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+//_____________________________________________________________________________
+void
+AliCodeTimer::Reset()
+{
+ /// Reset
+ TIter next(fTimers);
+ TObjString* classname;
+
+ while ( ( classname = static_cast<TObjString*>(next()) ) )
+ {
+ TMap* m = static_cast<TMap*>(fTimers->GetValue(classname->String().Data()));
+ m->DeleteAll();
+ }
+
+ fTimers->DeleteAll();
+}
+
+//_____________________________________________________________________________
+void
+AliCodeTimer::Start(const char* classname, const char* methodname,
+ const char* message)
+{
+ /// Start a given time
+ TStopwatch* t = Stopwatch(classname,methodname,message);
+ if (!t)
+ {
+ TMap* m = MethodMap(classname);
+ if (!m)
+ {
+ m = new TMap;
+ m->SetOwner(kTRUE);
+ fTimers->Add(new TObjString(classname),m);
+ }
+ TObjArray* messages = MessageArray(classname,methodname);
+ if (!messages)
+ {
+ messages = new TObjArray;
+ messages->SetOwner(kTRUE);
+ m->Add(new TObjString(methodname),messages);
+ }
+ t = new TStopwatch;
+ t->Start(kTRUE);
+ t->Stop();
+ messages->Add(new AliPair(new TObjString(message),t));
+ }
+ t->Start(kFALSE);
+}
+
+//_____________________________________________________________________________
+void
+AliCodeTimer::Stop(const char* classname, const char* methodname,
+ const char* message)
+{
+ /// Stop a given timer
+ TStopwatch* t = Stopwatch(classname,methodname,message);
+ if (!t)
+ {
+ AliError(Form("No timer for %s/%s/%s",classname,methodname,message));
+ }
+ else
+ {
+ t->Stop();
+ }
+}
+
+//_____________________________________________________________________________
+TStopwatch*
+AliCodeTimer::Stopwatch(const char* classname, const char* methodname,
+ const char* message) const
+{
+ /// Return the internal TStopwatch for a given timer
+ TObjArray* a = MessageArray(classname,methodname);
+ if ( a )
+ {
+ if (message)
+ {
+ TIter next(a);
+ AliPair* p;
+ while ( ( p = static_cast<AliPair*>(next()) ) )
+ {
+ TString s = p->Name();
+ if ( s == TString(message) )
+ {
+ return p->Timer();
+ }
+ }
+ }
+ else
+ {
+ return static_cast<TStopwatch*>(a->First());
+ }
+ }
+ return 0x0;
+}
--- /dev/null
+#ifndef ALICODETIMER_H
+#define ALICODETIMER_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice */
+
+// $Id$
+
+///
+/// A class to organize TStopwatch timers used to time our code
+///
+// Author Laurent Aphecetche
+
+#ifndef ROOT_TString
+# include "TString.h"
+#endif
+#ifndef ROOT_TObjString
+# include "TObjString.h"
+#endif
+#ifndef ALILOG_H
+# include "AliLog.h"
+#endif
+
+class TStopwatch;
+class TMap;
+
+class AliCodeTimer : public TObject
+{
+public:
+
+ AliCodeTimer();
+ virtual ~AliCodeTimer();
+
+ /// Unique instance of this class, which is a singleton
+ static AliCodeTimer* Instance();
+
+ /// Continue timer(classname,methodname,message)
+ void Continue(const char* classname, const char* methodname, const char* message="");
+
+ /// Return the cpu time spent in timer(classname,methodname,message)
+ Double_t CpuTime(const char* classname, const char* methodname, const char* message="") const;
+
+ /// Print the list of timers we manage
+ void Print(Option_t* opt="") const;
+
+ /// Return the real time spent in timer(classname,methodname,message)
+ Double_t RealTime(const char* classname, const char* methodname, const char* message="") const;
+
+ /// Reset all our timers
+ void Reset();
+
+ /// Start timer(classname,methodname,message)
+ void Start(const char* classname, const char* methodname, const char* message="");
+
+ /// Stop timer(classname,methodname,message)
+ void Stop(const char* classname, const char* methodname, const char* message="");
+
+public:
+
+ class AliPair : public TObject
+ {
+ public:
+ AliPair() : TObject(),fName(0), fTimer(0) {}
+ // ctor
+ AliPair(TObjString* name, TStopwatch* timer) : TObject(), fName(name), fTimer(timer) {}
+ virtual ~AliPair() { delete fName; }
+
+ /// get name
+ TString Name() const { return fName->String(); }
+ /// get timer
+ TStopwatch* Timer() const { return fTimer; }
+
+ /// we are sortable (by name)
+ virtual Bool_t IsSortable() const { return kTRUE; }
+ /// compare the names
+ virtual Int_t Compare(const TObject* object) const
+ { return fName->Compare(((const AliPair*)(object))->fName); }
+
+ virtual void Print(Option_t* opt="") const;
+
+private:
+ AliPair(const AliPair&);
+ AliPair& operator=(const AliPair&);
+
+ TObjString* fName; // name of the timer
+ TStopwatch* fTimer; // actual timer
+
+ ClassDef(AliPair,1) // internal class to hold (string,TStopwatch*) AliPair
+ };
+
+ class AliAutoPtr
+ {
+ public:
+
+ /// ctor
+ AliAutoPtr(const char* classname, const char* methodname, const char* message="")
+ : fA(classname), fB(methodname), fC(message)
+ { AliCodeTimer::Instance()->Start(classname,methodname,message); }
+
+ /// dtor
+ ~AliAutoPtr() { AliCodeTimer::Instance()->Stop(fA.Data(),fB.Data(),fC.Data()); }
+
+ private:
+ TString fA; // first id
+ TString fB; // second id
+ TString fC; // third id
+ };
+
+private:
+
+ TMap* MethodMap(const char* classname) const;
+ TObjArray* MessageArray(const char* classname, const char* methodname) const;
+ TStopwatch* Stopwatch(const char* classname, const char* methodname, const char* message="") const;
+ void PrintClass(const char* classname) const;
+ void PrintMethod(const char* classname, const char* methodname) const;
+
+private:
+
+ AliCodeTimer(const AliCodeTimer& rhs);
+ AliCodeTimer& operator=(const AliCodeTimer& rhs);
+
+ static AliCodeTimer* fgInstance; //< unique instance
+
+ TMap* fTimers; //< internal timers
+
+ ClassDef(AliCodeTimer,1) // A timer holder
+};
+
+#ifndef LOG_NO_DEBUG
+
+#define AliCodeTimerStartClass(message) AliCodeTimer::Instance()->Start(Class()->GetName(),FUNCTIONNAME(),message);
+#define AliCodeTimerStopClass(message) AliCodeTimer::Instance()->Stop(Class()->GetName(),FUNCTIONNAME(),message);
+#define AliCodeTimerAutoClass(message) AliCodeTimer::AliAutoPtr AliCodeTimerAliAutoPtrVariable(Class()->GetName(),FUNCTIONNAME(),message);
+
+#define AliCodeTimerStart(message) AliCodeTimer::Instance()->Start(ClassName(),FUNCTIONNAME(),message);
+#define AliCodeTimerStop(message) AliCodeTimer::Instance()->Stop(ClassName(),FUNCTIONNAME(),message);
+#define AliCodeTimerAuto(message) AliCodeTimer::AliAutoPtr AliCodeTimerAliAutoPtrVariable(ClassName(),FUNCTIONNAME(),message);
+
+#define AliCodeTimerStartGeneral(message) AliCodeTimer::Instance()->Start("General",FUNCTIONNAME(),message);
+#define AliCodeTimerStopGeneral(message) AliCodeTimer::Instance()->Stop("General",FUNCTIONNAME(),message);
+#define AliCodeTimerAutoGeneral(message) AliCodeTimer::AliAutoPtr AliCodeTimerAliAutoPtrVariable("General",FUNCTIONNAME(),message);
+
+#else
+
+#define AliCodeTimerStartClass(message)
+#define AliCodeTimerStopClass(message)
+#define AliCodeTimerAutoClass(message)
+
+#define AliCodeTimerStart(message)
+#define AliCodeTimerStop(message)
+#define AliCodeTimerAuto(message)
+
+#define AliCodeTimerStartGeneral(message)
+#define AliCodeTimerStopGeneral(message)
+#define AliCodeTimerAutoGeneral(message)
+
+#endif
+
+#endif
#include <TSystem.h>
#include <TROOT.h>
#include <TPluginManager.h>
-#include <TStopwatch.h>
#include <TGeoManager.h>
#include <TLorentzVector.h>
#include "AliReconstruction.h"
+#include "AliCodeTimer.h"
#include "AliReconstructor.h"
#include "AliLog.h"
#include "AliRunLoader.h"
CleanUp();
fOptions.Delete();
fSpecCDBUri.Delete();
+
+ AliCodeTimer::Instance()->Print();
}
//_____________________________________________________________________________
{
// run the reconstruction
+ AliCodeTimerAuto("")
+
// set the input
if (!input) input = fInput.Data();
TString fileName(input);
}
}
-
- TStopwatch stopwatch;
- stopwatch.Start();
-
// get the possibly already existing ESD file and tree
AliESD* esd = new AliESD(); AliESD* hltesd = new AliESD();
TFile* fileOld = NULL;
}
- AliInfo(Form("Execution time for filling ESD : R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
file->cd();
if (fWriteESDfriend)
tree->SetBranchStatus("ESDfriend*",0);
{
// run the local reconstruction
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
AliCDBManager* man = AliCDBManager::Instance();
Bool_t origCache = man->GetCacheFlag();
if (!reconstructor) continue;
if (reconstructor->HasLocalReconstruction()) continue;
+ AliCodeTimerStart(Form("running reconstruction for %s", fgkDetectorName[iDet]));
AliInfo(Form("running reconstruction for %s", fgkDetectorName[iDet]));
- TStopwatch stopwatchDet;
- stopwatchDet.Start();
-
+
+ AliCodeTimerStart(Form("Loading calibration data from OCDB for %s", fgkDetectorName[iDet]));
AliInfo(Form("Loading calibration data from OCDB for %s", fgkDetectorName[iDet]));
man->SetCacheFlag(kTRUE);
TString calibPath = Form("%s/Calib/*", fgkDetectorName[iDet]);
man->GetAll(calibPath); // entries are cached!
+ AliCodeTimerStop(Form("Loading calibration data from OCDB for %s", fgkDetectorName[iDet]));
+
if (fRawReader) {
fRawReader->RewindEvents();
reconstructor->Reconstruct(fRunLoader, fRawReader);
} else {
reconstructor->Reconstruct(fRunLoader);
}
- AliInfo(Form("Execution time for %s: R:%.2fs C:%.2fs",
- fgkDetectorName[iDet],
- stopwatchDet.RealTime(),stopwatchDet.CpuTime()));
+
+ AliCodeTimerStop(Form("running reconstruction for %s", fgkDetectorName[iDet]));
// unload calibration data
man->UnloadFromCache(calibPath);
if (fStopOnError) return kFALSE;
}
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// run the local reconstruction
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
TString detStr = detectors;
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (fRawReader && reconstructor->HasDigitConversion()) {
AliInfo(Form("converting raw data digits into root objects for %s",
fgkDetectorName[iDet]));
- TStopwatch stopwatchDet;
- stopwatchDet.Start();
+ AliCodeTimerAuto(Form("converting raw data digits into root objects for %s",
+ fgkDetectorName[iDet]));
loader->LoadDigits("update");
loader->CleanDigits();
loader->MakeDigitsContainer();
reconstructor->ConvertDigits(fRawReader, digitsTree);
loader->WriteDigits("OVERWRITE");
loader->UnloadDigits();
- AliInfo(Form("Execution time for %s: R:%.2fs C:%.2fs",
- fgkDetectorName[iDet],
- stopwatchDet.RealTime(),stopwatchDet.CpuTime()));
}
// local reconstruction
if (!reconstructor->HasLocalReconstruction()) continue;
AliInfo(Form("running reconstruction for %s", fgkDetectorName[iDet]));
- TStopwatch stopwatchDet;
- stopwatchDet.Start();
+ AliCodeTimerAuto(Form("running reconstruction for %s", fgkDetectorName[iDet]));
loader->LoadRecPoints("update");
loader->CleanRecPoints();
loader->MakeRecPointsContainer();
}
loader->WriteRecPoints("OVERWRITE");
loader->UnloadRecPoints();
- AliInfo(Form("Execution time for %s: R:%.2fs C:%.2fs",
- fgkDetectorName[iDet],
- stopwatchDet.RealTime(),stopwatchDet.CpuTime()));
}
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
if (fStopOnError) return kFALSE;
}
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// run the barrel tracking
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
AliESDVertex* vertex = NULL;
Double_t vtxPos[3] = {0, 0, 0};
}
delete vertex;
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// run the HLT barrel tracking
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
if (!fRunLoader) {
AliError("Missing runLoader!");
delete tracker;
}
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// run the muon spectrometer tracking
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
if (!fRunLoader) {
AliError("Missing runLoader!");
delete tracker;
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// run the barrel tracking
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
AliInfo("running tracking");
track->RelateToVertex(esd->GetVertex(),fieldZ, kMaxD);
}
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// fill the event summary data
- TStopwatch stopwatch;
- stopwatch.Start();
- AliInfo("filling ESD");
+ AliCodeTimerAuto("")
TString detStr = detectors;
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (fStopOnError) return kFALSE;
}
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
// stored in Trigger.root file and fills
// the corresponding esd entries
+ AliCodeTimerAuto("")
+
AliInfo("Filling trigger information into the ESD");
if (fRawReader) {
#include <TVirtualMCApplication.h>
#include <TGeoManager.h>
#include <TObjString.h>
-#include <TStopwatch.h>
#include <TSystem.h>
#include <TFile.h>
+#include "AliCodeTimer.h"
#include "AliCDBStorage.h"
#include "AliCDBEntry.h"
#include "AliCDBManager.h"
fSpecCDBUri.Delete();
if (fgInstance==this) fgInstance = 0;
+
+ AliCodeTimer::Instance()->Print();
}
{
// run the generation, simulation and digitization
+ AliCodeTimerAuto("")
+
InitCDBStorage();
if (nEvents > 0) fNEvents = nEvents;
{
// run the trigger
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
AliRunLoader* runLoader = LoadRun("READ");
if (!runLoader) return kFALSE;
}
}
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
delete runLoader;
return kTRUE;
{
// run the generation and simulation
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
if (!gAlice) {
AliError("no gAlice object. Restart aliroot and try again.");
delete runLoader;
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
return kTRUE;
}
{
// run the digitization and produce summable digits
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
AliRunLoader* runLoader = LoadRun();
if (!runLoader) return kFALSE;
if (!det || !det->IsActive()) continue;
if (IsSelected(det->GetName(), detStr)) {
AliInfo(Form("creating summable digits for %s", det->GetName()));
- TStopwatch stopwatchDet;
- stopwatchDet.Start();
+ AliCodeTimerAuto(Form("creating summable digits for %s", det->GetName()));
det->Hits2SDigits();
- AliInfo(Form("Execution time for %s: R:%.2fs C:%.2fs",
- det->GetName(),stopwatchDet.RealTime(),stopwatchDet.CpuTime()));
}
}
delete runLoader;
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// run the digitization and produce digits from sdigits
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
while (AliRunLoader::GetRunLoader()) delete AliRunLoader::GetRunLoader();
if (gAlice) delete gAlice;
delete manager;
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// run the digitization and produce digits from hits
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
AliRunLoader* runLoader = LoadRun("READ");
if (!runLoader) return kFALSE;
//PH Temporary fix to avoid interference with the PHOS loder/getter
//PH The problem has to be solved in more general way 09/06/05
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
// to a root file.
// If deleteIntermediateFiles is true, the DATE file is deleted afterwards.
- TStopwatch stopwatch;
- stopwatch.Start();
+ AliCodeTimerAuto("")
if (!WriteRawFiles(detectors)) {
if (fStopOnError) return kFALSE;
}
}
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
-
return kTRUE;
}
{
// convert the digits to raw data DDL files
+ AliCodeTimerAuto("")
+
AliRunLoader* runLoader = LoadRun("READ");
if (!runLoader) return kFALSE;
}
delete runLoader;
+
return kTRUE;
}
{
// convert raw data DDL files to a DATE file with the program "dateStream"
+ AliCodeTimerAuto("")
+
char* path = gSystem->Which(gSystem->Getenv("PATH"), "dateStream");
if (!path) {
AliError("the program dateStream was not found");
#pragma link C++ class AliSurveyObj+;
#pragma link C++ class AliSurveyPoint+;
+#pragma link C++ class AliCodeTimer+;
+#pragma link C++ class AliCodeTimer::AliPair+;
+
#endif
AliSelectorRL.cxx AliSplineFit.cxx \
AliMagFMapsV1.cxx \
AliDCSValue.cxx AliDCSSensor.cxx AliDCSSensorArray.cxx \
-AliSurveyObj.cxx AliSurveyPoint.cxx
+AliSurveyObj.cxx AliSurveyPoint.cxx \
+AliCodeTimer.cxx
+
HDRS:= $(SRCS:.cxx=.h)