ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfL1Data
Root
PrescaleSet.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
7
#include "
TrigConfL1Data/PrescaleSet.h
"
8
#include "
TrigConfL1Data/L1PSNumber.h
"
9
#include <iostream>
10
#include <iomanip>
11
#include <math.h>
12
13
using namespace
TrigConf
;
14
15
const
int32_t
PrescaleSet::maxPrescaleCut
= 0xFFFFFF;
//2**24 - 1
16
29
int32_t
30
PrescaleSet::getCutFromPrescale
(
double
prescale) {
31
int32_t
sign
= prescale<0 ? -1 : 1;
32
double
uprescale = fabs(prescale);
33
return
sign
* ( 0x1000000 - int32_t(0xFFFFFF/uprescale));
34
}
35
48
double
49
PrescaleSet::getPrescaleFromCut
(int32_t cut) {
50
double
sign
= cut<0 ? -1 : 1;
51
uint32_t ucut = abs(cut);
52
return
(
sign
* 0xFFFFFF ) / ( 0x1000000 - ucut );
53
}
54
55
void
TrigConf::PrescaleSet::reset
() {
56
for
(
auto
&
x
:
m_Prescales_ctp
)
x
=-1;
57
for
(
auto
&
x
:
m_Prescales_float
)
x
=-1;
58
for
(
auto
&
x
:
m_Cuts
)
x
=-
maxPrescaleCut
;
59
m_null
=
true
;
60
}
61
62
void
63
TrigConf::PrescaleSet::resize
(
size_t
size
) {
64
m_Prescales_ctp
.resize(
size
,-1);
65
m_Prescales_float
.resize(
size
,-1);
66
m_Cuts
.resize(
size
,2<<10);
67
}
68
69
void
70
TrigConf::PrescaleSet::setCuts
(
const
std::vector<int32_t>&
cuts
) {
71
for
(
unsigned
int
ctpid = 0; ctpid <
cuts
.size(); ++ctpid )
72
setCut
(ctpid,
cuts
[ctpid]);
73
}
74
75
76
void
77
TrigConf::PrescaleSet::setCut
(
unsigned
int
ctpid, int32_t cut) {
78
m_Cuts
[ctpid] = cut;
79
m_Prescales_float
[ctpid] =
getPrescaleFromCut
(cut);
80
m_null
=
false
;
81
}
82
83
84
void
85
TrigConf::PrescaleSet::setPrescale
(
unsigned
int
num,
float
prescaleValue) {
86
int32_t cut =
getCutFromPrescale
(prescaleValue);
87
m_Prescales_ctp
[num] = cut;
88
m_Prescales_float
[num] = prescaleValue;
89
m_null
=
false
;
90
}
91
92
93
void
94
TrigConf::PrescaleSet::print
(
const
std::string&
indent
,
unsigned
int
detail
)
const
{
95
if
(
detail
>=1) {
96
std::cout <<
indent
<<
"PrescaleSet "
;
97
printNameIdV
(
""
);
98
if
(
detail
>=3) {
99
int
i(0);
100
for
(
auto
ps:
m_Prescales_float
)
101
std::cout <<
indent
<<
" ctpid="
<< i++ <<
": "
<<
" prescale="
<< ps << std::endl;
102
}
103
}
104
}
105
109
void
110
TrigConf::PrescaleSet::writeXML
(std::ostream &
xmlfile
,
int
indentLevel,
int
indentWidth)
const
{
111
L1PSNumber
psOut;
112
indent
(
xmlfile
, indentLevel, indentWidth)
113
<<
"<PrescaleSet"
114
<<
" name=\""
<<
name
() <<
"\""
115
<<
" type=\""
<<
type
() <<
"\""
116
<<
" menuPartition=\""
<<
partition
() <<
"\">"
117
<< std::endl;
118
119
int
ctpid(0);
120
for
(int32_t cut:
m_Cuts
) {
121
indent
(
xmlfile
, indentLevel + 1, indentWidth)
122
<<
"<Prescale ctpid=\""
<< ctpid++
123
<<
"\" cut=\""
<< (cut<0?
"-"
:
""
) << std::hex << std::setfill(
'0'
) << std::setw(6) << abs(cut)
124
<< std::setfill(
' '
) << std::dec <<
"\" value=\""
<<
getPrescaleFromCut
(cut)
125
<<
"\"/>"
<< std::endl;
126
}
127
indent
(
xmlfile
, indentLevel, indentWidth)
128
<<
"</PrescaleSet>"
<< std::endl;
129
}
L1PSNumber.h
PrescaleSet.h
size
size_t size() const
Number of registered mappings.
sign
int sign(int a)
Definition
TRT_StrawNeighbourSvc.h:108
x
#define x
TrigConf::L1PSNumber
Definition
L1PSNumber.h:33
TrigConf::PrescaleSet::m_null
bool m_null
Definition
PrescaleSet.h:61
TrigConf::PrescaleSet::getCutFromPrescale
static int32_t getCutFromPrescale(double prescale)
calculate cut value for hardware configuration cut = 2*24/prescale - 1
Definition
PrescaleSet.cxx:30
TrigConf::PrescaleSet::type
const std::string & type() const
Definition
PrescaleSet.h:37
TrigConf::PrescaleSet::setCuts
void setCuts(const std::vector< int32_t > &cuts)
Definition
PrescaleSet.cxx:70
TrigConf::PrescaleSet::print
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition
PrescaleSet.cxx:94
TrigConf::PrescaleSet::reset
void reset()
Definition
PrescaleSet.cxx:55
TrigConf::PrescaleSet::setCut
void setCut(unsigned int num, int32_t cut)
Definition
PrescaleSet.cxx:77
TrigConf::PrescaleSet::partition
unsigned int partition() const
Definition
PrescaleSet.h:38
TrigConf::PrescaleSet::cuts
const std::vector< int32_t > & cuts() const
Definition
PrescaleSet.h:41
TrigConf::PrescaleSet::getPrescaleFromCut
static double getPrescaleFromCut(int32_t cut)
prescale = 2*24/(cut+1.)
Definition
PrescaleSet.cxx:49
TrigConf::PrescaleSet::maxPrescaleCut
static const int32_t maxPrescaleCut
Definition
PrescaleSet.h:26
TrigConf::PrescaleSet::m_Cuts
std::vector< int32_t > m_Cuts
Definition
PrescaleSet.h:67
TrigConf::PrescaleSet::writeXML
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Writes the Prescale item to the XML file.
Definition
PrescaleSet.cxx:110
TrigConf::PrescaleSet::setPrescale
void setPrescale(unsigned int num, float prescaleValue)
Definition
PrescaleSet.cxx:85
TrigConf::PrescaleSet::m_Prescales_float
std::vector< float > m_Prescales_float
Definition
PrescaleSet.h:66
TrigConf::PrescaleSet::resize
void resize(size_t size)
Definition
PrescaleSet.cxx:63
TrigConf::PrescaleSet::m_Prescales_ctp
std::vector< int64_t > m_Prescales_ctp
Definition
PrescaleSet.h:65
TrigConf::TrigConfData::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition
TrigConfData.cxx:23
TrigConf::TrigConfData::printNameIdV
void printNameIdV(const std::string &indent="") const
Definition
TrigConfData.cxx:31
xmlfile
static std::vector< std::string > xmlfile
Definition
iLumiCalc.h:29
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition
IDPerfMonZmumu.h:57
detail
Definition
extract_histogram_tag.cxx:14
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0