Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EgammaReco_EgammaTrigger_h
0002 #define EgammaReco_EgammaTrigger_h
0003 /** \class reco::EgammaTrigger EgammaTrigger.h DataFormats/EgammaReco/interface/EgammaTrigger.h
0004  *  
0005  * Egamma trigger bit set
0006  *
0007  * \author Luca Lista, INFN
0008  *
0009  *
0010  */
0011 #include "DataFormats/EgammaReco/interface/EgammaTriggerFwd.h"
0012 
0013 namespace reco {
0014 
0015   class SuperCluster;
0016 
0017   namespace egamma {
0018     enum { L1Single = 0, L1Double, L1RelaxedDouble, IsolatedL1 };
0019     template <unsigned char L1>
0020     struct mask {
0021       enum { value = mask<L1 - 1>::value << 1 };
0022     };
0023     template <>
0024     struct mask<0> {
0025       enum { value = 1 };
0026     };
0027   }  // namespace egamma
0028 
0029   class EgammaTrigger {
0030   public:
0031     /// default constructor
0032     EgammaTrigger() : l1word_(0) {}
0033 
0034     /// constructor from boolean values
0035     EgammaTrigger(bool, bool, bool, bool);
0036 
0037     /// returns the trigger bit at positon L1 (L1 = 0, ..., 3)
0038     /// L1 couls be one of the enumerator defined in egamma namespace
0039     template <unsigned char L1>
0040     bool match() {
0041       return l1word_ & egamma::mask<L1>::value;
0042     }
0043 
0044     /// sets to 1 the trigger bit at positon L1 (L1 = 0, ..., 3)
0045     /// L1 couls be one of the enumerator defined in egamma namespace
0046     template <unsigned char L1>
0047     void set() {
0048       l1word_ |= egamma::mask<L1>::value;
0049     }
0050 
0051     /// return the trigger work
0052     unsigned char l1word() const { return l1word_; }
0053 
0054   private:
0055     /// trigger work (packed). Only 4 bits are used.
0056     unsigned char l1word_;
0057   };
0058 }  // namespace reco
0059 
0060 #endif