ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DataQuality
GoodRunsLists
Root
TLumiBlockRange.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "
GoodRunsLists/TLumiBlockRange.h
"
7
#include "
GoodRunsLists/TMsgLogger.h
"
8
9
ClassImp
(
Root::TLumiBlockRange
)
10
11
12
Root::TLumiBlockRange::TLumiBlockRange
()
13
: TObject()
14
, m_begin(0)
15
, m_end(2147483647)
16
{
17
}
18
19
20
Root::TLumiBlockRange::TLumiBlockRange
(
const
Int_t& begin,
const
Int_t& end )
21
: TObject()
22
,
m_begin
(begin)
23
,
m_end
(end)
24
{
25
}
26
27
28
Root::TLumiBlockRange::~TLumiBlockRange
()
29
{
30
}
31
32
33
Root::TLumiBlockRange::TLumiBlockRange
(
const
Root::TLumiBlockRange
& other)
34
: TObject(other)
35
,
m_begin
(other.
m_begin
)
36
,
m_end
(other.
m_end
)
37
{
38
}
39
40
41
Root::TLumiBlockRange
&
42
Root::TLumiBlockRange::operator=
(
const
Root::TLumiBlockRange
& other)
43
{
44
if
(&other==
this
) {
45
return
*this ;
46
}
47
m_begin
= other.m_begin ;
48
m_end
= other.m_end ;
49
50
return
*this ;
51
}
52
53
54
const
Root::TLumiBlockRange
55
Root::TLumiBlockRange::GetOverlapWith
(
const
TLumiBlockRange
& other)
const
56
{
57
Int_t begin = ( this->
Begin
()>=other.Begin() ? this->
Begin
() : other.Begin() );
58
Int_t end = ( this->
End
()<=other.End() ? this->
End
() : other.End() );
59
return
Root::TLumiBlockRange
(begin,end);
60
}
61
62
63
const
std::vector<Root::TLumiBlockRange>
64
Root::TLumiBlockRange::GetPartOnlyIn
(
const
Root::TLumiBlockRange
& other)
const
65
{
66
return
other.GetPartNotIn(*
this
);
67
}
68
69
70
const
std::vector<Root::TLumiBlockRange>
71
Root::TLumiBlockRange::GetPartNotIn
(
const
Root::TLumiBlockRange
& other)
const
72
{
73
std::vector<Root::TLumiBlockRange> notinother;
74
75
Int_t begin(-1), end(-1);
76
77
if
( other.Begin()>this->Begin() ) {
78
begin = this->
Begin
() ;
79
end = ( other.Begin()>this->
End
() ? this->
End
() : other.Begin()-1 ) ;
80
if
(end>=begin) notinother.push_back(
Root::TLumiBlockRange
(begin,end) ) ;
81
}
82
83
if
( other.End()<this->End() ) {
84
begin = ( other.End()>=this->
Begin
() ? other.End()+1 : this->Begin() ) ;
85
end = this->
End
();
86
if
(end>=begin) notinother.push_back(
Root::TLumiBlockRange
(begin,end) ) ;
87
}
88
89
return
notinother;
90
}
91
92
93
Bool_t
94
Root::TLumiBlockRange::Contains
(
const
Int_t&
number
)
const
95
{
96
if
(
number
>=
m_begin
&&
number
<=
m_end
)
return
kTRUE;
97
else
return
kFALSE;
98
}
99
100
101
void
102
Root::TLumiBlockRange::Summary
()
const
103
{
104
Root::TMsgLogger
m_logger(
"TLumiBlockRange"
);
105
m_logger <<
kINFO
<<
"Begin: "
<<
m_begin
<<
" End: "
<<
m_end
<<
GEndl
;
106
}
107
ClassImp
ClassImp(Root::TLumiBlockRange) Root
Definition
TLumiBlockRange.cxx:9
TLumiBlockRange.h
TMsgLogger.h
GEndl
#define GEndl
Definition
TMsgLogger.h:147
Root::TLumiBlockRange
Definition
TLumiBlockRange.h:21
Root::TLumiBlockRange::~TLumiBlockRange
virtual ~TLumiBlockRange()
Definition
TLumiBlockRange.cxx:28
Root::TLumiBlockRange::GetPartNotIn
const std::vector< Root::TLumiBlockRange > GetPartNotIn(const TLumiBlockRange &other) const
Definition
TLumiBlockRange.cxx:71
Root::TLumiBlockRange::GetPartOnlyIn
const std::vector< Root::TLumiBlockRange > GetPartOnlyIn(const TLumiBlockRange &other) const
Definition
TLumiBlockRange.cxx:64
Root::TLumiBlockRange::m_begin
Int_t m_begin
Definition
TLumiBlockRange.h:49
Root::TLumiBlockRange::Summary
void Summary() const
Definition
TLumiBlockRange.cxx:102
Root::TLumiBlockRange::TLumiBlockRange
TLumiBlockRange()
Root::TLumiBlockRange::operator=
TLumiBlockRange & operator=(const TLumiBlockRange &other)
Definition
TLumiBlockRange.cxx:42
Root::TLumiBlockRange::End
Int_t End() const
Definition
TLumiBlockRange.h:39
Root::TLumiBlockRange::Begin
Int_t Begin() const
Definition
TLumiBlockRange.h:38
Root::TLumiBlockRange::Contains
Bool_t Contains(const Int_t &number) const
Definition
TLumiBlockRange.cxx:94
Root::TLumiBlockRange::GetOverlapWith
const Root::TLumiBlockRange GetOverlapWith(const TLumiBlockRange &other) const
Definition
TLumiBlockRange.cxx:55
Root::TLumiBlockRange::m_end
Int_t m_end
Definition
TLumiBlockRange.h:50
Root::TMsgLogger
Definition
TMsgLogger.h:47
Root::kINFO
@ kINFO
Definition
TMsgLogger.h:40
number
std::string number(const double &d, const std::string &s)
Definition
utils.cxx:186
Generated on
for ATLAS Offline Software by
1.17.0