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
EicRecoKalmanTask.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file EicRecoKalmanTask.cxx
1
//
2
// AYK (ayk@bnl.gov), 2013/06/12
3
//
4
// Kalman filter task wrapper;
5
//
6
7
#include "
GFRecoHitFactory.h
"
8
9
#include <
FairRunAna.h
>
10
#include <
FairGeane.h
>
11
12
#include <
PndRecoKalmanFit.h
>
13
14
#include <
EicTrackingRecoHit.h
>
15
#include <
EicRecoKalmanTask.h
>
16
17
#define _ITERATIONS_DEFAULT_ 2
18
#define _BUSY_CUT_DEFAULT_ 50
19
20
// ---------------------------------------------------------------------------------------
21
22
EicRecoKalmanTask::EicRecoKalmanTask
(
EicIdealTrackingCode
*ideal)
23
{
24
fIdeal
= ideal;
25
fTrackOutBranchName
=
"EicIdealGenTrack"
;
26
27
// Geane stuff is needed for track propagation;
28
if
(
FairRunAna::Instance
())
FairRunAna::Instance
()->
AddTask
(
new
FairGeane
());
29
30
SetBusyCut
(
_BUSY_CUT_DEFAULT_
);
31
SetNumIterations
(
_ITERATIONS_DEFAULT_
);
32
}
// EicRecoKalmanTask::EicRecoKalmanTask()
33
34
// ---------------------------------------------------------------------------------------
35
36
InitStatus
EicRecoKalmanTask::Init
()
37
{
38
// Do it better later; for now deal with the regular Kalman filter only;
39
SetDaf
(kFALSE);
40
41
//Get ROOT Manager;
42
FairRootManager
* ioman=
FairRootManager::Instance
();
43
if
(ioman==0)
44
{
45
Error(
"EicRecoKalmanFit::Init"
,
"RootManager not instantiated!"
);
46
return
kERROR
;
47
}
48
49
if
(!
fIdeal
) {
50
// FIXME: this is indeed a terrible hack;
51
TFile *
ff
=
new
TFile(
"ireconstruction.root"
);
52
53
fIdeal
=
dynamic_cast<
EicIdealTrackingCode
*
>
(ff->Get(
"EicIdealTrackingCode"
));
54
assert(
fIdeal
);
55
}
//if
56
57
// Yes, no need to assign this in reco_complete.C;
58
SetTrackInBranchName
(
fIdeal
->
fTracksArrayName
);
59
60
// Call original PandaRoot Init();
61
PndRecoKalmanTask::Init
();
62
63
// Instead of hardcoding hit classes in PndRecoKalmanTask prefer to spool them from
64
// EicIdealTracker class;
65
for
(std::vector<EicDetectorGroup>::iterator
it
=
fIdeal
->
fGroups
.begin();
66
it
!=
fIdeal
->
fGroups
.end();
it
++)
67
{
68
//TString flname = it->dname->Name() + "DigiHit";
69
TString flname =
it
->dname->Name() +
"TrackingDigiHit"
;
70
TClonesArray* arr=(TClonesArray*) ioman->
GetObject
(flname);
71
72
if
(!
it
->mGptr) {
73
ioman->
GetInFile
()->GetObject(
it
->dname->Name() +
"GeoParData"
,
it
->mGptr);
74
75
if
(!
it
->mGptr) {
76
std::cout <<
"-E- Eic"
<<
it
->dname->Name() <<
" hit producer: no map found!"
<< std::endl;
77
return
kERROR
;
78
}
//if
79
80
it
->mGptr->InitializeLookupTables();
81
}
//if
82
83
if
(arr!=0)
84
{
85
//TClass *cl = arr->GetClass();
86
//printf("%d\n", cl->InheritsFrom("EicTrackingDigiHit3D"));
87
88
// Use custom EicRawHit class instead of a generic FairHit; and indeed EicRecoHit
89
// (base) class must be generic as well;
90
//if (it->dname->Name() == "Tpc")
91
// Well, I suppose this check is correct, right?; there are no other digi hit types
92
// which require EicSpaceRecoHit-based factory;
93
if
(arr->GetClass()->InheritsFrom(
"EicTrackingDigiHit3D"
))
94
// Yes, let it be a hack for now; figure out how to pass kTPC later;
95
fFitter
->
GetRecoHitFactory
()->
addProducer
(
FairRootManager::Instance
()->GetBranchId(flname),
96
new
GFRecoHitProducer<EicTrackingDigiHit,EicSpaceRecoHit>
(arr),
it
->GetGptr());
97
else
98
fFitter
->
GetRecoHitFactory
()->
addProducer
(
FairRootManager::Instance
()->GetBranchId(flname),
99
new
GFRecoHitProducer<EicTrackingDigiHit,EicPlanarRecoHit>
(arr),
it
->GetGptr());
100
101
std::cout <<
"*** EicRecoKalmanFit::Init"
<<
"\t"
<< flname <<
" array found"
<< std::endl;
102
}
103
}
104
//exit(0);
105
106
return
kSUCCESS
;
107
}
// EicRecoKalmanTask::Init()
108
109
// ---------------------------------------------------------------------------------------
110
111
void
EicRecoKalmanTask::Exec
(Option_t* opt)
112
{
113
// Call original PandaRoot Exec();
114
PndRecoKalmanTask::Exec
(opt);
115
}
// EicRecoKalmanTask::Exec()
116
117
// ---------------------------------------------------------------------------------------
118
119
ClassImp
(
EicRecoKalmanTask
)
EicRoot
blob
master
eic
tracking
EicRecoKalmanTask.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:35
using
1.8.2 with
EIC GitHub integration