本文整理汇总了C++中TMap::GetEntries方法的典型用法代码示例。如果您正苦于以下问题:C++ TMap::GetEntries方法的具体用法?C++ TMap::GetEntries怎么用?C++ TMap::GetEntries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMap
的用法示例。
在下文中一共展示了TMap::GetEntries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeSnapshot
void MakeSnapshot(Int_t run, const char* defStorage, TMap* specStorages, const char* snapshotFileName)
{
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage(defStorage);
cdb->SetRun(run);
TIter iter(specStorages->GetTable());
TPair *pair = 0;
while((pair = dynamic_cast<TPair*> (iter.Next()))){
TObjString* caltype = dynamic_cast<TObjString*> (pair->Key());
TObjString* specstor= dynamic_cast<TObjString*> (pair->Value());
if (caltype && specstor)
//TString calType = caltype->GetString();
//TString specStor = specstor->GetString();
//cdb->SetSpecificStorage(calType.Data(),specStor.Data());
cdb->SetSpecificStorage(caltype->GetString().Data(),specstor->GetString().Data());
else
//AliFatal("Error reading info for specific storage")
Printf("Error reading info for specific storage");
}
// ********************************** GRP ******************************************
cdb->Get("GRP/CTP/Config");
cdb->Get("GRP/Calib/LHCClockPhase");
cdb->Get("GRP/GRP/Data");
cdb->Get("GRP/Align/Data");
cdb->Get("GRP/Calib/MeanVertexSPD");
cdb->Get("GRP/Calib/MeanVertex");
cdb->Get("GRP/Calib/MeanVertexTPC");
cdb->Get("GRP/Calib/CosmicTriggers");
cdb->Get("GRP/CTP/Scalers");
cdb->Get("GRP/CTP/CTPtiming");
cdb->Get("GRP/CTP/TimeAlign");
cdb->Get("GRP/GRP/LHCData");
cdb->Get("GRP/Calib/RecoParam");
// ********************************** ALL ******************************************
TString detStr = ("ITS TPC TRD TOF PHOS HMPID EMCAL MUON ZDC PMD T0 VZERO");
//TString detStr = ("ITS MUON TPC");
TObjArray *arr = detStr.Tokenize(' ');
for (Int_t iDet=0; iDet<arr->GetEntries(); iDet++) {
TObjString *detOStr = dynamic_cast<TObjString*>(arr->At(iDet));
AliCDBManager::Instance()->GetAll(Form("%s/Calib/*",detOStr->GetString().Data()));
AliCDBManager::Instance()->Get(Form("%s/Align/Data",detOStr->GetString().Data()));
}
// ******************************** TRIGGER ****************************************
// Temporary fix - one has to define the correct policy in order
// to load the trigger OCDB entries only for the detectors that
// in the trigger or that are needed in order to put correct
// information in ESD
AliCDBManager::Instance()->GetAll("TRIGGER/*/*");
// ********************************** HLT ******************************************
// cdb->Get("HLT/ConfigHLT/esdLayout");
// cdb->Get("HLT/Calib/StreamerInfo");
TMap* entriesMap = const_cast<TMap*>(cdb->GetEntryCache());
Printf("\nentriesMap has %d entries!\n", entriesMap->GetEntries());
TList* entriesList = const_cast<TList*>(cdb->GetRetrievedIds());
Printf("\nentriesList has %d entries!\n", entriesList->GetEntries());
//TString filename(TString::Format("CDBsnapshot_Run%d.root",run));
TString filename(snapshotFileName);
TFile *f = new TFile(filename.Data(),"recreate");
f->cd();
f->WriteObject(entriesMap,"entriesMap");
f->WriteObject(entriesList,"entriesList");
f->Close();
entriesMap->SetOwnerKeyValue(kFALSE,kFALSE);
entriesList->SetOwner(kFALSE);
}