CMS 3D CMS Logo

HLTStreamFilter.cc
Go to the documentation of this file.
1 
15 
19 
21  EDFilter(),
22  saveTags_(config.getParameter<bool>("saveTags"))
23 {
24  // register common HLTStreamFilter products
25  produces<trigger::TriggerFilterObjectWithRefs>();
26 }
27 
28 void
30  desc.add<bool>("saveTags",true);
31 }
32 
34 
36  std::unique_ptr<trigger::TriggerFilterObjectWithRefs> filterproduct( new trigger::TriggerFilterObjectWithRefs(path(event), module(event)) );
37 
38  // compute the result of the HLTStreamFilter implementation
39  bool result = hltFilter(event, setup, * filterproduct);
40 
41  // put filter object into the Event
42  event.put(std::move(filterproduct));
43 
44  // retunr the result of the HLTStreamFilter
45  return result;
46 }
47 
49  return static_cast<int>(event.moduleCallingContext()->placeInPathContext()->pathContext()->pathID());
50 }
51 
53  return static_cast<int>(event.moduleCallingContext()->placeInPathContext()->placeInPath());
54 }
55 
56 std::pair<int,int> HLTStreamFilter::pmid(edm::Event const& event) const {
57  edm::PlaceInPathContext const* placeInPathContext = event.moduleCallingContext()->placeInPathContext();
58  return std::make_pair(static_cast<int>(placeInPathContext->pathContext()->pathID()),
59  static_cast<int>(placeInPathContext->placeInPath()));
60 }
61 
63  return &event.moduleCallingContext()->placeInPathContext()->pathContext()->pathName();
64 }
65 
67  return &moduleDescription().moduleLabel();
68 }
bool filter(edm::Event &event, const edm::EventSetup &setup) final
int module(edm::Event const &) const
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
Definition: config.py:1
ModuleDescription const & moduleDescription() const
Definition: EDFilterBase.h:59
std::string const & moduleLabel() const
const std::string * pathName(edm::Event const &) const
virtual bool hltFilter(edm::Event &event, const edm::EventSetup &setup, trigger::TriggerFilterObjectWithRefs &filterobject)=0
PathContext const * pathContext() const
HLTStreamFilter(const edm::ParameterSet &config)
const std::string * moduleLabel() const
std::pair< int, int > pmid(edm::Event const &) const
unsigned int pathID() const
Definition: PathContext.h:32
ParameterDescriptionBase * add(U const &iLabel, T const &value)
unsigned int placeInPath() const
~HLTStreamFilter() override
int path(edm::Event const &) const
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1