ATLAS Offline Software
Loading...
Searching...
No Matches
Root::TLumiBlockRange Class Reference

#include <TLumiBlockRange.h>

Inheritance diagram for Root::TLumiBlockRange:
Collaboration diagram for Root::TLumiBlockRange:

Public Member Functions

 TLumiBlockRange ()
 TLumiBlockRange (const Int_t &start, const Int_t &end=2147483647)
virtual ~TLumiBlockRange ()
 TLumiBlockRange (const Root::TLumiBlockRange &other)
TLumiBlockRangeoperator= (const TLumiBlockRange &other)
const Root::TLumiBlockRange GetOverlapWith (const TLumiBlockRange &other) const
const std::vector< Root::TLumiBlockRangeGetPartOnlyIn (const TLumiBlockRange &other) const
const std::vector< Root::TLumiBlockRangeGetPartNotIn (const TLumiBlockRange &other) const
Bool_t Contains (const Int_t &number) const
Int_t Begin () const
Int_t End () const
Bool_t IsEmpty () const
void SetBegin (const Int_t &begin)
void SetEnd (const Int_t &end)
void Summary () const

Private Attributes

Int_t m_begin
Int_t m_end

Detailed Description

Definition at line 21 of file TLumiBlockRange.h.

Constructor & Destructor Documentation

◆ TLumiBlockRange() [1/3]

Root::TLumiBlockRange::TLumiBlockRange ( )

◆ TLumiBlockRange() [2/3]

Root::TLumiBlockRange::TLumiBlockRange ( const Int_t & start,
const Int_t & end = 2147483647 )

Definition at line 20 of file TLumiBlockRange.cxx.

21 : TObject()
22 , m_begin(begin)
23 , m_end(end)
24{
25}

◆ ~TLumiBlockRange()

Root::TLumiBlockRange::~TLumiBlockRange ( )
virtual

Definition at line 28 of file TLumiBlockRange.cxx.

29{
30}

◆ TLumiBlockRange() [3/3]

Root::TLumiBlockRange::TLumiBlockRange ( const Root::TLumiBlockRange & other)

Definition at line 33 of file TLumiBlockRange.cxx.

34 : TObject(other)
35 , m_begin(other.m_begin)
36 , m_end(other.m_end)
37{
38}

Member Function Documentation

◆ Begin()

Int_t Root::TLumiBlockRange::Begin ( ) const
inline

Definition at line 38 of file TLumiBlockRange.h.

38{ return m_begin; }

◆ Contains()

Bool_t Root::TLumiBlockRange::Contains ( const Int_t & number) const

Definition at line 94 of file TLumiBlockRange.cxx.

95{
96 if (number>=m_begin && number<=m_end) return kTRUE;
97 else return kFALSE;
98}
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186

◆ End()

Int_t Root::TLumiBlockRange::End ( ) const
inline

Definition at line 39 of file TLumiBlockRange.h.

39{ return m_end; }

◆ GetOverlapWith()

const Root::TLumiBlockRange Root::TLumiBlockRange::GetOverlapWith ( const TLumiBlockRange & other) const

Definition at line 55 of file TLumiBlockRange.cxx.

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}

◆ GetPartNotIn()

const std::vector< Root::TLumiBlockRange > Root::TLumiBlockRange::GetPartNotIn ( const TLumiBlockRange & other) const

Definition at line 71 of file TLumiBlockRange.cxx.

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}

◆ GetPartOnlyIn()

const std::vector< Root::TLumiBlockRange > Root::TLumiBlockRange::GetPartOnlyIn ( const TLumiBlockRange & other) const

Definition at line 64 of file TLumiBlockRange.cxx.

65{
66 return other.GetPartNotIn(*this);
67}

◆ IsEmpty()

Bool_t Root::TLumiBlockRange::IsEmpty ( ) const
inline

Definition at line 40 of file TLumiBlockRange.h.

40{ return (Begin()>End()); }

◆ operator=()

Root::TLumiBlockRange & Root::TLumiBlockRange::operator= ( const TLumiBlockRange & other)

Definition at line 42 of file TLumiBlockRange.cxx.

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}

◆ SetBegin()

void Root::TLumiBlockRange::SetBegin ( const Int_t & begin)
inline

Definition at line 42 of file TLumiBlockRange.h.

42{ m_begin=begin; }

◆ SetEnd()

void Root::TLumiBlockRange::SetEnd ( const Int_t & end)
inline

Definition at line 43 of file TLumiBlockRange.h.

43{ m_end=end; }

◆ Summary()

void Root::TLumiBlockRange::Summary ( ) const

Definition at line 102 of file TLumiBlockRange.cxx.

103{
104 Root::TMsgLogger m_logger("TLumiBlockRange");
105 m_logger << kINFO << "Begin: " << m_begin << " End: " << m_end << GEndl;
106}
#define GEndl
Definition TMsgLogger.h:147
@ kINFO
Definition TMsgLogger.h:40

Member Data Documentation

◆ m_begin

Int_t Root::TLumiBlockRange::m_begin
private

Definition at line 49 of file TLumiBlockRange.h.

◆ m_end

Int_t Root::TLumiBlockRange::m_end
private

Definition at line 50 of file TLumiBlockRange.h.


The documentation for this class was generated from the following files: