1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#ifndef EgammaReco_EgammaTrigger_h
#define EgammaReco_EgammaTrigger_h
/** \class reco::EgammaTrigger EgammaTrigger.h DataFormats/EgammaReco/interface/EgammaTrigger.h
*
* Egamma trigger bit set
*
* \author Luca Lista, INFN
*
*
*/
#include "DataFormats/EgammaReco/interface/EgammaTriggerFwd.h"
namespace reco {
class SuperCluster;
namespace egamma {
enum { L1Single = 0, L1Double, L1RelaxedDouble, IsolatedL1 };
template <unsigned char L1>
struct mask {
enum { value = mask<L1 - 1>::value << 1 };
};
template <>
struct mask<0> {
enum { value = 1 };
};
} // namespace egamma
class EgammaTrigger {
public:
/// default constructor
EgammaTrigger() : l1word_(0) {}
/// constructor from boolean values
EgammaTrigger(bool, bool, bool, bool);
/// returns the trigger bit at positon L1 (L1 = 0, ..., 3)
/// L1 couls be one of the enumerator defined in egamma namespace
template <unsigned char L1>
bool match() {
return l1word_ & egamma::mask<L1>::value;
}
/// sets to 1 the trigger bit at positon L1 (L1 = 0, ..., 3)
/// L1 couls be one of the enumerator defined in egamma namespace
template <unsigned char L1>
void set() {
l1word_ |= egamma::mask<L1>::value;
}
/// return the trigger work
unsigned char l1word() const { return l1word_; }
private:
/// trigger work (packed). Only 4 bits are used.
unsigned char l1word_;
};
} // namespace reco
#endif
|