![]() |
![]() |
00001 #ifndef GenericTriggerEventFlag_H 00002 #define GenericTriggerEventFlag_H 00003 00004 00005 // -*- C++ -*- 00006 // 00007 // Package: CommonTools/TriggerUtils 00008 // Class: GenericTriggerEventFlag 00009 // 00010 // $Id: GenericTriggerEventFlag.h,v 1.3 2010/07/19 14:43:33 vadler Exp $ 00011 // 00023 #include "FWCore/Framework/interface/Run.h" 00024 #include "FWCore/Framework/interface/Event.h" 00025 #include "FWCore/Framework/interface/EventSetup.h" 00026 #include "FWCore/Framework/interface/ESWatcher.h" 00027 #include "CondFormats/DataRecord/interface/AlCaRecoTriggerBitsRcd.h" 00028 #include "DataFormats/Common/interface/TriggerResults.h" 00029 #include "DataFormats/Scalers/interface/DcsStatus.h" 00030 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h" 00031 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" 00032 00033 #include <string> 00034 00035 00036 class GenericTriggerEventFlag { 00037 00038 // Utility classes 00039 edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_; 00040 L1GtUtils l1Gt_; 00041 HLTConfigProvider hltConfig_; 00042 bool hltConfigInit_; 00043 // Configuration parameters 00044 bool andOr_; 00045 std::string dbLabel_; 00046 unsigned verbose_; 00047 bool andOrDcs_; 00048 edm::InputTag dcsInputTag_; 00049 std::vector< int > dcsPartitions_; 00050 bool errorReplyDcs_; 00051 bool andOrGt_; 00052 edm::InputTag gtInputTag_; 00053 edm::InputTag gtEvmInputTag_; 00054 std::string gtDBKey_; 00055 std::vector< std::string > gtLogicalExpressions_; 00056 bool errorReplyGt_; 00057 bool andOrL1_; 00058 bool l1BeforeMask_; 00059 std::string l1DBKey_; 00060 std::vector< std::string > l1LogicalExpressions_; 00061 bool errorReplyL1_; 00062 bool andOrHlt_; 00063 edm::InputTag hltInputTag_; 00064 std::string hltDBKey_; 00065 std::vector< std::string > hltLogicalExpressions_; 00066 bool errorReplyHlt_; 00067 // Switches 00068 bool on_; 00069 bool onDcs_; 00070 bool onGt_; 00071 bool onL1_; 00072 bool onHlt_; 00073 // Member constants 00074 const std::string configError_; 00075 00076 public: 00077 00078 // Constructors and destructor 00079 GenericTriggerEventFlag( const edm::ParameterSet & config ); // To be called from the ED module's c'tor 00080 ~GenericTriggerEventFlag(); 00081 00082 // Public methods 00083 bool on() { return on_ ; } 00084 bool off() { return ( ! on_ ); } 00085 void initRun( const edm::Run & run, const edm::EventSetup & setup ); // To be called from beginRun() methods 00086 bool accept( const edm::Event & event, const edm::EventSetup & setup ); // To be called from analyze/filter() methods 00087 00088 private: 00089 00090 // Private methods 00091 00092 // DCS 00093 bool acceptDcs( const edm::Event & event ); 00094 bool acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const; 00095 00096 // GT status bits 00097 bool acceptGt( const edm::Event & event ); 00098 bool acceptGtLogicalExpression( const edm::Event & event, std::string gtLogicalExpression ); 00099 00100 // L1 00101 bool acceptL1( const edm::Event & event, const edm::EventSetup & setup ); 00102 bool acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression ); 00103 00104 // HLT 00105 bool acceptHlt( const edm::Event & event ); 00106 bool acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const; 00107 00108 // Algos 00109 std::vector< std::string > expressionsFromDB( const std::string & key, const edm::EventSetup & setup ); 00110 bool negate( std::string & word ) const; 00111 00112 }; 00113 00114 00115 #endif