CMS 3D CMS Logo

HLTFilter.cc
Go to the documentation of this file.
1 
15 
19 
21  EDFilter(),
22  saveTags_(config.getParameter<bool>("saveTags"))
23 {
24  // register common HLTFilter products
25  produces<trigger::TriggerFilterObjectWithRefs>();
26 }
27 
28 void
30  desc.add<bool>("saveTags",true);
31 }
32 
33 HLTFilter::~HLTFilter() = default;
34 
36  std::unique_ptr<trigger::TriggerFilterObjectWithRefs> filterproduct( new trigger::TriggerFilterObjectWithRefs(path(event), module(event)) );
37 
38  // compute the result of the HLTFilter 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 HLTFilter
45  return result;
46 }
47 
48 int HLTFilter::path(edm::Event const& event) const {
49  return static_cast<int>(event.moduleCallingContext()->placeInPathContext()->pathContext()->pathID());
50 }
51 
52 int HLTFilter::module(edm::Event const& event) const {
53  return static_cast<int>(event.moduleCallingContext()->placeInPathContext()->placeInPath());
54 }
55 
56 std::pair<int,int> HLTFilter::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 }
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
std::pair< int, int > pmid(edm::Event const &) const
Definition: HLTFilter.cc:56
Definition: config.py:1
virtual bool hltFilter(edm::Event &event, const edm::EventSetup &setup, trigger::TriggerFilterObjectWithRefs &filterobject) const =0
std::string const & moduleLabel() const
bool filter(edm::StreamID, edm::Event &event, const edm::EventSetup &setup) const final
Definition: HLTFilter.cc:35
~HLTFilter() override
PathContext const * pathContext() const
const std::string * pathName(edm::Event const &) const
Definition: HLTFilter.cc:62
int module(edm::Event const &) const
Definition: HLTFilter.cc:52
unsigned int pathID() const
Definition: PathContext.h:32
ModuleDescription const & moduleDescription() const
Definition: EDFilterBase.h:66
ParameterDescriptionBase * add(U const &iLabel, T const &value)
unsigned int placeInPath() const
const std::string * moduleLabel() const
Definition: HLTFilter.cc:66
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
int path(edm::Event const &) const
Definition: HLTFilter.cc:48
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1