ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1RPClogic
src
decodeSL.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigT1RPClogic/decodeSL.h
"
6
7
namespace
{
8
/*
9
* Note implicit sign extension: field with type unsigned short (16 bits, unsigned)
10
* is promoted in (unsigned short)field << posit to type int (32 bits, signed),
11
* then sign-extended to type unsigned long (64 bits, unsigned). If
12
* (unsigned short)field << posit is greater than 0x7FFFFFFF, the upper bits of the
13
* result will all be 1.
14
*/
15
unsigned
short
16
code(
unsigned
long
int
slword,
unsigned
short
int
field,
unsigned
short
int
posit){
17
return
((slword&((
unsigned
short
int
) field<<posit))>>posit);
18
}
19
}
20
21
namespace
TriggerRPC
{
22
23
//****************************************************************************//
24
unsigned
short
int
moreThan2
(
unsigned
long
int
slword) {
25
//
26
// returns 1 if there are more than 2 candidates in a sector
27
// returns 0 otherwise
28
//
29
unsigned
short
int
field=0x1;
30
unsigned
short
int
posit=0;
31
return
code(slword, field, posit);
32
}
33
//****************************************************************************//
34
unsigned
short
int
ROI1
(
unsigned
long
int
slword) {
35
//
36
// returns the ROI identifier of the highest pT ROI
37
//
38
unsigned
short
int
field=0x1f;
39
unsigned
short
int
posit=1;
40
return
code(slword, field, posit);
41
}
42
//****************************************************************************//
43
unsigned
short
int
OVL1
(
unsigned
long
int
slword) {
44
//
45
// returns the Overlap Flag of the highest pT ROI
46
//
47
unsigned
short
int
field=0x3;
48
unsigned
short
int
posit=8;
49
return
code(slword, field, posit);
50
}
51
//****************************************************************************//
52
unsigned
short
int
ROI2
(
unsigned
long
int
slword) {
53
//
54
// returns the ROI identifier of the second highest pT ROI
55
//
56
unsigned
short
int
field=0x1f;
57
unsigned
short
int
posit=10;
58
return
code(slword, field, posit);
59
}
60
//****************************************************************************//
61
unsigned
short
int
OVL2
(
unsigned
long
int
slword) {
62
//
63
// returns the Overlap Flag of the second highest pT ROI
64
//
65
unsigned
short
int
field=0x3;
66
unsigned
short
int
posit=17;
67
return
code(slword, field, posit);
68
}
69
//****************************************************************************//
70
unsigned
short
int
PT1
(
unsigned
long
int
slword) {
71
//
72
// returns the highest pt code
73
//
74
unsigned
short
int
field=0x7;
75
unsigned
short
int
posit=19;
76
unsigned
short
int
ptcode = code(slword, field, posit);
77
if
(!ptcode) {
78
return
0;
79
}
else
{
80
if
(ptcode==7) ptcode=0;
81
}
82
return
ptcode;
83
}
84
//****************************************************************************//
85
unsigned
short
int
PT2
(
unsigned
long
int
slword) {
86
//
87
// returns the second highest pt code
88
//
89
unsigned
short
int
field=0x7;
90
unsigned
short
int
posit=22;
91
unsigned
short
int
ptcode = code(slword, field, posit);
92
if
(!ptcode) {
93
return
0;
94
}
else
{
95
if
(ptcode==7) ptcode=0;
96
}
97
return
ptcode;
98
}
99
//****************************************************************************//
100
unsigned
short
moreThan1_1
(
unsigned
long
int
slword) {
101
//
102
// returns 1 if there is more than 1 candidate in ROI1
103
// returns 0 otherwise
104
//
105
unsigned
short
int
field=0x1;
106
unsigned
short
int
posit=25;
107
return
code(slword, field, posit);
108
}
109
//****************************************************************************//
110
unsigned
short
moreThan1_2
(
unsigned
long
int
slword) {
111
//
112
// returns 1 if there is more than 1 candidate in ROI2
113
// returns 0 otherwise
114
//
115
unsigned
short
int
field=0x1;
116
unsigned
short
int
posit=26;
117
return
code(slword, field, posit);
118
}
119
//****************************************************************************//
120
unsigned
short
BunchXID
(
unsigned
long
int
slword) {
121
//
122
// returns the Bunch Crossing identifier of this trigger
123
//
124
unsigned
short
int
field=0x7;
125
unsigned
short
int
posit=27;
126
return
code(slword, field, posit);
127
}
128
129
130
}
decodeSL.h
TriggerRPC
Definition
decodeSL.cxx:21
TriggerRPC::moreThan1_2
unsigned short moreThan1_2(unsigned long int slword)
Definition
decodeSL.cxx:110
TriggerRPC::PT1
unsigned short int PT1(unsigned long int slword)
Definition
decodeSL.cxx:70
TriggerRPC::ROI1
unsigned short int ROI1(unsigned long int slword)
Definition
decodeSL.cxx:34
TriggerRPC::BunchXID
unsigned short BunchXID(unsigned long int slword)
Definition
decodeSL.cxx:120
TriggerRPC::ROI2
unsigned short int ROI2(unsigned long int slword)
Definition
decodeSL.cxx:52
TriggerRPC::moreThan2
unsigned short int moreThan2(unsigned long int slword)
Definition
decodeSL.cxx:24
TriggerRPC::moreThan1_1
unsigned short moreThan1_1(unsigned long int slword)
Definition
decodeSL.cxx:100
TriggerRPC::OVL2
unsigned short int OVL2(unsigned long int slword)
Definition
decodeSL.cxx:61
TriggerRPC::OVL1
unsigned short int OVL1(unsigned long int slword)
Definition
decodeSL.cxx:43
TriggerRPC::PT2
unsigned short int PT2(unsigned long int slword)
Definition
decodeSL.cxx:85
Generated on
for ATLAS Offline Software by
1.17.0