CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
MultiEventFilter Class Reference
Inheritance diagram for MultiEventFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  Event
 

Public Member Functions

 MultiEventFilter (const edm::ParameterSet &iConfig)
 
 ~MultiEventFilter () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool filter (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 

Private Attributes

const std::vector< std::string > eventList_
 
std::vector< Eventevents_
 
const bool taggingMode_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file MultiEventFilter.cc.

Constructor & Destructor Documentation

MultiEventFilter::MultiEventFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 41 of file MultiEventFilter.cc.

References edm::errors::Configuration, eventList_, events_, Exception, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), mps_fire::i, mps_splice::line, AlCaHLTBitMon_QueryRunRegistry::string, and edm::tokenize().

42  : eventList_ (iConfig.getParameter<std::vector<std::string> >("EventList") )
43  , taggingMode_ (iConfig.getParameter<bool>("taggingMode") )
44 {
45  edm::FileInPath fp = iConfig.getParameter<edm::FileInPath>("file");
46  std::string fFile = fp.fullPath();
47  std::ifstream inStream(fFile.c_str());
48 
49  for (unsigned int i = 0; i < eventList_.size(); ++i) {
50  std::vector<std::string> tokens = edm::tokenize(eventList_[i], ":");
51  if(tokens.size() != 3) {
52  throw edm::Exception(edm::errors::Configuration) << "Incorrect event specification";
53  continue;
54  }
55  events_.push_back(Event(atoi(tokens[0].c_str()), atoi(tokens[1].c_str()), atoi(tokens[2].c_str())));
56  }
57 
59  while( getline(inStream, line) ){
60  std::vector<std::string> tokens = edm::tokenize(line, ":");
61  if(tokens.size() != 3) {
62  throw edm::Exception(edm::errors::Configuration) << "Incorrect event specification";
63  continue;
64  }
65  events_.push_back(Event(atoi(tokens[0].c_str()), atoi(tokens[1].c_str()), atoi(tokens[2].c_str())));
66  }
67 
68  produces<bool>();
69 }
T getParameter(std::string const &) const
const bool taggingMode_
std::vector< Event > events_
const std::vector< std::string > eventList_
std::string fullPath() const
Definition: FileInPath.cc:163
std::vector< std::string > tokenize(std::string const &input, std::string const &separator)
breaks the input string into tokens, delimited by the separator
MultiEventFilter::~MultiEventFilter ( )
inlineoverride

Definition at line 27 of file MultiEventFilter.cc.

References filter(), and iEvent.

27 {}

Member Function Documentation

bool MultiEventFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 72 of file MultiEventFilter.cc.

References DEFINE_FWK_MODULE, edm::EventID::event(), events_, mps_fire::i, edm::EventBase::id(), edm::EventID::luminosityBlock(), edm::Event::put(), edm::EventID::run(), and taggingMode_.

Referenced by ~MultiEventFilter().

72  {
73 
74  bool pass = true;
75 
76  for (unsigned int i = 0; i < events_.size(); ++i) {
77  if (events_[i].event == iEvent.id().event() &&
78  events_[i].run == iEvent.id().run() &&
79  events_[i].lumi == iEvent.id().luminosityBlock()) pass = false;
80  }
81 
82  iEvent.put(std::make_unique<bool>(pass));
83 
84  return taggingMode_ || pass;
85 
86 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
const bool taggingMode_
std::vector< Event > events_
edm::EventID id() const
Definition: EventBase.h:59
Definition: event.py:1

Member Data Documentation

const std::vector<std::string> MultiEventFilter::eventList_
private

Definition at line 34 of file MultiEventFilter.cc.

Referenced by MultiEventFilter().

std::vector<Event> MultiEventFilter::events_
private

Definition at line 33 of file MultiEventFilter.cc.

Referenced by filter(), and MultiEventFilter().

const bool MultiEventFilter::taggingMode_
private

Definition at line 36 of file MultiEventFilter.cc.

Referenced by filter().