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

#include <PndTrkLegendreTransform.h>

Inheritance diagram for PndTrkLegendreTransform:

Public Member Functions

 PndTrkLegendreTransform ()
 
 ~PndTrkLegendreTransform ()
 
void SetUpLegendreHisto ()
 
void SetUpLegendreHisto (double thetaNofBin, double thetaMin, double thetaMax, double rNofBin, double rMin, double rMax)
 
void SetUpZoomHisto (double theta, double r, double deltatheta, double deltar)
 
void SetUpZoomHisto ()
 
void ResetLegendreHisto ()
 
void ResetZoomHisto ()
 
void FillHisto (TH2F *histo, double thetamin, double thetamax, double x, double y, double radius)
 
void FillLegendreHisto (double x, double y, double radius)
 
void FillZoomHisto (double x, double y, double radius)
 
void ApplyThresholdLegendreHisto (double threshold)
 
int ExtractLegendreMaximum (double &theta_max, double &r_max)
 
void ExtractLegendreMaxima (int nmaxima, std::vector< double > &theta_max, std::vector< double > &r_max, std::vector< int > &content_max)
 
int ExtractZoomMaximum (double &theta_max, double &r_max)
 
int ExtractMaximumFromHisto (TH2F *histo, double &theta_max, double &r_max)
 
void ExtractMaximaFromHisto (int nmaxima, TH2F *histo, std::vector< double > &theta_max, std::vector< double > &r_max, std::vector< int > &content_max)
 
void ExtractLineParameters (double theta, double r, double &slope, double &intercept)
 
void ExtractLegendreSingleLineParameters (double &slope, double &intercept)
 
void ExtractZoomSingleLineParameters (double &slope, double &intercept)
 
void DeleteZoneAroundXYLegendre (double x, double y)
 
void DeleteZoneAroundXYZoom (double x, double y)
 
void DeleteZoneAroundXY (TH2F *histo, double x, double y)
 
void Draw ()
 
void DrawZoom ()
 

Private Attributes

Double_t fThetaNofBin
 
Double_t fThetaMin
 
Double_t fThetaMax
 
Double_t fRNofBin
 
Double_t fRMin
 
Double_t fRMax
 
Double_t fThetaMinZoom
 
Double_t fThetaMaxZoom
 
Double_t fRMinZoom
 
Double_t fRMaxZoom
 
TH2F * fhLegendre
 
TH2F * fhLegendreZoom
 

Detailed Description

Definition at line 7 of file PndTrkLegendreTransform.h.

Constructor & Destructor Documentation

PndTrkLegendreTransform::PndTrkLegendreTransform ( )

Definition at line 19 of file PndTrkLegendreTransform.cxx.

References fThetaMax, and fThetaMin.

PndTrkLegendreTransform::~PndTrkLegendreTransform ( )

Definition at line 40 of file PndTrkLegendreTransform.cxx.

40  {
41 
42 }

Member Function Documentation

void PndTrkLegendreTransform::ApplyThresholdLegendreHisto ( double  threshold)
void PndTrkLegendreTransform::DeleteZoneAroundXY ( TH2F *  histo,
double  x,
double  y 
)

Definition at line 237 of file PndTrkLegendreTransform.cxx.

237  {
238 
239  // int bin = histo->GetMaximumBin();
240  // int bin1, bin2, bin3;
241  // histo->GetBinXYZ(bin, bin1, bin2, bin3);
242  // cout << "MAX BIN BEFORE " << bin << " " << bin1 << " " << bin2 << " " << bin3 << endl;
243 
244  int binx = (int) ((x - histo->GetXaxis()->GetXmin())/histo->GetXaxis()->GetBinWidth(1)) + 1;
245  int biny = (int) ((y - histo->GetYaxis()->GetXmin())/histo->GetYaxis()->GetBinWidth(1)) + 1;
246 
247  // delete the bin and a line and a row around it
248  histo->SetBinContent(binx, biny, 0);
249  histo->SetBinContent(binx + 1, biny, 0);
250  histo->SetBinContent(binx - 1, biny, 0);
251  histo->SetBinContent(binx + 1, biny + 1, 0);
252  histo->SetBinContent(binx, biny + 1, 0);
253  histo->SetBinContent(binx - 1, biny + 1, 0);
254  histo->SetBinContent(binx + 1, biny - 1, 0);
255  histo->SetBinContent(binx, biny - 1, 0);
256  histo->SetBinContent(binx - 1, biny - 1, 0);
257 
258  // cout << "deleting binx " << binx << " " << biny << endl;
259  // bin = histo->GetMaximumBin();
260  // histo->GetBinXYZ(bin, bin1, bin2, bin3);
261  // cout << "MAX BIN AFTER " << bin << " " << bin1 << " " << bin2 << " " << bin3 << endl;
262 }
Double_t x
Double_t y
void PndTrkLegendreTransform::DeleteZoneAroundXYLegendre ( double  x,
double  y 
)
void PndTrkLegendreTransform::DeleteZoneAroundXYZoom ( double  x,
double  y 
)
void PndTrkLegendreTransform::Draw ( )
void PndTrkLegendreTransform::DrawZoom ( )
void PndTrkLegendreTransform::ExtractLegendreMaxima ( int  nmaxima,
std::vector< double > &  theta_max,
std::vector< double > &  r_max,
std::vector< int > &  content_max 
)

Definition at line 115 of file PndTrkLegendreTransform.cxx.

Referenced by PndTrkTrackFinder::Exec().

115  {
116  ExtractMaximaFromHisto(nmaxima, fhLegendre, theta_max, r_max, content_max);
117 }
void ExtractMaximaFromHisto(int nmaxima, TH2F *histo, std::vector< double > &theta_max, std::vector< double > &r_max, std::vector< int > &content_max)
int PndTrkLegendreTransform::ExtractLegendreMaximum ( double &  theta_max,
double &  r_max 
)
void PndTrkLegendreTransform::ExtractLegendreSingleLineParameters ( double &  slope,
double &  intercept 
)

Definition at line 120 of file PndTrkLegendreTransform.cxx.

References r, and theta.

Referenced by PndTrkLegendreSecTask::Exec(), PndTrkLegendreTask::Exec(), PndTrkLegendreSecTask2::Exec(), PndTrkLegendreNew::LegendreFit(), and PndTrkTrackFinder::LegendreFit().

120  {
121  double theta, r;
122  ExtractLegendreMaximum(theta, r);
123  ExtractLineParameters(theta, r, slope, intercept);
124 }
double r
Definition: RiemannTest.C:14
int ExtractLegendreMaximum(double &theta_max, double &r_max)
void ExtractLineParameters(double theta, double r, double &slope, double &intercept)
void PndTrkLegendreTransform::ExtractLineParameters ( double  theta,
double  r,
double &  slope,
double &  intercept 
)

Definition at line 216 of file PndTrkLegendreTransform.cxx.

References CAMath::Sin(), and CAMath::Tan().

Referenced by PndTrkTrackFinder::Exec().

216  {
217  // r = x cost + y sint --> y = r/sint - x/tant
218 
219  if(theta == 0.) theta = 1.e-6; // CHECK
220 
221  slope = - 1./TMath::Tan(TMath::DegToRad() * theta);
222  intercept = r/TMath::Sin(TMath::DegToRad() * theta);
223 
224 }
double r
Definition: RiemannTest.C:14
static T Sin(const T &x)
Definition: PndCAMath.h:42
float Tan(float x)
Definition: PndCAMath.h:165
void PndTrkLegendreTransform::ExtractMaximaFromHisto ( int  nmaxima,
TH2F *  histo,
std::vector< double > &  theta_max,
std::vector< double > &  r_max,
std::vector< int > &  content_max 
)

Definition at line 176 of file PndTrkLegendreTransform.cxx.

176  {
177 
178  // PEAK Finder 2D
179  int maxbins[nmaxima];
180  for(int ibin = 0; ibin < nmaxima; ibin++) maxbins[ibin] = 0;
181 
182  for(int ibinx = 1; ibinx <= histo->GetNbinsX() ; ibinx++) {
183  for(int ibiny = 1; ibiny <= histo->GetNbinsY() ; ibiny++) {
184 
185  int bincontent = histo->GetBinContent(ibinx, ibiny);
186  if(bincontent == 0) continue;
187 
188  int ibintotal = histo->GetBin(ibinx, ibiny);
189 
190  // cout << "current bin: " << ibintotal << " contains " << bincontent << " entries" << endl;
191 
192  for(int ibinm = nmaxima - 1; ibinm >= 0; ibinm--) {
193  // cout << "ibinm " << ibinm << " " << bincontent << " " << maxbins[ibinm] << " " << histo->GetBinContent(maxbins[ibinm]) << endl;
194  if(bincontent >= histo->GetBinContent(maxbins[ibinm])) {
195  for(int jbinm = 0; jbinm < ibinm; jbinm++) maxbins[jbinm] = maxbins[jbinm + 1];
196  maxbins[ibinm] = ibintotal;
197  break;
198  }
199  }
200  }
201  }
202 
203  for(int ibin = 0; ibin < nmaxima; ibin++) {
204  int bin = maxbins[ibin];
205  int binx, biny, binz;
206  histo->GetBinXYZ(bin, binx, biny, binz);
207  theta_max.push_back(histo->GetXaxis()->GetBinCenter(binx));
208  r_max.push_back(histo->GetYaxis()->GetBinCenter(biny));
209  content_max.push_back(histo->GetBinContent(bin));
210 
211  }
212 
213 }
int PndTrkLegendreTransform::ExtractMaximumFromHisto ( TH2F *  histo,
double &  theta_max,
double &  r_max 
)

Definition at line 166 of file PndTrkLegendreTransform.cxx.

166  {
167  int bin = histo->GetMaximumBin();
168  int binx, biny, binz;
169  histo->GetBinXYZ(bin, binx, biny, binz);
170  theta_max = histo->GetXaxis()->GetBinCenter(binx);
171  r_max = histo->GetYaxis()->GetBinCenter(biny);
172  return histo->GetMaximum();
173  // cout << "== THETA, R max ======== " << theta_max << " " << r_max << endl;
174 }
int PndTrkLegendreTransform::ExtractZoomMaximum ( double &  theta_max,
double &  r_max 
)
void PndTrkLegendreTransform::ExtractZoomSingleLineParameters ( double &  slope,
double &  intercept 
)

Definition at line 159 of file PndTrkLegendreTransform.cxx.

References r, and theta.

159  {
160  double theta, r;
161  ExtractZoomMaximum(theta, r);
162  ExtractLineParameters(theta, r, slope, intercept);
163 }
double r
Definition: RiemannTest.C:14
int ExtractZoomMaximum(double &theta_max, double &r_max)
void ExtractLineParameters(double theta, double r, double &slope, double &intercept)
void PndTrkLegendreTransform::FillHisto ( TH2F *  histo,
double  thetamin,
double  thetamax,
double  x,
double  y,
double  radius 
)

Definition at line 70 of file PndTrkLegendreTransform.cxx.

References CAMath::Cos(), Double_t, r, r1, r2, and CAMath::Sin().

70  {
71  Double_t thetaRad = thetamin * TMath::DegToRad();
72  double deltaThetaRad = TMath::DegToRad() * (thetamax - thetamin)/fThetaNofBin;
73 
74 
75  // computation
76  //double deltar = deltaThetaRad * (y * TMath::Cos(thetaRad) - x * TMath::Sin(thetaRad)); //[R.K. 01/2017] unused variable
77  // cout << "cfr delta r " << x << " " << y << " " << radius << " " << deltar << " " << (fRMax - fRMin)/fRNofBin << " " << 2 * radius << endl;
78 
79 
80  while(thetaRad < thetamax * TMath::DegToRad()) {
81  double thetaDeg = thetaRad * TMath::RadToDeg();
82 
83  // STT
84  if(radius > 0.) {
85  double r1 = x * TMath::Cos(thetaRad) + y * TMath::Sin(thetaRad) + radius;
86  double r2 = x * TMath::Cos(thetaRad) + y * TMath::Sin(thetaRad) - radius;
87  // histo->Fill(thetaDeg, r1, radius);
88  // histo->Fill(thetaDeg, r2, radius);
89  histo->Fill(thetaDeg, r1);
90  histo->Fill(thetaDeg, r2);
91  }
92  else { // MVD, SCITIL, GEM
93  double r = x * TMath::Cos(thetaRad) + y * TMath::Sin(thetaRad);
94  histo->Fill(thetaDeg, r);
95  }
96 
97  thetaRad += deltaThetaRad;
98 
99  }
100 }
double r
Definition: RiemannTest.C:14
static T Sin(const T &x)
Definition: PndCAMath.h:42
double r1
static T Cos(const T &x)
Definition: PndCAMath.h:43
Double_t
Double_t x
Double_t y
double r2
void PndTrkLegendreTransform::FillLegendreHisto ( double  x,
double  y,
double  radius 
)
void PndTrkLegendreTransform::FillZoomHisto ( double  x,
double  y,
double  radius 
)
void PndTrkLegendreTransform::ResetLegendreHisto ( )
void PndTrkLegendreTransform::ResetZoomHisto ( )

Definition at line 146 of file PndTrkLegendreTransform.cxx.

146  {
147  fhLegendreZoom->Reset();
148  fhLegendreZoom->SetStats(kFALSE);
149 }
void PndTrkLegendreTransform::SetUpLegendreHisto ( )
void PndTrkLegendreTransform::SetUpLegendreHisto ( double  thetaNofBin,
double  thetaMin,
double  thetaMax,
double  rNofBin,
double  rMin,
double  rMax 
)

Definition at line 50 of file PndTrkLegendreTransform.cxx.

References fThetaMax, and fThetaMin.

void PndTrkLegendreTransform::SetUpZoomHisto ( double  theta,
double  r,
double  deltatheta,
double  deltar 
)
void PndTrkLegendreTransform::SetUpZoomHisto ( )

Member Data Documentation

TH2F* PndTrkLegendreTransform::fhLegendre
private

Definition at line 51 of file PndTrkLegendreTransform.h.

TH2F * PndTrkLegendreTransform::fhLegendreZoom
private

Definition at line 51 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fRMax
private

Definition at line 49 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fRMaxZoom
private

Definition at line 50 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fRMin
private

Definition at line 49 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fRMinZoom
private

Definition at line 50 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fRNofBin
private

Definition at line 49 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fThetaMax
private

Definition at line 49 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fThetaMaxZoom
private

Definition at line 50 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fThetaMin
private

Definition at line 49 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fThetaMinZoom
private

Definition at line 50 of file PndTrkLegendreTransform.h.

Double_t PndTrkLegendreTransform::fThetaNofBin
private

Definition at line 49 of file PndTrkLegendreTransform.h.


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