CbmRoot
Loading...
Searching...
No Matches
CbmMatch.h
Go to the documentation of this file.
1/* Copyright (C) 2013-2020 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer], Florian Uhlig */
4
13#ifndef CBMMATCH_H_
14#define CBMMATCH_H_
15
16#include "CbmLink.h" // for CbmLink
17
18#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
19#include <TObject.h> // for TObject
20
21#include <cstdint>
22#include <memory> // for unique_ptr
23#include <string> // for string
24#include <vector> // for vector
25
26class CbmMatch : public TObject {
27public:
31 CbmMatch();
32
36 virtual ~CbmMatch();
37
38 /* Accessors */
39 const CbmLink& GetLink(int32_t i) const { return fLinks.at(i); }
40 const std::vector<CbmLink>& GetLinks() const { return fLinks; }
41 const CbmLink& GetMatchedLink() const { return fLinks.at(fMatchedIndex); }
42 int32_t GetNofLinks() const { return fLinks.size(); }
43 double GetTotalWeight() const { return fTotalWeight; }
44
45 /* Modifiers */
46 void AddLinks(const CbmMatch& match);
47 void AddLink(const CbmLink& newLink);
48 void AddLink(double weight, int32_t index, int32_t entry = -1, int32_t file = -1);
49 void ClearLinks();
50
55 virtual std::string ToString() const;
56
57protected:
58 std::vector<CbmLink> fLinks; // List of links to MC
59 double fTotalWeight; // Sum of all reference weights
60 int32_t fMatchedIndex; // Index of the matched reference in fReferences array
61
63};
64
65typedef std::unique_ptr<CbmMatch> up_CbmMatch;
66
67#endif /* CBMMATCH_H_ */
std::unique_ptr< CbmMatch > up_CbmMatch
Definition CbmMatch.h:65
void AddLinks(const CbmMatch &match)
Definition CbmMatch.cxx:39
const CbmLink & GetLink(int32_t i) const
Definition CbmMatch.h:39
int32_t GetNofLinks() const
Definition CbmMatch.h:42
double fTotalWeight
Definition CbmMatch.h:59
void AddLink(const CbmLink &newLink)
Definition CbmMatch.cxx:47
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
int32_t fMatchedIndex
Definition CbmMatch.h:60
ClassDef(CbmMatch, 1)
std::vector< CbmLink > fLinks
Definition CbmMatch.h:58
CbmMatch()
Default constructor.
Definition CbmMatch.cxx:21
virtual ~CbmMatch()
Destructor.
Definition CbmMatch.cxx:23
virtual std::string ToString() const
Return string representation of the object.
Definition CbmMatch.cxx:25
double GetTotalWeight() const
Definition CbmMatch.h:43
void ClearLinks()
Definition CbmMatch.cxx:78
const std::vector< CbmLink > & GetLinks() const
Definition CbmMatch.h:40