EIC Software
 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 
23 {
24  fIdeal = ideal;
25  fTrackOutBranchName = "EicIdealGenTrack";
26 
27  // Geane stuff is needed for track propagation;
29 
32 } // EicRecoKalmanTask::EicRecoKalmanTask()
33 
34 // ---------------------------------------------------------------------------------------
35 
37 {
38  // Do it better later; for now deal with the regular Kalman filter only;
39  SetDaf(kFALSE);
40 
41  //Get ROOT Manager;
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;
59 
60  // Call original PandaRoot 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;
97  else
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();
115 } // EicRecoKalmanTask::Exec()
116 
117 // ---------------------------------------------------------------------------------------
118