29 #include "FairRootManager.h"
30 #include "FairRuntimeDb.h"
31 #include "FairRunAna.h"
32 #include "TClonesArray.h"
53 #include "TLorentzVector.h"
55 #include "FairTrackParH.h"
58 #include "RKTrackRep.h"
61 #include "FairGeanePro.h"
67 fMvdBranchName(
""), fCentralTrackerBranchName(
""),
68 fUseGeane(kTRUE), fPropagateToIP(kTRUE), fPerpPlane(kFALSE), fNumIt(1), fTrackRep(0),
fVerbose(0)
76 FairRootManager* ioman= FairRootManager::Instance();
79 Error(
"PndRecoDafFit::Init",
"RootManager not instantiated!");
84 FairRuntimeDb*
rtdb = FairRunAna::Instance()->GetRuntimeDb();
86 TClonesArray *tubeArray = NULL;
96 TClonesArray* stripar; TClonesArray* pixelar;
99 stripar=(TClonesArray*) ioman->GetObject(
"MVDHitsStripMix");
103 std::cout <<
"*** PndRecoDafFit::Init" <<
"\t" <<
"MVDHitsStripMix array found" << std::endl;
106 pixelar=(TClonesArray*) ioman->GetObject(
"MVDHitsPixelMix");
110 std::cout <<
"*** PndRecoDafFit::Init" <<
"\t" <<
"MVDHitsPixelMix array found" << std::endl;
115 stripar=(TClonesArray*) ioman->GetObject(
"MVDHitsStrip");
119 std::cout <<
"*** PndRecoDafFit::Init" <<
"\t" <<
"MVDHitsStrip array found" << std::endl;
122 pixelar=(TClonesArray*) ioman->GetObject(
"MVDHitsPixel");
126 std::cout <<
"*** PndRecoDafFit::Init" <<
"\t" <<
"MVDHitsPixel array found" << std::endl;
134 sthit=(TClonesArray*) ioman->GetObject(
"STTHitMix");
138 std::cout <<
"*** PndRecoDafFit::Init" <<
"\t" <<
"STTHitMix array found" << std::endl;
143 sthit=(TClonesArray*) ioman->GetObject(
"STTHit");
147 std::cout <<
"*** PndRecoDafFit::Init" <<
"\t" <<
"SttHit array found" << std::endl;
151 TClonesArray* gemar=(TClonesArray*) ioman->GetObject(
"GEMHit");
155 std::cout <<
"*** PndRecoDafFit::Init" <<
"\t" <<
"GEMHit array found" << std::endl;
158 TClonesArray* mdtar=(TClonesArray*) ioman->GetObject(
"MdtHit");
162 std::cout <<
"*** PndRecoDafFit::Init" <<
"\t" <<
"MdtHit array found" << std::endl;
167 fPro =
new FairGeanePro();
171 Error(
"PndRecoDafFit::Init",
"Only GEANE Propagatio available!!!");
178 std::cout <<
"===PndRecoDafFit::Init() finished ===================================================" << std::endl;
189 if (
fVerbose>0) std::cout<<
"PndRecoDafFit::Fit"<<std::endl;
211 FairTrackParH *helix =
new FairTrackParH(&par, ierr);
212 FairGeanePro *fPro0 =
new FairGeanePro();
213 FairTrackParH *fRes=
new FairTrackParH();
214 fPro0->SetPoint(TVector3(0,0,0));
215 fPro0->PropagateToPCA(1, -1);
216 Bool_t rc = fPro0->Propagate(helix, fRes, PDGCode);
219 StartPos.SetXYZ(fRes->GetX(), fRes->GetY(), fRes->GetZ());
220 StartMom.SetXYZ(fRes->GetPx(), fRes->GetPy(), fRes->GetPz());
221 StartPosErr.SetXYZ(fRes->GetDX(), fRes->GetDY(), fRes->GetDZ());
222 StartMomErr.SetXYZ(fRes->GetDPx(), fRes->GetDPy(), fRes->GetDPz());
226 TVector3 plane_v1, plane_v2;
229 plane_v1 = StartMom.Orthogonal();
230 plane_v2 = StartMom.Cross(plane_v1);
234 plane_v1.SetXYZ(1.,0.,0.);
235 plane_v2.SetXYZ(0.,1.,0.);
237 GFDetPlane start_pl(StartPos, plane_v1, plane_v2);
243 StartPosErr,StartMomErr,
251 StartPosErr, StartMomErr,
257 std::cout <<
"*** PndRecoDafFit::Fit" <<
"\t" <<
"Not existing Track Representation " <<
fTrackRep << std::endl;
274 std::cout <<
"*** PndRecoDafFit::Fit" <<
"\t" <<
"Genfit Exception: trk->addHitVector " << e.
what() << std::endl;
284 std::cout<<
"*** PndRecoDafFit::Fit" <<
"\t" <<
"FITTER EXCEPTION ***"<<std::endl;
285 std::cout<<e.
what()<<std::endl;
288 if (
fVerbose>0) std::cout<<
"*** PndRecoDafFit::Fit" <<
"\t" <<
"SUCCESSFULL FIT!"<<std::endl;
296 std::cout<<
"*** PndRecoDafFit::Fit" <<
"\t" <<
"CONVERSION EXCEPTION ***"<<std::endl;
297 std::cout<<e.
what()<<std::endl;
302 if (
fVerbose>0) std::cout<<
"Fitting done"<<std::endl;
Bool_t fUseGeane
Name of the TCA for central tracker.
Base Class for genfit track representations. Defines interface for track parameterizations.
unsigned int getNumHits() const
Detector plane genfit geometry class.
Track object for genfit. genfit algorithms work on these objects.
std::vector< GFAbsRecoHit * > createMany(const GFTrackCand &cand)
Creat a collection of RecoHits.
void addProducer(int detID, GFAbsRecoHitProducer *hitProd)
Register a producer module to the factory.
virtual const char * what() const
standard error message handling for exceptions. use like "std::cerr << e.what();" ...
void addHitVector(std::vector< GFAbsRecoHit * > hits)
Add collection of hits.
Template class for a hit producer module.
Short_t fTrackRep
Number of iterations.
void setCandidate(const GFTrackCand &cand, bool doreset=false)
set track candidate
static void quiet(bool b=true)
TString fCentralTrackerBranchName
Name of the TCA for MVD.
Bool_t fPerpPlane
Flag to propagate to the interaction point.
Bool_t fPropagateToIP
Flag to use Geane.
Factory object to create RecoHits from digitized and clustered data.
Track Representation module based on a Runge-Kutta algorithm including a full material model...
TString fMvdBranchName
Geane Propagator.
PndTrackCand GetTrackCand()
TClonesArray * FillTubeArray()
void processTrack(GFTrack *trk)
Process a track using the DAF.
GFTrackCand * PndTrackCand2GenfitTrackCand(PndTrackCand *cand)
friend F32vec4 fabs(const F32vec4 &a)
PndTrack * Fit(PndTrack *tBefore, Int_t PDG)
static PndGeoHandling * Instance()
const GFTrackCand & getCand() const
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
void init(GFAbsBField *b)
set the magntic field here. Magnetic field classes must be derived from GFAbsBField ...
PndTrack * GenfitTrack2PndTrack(const GFTrack *tr)
static GFFieldManager * getInstance()
Int_t fVerbose
(0) GeaneTrackRep, 1 RKTrackRep
GFRecoHitFactory * fTheRecoHitFactory
FairTrackParP GetParamFirst()