LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::Event Class Referencefinal

#include "Event.h"

Inheritance diagram for art::Event:
art::DataViewImpl

Public Types

using Base = DataViewImpl
 
template<typename T >
using HandleT = Handle< T >
 

Public Member Functions

 Event (EventPrincipal const &ep, ModuleDescription const &md, cet::exempt_ptr< Consumer > consumer, RangeSet const &rs)
 
 Event (EventPrincipal const &ep, ModuleDescription const &md, cet::exempt_ptr< Consumer > consumer)
 
EventID id () const
 
Timestamp time () const
 
EventNumber_t event () const
 
SubRunNumber_t subRun () const
 
RunNumber_t run () const
 
bool isRealData () const
 
EventAuxiliary::ExperimentType experimentType () const
 
SubRun const & getSubRun () const
 
Run const & getRun () const
 
History const & history () const
 
ProcessHistoryID const & processHistoryID () const
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&product)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&product, std::string const &productInstanceName)
 
bool getProcessParameterSet (std::string const &processName, fhicl::ParameterSet &ps) const
 
EDProductGetter const * productGetter (ProductID const) const
 
void commit (EventPrincipal &, bool checkPutProducts, std::set< TypeLabel > const &expectedProducts)
 
template<typename PROD >
art::ProductID put (std::unique_ptr< PROD > &&product, std::string const &productInstanceName)
 

Private Types

using RetrievedProductIDs = std::vector< ProductID >
 
using RetrievedProductSet = std::set< ProductID >
 
using TypeLabelMap = std::map< TypeLabel, PMValue >
 
using GroupQueryResultVec = std::vector< GroupQueryResult >
 

Private Member Functions

size_t size () const
 
template<typename PROD >
bool get (SelectorBase const &, Handle< PROD > &result) const
 
template<typename PROD >
bool get (ProductID const pid, Handle< PROD > &result) const
 
template<typename PROD >
bool getByLabel (std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
 
template<typename PROD >
bool getByLabel (std::string const &label, std::string const &productInstanceName, std::string const &processName, Handle< PROD > &result) const
 
template<typename PROD >
PROD const & getByLabel (InputTag const &tag) const
 same as above, but using the InputTag class More...
 
template<typename PROD >
bool getByLabel (InputTag const &tag, Handle< PROD > &result) const
 
template<typename PROD >
PROD const * getPointerByLabel (InputTag const &tag) const
 
template<typename PROD >
bool getByToken (ProductToken< PROD > const &token, Handle< PROD > &result) const
 
template<typename PROD >
ValidHandle< PROD > getValidHandle (InputTag const &tag) const
 
template<typename PROD >
ValidHandle< PROD > getValidHandle (ProductToken< PROD > const &token) const
 
template<typename PROD >
art::ValidHandle< PROD > getValidHandle (InputTag const &tag) const
 
template<typename PROD >
art::ValidHandle< PROD > getValidHandle (ProductToken< PROD > const &token) const
 
template<typename PROD >
void getMany (SelectorBase const &, std::vector< Handle< PROD >> &results) const
 
template<typename PROD >
void getManyByType (std::vector< Handle< PROD >> &results) const
 
template<typename ELEMENT >
std::size_t getView (std::string const &moduleLabel, std::string const &productInstanceName, std::vector< ELEMENT const * > &result) const
 
template<typename ELEMENT >
std::size_t getView (InputTag const &tag, std::vector< ELEMENT const * > &result) const
 
template<typename ELEMENT >
std::size_t getView (ViewToken< ELEMENT > const &token, std::vector< ELEMENT const * > &result) const
 
template<typename ELEMENT >
bool getView (std::string const &moduleLabel, std::string const &instanceName, View< ELEMENT > &result) const
 
template<typename ELEMENT >
bool getView (InputTag const &tag, View< ELEMENT > &result) const
 
template<typename ELEMENT >
bool getView (ViewToken< ELEMENT > const &tag, View< ELEMENT > &result) const
 
template<typename PROD >
bool removeCachedProduct (Handle< PROD > &h) const
 
ProcessHistory const & processHistory () const
 
void recordAsParent (Provenance const &prov) const
 
TypeLabelMapputProducts ()
 
TypeLabelMap const & putProducts () const
 
RetrievedProductSet const & retrievedProducts () const
 
RetrievedProductIDs retrievedProductIDs () const
 
void checkPutProducts (bool checkProducts, std::set< TypeLabel > const &expectedProducts, TypeLabelMap const &putProducts)
 
BranchDescription const & getProductDescription (TypeID const &type, std::string const &productInstanceName) const
 
template<typename ELEMENT >
art::DataViewImpl::GroupQueryResultVec getView_ (std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName) const
 

Private Attributes

EventAuxiliary const & aux_
 
std::unique_ptr< SubRun const > const subRun_
 
EventPrincipal const & eventPrincipal_
 

Detailed Description

Definition at line 42 of file Event.h.

Member Typedef Documentation

Definition at line 44 of file Event.h.

using art::DataViewImpl::GroupQueryResultVec = std::vector<GroupQueryResult>
protectedinherited

Definition at line 214 of file DataViewImpl.h.

template<typename T >
using art::Event::HandleT = Handle<T>

Definition at line 148 of file Event.h.

using art::DataViewImpl::RetrievedProductIDs = std::vector<ProductID>
inherited

Definition at line 175 of file DataViewImpl.h.

Definition at line 176 of file DataViewImpl.h.

using art::DataViewImpl::TypeLabelMap = std::map<TypeLabel, PMValue>
inherited

Definition at line 177 of file DataViewImpl.h.

Constructor & Destructor Documentation

art::Event::Event ( EventPrincipal const &  ep,
ModuleDescription const &  md,
cet::exempt_ptr< Consumer consumer,
RangeSet const &  rs 
)
explicit

Definition at line 47 of file Event.cc.

51  : Event{ep, md, consumer}
52  {}
Event(EventPrincipal const &ep, ModuleDescription const &md, cet::exempt_ptr< Consumer > consumer, RangeSet const &rs)
Definition: Event.cc:47
art::Event::Event ( EventPrincipal const &  ep,
ModuleDescription const &  md,
cet::exempt_ptr< Consumer consumer 
)
explicit

Definition at line 54 of file Event.cc.

References aux_, eventPrincipal_, art::InEvent, and subRun_.

57  : DataViewImpl{ep, md, InEvent, record_parents(this), consumer}
58  , aux_{ep.aux()}
59  , subRun_{newSubRun(ep, md, consumer)}
60  , eventPrincipal_{ep}
61  {}
EventPrincipal const & eventPrincipal_
Definition: Event.h:153
EventAuxiliary const & aux_
Definition: Event.h:151
std::unique_ptr< SubRun const > const subRun_
Definition: Event.h:152
DataViewImpl(DataViewImpl const &)=delete

Member Function Documentation

void art::DataViewImpl::checkPutProducts ( bool  checkProducts,
std::set< TypeLabel > const &  expectedProducts,
TypeLabelMap const &  putProducts 
)
protectedinherited

Definition at line 109 of file DataViewImpl.cc.

References art::DataViewImpl::getProductDescription(), and art::errors::LogicError.

Referenced by art::Run::commit(), art::SubRun::commit(), commit(), put(), and art::DataViewImpl::retrievedProducts().

112  {
113  if (!checkProducts)
114  return;
115 
116  std::vector<std::string> missing;
117  for (auto const& typeLabel : expectedProducts) {
118  if (putProducts.find(typeLabel) != putProducts.cend())
119  continue;
120 
121  std::ostringstream desc;
122  desc << getProductDescription(typeLabel.typeID(),
123  typeLabel.productInstanceName());
124  missing.emplace_back(desc.str());
125  }
126 
127  if (!missing.empty()) {
128  std::ostringstream errmsg;
129  HorizontalRule rule{25};
130  errmsg << "The following products have been declared with 'produces',\n"
131  << "but they have not been placed onto the event:\n"
132  << rule('=') << '\n';
133  for (auto const& desc : missing) {
134  errmsg << desc << rule('=') << '\n';
135  }
136  throw Exception{errors::LogicError, "DataViewImpl::checkPutProducts"}
137  << errmsg.str();
138  }
139  }
BranchDescription const & getProductDescription(TypeID const &type, std::string const &productInstanceName) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
TypeLabelMap & putProducts()
Definition: DataViewImpl.h:183
void art::Event::commit ( EventPrincipal ep,
bool  checkPutProducts,
std::set< TypeLabel > const &  expectedProducts 
)

Definition at line 121 of file Event.cc.

References art::DataViewImpl::checkPutProducts(), eventPrincipal_, art::productstatus::present(), art::EventPrincipal::put(), art::DataViewImpl::putProducts(), and art::DataViewImpl::retrievedProductIDs().

Referenced by put().

124  {
125  // Check addresses only since type of 'ep' will hopefully change to
126  // Principal&.
127  assert(&ep == &eventPrincipal_);
128  checkPutProducts(checkProducts, expectedProducts, putProducts());
129 
130  auto const& parents = retrievedProductIDs();
131  for (auto& elem : putProducts()) {
132  auto const& pd = elem.second.pd;
133  auto productProvenancePtr = make_unique<ProductProvenance const>(
134  pd.productID(), productstatus::present(), parents);
135  ep.put(std::move(elem.second.prod), pd, std::move(productProvenancePtr));
136  };
137 
138  // the cleanup is all or none
139  putProducts().clear();
140  }
EventPrincipal const & eventPrincipal_
Definition: Event.h:153
TypeLabelMap & putProducts()
Definition: DataViewImpl.h:183
RetrievedProductIDs retrievedProductIDs() const
void checkPutProducts(bool checkProducts, std::set< TypeLabel > const &expectedProducts, TypeLabelMap const &putProducts)
ProductStatus present()
Definition: ProductStatus.h:16
EventAuxiliary::ExperimentType art::Event::experimentType ( ) const
inline

Definition at line 88 of file Event.h.

References aux_, art::EventAuxiliary::experimentType(), getRun(), getSubRun(), history(), and processHistoryID().

Referenced by rndm::NuRandomServiceHelper::ArtState::set_event().

89  {
90  return aux_.experimentType();
91  }
EventAuxiliary const & aux_
Definition: Event.h:151
ExperimentType experimentType() const
template<typename PROD >
bool art::DataViewImpl::get ( SelectorBase const &  sel,
Handle< PROD > &  result 
) const
inlineinherited

Definition at line 307 of file DataViewImpl.h.

References art::Handle< T >::clear(), art::convert_handle(), art::Handle< T >::failedToGet(), art::DataViewImpl::get_(), art::Handle< T >::provenance(), art::DataViewImpl::recordAsParent(), art::DataViewImpl::recordParents_, and art::GroupQueryResult::succeeded().

Referenced by art::Run::endTime(), art::SubRun::endTime(), art::detail::ProcessAndEventSelector::loadTriggerResults(), DUNE::NeutrinoTrackingEff::processEff(), DUNE::MuonTrackingEff::processEff(), and put().

308 {
309  result.clear(); // Is this the correct thing to do if an exception is thrown?
310  // We do *not* track whether consumes was called for a SelectorBase.
311  GroupQueryResult bh = get_(WrappedTypeID::make<PROD>(), sel);
312  convert_handle(bh, result);
313  bool const ok{bh.succeeded() && !result.failedToGet()};
314  if (recordParents_ && ok) {
315  recordAsParent(*result.provenance());
316  }
317  return ok;
318 }
void recordAsParent(Provenance const &prov) const
Definition: DataViewImpl.cc:87
GroupQueryResult get_(WrappedTypeID const &wrapped, SelectorBase const &) const
Definition: DataViewImpl.cc:40
void convert_handle(GroupQueryResult const &, Handle< T > &)
Definition: Handle.h:249
bool const recordParents_
Definition: DataViewImpl.h:286
template<typename PROD >
bool art::DataViewImpl::get ( ProductID const  pid,
Handle< PROD > &  result 
) const
inherited

Definition at line 322 of file DataViewImpl.h.

References art::Handle< T >::clear(), art::convert_handle(), art::Handle< T >::failedToGet(), art::DataViewImpl::getByProductID_(), art::Handle< T >::provenance(), art::DataViewImpl::recordAsParent(), art::DataViewImpl::recordParents_, and art::GroupQueryResult::succeeded().

323 {
324  result.clear(); // Is this the correct thing to do if an exception is thrown?
325  // We do *not* track whether consumes was called for a ProductID.
326  GroupQueryResult bh = getByProductID_(pid);
327  convert_handle(bh, result);
328  bool const ok{bh.succeeded() && !result.failedToGet()};
329  if (recordParents_ && ok) {
330  recordAsParent(*result.provenance());
331  }
332  return ok;
333 }
void recordAsParent(Provenance const &prov) const
Definition: DataViewImpl.cc:87
void convert_handle(GroupQueryResult const &, Handle< T > &)
Definition: Handle.h:249
GroupQueryResult getByProductID_(ProductID const pid) const
Definition: DataViewImpl.cc:47
bool const recordParents_
Definition: DataViewImpl.h:286
template<typename PROD >
bool art::DataViewImpl::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
Handle< PROD > &  result 
) const
inlineinherited

Definition at line 344 of file DataViewImpl.h.

Referenced by lar::util::details::FindAllP< Source, Dest >::Add(), reco3d::PlotSpacePoints::analyze(), hit::MCHitAnaExample::analyze(), pid::PIDAAnalyzer::analyze(), opdet::OpFlashSimpleAna::analyze(), opdet::OpHitAna::analyze(), cheat::CheckBackTracking::analyze(), calo::PrintCalorimetry::analyze(), opdet::OpFlashMCTruthAna::analyze(), MCBTDemo::analyze(), trk::TrackContainmentAnalyzer::analyze(), opdet::FlashHypothesisAna::analyze(), cheat::RecoCheckAna::analyze(), opreco::OpticalRecoAna::analyze(), cluster::ClusterPCA::analyze(), hit::HitAnaModule::analyze(), lar_pandora::ConsolidatedPFParticleAnalysisTemplate::analyze(), vertex::AggregateVertexAna::analyze(), rwgt::ReweightAna::analyze(), caldata::CalWireAna::analyze(), shower::TCShowerTemplateMaker::analyze(), opdet::FIFOHistogramAna::analyze(), opdet::TrackTimeAssocAna::analyze(), shower::TCShowerElectronLikelihood::analyze(), shower::TCShowerAnalysis::analyze(), opdet::OpDigiAna::analyze(), opdet::OpFlashAna::analyze(), microboone::CosmicRemovalAna::analyze(), detsim::SimWireAna::analyze(), larg::LArSimChannelAna::analyze(), opdet::FlashPurityCheckAna::analyze(), opdet::LEDCalibrationAna::analyze(), pfpf::PFPAna::analyze(), trkf::SpacePointAna::analyze(), cluster::ClusterAna::analyze(), hit::MagDriftAna::analyze(), detsim::WienerFilterAna::analyze(), cluster::DBclusterAna::analyze(), hit::GausHitFinderAna::analyze(), hit::HitFinderAna::analyze(), cluster::HoughLineFinderAna::analyze(), NuShowerEff::analyze(), opdet::SimPhotonCounter::analyze(), vertex::FeatureVertexFinderAna::analyze(), ems::MultiEMShowers::analyze(), lar::example::AnalysisExample::analyze(), trkf::SeedAna::analyze(), trkf::TrackAna::analyze(), ClusteringValidation::ClusteringValidation::analyze(), trkf::TrackAna::anaStitch(), lar_pandora::LArPandoraHelper::BuildMCParticleHitMaps(), evd::AnalysisBaseDrawer::CalorShower(), evd::HitSelector::ChangeHit(), lar_cluster3d::StandardHit3DBuilder::CollectArtHits(), lar_pandora::LArPandoraHelper::CollectClusters(), lar_pandora::LArPandoraHelper::CollectCosmicTags(), lar_pandora::LArPandoraHelper::CollectGeneratorMCParticles(), lar_pandora::LArPandoraHelper::CollectHits(), lar_pandora::LArPandoraHelper::CollectMCParticles(), lar_pandora::LArPandoraHelper::CollectPFParticleMetadata(), lar_pandora::LArPandoraExternalEventBuilding::CollectPFParticles(), lar_pandora::LArPandoraHelper::CollectPFParticles(), lar_pandora::LArPandoraHelper::CollectSeeds(), ems::EMShower3D::CollectShower2D(), lar_pandora::LArPandoraHelper::CollectShowers(), ems::MergeEMShower3D::collectshowers(), lar_pandora::LArPandoraHelper::CollectSimChannels(), lar_pandora::LArPandoraHelper::CollectSpacePoints(), lar_pandora::LArPandoraHelper::CollectT0s(), lar_pandora::LArPandoraHelper::CollectTracks(), lar_pandora::LArPandoraHelper::CollectVertices(), lar_pandora::LArPandoraHelper::CollectWires(), ems::MultiEMShowers::convCluster(), t0::IndirectHitParticleAssns::CreateHitParticleAssociations(), t0::DirectHitParticleAssns::CreateHitParticleAssociations(), evd::AnalysisBaseDrawer::DrawDeDx(), evd::AnalysisBaseDrawer::DrawKineticEnergy(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), art::Run::endTime(), art::SubRun::endTime(), filt::LArG4ParticleFilter::filter(), simfilter::FilterNoMCParticles::filter(), filt::FinalStateParticleFilter::filter(), filt::FinalStateSelectFilter::filter(), simfilter::FilterSimPhotonTime::filter(), cluster::SmallClusterFilter::filter(), filt::EmptyFilter::filter(), simfilter::FilterNoDirtNeutrinos::filter(), simfilter::FilterStoppingMuon::filter(), filter::MuonFilter::filter(), trkf::StitchAlg::FindHeadsAndTails(), anab::FVectorReader< T, N >::FVectorReader(), trkf::Track3DKalmanHit::getAllHits(), lar_pandora::LArPandoraHelper::GetAssociatedHits(), evd::RecoBaseDrawer::GetBezierTracks(), art::DataViewImpl::getByLabel(), art::DataViewImpl::getByToken(), trkf::Track3DKalmanHit::getClusteredHits(), evd::RecoBaseDrawer::GetClusters(), lar_pandora::LArPandoraEvent::GetCollection(), ShowerQuality::GetDataOrDie(), evd::RecoBaseDrawer::GetEdges(), evd::RecoBaseDrawer::GetEndPoint2D(), evd::RecoBaseDrawer::GetEvents(), lar_pandora::LArPandoraEvent::GetFilteredParticlesByCRTag(), ems::MergeEMShower3D::getGammaId(), trkf::BezierTrackerModule::GetHitsFromClusters(), trkf::SeedFinderModule::GetHitsFromEvent(), evd::RecoBaseDrawer::GetOpFlashes(), evd::RecoBaseDrawer::GetPFParticles(), trkf::Track3DKalmanHit::getPFParticleStuff(), art::DataViewImpl::getPointerByLabel(), evd::RecoBaseDrawer::GetSeeds(), shower::TCShower::getShowersWithoutSlices(), shower::TCShower::getShowersWithSlices(), sim::SimListUtils::GetSimPhotonsCollection(), evd::RecoBaseDrawer::GetSlices(), trkf::SeedFinderModule::GetSortedHitsFromClusters(), evd::RecoBaseDrawer::GetSpacePoints(), art::DataViewImpl::getValidHandle(), evd::RecoBaseDrawer::GetVertices(), evwgh::GenieWeightCalc::GetWeight(), evd::RecoBaseDrawer::GetWires(), lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), lar_pandora::LArPandoraEventDump::PandoraData::LoadCollection(), ems::MergeEMShower3D::mcinfo(), evgb::MCTruthAndFriendsItr::MCTruthAndFriendsItr(), mvapid::MVAAlg::PrepareEvent(), wc::CellTree::processCalib(), DUNE::NeutrinoShowerEff::processEff(), DUNE::NeutrinoTrackingEff::processEff(), DUNE::MuonTrackingEff::processEff(), wc::CellTree::processMC(), wc::CellTree::processOpFlash(), wc::CellTree::processOpHit(), wc::CellTree::processRaw(), wc::CellTree::processTrigger(), event::EventMaker::produce(), MCReco::produce(), opdet::FlashClusterMatch::produce(), hit::DisambigCheater::produce(), hit::MCHitFinder::produce(), hit::TTHitFinder::produce(), trk::TrackContainmentTagger::produce(), vertex::VertexCheater::produce(), cluster::SimpleClusterMerger::produce(), opdet::OpMCDigi::produce(), vertex::CornerFinder::produce(), hit::RFFHitFinder::produce(), event::EventCheater::produce(), shwf::ShowerCheater::produce(), apa::APAHitFinder::produce(), opdet::TrackTimeAssoc::produce(), opdet::BeamFlashCompatabilityCheck::produce(), trkf::SpacePointCheater::produce(), trkf::SpacePointFinder::produce(), sim::MergeSimSources::produce(), sppt::TTSpacePointFinder::produce(), trkf::BezierTrackerModule::produce(), spacecharge::ShiftEdepSCE::produce(), noisefilteralg::WireCellNoiseFilter::produce(), trkf::TrackCheater::produce(), opdet::OpticalRawDigitReformatter::produce(), calo::BezierCalorimetry::produce(), pid::Chi2ParticleID::produce(), cluster::ClusterCheater::produce(), hit::FFTHitFinder::produce(), cosmic::BeamFlashTrackMatchTagger::produce(), evwgh::EventWeight::produce(), calo::TrackCalorimetry::produce(), caldata::CalWire::produce(), trkf::FeatureTracker::produce(), opdet::OpFlashFinder::produce(), vertex::AggregateVertex::produce(), CRHitRemoval::produce(), cluster::TrajCluster::produce(), cluster::DBcluster::produce(), cosmic::TrackPFParticleMatch::produce(), cluster::FuzzyClusterMerger::produce(), ShowerReco3D::produce(), caldata::CalWireT962::produce(), cluster::BlurredClustering::produce(), cluster::LineMerger::produce(), cluster::fuzzyCluster::produce(), trkf::SpacePts::produce(), cosmic::CosmicPFParticleTagger::produce(), shower::EMShower::produce(), event::AggregateEvent::produce(), shower::TCShower::produce(), cosmic::CosmicTrackTagger::produce(), trkf::Track3Dreco::produce(), vertex::VertexMatch::produce(), trkf::TrackKalmanCheater::produce(), shwf::ShowerFinder::produce(), cosmic::CosmicPCAxisTagger::produce(), t0::MCParticleShowerMatching::produce(), cosmic::CosmicClusterTagger::produce(), t0::MCParticleTrackMatching::produce(), hit::RawHitFinder::produce(), opdet::OpHitFinder::produce(), reco3d::SpacePointSolver::produce(), trkf::CCTrackMaker::produce(), trkf::MCSFitProducer::produce(), vertex::PrimaryVertexFinder::produce(), cluster::SmallClusterFinder::produce(), vertex::HarrisVertexFinder::produce(), cluster::EndPointModule::produce(), hit::GausHitFinder::produce(), trkf::TrackStitcher::produce(), ems::EMShower3D::produce(), CRHitRemovalByPCA::produce(), cluster::HoughLineFinder::produce(), calo::Calorimetry::produce(), hit::DPRawHitFinder::produce(), vertex::VertexFinder2D::produce(), shwf::ShowerReco::produce(), trkf::Track3DKalman::produce(), lbne::PhotonCounterT0Matching::produce(), trkf::PMAlgTrajFitter::produce(), trkf::Track3DKalmanSPS::produce(), detsim::SimDriftElectrons::produce(), t0::MCTruthT0Matching::produce(), vertex::FeatureVertexFinder::produce(), trkf::KalmanFilterTrajectoryFitter::produce(), trkf::CosmicTracker::produce(), larg4::LArG4::produce(), ems::MergeEMShower3D::produce(), put(), evd::details::RawDigitCacheDataClass::ReadProduct(), evd::InfoTransfer::Rebuild(), cheat::PhotonBackTracker::Rebuild(), evd::HitSelector::SaveHits(), evd::HitSelector::SaveSeedLines(), cluster::ClusterMergeHelper::SetClusters(), nnet::TrainingDataAlg::setDataEventData(), tss::TrackShowerHits::sortHits(), and evd::details::RawDigitCacheDataClass::Update().

347 {
348  return getByLabel<PROD>(label, productInstanceName, {}, result);
349 }
template<typename PROD >
bool art::DataViewImpl::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
std::string const &  processName,
Handle< PROD > &  result 
) const
inlineinherited

Definition at line 353 of file DataViewImpl.h.

References art::DataViewImpl::branchType_, art::Handle< T >::clear(), art::DataViewImpl::consumer_, art::convert_handle(), art::Handle< T >::failedToGet(), art::DataViewImpl::getByLabel_(), art::ProductInfo::Product, art::Handle< T >::provenance(), art::DataViewImpl::recordAsParent(), art::DataViewImpl::recordParents_, and art::GroupQueryResult::succeeded().

357 {
358  result.clear(); // Is this the correct thing to do if an exception is thrown?
359  auto const wrapped = WrappedTypeID::make<PROD>();
360  ProductInfo const pinfo{ProductInfo::ConsumableType::Product,
361  wrapped.product_type,
362  label,
363  productInstanceName,
364  processName};
365  consumer_->validateConsumedProduct(branchType_, pinfo);
366  GroupQueryResult bh =
367  getByLabel_(wrapped, label, productInstanceName, processName);
368  convert_handle(bh, result);
369  bool const ok{bh.succeeded() && !result.failedToGet()};
370  if (recordParents_ && ok) {
371  recordAsParent(*result.provenance());
372  }
373  return ok;
374 }
void recordAsParent(Provenance const &prov) const
Definition: DataViewImpl.cc:87
BranchType const branchType_
Definition: DataViewImpl.h:283
cet::exempt_ptr< Consumer > consumer_
Definition: DataViewImpl.h:291
void convert_handle(GroupQueryResult const &, Handle< T > &)
Definition: Handle.h:249
GroupQueryResult getByLabel_(WrappedTypeID const &wrapped, std::string const &label, std::string const &productInstanceName, std::string const &processName) const
Definition: DataViewImpl.cc:60
bool const recordParents_
Definition: DataViewImpl.h:286
template<typename PROD >
PROD const & art::DataViewImpl::getByLabel ( InputTag const &  tag) const
inlineinherited

same as above, but using the InputTag class

Definition at line 378 of file DataViewImpl.h.

References art::DataViewImpl::getByLabel().

379 {
380  Handle<PROD> h;
381  getByLabel(tag, h);
382  return *h;
383 }
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
template<typename PROD >
bool art::DataViewImpl::getByLabel ( InputTag const &  tag,
Handle< PROD > &  result 
) const
inlineinherited

Definition at line 337 of file DataViewImpl.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

338 {
339  return getByLabel<PROD>(tag.label(), tag.instance(), tag.process(), result);
340 }
template<typename PROD >
bool art::DataViewImpl::getByToken ( ProductToken< PROD > const &  token,
Handle< PROD > &  result 
) const
inlineinherited

Definition at line 387 of file DataViewImpl.h.

References art::DataViewImpl::getByLabel(), and art::ProductToken< T >::inputTag_.

Referenced by art::Run::endTime(), art::SubRun::endTime(), and put().

389 {
390  auto const& tag = token.inputTag_;
391  return getByLabel(tag.label(), tag.instance(), tag.process(), result);
392 }
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
template<typename PROD >
void art::DataViewImpl::getMany ( SelectorBase const &  sel,
std::vector< Handle< PROD >> &  results 
) const
inlineinherited

Definition at line 421 of file DataViewImpl.h.

References art::DataViewImpl::branchType_, art::DataViewImpl::consumer_, art::convert_handle(), art::DataViewImpl::getMany_(), art::ProductInfo::Many, art::DataViewImpl::recordAsParent(), and art::DataViewImpl::recordParents_.

Referenced by art::Run::endTime(), art::SubRun::endTime(), art::DataViewImpl::getManyByType(), and put().

423 {
424  auto const wrapped = WrappedTypeID::make<PROD>();
425  consumer_->validateConsumedProduct(
426  branchType_,
427  ProductInfo{ProductInfo::ConsumableType::Many, wrapped.product_type});
428 
429  std::vector<Handle<PROD>> products;
430  for (auto const& qr : getMany_(wrapped, sel)) {
431  Handle<PROD> result;
432  convert_handle(qr, result);
433  products.push_back(result);
434  }
435  results.swap(products);
436 
437  if (!recordParents_)
438  return;
439 
440  for (auto const& h : results)
441  recordAsParent(*h.provenance());
442 }
void recordAsParent(Provenance const &prov) const
Definition: DataViewImpl.cc:87
BranchType const branchType_
Definition: DataViewImpl.h:283
cet::exempt_ptr< Consumer > consumer_
Definition: DataViewImpl.h:291
void convert_handle(GroupQueryResult const &, Handle< T > &)
Definition: Handle.h:249
GroupQueryResultVec getMany_(WrappedTypeID const &wrapped, SelectorBase const &sel) const
Definition: DataViewImpl.cc:53
bool const recordParents_
Definition: DataViewImpl.h:286
template<typename PROD >
PROD const * art::DataViewImpl::getPointerByLabel ( InputTag const &  tag) const
inlineinherited

Definition at line 396 of file DataViewImpl.h.

References art::DataViewImpl::getByLabel().

Referenced by art::Run::endTime(), art::SubRun::endTime(), and put().

397 {
398  Handle<PROD> h;
399  getByLabel(tag, h);
400  return &(*h);
401 }
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
bool art::Event::getProcessParameterSet ( std::string const &  processName,
fhicl::ParameterSet ps 
) const

Definition at line 98 of file Event.cc.

References art::thread_safe_registry_via_id< K, M >::get(), art::ProcessHistory::getConfigurationForProcess(), id(), art::errors::NotFound, art::ProcessConfiguration::parameterSetID(), and processHistoryID().

Referenced by put().

100  {
101  // Get the ProcessHistory for this event.
102  ProcessHistory ph;
105  << "ProcessHistoryID " << processHistoryID()
106  << " is claimed to describe " << id()
107  << "\nbut is not found in the ProcessHistoryRegistry.\n"
108  "This file is malformed.\n";
109  }
110 
111  ProcessConfiguration config;
112  bool const process_found{
113  ph.getConfigurationForProcess(processName, config)};
114  if (process_found) {
115  ParameterSetRegistry::get(config.parameterSetID(), ps);
116  }
117  return process_found;
118  }
static collection_type const & get()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
ProcessHistoryID const & processHistoryID() const
Definition: Event.cc:92
EventID id() const
Definition: Event.h:56
BranchDescription const & art::DataViewImpl::getProductDescription ( TypeID const &  type,
std::string const &  productInstanceName 
) const
protectedinherited

Definition at line 142 of file DataViewImpl.cc.

References art::DataViewImpl::branchType_, art::get_ProductDescription(), art::ProductMetaData::instance(), art::DataViewImpl::md_, art::ModuleDescription::moduleLabel(), art::ModuleDescription::processName(), and art::ProductMetaData::productList().

Referenced by art::DataViewImpl::checkPutProducts(), art::Results::put(), put(), art::Run::put_(), art::SubRun::put_(), and art::DataViewImpl::retrievedProducts().

144  {
145  return get_ProductDescription(type,
146  md_.processName(),
148  branchType_,
149  md_.moduleLabel(),
150  productInstanceName);
151  }
BranchDescription const & get_ProductDescription(BranchType branch_type, std::string const &module_label, std::string const &instance_name)
BranchType const branchType_
Definition: DataViewImpl.h:283
static ProductMetaData const & instance()
ModuleDescription const & md_
Definition: DataViewImpl.h:280
std::string const & processName() const
std::string const & moduleLabel() const
ProductList const & productList() const
Run const & art::Event::getRun ( ) const

Definition at line 80 of file Event.cc.

References art::SubRun::getRun(), and getSubRun().

Referenced by experimentType().

81  {
82  return getSubRun().getRun();
83  }
Run const & getRun() const
Definition: SubRun.cc:32
SubRun const & getSubRun() const
Definition: Event.cc:70
SubRun const & art::Event::getSubRun ( ) const

Definition at line 70 of file Event.cc.

References art::errors::NullPointerError, and subRun_.

Referenced by experimentType(), and getRun().

71  {
72  if (!subRun_) {
74  << "Tried to obtain a NULL subRun.\n";
75  }
76  return *subRun_;
77  }
std::unique_ptr< SubRun const > const subRun_
Definition: Event.h:152
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
template<typename PROD >
ValidHandle<PROD> art::DataViewImpl::getValidHandle ( ProductToken< PROD > const &  token) const
inherited
template<typename PROD >
art::ValidHandle<PROD> art::DataViewImpl::getValidHandle ( InputTag const &  tag) const
inlineinherited

Definition at line 405 of file DataViewImpl.h.

References art::DataViewImpl::getByLabel(), and art::ValidHandle< T >::provenance().

406 {
407  Handle<PROD> h;
408  getByLabel(tag, h);
409  return ValidHandle<PROD>(&(*h), *h.provenance());
410 }
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
template<typename PROD >
art::ValidHandle<PROD> art::DataViewImpl::getValidHandle ( ProductToken< PROD > const &  token) const
inlineinherited

Definition at line 414 of file DataViewImpl.h.

References art::ProductToken< T >::inputTag_.

415 {
416  return getValidHandle<PROD>(token.inputTag_);
417 }
template<typename ELEMENT >
std::size_t art::DataViewImpl::getView ( std::string const &  moduleLabel,
std::string const &  productInstanceName,
std::vector< ELEMENT const * > &  result 
) const
inherited
template<typename ELEMENT >
std::size_t art::DataViewImpl::getView ( InputTag const &  tag,
std::vector< ELEMENT const * > &  result 
) const
inherited

Definition at line 486 of file DataViewImpl.h.

References art::DataViewImpl::fillView_(), art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

488 {
489  auto bhv = getView_<ELEMENT>(tag.label(), tag.instance(), tag.process());
490  std::size_t const orig_size = result.size();
491  fillView_(bhv[0], result);
492  return result.size() - orig_size;
493 } // getView<>()
void fillView_(GroupQueryResult &bh, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:531
template<typename ELEMENT >
std::size_t art::DataViewImpl::getView ( ViewToken< ELEMENT > const &  token,
std::vector< ELEMENT const * > &  result 
) const
inherited
template<typename ELEMENT >
bool art::DataViewImpl::getView ( std::string const &  moduleLabel,
std::string const &  instanceName,
View< ELEMENT > &  result 
) const
inherited

Definition at line 497 of file DataViewImpl.h.

References art::DataViewImpl::fillView_(), art::View< T >::set_innards(), and art::View< T >::vals().

500 {
501  auto bhv = getView_<ELEMENT>(moduleLabel, productInstanceName, {});
502  fillView_(bhv[0], result.vals());
503  result.set_innards(bhv[0].result()->productID(),
504  bhv[0].result()->uniqueProduct());
505  return true;
506 }
void fillView_(GroupQueryResult &bh, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:531
template<typename ELEMENT >
bool art::DataViewImpl::getView ( InputTag const &  tag,
View< ELEMENT > &  result 
) const
inherited

Definition at line 510 of file DataViewImpl.h.

References art::DataViewImpl::fillView_(), art::InputTag::instance(), art::InputTag::label(), art::InputTag::process(), art::View< T >::set_innards(), and art::View< T >::vals().

511 {
512  auto bhv = getView_<ELEMENT>(tag.label(), tag.instance(), tag.process());
513  fillView_(bhv[0], result.vals());
514  result.set_innards(bhv[0].result()->productID(),
515  bhv[0].result()->uniqueProduct());
516  return true;
517 }
void fillView_(GroupQueryResult &bh, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:531
template<typename ELEMENT >
bool art::DataViewImpl::getView ( ViewToken< ELEMENT > const &  tag,
View< ELEMENT > &  result 
) const
inherited

Definition at line 521 of file DataViewImpl.h.

References art::DataViewImpl::getView(), and art::ViewToken< Element >::inputTag_.

523 {
524  return getView(token.inputTag_, result);
525 }
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:474
template<typename ELEMENT >
art::DataViewImpl::GroupQueryResultVec art::DataViewImpl::getView_ ( std::string const &  moduleLabel,
std::string const &  productInstanceName,
std::string const &  processName 
) const
inherited

Definition at line 453 of file DataViewImpl.h.

References art::DataViewImpl::branchType_, art::DataViewImpl::consumer_, art::DataViewImpl::ensureUniqueProduct_(), art::DataViewImpl::getMatchingSequenceByLabel_(), art::DataViewImpl::removeNonViewableMatches_(), and art::ProductInfo::ViewElement.

456 {
457  TypeID const typeID{typeid(ELEMENT)};
458  ProductInfo const pinfo{ProductInfo::ConsumableType::ViewElement,
459  typeID,
460  moduleLabel,
461  productInstanceName,
462  processName};
463  consumer_->validateConsumedProduct(branchType_, pinfo);
464  auto bhv =
465  getMatchingSequenceByLabel_(moduleLabel, productInstanceName, processName);
466  removeNonViewableMatches_(typeID, bhv);
468  bhv.size(), typeID, moduleLabel, productInstanceName, processName);
469  return bhv;
470 } // getView_<>()
void ensureUniqueProduct_(std::size_t nFound, TypeID const &typeID, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName) const
BranchType const branchType_
Definition: DataViewImpl.h:283
cet::exempt_ptr< Consumer > consumer_
Definition: DataViewImpl.h:291
void removeNonViewableMatches_(TypeID const &requestedElementType, GroupQueryResultVec &results) const
GroupQueryResultVec getMatchingSequenceByLabel_(std::string const &label, std::string const &productInstanceName, std::string const &processName) const
Definition: DataViewImpl.cc:70
History const & art::Event::history ( ) const

Definition at line 86 of file Event.cc.

References eventPrincipal_, and art::EventPrincipal::history().

Referenced by experimentType().

87  {
88  return eventPrincipal_.history();
89  }
History const & history() const
EventPrincipal const & eventPrincipal_
Definition: Event.h:153
EventID art::Event::id ( ) const
inline

Definition at line 56 of file Event.h.

References aux_, and art::EventAuxiliary::id().

Referenced by lar_pandora::PFParticleTrackAna::analyze(), opdet::OpHitAna::analyze(), lar_pandora::PFParticleCosmicAna::analyze(), opdet::OpFlashMCTruthAna::analyze(), lar_pandora::PFParticleAnalysis::analyze(), lar_pandora::PFParticleHitDumper::analyze(), lar_pandora::PFParticleMonitoring::analyze(), cheat::RecoCheckAna::analyze(), opdet::FlashHypothesisAna::analyze(), opreco::OpticalRecoAna::analyze(), recob::DumpVertices::analyze(), hit::HitAnaModule::analyze(), opdet::TrackTimeAssocAna::analyze(), opdet::OpDigiAna::analyze(), shower::TCShowerAnalysis::analyze(), opdet::OpFlashAna::analyze(), larg4::LArG4Ana::analyze(), opdet::FlashPurityCheckAna::analyze(), cluster::ClusterAna::analyze(), pfpf::PFPAna::analyze(), cluster::DBclusterAna::analyze(), hit::GausHitFinderAna::analyze(), hit::HitFinderAna::analyze(), cluster::HoughLineFinderAna::analyze(), NuShowerEff::analyze(), recob::DumpSeeds::analyze(), opdet::SimPhotonCounter::analyze(), vertex::FeatureVertexFinderAna::analyze(), detsim::DumpRawDigits::analyze(), caldata::DumpWires::analyze(), recob::DumpPFParticles::analyze(), ems::MultiEMShowers::analyze(), evd::HitSelector::ChangeHit(), evd::GraphClusterAlg::CheckValidity(), t0::IndirectHitParticleAssns::CreateHitParticleAssociations(), util::EventChangeTracker_t::EventChangeTracker_t(), filter::EventFilter::filter(), filt::EmptyFilter::filter(), art::EventIDFilter::filter(), getProcessParameterSet(), evd::HeaderDrawer::Header(), evdb::DisplayWindow::OpenWindow(), art::TimeTracker::postEventReading(), evd::LandedSocket::postProcessEvent(), evdb::EventDisplay::postProcessEvent(), art::Tracer::preEvent(), lar_cluster3d::Cluster3D::PrepareEvent(), evdb::EventDisplay::preProcessEvent(), opdet::BoDataFrameInput::produce(), mvapid::MVAPID::produce(), wc::MergeWireCell::produce(), evgen::NUANCEGen::produce(), evgen::NDKGen::produce(), vertex::PrimaryVertexFinder::produce(), vertex::HarrisVertexFinder::produce(), shwf::ShowerReco::produce(), trkf::Track3DKalman::produce(), trkf::Track3DKalmanSPS::produce(), lar::example::TotallyCheatTracker::produce(), lar_cluster3d::Cluster3D::produce(), larg4::LArG4::produce(), ems::MergeEMShower3D::produce(), evd::InfoTransfer::Rebuild(), evdb::ScanFrame::Record(), art::MemoryTracker::recordEventData(), run(), evd::HitSelector::SaveHits(), evd::HitSelector::SaveSeedLines(), rndm::NuRandomServiceHelper::ArtState::set_event(), and art::TFileService::TFileService().

57  {
58  return aux_.id();
59  }
EventAuxiliary const & aux_
Definition: Event.h:151
EventID const & id() const
bool art::Event::isRealData ( ) const
inline

Definition at line 83 of file Event.h.

References aux_, and art::EventAuxiliary::isRealData().

Referenced by lar_pandora::PFParticleMonitoring::analyze(), cheat::RecoCheckAna::analyze(), opreco::OpticalRecoAna::analyze(), larg::LArSimChannelAna::analyze(), trkf::SpacePointAna::analyze(), hit::MagDriftAna::analyze(), DUNE::NeutrinoTrackingEff::analyze(), cluster::DBclusterAna::analyze(), DUNE::MuonTrackingEff::analyze(), hit::HitFinderAna::analyze(), trkf::SeedAna::analyze(), trkf::TrackAna::analyze(), trkf::TrackAna::anaStitch(), lar_pandora::LArPandoraHelper::CollectGeneratorMCParticles(), lar_pandora::LArPandoraHelper::CollectMCParticles(), lar_pandora::LArPandoraHelper::CollectSimChannels(), lar_pandora::LArPandora::CreatePandoraInput(), evd::SimulationDrawer::GetMCTruth(), evd::SimulationDrawer::GetParticle(), evd::SimulationDrawer::MCTruth3D(), evd::SimulationDrawer::MCTruthLongText(), evd::SimulationDrawer::MCTruthOrtho(), evd::SimulationDrawer::MCTruthShortText(), evd::SimulationDrawer::MCTruthVectors2D(), caldata::CalWire::produce(), cluster::TrajCluster::produce(), caldata::CalWireT962::produce(), t0::MCParticleHitMatching::produce(), t0::MCParticleTrackMatching::produce(), t0::MCParticleShowerMatching::produce(), trkf::Track3DKalman::produce(), trkf::Track3DKalmanSPS::produce(), t0::MCTruthT0Matching::produce(), cheat::PhotonBackTracker::Rebuild(), rndm::NuRandomServiceHelper::ArtState::set_event(), and nnet::TrainingDataAlg::setEventData().

84  {
85  return aux_.isRealData();
86  }
bool isRealData() const
EventAuxiliary const & aux_
Definition: Event.h:151
ProcessHistory const & art::DataViewImpl::processHistory ( ) const
inherited

Definition at line 81 of file DataViewImpl.cc.

References art::DataViewImpl::principal_, and art::Principal::processHistory().

Referenced by art::Run::endTime(), art::SubRun::endTime(), and put().

82  {
83  return principal_.processHistory();
84  }
Principal const & principal_
Definition: DataViewImpl.h:276
ProcessHistory const & processHistory() const
Definition: Principal.h:132
ProcessHistoryID const & art::Event::processHistoryID ( ) const

Definition at line 92 of file Event.cc.

References eventPrincipal_, art::EventPrincipal::history(), and art::History::processHistoryID().

Referenced by experimentType(), and getProcessParameterSet().

93  {
95  }
ProcessHistoryID const & processHistoryID() const
Definition: History.h:42
History const & history() const
EventPrincipal const & eventPrincipal_
Definition: Event.h:153
template<typename PROD >
ProductID art::Event::put ( std::unique_ptr< PROD > &&  product)
inline

Definition at line 102 of file Event.h.

References art::DataViewImpl::checkPutProducts(), commit(), art::DataViewImpl::get(), art::DataViewImpl::getByLabel(), art::DataViewImpl::getByToken(), art::DataViewImpl::getMany(), art::DataViewImpl::getManyByType(), art::DataViewImpl::getPointerByLabel(), getProcessParameterSet(), art::DataViewImpl::getValidHandle(), art::DataViewImpl::getView(), art::DataViewImpl::processHistory(), productGetter(), art::DataViewImpl::removeCachedProduct(), and art::DataViewImpl::size().

Referenced by simfilter::FilterGenInTime::filter(), art::MixOp< PROD, OPROD >::mixAndPut(), lar_cluster3d::Cluster3D::ArtOutputHandler::outputObjects(), event::EventMaker::produce(), opdet::BoDataFrameInput::produce(), MCReco::produce(), lar_pandora::LArPandoraTrackCreation::produce(), opdet::FlashClusterMatch::produce(), art::TriggerResultInserter::produce(), lar_pandora::LArPandoraShowerCreation::produce(), hit::MCHitFinder::produce(), mvapid::MVAPID::produce(), trkf::SeedFinderModule::produce(), trk::TrackContainmentTagger::produce(), vertex::VertexCheater::produce(), opdet::OpMCDigi::produce(), trkf::TCTrack::produce(), art::RandomNumberSaver::produce(), cluster::SimpleClusterMerger::produce(), ToyOneShowerGen::produce(), vertex::CornerFinder::produce(), shwf::ShowerCheater::produce(), event::EventCheater::produce(), sppt::TTSpacePointFinder::produce(), trkf::SpacePointCheater::produce(), trkf::SpacePointFinder::produce(), cluster::LineCluster::produce(), opdet::BeamFlashCompatabilityCheck::produce(), tss::TrackShowerHits::produce(), sim::MergeSimSources::produce(), trkf::BezierTrackerModule::produce(), spacecharge::ShiftEdepSCE::produce(), cluster::SimpleLineCluster::produce(), noisefilteralg::WireCellNoiseFilter::produce(), opdet::OpticalRawDigitReformatter::produce(), trkf::TrackCheater::produce(), opdet::OptDetDigitizer::produce(), calo::BezierCalorimetry::produce(), pid::Chi2ParticleID::produce(), cluster::ClusterCheater::produce(), evgen::CosmicsGen::produce(), cosmic::BeamFlashTrackMatchTagger::produce(), calo::TrackCalorimetry::produce(), TrackProducerFromTrack::produce(), evwgh::EventWeight::produce(), opdet::OpFlashFinder::produce(), trkf::FeatureTracker::produce(), cluster::DBCluster3D::produce(), TrackProducerFromTrackTrajectory::produce(), vertex::AggregateVertex::produce(), wc::MergeWireCell::produce(), evgen::CORSIKAGen::produce(), caldata::CalWire::produce(), cluster::TrajCluster::produce(), caldata::CalWireT962::produce(), ShowerReco3D::produce(), cluster::DBcluster::produce(), cosmic::TrackPFParticleMatch::produce(), t0::MCParticleHitMatching::produce(), cluster::FuzzyClusterMerger::produce(), cluster::BlurredClustering::produce(), cluster::LineMerger::produce(), evgen::FileMuons::produce(), cluster::ClusterCrawler::produce(), cluster::fuzzyCluster::produce(), trkf::SpacePts::produce(), cosmic::CosmicPFParticleTagger::produce(), evgen::NUANCEGen::produce(), shower::EMShower::produce(), shower::TCShower::produce(), cosmic::CosmicTrackTagger::produce(), trkf::TrackKalmanCheater::produce(), trkf::Track3Dreco::produce(), vertex::VertexMatch::produce(), evgen::NucleonDecay::produce(), shwf::ShowerFinder::produce(), cosmic::CosmicPCAxisTagger::produce(), cosmic::CosmicClusterTagger::produce(), t0::MCParticleShowerMatching::produce(), t0::MCParticleTrackMatching::produce(), opdet::OpHitFinder::produce(), evgen::NDKGen::produce(), reco3d::SpacePointSolver::produce(), trkf::CCTrackMaker::produce(), trkf::MCSFitProducer::produce(), vertex::PrimaryVertexFinder::produce(), vertex::HarrisVertexFinder::produce(), cluster::SmallClusterFinder::produce(), cluster::EndPointModule::produce(), trkf::TrackStitcher::produce(), trkf::Track3DKalmanHit::produce(), ems::EMShower3D::produce(), CRHitRemovalByPCA::produce(), evgen::GaisserParam::produce(), evgen::MarleyGen::produce(), cluster::HoughLineFinder::produce(), evgen::TextFileGen::produce(), calo::Calorimetry::produce(), detsim::SimWire::produce(), evgen::NeutronOsc::produce(), vertex::VertexFinder2D::produce(), shwf::ShowerReco::produce(), trkf::Track3DKalman::produce(), evgen::GENIEGen::produce(), lbne::PhotonCounterT0Matching::produce(), trkf::PMAlgTrajFitter::produce(), evgen::RadioGen::produce(), trkf::Track3DKalmanSPS::produce(), t0::MCTruthT0Matching::produce(), evgen::LightSource::produce(), vertex::FeatureVertexFinder::produce(), evd::GraphCluster::produce(), trkf::KalmanFilterTrajectoryFitter::produce(), trkf::PMAlgTrackMaker::produce(), phot::PhotonLibraryPropagation::produce(), trkf::KalmanFilterFinalTrackFitter::produce(), trkf::CosmicTracker::produce(), evgen::MUSUN::produce(), evgen::MarleyTimeGen::produce(), evgen::SingleGen::produce(), larg4::LArG4::produce(), ems::MergeEMShower3D::produce(), lar_pandora::LArPandoraOutput::ProduceArtOutput(), recob::ChargedSpacePointCollectionCreator::put(), anab::FVectorWriter< N >::saveOutputs(), opdet::TrackTimeAssoc::StoreFlashMatches(), lar_pandora::LArPandoraEvent::WriteAssociation(), and lar_pandora::LArPandoraEvent::WriteCollection().

103  {
104  return put<PROD>(std::move(product), std::string());
105  }
template<typename PROD >
ProductID art::Event::put ( std::unique_ptr< PROD > &&  product,
std::string const &  productInstanceName 
)
template<typename PROD >
art::ProductID art::Event::put ( std::unique_ptr< PROD > &&  product,
std::string const &  productInstanceName 
)

Definition at line 160 of file Event.h.

References art::DataViewImpl::getProductDescription(), art::RangeSet::invalid(), art::errors::NullPointerError, art::errors::ProductPutFailure, and art::DataViewImpl::putProducts().

162 {
163  TypeID const tid{typeid(PROD)};
164  if (product.get() == nullptr) {
166  << "Event::put: A null unique_ptr was passed to 'put'.\n"
167  << "The pointer is of type " << tid << ".\n"
168  << "The specified productInstanceName was '" << productInstanceName
169  << "'.\n";
170  }
171 
172  auto const& pd = getProductDescription(tid, productInstanceName);
173  auto wp = std::make_unique<Wrapper<PROD>>(std::move(product));
174 
175  auto result = putProducts().emplace(
176  TypeLabel{
177  tid, productInstanceName, SupportsView<PROD>::value, false /*not used*/},
178  DataViewImpl::PMValue{std::move(wp), pd, RangeSet::invalid()});
179  if (!result.second) {
180  cet::HorizontalRule rule{30};
182  << "Event::put: Attempt to put multiple products with the\n"
183  << " following description onto the Event.\n"
184  << " Products must be unique per Event.\n"
185  << rule('=') << '\n'
186  << pd << rule('=') << '\n';
187  }
188 
189  return pd.productID();
190 } // put<>()
BranchDescription const & getProductDescription(TypeID const &type, std::string const &productInstanceName) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::string value(boost::any const &)
static RangeSet invalid()
Definition: RangeSet.cc:46
TypeLabelMap & putProducts()
Definition: DataViewImpl.h:183
TypeLabelMap& art::DataViewImpl::putProducts ( )
inlineprotectedinherited
TypeLabelMap const& art::DataViewImpl::putProducts ( ) const
inlineprotectedinherited

Definition at line 188 of file DataViewImpl.h.

References art::DataViewImpl::putProducts_.

189  {
190  return putProducts_;
191  }
TypeLabelMap putProducts_
Definition: DataViewImpl.h:266
void art::DataViewImpl::recordAsParent ( Provenance const &  prov) const
protectedinherited

Definition at line 87 of file DataViewImpl.cc.

References art::Provenance::parents(), art::Provenance::productDescription(), art::Provenance::productID(), art::DataViewImpl::retrievedProducts_, and art::BranchDescription::transient().

Referenced by art::DataViewImpl::fillView_(), art::DataViewImpl::get(), art::DataViewImpl::getByLabel(), and art::DataViewImpl::getMany().

88  {
89  if (prov.productDescription().transient()) {
90  // If the product retrieved is transient, don't use its
91  // ProductID; use the ProductID's of its parents.
92  auto const& parents = prov.parents();
93  retrievedProducts_.insert(cbegin(parents), cend(parents));
94  } else {
95  retrievedProducts_.insert(prov.productID());
96  }
97  }
RetrievedProductSet retrievedProducts_
Definition: DataViewImpl.h:272
template<typename PROD >
bool art::DataViewImpl::removeCachedProduct ( Handle< PROD > &  h) const
inherited

Definition at line 551 of file DataViewImpl.h.

References art::Handle< T >::clear(), art::Handle< T >::id(), art::Handle< T >::isValid(), art::Handle< T >::provenance(), and art::DataViewImpl::removeCachedProduct_().

Referenced by art::Run::endTime(), art::SubRun::endTime(), hit::MCHitFinder::produce(), and put().

552 {
553  bool result{false};
554  if (h.isValid() && !h.provenance()->produced()) {
555  removeCachedProduct_(h.id());
556  h.clear();
557  result = true;
558  }
559  return result;
560 }
void removeCachedProduct_(ProductID const pid) const
DataViewImpl::RetrievedProductIDs art::DataViewImpl::retrievedProductIDs ( ) const
protectedinherited

Definition at line 100 of file DataViewImpl.cc.

References art::DataViewImpl::retrievedProducts_.

Referenced by commit(), and art::DataViewImpl::retrievedProducts().

101  {
102  std::vector<ProductID> result;
103  result.reserve(retrievedProducts_.size());
104  result.assign(cbegin(retrievedProducts_), cend(retrievedProducts_));
105  return result;
106  }
RetrievedProductSet retrievedProducts_
Definition: DataViewImpl.h:272
RetrievedProductSet const& art::DataViewImpl::retrievedProducts ( ) const
inlineprotectedinherited
RunNumber_t art::Event::run ( ) const
inline

Definition at line 77 of file Event.h.

References id(), and art::EventID::run().

Referenced by pid::PIDAAnalyzer::analyze(), lar_pandora::PFParticleTrackAna::analyze(), calo::PrintCalorimetry::analyze(), lar_pandora::PFParticleCosmicAna::analyze(), lar_pandora::PFParticleMonitoring::analyze(), lar_pandora::PFParticleAnalysis::analyze(), lar_pandora::PFParticleHitDumper::analyze(), trk::TrackContainmentAnalyzer::analyze(), opdet::FlashHypothesisAna::analyze(), cheat::RecoCheckAna::analyze(), larg4::ISCalculationAna::analyze(), hit::HitAnaModule::analyze(), opdet::FIFOHistogramAna::analyze(), shower::TCShowerAnalysis::analyze(), microboone::CosmicRemovalAna::analyze(), larg4::LArG4Ana::analyze(), opdet::LEDCalibrationAna::analyze(), cluster::DBclusterAna::analyze(), hit::GausHitFinderAna::analyze(), hit::HitFinderAna::analyze(), NuShowerEff::analyze(), opdet::SimPhotonCounter::analyze(), vertex::FeatureVertexFinderAna::analyze(), trkf::TrackAna::analyze(), t0::IndirectHitParticleAssns::CreateHitParticleAssociations(), filter::EventFilter::filter(), evd::HeaderDrawer::Header(), util::FileCatalogMetadataExtras::postEvent(), lar_cluster3d::Cluster3D::PrepareEvent(), lar_pandora::LArPandoraEventDump::PrintEventMetadata(), trk::TrackContainmentTagger::produce(), noisefilteralg::WireCellNoiseFilter::produce(), wc::MergeWireCell::produce(), cluster::BlurredClustering::produce(), evgen::MarleyGen::produce(), trkf::Track3DKalmanSPS::produce(), lar_cluster3d::Cluster3D::produce(), evgen::MarleyTimeGen::produce(), and evdb::ScanFrame::Record().

78  {
79  return id().run();
80  }
RunNumber_t run() const
Definition: EventID.h:99
EventID id() const
Definition: Event.h:56
size_t art::DataViewImpl::size ( void  ) const
inherited

Definition at line 34 of file DataViewImpl.cc.

References art::DataViewImpl::principal_, art::DataViewImpl::putProducts_, and art::Principal::size().

Referenced by put().

35  {
36  return putProducts_.size() + principal_.size();
37  }
Principal const & principal_
Definition: DataViewImpl.h:276
size_t size() const
Definition: Principal.h:150
TypeLabelMap putProducts_
Definition: DataViewImpl.h:266

Member Data Documentation

EventAuxiliary const& art::Event::aux_
private

Definition at line 151 of file Event.h.

Referenced by Event(), event(), experimentType(), id(), isRealData(), subRun(), and time().

EventPrincipal const& art::Event::eventPrincipal_
private

Definition at line 153 of file Event.h.

Referenced by commit(), Event(), history(), processHistoryID(), and productGetter().

std::unique_ptr<SubRun const> const art::Event::subRun_
private

Definition at line 152 of file Event.h.

Referenced by Event(), and getSubRun().


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