10#include "TrackToFMass2Cut.h"
13#include <TLorentzVector.h>
14#include <TMatrixDfwd.h>
19#include "DataFormat.h"
27 TrackToFMass2Cut::TrackToFMass2Cut() : TrackExpCut(1) {
28 SetUnitName(
"ToF M^{2} A [GeV/c^2]", 0);
31 for (
int i = 1; i < 3; i++) {
37 TrackToFMass2Cut::TrackToFMass2Cut(Int_t nParams) : TrackExpCut(nParams) {
38 SetUnitName(
"ToF M^{2} A [GeV/c^2]", 0);
41 for (
int i = 1; i < 3; i++) {
47 void TrackToFMass2Cut::SetPolyLineDown(Double_t a, Double_t b, Double_t c) {
53 void TrackToFMass2Cut::SetPolyLineUp(Double_t a, Double_t b, Double_t c) {
59 Bool_t TrackToFMass2Cut::Init(Int_t formad_id) {
60 Bool_t stat = TrackExpCut::Init(formad_id);
61 if (stat == kFALSE)
return kFALSE;
62 if (ToFAvaiable(formad_id))
return kTRUE;
66 Bool_t TrackToFMass2Cut::Pass(
Track* tr) {
71 Double_t min = fLowLine[0] + fLowLine[1] * p + fLowLine[2] * p * p;
72 Double_t max = fHighLine[0] + fHighLine[1] * p + fHighLine[2] * p * p;
73 if (m2 > max || m2 < min) {
return ForcedUpdate(kFALSE); }
77 TrackToFMass2Cut::~TrackToFMass2Cut() {}
79 Package* TrackToFMass2Cut::Report()
const {
80 Package* rep = TrackExpCut::Report();
90 void TrackToFMass2Cut::GetPolyUp(Double_t& a, Double_t& b, Double_t& c)
const {
96 void TrackToFMass2Cut::GetPolyDown(Double_t& a, Double_t& b, Double_t& c)
const {
102 TrackToFMass2Cut::TrackToFMass2Cut(
const TrackToFMass2Cut& other) : TrackExpCut(other) {
103 for (
int i = 0; i < 3; i++) {
104 fLowLine[i] = other.fLowLine[i];
105 fHighLine[i] = other.fHighLine[i];
109 void TrackToFMass2Cut::SetUpPoints(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t x3, Double_t y3) {
110 GetPoly(fHighLine[0], fHighLine[1], fHighLine[2], x1, y1, x2, y2, x3, y3);
113 void TrackToFMass2Cut::GetPoly(Double_t& a,
141 std::cout << a <<
" " << b <<
" " << c << std::endl;
144 void TrackToFMass2Cut::SetDownPoints(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t x3, Double_t y3) {
145 GetPoly(fLowLine[0], fLowLine[1], fLowLine[2], x1, y1, x2, y2, x3, y3);
154 Double_t min = fLowLine[0] + fLowLine[1] * p + fLowLine[2] * p * p;
155 Double_t max = fHighLine[0] + fHighLine[1] * p + fHighLine[2] * p * p;
156 if (m2 > max || m2 < min) {
return ForcedUpdate(kFALSE); }
Bool_t ForcedUpdate(Bool_t state)
void SetValue(Double_t val, Int_t i=0)
void AddObject(TObject *object)
virtual Bool_t Pass(Track *tr)
const TLorentzVector & GetMomentum() const