10#include "TrackTpcToFCut.h"
23 TrackTpcToFCut::TrackTpcToFCut(TrackTpcCut* tpc, TrackToFMass2Cut* tof) : TrackExpCut(8) {
25 fToF =
new TrackToFMass2Cut(*tof);
27 fToF =
new TrackToFMass2Cut();
29 fTpc =
new TrackTpcCut(*tpc);
31 fTpc =
new TrackTpcCut();
34 for (
int i = 0; i < fTpc->GetCutSize(); i++) {
35 SetUnitName(fTpc->GetUnit(i), i);
37 SetUnitName(fToF->GetUnit(0), fTpc->GetCutSize());
38 for (
int i = 0; i < 7; i++) {
39 SetMinMax(fTpc->GetMin(i), fTpc->GetMax(i), i);
41 SetMinMax(fToF->GetMin(0), fToF->GetMax(0), 7);
44 Bool_t TrackTpcToFCut::Init(Int_t format_id) {
45 if (fTpc->Init(format_id) == kFALSE) {
46 Cout::PrintInfo(Form(
"Cannot init %s becase TPC cut", ClassName()), EInfo::kWarning);
49 if (fToF->Init(format_id) == kFALSE) {
50 Cout::PrintInfo(Form(
"Cannot init %s because ToF cut", ClassName()), EInfo::kWarning);
53 for (
int i = 0; i < 7; i++) {
54 SetMinMax(fTpc->GetMin(i), fTpc->GetMax(i), i);
56 SetMinMax(fToF->GetMin(0), fToF->GetMax(0), 7);
60 Bool_t TrackTpcToFCut::Pass(
Track* tr) {
61 Double_t px = tr->
GetPx();
62 Double_t py = tr->
GetPy();
63 Double_t pz = tr->
GetPz();
64 Double_t p = TMath::Sqrt(px * px + py * py + pz * pz);
65 Bool_t good = fTpc->Pass(tr);
66 Bool_t tof_ok = fToF->Pass(tr);
67 for (
int i = 0; i < fTpc->GetCutSize(); i++) {
68 SetValue(fTpc->GetValue(i), i);
70 SetValue(fToF->GetValue(), 7);
72 if (tof_ok == kFALSE) good = kFALSE;
74 Double_t m2 = fToF->GetValue(0);
75 if (m2 != 0.0 && m2 > -1) {
76 if (tof_ok == kFALSE) good = kFALSE;
79 return ForcedUpdate(good);
83 Package* pack = TrackExpCut::Report();
92 fToF->GetPolyDown(LowLine[0], LowLine[1], LowLine[2]);
93 fToF->GetPolyUp(HighLine[0], HighLine[1], HighLine[2]);
106 TrackExpCut(other), fThreshold(other.fThreshold), fTofOpt(other.fTofOpt) {
107 TString tof_class = other.fToF->ClassName();
108 if (tof_class ==
"Hal::TrackToFMass2Cut") {
110 }
else if (tof_class ==
"Hal::TrackTofMass2CutNoZeros") {
111 fToF =
new TrackTofMass2CutNoZeros(*other.fToF);
113 fTpc =
new TrackTpcCut(*other.fTpc);
116 TrackTpcToFCut::~TrackTpcToFCut() {
TObject * GetObjectByName(TString name, Int_t index=0, Bool_t quited=kFALSE) const
void AddObject(TObject *object)