CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual 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
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 &)
 
- 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 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, personalPlayback::fp, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), i, geometryCSVtoXML::line, AlCaHLTBitMon_QueryRunRegistry::string, and edm::tokenize().

42  : eventList_ (iConfig.getParameter<std::vector<std::string> >("EventList") )
43  , taggingMode_ (iConfig.getParameter<bool>("taggingMode") )
44 {
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
int i
Definition: DBlmapReader.cc:9
const bool taggingMode_
std::vector< Event > events_
const std::vector< std::string > eventList_
std::vector< std::string > tokenize(std::string const &input, std::string const &separator)
breaks the input string into tokens, delimited by the separator
Definition: Parse.cc:57
std::string fullPath() const
Definition: FileInPath.cc:165
MultiEventFilter::~MultiEventFilter ( )
inline

Definition at line 27 of file MultiEventFilter.cc.

27 {}

Member Function Documentation

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

Implements edm::EDFilter.

Definition at line 72 of file MultiEventFilter.cc.

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

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::auto_ptr<bool>(new 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
int i
Definition: DBlmapReader.cc:9
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
const bool taggingMode_
std::vector< Event > events_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::EventID id() const
Definition: EventBase.h:60

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().