#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();
}
// then applied to the TGeo geometry.
// Finally an overlaps check is performed.
- if (!gGeoManager || !gGeoManager->IsClosed()) {
- AliError("Can't apply the misalignment! gGeoManager doesn't exist or it is still opened!");
+ if (!AliGeomManager::GetGeometry() || !AliGeomManager::GetGeometry()->IsClosed()) {
+ AliError("Can't apply the misalignment! Geometry is not loaded or it is still opened!");
return kFALSE;
}
Bool_t delRunLoader = kFALSE;
}
// Export ideal geometry
- gGeoManager->Export("geometry.root");
+ AliGeomManager::GetGeometry()->Export("geometry.root");
// Load alignment data from CDB and apply to geometry through AliGeomManager
if(fLoadAlignFromCDB){
loadAlObjsListOfDets += " ";
}
} // end loop over detectors
- (AliGeomManager::Instance())->ApplyAlignObjsFromCDB(loadAlObjsListOfDets.Data());
+ AliGeomManager::ApplyAlignObjsFromCDB(loadAlObjsListOfDets.Data());
}else{
// Check if the array with alignment objects was
// provided by the user. If yes, apply the objects
// to the present TGeo geometry
if (fAlignObjArray) {
- if ((AliGeomManager::Instance())->ApplyAlignObjsToGeom(fAlignObjArray) == kFALSE) {
+ if (AliGeomManager::ApplyAlignObjsToGeom(*fAlignObjArray) == kFALSE) {
AliError("The misalignment of one or more volumes failed!"
"Compare the list of simulated detectors and the list of detector alignment data!");
if (delRunLoader) delete runLoader;
if (delRunLoader) delete runLoader;
- // Update the TGeoPhysicalNodes
- gGeoManager->RefreshPhysicalNodes();
-
return kTRUE;
}
{
// run the generation, simulation and digitization
+ AliCodeTimerAuto("")
+
InitCDBStorage();
if (nEvents > 0) fNEvents = nEvents;
if (!SetRunNumber()) if (fStopOnError) return kFALSE;
// If RunSimulation was not called, load the geometry and misalign it
- if (!gGeoManager) {
- TGeoManager::Import("geometry.root");
- if (!gGeoManager) if (fStopOnError) return kFALSE;
- // Initialize the geometry manager (if not already done)
+ if (!AliGeomManager::GetGeometry()) {
+ // Initialize the geometry manager
+ AliGeomManager::LoadGeometry("geometry.root");
+ if (!AliGeomManager::GetGeometry()) if (fStopOnError) return kFALSE;
+ // Misalign geometry
if(!MisalignGeometry()) if (fStopOnError) return kFALSE;
}
{
// 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.");
gAlice->SetTriggerDescriptor(fMakeTrigger.Data());
// Set run number in CDBManager
- AliCDBManager::Instance()->SetRun(gAlice->GetRunNumber());
AliInfo(Form("Run number: %d",AliCDBManager::Instance()->GetRun()));
AliRunLoader* runLoader = gAlice->GetRunLoader();
// Misalign geometry
#if ROOT_VERSION_CODE < 331527
+ AliGeomManager::SetGeometry(gGeoManager);
MisalignGeometry(runLoader);
#endif
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");