// //
///////////////////////////////////////////////////////////////////////////////
+#include <TGeoManager.h>
#include <TObjString.h>
#include <TStopwatch.h>
#include <TSystem.h>
+#include <TFile.h>
-#include "AliLog.h"
+#include "AliCDBStorage.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "AliAlignObj.h"
+#include "AliCentralTrigger.h"
+#include "AliDAQConfig.h"
#include "AliDigitizer.h"
#include "AliGenerator.h"
+#include "AliLog.h"
#include "AliModule.h"
#include "AliRun.h"
#include "AliRunDigitizer.h"
#include "AliSimulation.h"
#include "AliVertexGenFile.h"
#include "AliCentralTrigger.h"
-
-#include "AliDAQConfig.h"
-#include "AliAlignObj.h"
-#include "AliAlignObjAngles.h"
-#include "AliAlignObjMatrix.h"
+#include "AliCTPRawData.h"
ClassImp(AliSimulation)
//_____________________________________________________________________________
-AliSimulation::AliSimulation(const char* configFileName,
+AliSimulation::AliSimulation(const char* configFileName, const char* cdbUri,
const char* name, const char* title) :
TNamed(name, title),
fRunGeneration(kTRUE),
fRunSimulation(kTRUE),
+ fLoadAlignFromCDB(kTRUE),
+ fLoadAlignData("ALL"),
fMakeSDigits("ALL"),
fMakeDigits("ALL"),
fMakeTrigger(""),
fGAliceFileName("galice.root"),
fEventsPerFile(),
fBkgrdFileNames(NULL),
+ fAlignObjArray(NULL),
fUseBkgrdVertex(kTRUE),
- fRegionOfInterest(kFALSE)
+ fRegionOfInterest(kFALSE),
+ fCDBUri(cdbUri)
{
// create simulation object with default parameters
fRunGeneration(sim.fRunGeneration),
fRunSimulation(sim.fRunSimulation),
+ fLoadAlignFromCDB(sim.fLoadAlignFromCDB),
+ fLoadAlignData(sim.fLoadAlignData),
fMakeSDigits(sim.fMakeSDigits),
fMakeDigits(sim.fMakeDigits),
fMakeTrigger(sim.fMakeTrigger),
fGAliceFileName(sim.fGAliceFileName),
fEventsPerFile(),
fBkgrdFileNames(NULL),
+ fAlignObjArray(NULL),
fUseBkgrdVertex(sim.fUseBkgrdVertex),
- fRegionOfInterest(sim.fRegionOfInterest)
+ fRegionOfInterest(sim.fRegionOfInterest),
+ fCDBUri(sim.fCDBUri)
{
// copy constructor
// clean up
fEventsPerFile.Delete();
+// if(fAlignObjArray) fAlignObjArray->Delete(); // fAlignObjArray->RemoveAll() ???
+// delete fAlignObjArray; fAlignObjArray=0;
if (fBkgrdFileNames) {
fBkgrdFileNames->Delete();
fNEvents = nEvents;
}
+//_____________________________________________________________________________
+void AliSimulation::InitCDBStorage(const char* uri)
+{
+// activate a default CDB storage
+// First check if we have any CDB storage set, because it is used
+// to retrieve the calibration and alignment constants
+
+ AliCDBManager* man = AliCDBManager::Instance();
+ if (!man->IsDefaultStorageSet())
+ {
+ AliWarningClass("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+ AliWarningClass("Default CDB storage not yet set");
+ AliWarningClass(Form("Using default storage declared in AliSimulation: %s",uri));
+ AliWarningClass("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+ SetDefaultStorage(uri);
+ }
+
+}
+
+//_____________________________________________________________________________
+void AliSimulation::SetDefaultStorage(const char* uri) {
+// activate a default CDB storage
+
+ AliCDBManager::Instance()->SetDefaultStorage(uri);
+
+}
+
+//_____________________________________________________________________________
+void AliSimulation::SetSpecificStorage(const char* detName, const char* uri) {
+// activate a detector-specific CDB storage
+
+ AliCDBManager::Instance()->SetSpecificStorage(detName, uri);
+
+}
+
//_____________________________________________________________________________
void AliSimulation::SetConfigFile(const char* fileName)
{
}
//_____________________________________________________________________________
-Bool_t AliSimulation::ApplyDisplacements(const char* fileName, const char* ClArrayName)
+Bool_t AliSimulation::ApplyAlignObjsToGeom(TObjArray* alObjArray)
+{
+ // Read collection of alignment objects (AliAlignObj derived) saved
+ // in the TClonesArray ClArrayName and apply them to the geometry
+ // manager singleton.
+ //
+ alObjArray->Sort();
+ Int_t nvols = alObjArray->GetEntriesFast();
+
+ Bool_t flag = kTRUE;
+
+ for(Int_t j=0; j<nvols; j++)
+ {
+ AliAlignObj* alobj = (AliAlignObj*) alObjArray->UncheckedAt(j);
+ if (alobj->ApplyToGeometry() == kFALSE) flag = kFALSE;
+ }
+
+ if (AliDebugLevelClass() >= 1) {
+ gGeoManager->CheckOverlaps(20);
+ TObjArray* ovexlist = gGeoManager->GetListOfOverlaps();
+ if(ovexlist->GetEntriesFast()){
+ AliError("The application of alignment objects to the geometry caused huge overlaps/extrusions!");
+ }
+ }
+
+ return flag;
+
+}
+
+//_____________________________________________________________________________
+Bool_t AliSimulation::ApplyAlignObjsToGeom(const char* fileName, const char* clArrayName)
{
// read collection of alignment objects (AliAlignObj derived) saved
// in the TClonesArray ClArrayName in the file fileName and apply
return kFALSE;
}
- TClonesArray* AlObjArray = ((TClonesArray*) inFile->Get(ClArrayName));
+ TClonesArray* alObjArray = ((TClonesArray*) inFile->Get(clArrayName));
inFile->Close();
+ if (!alObjArray) {
+ AliErrorClass(Form("Could not get array (%s) from file (%s) !",clArrayName,fileName));
+ return kFALSE;
+ }
- return AliSimulation::ApplyDisplacements(AlObjArray);
+ return ApplyAlignObjsToGeom(alObjArray);
}
//_____________________________________________________________________________
-Bool_t AliSimulation::ApplyDisplacements(TClonesArray* AlObjArray)
+Bool_t AliSimulation::ApplyAlignObjsToGeom(AliCDBParam* param, AliCDBId& Id)
{
- // Read collection of alignment objects (AliAlignObj derived) saved
- // in the TClonesArray ClArrayName and apply them to the geometry
- // manager singleton.
+ // read collection of alignment objects (AliAlignObj derived) saved
+ // in the TClonesArray ClArrayName in the AliCDBEntry identified by
+ // param (to get the AliCDBStorage) and Id; apply the alignment objects
+ // to the TGeo geometry passed as argument
//
- Int_t nvols = AlObjArray->GetEntriesFast();
-
- AliAlignObj::ELayerID layerId; // unique identity for volume in the alobj
- Int_t modId; // unique identity for volume in the alobj
- Bool_t ispathvalid; // false if volume path for alobj is not valid for TGeo
- TGeoHMatrix dm;
-
- for(Int_t j=0; j<nvols; j++)
- {
- AliAlignObj* alobj = (AliAlignObj*) AlObjArray->UncheckedAt(j);
- const char* volpath = alobj->GetVolPath();
- TGeoPhysicalNode* node = (TGeoPhysicalNode*) gGeoManager->MakePhysicalNode(volpath);
- alobj->GetMatrix(dm);
- alobj->GetVolUID(layerId, modId);
- ispathvalid = gGeoManager->cd(volpath);
- if(!ispathvalid){
- AliWarningClass(Form("Volume path %s not valid!",volpath));
- return kFALSE;
- }
- TGeoHMatrix* hm = gGeoManager->GetCurrentMatrix();
- hm->MultiplyLeft(&dm);
- AliInfoClass(Form("Aligning volume %s of detector layer %d with local ID %d",volpath,layerId,modId));
- node->Align(hm);
- }
+ AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage(param);
+ AliCDBEntry* entry = storage->Get(Id);
+ TClonesArray* AlObjArray = ((TClonesArray*) entry->GetObject());
- return kTRUE;
+ return ApplyAlignObjsToGeom(AlObjArray);
}
//_____________________________________________________________________________
-Bool_t AliSimulation::ApplyDisplacements(AliCDBParam* param, AliCDBId& Id)
+Bool_t AliSimulation::ApplyAlignObjsToGeom(const char* uri, const char* path, Int_t runnum, Int_t version, Int_t sversion)
{
// read collection of alignment objects (AliAlignObj derived) saved
// in the TClonesArray ClArrayName in the AliCDBEntry identified by
// to the TGeo geometry passed as argument
//
- AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage(param);
- AliCDBEntry* entry = storage->Get(Id);
- TClonesArray* AlObjArray = ((TClonesArray*) entry->GetObject());
+ AliCDBParam* param = AliCDBManager::Instance()->CreateParameter(uri);
+ AliCDBId id(path, runnum, runnum, version, sversion);
- return AliSimulation::ApplyDisplacements(AlObjArray);
+ return ApplyAlignObjsToGeom(param, id);
}
//_____________________________________________________________________________
-Bool_t AliSimulation::ApplyDisplacements(const char* uri, const char* path, Int_t runnum, Int_t version, Int_t sversion)
+Bool_t AliSimulation::ApplyAlignObjsToGeom(const char* detName, Int_t runnum, Int_t version, Int_t sversion)
{
// read collection of alignment objects (AliAlignObj derived) saved
// in the TClonesArray ClArrayName in the AliCDBEntry identified by
// to the TGeo geometry passed as argument
//
- AliCDBParam* param = AliCDBManager::Instance()->CreateParameter(uri);
- AliCDBId id(path, runnum, runnum, version, sversion);
+ InitCDBStorage("local://$ALICE_ROOT");
+ AliCDBPath path(detName,"Align","Data");
+ AliCDBEntry* entry = AliCDBManager::Instance()->Get(path.GetPath(),runnum,version,sversion);
+
+ if(!entry) return kFALSE;
+ TClonesArray* AlObjArray = ((TClonesArray*) entry->GetObject());
+
+ return ApplyAlignObjsToGeom(AlObjArray);
+}
+
+//_____________________________________________________________________________
+Bool_t AliSimulation::SetAlignObjArraySingleDet(const char* detName)
+{
+ // Fills array of single detector's alignable objects from CDB
+
+ AliDebug(2, Form("Loading alignment data for detector: %s",detName));
+
+ AliCDBEntry *entry;
+
+ AliCDBPath path(detName,"Align","Data");
+
+ entry=AliCDBManager::Instance()->Get(path.GetPath());
+ if(!entry){
+ AliDebug(2,Form("Couldn't load alignment data for detector %s",detName));
+ return kFALSE;
+ }
+ entry->SetOwner(1);
+ TClonesArray *alignArray = (TClonesArray*) entry->GetObject();
+ alignArray->SetOwner(0);
+ AliDebug(2,Form("Found %d alignment objects for %s",
+ alignArray->GetEntries(),detName));
+
+ AliAlignObj *alignObj=0;
+ TIter iter(alignArray);
+
+ // loop over align objects in detector
+ while( ( alignObj=(AliAlignObj *) iter.Next() ) ){
+ fAlignObjArray->Add(alignObj);
+ }
+ // delete entry --- Don't delete, it is cached!
+
+ AliDebug(2, Form("fAlignObjArray entries: %d",fAlignObjArray->GetEntries() ));
+ return kTRUE;
+
+}
+
+//_____________________________________________________________________________
+Bool_t AliSimulation::MisalignGeometry(AliRunLoader *runLoader)
+{
+ // Read the alignment objects from CDB.
+ // Each detector is supposed to have the
+ // alignment objects in DET/Align/Data CDB path.
+ // All the detector objects are then collected,
+ // sorted by geometry level (starting from ALIC) and
+ // then applied to the TGeo geometry.
+ // Finally an overlaps check is performed.
+
+ Bool_t delRunLoader = kFALSE;
+ if (!runLoader) {
+ runLoader = LoadRun("READ");
+ if (!runLoader) return kFALSE;
+ delRunLoader = kTRUE;
+ }
+
+ // Load alignment data from CDB and fill fAlignObjArray
+ if(fLoadAlignFromCDB){
+ if(!fAlignObjArray) fAlignObjArray = new TObjArray();
+
+ //fAlignObjArray->RemoveAll();
+ fAlignObjArray->Clear();
+ fAlignObjArray->SetOwner(0);
+
+ TString detStr = fLoadAlignData;
+ TString dataNotLoaded="";
+ TString dataLoaded="";
+
+ TObjArray* detArray = runLoader->GetAliRun()->Detectors();
+ for (Int_t iDet = 0; iDet < detArray->GetEntriesFast(); iDet++) {
+ AliModule* det = (AliModule*) detArray->At(iDet);
+ if (!det || !det->IsActive()) continue;
+ if (IsSelected(det->GetName(), detStr)) {
+ if(!SetAlignObjArraySingleDet(det->GetName())){
+ dataNotLoaded += det->GetName();
+ dataNotLoaded += " ";
+ } else {
+ dataLoaded += det->GetName();
+ dataLoaded += " ";
+ }
+ }
+ } // end loop over detectors
+
+ if ((detStr.CompareTo("ALL") == 0)) detStr = "";
+ dataNotLoaded += detStr;
+ AliInfo(Form("Alignment data loaded for: %s",
+ dataLoaded.Data()));
+ AliInfo(Form("Didn't/couldn't load alignment data for: %s",
+ dataNotLoaded.Data()));
+ } // fLoadAlignFromCDB flag
+
+ // 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 (gGeoManager && gGeoManager->IsClosed()) {
+ if (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;
+ return kFALSE;
+ }
+ }
+ else {
+ AliError("Can't apply the misalignment! gGeoManager doesn't exist or it is still opened!");
+ if (delRunLoader) delete runLoader;
+ return kFALSE;
+ }
+ }
+
+ if (delRunLoader) delete runLoader;
+
+ return kTRUE;
+}
- return ApplyDisplacements(param, id);
+//_____________________________________________________________________________
+Bool_t AliSimulation::SetRunNumber()
+{
+ // Set the CDB manager run number
+ // The run number is retrieved from gAlice
+
+ if(AliCDBManager::Instance()->GetRun() < 0) {
+ AliRunLoader* runLoader = LoadRun("READ");
+ if (!runLoader) return kFALSE;
+ else {
+ AliCDBManager::Instance()->SetRun(runLoader->GetAliRun()->GetRunNumber());
+ AliInfo(Form("Run number: %d",AliCDBManager::Instance()->GetRun()));
+ delete runLoader;
+ }
+ }
+ return kTRUE;
}
//_____________________________________________________________________________
{
// run the generation, simulation and digitization
+ InitCDBStorage(fCDBUri);
+
if (nEvents > 0) fNEvents = nEvents;
// generation and simulation -> hits
if (!RunSimulation()) if (fStopOnError) return kFALSE;
}
+ // Set run number in CDBManager (if it is not already set in RunSimulation)
+ if (!SetRunNumber()) if (fStopOnError) return kFALSE;
+
+ // Load and misalign the geometry
+ if (!gGeoManager) {
+ TGeoManager::Import("geometry.root");
+ if (!gGeoManager) if (fStopOnError) return kFALSE;
+ if (!MisalignGeometry()) if (fStopOnError) return kFALSE;
+ }
+
// hits -> summable digits
if (!fMakeSDigits.IsNull()) {
if (!RunSDigitization(fMakeSDigits)) if (fStopOnError) return kFALSE;
}
// digits -> trigger
- if (!fMakeTrigger.IsNull()) {
- if (!RunTrigger(fMakeTrigger)) {
- if (fStopOnError) return kFALSE;
- }
+ if (!RunTrigger(fMakeTrigger)) {
+ if (fStopOnError) return kFALSE;
}
// digits -> raw data
{
// run the trigger
- TStopwatch stopwatch;
- stopwatch.Start();
-
- AliRunLoader* runLoader = LoadRun("READ");
- if (!runLoader) return kFALSE;
- TString des = descriptors;
+ TStopwatch stopwatch;
+ stopwatch.Start();
+
+ AliRunLoader* runLoader = LoadRun("READ");
+ if (!runLoader) return kFALSE;
+ TString des = descriptors;
+
+ if (des.IsNull()) {
+ if (gAlice->GetTriggerDescriptor() != "") {
+ des = gAlice->GetTriggerDescriptor();
+ }
+ else {
+ AliWarning("No trigger descriptor is specified. Skipping the trigger simulation...");
+ return kTRUE;
+ }
+ }
+
+ runLoader->MakeTree( "CT" );
+ AliCentralTrigger* aCTP = runLoader->GetTrigger();
// Load Descriptors
- AliCentralTrigger* aCTP = new AliCentralTrigger( des );
+ aCTP->LoadDescriptor( des );
// digits -> trigger
- if( !aCTP->RunTrigger( runLoader ) ) {
- if (fStopOnError) {
- delete aCTP;
- return kFALSE;
- }
- }
-
-/*
- // Process each event
- for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) {
- AliInfo(Form("processing event %d", iEvent));
- runLoader->GetEvent(iEvent);
-
- TObjArray* detArray = runLoader->GetAliRun()->Detectors();
- for (Int_t iDet = 0; iDet < detArray->GetEntriesFast(); iDet++) {
- AliModule* det = (AliModule*) detArray->At(iDet);
- if (!det || !det->IsActive()) continue;
- if (IsSelected(det->GetName(), detStr)) {
- AliInfo(Form("triggering from digits for %s", det->GetName()));
-
- // AliLoader* loader = fLoader[iDet];
- // loader->LoadDigits("read");
- // TTree* digitsTree = loader->TreeD();
- // det->Trigger( digitsTree );
- // or
- AliTriggerDetector* tdet = det->CreateTriggerDetector();
- TObjArray* detInp = dtrg->GetTriggerInputs();
- for( Int_t i=0; i<detInp->GetEntriesFast(); i++ )
- fInputs.AddLast( detInp->At(i) );
-
- AliInfo(Form("Execution time for %s: R:%.2fs C:%.2fs",
- det->GetName(),stopwatchDet.RealTime(),stopwatchDet.CpuTime()));
- }
- }
-
- if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
- AliError(Form("the following detectors were not found: %s",
- detStr.Data()));
+ if( !aCTP->RunTrigger( runLoader ) ) {
if (fStopOnError) {
- delete centralTP;
+ // delete aCTP;
return kFALSE;
}
- }
-
- // Check trigger conditions
- centralTP->TriggerConditions();
+ }
- // Write trigger ????
- centralTP->Write();
+ AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
+ stopwatch.RealTime(),stopwatch.CpuTime()));
- } */
+ delete runLoader;
- AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
- stopwatch.RealTime(),stopwatch.CpuTime()));
+ return kTRUE;
+}
- delete aCTP;
- delete runLoader;
+//_____________________________________________________________________________
+Bool_t AliSimulation::WriteTriggerRawData()
+{
+ // Writes the CTP (trigger) DDL raw data
+ // Details of the format are given in the
+ // trigger TDR - pages 134 and 135.
+ AliCTPRawData writer;
+ writer.RawData();
return kTRUE;
}
-
-
//_____________________________________________________________________________
Bool_t AliSimulation::RunSimulation(Int_t nEvents)
{
StdoutToAliInfo(StderrToAliError(
gAlice->Init(fConfigFileName.Data());
););
+
+ // Get the trigger descriptor string
+ // Either from AliSimulation or from
+ // gAlice
+ if (fMakeTrigger.IsNull()) {
+ if (gAlice->GetTriggerDescriptor() != "")
+ fMakeTrigger = gAlice->GetTriggerDescriptor();
+ }
+ else
+ 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();
if (!runLoader) {
- AliError(Form("gAlice has no run loader object. "
- "Check your config file: %s", fConfigFileName.Data()));
- return kFALSE;
+ AliError(Form("gAlice has no run loader object. "
+ "Check your config file: %s", fConfigFileName.Data()));
+ return kFALSE;
}
SetGAliceFile(runLoader->GetFileName());
+
+ // Export ideal geometry
+ if (gGeoManager) gGeoManager->Export("geometry.root");
+
+ // Misalign geometry
+// if (!MisalignGeometry(runLoader)) {
+// delete runLoader;
+// return kFALSE;
+// }
+ MisalignGeometry(runLoader);
+
+ // Temporary fix by A.Gheata
+ // Could be removed with the next Root version (>5.11)
+ if (gGeoManager) {
+ TIter next(gGeoManager->GetListOfVolumes());
+ TGeoVolume *vol;
+ while ((vol = (TGeoVolume *)next())) {
+ if (vol->GetVoxels()) {
+ if (vol->GetVoxels()->NeedRebuild()) {
+ vol->GetVoxels()->Voxelize();
+ vol->FindOverlaps();
+ }
+ }
+ }
+ }
+
+ // Export (mis)aligned geometry
+ if (gGeoManager) gGeoManager->Export("misaligned_geometry.root");
+
+// AliRunLoader* runLoader = gAlice->GetRunLoader();
+// if (!runLoader) {
+// AliError(Form("gAlice has no run loader object. "
+// "Check your config file: %s", fConfigFileName.Data()));
+// return kFALSE;
+// }
+// SetGAliceFile(runLoader->GetFileName());
if (!gAlice->Generator()) {
AliError(Form("gAlice has no generator object. "
}
}
+ if (!WriteTriggerRawData())
+ if (fStopOnError) return kFALSE;
+
gSystem->ChangeDirectory(baseDir);
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
AliError(Form("the following detectors were not found: %s",
AliInfo(Form("converting raw data DDL files to DATE file %s", dateFileName));
char command[256];
- sprintf(command, "dateStream -o %s -# %d -C",
+ sprintf(command, "dateStream -D -o %s -# %d -C",
dateFileName, runLoader->GetNumberOfEvents());
FILE* pipe = gSystem->OpenPipe(command, "w");
AliInfo(Form("converting DATE file %s to root file %s",
dateFileName, rootFileName));
- gSystem->Exec("rm -rf /tmp/mdc1");
- gSystem->Exec("rm -rf /tmp/mdc2");
-
- gSystem->Exec("mkdir /tmp/mdc1");
- gSystem->Exec("mkdir /tmp/mdc2");
-
- char command[256];
- sprintf(command, "alimdc %d %d %d %d %s",
- kDBSize, kTagDBSize, kFilter, kCompression, dateFileName);
- Int_t result = gSystem->Exec(command);
- sprintf(command, "mv /tmp/mdc1/*.root %s", rootFileName);
- gSystem->Exec(command);
- gSystem->Exec("rm -rf /tmp/mdc1");
- gSystem->Exec("rm -rf /tmp/mdc2");
+ const char* rawDBFS[2] = { "/tmp/mdc1", "/tmp/mdc2" };
+ const char* tagDBFS = "/tmp/mdc1/tags";
+ const char* runDBFS = "/tmp/mdc1/meta";
+
+ // User defined file system locations
+ if (gSystem->Getenv("ALIMDC_RAWDB1"))
+ rawDBFS[0] = gSystem->Getenv("ALIMDC_RAWDB1");
+ if (gSystem->Getenv("ALIMDC_RAWDB2"))
+ rawDBFS[1] = gSystem->Getenv("ALIMDC_RAWDB2");
+ if (gSystem->Getenv("ALIMDC_TAGDB"))
+ tagDBFS = gSystem->Getenv("ALIMDC_TAGDB");
+ if (gSystem->Getenv("ALIMDC_RUNDB"))
+ runDBFS = gSystem->Getenv("ALIMDC_RUNDB");
+
+ gSystem->Exec(Form("rm -rf %s",rawDBFS[0]));
+ gSystem->Exec(Form("rm -rf %s",rawDBFS[1]));
+ gSystem->Exec(Form("rm -rf %s",tagDBFS));
+ gSystem->Exec(Form("rm -rf %s",runDBFS));
+
+ gSystem->Exec(Form("mkdir %s",rawDBFS[0]));
+ gSystem->Exec(Form("mkdir %s",rawDBFS[1]));
+ gSystem->Exec(Form("mkdir %s",tagDBFS));
+ gSystem->Exec(Form("mkdir %s",runDBFS));
+
+ Int_t result = gSystem->Exec(Form("alimdc %d %d %d %d %s",
+ kDBSize, kTagDBSize, kFilter, kCompression, dateFileName));
+ gSystem->Exec(Form("mv %s/*.root %s", rawDBFS[0], rootFileName));
+
+ gSystem->Exec(Form("rm -rf %s",rawDBFS[0]));
+ gSystem->Exec(Form("rm -rf %s",rawDBFS[1]));
+ gSystem->Exec(Form("rm -rf %s",tagDBFS));
+ gSystem->Exec(Form("rm -rf %s",runDBFS));
return (result == 0);
}