Classes | Public Types | Public Member Functions | Private Member Functions | List of all members
art::ProvenanceCheckerOutput Class Reference
Inheritance diagram for art::ProvenanceCheckerOutput:
art::OutputModule art::Observer art::detail::SharedModule art::ModuleBase

Classes

struct  Config
 

Public Types

using Parameters = fhicl::WrappedTable< Config, OutputModule::Config::KeysToIgnore >
 
- Public Types inherited from art::OutputModule
using ModuleType = OutputModule
 
using WorkerType = OutputWorker
 
using PluginCollection_t = std::vector< std::unique_ptr< FileCatalogMetadataPlugin >>
 

Public Member Functions

 ProvenanceCheckerOutput (Parameters const &)
 
- Public Member Functions inherited from art::OutputModule
virtual ~OutputModule () noexcept
 
 OutputModule (fhicl::ParameterSet const &pset)
 
 OutputModule (fhicl::TableFragment< Config > const &pset, fhicl::ParameterSet const &containing_pset)
 
 OutputModule (OutputModule const &)=delete
 
 OutputModule (OutputModule &&)=delete
 
OutputModuleoperator= (OutputModule const &)=delete
 
OutputModuleoperator= (OutputModule &&)=delete
 
int maxEvents () const
 
int remainingEvents () const
 
bool fileIsOpen () const
 
OutputFileStatus fileStatus () const
 
virtual std::string const & lastClosedFileName () const
 
SelectionsArray const & keptProducts () const
 
bool selected (BranchDescription const &) const
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
void selectProducts (ProductTables const &)
 
void doSelectProducts (ProductTables const &)
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
BranchChildren const & branchChildren () const
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 
- Public Member Functions inherited from art::detail::SharedModule
 SharedModule ()
 
 SharedModule (std::string const &moduleLabel)
 
hep::concurrency::SerialTaskQueueChain * serialTaskQueueChain () const
 
std::set< std::string > const & sharedResources () const
 
void createQueues (SharedResources const &resources)
 
template<BranchType , typename... T>
void serialize (T const &...resources)
 
template<BranchType , typename... T>
void serializeExternal (T const &...resources)
 

Private Member Functions

void write (EventPrincipal &e) override
 
void writeSubRun (SubRunPrincipal &) override
 
void writeRun (RunPrincipal &) override
 

Additional Inherited Members

- Protected Member Functions inherited from art::OutputModule
virtual void doRegisterProducts (ProductDescriptions &, ModuleDescription const &)
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
- Protected Member Functions inherited from art::detail::SharedModule
template<BranchType BT = InEvent, typename... T>
void serialize (T const &...)
 
template<BranchType BT = InEvent, typename... T>
void serializeExternal (T const &...)
 
template<BranchType BT = InEvent>
void async ()
 

Detailed Description

Definition at line 20 of file ProvenanceCheckerOutput_module.cc.

Member Typedef Documentation

using art::ProvenanceCheckerOutput::Parameters = fhicl::WrappedTable<Config, OutputModule::Config::KeysToIgnore>

Definition at line 27 of file ProvenanceCheckerOutput_module.cc.

Constructor & Destructor Documentation

art::ProvenanceCheckerOutput::ProvenanceCheckerOutput ( ProvenanceCheckerOutput::Parameters const &  ps)
explicit

Definition at line 43 of file ProvenanceCheckerOutput_module.cc.

45  : OutputModule{ps().omConfig, ps.get_PSet()}
46  {}
static constexpr double ps
Definition: Units.h:99
OutputModule(fhicl::ParameterSet const &pset)
Definition: OutputModule.cc:73

Member Function Documentation

void art::ProvenanceCheckerOutput::write ( EventPrincipal e)
overrideprivatevirtual

Implements art::OutputModule.

Definition at line 75 of file ProvenanceCheckerOutput_module.cc.

76  {
77  // Check ProductProvenance's parents to see if they are in the
78  // ProductProvenance list
79 
80  std::map<ProductID, bool> seenParentInPrincipal;
81  std::set<ProductID> missingFromMapper;
82  std::set<ProductID> missingProductProvenance;
83 
84  for (auto const& group : e) {
85  auto const pid = group.first;
86  auto const& pd = group.second;
87  if (pd && pd->productAvailable()) {
88  e.getForOutput(pid, false);
89  if (not pd->productProvenance().get()) {
90  missingProductProvenance.insert(pid);
91  continue;
92  }
93  auto pInfo = e.branchToProductProvenance(pid);
94  if (!pInfo) {
95  missingFromMapper.insert(pid);
96  }
97  markAncestors(*(pd->productProvenance()),
98  e,
99  seenParentInPrincipal,
100  missingFromMapper);
101  }
102  seenParentInPrincipal[pid] = true;
103  }
104 
105  // Determine what ProductIDs are missing from the principal,
106  // vs. which ProductIDs are not even accessible to the principal
107  // via the product tables.
108  std::set<ProductID> missingFromPrincipal;
109  std::set<ProductID> missingFromTables;
110  for (auto const& seenParent : seenParentInPrincipal) {
111  if (!seenParent.second) {
112  missingFromPrincipal.insert(seenParent.first);
113  }
114  ProductID const pid{seenParent.first};
115  auto found = e.getProductDescription(pid);
116  if (found == nullptr) {
117  missingFromTables.insert(pid);
118  }
119  }
120 
121  auto logProductID = [](auto const& missing) {
122  mf::LogProblem("ProvenanceChecker") << missing;
123  };
124 
125  if (missingFromMapper.size()) {
126  mf::LogError("ProvenanceChecker")
127  << "Missing the following ProductIDs from BranchMapper\n";
128  cet::for_all(missingFromMapper, logProductID);
129  }
130 
131  if (missingFromPrincipal.size()) {
132  mf::LogError("ProvenanceChecker")
133  << "Missing the following ProductIDs from EventPrincipal\n";
134  cet::for_all(missingFromPrincipal, logProductID);
135  }
136 
137  if (missingProductProvenance.size()) {
138  mf::LogError("ProvenanceChecker") << "The Groups for the following "
139  "ProductIDs have no "
140  "ProductProvenance\n";
141  cet::for_all(missingProductProvenance, logProductID);
142  }
143 
144  if (missingFromTables.size()) {
145  mf::LogError("ProvenanceChecker") << "Missing the following ProductIDs "
146  "from the principal's product "
147  "tables\n";
148  cet::for_all(missingFromTables, logProductID);
149  }
150 
151  if (missingFromMapper.size() or missingFromPrincipal.size() or
152  missingProductProvenance.size() or missingFromTables.size()) {
153  throw cet::exception("ProvenanceError")
154  << (missingFromMapper.size() or missingFromPrincipal.size() ?
155  "Having missing ancestors" :
156  "")
157  << (missingFromMapper.size() ? " from BranchMapper" : "")
158  << (missingFromMapper.size() and missingFromPrincipal.size() ? " and" :
159  "")
160  << (missingFromPrincipal.size() ? " from EventPrincipal" : "")
161  << (missingFromMapper.size() or missingFromPrincipal.size() ? ".\n" :
162  "")
163  << (missingProductProvenance.size() ? " Have missing "
164  "ProductProvenance's from Group "
165  "in EventPrincipal.\n" :
166  "")
167  << (missingFromTables.size() ?
168  " Have missing info from the principal's product tables.\n" :
169  "");
170  }
171  }
static void markAncestors(ProductProvenance const &iInfo, EventPrincipal &e, std::map< ProductID, bool > &oMap, std::set< ProductID > &oMapperMissing)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
MaybeLogger_< ELseverityLevel::ELsev_error, true > LogProblem
const double e
auto for_all(FwdCont &, Func)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void art::ProvenanceCheckerOutput::writeRun ( RunPrincipal )
inlineoverrideprivatevirtual

Implements art::OutputModule.

Definition at line 36 of file ProvenanceCheckerOutput_module.cc.

37  {}
void art::ProvenanceCheckerOutput::writeSubRun ( SubRunPrincipal )
inlineoverrideprivatevirtual

Implements art::OutputModule.

Definition at line 33 of file ProvenanceCheckerOutput_module.cc.

34  {}

The documentation for this class was generated from the following file: