FairRoot/PandaRoot
PndTrkConformalHit.cxx
Go to the documentation of this file.
1 //
2 // PndTrkConformalHit.cxx
3 //
4 // Class for pattern recognition conformal hit
5 //
6 // authors: Lia Lavezzi - INFN Pavia (2012)
7 //
8 
9 #include "PndTrkConformalHit.h"
10 
11 #include <iostream>
12 
13 // ROOT
14 #include "TArc.h"
15 #include "TMarker.h"
16 #include "TMath.h"
17 
18 using namespace std;
19 
20 PndTrkConformalHit::PndTrkConformalHit() : fHit(NULL), fPosition(0., 0.), fIsochrone(-1) {}
21 
22 
23 PndTrkConformalHit::PndTrkConformalHit(PndTrkHit *hit, double u, double v, double rd) : fHit(hit), fPosition(u, v), fIsochrone(rd) {}
24 
25 PndTrkConformalHit::PndTrkConformalHit(PndTrkHit *hit, double u, double v) : fHit(hit), fPosition(u, v), fIsochrone(-1) {}
26 
28 
29 
30 double PndTrkConformalHit::GetDistanceFromTrack(double fitm, double fitp) {
31  return TMath::Abs(fPosition.Y() - fitm * fPosition.X() - fitp)/TMath::Sqrt(fitm *fitm + 1);
32 }
33 
34 void PndTrkConformalHit::Draw(Color_t color) {
35 
36  TMarker *mrk = NULL;
37  TArc *arc = NULL;
38 
39  switch(fHit->GetIRegion()) {
40  case 0:
41  {
42  mrk = new TMarker(fPosition.X(), fPosition.Y(), 21);
43  break;
44  }
45  case 1:
46  {
47  mrk = new TMarker(fPosition.X(), fPosition.Y(), 25);
48  break;
49  }
50  case 2:
51  case 6:
52  case 3:
53  case 7:
54  {
55  arc = new TArc(fPosition.X(), fPosition.Y(), fIsochrone); // TUBERADIUS);
56  break;
57  }
58  case 4:
59  case 5:
60  {
61  // arc = new TArc(fPosition.X(), fPosition.Y(), TUBERADIUS); // CHECK skew
62  mrk = new TMarker(fPosition.X(), fPosition.Y(), 3);
63  break;
64  }
65  case 8:
66  {
67  mrk = new TMarker(fPosition.X(), fPosition.Y(), 29);
68  break;
69  }
70  case 9:
71  {
72  mrk = new TMarker(fPosition.X(), fPosition.Y(), 24);
73  break;
74  }
75  case 10:
76  {
77  mrk = new TMarker(fPosition.X(), fPosition.Y(), 25);
78  break;
79  }
80  }
81 
82  if(mrk) {
83  mrk->SetMarkerColor(color);
84  mrk->Draw("SAME");
85  }
86  if(arc) {
87  arc->SetFillStyle(0);
88  arc->SetLineColor(color);
89  arc->Draw("SAME");
90  }
91 
92 
93 }
94 
96 
97  cout << "conformal hit ###############################" << endl;
98  cout << "hitID " << fHit->GetHitID() << " detID " << fHit->GetDetectorID() << endl;
99  cout << "isochrone " << fIsochrone << endl;
100  fPosition.Print();
101 }
102 
103 
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
__m128 v
Definition: P4_F32vec4.h:4
Int_t GetHitID()
Definition: PndTrkHit.h:56
static T Abs(const T &x)
Definition: PndCAMath.h:39
Int_t GetIRegion()
Definition: PndTrkHit.h:64
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
void Draw(Color_t color)
double GetDistanceFromTrack(double fitm, double fitp)
ClassImp(PndAnaContFact)
PndSdsMCPoint * hit
Definition: anasim.C:70