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 
20  std::pair<ParameterSetID, ParameterSetBlob> idToBlob;
21  std::pair<ParameterSetID, ParameterSetBlob>* pIdToBlob = &idToBlob;
22  TBranch* b = 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, int basketSize, ProcessHistoryRegistry const& processHistoryRegistry) {
33  ProcessHistoryVector procHistoryVector;
34  for(auto const& ph : processHistoryRegistry) {
35  procHistoryVector.push_back(ph.second);
36  }
37  ProcessHistoryVector* p = &procHistoryVector;
38  TBranch* b = metaDataTree->Branch(poolNames::processHistoryBranchName().c_str(), &p, basketSize, 0);
39  assert(b);
40  b->Fill();
41  }
42 
43 }
std::vector< ProcessHistory > ProcessHistoryVector
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:261
void fillParameterSetBranch(TTree *parameterSetsTree, int basketSize)
void fillProcessHistoryBranch(TTree *metaDataTree, int basketSize, ProcessHistoryRegistry const &processHistoryRegistry)
std::string const & processHistoryBranchName()
Definition: BranchType.cc:199
double b
Definition: hdecay.h:120
HLT enums.
static Registry * instance()
Definition: Registry.cc:13