Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
art::MixFilter< T > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/art/v2_13_00/source/art/Framework/Modules/MixFilter.h"

Inheritance diagram for art::MixFilter< T >:
art::EDFilter art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

typedef T MixDetail
 
using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = ProducerBase::Table< UserConfig >
 

Public Member Functions

 MixFilter (fhicl::ParameterSet const &p)
 
void beginJob () override
 
void respondToOpenInputFile (FileBlock const &fb) override
 
void respondToCloseInputFile (FileBlock const &fb) override
 
void respondToOpenOutputFiles (FileBlock const &fb) override
 
void respondToCloseOutputFiles (FileBlock const &fb) override
 
bool filter (Event &e) override
 
bool beginSubRun (SubRun &sr) override
 
bool endSubRun (SubRun &sr) override
 
bool beginRun (Run &r) override
 
bool endRun (Run &r) override
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

fhicl::ParameterSet const & initEngine_ (fhicl::ParameterSet const &p)
 

Private Attributes

MixHelper helper_
 
MixDetail detail_
 

Detailed Description

template<class T>
class art::MixFilter< T >

Definition at line 153 of file MixFilter.h.

Member Typedef Documentation

template<class T >
typedef T art::MixFilter< T >::MixDetail

Definition at line 593 of file MixFilter.h.

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

Definition at line 38 of file EDFilter.h.

Constructor & Destructor Documentation

template<class T >
art::MixFilter< T >::MixFilter ( fhicl::ParameterSet const &  p)
explicit

Definition at line 614 of file MixFilter.h.

References art::MixFilter< T >::detail_, and art::MixFilter< T >::helper_.

615  : helper_(initEngine_(p), *this)
616  , // See note below
617  detail_(p, helper_)
618 {
619  // Note that the random number engine is created in the initializer
620  // list by calling initEngine(). This enables the engine to be
621  // obtained by the helper and or detail objects in their constructors
622  // via a service handle to the random number generator service. The
623  // initEngine() function returns a ParameterSet simply so that it may
624  // be called in this place without having to resort to comma-separated
625  // bundles to do the job.
627  detail::setup_eventsToSkip<T>,
628  detail::do_not_setup_eventsToSkip<T>>
629  maybe_setup_skipper(helper_, detail_);
630 }
fhicl::ParameterSet const & initEngine_(fhicl::ParameterSet const &p)
Definition: MixFilter.h:768
MixDetail detail_
Definition: MixFilter.h:610
const char * p
Definition: xmltok.h:285
const XML_Char int const XML_Char * value
Definition: expat.h:331
MixHelper helper_
Definition: MixFilter.h:609

Member Function Documentation

template<class T >
void art::MixFilter< T >::beginJob ( )
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 634 of file MixFilter.h.

635 {}
template<class T >
bool art::MixFilter< T >::beginRun ( Run r)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 744 of file MixFilter.h.

References art::MixFilter< T >::detail_.

745 {
747  detail::call_beginRun<T>,
748  detail::do_not_call_beginRun<T>>
749  maybe_call_beginRun;
750  maybe_call_beginRun(detail_, r);
751  return true;
752 }
MixDetail detail_
Definition: MixFilter.h:610
const XML_Char int const XML_Char * value
Definition: expat.h:331
TRandom3 r(0)
template<class T >
bool art::MixFilter< T >::beginSubRun ( SubRun sr)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 720 of file MixFilter.h.

References art::MixFilter< T >::detail_.

721 {
723  detail::call_beginSubRun<T>,
724  detail::do_not_call_beginSubRun<T>>
725  maybe_call_beginSubRun;
726  maybe_call_beginSubRun(detail_, sr);
727  return true;
728 }
MixDetail detail_
Definition: MixFilter.h:610
const XML_Char int const XML_Char * value
Definition: expat.h:331
caf::StandardRecord * sr
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDFilter::currentContext ( ) const
protectedinherited
template<class T >
bool art::MixFilter< T >::endRun ( Run r)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 756 of file MixFilter.h.

References art::MixFilter< T >::detail_.

757 {
759  detail::call_endRun<T>,
760  detail::do_not_call_endRun<T>>
761  maybe_call_endRun;
762  maybe_call_endRun(detail_, r);
763  return true;
764 }
MixDetail detail_
Definition: MixFilter.h:610
const XML_Char int const XML_Char * value
Definition: expat.h:331
TRandom3 r(0)
template<class T >
bool art::MixFilter< T >::endSubRun ( SubRun sr)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 732 of file MixFilter.h.

References art::MixFilter< T >::detail_.

733 {
735  detail::call_endSubRun<T>,
736  detail::do_not_call_endSubRun<T>>
737  maybe_call_endSubRun;
738  maybe_call_endSubRun(detail_, sr);
739  return true;
740 }
MixDetail detail_
Definition: MixFilter.h:610
const XML_Char int const XML_Char * value
Definition: expat.h:331
caf::StandardRecord * sr
template<class T >
bool art::MixFilter< T >::filter ( art::Event e)
overridevirtual

Implements art::EDFilter.

Definition at line 675 of file MixFilter.h.

References art::MixFilter< T >::detail_, art::errors::FileReadError, art::MixHelper::generateEventSequence(), art::MixFilter< T >::helper_, and art::MixHelper::mixAndPut().

676 {
677  // 1. Call detail object's startEvent() if it exists.
679  detail::call_startEvent<T>,
680  detail::do_not_call_startEvent<T>>
681  maybe_call_startEvent(e);
682  maybe_call_startEvent(detail_);
683  // 2. Ask detail object how many events to read.
684  size_t nSecondaries = detail_.nSecondaries();
685  // 3. Decide which events we're reading and prime the event tree cache.
686  EntryNumberSequence enSeq;
687  EventIDSequence eIDseq;
688  enSeq.reserve(nSecondaries);
689  eIDseq.reserve(nSecondaries);
690  if (!helper_.generateEventSequence(nSecondaries, enSeq, eIDseq)) {
692  << "Insufficient secondary events available to mix.\n";
693  }
694  // 4. Give the event ID sequence to the detail object.
696  detail::call_processEventIDs<T>,
697  detail::do_not_call_processEventIDs<T>>
698  maybe_call_processEventIDs;
699  maybe_call_processEventIDs(detail_, eIDseq);
700  // 5. Give the event auxiliary sequence to the detail object.
702  detail::call_processEventAuxiliaries<T>,
703  detail::do_not_call_processEventAuxiliaries<T>>
704  maybe_call_processEventAuxiliaries;
705  maybe_call_processEventAuxiliaries(detail_, helper_, enSeq, nSecondaries);
706  // 6. Make the MixHelper read info into all the products, invoke the
707  // mix functions and put the products into the event.
708  helper_.mixAndPut(enSeq, eIDseq, e);
709  // 7. Call detail object's finalizeEvent() if it exists.
711  detail::call_finalizeEvent<T>,
712  detail::do_not_call_finalizeEvent<T>>
713  maybe_call_finalizeEvent;
714  maybe_call_finalizeEvent(detail_, e);
715  return true;
716 }
std::vector< EventID > EventIDSequence
Definition: MixTypes.h:22
void mixAndPut(EntryNumberSequence const &enSeq, EventIDSequence const &eIDseq, Event &e)
MixDetail detail_
Definition: MixFilter.h:610
bool generateEventSequence(size_t nSecondaries, EntryNumberSequence &enSeq, EventIDSequence &eIDseq)
const XML_Char int const XML_Char * value
Definition: expat.h:331
std::vector< FileIndex::EntryNumber_t > EntryNumberSequence
Definition: MixTypes.h:23
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
MixHelper helper_
Definition: MixFilter.h:609
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<class T >
fhicl::ParameterSet const & art::MixFilter< T >::initEngine_ ( fhicl::ParameterSet const &  p)
private

Definition at line 768 of file MixFilter.h.

References art::EngineCreator::createEngine(), and art::EngineCreator::get_seed_value().

769 {
770  // If we can't create one of these, the helper will deal with the
771  // situation accordingly.
772  if (ServiceRegistry::isAvailable<RandomNumberGenerator>()) {
774  }
775  return p;
776 }
const char * p
Definition: xmltok.h:285
base_engine_t & createEngine(seed_t seed)
seed_t get_seed_value(fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
template<class T >
void art::MixFilter< T >::respondToCloseInputFile ( FileBlock const &  fb)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 648 of file MixFilter.h.

References art::MixFilter< T >::detail_, and fb.

649 {
651  detail::call_respondToCloseInputFile<T>,
652  detail::do_not_call_respondToXXX<T>>(detail_, fb);
653 }
MixDetail detail_
Definition: MixFilter.h:610
const XML_Char int const XML_Char * value
Definition: expat.h:331
template<class T >
void art::MixFilter< T >::respondToCloseOutputFiles ( FileBlock const &  fb)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 666 of file MixFilter.h.

References art::MixFilter< T >::detail_, and fb.

667 {
669  detail::call_respondToCloseOutputFiles<T>,
670  detail::do_not_call_respondToXXX<T>>(detail_, fb);
671 }
MixDetail detail_
Definition: MixFilter.h:610
const XML_Char int const XML_Char * value
Definition: expat.h:331
template<class T >
void art::MixFilter< T >::respondToOpenInputFile ( FileBlock const &  fb)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 639 of file MixFilter.h.

References art::MixFilter< T >::detail_, and fb.

640 {
642  detail::call_respondToOpenInputFile<T>,
643  detail::do_not_call_respondToXXX<T>>(detail_, fb);
644 }
MixDetail detail_
Definition: MixFilter.h:610
const XML_Char int const XML_Char * value
Definition: expat.h:331
template<class T >
void art::MixFilter< T >::respondToOpenOutputFiles ( FileBlock const &  fb)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 657 of file MixFilter.h.

References art::MixFilter< T >::detail_, and fb.

658 {
660  detail::call_respondToOpenOutputFiles<T>,
661  detail::do_not_call_respondToXXX<T>>(detail_, fb);
662 }
MixDetail detail_
Definition: MixFilter.h:610
const XML_Char int const XML_Char * value
Definition: expat.h:331
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

template<class T >
MixDetail art::MixFilter< T >::detail_
private
constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().

template<class T >
MixHelper art::MixFilter< T >::helper_
private

Definition at line 609 of file MixFilter.h.

Referenced by art::MixFilter< T >::filter(), and art::MixFilter< T >::MixFilter().

constexpr bool art::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().


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