BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMatch.h
Go to the documentation of this file.
1/**
2 * \file BmnMatch.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 RECO-to-MC matching information.
8 **/
9
10#ifndef BMNMATCH_H_
11#define BMNMATCH_H_
12
13#include "BmnLink.h"
14#include "TObject.h"
15
16#include <algorithm>
17#include <string>
18#include <vector>
19
20using std::pair;
21using std::string;
22using std::vector;
23
24class BmnMatch : public TObject
25{
26 public:
27 /**
28 * \brief Default constructor.
29 */
30 BmnMatch();
31
32 /**
33 * \brief Destructor.
34 */
35 virtual ~BmnMatch();
36
37 /* Accessors */
38 const BmnLink& GetLink(Int_t i) const { return fLinks[i]; }
39 const vector<BmnLink>& GetLinks() const { return fLinks; }
40 const BmnLink& GetMatchedLink() const { return fLinks[fMatchedIndex]; }
41 Int_t GetNofLinks() const { return fLinks.size(); }
44
45 /* Modifiers */
46 void AddLink(const BmnMatch& match);
47 void AddLinks(const BmnMatch& match) { AddLink(match); }
48 void AddLink(const BmnLink& newLink);
49 void AddLink(Double_t weight, Int_t index, Int_t entry = -1, Int_t file = -1);
50 void ClearLinks();
51
52 /**
53 * \brief Return string representation of the object.
54 * \return String representation of the object.
55 **/
56 virtual string ToString() const;
57
58 protected:
59 vector<BmnLink> fLinks; // List of links to MC
60 Double_t fTotalWeight; // Sum of all reference weights
61 Int_t fMatchedIndex; // Index of the matched reference in fReferences array
62
64};
65
66#endif /* BMNMATCH_H_ */
int i
Definition P4_F32vec4.h:22
int Int_t
double Double_t
#define ClassDef(name, id)
void AddLinks(const BmnMatch &match)
Definition BmnMatch.h:47
Double_t fTotalWeight
Definition BmnMatch.h:60
const BmnLink & GetLink(Int_t i) const
Definition BmnMatch.h:38
vector< BmnLink > fLinks
Definition BmnMatch.h:59
Int_t GetMatchedIndex() const
Definition BmnMatch.h:43
Int_t fMatchedIndex
Definition BmnMatch.h:61
Double_t GetTotalWeight() const
Definition BmnMatch.h:42
void AddLink(const BmnMatch &match)
Definition BmnMatch.cxx:40
void ClearLinks()
Definition BmnMatch.cxx:81
virtual ~BmnMatch()
Destructor.
Definition BmnMatch.cxx:21
BmnMatch()
Default constructor.
Definition BmnMatch.cxx:15
const BmnLink & GetMatchedLink() const
Definition BmnMatch.h:40
virtual string ToString() const
Return string representation of the object.
Definition BmnMatch.cxx:26
const vector< BmnLink > & GetLinks() const
Definition BmnMatch.h:39
Int_t GetNofLinks() const
Definition BmnMatch.h:41