From: acolla Date: Fri, 2 Nov 2007 09:35:17 +0000 (+0000) Subject: Map of CDB storages and list of CDB object Id's used for the reconstruction are X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=69adb7b53b1026ce3d6e97f126cb94728a7cc2f4;p=u%2Fmrichter%2FAliRoot.git Map of CDB storages and list of CDB object Id's used for the reconstruction are now written to the ESD tree's UserInfo. The storage map (named "cdbMap") is a list of TObjString pairs. The key is "default" or the paths for which the specific storages are accessed, e.g.: key value "default" "local://$ALICE_ROOT" "TPC/Calib/*" "local://TPC_SPECIFIC" ... The list of retrieved objects (named "cdbList") is made of the AliCDBId's of the retrieved data. To get them: TFile * f = new TFile("AliESDs.root"); TTree* tree = f->Get("esdTree"); TList* l = tree->GetUserInfo(); TList* ids = l->FindObject("cdbList"); ids->Print(); TMap* storages = l->FindObject("cdbMap"); storages->Print(); --- diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 274c0f647c1..677951d8482 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -917,8 +917,35 @@ Bool_t AliReconstruction::Run(const char* input) tree->GetUserInfo()->Add(esd); hlttree->GetUserInfo()->Add(hltesd); + + 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()); + 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(id->Clone()); + } + + tree->GetUserInfo()->Add(cdbMapCopy); + tree->GetUserInfo()->Add(cdbListCopy); if(fESDPar.Contains("ESD.par")){ AliInfo("Attaching ESD.par to Tree");