X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FSTEER%2FAliSimulation.cxx;h=2fbf9872af78085c2f06514dc4538b6b37916fc4;hb=a04d1d77d00e1f1538b2de830121c4cb0e3db077;hp=2c8e534576a1b488a0671c7f40edbf9f1252845e;hpb=35ec1f7073cd88ed589e94d772eaca9f92fad753;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/STEER/AliSimulation.cxx b/STEER/STEER/AliSimulation.cxx index 2c8e534576a..2fbf9872af7 100644 --- a/STEER/STEER/AliSimulation.cxx +++ b/STEER/STEER/AliSimulation.cxx @@ -13,7 +13,7 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* $Id$ */ +/* $Id: AliSimulation.cxx 64623 2013-10-21 13:38:58Z rgrosso $ */ /////////////////////////////////////////////////////////////////////////////// // // @@ -105,7 +105,6 @@ // // /////////////////////////////////////////////////////////////////////////////// -#include #include #include #include @@ -157,13 +156,9 @@ using std::ofstream; ClassImp(AliSimulation) AliSimulation *AliSimulation::fgInstance = 0; -const char* AliSimulation::fgkDetectorName[AliSimulation::fgkNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE" -// #ifdef MFT_UPGRADE -// ,"MFT" -// #endif - ,"MFT" // AU - ,"HLT" -}; + const char* AliSimulation::fgkDetectorName[AliSimulation::fgkNDetectors] = {"ITS", "TPC", "TRD", + "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE","AD", + "FIT","MFT","HLT"}; //_____________________________________________________________________________ AliSimulation::AliSimulation(const char* configFileName, @@ -1303,6 +1298,8 @@ Bool_t AliSimulation::RunGeneratorOnly() runLoader->WriteHeader("OVERWRITE"); generator->Write(); runLoader->Write(); + + return kTRUE; } //_____________________________________________________________________________ @@ -2109,7 +2106,9 @@ void AliSimulation::FinishRun() AliRunLoader::Instance()->CdGAFile(); gAlice->Write(0,TObject::kOverwrite);//write AliRun AliRunLoader::Instance()->Write(0,TObject::kOverwrite);//write RunLoader itself - + // + StoreUsedCDBMaps(); + // if(gAlice->GetMCApp()) gAlice->GetMCApp()->FinishRun(); AliRunLoader::Instance()->Synchronize(); } @@ -2516,3 +2515,46 @@ time_t AliSimulation::GenerateTimeStamp() const else return 0; } + +//_____________________________________________________________________________ +void AliSimulation::StoreUsedCDBMaps() const +{ + // write in galice.root maps with used CDB paths + // + const TMap *cdbMap = AliCDBManager::Instance()->GetStorageMap(); + const TList *cdbList = AliCDBManager::Instance()->GetRetrievedIds(); + // + TMap *cdbMapCopy = new TMap(cdbMap->GetEntries()); + cdbMapCopy->SetOwner(1); + // cdbMapCopy->SetName("cdbMap"); + TIter iter(cdbMap->GetTable()); + // + TPair* pair = 0; + while((pair = dynamic_cast (iter.Next()))){ + TObjString* keyStr = dynamic_cast (pair->Key()); + TObjString* valStr = dynamic_cast (pair->Value()); + if (keyStr && valStr) + cdbMapCopy->Add(new TObjString(keyStr->GetName()), new TObjString(valStr->GetName())); + } + // + TList *cdbListCopy = new TList(); + cdbListCopy->SetOwner(1); + // cdbListCopy->SetName("cdbList"); + // + TIter iter2(cdbList); + + AliCDBId* id=0; + while((id = dynamic_cast (iter2.Next()))){ + cdbListCopy->Add(new TObjString(id->ToString().Data())); + } + // + AliRunLoader::Instance()->CdGAFile(); + gDirectory->WriteObject(cdbMapCopy,"cdbMap","kSingleKey"); + gDirectory->WriteObject(cdbListCopy,"cdbList","kSingleKey"); + // + AliInfo(Form("Stored used OCDB entries as TMap %s and TList %s in %s", + cdbMapCopy->GetName(), + cdbListCopy->GetName(), + fGAliceFileName.Data())); + // +}