CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/HLTrigger/HLTcore/interface/TriggerExpressionData.h

Go to the documentation of this file.
00001 #ifndef HLTrigger_HLTfilters_TriggerExpressionData_h
00002 #define HLTrigger_HLTfilters_TriggerExpressionData_h
00003 
00004 #include "FWCore/Utilities/interface/InputTag.h"
00005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00006 #include "DataFormats/Provenance/interface/ParameterSetID.h"
00007 #include "DataFormats/Provenance/interface/EventID.h"
00008 
00009 namespace edm {
00010   class Event;
00011   class EventSetup;
00012   class TriggerResults;
00013   class TriggerNames;
00014 }
00015 
00016 class L1GlobalTriggerReadoutRecord;
00017 class L1GtTriggerMenu;
00018 class L1GtTriggerMask;
00019 
00020 namespace triggerExpression {
00021 
00022 class Data {
00023 public:
00024   // default c'tor
00025   Data() :
00026     // configuration
00027     m_hltResultsTag(""),
00028     m_l1tResultsTag(""),
00029     m_daqPartitions(0x01),
00030     m_l1tIgnoreMask(false),
00031     m_l1techIgnorePrescales(false),
00032     m_throw(true),
00033     // l1 values and status
00034     m_l1tResults(0),
00035     m_l1tMenu(0),
00036     m_l1tAlgoMask(0),
00037     m_l1tTechMask(0),
00038     m_l1tCacheID(),
00039     m_l1tUpdated(false),
00040     // hlt values and status
00041     m_hltResults(0),
00042     m_hltMenu(0),
00043     m_hltCacheID(),
00044     m_hltUpdated(false),
00045     // event values
00046     m_eventNumber()
00047   { }
00048 
00049   // explicit c'tor from a PArameterSet
00050   explicit Data(const edm::ParameterSet & config) :
00051     // configuration
00052     m_hltResultsTag(config.getParameter<edm::InputTag>("hltResults")),
00053     m_l1tResultsTag(config.getParameter<edm::InputTag>("l1tResults")),
00054     m_daqPartitions(config.getParameter<unsigned int>("daqPartitions")),
00055     m_l1tIgnoreMask(config.getParameter<bool>("l1tIgnoreMask")),
00056     m_l1techIgnorePrescales(config.getParameter<bool>("l1techIgnorePrescales")),
00057     m_throw(config.getParameter<bool>("throw")),
00058     // l1 values and status
00059     m_l1tResults(0),
00060     m_l1tMenu(0),
00061     m_l1tAlgoMask(0),
00062     m_l1tTechMask(0),
00063     m_l1tCacheID(),
00064     m_l1tUpdated(false),
00065     // hlt values and status
00066     m_hltResults(0),
00067     m_hltMenu(0),
00068     m_hltCacheID(),
00069     m_hltUpdated(false),
00070     // event values
00071     m_eventNumber()
00072   { }
00073 
00074   // explicit c'tor from single arguments
00075   Data(
00076     edm::InputTag const & hltResultsTag,
00077     edm::InputTag const & l1tResultsTag,
00078     unsigned int          daqPartitions,
00079     bool                  l1tIgnoreMask,
00080     bool                  l1techIgnorePrescales,
00081     bool                  doThrow
00082   ) :
00083     // configuration
00084     m_hltResultsTag(hltResultsTag),
00085     m_l1tResultsTag(l1tResultsTag),
00086     m_daqPartitions(daqPartitions),
00087     m_l1tIgnoreMask(l1tIgnoreMask),
00088     m_l1techIgnorePrescales(l1techIgnorePrescales),
00089     m_throw(doThrow),
00090     // l1 values and status
00091     m_l1tResults(0),
00092     m_l1tMenu(0),
00093     m_l1tAlgoMask(0),
00094     m_l1tTechMask(0),
00095     m_l1tCacheID(),
00096     m_l1tUpdated(false),
00097     // hlt values and status
00098     m_hltResults(0),
00099     m_hltMenu(0),
00100     m_hltCacheID(),
00101     m_hltUpdated(false),
00102     // event values
00103     m_eventNumber()
00104   { }
00105 
00106   // set the new event
00107   bool setEvent(const edm::Event & event, const edm::EventSetup & setup);
00108 
00109   // re-configuration accessors 
00110 
00111   void setHltResultsTag(edm::InputTag const & tag) {
00112     m_hltResultsTag = tag;
00113   }
00114 
00115   void setL1tResultsTag(edm::InputTag const & tag) {
00116     m_l1tResultsTag = tag;
00117   }
00118 
00119   void setDaqPartitions(unsigned int daqPartitions) {
00120     m_daqPartitions = daqPartitions;
00121   }
00122 
00123   void setL1tIgnoreMask(bool l1tIgnoreMask) {
00124     m_l1tIgnoreMask = l1tIgnoreMask;
00125   }
00126 
00127   void setL1techIgnorePrescales(bool l1techIgnorePrescales) {
00128     m_l1techIgnorePrescales = l1techIgnorePrescales;
00129   }
00130 
00131   void setThrow(bool doThrow) {
00132     m_throw = doThrow;
00133   }
00134 
00135   // read-only accessors
00136 
00137   bool hasL1T() const {
00138     return not m_l1tResultsTag.label().empty();
00139   }
00140 
00141   bool hasHLT() const {
00142     return not m_hltResultsTag.label().empty();
00143   }
00144 
00145   const edm::TriggerResults & hltResults() const {
00146     return * m_hltResults;
00147   }
00148 
00149   const edm::TriggerNames & hltMenu() const {
00150     return * m_hltMenu;
00151   }
00152 
00153   const L1GlobalTriggerReadoutRecord & l1tResults() const {
00154     return * m_l1tResults;
00155   }
00156 
00157   const L1GtTriggerMenu & l1tMenu() const {
00158     return * m_l1tMenu;
00159   }
00160 
00161   const L1GtTriggerMask & l1tAlgoMask() const {
00162     return * m_l1tAlgoMask;
00163   }
00164 
00165   const L1GtTriggerMask & l1tTechMask() const {
00166     return * m_l1tTechMask;
00167   }
00168 
00169   bool hltConfigurationUpdated() const {
00170     return m_hltUpdated;
00171   }
00172 
00173   bool l1tConfigurationUpdated() const {
00174     return m_l1tUpdated;
00175   }
00176 
00177   bool configurationUpdated() const {
00178     return m_hltUpdated or m_l1tUpdated;
00179   }
00180 
00181   edm::EventNumber_t eventNumber() const {
00182     return m_eventNumber;
00183   }
00184 
00185   bool shouldThrow() const {
00186     return m_throw;
00187   }
00188 
00189   bool ignoreL1Mask() const {
00190     return m_l1tIgnoreMask;
00191   }
00192 
00193   bool ignoreL1TechPrescales() const {
00194     return m_l1techIgnorePrescales;
00195   }
00196 
00197   unsigned int daqPartitions() const {
00198     return m_daqPartitions;
00199   }
00200 
00201 private:
00202   // configuration
00203   edm::InputTag m_hltResultsTag;
00204   edm::InputTag m_l1tResultsTag;
00205   unsigned int  m_daqPartitions;
00206   bool          m_l1tIgnoreMask;
00207   bool          m_l1techIgnorePrescales;
00208   bool          m_throw;
00209 
00210   // l1 values and status
00211   const L1GlobalTriggerReadoutRecord  * m_l1tResults;
00212   const L1GtTriggerMenu               * m_l1tMenu;
00213   const L1GtTriggerMask               * m_l1tAlgoMask;
00214   const L1GtTriggerMask               * m_l1tTechMask;
00215   unsigned long long                    m_l1tCacheID;
00216   bool                                  m_l1tUpdated;
00217 
00218   // hlt values and status
00219   const edm::TriggerResults           * m_hltResults;
00220   const edm::TriggerNames             * m_hltMenu;
00221   edm::ParameterSetID                   m_hltCacheID;
00222   bool                                  m_hltUpdated;
00223 
00224   // event values
00225   edm::EventNumber_t                    m_eventNumber;
00226 };
00227 
00228 } // namespace triggerExpression
00229 
00230 #endif // HLTrigger_HLTfilters_TriggerExpressionData_h