Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:18:29

0001 #ifndef TriggerResultsFilterFromDB_h
0002 #define TriggerResultsFilterFromDB_h
0003 
0004 /** \class TriggerResultsFilterFromDB
0005  *
0006  *
0007  *  This class is an EDFilter implementing filtering on arbitrary logical combinations
0008  *  of L1 and HLT results.
0009  *
0010  *  It is a modifed version of TriggerResultsFilter that reads the trigger expression
0011  *  from the database.
0012  *
0013  *
0014  *  Authors: Martin Grunewald, Andrea Bocci
0015  *
0016  */
0017 
0018 #include <vector>
0019 #include <string>
0020 
0021 #include "FWCore/Framework/interface/ESWatcher.h"
0022 #include "FWCore/Framework/interface/stream/EDFilter.h"
0023 #include "CondFormats/DataRecord/interface/AlCaRecoTriggerBitsRcd.h"
0024 #include "HLTrigger/HLTcore/interface/TriggerExpressionData.h"
0025 
0026 // forward declaration
0027 namespace edm {
0028   class ConfigurationDescriptions;
0029 }
0030 namespace triggerExpression {
0031   class Evaluator;
0032 }
0033 
0034 //
0035 // class declaration
0036 //
0037 
0038 class TriggerResultsFilterFromDB : public edm::stream::EDFilter<> {
0039 public:
0040   explicit TriggerResultsFilterFromDB(const edm::ParameterSet &);
0041   ~TriggerResultsFilterFromDB() override;
0042   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
0043   bool filter(edm::Event &, const edm::EventSetup &) override;
0044 
0045 private:
0046   /// read the triggerConditions from the database
0047   void pathsFromSetup(const edm::Event &, const edm::EventSetup &setup);
0048 
0049   /// parse the logical expression into functionals
0050   void parse(const std::string &expression);
0051   void parse(const std::vector<std::string> &expressions);
0052 
0053   /// read the triggerConditions from the database
0054   std::string m_eventSetupPathsKey;
0055   edm::ESWatcher<AlCaRecoTriggerBitsRcd> m_eventSetupWatcher;
0056   edm::ESGetToken<AlCaRecoTriggerBits, AlCaRecoTriggerBitsRcd> const m_alcaRecoTriggerBitsRcdToken;
0057 
0058   /// evaluator for the trigger condition
0059   triggerExpression::Evaluator *m_expression;
0060 
0061   /// cache some data from the Event for faster access by the m_expression
0062   triggerExpression::Data m_eventCache;
0063 };
0064 
0065 #endif  //TriggerResultsFilterFromDB_h