10#include "TrackComplexCut.h"
12#include "ComplexEvent.h"
13#include "ComplexTrack.h"
16#include "DataFormatManager.h"
28 if (z_track->GetImgTrack() ==
nullptr) {
30 for (
int i = 0; i < fImgCut->
GetCutSize(); i++)
34 stat2 = fImgCut->
Pass(z_track->GetImgTrack());
36 Bool_t stat1 = fRealCut->
Pass(z_track->GetRealTrack());
37 for (
int i = 0; i < fStep; i++) {
40 for (
int i = 0; i < fImgCut->
GetCutSize(); i++) {
65 TrackCut(1), fRealCut(NULL), fImgCut(NULL), fStep(0), fNullObjects(0), fAcceptNulls(kFALSE) {}
68 TrackCut(real->GetCutSize() + img->GetCutSize()),
69 fRealCut((
TrackCut*) real->MakeCopy()),
70 fImgCut((
TrackCut*) img->MakeCopy()),
72 fAcceptNulls(kFALSE) {
89 Cout::PrintInfo(Form(
"Failed to init cut %s", ClassName()), EInfo::kDebugInfo);
98 manager->
SetFormat(z->GetRealEvent(), task_id, EFormatDepth::kNonBuffered, kTRUE);
99 ok += fRealCut->
Init(task_id);
102 Cout::PrintInfo(Form(
"Failed to init %s due to init %s", ClassName(), fRealCut->ClassName()), EInfo::kDebugInfo);
105 manager->
SetFormat(z->GetImgEvent(), task_id, EFormatDepth::kNonBuffered, kTRUE);
106 Int_t dx = fImgCut->
Init(task_id);
109 Cout::PrintInfo(Form(
"Failed to init %s due to init %s", ClassName(), fImgCut->ClassName()), EInfo::kDebugInfo);
113 manager->
SetFormat(z, task_id, EFormatDepth::kNonBuffered, kTRUE);
114 for (
int i = 0; i < fRealCut->
GetCutSize(); i++) {
117 for (
int i = 0; i < fImgCut->
GetCutSize(); i++) {
120 if (ok == 2)
return kTRUE;
126 fNullObjects = other.fNullObjects;
127 fAcceptNulls = other.fAcceptNulls;
133 return Form(
"Hal::TrackComplexCut(%s,%s)", fRealCut->
CutName().Data(), fImgCut->
CutName().Data());
136 TrackComplexCut::~TrackComplexCut() {
137 if (fRealCut)
delete fRealCut;
138 if (fImgCut)
delete fImgCut;
142 TrackCut(real.GetCutSize() + img.GetCutSize()),
143 fRealCut((TrackCut*) real.MakeCopy()),
144 fImgCut((TrackCut*) img.MakeCopy()),
146 fAcceptNulls(kFALSE) {
147 for (
int i = 0; i < real.GetCutSize(); i++) {
149 SetMinMax(real.GetMin(i), real.GetMax(i), i);
151 fStep = real.GetCutSize();
155 SetMinMax(img.GetMin(j), img.GetMax(j), i);
162 TrackRealCut::TrackRealCut() : TrackCut(1), fRealCut(nullptr) {}
164 TrackRealCut::TrackRealCut(
const TrackCut* real) : TrackCut(real->GetCutSize()), fRealCut((TrackCut*) real->MakeCopy()) {
165 for (
int i = 0; i < real->GetCutSize(); i++) {
167 SetMinMax(real->GetMin(i), real->GetMax(i), i);
171 TrackRealCut::TrackRealCut(
const TrackCut& real) : TrackCut(real.GetCutSize()), fRealCut((TrackCut*) real.MakeCopy()) {
172 for (
int i = 0; i < real.GetCutSize(); i++) {
174 SetMinMax(real.GetMin(i), real.GetMax(i), i);
178 TrackRealCut::TrackRealCut(
const TrackRealCut& other) : TrackRealCut(other.GetRealCut()) {}
182 Bool_t passed = fRealCut->
Pass(z_track->GetRealTrack());
192 const Event*
event = manager->
GetFormat(task_id, EFormatDepth::kNonBuffered);
195 manager->
SetFormat(z->GetRealEvent(), task_id, EFormatDepth::kNonBuffered, kTRUE);
196 Bool_t ok = fRealCut->
Init(task_id);
197 manager->
SetFormat(z, task_id, EFormatDepth::kNonBuffered, kTRUE);
198 for (
int i = 0; i < fRealCut->
GetCutSize(); i++) {
201 if (ok)
return kTRUE;
218 TrackRealCut::~TrackRealCut() {
219 if (fRealCut)
delete fRealCut;
224 TrackImaginaryCut::TrackImaginaryCut() : TrackCut(1), fImgCut(nullptr), fNullObjects(0), fAcceptNulls(kFALSE) {}
226 TrackImaginaryCut::TrackImaginaryCut(
const TrackCut* img) :
227 TrackCut(img->GetCutSize()), fImgCut((TrackCut*) img->MakeCopy()), fNullObjects(0), fAcceptNulls(kFALSE) {
228 for (
int i = 0; i < img->GetCutSize(); i++) {
230 SetMinMax(img->GetMin(i), img->GetMax(i), i);
234 TrackImaginaryCut::TrackImaginaryCut(
const TrackCut& img) :
235 TrackCut(img.GetCutSize()), fImgCut((TrackCut*) img.MakeCopy()), fNullObjects(0), fAcceptNulls(kFALSE) {
236 for (
int i = 0; i < img.GetCutSize(); i++) {
238 SetMinMax(img.GetMin(i), img.GetMax(i), i);
242 TrackImaginaryCut::TrackImaginaryCut(
const TrackImaginaryCut& other) : TrackImaginaryCut(other.GetImgCut()) {
243 fNullObjects = other.fNullObjects;
244 fAcceptNulls = other.fAcceptNulls;
249 if (z_track->GetImgTrack() ==
nullptr) {
258 Bool_t passed = fImgCut->
Pass(z_track->GetImgTrack());
268 const Event*
event = manager->
GetFormat(task_id, EFormatDepth::kNonBuffered);
271 manager->
SetFormat(z->GetImgEvent(), task_id, EFormatDepth::kNonBuffered, kTRUE);
272 Bool_t ok = fImgCut->
Init(task_id);
273 manager->
SetFormat(z, task_id, EFormatDepth::kNonBuffered, kTRUE);
274 for (
int i = 0; i < fImgCut->
GetCutSize(); i++) {
277 if (ok)
return kTRUE;
295 return Form(
"Hal::TrackImaginaryCut(%s)", fImgCut->
CutName().Data());
298 TrackImaginaryCut::~TrackImaginaryCut() {
299 if (fImgCut)
delete fImgCut;
static void PrintInfo(TString text, Hal::EInfo status)
virtual TString CutName(Option_t *opt="") const
virtual Bool_t Init(Int_t=0)
TString GetUnit(Int_t i) const
void SetMinMax(Double_t min, Double_t max, Int_t i=0)
Double_t GetValue(Int_t i=0) const
Bool_t ForcedUpdate(Bool_t state)
void SetValue(Double_t val, Int_t i=0)
ULong64_t GetFailed() const
Double_t GetMin(Int_t i=0) const
ULong64_t GetPassed() const
Double_t GetMax(Int_t i=0) const
void SetUnitName(TString name, Int_t i=0)
void AddObject(TObject *object)
virtual TString CutName(Option_t *opt="") const
virtual Bool_t Init(Int_t task_id)
virtual Package * Report() const
virtual Bool_t Pass(Track *track)
virtual Bool_t Pass(Track *track)=0
virtual Package * Report() const
virtual TString CutName(Option_t *opt="") const
virtual Bool_t Pass(Track *track)
virtual Bool_t Init(Int_t task_id)
virtual Package * Report() const
virtual Bool_t Pass(Track *track)
virtual Package * Report() const
virtual TString CutName(Option_t *opt="") const
virtual Bool_t Init(Int_t task_id)