FairRoot/PandaRoot
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
PndWayFollower Class Reference

#include <PndWayFollower.h>

Public Member Functions

 PndWayFollower (TClonesArray *p, TClonesArray *p2)
 
virtual ~PndWayFollower ()
 
vector< PndTrackCollectionfollowLines (Int_t begin)
 
void init (vector< PndLineApproximation > b, map< Int_t, vector< PndFtsExpandedTrackCand >> c)
 
PndLineApproximation getBestApproxTo (PndLine l1, Int_t layer)
 
PndLineApproximation getBestSkewedApproxTo (PndLine l2, Int_t layer)
 

Static Public Attributes

static Double_t compDist = 5
 
static Double_t compAngle = 10
 
static Double_t qualiT = 10
 

Private Attributes

vector< PndLineApproximationfBefore
 
map< Int_t, vector
< PndFtsExpandedTrackCand > > 
cands
 
PndFtsLineComparator fLineComp
 
TClonesArray * planes
 
TClonesArray * planesHit
 
int asd = 0
 

Detailed Description

Definition at line 24 of file PndWayFollower.h.

Constructor & Destructor Documentation

PndWayFollower::PndWayFollower ( TClonesArray *  p,
TClonesArray *  p2 
)
inline

Definition at line 29 of file PndWayFollower.h.

TClonesArray * planesHit
Double_t p
Definition: anasim.C:58
PndFtsLineComparator fLineComp
TClonesArray * planes
TPad * p2
Definition: hist-t7.C:117
static Double_t compDist
static Double_t compAngle
PndWayFollower::~PndWayFollower ( )
virtual

Definition at line 147 of file PndWayFollower.cxx.

147  {
148  // TODO Auto-generated destructor stub
149 }

Member Function Documentation

vector< PndTrackCollection > PndWayFollower::followLines ( Int_t  begin)

Definition at line 14 of file PndWayFollower.cxx.

References a, PndTrackCollection::add(), best, fBefore, getBestApproxTo(), getBestSkewedApproxTo(), PndTrackCollection::getLastLine(), and i.

Referenced by PndForwardTrackFinderTask::Exec().

14  {
15  vector<PndTrackCollection> result;
16  cout << "Start follow lines" << endl;
17 
18  /*
19  vector<PndLineApproximation> allLines;
20  for(map<Int_t, vector<PndFtsExpandedTrackCand>>::iterator i=cands.begin();i!=cands.end();i++){
21  vector<PndFtsExpandedTrackCand> vec = i->second;
22  for(int j=0;j<vec.size();j++){
23  vector<PndLineApproximation> appr = vec[j].getLineApproximations();
24  for(int k=0;k<appr.size();k++)allLines.push_back(appr[k]);
25  }
26  }*/
27 
28 
29  for(size_t i=0;i<fBefore.size();i++){
30  cout << "Follow Track " << i << endl;
31  PndTrackCollection trackCollection;
33  trackCollection.add(a,kTRUE);
34 
35  //FTS3
36  PndLineApproximation best = getBestApproxTo(trackCollection.getLastLine(),begin);
37  trackCollection.add(best,kFALSE);
38  PndLineApproximation best2=getBestSkewedApproxTo(trackCollection.getLastLine(),begin+1);
39  trackCollection.add(best2,kTRUE);
40  PndLineApproximation best3=getBestSkewedApproxTo(trackCollection.getLastLine(),begin+2);
41  trackCollection.add(best3,kTRUE);
42  PndLineApproximation best4=getBestApproxTo(trackCollection.getLastLine(),begin+3);
43  trackCollection.add(best4,kFALSE);
44 
45  //FTS4
46  PndLineApproximation best5=getBestApproxTo(trackCollection.getLastLine(),begin+4);
47  trackCollection.add(best5,kFALSE);
48  /*if(asd==0 && i==1){
49  TVector3 v(1,1,1);
50  PndTrackCand trackCand;
51  FairTrackParP tp1(trackCollection.getLastLine().getP1(),3 * trackCollection.getLastLine().getDir().Unit(), v, v, 1, v, v, v);
52  FairTrackParP tp2(v,v.Unit(), v, v, 1, v, v, v);
53  PndTrack* myCand = new ((*planes)[0]) PndTrack(tp1, tp2, trackCand);
54  PndPlane p1(allLines[134].getLine(),0);
55  PndPlane p2(allLines[144].getLine(),1);
56  PndPlane p3(allLines[146].getLine(),1);
57  PndLine l1 = p1.getIntersection(p2);
58  PndLine l2 = p1.getIntersection(p3);
59  fLineComp.setZValue(allLines[144].getHits()[0]->GetZ());
60  cout << "Quali wrong line:" <<fLineComp.getQuality3D(trackCollection.getLastLine(),l1) << endl;
61  cout << "Quali right line:" <<fLineComp.getQuality3D(trackCollection.getLastLine(),l2) << endl;
62  asd++;
63  }*/
64  PndLineApproximation best6=getBestSkewedApproxTo(trackCollection.getLastLine(),begin+5);
65  trackCollection.add(best6,kTRUE);
66  PndLineApproximation best7=getBestSkewedApproxTo(trackCollection.getLastLine(),begin+6);
67  trackCollection.add(best7,kTRUE);
68  PndLineApproximation best8=getBestApproxTo(trackCollection.getLastLine(),begin+7);
69  trackCollection.add(best8,kFALSE);
70 
71  result.push_back(trackCollection);
72  }
73  return result;
74 }
Int_t i
Definition: run_full.C:25
Int_t a
Definition: anaLmdDigi.C:126
PndLineApproximation getBestSkewedApproxTo(PndLine l2, Int_t layer)
vector< PndLineApproximation > fBefore
void add(PndLineApproximation l, Bool_t skewed)
PndLineApproximation getBestApproxTo(PndLine l1, Int_t layer)
PndLineApproximation PndWayFollower::getBestApproxTo ( PndLine  l1,
Int_t  layer 
)

Definition at line 76 of file PndWayFollower.cxx.

References cands, Double_t, fLineComp, PndLine::getDir(), PndFtsLineComparator::getDist2D(), PndLineApproximation::getHits(), PndLineApproximation::getLine(), PndLine::getP1(), PndFtsLineComparator::getQuality(), i, layer, qualiT, PndLine::setRating(), and PndFtsLineComparator::setZValue().

Referenced by followLines().

76  {
77  vector<PndFtsExpandedTrackCand> layerCands = cands[layer];
78 
79  PndLineApproximation bestApprox;
80  bestApprox.getLine().setRating(-1);
81  Double_t bestDist = 99999999;
82 
83  for(size_t i=0;i<layerCands.size();i++){
84  vector<PndLineApproximation> approxs = layerCands[i].getLineApproximations();
85  for(size_t j=0;j<approxs.size();j++){
86  PndLineApproximation approx = approxs[j];
87  fLineComp.setZValue(approx.getHits()[0]->GetZ()-20);
88  PndLine l2 = approx.getLine();
89  Double_t dist = fLineComp.getDist2D(l1.getP1(),l2.getP1(),l1.getDir(),l2.getDir());
90  if(dist<bestDist){
91  bestDist = dist;
92  bestApprox = approx;
93  }
94  }
95  }
96  if(bestDist>5){
97  bestApprox=PndLineApproximation();
98  bestApprox.getLine().setRating(-1);
99  }
100  //to bad?
101  PndLine l2 = bestApprox.getLine();
102  Double_t quali = fLineComp.getQuality(l1,l2);
103  if(quali > qualiT){
104  PndLineApproximation apprWrong;
105  apprWrong.getLine().setRating(-1);
106  return apprWrong;
107  }
108  return bestApprox;
109 }
vector< PndFtsHit * > getHits()
map< Int_t, vector< PndFtsExpandedTrackCand > > cands
Double_t getDist2D(TVector3 b1, TVector3 b2, TVector3 d1, TVector3 d2)
Int_t i
Definition: run_full.C:25
PndFtsLineComparator fLineComp
static Double_t qualiT
TVector3 getDir()
Definition: PndLine.h:34
void setZValue(Double_t z)
Double_t getQuality(PndLine l1, PndLine l2)
Double_t
void setRating(Int_t r)
Definition: PndLine.h:44
Int_t layer
Definition: reco_muo.C:36
TVector3 getP1()
Definition: PndLine.h:32
PndLineApproximation PndWayFollower::getBestSkewedApproxTo ( PndLine  l2,
Int_t  layer 
)

Definition at line 111 of file PndWayFollower.cxx.

References cands, PndLineApproximation::correctHits3DAndAdd(), Double_t, fLineComp, PndLineApproximation::getHits(), PndPlane::getIntersection(), PndLineApproximation::getLine(), PndFtsLineComparator::getQuality(), PndFtsLineComparator::getQuality3D(), hits, i, layer, p1, p2, qualiT, PndLine::setRating(), and PndFtsLineComparator::setZValue().

Referenced by followLines().

111  {
112  PndPlane p1(l1,layer-1);
113  vector<PndFtsExpandedTrackCand> layerCands = cands[layer];
114 
115  PndLineApproximation bestApprox;
116  bestApprox.getLine().setRating(-1);
117  Double_t bestDist = 99999999;
118 
119  for(size_t i=0;i<layerCands.size();i++){
120  vector<PndLineApproximation> approxs = layerCands[i].getLineApproximations();
121  for(size_t j=0;j<approxs.size();j++){
122  PndLineApproximation approx = approxs[j];
123  fLineComp.setZValue(approx.getHits()[0]->GetZ());
124  PndPlane p2(approx.getLine(),layer);
125  PndLine l3 = p1.getIntersection(p2);
126 
127  Double_t dist = fLineComp.getQuality3D(l1,l3);
128  if(dist<bestDist){
129  bestDist = dist;
130  vector<PndFtsHit*> hits;
131  bestApprox = PndLineApproximation(l3,hits);
132  bestApprox.correctHits3DAndAdd(approx.getHits());
133  }
134  }
135  }
136  //to bad?
137  PndLine l2 = bestApprox.getLine();
138  Double_t quali = fLineComp.getQuality(l1,l2);
139  if(quali > qualiT){
140  PndLineApproximation apprWrong;
141  apprWrong.getLine().setRating(-1);
142  return apprWrong;
143  }
144  return bestApprox;
145 }
vector< PndFtsHit * > getHits()
map< Int_t, vector< PndFtsExpandedTrackCand > > cands
Int_t i
Definition: run_full.C:25
PndFtsLineComparator fLineComp
static Double_t qualiT
Double_t getQuality3D(PndLine l1, PndLine l2)
void setZValue(Double_t z)
Double_t getQuality(PndLine l1, PndLine l2)
Double_t
void setRating(Int_t r)
Definition: PndLine.h:44
TPad * p2
Definition: hist-t7.C:117
void correctHits3DAndAdd(vector< PndFtsHit * > correctedHits)
Int_t layer
Definition: reco_muo.C:36
TPad * p1
Definition: hist-t7.C:116
CbmHit * hits[nHits]
Definition: RiemannTest.C:19
void PndWayFollower::init ( vector< PndLineApproximation b,
map< Int_t, vector< PndFtsExpandedTrackCand >>  c 
)
inline

Definition at line 32 of file PndWayFollower.h.

References b, and c.

Referenced by PndForwardTrackFinderTask::Exec().

32  {
33  fBefore = b;
34  cands = c;
35  }
map< Int_t, vector< PndFtsExpandedTrackCand > > cands
TTree * b
vector< PndLineApproximation > fBefore

Member Data Documentation

int PndWayFollower::asd = 0
private

Definition at line 45 of file PndWayFollower.h.

map<Int_t, vector<PndFtsExpandedTrackCand> > PndWayFollower::cands
private

Definition at line 40 of file PndWayFollower.h.

Referenced by getBestApproxTo(), and getBestSkewedApproxTo().

Double_t PndWayFollower::compAngle = 10
static

Definition at line 27 of file PndWayFollower.h.

Double_t PndWayFollower::compDist = 5
static

Definition at line 26 of file PndWayFollower.h.

vector<PndLineApproximation> PndWayFollower::fBefore
private

Definition at line 39 of file PndWayFollower.h.

Referenced by followLines().

PndFtsLineComparator PndWayFollower::fLineComp
private

Definition at line 41 of file PndWayFollower.h.

Referenced by getBestApproxTo(), and getBestSkewedApproxTo().

TClonesArray* PndWayFollower::planes
private

Definition at line 42 of file PndWayFollower.h.

TClonesArray* PndWayFollower::planesHit
private

Definition at line 43 of file PndWayFollower.h.

Double_t PndWayFollower::qualiT = 10
static

The documentation for this class was generated from the following files: