PandaRoot
PndLine.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /*
14  * PndLine.h
15  *
16  * Created on: Jun 14, 2016
17  * Author: kibellus
18  */
19 
20 #ifndef PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINE_H_
21 #define PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINE_H_
22 
23 #include "TVector3.h"
24 #include "TMath.h"
25 
26 #include "FairHit.h"
27 #include "PndFtsHit.h"
28 #include "PndPlane.h"
29 #include "FairTrackParP.h"
30 #include <iostream>
31 #include <vector>
32 
33 using namespace std;
34 
35 class PndLine {
36  public:
37  PndLine() : fP1(), fP2(), fRating(1) {}
38  PndLine(FairHit *h1, FairHit *h2);
39  PndLine(TVector3 &base, TVector3 &dir);
40  PndLine(TVector3 h1, Int_t layer);
41  virtual ~PndLine();
42  void Print(Bool_t withDirVec = kFALSE);
43  FairTrackParP plot(Double_t zVal1, Double_t zVal2);
44  TVector3 getP1() { return fP1; }
45  TVector3 getP2() { return fP2; }
46  TVector3 getDir() { return fP1 - fP2; }
47  bool operator<(const PndLine &) const // rhs //[R.K.03/2017] unused variable(s)
48  {
49  return kTRUE; // dummy sorting operator for map
50  }
51  Double_t getZAngle() { return TMath::Abs(TMath::ASin(getDir()[2] / getDir().Mag()) * TMath::RadToDeg()); }
52  Int_t getRating() { return fRating; }
53  void incrementRating() { fRating++; }
54  void setRating(Int_t r) { fRating = r; }
55  // PndLine approx(PndLine &l2);
56  TVector3 getPerpendicular(PndLine l2); // the point on this line
57  Double_t getDistTo(TVector3 p);
58 
59  private:
60  TVector3 fP1;
61  TVector3 fP2;
62  Int_t fRating;
63 };
64 
65 #endif /* PNDTOOLS_PNDFORWARDTRACKFINDER_PNDLINE_H_ */
static T ASin(const T &x)
Double_t getZAngle()
Definition: PndLine.h:51
STL namespace.
PndLine()
Definition: PndLine.h:37
TVector3 getP2()
Definition: PndLine.h:45
TVector3 getDir()
Definition: PndLine.h:46
static T Abs(const T &x)
Definition: PndCAMath.h:68
void incrementRating()
Definition: PndLine.h:53
bool operator<(const PndLine &) const
Definition: PndLine.h:47
void setRating(Int_t r)
Definition: PndLine.h:54
Int_t getRating()
Definition: PndLine.h:52
TVector3 getP1()
Definition: PndLine.h:44