Belle II Software development
HoughFinder.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 find tracks usning Hough algorithm
11//-----------------------------------------------------------------------------
12
13#ifndef TRGCDCHoughFinder_FLAG_
14#define TRGCDCHoughFinder_FLAG_
15
16#include <string>
17#include "trg/cdc/HoughPlaneMulti2.h"
18#include "trg/cdc/HoughTransformationCircle.h"
19#include "trg/cdc/PeakFinder.h"
21#include <map>
23#ifdef TRGCDC_SHORT_NAMES
24#define TCHFinder TRGCDCHoughFinder
25#endif
26
27namespace Belle2 {
33 class TRGCDC;
34 class TRGCDCPeakFinder;
35 class TRGCDCTrack;
36 class TRGCDCLink;
37 class TRGCDCJSignal;
38 class TRGCDCJLUT;
39 class TRGCDCJSignalData;
40
43
44 public:
45
47 TRGCDCHoughFinder(const std::string& name,
48 const TRGCDC&,
49 unsigned peakMin,
50 const std::string& mappingFilePlus,
51 const std::string& mappingFileMinus,
52 unsigned doit);
53
55 virtual ~TRGCDCHoughFinder();
56
57 public:
58
60 std::string name(void) const;
61
63 std::string version(void) const;
64
66 void terminate();
67
69 int FindAndFit(std::vector<TRGCDCTrack*>& trackList2D,
70 std::vector<TRGCDCTrack*>& trackList2DFitted);
71
72 public:
73
75 bool perfect(bool);
76
77 private:
78
80 int doFindingAndFittingTrasan(std::vector<TRGCDCTrack*>& trackList2D,
81 std::vector<TRGCDCTrack*>& trackList2DFitted);
82
84 int doFindingAndFitting(std::vector<TRGCDCTrack*>& trackList2D,
85 std::vector<TRGCDCTrack*>& trackList2DFitted);
86
88 std::vector<TRGCDCLink*> selectBestHits(
89 const std::vector<TRGCDCLink*>& links) const;
90
92 void mappingByFile(const std::string& mappingFilePlus,
93 const std::string& mappingFileMinus);
94
96 int doFindingTrasan(std::vector<unsigned> peaks[],
97 std::vector<TRGCDCTrack*>& trackList2D) const;
98
100 int doFinding(std::vector<std::vector<unsigned>> peaks[],
101 std::vector<TRGCDCTrack*>& trackList2D);
102
104 int doFittingTrasan(std::vector<unsigned> peaks[],
105 std::vector<TRGCDCTrack*>& trackList2DFitted) const;
106
108 int doFitting(std::vector<TRGCDCTrack*>& trackList2D,
109 std::vector<TRGCDCTrack*>& trackList2DFitted);
110
113 TRGCDCTrack* makeTrack(const unsigned serialID, const unsigned pm) const;
114
116 static double calPhi(TRGCDCSegmentHit const* segmentHit,
117 double eventTime);
118
120 static void calCosPhi(std::map<std::string, Belle2::TRGCDCJSignal>
121 & mSignalStorage,
122 std::map<std::string, Belle2::TRGCDCJLUT* >
123 & mLutStorage);
124
126 static void calSinPhi(std::map<std::string, Belle2::TRGCDCJSignal>
127 & mSignalStorage,
128 std::map<std::string, Belle2::TRGCDCJLUT* >
129 & mLutStorage);
130
132 static void rPhi(std::map<std::string, Belle2::TRGCDCJSignal>
133 & mSignalStorage,
134 std::map<std::string, Belle2::TRGCDCJLUT* >
135 & mLutStorage);
136 private:
137
139 const std::string _name;
140
142 const TRGCDC& _cdc;
143
146
149
151 const unsigned _doit;
152
155
157 const unsigned _peakMin;
158
160 std::map<std::string, double> m_mDouble;
161
163 std::map<std::string, std::vector<double> > m_mVector;
164
166 std::map<std::string, double> m_mConstants;
167
169 std::map<std::string, double> m_mConstD;
170
172 std::map<std::string, std::vector<double> > m_mConstV;
173
175 std::map<std::string, bool> m_mBool;
176
178 std::map<std::string, TRGCDCJSignal> m_mSignalStorage;
179
181 std::map<std::string, TRGCDCJLUT*> m_mLutStorage;
182
185 };
186
187//-----------------------------------------------------------------------------
188
189 inline
190 std::string
192 {
193 return _name;
194 }
195
196
198} // namespace Belle2
199
200#endif
A class to find tracks using Hough algorithm.
Definition: HoughFinder.h:42
bool perfect(bool)
sets and returns switch to do perfect finding.
std::map< std::string, double > m_mConstants
Map to hold const values for Fitter2D.
Definition: HoughFinder.h:166
TRGCDCJSignalData * _commonData
For VHDL code.
Definition: HoughFinder.h:184
std::map< std::string, std::vector< double > > m_mVector
Map to hold vector values for Fitter2D.
Definition: HoughFinder.h:163
const std::string _name
Name.
Definition: HoughFinder.h:139
TRGCDCHoughPlaneMulti2 * _plane[2]
Hough planes, for + and - charges.
Definition: HoughFinder.h:145
std::map< std::string, bool > m_mBool
Map to hold input options.
Definition: HoughFinder.h:175
std::map< std::string, double > m_mConstD
Map to ?
Definition: HoughFinder.h:169
const TRGCDC & _cdc
CDCTRG.
Definition: HoughFinder.h:142
TRGCDCHoughTransformationCircle _circleH
Circle Hough transformtion.
Definition: HoughFinder.h:148
std::map< std::string, TRGCDCJLUT * > m_mLutStorage
Map to hold JLuts.
Definition: HoughFinder.h:181
std::map< std::string, std::vector< double > > m_mConstV
Map to ?
Definition: HoughFinder.h:172
std::map< std::string, double > m_mDouble
Map to hold double values for Fitter2D.
Definition: HoughFinder.h:160
const unsigned _doit
Doit version.
Definition: HoughFinder.h:151
std::map< std::string, TRGCDCJSignal > m_mSignalStorage
Map to hold JSignals.
Definition: HoughFinder.h:178
TRGCDCPeakFinder _peakFinder
Peak finder.
Definition: HoughFinder.h:154
const unsigned _peakMin
Min. peak height for the peak finder.
Definition: HoughFinder.h:157
A class to represent a Hough parameter plane.
A class to represent circle Hough transformation.
A class to hold common data for JSignals.
Definition: JSignalData.h:33
A class to find peaks in Hough Plane.
Definition: PeakFinder.h:33
A class to represent a track segment hit in CDC.
Definition: SegmentHit.h:31
A class to represent a reconstructed charged track in TRGCDC.
Definition: TRGCDCTrack.h:38
The instance of TRGCDC is a singleton.
Definition: TRGCDC.h:69
int doFindingTrasan(std::vector< unsigned > peaks[], std::vector< TRGCDCTrack * > &trackList2D) const
do track finding. (trasan version)
Definition: HoughFinder.cc:196
static void calCosPhi(std::map< std::string, Belle2::TRGCDCJSignal > &mSignalStorage, std::map< std::string, Belle2::TRGCDCJLUT * > &mLutStorage)
Calculate Cos Sin ?
Definition: HoughFinder.cc:412
static void calSinPhi(std::map< std::string, Belle2::TRGCDCJSignal > &mSignalStorage, std::map< std::string, Belle2::TRGCDCJLUT * > &mLutStorage)
Calculate Cos Sin ?
Definition: HoughFinder.cc:440
static double calPhi(TRGCDCSegmentHit const *segmentHit, double eventTime)
Utility functions.
Definition: HoughFinder.cc:400
TRGCDCTrack * makeTrack(const unsigned serialID, const unsigned pm) const
Make a track from serial ID in Hough plane.
int FindAndFit(std::vector< TRGCDCTrack * > &trackList2D, std::vector< TRGCDCTrack * > &trackList2DFitted)
do track finding and fitting (wrapper that can choose between different versions).
Definition: HoughFinder.cc:755
void mappingByFile(const std::string &mappingFilePlus, const std::string &mappingFileMinus)
creates mappings by a file.
Definition: HoughFinder.cc:661
std::vector< TRGCDCLink * > selectBestHits(const std::vector< TRGCDCLink * > &links) const
selects the best(fastest) hits in each super layer.
Definition: HoughFinder.cc:270
virtual ~TRGCDCHoughFinder()
Destructor.
Definition: HoughFinder.cc:184
void terminate()
termination.
Definition: HoughFinder.cc:395
int doFindingAndFitting(std::vector< TRGCDCTrack * > &trackList2D, std::vector< TRGCDCTrack * > &trackList2DFitted)
do track finding and fitting (Kaiyu version).
Definition: HoughFinder.cc:783
int doFindingAndFittingTrasan(std::vector< TRGCDCTrack * > &trackList2D, std::vector< TRGCDCTrack * > &trackList2DFitted)
do track finding and fitting (Trasan version).
Definition: HoughFinder.cc:766
int doFittingTrasan(std::vector< unsigned > peaks[], std::vector< TRGCDCTrack * > &trackList2DFitted) const
do track fitting. (old trasan version)
Definition: HoughFinder.cc:307
int doFitting(std::vector< TRGCDCTrack * > &trackList2D, std::vector< TRGCDCTrack * > &trackList2DFitted)
do track fitting. (kaiyu original)
Definition: HoughFinder.cc:857
std::string name(void) const
returns name.
Definition: HoughFinder.h:191
static void rPhi(std::map< std::string, Belle2::TRGCDCJSignal > &mSignalStorage, std::map< std::string, Belle2::TRGCDCJLUT * > &mLutStorage)
Calculate r * phi ?
Definition: HoughFinder.cc:467
int doFinding(std::vector< std::vector< unsigned > > peaks[], std::vector< TRGCDCTrack * > &trackList2D)
do track finding. (kaiyu version)
Definition: HoughFinder.cc:800
std::string version(void) const
returns version.
Definition: HoughFinder.cc:74
Abstract base class for different kinds of events.