ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfL1Data
Root
Random.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigConfL1Data/Random.h
"
6
#include "
TrigConfL1Data/PrescaleSet.h
"
7
#include <iostream>
8
#include <math.h>
9
10
using namespace
std
;
11
12
TrigConf::Random::Random
() :
L1DataBaseclass
(),
13
m_rate1
( 0 ),
m_rate2
( 0 ),
14
m_names
{
"Random0"
,
"Random1"
,
15
"Random2"
,
"Random3"
},
16
m_cuts
{ 0xffffff, 0xffffff, 0xffffff,
17
0xffffff }
18
{}
19
20
float
21
TrigConf::Random::getRateFromCut
(
unsigned
int
idx)
const
{
22
int32_t cut =
m_cuts
[idx];
23
float
ucut = abs(cut);
24
return
( 0x1000000 / ( ucut + 1 ) );
25
}
26
27
void
28
TrigConf::Random::print
(
const
std::string&
indent
,
unsigned
int
detail
)
const
{
29
if
(
detail
>=1) {
30
cout <<
indent
<<
"Random "
;
printNameIdV
();
31
if
(
detail
>=2) {
32
if
(
m_cuts
[0]!=0xffffffff ||
33
m_cuts
[1]!=0xffffffff ||
34
m_cuts
[2]!=0xffffffff ||
35
m_cuts
[3]!=0xffffffff )
36
{
37
for
(
int
i=0; i<4; i++) {
38
cout <<
indent
<<
" "
<<
m_names
[i] <<
": cut="
<<
m_cuts
[i] <<
" (prescale="
<<
PrescaleSet::getPrescaleFromCut
(
m_cuts
[i]) <<
")"
<< endl;
39
}
40
}
else
{
41
cout <<
indent
<<
" Rate 1: "
<<
m_rate1
<< endl;
42
cout <<
indent
<<
" Rate 2: "
<<
m_rate2
<< endl;
43
}
44
}
45
}
46
}
47
48
void
49
TrigConf::Random::writeXML
(std::ostream &
xmlfile
,
int
indentLevel,
int
indentWidth)
const
{
50
if
(
m_cuts
[0]!=0xffffffff ||
51
m_cuts
[1]!=0xffffffff ||
52
m_cuts
[2]!=0xffffffff ||
53
m_cuts
[3]!=0xffffffff )
54
{
55
indent
(
xmlfile
,indentLevel, indentWidth)
56
<<
"<Random "
57
<<
"name0=\""
<<
m_names
[0] <<
"\" cut0=\""
<<
m_cuts
[0] <<
"\" "
58
<<
"name1=\""
<<
m_names
[1] <<
"\" cut1=\""
<<
m_cuts
[1] <<
"\" "
59
<<
"name2=\""
<<
m_names
[2] <<
"\" cut2=\""
<<
m_cuts
[2] <<
"\" "
60
<<
"name3=\""
<<
m_names
[3] <<
"\" cut3=\""
<<
m_cuts
[3] <<
"\"/>"
<< endl;
61
}
else
{
62
indent
(
xmlfile
,indentLevel, indentWidth)
63
<<
"<Random name=\""
<<
name
() <<
"\" rate1=\""
<<
m_rate1
64
<<
"\" rate2=\""
<<
m_rate2
65
<<
"\" seed1=\"1\" seed2=\"1\"/>"
<< endl;
66
}
67
}
PrescaleSet.h
Random.h
TrigConf::L1DataBaseclass::L1DataBaseclass
L1DataBaseclass()
Definition
L1DataBaseclass.h:24
TrigConf::PrescaleSet::getPrescaleFromCut
static double getPrescaleFromCut(int32_t cut)
prescale = 2*24/(cut+1.)
Definition
PrescaleSet.cxx:52
TrigConf::Random::m_names
std::string m_names[4]
Definition
TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h:40
TrigConf::Random::m_rate1
int m_rate1
Definition
TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h:38
TrigConf::Random::getRateFromCut
float getRateFromCut(unsigned int idx) const
Definition
Random.cxx:21
TrigConf::Random::m_rate2
int m_rate2
Definition
TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h:39
TrigConf::Random::print
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition
Random.cxx:28
TrigConf::Random::m_cuts
uint32_t m_cuts[4]
Definition
TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h:41
TrigConf::Random::Random
Random()
Definition
Random.cxx:12
TrigConf::Random::writeXML
virtual void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Definition
Random.cxx:49
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
detail
Definition
extract_histogram_tag.cxx:14
std
STL namespace.
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0