-
Notifications
You must be signed in to change notification settings - Fork 0
/
L1MuonRoI.h
48 lines (41 loc) · 1.31 KB
/
L1MuonRoI.h
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
#ifndef __L1MuonRoI__
#define __L1MuonRoI__
#include "TLorentzVector.h"
#include <stdint.h>
class L1MuonRoI {
public :
TLorentzVector p4;
uint32_t roiWord;
float thrValue;
int isVetoed;
//L1MuonRoI() : TLorentzVector(), roiWord(0), thrValue(0){}
L1MuonRoI() : p4(), roiWord(0), thrValue(0),isVetoed(0) {}
enum RoISource { Barrel, Endcap, Forward };
enum Hemisphere { Positive, Negative };
enum Charge { Neg = 0, Pos = 1, Undef = 100 };
int getSectorAddress() const { return ( ( roiWord >> 14 ) & 0xff ); }
bool isFirstCandidate() const { return ( ( roiWord >> 22 ) & 0x1 ); }
bool isMoreCandInRoI() const { return ( ( roiWord >> 1 ) & 0x1 ); }
bool isMoreCandInSector() const {return ( roiWord & 0x1 ); }
RoISource getSource() const {
if( this->getSectorAddress() & 0x80 ) {
return Endcap;
} else if( this->getSectorAddress() & 0x40 ) {
return Forward;
} else {
return Barrel;
}
}
Hemisphere getHemisphere() const {
if( this->getSectorAddress() & 0x1 )return Positive;
else return Negative;
}
Charge getCharge() const {
if( getSource() == Barrel ) return Undef;
if( roiWord & 0x8000000 ) return Pos;
else return Neg;
}
bool isVetoedRoI() const { return ( roiWord & 0x10000000 ); }
ClassDef (L1MuonRoI,1);
};
#endif