18 #include "FairRootManager.h"
21 #include "TClonesArray.h"
26 #include "TGeoManager.h"
27 #include "TGeoTrack.h"
28 #include "TLorentzVector.h"
36 #include <Math/Vector3D.h>
40 #include <TGraph2DErrors.h>
43 #include <TMatrixDSym.h>
44 #include <TMatrixTSym.h>
45 #include <TPolyLine3D.h>
46 #include <TVirtualFitter.h>
48 #include <TMultiGraph.h>
49 #include <TPolyLine3D.h>
50 using namespace ROOT::Math;
59 : FairTask(
"Connect 2 points task") {
66 cout <<
"PndLmdLineTask::~PndLmdLineTask()" << endl;
71 FairRootManager* ioman = FairRootManager::Instance();
74 Error(
"PndLmdLineTask::Init",
"RootManager not instantiated!");
82 Error(
"PndLmdLineTask::Init",
"trackcand-array not found!");
89 Error(
"PndLmdLineTask::Init",
"reco-array not found!");
94 ioman->Register(
"LMDTrack",
"PndLmd",
fTrackArray, kTRUE);
96 std::cout <<
"-I- PndLmdLineTask: Initialisation successfull" << std::endl;
101 std::cout <<
"PndLmdLineTask::Exec" << std::endl;
103 if (
fTrackArray == 0) Fatal(
"PndLmdLineTask::Exec",
"No TrackArray");
110 std::cout <<
" -I- PndLmdLineTask: contains " << ntcand <<
" RhoCandidates"
113 std::cout <<
" Detailed Debug info on the candidates:" << std::endl;
116 for (Int_t itr = 0; itr < ntcand; ++itr) {
118 std::cout <<
"TrackCand no. " << itr <<
" has " << trcnd->
GetNHits()
119 <<
" hits." << std::endl;
120 std::cout <<
"Point: \t Index: " << std::endl;
121 for (
unsigned int ihit = 0; ihit < trcnd->
GetNHits();
126 std::cout << ihit <<
"\t" << index << std::endl;
140 std::cout <<
" -I- PndLmdLineTask: start Fitting " << std::endl;
144 const int numPts = trcnd->
GetNHits();
155 TVector3 dirSeed = pos2 - posSeed;
156 dirSeed *= 1. / dirSeed.Mag();
160 std::cout <<
"Track: " <<
track <<
" Points: " << numPts << std::endl;
164 Int_t firstHit = -1, lastHit = -1;
165 for (
int ihit = 0; ihit < numPts; ihit++) {
174 else if (ihit == numPts - 1)
201 "Lumi", posSeed.X(), dirSeed.X(), posSeed.Y(), dirSeed.Y(), posSeed.Z(),
202 posSeed.Z(), 0, firstHit, lastHit,
track);
207 new ((*fTrackArray)[rec_tkr])
PndLinTrack(*(trackfit));
227 std::cout <<
"Fitting done" << std::endl;
TVector3 GetPosition() const
PndTrackCandHit GetSortedHit(UInt_t i)
virtual void Exec(Option_t *opt)
PndLmdLineTask(TString hitBranch="LMDHitsStrip")
virtual InitStatus Init()
TClonesArray * fTrackArray
TClonesArray * fRecoArray
virtual ~PndLmdLineTask()
TClonesArray * fTCandArray