BmnRoot
Loading...
Searching...
No Matches
BmnMatch.h
Go to the documentation of this file.
1
10#ifndef BMNMATCH_H_
11#define BMNMATCH_H_
12
13#include "TObject.h"
14#include "BmnLink.h"
15#include <string>
16#include <vector>
17#include <algorithm>
18
19using std::string;
20using std::vector;
21using std::pair;
22
23class BmnMatch : public TObject
24{
25public:
30
34 virtual ~BmnMatch();
35
36 /* Accessors */
37 const BmnLink& GetLink(Int_t i) const { return fLinks[i]; }
38 const vector<BmnLink>& GetLinks() const { return fLinks; }
39 const BmnLink& GetMatchedLink() const { return fLinks[fMatchedIndex]; }
40 Int_t GetNofLinks() const { return fLinks.size(); }
41 Double_t GetTotalWeight() const { return fTotalWeight; }
42 Int_t GetMatchedIndex() const { return fMatchedIndex; }
43
44 /* Modifiers */
45 void AddLink(const BmnMatch& match);
46 void AddLinks(const BmnMatch& match) { AddLink(match); }
47 void AddLink(const BmnLink& newLink);
48 void AddLink(Double_t weight, Int_t index, Int_t entry = -1, Int_t file = -1);
49 void ClearLinks();
50
55 virtual string ToString() const;
56
57protected:
58 vector<BmnLink> fLinks; // List of links to MC
59 Double_t fTotalWeight; // Sum of all reference weights
60 Int_t fMatchedIndex; // Index of the matched reference in fReferences array
61
63};
64
65#endif /* BMNMATCH_H_ */
int i
Definition P4_F32vec4.h:22
void AddLinks(const BmnMatch &match)
Definition BmnMatch.h:46
Double_t fTotalWeight
Definition BmnMatch.h:59
virtual ~BmnMatch()
Destructor.
const BmnLink & GetLink(Int_t i) const
Definition BmnMatch.h:37
vector< BmnLink > fLinks
Definition BmnMatch.h:58
Int_t GetMatchedIndex() const
Definition BmnMatch.h:42
Int_t fMatchedIndex
Definition BmnMatch.h:60
Double_t GetTotalWeight() const
Definition BmnMatch.h:41
void AddLink(const BmnMatch &match)
void AddLink(const BmnLink &newLink)
void ClearLinks()
BmnMatch()
Default constructor.
const BmnLink & GetMatchedLink() const
Definition BmnMatch.h:39
virtual string ToString() const
Return string representation of the object.
void AddLink(Double_t weight, Int_t index, Int_t entry=-1, Int_t file=-1)
const vector< BmnLink > & GetLinks() const
Definition BmnMatch.h:38
ClassDef(BmnMatch, 1)
Int_t GetNofLinks() const
Definition BmnMatch.h:40