Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TwoTrackFemtoQinvCut.cxx
1/*
2 * TwoTrackQinvCut.cxx
3 *
4 * Created on: 5 lip 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "TwoTrackFemtoQinvCut.h"
11
12
13#include <TLorentzVector.h>
14#include <TMath.h>
15#include <TMathBase.h>
16
17#include "Cut.h"
18#include "Package.h"
19#include "Parameter.h"
20#include "Track.h"
21#include "TwoTrack.h"
22
23namespace Hal {
24 TwoTrackFemtoQinvCut::TwoTrackFemtoQinvCut(Double_t mass) : TwoTrackCut(1), fMass2(mass) {
25 SetUnitName("q_{inv} [GeV/c]");
26 fMass2 = fMass2 * fMass2;
27 }
28
29 Bool_t TwoTrackFemtoQinvCut::Pass(TwoTrack* pair) {
30 const TLorentzVector& tr1 = pair->GetTrack1()->GetMomentum();
31 const TLorentzVector& tr2 = pair->GetTrack2()->GetMomentum();
32 Double_t px, py, pz;
33 switch (pair->GetPairType()) {
34 case TwoTrack::kHemishpere:
35 px = tr1.Px() + tr2.Px();
36 py = tr1.Py() + tr2.Py();
37 pz = tr1.Pz() + tr2.Pz();
38 break;
39 case TwoTrack::kRotated:
40 px = tr1.Px() + tr2.Px();
41 py = tr1.Py() + tr2.Py();
42 pz = tr1.Pz() - tr2.Pz();
43 break;
44 default:
45 px = tr1.Px() - tr2.Px();
46 py = tr1.Py() - tr2.Py();
47 pz = tr1.Pz() - tr2.Pz();
48 break;
49 }
50 Double_t p1 = tr1.P();
51 Double_t p2 = tr2.P();
52 Double_t e1 = TMath::Sqrt(p1 * p1 + fMass2);
53 Double_t e2 = TMath::Sqrt(p2 * p2 + fMass2);
54
55 Double_t e = e1 - e2;
56 Double_t q2 = TMath::Sqrt(TMath::Abs((e * e - px * px - py * py - pz * pz)));
57 SetValue(q2);
58 return Validate();
59 }
60
61 TwoTrackFemtoQinvCut::~TwoTrackFemtoQinvCut() {}
62
63 Package* TwoTrackFemtoQinvCut::Report() const {
64 Package* pack = TwoTrackCut::Report();
65 pack->AddObject(new ParameterDouble("Assumed mass", TMath::Sqrt(fMass2)));
66 return pack;
67 }
68} // namespace Hal
void AddObject(TObject *object)
Definition Package.cxx:209
const TLorentzVector & GetMomentum() const
Definition Track.h:118
PairType GetPairType() const
Definition TwoTrack.h:70
Track * GetTrack1() const
Definition TwoTrack.h:75
Track * GetTrack2() const
Definition TwoTrack.h:80