BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnLink.h
Go to the documentation of this file.
1/**
2 * \file BmnLink.h
3 * \author Andrey Lebedev <andrey.lebedev@gsi.de> - original author for CBM experiment
4 * \author Sergey Merts <sergey.merts@gmail.com> - modifications for BMN experiment
5 * \date 2013-2014
6 *
7 * Base data class for storing MC information link.
8 **/
9
10#ifndef BMNLINK_H_
11#define BMNLINK_H_
12
13#include "TObject.h"
14
15#include <string>
16
17using std::string;
18
19class BmnLink : public TObject
20{
21 public:
22 /**
23 * \brief Constructor.
24 */
26
27 /**
28 * \brief Standard constructor.
29 */
30 BmnLink(Float_t weight, Int_t index, Int_t entry = -1, Int_t file = -1);
31
32 /**
33 * \brief Destructor.
34 */
35 virtual ~BmnLink();
36
37 /* Modifiers */
38 Int_t GetFile() const { return fFile; }
39 Int_t GetEntry() const { return fEntry; }
40 Int_t GetIndex() const { return fIndex; }
41 Float_t GetWeight() const { return fWeight; }
42
43 /* Accessors */
44 void SetFile(Int_t file) { fFile = file; }
45 void SetEntry(Int_t entry) { fEntry = entry; }
46 void SetIndex(Int_t index) { fIndex = index; }
47 void SetWeight(Float_t weight) { fWeight = weight; }
48
49 void AddWeight(Float_t weight) { fWeight += weight; }
50
51 /**
52 * \brief Return string representation of the object.
53 * \return String representation of the object.
54 **/
55 virtual string ToString() const;
56
57 friend Bool_t operator==(const BmnLink& lhs, const BmnLink& rhs)
58 {
59 return (lhs.GetFile() == rhs.GetFile() && lhs.GetEntry() == rhs.GetEntry() && lhs.GetIndex() == rhs.GetIndex());
60 }
61
62 private:
63 Int_t fFile; // File ID
64 Int_t fEntry; // Entry number
65 Int_t fIndex; // Index in array
66 Float_t fWeight; // Weight
67
69};
70
71#endif /* BMNLINK_H_ */
bool Bool_t
int Int_t
float Float_t
#define ClassDef(name, id)