4#include "DataFormatManager.h"
12 Cut::Cut(
const Int_t size, ECutUpdate update, TString group_flag) :
26 fGroupFlag(group_flag) {}
28 Cut::Cut(
const Cut& cut) : TNamed(cut), fCutSize(cut.fCutSize), fUpdateRatio(cut.fUpdateRatio), fGroupFlag(cut.fGroupFlag) {
29 this->fPassed = cut.fPassed;
30 this->fFailed = cut.fFailed;
31 this->fTotal = cut.fTotal;
32 this->fSubCut = cut.fSubCut;
94 if (i > fSubCut.
GetSize() || i < 0) {
95 Cout::PrintInfo(Form(
"Seting wrong parameter id (%i) in %s", i, ClassName()), EInfo::kError);
103 Cut** array =
new Cut*[no];
104 for (
int i = 0; i < no; i++) {
107 if (increment_collections) {
108 for (
int i = 0; i < no; i++) {
119 for (Int_t i = 0; i <
fCutSize; i++) {
131 TObjArray*
Cut::Split(Int_t n, Int_t i, Double_t shift)
const {
133 Cout::PrintInfo(Form(
"Canot split %s along %i", this->ClassName(), n), EInfo::kLowWarning);
137 Cout::PrintInfo(Form(
"Canot split %s into %i partts", this->ClassName(), i), EInfo::kLowWarning);
140 TObjArray* cuts_array =
new TObjArray();
141 Double_t tmin =
GetMin(i);
142 Double_t tmax =
GetMax(i);
143 Double_t step = (tmax - tmin) / ((Double_t) n);
144 for (
int j = 0; j < n; j++) {
146 Double_t min = tmin + j * step;
147 Double_t max = tmin + (j + 1) * step;
148 if (shift > 0 && j != 0) {
150 }
else if (shift < 0 && j != n - 1) {
154 cuts_array->AddLast(copy);
160 Cout::InStars(Form(
"Report %s", this->ClassName()));
171 if (
this == &other)
return *
this;
172 if (other.
fCutSize != this->fCutSize)
return *
this;
173 if (other.
fUpdateRatio != this->fUpdateRatio)
return *
this;
174 fPassed = other.fPassed;
175 fFailed = other.fFailed;
176 fTotal = other.fTotal;
177 fSubCut = other.fSubCut;
188 if (depth == EFormatDepth::kAll) {
189 if (this->InheritsFrom(
"Hal::TwoTrackCut"))
190 depth = EFormatDepth::kBuffered;
192 depth = EFormatDepth::kNonBuffered;
195 TString classname = ev->ClassName();
196 if (classname.EqualTo(format))
203 if (depth == EFormatDepth::kAll) {
204 if (this->InheritsFrom(
"Hal::TwoTrackCut"))
205 depth = EFormatDepth::kBuffered;
207 depth = EFormatDepth::kNonBuffered;
210 if (ev->InheritsFrom(format))
return kTRUE;
215 TString option = opt;
217 TString className = ClassName();
218 if (
fLabel >= 0) className = Form(
"%s_%i", className.Data(),
fLabel);
219 if (option.EqualTo(
"re")) {
220 if (InheritsFrom(
"Hal::EventCut")) {
221 name = Form(
"Hal::EventRealCut(%s)", className.Data());
222 }
else if (InheritsFrom(
"Hal::TrackCut")) {
223 name = Form(
"Hal::TrackRealCut(%s)", className.Data());
224 }
else if (InheritsFrom(
"Hal::TwoTrackCut")) {
225 name = Form(
"Hal::TwoTrackRealCut(%s)", className.Data());
227 }
else if (option.EqualTo(
"im")) {
228 if (InheritsFrom(
"Hal::EventCut")) {
229 name = Form(
"Hal::EventImaginaryCut(%s)", className.Data());
230 }
else if (InheritsFrom(
"Hal::TrackCut")) {
231 name = Form(
"Hal::TrackImaginaryCut(%s)", className.Data());
232 }
else if (InheritsFrom(
"Hal::TwoTrackCut")) {
233 name = Form(
"Hal::TwoTrackImaginaryCut(%s)", className.Data());
236 if (name.Length() == 0) name = className;
247 std::vector<std::pair<TString, Double_t>> x;
static void Text(TString text, TString option="L", Color_t color=-1)
static void PrintInfo(TString text, Hal::EInfo status)
static void Database(Int_t no...)
Bool_t FormatInhertis(TString format, Int_t format_id, EFormatDepth depth=EFormatDepth::kAll) const
Cut & operator=(const Cut &other)
virtual TString CutName(Option_t *opt="") const
void SetMinAndMax(Double_t val, Int_t i=0)
Cut ** MultiClone(Int_t no, Bool_t increment_collections=kFALSE)
virtual void Print(Option_t *option="") const
Bool_t FormatEquals(TString format, Int_t format_id, EFormatDepth depth=EFormatDepth::kAll) const
void SetCollectionID(Int_t i)
TString GetUnit(Int_t i) const
virtual Cut * MakeCopy() const
Bool_t InLimits(Int_t par) 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)
ULong64_t GetFailed() const
TObjArray * Split(Int_t n, Int_t i=0, Double_t shift=0) const
Double_t GetMin(Int_t i=0) const
ULong64_t GetPassed() const
Double_t GetMax(Int_t i=0) const
virtual Package * Report() const
const ECutUpdate fUpdateRatio
Cut(const Int_t size=1, ECutUpdate update=ECutUpdate::kNo, TString groupFlag="")
virtual std::vector< std::pair< TString, Double_t > > GetBinLabels(Int_t par=0) const
void AddObject(TObject *object)
void SetMax(Double_t val, Int_t i=0)
TString GetUnit(Int_t i) const
void SetMin(Double_t val, Int_t i=0)
Double_t GetMax(Int_t i) const
Double_t GetMin(Int_t i) const