ATLAS Offline Software
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 
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 
29 {
30 }
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() );
60 }
61 
62 
63 const std::vector<Root::TLumiBlockRange>
65 {
66  return other.GetPartNotIn(*this);
67 }
68 
69 
70 const 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 
93 Bool_t
95 {
96  if (number>=m_begin && number<=m_end) return kTRUE;
97  else return kFALSE;
98 }
99 
100 
101 void
103 {
104  Root::TMsgLogger m_logger("TLumiBlockRange");
105  m_logger << kINFO << "Begin: " << m_begin << " End: " << m_end << GEndl;
106 }
107 
TLumiBlockRange.h
ClassImp
ClassImp(Root::TLumiBlockRange) Root
Definition: TLumiBlockRange.cxx:9
Root::TLumiBlockRange::~TLumiBlockRange
virtual ~TLumiBlockRange()
Definition: TLumiBlockRange.cxx:28
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
Root::TLumiBlockRange::operator=
TLumiBlockRange & operator=(const TLumiBlockRange &other)
Definition: TLumiBlockRange.cxx:42
GEndl
#define GEndl
Definition: TMsgLogger.h:151
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Root::kINFO
@ kINFO
Definition: TMsgLogger.h:50
python.selection.number
number
Definition: selection.py:20
Root::TLumiBlockRange::GetPartOnlyIn
const std::vector< Root::TLumiBlockRange > GetPartOnlyIn(const TLumiBlockRange &other) const
Definition: TLumiBlockRange.cxx:64
Root::TLumiBlockRange::Contains
Bool_t Contains(const Int_t &number) const
Definition: TLumiBlockRange.cxx:94
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
Root::TLumiBlockRange
Definition: TLumiBlockRange.h:26
Root::TLumiBlockRange::TLumiBlockRange
TLumiBlockRange()
Root::TLumiBlockRange::GetPartNotIn
const std::vector< Root::TLumiBlockRange > GetPartNotIn(const TLumiBlockRange &other) const
Definition: TLumiBlockRange.cxx:71
Root::TLumiBlockRange::GetOverlapWith
const Root::TLumiBlockRange GetOverlapWith(const TLumiBlockRange &other) const
Definition: TLumiBlockRange.cxx:55
TMsgLogger.h
Root::TLumiBlockRange::Summary
void Summary() const
Definition: TLumiBlockRange.cxx:102
Root::TMsgLogger
Definition: TMsgLogger.h:52