CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
edm::DaqProvenanceHelper Struct Reference

#include <DaqProvenanceHelper.h>

Public Types

typedef tbb::concurrent_unordered_map< ParentageID, ParentageID, dqh::parentage_hashParentageIDMap
 
typedef std::map< ProcessHistoryID, ProcessHistoryIDProcessHistoryIDMap
 

Public Member Functions

BranchDescription const & branchDescription () const
 
ProcessHistoryID daqInit (ProductRegistry &productRegistry, ProcessHistoryRegistry &processHistoryRegistry) const
 
 DaqProvenanceHelper (TypeID const &rawDataType)
 
ProductProvenance const & dummyProvenance () const
 
void fixMetaData (ProcessConfigurationVector &pcv, std::vector< ProcessHistory > &phv)
 
void fixMetaData (std::vector< BranchID > &branchIDs) const
 
void fixMetaData (BranchIDLists const &) const
 
void fixMetaData (BranchChildren &branchChildren) const
 
BranchID const & mapBranchID (BranchID const &branchID) const
 
ParentageID const & mapParentageID (ParentageID const &phid) const
 
ProcessHistoryID const & mapProcessHistoryID (ProcessHistoryID const &phid)
 
bool matchProcesses (ProcessConfiguration const &pc, ProcessHistory const &ph) const
 
ProcessHistoryID const * oldProcessHistoryID () const
 
void saveInfo (BranchDescription const &oldBD, BranchDescription const &newBD)
 
void setOldParentageIDToNew (ParentageID const &iOld, ParentageID const &iNew)
 

Private Attributes

BranchDescription const constBranchDescription_
 
ProductProvenance dummyProvenance_
 
BranchID newBranchID_
 
BranchID oldBranchID_
 
ProcessHistoryID const * oldProcessHistoryID_
 
std::string oldProcessName_
 
ParentageIDMap parentageIDMap_
 
ProcessHistoryIDMap phidMap_
 
ParameterSet processParameterSet_
 

Detailed Description

Definition at line 27 of file DaqProvenanceHelper.h.

Member Typedef Documentation

Definition at line 29 of file DaqProvenanceHelper.h.

Definition at line 28 of file DaqProvenanceHelper.h.

Constructor & Destructor Documentation

edm::DaqProvenanceHelper::DaqProvenanceHelper ( TypeID const &  rawDataType)
explicit

Definition at line 18 of file DaqProvenanceHelper.cc.

References edm::ParameterSet::addParameter(), constBranchDescription_, relativeConstraints::empty, edm::BranchDescription::moduleLabel(), edm::moduleName(), edm::BranchDescription::moduleName(), modifiedElectrons_cfi::processName, edm::BranchDescription::processName(), processParameterSet_, edm::ParameterSet::registerIt(), AlCaHLTBitMon_QueryRunRegistry::string, and triggerPaths.

19  : constBranchDescription_(BranchDescription(InEvent,
20  "rawDataCollector"
21  //, "source"
22  ,
23  "LHC"
24  // , "HLT"
25  ,
26  "FEDRawDataCollection",
27  "FEDRawDataCollection",
28  "",
29  "FedRawDataInputSource",
31  TypeWithDict(rawDataType.typeInfo()),
32  false)),
36  oldBranchID_(),
37  newBranchID_(),
38  oldProcessHistoryID_(nullptr),
39  phidMap_() {
40  // Now we create a process parameter set for the "LHC" process.
41  // We don't currently use the untracked parameters, However, we make them available, just in case.
42  std::string const& moduleLabel = constBranchDescription_.moduleLabel();
45  typedef std::vector<std::string> vstring;
46  vstring empty;
47 
48  vstring modlbl;
49  modlbl.reserve(1);
50  modlbl.push_back(moduleLabel);
51  processParameterSet_.addParameter("@all_sources", modlbl);
52 
54  triggerPaths.addParameter<vstring>("@trigger_paths", empty);
56 
57  ParameterSet pseudoInput;
58  pseudoInput.addParameter<std::string>("@module_edm_type", "Source");
59  pseudoInput.addParameter<std::string>("@module_label", moduleLabel);
60  pseudoInput.addParameter<std::string>("@module_type", moduleName);
61  processParameterSet_.addParameter<ParameterSet>(moduleLabel, pseudoInput);
62 
63  processParameterSet_.addParameter<vstring>("@all_esmodules", empty);
64  processParameterSet_.addParameter<vstring>("@all_esprefers", empty);
65  processParameterSet_.addParameter<vstring>("@all_essources", empty);
66  processParameterSet_.addParameter<vstring>("@all_loopers", empty);
67  processParameterSet_.addParameter<vstring>("@all_modules", empty);
68  processParameterSet_.addParameter<vstring>("@end_paths", empty);
69  processParameterSet_.addParameter<vstring>("@paths", empty);
71  // Now we register the process parameter set.
73 
74  //std::cerr << processParameterSet_.dump() << std::endl;
75  }
ProductProvenance dummyProvenance_
std::string const & processName() const
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
std::string const & moduleLabel() const
ProcessHistoryIDMap phidMap_
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:125
BranchID const & branchID() const
Hash< ParameterSetType > ParameterSetID
std::string const & moduleName() const
BranchDescription const constBranchDescription_
static std::string const triggerPaths
Definition: EdmProvDump.cc:46
ParameterSet const & registerIt()
std::vector< std::string > vstring
Definition: Schedule.cc:565
ProcessHistoryID const * oldProcessHistoryID_

Member Function Documentation

BranchDescription const& edm::DaqProvenanceHelper::branchDescription ( ) const
inline

Definition at line 46 of file DaqProvenanceHelper.h.

Referenced by FedRawDataInputSource::read().

46 { return constBranchDescription_; }
BranchDescription const constBranchDescription_
ProcessHistoryID edm::DaqProvenanceHelper::daqInit ( ProductRegistry productRegistry,
ProcessHistoryRegistry processHistoryRegistry 
) const

Definition at line 77 of file DaqProvenanceHelper.cc.

References constBranchDescription_, edm::ProductRegistry::copyProduct(), edm::ProcessHistory::emplace_back(), edm::getPassID(), edm::getReleaseVersion(), edm::ParameterSet::id(), edm::BranchDescription::processName(), processParameterSet_, edm::ProcessHistoryRegistry::registerProcessHistory(), and edm::ProcessHistory::setProcessHistoryID().

Referenced by FedRawDataInputSource::FedRawDataInputSource().

78  {
79  // Now we need to set all the metadata
80  // Add the product to the product registry
81  productRegistry.copyProduct(constBranchDescription_);
82 
83  // Insert an entry for this process in the process history registry
84  ProcessHistory ph;
86  processHistoryRegistry.registerProcessHistory(ph);
87 
88  // Save the process history ID for use every event.
89  return ph.setProcessHistoryID();
90  }
std::string getPassID()
Definition: GetPassID.h:7
ParameterSetID id() const
std::string const & processName() const
std::string getReleaseVersion()
BranchDescription const constBranchDescription_
ProductProvenance const& edm::DaqProvenanceHelper::dummyProvenance ( ) const
inline

Definition at line 48 of file DaqProvenanceHelper.h.

Referenced by FedRawDataInputSource::read().

48 { return dummyProvenance_; }
ProductProvenance dummyProvenance_
void edm::DaqProvenanceHelper::fixMetaData ( ProcessConfigurationVector pcv,
std::vector< ProcessHistory > &  phv 
)

Referenced by matchProcesses().

void edm::DaqProvenanceHelper::fixMetaData ( std::vector< BranchID > &  branchIDs) const

Definition at line 133 of file DaqProvenanceHelper.cc.

References newBranchID_, oldBranchID_, and python.rootplot.root2matplotlib::replace().

133  {
134  std::replace(branchID.begin(), branchID.end(), oldBranchID_, newBranchID_);
135  }
def replace(string, replacements)
void edm::DaqProvenanceHelper::fixMetaData ( BranchIDLists const &  branchIDLists) const

Definition at line 137 of file DaqProvenanceHelper.cc.

References edm::BranchID::id(), list(), newBranchID_, oldBranchID_, and python.rootplot.root2matplotlib::replace().

137  {
140  // The const_cast is ugly, but it beats the alternatives.
141  BranchIDLists& lists = const_cast<BranchIDLists&>(branchIDLists);
142  for (auto& list : lists) {
143  std::replace(list.begin(), list.end(), oldID, newID);
144  }
145  }
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
def replace(string, replacements)
unsigned int id() const
Definition: BranchID.h:23
unsigned int value_type
Definition: BranchID.h:16
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void edm::DaqProvenanceHelper::fixMetaData ( BranchChildren branchChildren) const

Definition at line 147 of file DaqProvenanceHelper.cc.

References edm::BranchChildren::childLookup(), mps_fire::i, newBranchID_, and oldBranchID_.

147  {
148  typedef std::map<BranchID, std::set<BranchID> > BCMap;
149  // The const_cast is ugly, but it beats the alternatives.
150  BCMap& childLookup = const_cast<BCMap&>(branchChildren.childLookup());
151  // First fix any old branchID's in the key.
152  {
153  BCMap::iterator i = childLookup.find(oldBranchID_);
154  if (i != childLookup.end()) {
155  childLookup.insert(std::make_pair(newBranchID_, i->second));
156  childLookup.erase(i);
157  }
158  }
159  // Now fix any old branchID's in the sets;
160  for (auto& child : childLookup) {
161  if (child.second.erase(oldBranchID_) != 0) {
162  child.second.insert(newBranchID_);
163  }
164  }
165  }
BranchID const & edm::DaqProvenanceHelper::mapBranchID ( BranchID const &  branchID) const
ParentageID const & edm::DaqProvenanceHelper::mapParentageID ( ParentageID const &  phid) const

Definition at line 176 of file DaqProvenanceHelper.cc.

References parentageIDMap_.

Referenced by edm::ReducedProvenanceReader::readProvenance(), edm::FullProvenanceReader::readProvenance(), and edm::OldProvenanceReader::readProvenance().

176  {
177  ParentageIDMap::const_iterator it = parentageIDMap_.find(parentageID);
178  if (it == parentageIDMap_.end()) {
179  return parentageID;
180  }
181  return it->second;
182  }
ProcessHistoryID const & edm::DaqProvenanceHelper::mapProcessHistoryID ( ProcessHistoryID const &  phid)

Definition at line 168 of file DaqProvenanceHelper.cc.

References oldProcessHistoryID_, and phidMap_.

168  {
169  ProcessHistoryIDMap::const_iterator it = phidMap_.find(phid);
170  assert(it != phidMap_.end());
171  oldProcessHistoryID_ = &it->first;
172  return it->second;
173  }
ProcessHistoryIDMap phidMap_
ProcessHistoryID const * oldProcessHistoryID_
bool edm::DaqProvenanceHelper::matchProcesses ( ProcessConfiguration const &  pc,
ProcessHistory const &  ph 
) const

Definition at line 92 of file DaqProvenanceHelper.cc.

References constBranchDescription_, fixMetaData(), edm::ParameterSet::id(), oldProcessName_, edm::ProcessConfiguration::passID(), phidMap_, edm::BranchDescription::processName(), processParameterSet_, and edm::ProcessConfiguration::releaseVersion().

92  {
93  for (auto const& pc : ph) {
94  if (pc.processName() == oldProcessName_) {
95  return (pc.releaseVersion() == newPC.releaseVersion() && pc.passID() == newPC.passID());
96  }
97  }
98  return false;
99  }
ProcessHistoryID const* edm::DaqProvenanceHelper::oldProcessHistoryID ( ) const
inline

Definition at line 47 of file DaqProvenanceHelper.h.

47 { return oldProcessHistoryID_; }
ProcessHistoryID const * oldProcessHistoryID_
void edm::DaqProvenanceHelper::saveInfo ( BranchDescription const &  oldBD,
BranchDescription const &  newBD 
)
inline

Definition at line 32 of file DaqProvenanceHelper.h.

References edm::BranchDescription::branchID(), and edm::BranchDescription::processName().

32  {
33  oldProcessName_ = oldBD.processName();
34  oldBranchID_ = oldBD.branchID();
35  newBranchID_ = newBD.branchID();
36  }
void edm::DaqProvenanceHelper::setOldParentageIDToNew ( ParentageID const &  iOld,
ParentageID const &  iNew 
)

Definition at line 189 of file DaqProvenanceHelper.cc.

References parentageIDMap_.

189  {
190  parentageIDMap_.insert(std::make_pair(iOld, iNew));
191  }

Member Data Documentation

BranchDescription const edm::DaqProvenanceHelper::constBranchDescription_
private

Definition at line 53 of file DaqProvenanceHelper.h.

Referenced by daqInit(), DaqProvenanceHelper(), and matchProcesses().

ProductProvenance edm::DaqProvenanceHelper::dummyProvenance_
private

Definition at line 54 of file DaqProvenanceHelper.h.

BranchID edm::DaqProvenanceHelper::newBranchID_
private

Definition at line 59 of file DaqProvenanceHelper.h.

Referenced by fixMetaData(), and mapBranchID().

BranchID edm::DaqProvenanceHelper::oldBranchID_
private

Definition at line 58 of file DaqProvenanceHelper.h.

Referenced by fixMetaData(), and mapBranchID().

ProcessHistoryID const* edm::DaqProvenanceHelper::oldProcessHistoryID_
private

Definition at line 60 of file DaqProvenanceHelper.h.

Referenced by mapProcessHistoryID().

std::string edm::DaqProvenanceHelper::oldProcessName_
private

Definition at line 57 of file DaqProvenanceHelper.h.

Referenced by matchProcesses().

ParentageIDMap edm::DaqProvenanceHelper::parentageIDMap_
private

Definition at line 62 of file DaqProvenanceHelper.h.

Referenced by mapParentageID(), and setOldParentageIDToNew().

ProcessHistoryIDMap edm::DaqProvenanceHelper::phidMap_
private

Definition at line 61 of file DaqProvenanceHelper.h.

Referenced by mapProcessHistoryID(), and matchProcesses().

ParameterSet edm::DaqProvenanceHelper::processParameterSet_
private

Definition at line 55 of file DaqProvenanceHelper.h.

Referenced by daqInit(), DaqProvenanceHelper(), and matchProcesses().