FairRoot/PandaRoot
PndMQStraightLineTrackFinder.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndMQStraightLineTrackFinder -----
3 // ----- Created 22/10/09 by M. Michel -----
4 // -------------------------------------------------------------------------
5 
6 #include "TClonesArray.h"
7 #include "TArrayD.h"
8 #include "TGeoManager.h"
9 
10 #include "FairRootManager.h"
11 #include "FairRun.h"
12 #include "FairRuntimeDb.h"
13 
15 
16 #include "PndSdsDigiStrip.h"
17 #include "TStopwatch.h"
18 // #include "PndSdsPixelCluster.h"
19 
20 
21 // ----- Default constructor -------------------------------------------
23  fNLayers(4)
24 {
25  fdXY = 0.1;
26  fHitsPerLayer.resize(fNLayers);
27 }
28 
29 
30 // -------------------------------------------------------------------------
31 
32 
33 // ----- Destructor ----------------------------------------------------
35 {
36 }
37 // -------------------------------------------------------------------------
38 
39 // ----- Private method SortHitsByDet --------------------------------------------
41 {
42  for (int i = 0; i < hits.size(); i++){
43  if (hits[i].GetSensorID() < fNLayers)
44  fHitsPerLayer[hits[i].GetSensorID()].push_back(make_pair(hits[i], false));
45  }
46 }
47 // -------------------------------------------------------------------------
48 
49 std::vector< std::vector<int> > PndMQStraightLineTrackFinder::GetStartCombination(int firstLayer, int secondLayer)
50 {
51  std::vector< std::vector<int> > result;
52  for (int firstL = 0; firstL < fHitsPerLayer[firstLayer].size; firstL++){
53  for (int secondL = 0; secondL < fHitsPerLayer[secondLayer].size; secondL++){
54  std::vector<int> singleCombi(4,-1);
55  singleCombi[firstLayer] = firstL;
56  singleCombi[seondLayer] = secondL;
57  result.push_back(singleCombi);
58  }
59  }
60  return result;
61 }
62 
63 StraightLineParams PndMQStraightLineTrackFinder::GetLineParameters(std::vector<int> startCombi)
64 {
65  StraightLineParams result;
66  TVector3 first, second;
67  bool firstFound = false;
68  for (int i = 0; i < startCombi.size(); i++)
69  {
70  if (startCombi[i] > -1){
71  if (firstFound == false){
72  PndSdsHit firstHit = fHitsPerLayer[i][startCombi[i]].first;
73  first = firstHit.GetPosition();
74  firstFound = true;
75  result.origin = first;
76  } else {
77 
78  PndSdsHit secondHit = fHitsPerLayer[i][startCombi[i]].first;
79  second = secondHit.GetPosition();
80  result.direction = (second - first).Unit();
81  break;
82  }
83  }
84  }
85  return result;
86 }
87 
88 TVector3 PndMQStraightLineTrackFinder::PropagateToXYPlane(StraightLineParams line, Double z)
89 {
90  double t = 0;
91  t = (z - line.origin.Z()) / line.direction.Z();
92  TVector3 result;
93  result = line.origin + line.direction * t;
94  return result;
95 }
96 
97 double PndMQStraightLineTrackFinder::DistanceOfPoints(TVector3 first, TVector3 second)
98 {
99  return (first - second).Mag();
100 }
101 
102 PndTrackCand PndMQStraightLineTrackFinder::FindTrack(std::vector<int> startCombi){
103 
104 }
105 
106 std::vector<PndTrackCand> PndMQStraightLineTrackFinder::FindTracks(std::vector<PndSdsHit> hits)
107 {
108  SortHitsToLayers(hits);
109  std::vector<std::vector<int> > startCombi = GetStartCombination(0,1);
110  for (int i = 0; i < startCombi.size(); i++){
111 
112  }
113 
114 }
115 
116 // ----- Private method FindHitsII --------------------------------------------
117 void PndMQStraightLineTrackFinder::FindHitsII(std::vector<PndTrackCand> &tofill, std::vector< std::vector< std::pair<Int_t,bool> > > &hitsd, Int_t nStripHits)
118 {
119 
120  std::vector<TVector3> trackStart, trackVec;//pseudo tracks
121  std::vector<TVector3> trackStartd, trackVecd;//save errors
122  std::vector< Int_t > trackID1, trackID3; //for TrackCand
123 
124 //iterate first discs-hits with all seconds, save pseudo-tracks
125  TVector3 start, tmp, vec, dstart, dvec; //temp-vars
126 
127  if(hitsd.size()<3) return;
128  for (Int_t i=0; i<hitsd.at(0).size(); i++)
129  {
130  if(hitsd.at(0).at(i).second) continue; //if already used
131  PndSdsHit *hit1=(PndSdsHit*)fHitArray->At(hitsd.at(0).at(i).first);
132  start.SetXYZ(hit1->GetX(), hit1->GetY(), hit1->GetZ());
133  dstart.SetXYZ(hit1->GetDx(), hit1->GetDy(), hit1->GetDz());
134  for (Int_t k=0; k<hitsd.at(2).size(); k++)
135  {
136  if(hitsd.at(2).at(k).second) continue; //if already used
137  PndSdsHit *hit2=(PndSdsHit*)fHitArray->At(hitsd.at(2).at(k).first);
138  tmp.SetXYZ(hit2->GetX(), hit2->GetY(), hit2->GetZ());
139  vec = tmp - start; //calc direction vector for FINDING
140  dvec.SetXYZ(hit2->GetDx(), hit2->GetDy(), hit2->GetDz());
141  if(vec.Theta()>0.03 && vec.Theta()<0.05 && vec.Phi()>-0.25 && vec.Phi()<0.25){ //ignore vectors with theta outside 2-9 mrad
142  // if(0<1){
143  // if(vec.Theta()<0.01){ //ignore vectors with theta outside 10 mrad
144  trackStart.push_back(start);
145  trackStartd.push_back(dstart);
146  trackVec.push_back(vec); //save vector from start to second
147  trackVecd.push_back(dvec); //save error of second point for FIT, NOT error of direction vector
148  //trackID1.push_back(hitsd.at(0).at(i).first); //save Hit-Id's for TrackCand
149  //trackID2.push_back(hitsd.at(1).at(k).first);
150  trackID1.push_back(i); //save Hit-Id's for TrackCand
151  trackID3.push_back(k);
152  }
153  }//end of disc 2 (or 3 if none in disc 2) hits
154  }//end of disc 1 hits
155 
156  if(fVerbose>1) cout << "Pseudos L1L3: "<< trackStart.size() <<endl;
157 
158  std::vector<Int_t> ids;
159 
160 //check if other discs have hits in track, add points for fitting ---------------
161  for (Int_t i=0; i<trackStart.size(); i++) //pseudo-loop
162  {
163  ids.clear();
164  Int_t pntcnt=2;
165 
166  start = trackStart.at(i);
167  dstart = trackStartd.at(i);
168  vec = trackVec.at(i);
169  dvec = trackVecd.at(i);
170  ids.push_back(hitsd.at(0).at(trackID1.at(i)).first);
171  ids.push_back(hitsd.at(2).at(trackID3.at(i)).first);
172  std::vector< std::pair<Int_t,Int_t> > otherIDs;
173 
174  for (Int_t idet=3; idet < 4; idet++){ //i know this is not a loop, but in case we someday will have more planes
175  Double_t distClosest = 2*idet*dXY; //just bigger as possible
176  Bool_t firstp = true;
177  for (Int_t ihit=0; ihit<hitsd.at(idet).size(); ihit++)
178  {
179  PndSdsHit *hit=(PndSdsHit*)fHitArray->At(hitsd.at(idet).at(ihit).first);
180  Double_t scale = (hit->GetZ()-start.z())/vec.z();
181  tmp = start + scale*vec; //extend search-vector to hit-plane
182  Double_t distTmp = sqrt((tmp.x()-hit->GetX())*(tmp.x()-hit->GetX()) + (tmp.y()-hit->GetY())*(tmp.y()-hit->GetY()));
183  if( distTmp<(idet*dXY) ){ //if in diameter
184  if(firstp){
185  pntcnt++;
186  ids.push_back(hitsd.at(idet).at(ihit).first);
187  otherIDs.push_back( make_pair (idet,ihit) );
188  distClosest=distTmp;
189  firstp=false;
190  }else{
191  if(distTmp<distClosest){ //change if nearer
192  ids.pop_back();
193  otherIDs.pop_back();
194  ids.push_back(hitsd.at(idet).at(ihit).first);
195  otherIDs.push_back( make_pair (idet,ihit) );
196  }
197  }
198  }//endif in diameter
199  }//end of disc n hits
200  }//end of discs
201 
202  if(fVerbose>2) cout << " Track L1L3: "<< i << "#Planes: " << ids.size() <<endl;
203 
204  //create track für fitting
205  if(ids.size()>2){ //third hit found <=> !track found!
206  PndTrackCand *myTCand = new PndTrackCand();
207 
208  for (Int_t id=0; id<ids.size(); id++){
209  PndSdsHit* myHit = (PndSdsHit*)(fHitArray->At(ids.at(id)));
210  PndSdsClusterStrip* myCluster;
211  PndSdsDigiStrip* astripdigi;
212  if ( !fStripClusterArray || !fStripDigiArray){ //for ideal/fast Hit-Reco
213  myTCand->AddHit(0,ids.at(id),myHit->GetPosition().Mag());
214  }else{
215  myCluster = (PndSdsClusterStrip*)(fStripClusterArray->At(myHit->GetClusterIndex()));
216  astripdigi = (PndSdsDigiStrip*)fStripDigiArray->At(myCluster->GetDigiIndex(0));
217  myTCand->AddHit(astripdigi->GetDetID(),ids.at(id),myHit->GetPosition().Mag());
218  }
219  }
220 
221  //mark used hits---------
222  hitsd.at(0).at(trackID1.at(i)).second=true;
223  hitsd.at(2).at(trackID3.at(i)).second=true;
224  for(Int_t id=0; id<otherIDs.size(); id++){
225  hitsd.at(otherIDs.at(id).first).at(otherIDs.at(id).second).second=true;
226  }
227 
228  // ///Add seed information to track------------
229  // PndSdsHit* myHit0 = (PndSdsHit*)(fStripHitArray->At(ids.at(0)));
230  // PndSdsHit* myHit1 = (PndSdsHit*)(fStripHitArray->At(ids.at(1)));
231  // TVector3 hit0 = myHit0->GetPosition(); TVector3 hit1 = myHit1->GetPosition();
232  // TVector3 posSeed(hit0.X(),hit0.Y(),hit0.Z());
233  // vec*=1./vec.Mag();
234  // //shift trk out of plane [needed for correct treatment in Kalman Fillter and GEANE]
235  // double sh_z = -0.035; //350 mkm
236  // double sh_x = vec.X()*sh_z;
237  // double sh_y = vec.Y()*sh_y;
238  // TVector3 sh_point(sh_x,sh_y,sh_z);
239  // posSeed +=sh_point;
240  // myTCand->setTrackSeed(posSeed,vec,-1);
241  // ///-------------------------------------
242 
243  tofill.push_back(*(myTCand)); //save Track Candidate
244  //new((*fTrackCandArray)[trackCnt]) PndTrackCand(*(myTCand));
245  delete myTCand;
246  }//Track Cand build
247  }//end of pseudo-tracks
248 
249 }
250 // -------------------------------------------------------------------------
251 
252 // ----- Private method FindHitsI --------------------------------------------
253 void PndMQStraightLineTrackFinder::FindHitsI(std::vector<PndTrackCand> &tofill, std::vector< std::vector< std::pair<Int_t,bool> > > &hitsd, Int_t nStripHits)
254 {
255 
256  std::vector<TVector3> trackStart, trackVec;//pseudo tracks
257  std::vector<TVector3> trackStartd, trackVecd;//save errors
258  std::vector< Int_t > trackID1, trackID2; //for TrackCand
259 
260 //iterate first discs-hits with all seconds, save pseudo-tracks
261  TVector3 start, tmp, vec, dstart, dvec; //temp-vars
262 
263  if(hitsd.size()<2) return;
264  for (Int_t i=0; i<hitsd.at(0).size(); i++)
265  {
266  PndSdsHit *hit1=(PndSdsHit*)fHitArray->At(hitsd.at(0).at(i).first);
267  start.SetXYZ(hit1->GetX(), hit1->GetY(), hit1->GetZ());
268  dstart.SetXYZ(hit1->GetDx(), hit1->GetDy(), hit1->GetDz());
269  for (Int_t k=0; k<hitsd.at(1).size(); k++)
270  {
271  PndSdsHit *hit2=(PndSdsHit*)fHitArray->At(hitsd.at(1).at(k).first);
272  tmp.SetXYZ(hit2->GetX(), hit2->GetY(), hit2->GetZ());
273  vec = tmp - start; //calc direction vector for FINDING
274  dvec.SetXYZ(hit2->GetDx(), hit2->GetDy(), hit2->GetDz());
275  // if(vec.Theta()>0.03 && vec.Theta()<0.05 && vec.Phi()>-0.25 && vec.Phi()<0.25){ //ignore vectors with theta outside 2-9 mrad
276  // if(vec.Theta()<0.01){ //ignore vectors with theta outside 10 mrad
277  trackStart.push_back(start);
278  trackStartd.push_back(dstart);
279  trackVec.push_back(vec); //save vector from start to second
280  trackVecd.push_back(dvec); //save error of second point for FIT, NOT error of direction vector
281  //trackID1.push_back(hitsd.at(0).at(i).first); //save Hit-Id's for TrackCand
282  //trackID2.push_back(hitsd.at(1).at(k).first);
283  trackID1.push_back(i); //save Hit-Id's for TrackCand
284  trackID2.push_back(k);
285  // }
286  }//end of disc 2 (or 3 if none in disc 2) hits
287  }//end of disc 1 hits
288 
289  if(fVerbose>1) cout << "Pseudos L1L2: "<< trackStart.size() <<endl;
290 
291  std::vector<Int_t> ids;
292 
293 //check if other discs have hits in track, add points for fitting ---------------
294  for (Int_t i=0; i<trackStart.size(); i++) //pseudo-loop
295  {
296  ids.clear();
297  Int_t pntcnt=2;
298 
299  start = trackStart.at(i);
300  dstart = trackStartd.at(i);
301  vec = trackVec.at(i);
302  dvec = trackVecd.at(i);
303  ids.push_back(hitsd.at(0).at(trackID1.at(i)).first);
304  ids.push_back(hitsd.at(1).at(trackID2.at(i)).first);
305  std::vector< std::pair<Int_t,Int_t> > otherIDs;
306 
307  for (Int_t idet=2; idet < 4; idet++){
308  Double_t distClosest = 2*idet*dXY; //just bigger as possible
309  Bool_t firstp = true;
310  for (Int_t ihit=0; ihit<hitsd.at(idet).size(); ihit++)
311  {
312  PndSdsHit *hit=(PndSdsHit*)fHitArray->At(hitsd.at(idet).at(ihit).first);
313  Double_t scale = (hit->GetZ()-start.z())/vec.z();
314  tmp = start + scale*vec; //extend search-vector to hit-plane
315  Double_t distTmp = sqrt((tmp.x()-hit->GetX())*(tmp.x()-hit->GetX()) + (tmp.y()-hit->GetY())*(tmp.y()-hit->GetY()));
316  if( distTmp<(idet*dXY) ){ //if in diameter
317  if(firstp){
318  pntcnt++;
319  ids.push_back(hitsd.at(idet).at(ihit).first);
320  otherIDs.push_back( make_pair (idet,ihit) );
321  distClosest=distTmp;
322  firstp=false;
323  }else{
324  if(distTmp<distClosest){ //change if nearer
325  ids.pop_back();
326  otherIDs.pop_back();
327  ids.push_back(hitsd.at(idet).at(ihit).first);
328  otherIDs.push_back( make_pair (idet,ihit) );
329  }
330  }
331  }//endif in diameter
332  }//end of disc n hits
333  }//end of discs
334 
335  if(fVerbose>2) cout << " Track L1L2: "<< i << "#Planes: " << ids.size() <<endl;
336 
337  //create track für fitting
338  if(ids.size()>2){ //third hit found <=> !track found!
339  // if(ids.size()>3){ //4 hits are needed because 6 parameters are used in trk-fit!
340  // // //third hit found <=> !track found!
341  // // //check direction for reduction of ghost tracks
342  // if(ids.size()>2 &&
343  // fabs(vec.Phi())<0.26 && vec.Theta()>3e-2 && vec.Theta()<5e-2){
344  if(fVerbose>2) cout << " Track: "<< i << "#Planes: " << ids.size() <<endl;
345  PndTrackCand *myTCand = new PndTrackCand();
346 
347  for (Int_t id=0; id<ids.size(); id++){
348  PndSdsHit* myHit = (PndSdsHit*)(fHitArray->At(ids.at(id)));
349  PndSdsClusterStrip* myCluster;
350  PndSdsDigiStrip* astripdigi;
351 
352  myTCand->AddHit(FairRootManager::Instance()->GetBranchId(fHitBranchStrip),ids.at(id),myHit->GetPosition().Mag());
353 
354  }
355 
356  //mark used hits---------
357  hitsd.at(0).at(trackID1.at(i)).second=true;
358  hitsd.at(1).at(trackID2.at(i)).second=true;
359  for(Int_t id=0; id<otherIDs.size(); id++){
360  hitsd.at(otherIDs.at(id).first).at(otherIDs.at(id).second).second=true;
361  }
362 
364  // Double_t Z0 = 1099.;
365  // // Double_t Z0 = 0;
366  // PndSdsHit* myHit0 = (PndSdsHit*)(fStripHitArray->At(ids.at(0)));
367  // PndSdsHit* myHit1 = (PndSdsHit*)(fStripHitArray->At(ids.at(1)));
368  // TVector3 hit0 = myHit0->GetPosition(); TVector3 hit1 = myHit1->GetPosition();
369  // double p1seed = (hit0.X()-hit1.X())/(hit0.Z()-hit1.Z());
370  // double p0seed = hit0.X() - p1seed*(hit0.Z()-Z0);
371  // // double p0seed = 0.5*(hit0.X()+hit1.X()-p1seed*(hit0.Z()+hit1.Z()-2*1099.)); //TO DO: don't use const
372  // double p3seed = (hit0.Y()-hit1.Y())/(hit0.Z()-hit1.Z());
373  // double p2seed = hit0.Y() - p3seed*(hit0.Z()-Z0);
374  // //double p2seed = 0.5*(hit0.Y()+hit1.Y()-p1seed*(hit0.Z()+hit1.Z()-2*1099.)); //TO DO: don't use const
375  // TVector3 posSeed(p0seed,p2seed,Z0);
376  // TVector3 dirSeed(p1seed,p3seed,1.);
377  // cout<<"posSeed:"<<endl;
378  // posSeed.Print();
379  // cout<<"dirSeed:"<<endl;
380  // dirSeed.Print();
381 
382  // // Double_t Z0 = 1099.;
383  // // TVector3 posSeed(start.X(),start.Y(),Z0);
384  // TVector3 posSeed(start.X(),start.Y(),start.Z());
385  // // cout<<"Trk cand: pos"<<endl;
386  // // posSeed.Print();
387  // vec*=1./vec.Mag();
388  // //shift trk out of plane [needed for correct treatment in Kalman Fillter and GEANE]
389  // double sh_z = -0.035; //350 mkm
390  // double sh_x = vec.X()*sh_z;
391  // double sh_y = vec.Y()*sh_y;
392  // TVector3 sh_point(sh_x,sh_y,sh_z);
393  // posSeed +=sh_point;
394 
395  // // cout<<"Trk cand: vec"<<endl;
396  // // vec.Print();
397  // myTCand->setTrackSeed(posSeed,vec,-1);
398  // ///-------------------------------------
399 
400 
401  tofill.push_back(*(myTCand)); //save Track Candidate
402  //new((*fTrackCandArray)[trackCnt]) PndTrackCand(*(myTCand));
403  delete myTCand;
404  }//Track Cand build
405  }//end of pseudo-tracks
406 
407 }
408 // -------------------------------------------------------------------------
409 
410 // ----- Public method Exec --------------------------------------------
411 void PndMQStraightLineTrackFinder::Exec(Option_t*)
412 {
413  TStopwatch *timer_exec = new TStopwatch();
414  if(fVerbose>2) timer_exec->Start();
415  if(fVerbose>2) cout << "Evt " << FairRootManager::Instance()->GetEntryNr() << " started--------------"<<endl<<endl;
416 
417  //which combinations of planes to build pseudo-vectos
418  //Int_t planeFlag=0; //flag=... 0: planes 1-2, 1: 1-2 & 1-3, 2: 1-2 & 1-3 & 2-3
419 
420  // Reset output array
421  if ( ! fTrackCandArray )
422  Fatal("Exec", "No trackCandArray");
423  fTrackCandArray->Clear();
424 
425  Int_t nStripHits = fHitArray->GetEntriesFast();
426  if(fVerbose>2) cout << "# Hits: \t"<< nStripHits <<endl<<endl;
427  bool usedFlag[nStripHits]; //for pseudo-vector building
428  for(Int_t seti=0; seti<nStripHits; seti++)
429  usedFlag[seti]=false;
430 
431  if(nStripHits<2){
432  if(fVerbose>2) cout << "Evt finsihed: too less hits-----"<<endl<<endl;
433  return;
434  }
435 
436  //-----do some sorting first----------
437  std::vector< std::vector< std::pair<int,bool> > > hitsd(4);
438  bool resSortHits;
439  if(flagStipSens) resSortHits = SortHitsByDet(hitsd, nStripHits);
440  else{
441  if(flagPixelSens) resSortHits = SortHitsByDet2(hitsd, nStripHits);
442  else{
443  std::cout<<"Algorithm is needed sensor type! Please, set it via SetSensStripFlag(bool fS) or SetSensPixelFlag(bool fS)"<<std::endl;
444  return;
445  }
446  }
447  if(!resSortHits){
448  if(fVerbose>2) cout << "Evt finsihed: too less planes-----"<<endl<<endl;
449  return;
450  }
451 
452 
453  if(fVerbose>2){
454  cout<<"HitMap size: "<< hitsd.size() <<endl;
455  if(hitsd.size()>0){
456  for (Int_t i=0; i<hitsd.at(0).size(); i++){
457  PndSdsHit *hit=(PndSdsHit*)fHitArray->At(hitsd.at(0).at(i).first);
458  cout<<"Plane0 Hit=("<<hit->GetX()<<", "<<hit->GetY()<<", "<<hit->GetZ()<<")"<<endl;
459  }
460  }
461  if(hitsd.size()>1){
462  for (Int_t i=0; i<hitsd.at(1).size(); i++){
463  PndSdsHit *hit=(PndSdsHit*)fHitArray->At(hitsd.at(1).at(i).first);
464  cout<<"Plane1 Hit=("<<hit->GetX()<<", "<<hit->GetY()<<", "<<hit->GetZ()<<")"<<endl;
465  }
466  }
467  if(hitsd.size()>2){
468  for (Int_t i=0; i<hitsd.at(2).size(); i++){
469  PndSdsHit *hit=(PndSdsHit*)fHitArray->At(hitsd.at(2).at(i).first);
470  cout<<"Plane2 Hit=("<<hit->GetX()<<", "<<hit->GetY()<<", "<<hit->GetZ()<<")"<<endl;
471  }
472  }
473  if(hitsd.size()>3){
474  for (Int_t i=0; i<hitsd.at(3).size(); i++){
475  PndSdsHit *hit=(PndSdsHit*)fHitArray->At(hitsd.at(3).at(i).first);
476  cout<<"Plane3 Hit=("<<hit->GetX()<<", "<<hit->GetY()<<", "<<hit->GetZ()<<")"<<endl;
477  }
478  }
479  }
480 
481  std::vector<PndTrackCand> theCands; //Track Candidates
482 
483  //--------find some tracks--------------
484  FindHitsI(theCands, hitsd, nStripHits);
485  if(fFinderMode){ 
486  FindHitsII(theCands, hitsd, nStripHits);
487  FindHitsIII(theCands, hitsd, nStripHits);
488  }
489 
490  //fill tracklist für fitting
491  for(int t=0; t<theCands.size(); t++)
492  new((*fTrackCandArray)[t]) PndTrackCand(theCands.at(t));
493 
494  if(fVerbose>2) cout << "Evt finsihed--------------"<<endl<<endl;
495  if(fVerbose>2){
496  timer_exec->Stop();
497  Double_t rtime_exec = timer_exec->RealTime();
498  Double_t ctime_exec = timer_exec->CpuTime();
499  cout << "Real time for Exec:" << rtime_exec << " s, CPU time " << ctime_exec << " s" << endl;
500  cout << endl;
501  }
502 }
503 // -------------------------------------------------------------------------
504 
506 {
507  TVector3 p = myTrack->GetMomentum();
508  return (2/TMath::Sqrt(p.Px()*p.Px() + p.Py()*p.Py()));
509 }
510 // -------------------------------------------------------------------------
511 
513 {
514  TVector3 p= myTrack->GetMomentum();
515  return (p.Mag()/TMath::Sqrt(p.Px()*p.Px() + p.Py()*p.Py()));
516 }
517 
Double_t p
Definition: anasim.C:58
int fVerbose
Definition: poormantracks.C:24
Int_t i
Definition: run_full.C:25
TVector3 GetPosition() const
Definition: PndSdsHit.h:93
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
std::vector< PndTrackCand > FindTracks(std::vector< PndSdsHit > hits)
Class for digitised strip hits.
TVector3 GetMomentum() const
Definition: PndMCTrack.h:78
std::vector< std::vector< int > > GetStartCombination(int firstLayer, int secondLayer)
Int_t GetDigiIndex(Int_t i) const
Definition: PndSdsCluster.h:40
void AddHit(UInt_t detId, UInt_t hitId, Double_t rho)
Double_t
void SortHitsToLayers(std::vector< PndSdsHit > hits)
Double_t z
Double_t GetTrackDip(PndMCTrack *myTrack)
Int_t GetDetID() const
Definition: PndSdsDigi.h:61
TTree * t
Definition: bump_analys.C:13
Int_t GetClusterIndex() const
Definition: PndSdsHit.h:94
PndSdsMCPoint * hit
Definition: anasim.C:70
std::vector< std::vector< std::pair< PndSdsHit, bool > > > fHitsPerLayer
CbmHit * hits[nHits]
Definition: RiemannTest.C:19
double DistanceOfPoints(TVector3 first, TVector3 second)
Double_t GetTrackCurvature(PndMCTrack *myTrack)
dble_vec_t vec[12]
Definition: ranlxd.cxx:380