CbmRoot
PairAnalysisPair.h
Go to the documentation of this file.
1 #ifndef PAIRANALYSISPAIR_H
2 #define PAIRANALYSISPAIR_H
3 
4 //#############################################################
5 //# #
6 //# PairAnalysisPair #
7 //# Interface class to handle pair information #
8 //# #
9 //# #
10 //# Authors: #
11 //# Julian Book, Uni Ffm / Julian.Book@cern.ch #
12 //# #
13 //#############################################################
14 
15 #include <TMath.h>
16 #include <TRef.h>
17 
18 #include "PairAnalysisTrack.h"
20 
21 class TLorentzVector;
22 class CbmVertex;
23 class CbmMCTrack;
24 
26 public:
28  virtual ~PairAnalysisPair();
30 
31  PairAnalysisPair(Char_t type);
32 
33  virtual void SetTracks(PairAnalysisTrack* const particle1,
34  Int_t pid1,
35  PairAnalysisTrack* const particle2,
36  Int_t pid2) = 0;
37 
38  virtual void SetMCTracks(const CbmMCTrack* const particle1,
39  const CbmMCTrack* const particle2) = 0;
40 
41  // kinematics
42  virtual Double_t Px() const { return -999.; }
43  virtual Double_t Py() const { return -999.; }
44  virtual Double_t Pz() const { return -999.; }
45  virtual Double_t Pt() const { return -999.; }
46  virtual Double_t P() const { return -999.; }
47  virtual Bool_t PxPyPz(Double_t p[3]) const {
48  p[0] = Px();
49  p[1] = Py();
50  p[2] = Pz();
51  return kTRUE;
52  }
53 
54  virtual Double_t Xv() const { return -999.; }
55  virtual Double_t Yv() const { return -999.; }
56  virtual Double_t Zv() const { return -999.; }
57  virtual Bool_t XvYvZv(Double_t x[3]) const {
58  x[0] = Xv();
59  x[1] = Yv();
60  x[2] = Zv();
61  return kTRUE;
62  }
63 
64  virtual Double_t OneOverPt() const {
65  return Pt() > 0. ? 1. / Pt() : 0.;
66  } //TODO: check
67  virtual Double_t Phi() const { return -999.; }
68  virtual Double_t Theta() const {
69  return Pz() != 0 ? TMath::ATan(Pt() / Pz()) : 0.;
70  } //TODO: check
71 
72 
73  virtual Double_t E() const { return -999.; }
74  virtual Double_t M() const { return -999.; }
75 
76  // virtual Double_t Eta() const { return -999.; }
77  virtual Double_t Y() const { return -999.; }
78 
79  Short_t Charge() const { return fCharge; }
80  Int_t GetLabel() const { return fLabel; }
81  Double_t GetWeight() const { return fWeight; }
82  // PID
83  const Double_t* PID() const { return 0; } //TODO: check
84 
85  UChar_t GetType() const { return fType; }
86  void SetType(Char_t type) { fType = type; }
87 
88  static void SetBeamEnergy(Double_t beamEbyHand = -1.);
89 
90  // MC information
91  void SetLabel(Int_t label) { fLabel = label; }
92  void SetWeight(Double_t wght) { fWeight = wght; }
93  void SetPdgCode(Int_t pdgCode) { fPdgCode = pdgCode; }
94  Int_t PdgCode() const { return fPdgCode; }
95 
96  //inter leg information
97  virtual Double_t GetChi2() const { return -999.; }
98  virtual Int_t GetNdf() const { return -999.; }
99  virtual Double_t GetDecayLength() const { return -999.; }
100  virtual Double_t GetR() const { return -999.; }
101  virtual Double_t OpeningAngle() const { return -999.; }
102  virtual Double_t OpeningAngleXY() const { return -999.; }
103  virtual Double_t OpeningAngleRZ() const { return -999.; }
104  virtual Double_t DistanceDaughters() const { return -999.; }
105  virtual Double_t DistanceDaughtersXY() const { return -999.; }
106  virtual Double_t DeviationDaughters() const { return -999.; }
107  virtual Double_t DeviationDaughtersXY() const { return -999.; }
108  virtual Double_t DeltaEta() const { return -999.; }
109  virtual Double_t DeltaPhi() const { return -999.; }
110  virtual Double_t DaughtersP() const { return -999.; }
111 
112  // calculate cos(theta*) and phi* in HE and CS pictures
113  virtual void GetThetaPhiCM(Double_t& thetaHE,
114  Double_t& phiHE,
115  Double_t& thetaCS,
116  Double_t& phiCS) const = 0;
117  void GetThetaPhiCM(TLorentzVector& motherMom,
118  TLorentzVector& p1Mom,
119  TLorentzVector& p2Mom,
120  Double_t& thetaHE,
121  Double_t& phiHE,
122  Double_t& thetaCS,
123  Double_t& phiCS) const;
124 
125  virtual Double_t
126  PsiPair(Double_t MagField) const = 0; //Angle cut w.r.t. to magnetic field
127  virtual Double_t PhivPair(
128  Double_t MagField) const = 0; //Angle of ee plane w.r.t. to magnetic field
129 
130  virtual Double_t GetCosPointingAngle(const CbmVertex* primVtx) const /*= 0*/;
131 
132  virtual Double_t GetArmAlpha() const = 0;
133  virtual Double_t GetArmPt() const = 0;
134  void GetDCA(const CbmVertex* primVtx, Double_t d0z0[2]) const; // TOCHECK
135 
136  // daughter references
137  void SetRefFirstDaughter(PairAnalysisTrack* const track) { fRefD1 = track; }
138  void SetRefSecondDaughter(PairAnalysisTrack* const track) { fRefD2 = track; }
139 
141  return dynamic_cast<PairAnalysisTrack*>(fRefD1.GetObject());
142  }
144  return dynamic_cast<PairAnalysisTrack*>(fRefD2.GetObject());
145  }
146  Int_t GetFirstDaughterPid() const { return fPid1; }
147  Int_t GetSecondDaughterPid() const { return fPid2; }
148 
149  // rotations
150  virtual void RotateTrack(PairAnalysisTrackRotator* rot) = 0;
151 
152  void SetKFUsage(Bool_t KFUsage) { fKFUsage = KFUsage; }
153  Bool_t GetKFUsage() const { return fKFUsage; }
154 
155 protected:
156  Char_t fType =
157  -1; // type of the pair e.g. like sign SE, unlike sign SE, ... see PairAnalysis
158  Short_t fCharge = -1; // charge
159  Int_t fLabel = -1; // MC label
160  Double_t fWeight = 1.; // weighting factor
161  Int_t fPdgCode = 0; // pdg code in case it is a MC particle
162  static Double_t fBeamEnergy;
163 
164  TRef fRefD1; // Reference to first daughter
165  TRef fRefD2; // Reference to second daughter
166  Int_t fPid1 = 0; // reference to first daughter pid
167  Int_t fPid2 = 0; // reference to second daughter pid
168 
169  Bool_t fKFUsage = kFALSE; // Use KF for vertexing
170 
171  ClassDef(PairAnalysisPair, 1) // Base class for pairs
172 };
173 
174 #endif
PairAnalysisPair::GetDCA
void GetDCA(const CbmVertex *primVtx, Double_t d0z0[2]) const
Definition: PairAnalysisPair.cxx:135
PairAnalysisPair::PsiPair
virtual Double_t PsiPair(Double_t MagField) const =0
PairAnalysisPair::DeviationDaughtersXY
virtual Double_t DeviationDaughtersXY() const
Definition: PairAnalysisPair.h:107
PairAnalysisPair::SetTracks
virtual void SetTracks(PairAnalysisTrack *const particle1, Int_t pid1, PairAnalysisTrack *const particle2, Int_t pid2)=0
PairAnalysisPair::DeviationDaughters
virtual Double_t DeviationDaughters() const
Definition: PairAnalysisPair.h:106
PairAnalysisPair::GetWeight
Double_t GetWeight() const
Definition: PairAnalysisPair.h:81
PairAnalysisPair::GetFirstDaughterPid
Int_t GetFirstDaughterPid() const
Definition: PairAnalysisPair.h:146
PairAnalysisPair::GetLabel
Int_t GetLabel() const
Definition: PairAnalysisPair.h:80
PairAnalysisPair::GetFirstDaughter
PairAnalysisTrack * GetFirstDaughter() const
Definition: PairAnalysisPair.h:140
PairAnalysisPair::DistanceDaughtersXY
virtual Double_t DistanceDaughtersXY() const
Definition: PairAnalysisPair.h:105
PairAnalysisPair::SetRefSecondDaughter
void SetRefSecondDaughter(PairAnalysisTrack *const track)
Definition: PairAnalysisPair.h:138
PairAnalysisPair::Zv
virtual Double_t Zv() const
Definition: PairAnalysisPair.h:56
PairAnalysisPair::E
virtual Double_t E() const
Definition: PairAnalysisPair.h:73
PairAnalysisPair::fWeight
Double_t fWeight
Definition: PairAnalysisPair.h:160
PairAnalysisPair::SetRefFirstDaughter
void SetRefFirstDaughter(PairAnalysisTrack *const track)
Definition: PairAnalysisPair.h:137
PairAnalysisPair::DeltaPhi
virtual Double_t DeltaPhi() const
Definition: PairAnalysisPair.h:109
PairAnalysisPair::GetType
UChar_t GetType() const
Definition: PairAnalysisPair.h:85
PairAnalysisPair::GetThetaPhiCM
virtual void GetThetaPhiCM(Double_t &thetaHE, Double_t &phiHE, Double_t &thetaCS, Double_t &phiCS) const =0
PairAnalysisPair::SetKFUsage
void SetKFUsage(Bool_t KFUsage)
Definition: PairAnalysisPair.h:152
PairAnalysisPair::PxPyPz
virtual Bool_t PxPyPz(Double_t p[3]) const
Definition: PairAnalysisPair.h:47
PairAnalysisPair::fRefD1
TRef fRefD1
beam energy
Definition: PairAnalysisPair.h:164
PairAnalysisTrackRotator
Definition: PairAnalysisTrackRotator.h:17
PairAnalysisTrackRotator.h
PairAnalysisPair::SetPdgCode
void SetPdgCode(Int_t pdgCode)
Definition: PairAnalysisPair.h:93
PairAnalysisTrack
Definition: PairAnalysisTrack.h:37
PairAnalysisPair::M
virtual Double_t M() const
Definition: PairAnalysisPair.h:74
PairAnalysisPair::OpeningAngle
virtual Double_t OpeningAngle() const
Definition: PairAnalysisPair.h:101
PairAnalysisPair::XvYvZv
virtual Bool_t XvYvZv(Double_t x[3]) const
Definition: PairAnalysisPair.h:57
PairAnalysisPair::GetChi2
virtual Double_t GetChi2() const
Definition: PairAnalysisPair.h:97
PairAnalysisPair
Definition: PairAnalysisPair.h:25
PairAnalysisPair::Phi
virtual Double_t Phi() const
Definition: PairAnalysisPair.h:67
PairAnalysisPair::SetWeight
void SetWeight(Double_t wght)
Definition: PairAnalysisPair.h:92
PairAnalysisPair::GetArmPt
virtual Double_t GetArmPt() const =0
PairAnalysisPair::fPdgCode
Int_t fPdgCode
Definition: PairAnalysisPair.h:161
PairAnalysisPair::Yv
virtual Double_t Yv() const
Definition: PairAnalysisPair.h:55
PairAnalysisPair::fPid2
Int_t fPid2
Definition: PairAnalysisPair.h:167
PairAnalysisPair::Charge
Short_t Charge() const
Definition: PairAnalysisPair.h:79
PairAnalysisPair::OneOverPt
virtual Double_t OneOverPt() const
Definition: PairAnalysisPair.h:64
PairAnalysisPair::Py
virtual Double_t Py() const
Definition: PairAnalysisPair.h:43
PairAnalysisPair::SetBeamEnergy
static void SetBeamEnergy(Double_t beamEbyHand=-1.)
Definition: PairAnalysisPair.cxx:150
PairAnalysisPair::GetDecayLength
virtual Double_t GetDecayLength() const
Definition: PairAnalysisPair.h:99
PairAnalysisPair::DeltaEta
virtual Double_t DeltaEta() const
Definition: PairAnalysisPair.h:108
PairAnalysisPair::fCharge
Short_t fCharge
Definition: PairAnalysisPair.h:158
CbmVertex
Definition: CbmVertex.h:26
PairAnalysisPair::DaughtersP
virtual Double_t DaughtersP() const
Definition: PairAnalysisPair.h:110
PairAnalysisPair::PhivPair
virtual Double_t PhivPair(Double_t MagField) const =0
PairAnalysisPair::GetNdf
virtual Int_t GetNdf() const
Definition: PairAnalysisPair.h:98
PairAnalysisPair::fBeamEnergy
static Double_t fBeamEnergy
Definition: PairAnalysisPair.h:162
PairAnalysisPair::PairAnalysisPair
PairAnalysisPair()
PairAnalysisTrack.h
PairAnalysisPair::~PairAnalysisPair
virtual ~PairAnalysisPair()
Definition: PairAnalysisPair.cxx:59
PairAnalysisPair::Pz
virtual Double_t Pz() const
Definition: PairAnalysisPair.h:44
PairAnalysisPair::fPid1
Int_t fPid1
Definition: PairAnalysisPair.h:166
PairAnalysisPair::GetSecondDaughterPid
Int_t GetSecondDaughterPid() const
Definition: PairAnalysisPair.h:147
PairAnalysisPair::fRefD2
TRef fRefD2
Definition: PairAnalysisPair.h:165
PairAnalysisPair::OpeningAngleRZ
virtual Double_t OpeningAngleRZ() const
Definition: PairAnalysisPair.h:103
PairAnalysisPair::RotateTrack
virtual void RotateTrack(PairAnalysisTrackRotator *rot)=0
CbmMCTrack
Definition: CbmMCTrack.h:34
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
PairAnalysisPair::SetType
void SetType(Char_t type)
Definition: PairAnalysisPair.h:86
PairAnalysisPair::SetMCTracks
virtual void SetMCTracks(const CbmMCTrack *const particle1, const CbmMCTrack *const particle2)=0
PairAnalysisPair::Px
virtual Double_t Px() const
Definition: PairAnalysisPair.h:42
PairAnalysisPair::fKFUsage
Bool_t fKFUsage
Definition: PairAnalysisPair.h:169
PairAnalysisPair::Y
virtual Double_t Y() const
Definition: PairAnalysisPair.h:77
PairAnalysisPair::Xv
virtual Double_t Xv() const
Definition: PairAnalysisPair.h:54
PairAnalysisPair::GetKFUsage
Bool_t GetKFUsage() const
Definition: PairAnalysisPair.h:153
PairAnalysisPair::Pt
virtual Double_t Pt() const
Definition: PairAnalysisPair.h:45
PairAnalysisPair::GetArmAlpha
virtual Double_t GetArmAlpha() const =0
PairAnalysisPair::DistanceDaughters
virtual Double_t DistanceDaughters() const
Definition: PairAnalysisPair.h:104
PairAnalysisPair::Theta
virtual Double_t Theta() const
Definition: PairAnalysisPair.h:68
PairAnalysisPair::PID
const Double_t * PID() const
Definition: PairAnalysisPair.h:83
PairAnalysisPair::OpeningAngleXY
virtual Double_t OpeningAngleXY() const
Definition: PairAnalysisPair.h:102
PairAnalysisPair::GetR
virtual Double_t GetR() const
Definition: PairAnalysisPair.h:100
PairAnalysisPair::fType
Char_t fType
Definition: PairAnalysisPair.h:156
PairAnalysisPair::SetLabel
void SetLabel(Int_t label)
Definition: PairAnalysisPair.h:91
PairAnalysisPair::PdgCode
Int_t PdgCode() const
Definition: PairAnalysisPair.h:94
PairAnalysisPair::GetSecondDaughter
PairAnalysisTrack * GetSecondDaughter() const
Definition: PairAnalysisPair.h:143
PairAnalysisPair::GetCosPointingAngle
virtual Double_t GetCosPointingAngle(const CbmVertex *primVtx) const
Definition: PairAnalysisPair.cxx:118
PairAnalysisPair::fLabel
Int_t fLabel
Definition: PairAnalysisPair.h:159
PairAnalysisPair::P
virtual Double_t P() const
Definition: PairAnalysisPair.h:46