Go to the documentation of this file.00001 #ifndef GenericTriggerEventFlag_H
00002 #define GenericTriggerEventFlag_H
00003
00004
00005
00006
00007
00008
00009
00010
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
00039 edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_;
00040 L1GtUtils l1Gt_;
00041 HLTConfigProvider hltConfig_;
00042 bool hltConfigInit_;
00043
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 > l1LogicalExpressionsCache_;
00061 std::vector< std::string > l1LogicalExpressions_;
00062 bool errorReplyL1_;
00063 bool andOrHlt_;
00064 edm::InputTag hltInputTag_;
00065 std::string hltDBKey_;
00066 std::vector< std::string > hltLogicalExpressionsCache_;
00067 std::vector< std::string > hltLogicalExpressions_;
00068 bool errorReplyHlt_;
00069
00070 bool on_;
00071 bool onDcs_;
00072 bool onGt_;
00073 bool onL1_;
00074 bool onHlt_;
00075
00076 const std::string configError_;
00077 const std::string emptyKeyError_;
00078
00079 public:
00080
00081
00082 GenericTriggerEventFlag( const edm::ParameterSet & config );
00083 ~GenericTriggerEventFlag();
00084
00085
00086 bool on() { return on_ ; }
00087 bool off() { return ( ! on_ ); }
00088 void initRun( const edm::Run & run, const edm::EventSetup & setup );
00089 bool accept( const edm::Event & event, const edm::EventSetup & setup );
00090
00091 private:
00092
00093
00094
00095
00096 bool acceptDcs( const edm::Event & event );
00097 bool acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const;
00098
00099
00100 bool acceptGt( const edm::Event & event );
00101 bool acceptGtLogicalExpression( const edm::Event & event, std::string gtLogicalExpression );
00102
00103
00104 bool acceptL1( const edm::Event & event, const edm::EventSetup & setup );
00105 bool acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression );
00106
00107
00108 bool acceptHlt( const edm::Event & event );
00109 bool acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const;
00110
00111
00112 std::string expandLogicalExpression( const std::vector< std::string > & target, const std::string & expr, bool useAnd = false ) const;
00113 bool negate( std::string & word ) const;
00114
00115 public:
00116
00117
00118
00119 std::string gtDBKey() { return gtDBKey_ ; }
00120 std::string l1DBKey() { return l1DBKey_ ; }
00121 std::string hltDBKey() { return hltDBKey_; }
00122
00123 std::vector< std::string > expressionsFromDB( const std::string & key, const edm::EventSetup & setup );
00124
00125 };
00126
00127
00128 #endif