CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DataFormats/PatCandidates/interface/TriggerAlgorithm.h

Go to the documentation of this file.
00001 #ifndef DataFormats_PatCandidates_TriggerAlgorithm_h
00002 #define DataFormats_PatCandidates_TriggerAlgorithm_h
00003 
00004 
00005 // -*- C++ -*-
00006 //
00007 // Package:    PatCandidates
00008 // Class:      pat::TriggerAlgorithm
00009 //
00010 // $Id: TriggerAlgorithm.h,v 1.4 2011/02/22 18:29:50 vadler Exp $
00011 //
00025 #include <string>
00026 #include <vector>
00027 
00028 #include "DataFormats/Common/interface/Ref.h"
00029 #include "DataFormats/Common/interface/RefProd.h"
00030 #include "DataFormats/Common/interface/RefVector.h"
00031 #include "DataFormats/Common/interface/RefVectorIterator.h"
00032 
00033 
00034 namespace pat {
00035 
00036   class TriggerAlgorithm {
00037 
00039 
00041       std::string name_;
00043       std::string alias_;
00045       std::string logic_;
00047       bool tech_;
00049       unsigned bit_;
00051       bool gtlResult_;
00053       unsigned prescale_;
00055       bool mask_;
00057       bool decisionBeforeMask_;
00059       bool decisionAfterMask_;
00062       std::vector< unsigned > conditionKeys_;
00063 
00064     public:
00065 
00067 
00069       TriggerAlgorithm();
00071       TriggerAlgorithm( const std::string & name );
00073       TriggerAlgorithm( const std::string & name, const std::string & alias, bool tech, unsigned bit, unsigned prescale, bool mask, bool decisionBeforeMask, bool decisionAfterMask ); // for backward compatibility
00074       TriggerAlgorithm( const std::string & name, const std::string & alias, bool tech, unsigned bit, bool gtlResult, unsigned prescale, bool mask, bool decisionBeforeMask, bool decisionAfterMask );
00075 
00077       virtual ~TriggerAlgorithm() {};
00078 
00080 
00082       void setName( const std::string & name ) { name_ = name; };
00084       void setAlias( const std::string & alias ) { alias_ = alias; };
00086       void setLogicalExpression( const std::string & expression ) { logic_ = expression; };
00088       void setTechTrigger( bool tech ) { tech_ = tech; };
00090       void setBit( unsigned bit ) { bit_ = bit; };
00092       void setGtlResult( bool gtlResult ) { gtlResult_ = gtlResult; };
00094       void setPrescale( unsigned prescale )  { prescale_ = prescale; };
00096       void setMask( bool mask ) { mask_ = mask; };
00098       void setDecisionBeforeMask( bool decisionBeforeMask ) { decisionBeforeMask_ = decisionBeforeMask; };
00100       void setDecisionAfterMas( bool decisionAfterMask ) { decisionAfterMask_ = decisionAfterMask; };
00102       void addConditionKey( unsigned conditionKey ) { if ( ! hasConditionKey( conditionKey ) ) conditionKeys_.push_back( conditionKey ); };
00104       std::string name() const { return name_; };
00106       std::string alias() const { return alias_; };
00108       std::string logicalExpression() const { return logic_; };
00110       bool techTrigger() const { return tech_; };
00112       unsigned bit() const { return bit_; };
00114       bool gtlResult() const { return gtlResult_; };
00116       unsigned prescale() const { return prescale_; };
00118       bool mask() const { return mask_; };
00120       bool decisionBeforeMask() const { return decisionBeforeMask_; };
00122       bool decisionAfterMask() const { return decisionAfterMask_; };
00125       bool decision() const { return decisionAfterMask(); };
00127       std::vector< unsigned > conditionKeys() const { return conditionKeys_; };
00129       bool hasConditionKey( unsigned conditionKey ) const;
00130 
00131   };
00132 
00133 
00135   typedef std::vector< TriggerAlgorithm >                      TriggerAlgorithmCollection;
00137   typedef edm::Ref< TriggerAlgorithmCollection >               TriggerAlgorithmRef;
00139   typedef edm::RefProd< TriggerAlgorithmCollection >           TriggerAlgorithmRefProd;
00141   typedef edm::RefVector< TriggerAlgorithmCollection >         TriggerAlgorithmRefVector;
00143   typedef edm::RefVectorIterator< TriggerAlgorithmCollection > TriggerAlgorithmRefVectorIterator;
00144 
00145 }
00146 
00147 
00148 #endif