FairRoot/PandaRoot
PndTrkConformalTransform.cxx
Go to the documentation of this file.
1 //
3 // PndTrkConformalTransform
4 //
5 // Class to perform the Conformal Transformation
6 //
7 // authors: Lia Lavezzi - INFN Pavia (2012)
8 //
10 
12 
13 #include "PndTrkConformalHit.h"
14 #include <iostream>
15 
16 using namespace std;
17 
18 
19 // ----- Default constructor -------------------------------------------
20 PndTrkConformalTransform::PndTrkConformalTransform() : fTrasl(0., 0.), fAngle(0.) {}
21 
22 // -------------------------------------------------------------------------
23 PndTrkConformalTransform::PndTrkConformalTransform(double x, double y, double delta) : fTrasl(x, y), fAngle(delta) {}
24 
25 
26 
27 // ----- Destructor ----------------------------------------------------
29 }
30 // -------------------------------------------------------------------------
31 
32 void PndTrkConformalTransform::SetOrigin(double x, double y, double delta){
33  SetTranslation(x, y);
34  SetRotation(delta);
35 }
36 
38  fTrasl.Set(x, y);
39 }
41  fAngle = delta;
42 }
43 
44 void PndTrkConformalTransform::PerformConformalTransformation(double x, double y, double rd, double &u, double &v, double &rc)
45 {
46  Double_t xtrasl, ytrasl;
47  // traslation
48  xtrasl = x - fTrasl.X();
49  ytrasl = y - fTrasl.Y();
50 
51  Double_t xrot, yrot;
52  xrot = TMath::Cos(fAngle) * xtrasl + TMath::Sin(fAngle) * ytrasl;
53  yrot = -TMath::Sin(fAngle) * xtrasl + TMath::Cos(fAngle) * ytrasl;
54 
55  // change coordinate of the center
56  u = GetXConf(xrot, yrot, rd);
57  v = GetYConf(xrot, yrot, rd);
58  rc = GetRConf(xrot, yrot, rd);
59 
60 }
61 
62 
63 void PndTrkConformalTransform::PerformRealTransformation(double u, double v, double rc, double &x, double &y, double &rd)
64 {
65  // conf ->> real
66  double xrot, yrot;
67  xrot = GetXConf(u, v, rc);
68  yrot = GetYConf(u, v, rc);
69  rd = GetRConf(u, v, rc);
70 
71  // re-rotation
72  Double_t xtrasl, ytrasl;
73  xtrasl = TMath::Cos(fAngle) * xrot - TMath::Sin(fAngle) * yrot;
74  ytrasl = TMath::Sin(fAngle) * xrot + TMath::Cos(fAngle) * yrot;
75 
76  // re-traslation
77  x = xtrasl + fTrasl.X();
78  y = ytrasl + fTrasl.Y();
79 
80 }
81 
82 
84  TVector3 position = hit->GetPosition();
85  Double_t rd = hit->GetIsochrone();
86  double u, v, rc;
87  PerformConformalTransformation(position.X(), position.Y(), rd, u, v, rc);
88  return PndTrkConformalHit(hit, u, v, rc);
89 }
90 
92  TVector3 position = hit->GetPosition();
93  Double_t rd = 0.;
94  double u, v, rc;
95  PerformConformalTransformation(position.X(), position.Y(), rd, u, v, rc);
96  return PndTrkConformalHit(hit, u, v);
97 }
98 
99 double PndTrkConformalTransform::GetXConf(double x, double y, double rd) {
100  return x / (x * x + y * y - rd * rd);
101 }
102 
103 double PndTrkConformalTransform::GetYConf(double x, double y, double rd) {
104  return y / (x * x + y * y - rd * rd);
105 }
106 
107 double PndTrkConformalTransform::GetRConf(double x, double y, double rd) {
108  return rd / (x * x + y * y - rd * rd);
109 }
110 
111 
112 
114 
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
__m128 v
Definition: P4_F32vec4.h:4
double GetXConf(double x, double y, double rd)
Double_t
PndTrkConformalHit GetConformalHit(PndTrkHit *hit)
TVector3 GetPosition()
Definition: PndTrkHit.h:62
void SetOrigin(double x, double y, double delta)
double GetRConf(double x, double y, double rd)
void SetTranslation(double x, double y)
Double_t x
double GetYConf(double x, double y, double rd)
PndTrkConformalHit GetConformalSttHit(PndTrkHit *hit)
ClassImp(PndAnaContFact)
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t y
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
void PerformConformalTransformation(double x, double y, double rd, double &u, double &v, double &rc)
void PerformRealTransformation(double u, double v, double rc, double &x, double &y, double &rd)