]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Map of CDB storages and list of CDB object Id's used for the reconstruction are
authoracolla <acolla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Nov 2007 09:35:17 +0000 (09:35 +0000)
committeracolla <acolla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Nov 2007 09:35:17 +0000 (09:35 +0000)
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();

STEER/AliReconstruction.cxx

index 274c0f647c10bfd9d21cdc03e7fa27fe3e357025..677951d848229ad4fbb03f26b4f26db91be450ba 100644 (file)
@@ -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<TPair*> (iter.Next()))){
+       TObjString* keyStr = dynamic_cast<TObjString*> (pair->Key());
+       TObjString* valStr = dynamic_cast<TObjString*> (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<AliCDBId*> (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");