CbmRoot
CbmLink.h
Go to the documentation of this file.
1
9
#ifndef CBMLINK_H_
10
#define CBMLINK_H_
11
12
#include <Rtypes.h>
// for THashConsistencyHolder, ClassDef
13
#include <RtypesCore.h>
// for Int_t, Float_t, Bool_t
14
#include <TObject.h>
// for TObject
15
16
#include <string>
// for string
17
18
class
CbmLink
:
public
TObject {
19
public
:
23
CbmLink
();
24
28
CbmLink
(Float_t weight, Int_t index, Int_t entry = -1, Int_t file = -1);
29
33
virtual
~CbmLink
();
34
35
/* Modifiers */
36
Int_t
GetFile
()
const
{
return
fFile
; }
37
Int_t
GetEntry
()
const
{
return
fEntry
; }
38
Int_t
GetIndex
()
const
{
return
fIndex
; }
39
Float_t
GetWeight
()
const
{
return
fWeight
; }
40
41
/* Accessors */
42
void
SetFile
(Int_t file) {
fFile
= file; }
43
void
SetEntry
(Int_t entry) {
fEntry
= entry; }
44
void
SetIndex
(Int_t index) {
fIndex
= index; }
45
void
SetWeight
(Float_t weight) {
fWeight
= weight; }
46
47
void
AddWeight
(Float_t weight) {
fWeight
+= weight; }
48
53
virtual
std::string
ToString
()
const
;
54
55
friend
Bool_t
operator==
(
const
CbmLink
& lhs,
const
CbmLink
& rhs) {
56
return
(lhs.
GetFile
() == rhs.
GetFile
() && lhs.
GetEntry
() == rhs.
GetEntry
()
57
&& lhs.
GetIndex
() == rhs.
GetIndex
());
58
}
59
61
friend
Bool_t
operator<
(
const
CbmLink
& l,
const
CbmLink
& r) {
62
if
(l.
GetFile
() == r.
GetFile
()) {
63
if
(l.
GetEntry
() == r.
GetEntry
())
return
l.
GetIndex
() < r.
GetIndex
();
64
return
l.
GetEntry
() < r.
GetEntry
();
65
}
66
return
l.
GetFile
() < r.
GetFile
();
67
}
68
69
friend
Bool_t
operator>
(
const
CbmLink
& l,
const
CbmLink
& r) {
70
if
(l.
GetFile
() == r.
GetFile
()) {
71
if
(l.
GetEntry
() == r.
GetEntry
())
return
l.
GetIndex
() > r.
GetIndex
();
72
return
l.
GetEntry
() > r.
GetEntry
();
73
}
74
return
l.
GetFile
() > r.
GetFile
();
75
}
76
77
78
private
:
79
Int_t
fFile
;
// File ID
80
Int_t
fEntry
;
// Entry number
81
Int_t
fIndex
;
// Index in array
82
Float_t
fWeight
;
// Weight
83
84
ClassDef(
CbmLink
, 1)
85
};
86
87
#endif
/* CBMLINK_H_ */
CbmLink::SetWeight
void SetWeight(Float_t weight)
Definition:
CbmLink.h:45
CbmLink::~CbmLink
virtual ~CbmLink()
Destructor.
Definition:
CbmLink.cxx:21
CbmLink::ToString
virtual std::string ToString() const
Return string representation of the object.
Definition:
CbmLink.cxx:23
CbmLink::AddWeight
void AddWeight(Float_t weight)
Definition:
CbmLink.h:47
CbmLink::GetIndex
Int_t GetIndex() const
Definition:
CbmLink.h:38
CbmLink::fFile
Int_t fFile
Definition:
CbmLink.h:79
CbmLink::operator==
friend Bool_t operator==(const CbmLink &lhs, const CbmLink &rhs)
Definition:
CbmLink.h:55
CbmLink::fWeight
Float_t fWeight
Definition:
CbmLink.h:82
CbmLink::GetEntry
Int_t GetEntry() const
Definition:
CbmLink.h:37
CbmLink::SetFile
void SetFile(Int_t file)
Definition:
CbmLink.h:42
CbmLink::fIndex
Int_t fIndex
Definition:
CbmLink.h:81
CbmLink::operator<
friend Bool_t operator<(const CbmLink &l, const CbmLink &r)
Definition:
CbmLink.h:61
CbmLink::SetIndex
void SetIndex(Int_t index)
Definition:
CbmLink.h:44
CbmLink::GetFile
Int_t GetFile() const
Definition:
CbmLink.h:36
CbmLink::CbmLink
CbmLink()
Constructor.
Definition:
CbmLink.cxx:15
CbmLink::SetEntry
void SetEntry(Int_t entry)
Definition:
CbmLink.h:43
CbmLink::fEntry
Int_t fEntry
Definition:
CbmLink.h:80
CbmLink::GetWeight
Float_t GetWeight() const
Definition:
CbmLink.h:39
CbmLink
Definition:
CbmLink.h:18
CbmLink::operator>
friend Bool_t operator>(const CbmLink &l, const CbmLink &r)
Definition:
CbmLink.h:69
core
data
CbmLink.h
Generated on Wed Oct 28 2020 15:11:39 for CbmRoot by
1.8.18