Belle II Software development
Hough3DUtility.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#ifndef HOUGH3DUTILITY_H
9#include <vector>
10#include <TVectorD.h>
11#define HOUGH3DUTILITY_H
12
13namespace Belle2 {
18 class TRGCDCJSignal;
19 class TRGCDCJLUT;
20 class TRGCDCJSignalData;
22}
23
26public:
28 Hough3DFinder(void);
30 ~Hough3DFinder(void);
36 void setMode(int mode);
38 int getMode(void);
42 void initialize(const TVectorD& geometryVariables, std::vector<float >& initVariables);
44 void destruct(void);
48 void runFinder(const std::vector<double>& trackVariables, std::vector<std::vector<double> >& stTSs,
49 const std::vector<std::vector<int> >& stTSDrift);
52 void initVersion1(const std::vector<float >& initVariables);
54 void initVersion2(std::vector<float >& initVariables);
56 void initVersion3(std::vector<float >& initVariables);
58 void setInputFileName(const std::string& inputFileName);
60 void destVersion1(void);
62 void destVersion2(void);
64 void destVersion3(void);
66 void runFinderVersion1(const std::vector<double>& trackVariables, const std::vector<std::vector<double> >& stTSs,
67 const std::vector<double>& tsArcS,
68 const std::vector<std::vector<double> >& tsZ);
70 void runFinderVersion2(const std::vector<double>& trackVariables, std::vector<std::vector<double> >& stTSs,
71 const std::vector<std::vector<int> >& stTSDrift);
73 void runFinderVersion3(const std::vector<double>& trackVariables, std::vector<std::vector<double> >& stTSs,
74 const std::vector<std::vector<int> >& stTSDrift);
76 void getValues(const std::string& input, std::vector<double>& result);
78 void getHoughMeshLayer(bool***& houghMeshLayer);
81 int m_mode;
83 int m_nWires[4];
85 double m_rr[4];
87 double m_ztostraw[4];
89 double m_anglest[4];
92 double m_cotStart;
94 double m_cotEnd;
96 double m_z0Start;
98 double m_z0End;
116 bool** m_hitMap;
121 std::vector< std::vector< int> >* m_geoCandidatesIndex;
123 std::vector< std::vector< double> >* m_geoCandidatesPhi;
125 std::vector< std::vector< double> >* m_geoCandidatesDiffStWires;
127 double m_stAxPhi[4];
130 double m_bestCot;
132 double m_bestZ0;
138 double m_foundZ[4];
140 double m_foundPhiSt[4];
144 double m_bestTS[4];
147 std::string m_inputFileName;
150 std::vector<double> m_FPGAInput;
154 std::vector<double> m_FPGAOutput;
190 double m_rhoMax;
192 double m_rhoMin;
196 double m_phi0Max;
198 double m_phi0Min;
205 bool m_LUT;
210
212 std::map<std::string, Belle2::TRGCDCJSignal> m_mSignalStorage;
214 std::map<std::string, Belle2::TRGCDCJLUT*> m_mLutStorage;
218 std::map<std::string, std::vector<signed long long> > m_mSavedSignals;
220 std::map<std::string, std::vector<signed long long> > m_mSavedIoSignals;
222 std::map<std::string, bool> m_mBool;
227
228
229};
230
231#ifdef __CINT__
232#include "../src/Hough3DUtility.cc"
233#endif
234
235#endif
A class to hold common data for JSignals.
Definition: JSignalData.h:33
A class to finded stereo TS hits related to 2D tracks.
void initialize(const TVectorD &geometryVariables, std::vector< float > &initVariables)
Geometry variables.
bool m_LUT
FPGA LUTs A flag to check if acos LUT and wire convert LUT was set for geo finder.
double m_findPhi0Max
Holds the maximum value for phi0.
int m_nWires[4]
Holds the number of wires for stereo superlayer.
double m_findRhoMin
Holds the minimum value for rho.
bool *** m_houghMeshLayer
Map to check if there is a Hough vote in a stereo superlayer.
double m_houghMax
The maximum vote number for track.
std::vector< std::vector< double > > * m_geoCandidatesDiffStWires
The number of wires difference from fitted axial phi location.
void runFinderVersion3(const std::vector< double > &trackVariables, std::vector< std::vector< double > > &stTSs, const std::vector< std::vector< int > > &stTSDrift)
Uses the 3D finder for mode 3.
std::vector< std::vector< double > > * m_geoCandidatesPhi
The phi for stereo superlayer hits.
std::map< std::string, bool > m_mBool
Map to hold input options.
Belle2::TRGCDCJSignalData * m_commonData
For VHDL code.
double m_findPhiZMin
Holds the minimum value for fitted axial phi location between superlayers.
double m_cotEnd
Hough mesh cot end range.
double m_z0StepSize
Holds the size of Hough mesh for z0.
std::map< std::string, std::vector< signed long long > > m_mSavedSignals
Array of saved signals.
std::string m_outputVhdlDirname
Output directory for vhdl.
int ** m_wireConvertLUT
Memory for wire convert LUT.
double m_findArcCosMax
Holds the maximum value for arc cos(radius/2/rho).
void destVersion3(void)
Destructs the 3D finder for mode 3.
double m_rr[4]
Holds the radius for stereo super layer in cm.
double m_cotStart
Hough finder variables.
bool ** m_hitMap
Hit map for all streo superlayers.
double m_bestCot
Finder results.
void initVersion1(const std::vector< float > &initVariables)
Init variables.
double m_stAxPhi[4]
The fitted axial phi for stereo superlayers.
double m_findRhoIntMin
Holds the minimum value for integer rho.
double m_findPhiZMax
Holds the maximum for fitted axial phi location between superlayers.
double m_findArcCosIntMax
Holds the maximum value for intger arc cos(radius/2/rho).
double m_anglest[4]
Holds the tan theta of streo super layer in radian.
int m_mode
Members.
double m_findPhi0Min
Holds the minimum value for phi0.
Hough3DFinder(void)
3D finder constructor.
double m_findPhi0IntMin
Holds the minimum value for integer phi0.
int m_phi0Bit
The number of bits of phi0 for integer geo finder.
std::string m_inputFileName
Version3 (GeoFinder Integer space) GeoFinder input file for parameters.
int ** m_driftMap
Drift map for all streo superlayers.
void runFinderVersion2(const std::vector< double > &trackVariables, std::vector< std::vector< double > > &stTSs, const std::vector< std::vector< int > > &stTSDrift)
Uses the 3D finder for mode 2.
void setInputFileName(const std::string &inputFileName)
Sets the config file for the GeoFinder.
std::map< std::string, Belle2::TRGCDCJSignal > m_mSignalStorage
Map to hold JSignals.
std::string m_outputLutDirname
Output directory for luts.
float ** m_houghMeshDiff
Map that combines the z differences for all stereo superlayers.
void destVersion2(void)
Destructs the 3D finder for mode 2.
int m_nCotSteps
Number of Hough meshes for cot.
int m_nZ0Steps
Number of Hough meshes for z0.
double m_ztostraw[4]
Holds the length of for stereo super layer from center in cm.
~Hough3DFinder(void)
3D finder destructor.
double m_z0Start
Hough mesh z0 start range.
double m_findPhiZIntMax
Holds the maximum value for fitted integer axial phi location between superlayers.
int getMode(void)
Gets which 3D finder is used.
double m_phi0Max
The phi0 max value for integer geo finder.
Hough3DFinder(Hough3DFinder &)=delete
Copy constructor, deleted.
double m_bestTS[4]
The phi location of the found TSs.
double m_findRhoIntMax
Holds the maximum value for integer rho.
void initVersion2(std::vector< float > &initVariables)
Initializes the 3D finder for mode 2.
void setMode(int mode)
Sets which 3D finder to use.
double m_findArcCosIntMin
Holds the minimum value for intger arc cos(radius/2/rho).
float *** m_houghMeshLayerDiff
Hold the minimum z differences for the Hough vote in a stereo superlayer.
double m_minDiffHough
The minimum z diff between all Hough votes that have maximum vote number.
std::vector< std::vector< int > > * m_geoCandidatesIndex
GeoFinder Variables.
double m_foundPhiSt[4]
The phi location for streo superlayer using found z0 and cot values for track.
void runFinder(const std::vector< double > &trackVariables, std::vector< std::vector< double > > &stTSs, const std::vector< std::vector< int > > &stTSDrift)
Track variables.
double m_bestZ0
The found z0 value for track.
int ** m_arcCosLUT
Memory for acos LUT.
double m_cotStepSize
Holds the size of Hough mesh for cot.
void initVersion3(std::vector< float > &initVariables)
Initializes the 3D finder for mode 3.
int m_rhoBit
The number of bits of rho for integer geo finder.
double m_z0End
Hough mesh z0 end range.
void getValues(const std::string &input, std::vector< double > &result)
Gets results from the 3D finder.
void getHoughMeshLayer(bool ***&houghMeshLayer)
Gets the Hough plane for the 3D finder.
double m_rhoMax
Integer space The rho max value for integer geo finder.
int m_stAxWireFactor
A factor that changes phi space to wire space.
double m_findPhiZIntMin
Holds the minimum value for fitted integer axial phi location between superlayers.
double m_rhoMin
The rho min value for integer geo finder.
double m_phi0Min
The phi0 min value for integer geo finder.
Hough3DFinder & operator=(Hough3DFinder &)=delete
Assignment operator, deleted.
double m_findArcCosMin
Holds the minimum value for arc cos(radius/2/rho).
double m_foundZ[4]
The z location for stereo superlayer using found z0 and cot values for track.
void destVersion1(void)
Destructs the 3D finder for mode 1.
std::map< std::string, std::vector< signed long long > > m_mSavedIoSignals
Array of I/O signals.
std::map< std::string, Belle2::TRGCDCJLUT * > m_mLutStorage
Map to hold JLuts.
double m_findPhi0IntMax
Holds the maximum value for integer phi0.
std::vector< double > m_FPGAInput
[rho, phi0, sign] Holds input values of the GeoFinder.
void destruct(void)
Destructs the 3D finder.
void runFinderVersion1(const std::vector< double > &trackVariables, const std::vector< std::vector< double > > &stTSs, const std::vector< double > &tsArcS, const std::vector< std::vector< double > > &tsZ)
Uses the 3D finder for mode 1.
std::vector< double > m_FPGAOutput
[arcCos0, arcCos1, arcCos2, arcCos3, bestTSIndex0, bestTSIndex1, bestTSIndex2, bestTSIndex3] Holds ou...
double m_findRhoMax
Find min and max values Holds the maximum value for rho.
int ** m_houghMesh
Map that combines the number of Hough votes for all stereo superlayers.
int m_bestTSIndex[4]
The hit index of the found TSs.
Abstract base class for different kinds of events.