Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
Cut.h
1/*
2 * Cut.h
3 *
4 * Created on: 04-05-2022
5 * Author: Daniel Wielanek
6 */
10#ifndef _HALCUT_H_
11#define _HALCUT_H_
12
13#include "SubCut.h"
14
15#include <TNamed.h>
16#include <TString.h>
17
18#include <vector>
19
20#include "Std.h"
21
22namespace Hal {
23 class Package;
24
25 class EventComplexCut;
26 class EventImaginaryCut;
27 class EventRealCut;
28
29 class TrackComplexCut;
30 class TrackImaginaryCut;
31 class TrackRealCut;
32
33 class TwoTrackComplexCut;
34 class TwoTrackImaginaryCut;
35 class TwoTrackRealCut;
36
40 class Cut : public TNamed {
41 friend class EventComplexCut;
42 friend class EventImaginaryCut;
43 friend class EventRealCut;
44
45 friend class TrackComplexCut;
46 friend class TrackImaginaryCut;
47 friend class TrackRealCut;
48
49 friend class TwoTrackComplexCut;
50 friend class TwoTrackImaginaryCut;
51 friend class TwoTrackRealCut;
52
53 private:
57 ULong64_t fPassed;
61 ULong64_t fFailed;
65 ULong64_t fTotal;
69 SubCut fSubCut;
70
71 protected:
75 const Int_t fCutSize;
79 Bool_t fInit;
83 Int_t fIsCloned;
87 Int_t fState;
95 Int_t fLabel;
99 const ECutUpdate fUpdateRatio;
103 Double_t fWeight;
107 const TString fGroupFlag;
112 Bool_t Validate();
118 Bool_t AntiValidate();
123 Bool_t ValidateAbs();
129 Bool_t ForcedUpdate(Bool_t state);
136 Bool_t FormatEquals(TString format, Int_t format_id, EFormatDepth depth = EFormatDepth::kAll) const;
143 Bool_t FormatInhertis(TString format, Int_t format_id, EFormatDepth depth = EFormatDepth::kAll) const;
149 Bool_t InLimits(Int_t par) const;
155 Bool_t OutLimits(Int_t par) const { return !InLimits(par); };
156
157 public:
161 Cut(const Int_t size = 1, ECutUpdate update = ECutUpdate::kNo, TString groupFlag = "");
166 Cut(const Cut& cut);
172 Cut& operator=(const Cut& other);
178 void SetLabel(Int_t label) { fLabel = label; }
182 void Finish() {};
186 void Reset();
192 void SetMinAndMax(Double_t val, Int_t i = 0);
199 void SetMinMax(Double_t min, Double_t max, Int_t i = 0);
204 TString GetGroupFlag() const { return fGroupFlag; };
209 ECutUpdate GetUpdateRatio() const { return fUpdateRatio; };
217 Cut** MultiClone(Int_t no, Bool_t increment_collections = kFALSE);
223 inline void SetMinimum(Double_t min, Int_t i = 0) { fSubCut.SetMin(min, i); };
229 inline void SetMaximum(Double_t max, Int_t i = 0) { fSubCut.SetMax(max, i); };
235 inline void SetValue(Double_t val, Int_t i = 0) { fSubCut.SetValue(val, i); };
241 inline void SetUnitName(TString name, Int_t i = 0) { fSubCut.SetUnitName(name, i); };
247 inline void SetCollectionID(Int_t i) { fCollectionID = i; };
252 inline Int_t GetCutSize() const { return fCutSize; };
257 inline Int_t GetCollectionID() const { return fCollectionID; };
262 inline Bool_t HasPassed() const { return fState; };
267 inline Bool_t IsCloned() const { return fIsCloned; };
273 inline Double_t GetMin(Int_t i = 0) const { return fSubCut.GetMin(i); };
279 inline Double_t GetMax(Int_t i = 0) const { return fSubCut.GetMax(i); };
285 inline Double_t GetValue(Int_t i = 0) const { return fSubCut.GetValue(i); };
290 inline Double_t GetWeight() { return fWeight; };
295 inline ULong64_t GetPassed() const { return fPassed; };
300 inline ULong64_t GetTotal() const { return fTotal; };
305 inline ULong64_t GetFailed() const { return fFailed; };
311 inline TString GetUnit(Int_t i) const { return fSubCut.GetUnit(i); };
317 virtual Cut* MakeCopy() const { return (Cut*) this->Clone(); };
322 virtual Package* Report() const;
326 virtual void Print(Option_t* option = "") const;
341 TObjArray* Split(Int_t n, Int_t i = 0, Double_t shift = 0) const;
346 virtual Bool_t Init(Int_t /*format_id*/ = 0) {
347 fInit = kTRUE;
348 return kTRUE;
349 };
356 virtual TString CutName(Option_t* opt = "") const;
363 virtual std::vector<std::pair<TString, Double_t>> GetBinLabels(Int_t par = 0) const;
364 virtual ~Cut() {};
365 ClassDef(Cut, 1)
366 };
367} // namespace Hal
368#endif /* HALCUT_H_ */
Definition Cut.h:40
Bool_t FormatInhertis(TString format, Int_t format_id, EFormatDepth depth=EFormatDepth::kAll) const
Definition Cut.cxx:202
void SetMaximum(Double_t max, Int_t i=0)
Definition Cut.h:229
TString GetGroupFlag() const
Definition Cut.h:204
Cut & operator=(const Cut &other)
Definition Cut.cxx:170
Bool_t OutLimits(Int_t par) const
Definition Cut.h:155
virtual TString CutName(Option_t *opt="") const
Definition Cut.cxx:214
Int_t fIsCloned
Definition Cut.h:83
void SetMinAndMax(Double_t val, Int_t i=0)
Definition Cut.cxx:91
ULong64_t GetTotal() const
Definition Cut.h:300
Bool_t HasPassed() const
Definition Cut.h:262
Int_t fState
Definition Cut.h:87
Double_t GetWeight()
Definition Cut.h:290
Cut ** MultiClone(Int_t no, Bool_t increment_collections=kFALSE)
Definition Cut.cxx:102
virtual void Print(Option_t *option="") const
Definition Cut.cxx:159
Double_t fWeight
Definition Cut.h:103
const TString fGroupFlag
Definition Cut.h:107
virtual Bool_t Init(Int_t=0)
Definition Cut.h:346
Int_t fLabel
Definition Cut.h:95
Bool_t FormatEquals(TString format, Int_t format_id, EFormatDepth depth=EFormatDepth::kAll) const
Definition Cut.cxx:187
ECutUpdate GetUpdateRatio() const
Definition Cut.h:209
void SetCollectionID(Int_t i)
Definition Cut.h:247
TString GetUnit(Int_t i) const
Definition Cut.h:311
void Reset()
Definition Cut.cxx:41
void Finish()
Definition Cut.h:182
virtual Cut * MakeCopy() const
Definition Cut.h:317
Bool_t InLimits(Int_t par) const
Definition Cut.cxx:240
void SetMinMax(Double_t min, Double_t max, Int_t i=0)
Definition Cut.cxx:93
Double_t GetValue(Int_t i=0) const
Definition Cut.h:285
const Int_t fCutSize
Definition Cut.h:75
Bool_t ForcedUpdate(Bool_t state)
Definition Cut.cxx:79
Bool_t ValidateAbs()
Definition Cut.cxx:67
void SetValue(Double_t val, Int_t i=0)
Definition Cut.h:235
ULong64_t GetFailed() const
Definition Cut.h:305
TObjArray * Split(Int_t n, Int_t i=0, Double_t shift=0) const
Definition Cut.cxx:131
Int_t GetCutSize() const
Definition Cut.h:252
Double_t GetMin(Int_t i=0) const
Definition Cut.h:273
ULong64_t GetPassed() const
Definition Cut.h:295
Bool_t Validate()
Definition Cut.cxx:43
Double_t GetMax(Int_t i=0) const
Definition Cut.h:279
Int_t GetCollectionID() const
Definition Cut.h:257
void SetUnitName(TString name, Int_t i=0)
Definition Cut.h:241
virtual Package * Report() const
Definition Cut.cxx:115
Bool_t IsCloned() const
Definition Cut.h:267
const ECutUpdate fUpdateRatio
Definition Cut.h:99
Bool_t AntiValidate()
Definition Cut.cxx:55
Cut(const Int_t size=1, ECutUpdate update=ECutUpdate::kNo, TString groupFlag="")
Definition Cut.cxx:12
void SetLabel(Int_t label)
Definition Cut.h:178
Bool_t fInit
Definition Cut.h:79
void SetMinimum(Double_t min, Int_t i=0)
Definition Cut.h:223
Int_t fCollectionID
Definition Cut.h:91
virtual std::vector< std::pair< TString, Double_t > > GetBinLabels(Int_t par=0) const
Definition Cut.cxx:246
void SetMax(Double_t val, Int_t i=0)
Definition SubCut.cxx:86
TString GetUnit(Int_t i) const
Definition SubCut.h:70
void SetUnitName(TString name, Int_t i=0)
Definition SubCut.h:41
void SetMin(Double_t val, Int_t i=0)
Definition SubCut.cxx:84
void SetValue(Double_t val, Int_t i=0)
Definition SubCut.h:87
Double_t GetMax(Int_t i) const
Definition SubCut.h:99
Double_t GetMin(Int_t i) const
Definition SubCut.h:93
Double_t GetValue(Int_t i) const
Definition SubCut.h:105