-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.h
152 lines (131 loc) · 3.6 KB
/
error.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#pragma once
#ifndef ERROR_H
#define ERROR_H
#include <vector>
#include "CoordGrid.h"
#include "trackObject.h"
#include "pathCandidate.h"
// Structure holding per event errors
typedef struct EvtErrorStruct{
// public:
// Constructor
EvtErrorStruct()
: nMCTracks(0),
nRecoTracks(0),
UnderMerge(0.0),
OverMerge(0.0),
TotalError(0.0),
UnderMergeNorm(0.0),
OverMergeNorm(0.0),
TotalErrorNorm(0.0){};
// Destructor
virtual ~EvtErrorStruct(){};
// Local variables(Per image values)
size_t nMCTracks;// MC-Tracks
size_t nRecoTracks;// Reconstructed
float UnderMerge;
float OverMerge;
float TotalError;
// Pre-normalized values
float UnderMergeNorm;
float OverMergeNorm;
float TotalErrorNorm;
// double tr_E;
} EvtErrorStruct;
////////////////////////////////
//_____ Structure to hold error evaluation parameters _____
typedef struct TrackErrorStruct{
// public:
// Constructor
TrackErrorStruct()
: isComplex(0),
isNotmatched(0),
MCTrackLength(0),
RecoTrackLength(0),
IntersectionLength(0),
UnionLength(0),
F1score(0),
MC_px(0.0),
MC_py(0.0),
MC_pz(0.0),
MC_a(0.0),
MC_b(0.0),
MC_r1(0.0), // Using MCSTTPoints
MC_r2(0.0), // Using MCHitsCoords
tr_a(0.0),
tr_b(0.0),
tr_rIsoRand(0.0),
tr_rIsoRand16(0.0),
tr_rIsoRand84(0.0),
tr_rAnc(0.0),
tr_rPts(0.0),
tr_scattAngle(-1.),
tr_rank(0),
tr_isClone(0){};
// Destructor
virtual ~TrackErrorStruct(){};
// Local variables
int isComplex;
float isNotmatched;
float F1score;
size_t MatchIndex;
size_t MCTrackLength;
size_t RecoTrackLength;
size_t IntersectionLength;
size_t UnionLength;
/*Curvature parameters for members.*/
double MC_px;
double MC_py;
double MC_pz;
double MC_a;
double MC_b;
double MC_r1;
double MC_r2;
// Reco tracklets
double tr_a;
double tr_b;
double tr_rIsoRand;
double tr_rIsoRand16;
double tr_rIsoRand84;
double tr_rAnc;
double tr_rPts;
double tr_scattAngle;
int tr_rank;
int tr_isClone;
// Displacements of coordinates average
double MeanDiffX;
double MeanDiffY;
double MeanDiffZ;
// Displacements vectors
std::vector<float> DiffX;
std::vector<float> DiffY;
std::vector<float> DiffZ;
} TrackErrorStruct;
////////////////////////////////
/**
*@param
*/
bool sortbysec2(const pair<int,int> &a,
const pair<int,int> &b)
{
return (a.second > b.second);
}
//void complexSectors(CoordGrid &gr, std::vector< int > &activeId, std::vector< int >* sectorTC);
void ComplexTracks(CoordGrid &gr,
std::vector< MCTrackObject* > const *MCTracks,
std::vector< int > *ListIDComplex);
EvtErrorStruct* ComputeGlobalEvtErrors(CoordGrid &gr,
std::vector< MCTrackObject* > const *MCTracks,
std::vector< std::set<int>* > const *RecoTracks);
std::vector< TrackErrorStruct* >* ComputeErrorPerRecoTrack(CoordGrid const &hitMap,
std::vector < MCTrackObject* > const *MCTracks,
std::vector < PathCandidate* > const *RecoTracks,
std::vector<int > &ListIDComplex,
std::vector<int > &IDMatchesMCReco);
std::vector< TrackErrorStruct* >* PandaErrorMetric(CoordGrid const &hitMap,
std::vector < MCTrackObject* > const *MCTracks,
std::vector < PathCandidate* > const *RecoTracks);
std::vector< int > MatchBestRecoToMC( CoordGrid const &hitMap,
std::vector < MCTrackObject* > const *MCTracks,
std::vector < PathCandidate* > const *tracklets );
#endif