EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
CbmRichReconstruction.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file CbmRichReconstruction.cxx
1
8
#include "
CbmRichReconstruction.h
"
9
#include "
CbmRichRing.h
"
10
11
#include "
CbmRichProjectionProducer.h
"
12
#include "
prototype/CbmRichProtProjectionProducer.h
"
13
14
#include "
CbmRichTrackExtrapolationBase.h
"
15
#include "
CbmRichTrackExtrapolationIdeal.h
"
16
#include "
CbmRichTrackExtrapolationMirrorIdeal.h
"
17
#include "
CbmRichTrackExtrapolationKF.h
"
18
19
#include "CbmRichRingFinderHough.h"
20
#include "
CbmRichRingFinderIdeal.h
"
21
//@@#include "CbmL1RichENNRingFinder.h"
22
//#include "CbmL1RichENNRingFinderParallel.h"
23
#include "
prototype/CbmRichProtRingFinderHough.h
"
24
25
#include "
CbmRichRingFitterCircle.h
"
26
#include "
CbmRichRingFitterTAU.h
"
27
#include "
CbmRichRingFitterCOP.h
"
28
#include "
CbmRichRingFitterRobustCOP.h
"
29
#include "
CbmRichRingFitterEllipseTau.h
"
30
#include "
CbmRichRingFitterEllipseMinuit.h
"
31
32
#include "
CbmRichRingTrackAssignClosestD.h
"
33
34
#include "
FairHit.h
"
35
#include "
CbmGlobalTrack.h
"
36
#include "
FairRootManager.h
"
37
#include "
FairLogger.h
"
38
#include "
CbmRichConverter.h
"
39
#include "TClonesArray.h"
40
41
#include <iostream>
42
43
using
std::cout;
44
using
std::endl;
45
46
CbmRichReconstruction::CbmRichReconstruction
()
47
:
FairTask
(
"CbmRichReconstruction"
),
48
fRichHits(NULL),
49
fRichRings(NULL),
50
fRichProjections(NULL),
51
fRichTrackParamZ(NULL),
52
fGlobalTracks(NULL),
53
54
fRingFinder(NULL),
55
fRingFitter(NULL),
56
fTrackExtrapolation(NULL),
57
fProjectionProducer(NULL),
58
fRingTrackAssign(NULL),
59
60
fRunExtrapolation(
true
),
61
fRunProjection(
true
),
62
fRunFinder(
true
),
63
fRunFitter(
true
),
64
fRunTrackAssign(
true
),
65
66
fExtrapolationName(
"kf"
),
67
fProjectionName(
"standard"
),
68
fFinderName(
"hough"
),
69
fFitterName(
"ellipse_tau"
),
70
fTrackAssignName(
"closest_distance"
),
71
72
fZTrackExtrapolation(300.),
73
fMinNofStsHits(4)
74
{
75
76
}
77
78
CbmRichReconstruction::~CbmRichReconstruction
()
79
{
80
if
(NULL !=
fRingFinder
)
delete
fRingFinder
;
81
if
(NULL !=
fRingFitter
)
delete
fRingFitter
;
82
if
(NULL !=
fTrackExtrapolation
)
delete
fTrackExtrapolation
;
83
if
(NULL !=
fProjectionProducer
)
delete
fProjectionProducer
;
84
}
85
86
void
CbmRichReconstruction::SetParContainers
()
87
{
88
if
(
fProjectionName
==
"standard"
)
fProjectionProducer
=
new
CbmRichProjectionProducer
(1);
89
else
if
(
fProjectionName
==
"prototype"
)
fProjectionProducer
=
new
CbmRichProtProjectionProducer
(1);
90
else
{
91
LOG(
FATAL
) <<
fProjectionName
<<
" is not correct name for projection algorithm."
<<
FairLogger::endl
;
92
// Fatal("CbmRichReconstruction::",(fProjectionName + string(" is not correct name for projection algorithm.")).c_str());
93
}
94
fProjectionProducer
->
SetParContainers
();
95
}
96
97
InitStatus
CbmRichReconstruction::Init
()
98
{
99
cout <<
"CbmRichReconstruction::Init"
<<endl;
100
FairRootManager
* ioman =
FairRootManager::Instance
();
101
if
(NULL == ioman) { Fatal(
"CbmRichReconstruction::Init"
,
"RootManager not instantised!"
); }
102
103
if
(
fRunExtrapolation
) {
104
fRichTrackParamZ
=
new
TClonesArray(
"FairTrackParam"
,100);
105
ioman->
Register
(
"RichTrackParamZ"
,
"RICH"
,
fRichTrackParamZ
, kFALSE);
106
}
//if
107
if
(
fRunExtrapolation
&&
fRunProjection
) {
108
#if _MODIFY_
109
fGlobalTracks
= (TClonesArray*) ioman->
GetObject
(
"GlobalTrack"
);
110
if
( NULL ==
fGlobalTracks
) { Fatal(
"CbmRichReconstruction::Init"
,
"No GlobalTrack array!"
);}
111
#endif
112
fRichProjections
=
new
TClonesArray(
"FairTrackParam"
);
113
ioman->
Register
(
"RichProjection"
,
"RICH"
,
fRichProjections
, kTRUE);
114
}
115
fRichHits
= (TClonesArray*) ioman->
GetObject
(
"RichHit"
);
116
if
( NULL ==
fRichHits
) { Fatal(
"CbmRichReconstruction::Init"
,
"No RichHit array!"
); }
117
118
fRichRings
=
new
TClonesArray(
"CbmRichRing"
, 100);
119
ioman->
Register
(
"RichRing"
,
"RICH"
,
fRichRings
, kTRUE);
120
121
if
(
fRunExtrapolation
)
InitExtrapolation
();
122
if
(
fRunProjection
)
InitProjection
();
123
if
(
fRunFinder
)
InitFinder
();
124
if
(
fRunFitter
)
InitFitter
();
125
if
(
fRunTrackAssign
)
InitTrackAssign
();
126
127
return
kSUCCESS
;
128
}
129
130
void
CbmRichReconstruction::Exec
(
131
Option_t* opt)
132
{
133
if
(
fRunExtrapolation
)
RunExtrapolation
();
134
if
(
fRunProjection
)
RunProjection
();
135
if
(
fRunFinder
)
RunFinder
();
136
if
(
fRunFitter
)
RunFitter
();
137
if
(
fRunTrackAssign
)
RunTrackAssign
();
138
}
139
140
void
CbmRichReconstruction::InitExtrapolation
()
141
{
142
// Will need to modify them accordingly like "kf" case;
143
#if _LATER_
144
if
(
fExtrapolationName
==
"ideal"
){
145
fTrackExtrapolation
=
new
CbmRichTrackExtrapolationIdeal
();
146
}
else
if
(
fExtrapolationName
==
"mirror_ideal"
){
147
fTrackExtrapolation
=
new
CbmRichTrackExtrapolationMirrorIdeal
();
148
fProjectionProducer
->
SetZFlag
(2);
149
}
else
150
#endif
151
if
(
fExtrapolationName
==
"kf"
||
fExtrapolationName
==
"KF"
){
152
fTrackExtrapolation
=
new
CbmRichTrackExtrapolationKF
();
153
}
else
{
154
LOG(
FATAL
) <<
fExtrapolationName
<<
" is not correct name for extrapolation algorithm."
<<
FairLogger::endl
;
155
// Fatal("CbmRichReconstruction::InitExtrapolation",
156
// (fExtrapolationName + string(" is not correct name for extrapolation algorithm.")).c_str());
157
}
158
fTrackExtrapolation
->
Init
();
159
}
160
161
void
CbmRichReconstruction::InitProjection
()
162
{
163
fProjectionProducer
->
Init
();
164
}
165
166
void
CbmRichReconstruction::InitFinder
()
167
{
168
if
(
fFinderName
==
"hough"
){
169
fRingFinder
=
new
CbmRichRingFinderHough
();
170
// Check those first if ever want to try them out;
171
#if _LATER_
172
}
else
if
(
fFinderName
==
"ideal"
){
173
fRingFinder
=
new
CbmRichRingFinderIdeal
();
174
}
else
if
(
fFinderName
==
"enn"
){
175
fRingFinder
=
new
CbmL1RichENNRingFinder(0);
176
}
else
if
((
fFinderName
==
"enn_parallel"
)){
177
// fRingFinder = new CbmL1RichENNRingFinderParallel(0);
178
}
else
if
(
fFinderName
==
"hough_prototype"
) {
179
fRingFinder
=
new
CbmRichProtRingFinderHough
();
180
#endif
181
}
else
{
182
LOG(
FATAL
) <<
fFinderName
<<
" is not correct name for ring finder algorithm."
<<
FairLogger::endl
;
183
// Fatal("CbmRichReconstruction::InitFinder",
184
// (fFinderName + string(" is not correct name for ring finder algorithm.")).c_str());
185
}
186
187
fRingFinder
->
Init
();
188
}
189
190
void
CbmRichReconstruction::InitFitter
()
191
{
192
// Check them first if want to use;
193
#if _LATER_
194
if
(
fFitterName
==
"circle_cop"
){
195
fRingFitter
=
new
CbmRichRingFitterCOP
();
196
}
else
if
(
fFitterName
==
"circle_simple"
) {
197
fRingFitter
=
new
CbmRichRingFitterCircle
();
198
}
else
if
(
fFitterName
==
"circle_tau"
) {
199
fRingFitter
=
new
CbmRichRingFitterTAU
();
200
}
else
if
(
fFitterName
==
"circle_robust_cop"
) {
201
fRingFitter
=
new
CbmRichRingFitterRobustCOP
();
202
}
else
203
#endif
204
if
(
fFitterName
==
"ellipse_tau"
) {
205
fRingFitter
=
new
CbmRichRingFitterEllipseTau
();
206
#if _LATER_
207
}
else
if
(
fFitterName
==
"ellipse_minuit"
) {
208
fRingFitter
=
new
CbmRichRingFitterEllipseMinuit
();
209
#endif
210
}
else
{
211
LOG(
FATAL
) <<
fFitterName
<<
" is not correct name for ring fitter algorithm."
<<
FairLogger::endl
;
212
// Fatal("CbmRichReconstruction::InitFitter",
213
// (fFitterName + string(" is not correct name for ring fitter algorithm.")).c_str());
214
}
215
CbmRichConverter::Init
();
216
}
217
218
void
CbmRichReconstruction::InitTrackAssign
()
219
{
220
if
(
fTrackAssignName
==
"closest_distance"
){
221
fRingTrackAssign
=
new
CbmRichRingTrackAssignClosestD
();
222
}
else
{
223
LOG(
FATAL
) <<
fTrackAssignName
<<
" is not correct name for ring-track assignment algorithm."
<<
FairLogger::endl
;
224
// Fatal("CbmRichReconstruction::InitTrackAssign",
225
// (fTrackAssignName + string(" is not correct name for ring-track assignment algorithm.")).c_str());
226
}
227
fRingTrackAssign
->
Init
();
228
}
229
230
void
CbmRichReconstruction::RunExtrapolation
()
231
{
232
fRichTrackParamZ
->Clear();
233
fTrackExtrapolation
->
DoExtrapolation
(
fGlobalTracks
,
fRichTrackParamZ
,
fZTrackExtrapolation
,
fMinNofStsHits
);
234
}
235
236
void
CbmRichReconstruction::RunProjection
()
237
{
238
fProjectionProducer
->
DoProjection
(
fRichProjections
);
239
}
240
241
void
CbmRichReconstruction::RunFinder
()
242
{
243
fRichRings
->Clear();
244
fRingFinder
->
DoFind
(
fRichHits
,
fRichProjections
,
fRichRings
);
245
}
246
247
void
CbmRichReconstruction::RunFitter
()
248
{
249
int
nofRings =
fRichRings
->GetEntriesFast();
250
for
(
int
iRing = 0; iRing < nofRings; iRing++) {
251
CbmRichRing
* ring = (
CbmRichRing
*)
fRichRings
->At(iRing);
252
if
(NULL == ring)
continue
;
253
CbmRichRingLight
ringL;
254
255
CbmRichConverter::CopyHitsToRingLight
(ring, &ringL);
256
fRingFitter
->
DoFit
(&ringL);
257
CbmRichConverter::CopyParamsToRing
(&ringL, ring);
258
}
259
}
260
261
void
CbmRichReconstruction::RunTrackAssign
()
262
{
263
// check whether track were assigned to rings.
264
/* Int_t nTracks = fGlobalTracks->GetEntriesFast();
265
for (Int_t iTrack = 0; iTrack < nTracks; iTrack++){
266
CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(iTrack);
267
Int_t iRing = gTrack->GetRichRingIndex();
268
if (iRing != -1) return;
269
}*/
270
271
fRingTrackAssign
->
DoAssign
(
fRichRings
,
fRichProjections
);
272
}
273
274
void
CbmRichReconstruction::Finish
()
275
{
276
277
}
278
279
ClassImp
(
CbmRichReconstruction
)
EicRoot
blob
master
rich
CbmRichReconstruction.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:37
using
1.8.2 with
EIC GitHub integration