10#include "TwoTrackSailorCowboyCut.h"
16#include <RtypesCore.h>
17#include <TLorentzVector.h>
29 TwoTrackSailorCowboyCut::TwoTrackSailorCowboyCut() : TwoTrackCut(1) {
30 SetUnitName(
"SC [AU]", 0);
36 Bool_t TwoTrackSailorCowboyCut::Pass(
TwoTrack* pair) {
46 X1.SetXYZ(X1.Y(), X1.Z(), Z1.X());
47 X2.SetXYZ(X2.Y(), X2.Z(), Z2.X());
48 P1.SetXYZ(P1.Y(), P1.Z(), P1.X());
49 P2.SetXYZ(P2.Y(), P2.Z(), P2.X());
52 X1.SetXYZ(X1.Z(), X1.X(), Z1.Y());
53 X2.SetXYZ(X2.Z(), X2.X(), Z2.Y());
54 P1.SetXYZ(P1.Z(), P1.X(), P1.Y());
55 P2.SetXYZ(P2.Z(), P2.X(), P2.Y());
59 case TwoTrack::kRotated: {
65 case TwoTrack::kHemishpere: {
80 TwoTrackSailorCowboyCut::~TwoTrackSailorCowboyCut() {}
82 Double_t TwoTrackSailorCowboyCut::NormalizeAngle(
const TVector3 pos, Double_t x, Double_t y)
const {
83 Double_t dx = pos.X() - x;
84 Double_t dy = pos.Y() - y;
85 return TMath::ATan2(dy, dx);
88 Bool_t TwoTrackSailorCowboyCut::AreBetween(Double_t phi, Double_t sign)
const {
90 if (phi > 0)
return kFALSE;
92 if (phi < 0)
return kFALSE;
97 Bool_t TwoTrackSailorCowboyCut::Check() {
98 Double_t sign1 = fHz1.GetRotationDirection();
99 Double_t sign2 = fHz2.GetRotationDirection();
100 Double_t r2 = 1.0 / fHz2.GetCurv();
101 Double_t x2 = fHz2.GetXcenter();
102 Double_t y2 = fHz2.GetYcenter();
103 Double_t x1 = fHz1.GetXcenter();
104 Double_t y1 = fHz1.GetYcenter();
105 Double_t phi1 = fHz1.GetPhi0();
106 Double_t phi2 = fHz2.GetPhi0();
108 fHz1.PathLength(r2, x2, y2, s1, s2);
110 TVector3 pos1 = fHz1.EvalPos(s1);
111 TVector3 pos2 = fHz1.EvalPos(s2);
112 if (s1 == s2 && s1 == Helix::MaxPath()) {
116 Double_t phi1_1 = TVector2::Phi_mpi_pi(NormalizeAngle(pos1, x1, y1) - phi1);
117 Double_t phi2_1 = TVector2::Phi_mpi_pi(NormalizeAngle(pos2, x1, y1) - phi1);
118 Double_t phi1_2 = TVector2::Phi_mpi_pi(NormalizeAngle(pos1, x2, y2) - phi2);
119 Double_t phi2_2 = TVector2::Phi_mpi_pi(NormalizeAngle(pos2, x2, y2) - phi2);
120 if (AreBetween(phi1_1, sign1) && AreBetween(phi1_2, sign2)) {
121 if (pos1.Pt() >= fThreshold) {
126 if (AreBetween(phi2_1, sign1) && AreBetween(phi2_2, sign2)) {
127 if (pos2.Pt() >= fThreshold) {
136 Package* TwoTrackSailorCowboyCut::Report()
const {
137 Package* report = TwoTrackCut::Report();
145 fThreshold = other.fThreshold;
148 TwoTrackSailorCowboyCut& TwoTrackSailorCowboyCut::operator=(
const TwoTrackSailorCowboyCut& other) {
149 if (&other !=
this) {
152 fThreshold = other.fThreshold;
Bool_t FormatInhertis(TString format, Int_t format_id, EFormatDepth depth=EFormatDepth::kAll) const
TLorentzVector * GetVertex() const
const Helix & GetHelix() const
TVector3 GetStartPoint() const
void AddObject(TObject *object)
const TLorentzVector & GetMomentum() const
Double_t GetCharge() const
Bool_t Init(Int_t formatId)
PairType GetPairType() const
Track * GetTrack1() const
Track * GetTrack2() const