ATLAS Offline Software
Loading...
Searching...
No Matches
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
8
10
11
13 : TObject()
14 , m_begin(0)
15 , m_end(2147483647)
16{
17}
18
19
20Root::TLumiBlockRange::TLumiBlockRange( const Int_t& begin, const Int_t& end )
21 : TObject()
22 , m_begin(begin)
23 , m_end(end)
24{
25}
26
27
31
32
34 : TObject(other)
35 , m_begin(other.m_begin)
36 , m_end(other.m_end)
37{
38}
39
40
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
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
63const std::vector<Root::TLumiBlockRange>
65{
66 return other.GetPartNotIn(*this);
67}
68
69
70const std::vector<Root::TLumiBlockRange>
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
93Bool_t
95{
96 if (number>=m_begin && number<=m_end) return kTRUE;
97 else return kFALSE;
98}
99
100
101void
103{
104 Root::TMsgLogger m_logger("TLumiBlockRange");
105 m_logger << kINFO << "Begin: " << m_begin << " End: " << m_end << GEndl;
106}
107
ClassImp(Root::TLumiBlockRange) Root
#define GEndl
Definition TMsgLogger.h:147
const std::vector< Root::TLumiBlockRange > GetPartNotIn(const TLumiBlockRange &other) const
const std::vector< Root::TLumiBlockRange > GetPartOnlyIn(const TLumiBlockRange &other) const
TLumiBlockRange & operator=(const TLumiBlockRange &other)
Bool_t Contains(const Int_t &number) const
const Root::TLumiBlockRange GetOverlapWith(const TLumiBlockRange &other) const
@ kINFO
Definition TMsgLogger.h:40
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186