CMS 3D CMS Logo

CommonProvenanceFiller.cc
Go to the documentation of this file.
2 
9 
10 #include "TBranch.h"
11 #include "TTree.h"
12 
13 #include <cassert>
14 #include <utility>
15 
16 namespace edm {
17 
18  void fillParameterSetBranch(TTree* parameterSetsTree, int basketSize) {
19  std::pair<ParameterSetID, ParameterSetBlob> idToBlob;
20  std::pair<ParameterSetID, ParameterSetBlob>* pIdToBlob = &idToBlob;
21  TBranch* b =
22  parameterSetsTree->Branch(poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob, basketSize, 0);
23 
24  for (auto const& pset : *pset::Registry::instance()) {
25  idToBlob.first = pset.first;
26  idToBlob.second.pset() = pset.second.toString();
27 
28  b->Fill();
29  }
30  }
31 
32  void fillProcessHistoryBranch(TTree* metaDataTree,
33  int basketSize,
34  ProcessHistoryRegistry const& processHistoryRegistry) {
35  ProcessHistoryVector procHistoryVector;
36  for (auto const& ph : processHistoryRegistry) {
37  procHistoryVector.push_back(ph.second);
38  }
39  ProcessHistoryVector* p = &procHistoryVector;
40  TBranch* b = metaDataTree->Branch(poolNames::processHistoryBranchName().c_str(), &p, basketSize, 0);
41  assert(b);
42  b->Fill();
43  }
44 
45 } // namespace edm
std::vector< ProcessHistory > ProcessHistoryVector
void fillParameterSetBranch(TTree *parameterSetsTree, int basketSize)
void fillProcessHistoryBranch(TTree *metaDataTree, int basketSize, ProcessHistoryRegistry const &processHistoryRegistry)
std::string const & processHistoryBranchName()
Definition: BranchType.cc:177
assert(be >=bs)
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:218
double b
Definition: hdecay.h:118
HLT enums.
static Registry * instance()
Definition: Registry.cc:12