Belle II Software development
Relation.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9//-----------------------------------------------------------------------------
10// Description : A class to represent relations between TrackBase and MC track
11//-----------------------------------------------------------------------------
12
13#ifndef TRGCDCRelation_FLAG_
14#define TRGCDCRelation_FLAG_
15
16#include <map>
17
18#ifdef TRGCDC_SHORT_NAMES
19#define TCRelation TRGCDCRelation
20#endif
21
22#include "trg/cdc/TrackBase.h"
23
24namespace Belle2 {
30//class G4Track;
31 class MCParticle;
32//class TRGCDCTrackBase;
33
36
37 public:
38
41 const std::map<unsigned, unsigned>& relation);
42
44 virtual ~TRGCDCRelation();
45
46 public:// Selectors
47
49 const TRGCDCTrackBase& track(void) const;
50
52 unsigned nContributors(void) const;
53
55// G4Track contributor(unsigned i = 0) const;
56 unsigned contributor(unsigned i = 0) const;
57
59 const MCParticle& mcParticle(unsigned i = 0) const;
60
62 float purity(unsigned i = 0) const;
63
65 float purity3D(unsigned trkID) const;
66
68 float efficiency3D(unsigned trkID, std::map<unsigned, unsigned>& numTSsParticle) const;
69
71 void dump(const std::string& message = std::string(""),
72 const std::string& prefix = std::string("")) const;
73
74 private:
75
78
80 const std::map<unsigned, unsigned> _relations;
81
83 mutable const std::pair<unsigned, unsigned>** _pairs;
84 };
85
86//-----------------------------------------------------------------------------
87
88 inline
89 const TRGCDCTrackBase&
91 {
92 return _track;
93 }
94
95 inline
96 unsigned
98 {
99 return _relations.size();
100 }
101
103} // namespace Belle2
104#endif /* TRGCDCRelation_FLAG_ */
105
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
A class to represent a wire in CDC.
Definition: Relation.h:35
const std::pair< unsigned, unsigned > ** _pairs
Pairs.
Definition: Relation.h:83
const TRGCDCTrackBase & _track
Track.
Definition: Relation.h:77
const std::map< unsigned, unsigned > _relations
Map.
Definition: Relation.h:80
A class to represent a track object in TRGCDC.
Definition: TrackBase.h:40
float efficiency3D(unsigned trkID, std::map< unsigned, unsigned > &numTSsParticle) const
returns efficiency of TS for 3D
Definition: Relation.cc:129
const MCParticle & mcParticle(unsigned i=0) const
returns i'th contributor.
Definition: Relation.cc:79
const TRGCDCTrackBase & track(void) const
returns a track.
Definition: Relation.h:90
virtual ~TRGCDCRelation()
Destructor.
Definition: Relation.cc:35
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
Dumps debug information.
Definition: Relation.cc:156
unsigned nContributors(void) const
returns /# of contributors.
Definition: Relation.h:97
unsigned contributor(unsigned i=0) const
returns i'th contributor of MCParticle.
Definition: Relation.cc:41
float purity(unsigned i=0) const
returns i'th purity.
Definition: Relation.cc:90
float purity3D(unsigned trkID) const
returns purity for 3D for trkID particle which should be from 2D.
Definition: Relation.cc:111
Abstract base class for different kinds of events.