29 Cout::PrintInfo(Form(
"You cant configure more than %i axis in %s",
fAxisNo + 1, this->ClassName()), EInfo::kLowWarning);
67 for (
int i = 0; i <
fAxisNo; i++) {
78 TObject(other), fAxisNo(other.fAxisNo), fHistoPassed(NULL), fHistoFailed(NULL) {
90 for (
int i = 0; i <
fAxisNo; i++) {
103 Cout::PrintInfo(Form(
"%s is initialized ", this->ClassName()), EInfo::kDebugInfo);
107 for (
int i = 0; i <
fAxisNo; i++) {
108 if (
fCut[i] == NULL) {
113 for (
int i = 0; i <
fAxisNo; i++) {
114 for (
int j = i + 1; j <
fAxisNo; j++) {
117 "results in CutMonitor",
122 TH1::AddDirectory(kFALSE);
124 TH1::AddDirectory(kTRUE);
130 std::vector<Double_t> vec = Hal::Std::GetVector(axis);
131 if (vec.size() != 3)
return;
162 if (Hal::Std::FindParam(cut,
"Cloned")) {
163 Cout::PrintInfo(
"You can't add Cloned Cuts to CutMonitor", EInfo::kLowWarning);
166 TClass* classdata = NULL;
167 if (cut.Contains(
"(")) {
168 TString name(cut(0, cut.First(
'(')));
169 classdata = TClass::GetClass(name);
171 classdata = TClass::GetClass(cut);
173 ECutUpdate newUpd = ECutUpdate::kNo;
175 if (classdata ==
nullptr) {
176 Cout::PrintInfo(Form(
"Cannot find class %s", cut.Data()), EInfo::kLowWarning);
178 if (classdata->InheritsFrom(
"Hal::EventCut")) newUpd = ECutUpdate::kEvent;
179 if (classdata->InheritsFrom(
"Hal::TrackCut")) newUpd = ECutUpdate::kTrack;
180 if (classdata->InheritsFrom(
"Hal::TwoTrackCut")) newUpd = ECutUpdate::kTwoTrack;
221 for (
int i = 0; i <
fAxisNo; i++) {
228 CutMonitor::~CutMonitor() {
240 if (
this != &other) {
244 for (
int i = 0; i <
fAxisNo; i++) {
281 if (labels.size() > 0) {
282 for (
auto iLabel : labels) {
283 Int_t bin = hP->GetXaxis()->FindBin(iLabel.second);
285 hP->GetXaxis()->SetBinLabel(bin, iLabel.first);
286 hF->GetXaxis()->SetBinLabel(bin, iLabel.first);
299 if (labels.size() > 0) {
300 for (
auto iLabel : labels) {
301 Int_t bin = hP->GetYaxis()->FindBin(iLabel.second);
303 hP->GetYaxis()->SetBinLabel(bin, iLabel.first);
304 hF->GetYaxis()->SetBinLabel(bin, iLabel.first);
317 if (labels.size() > 0) {
318 for (
auto iLabel : labels) {
319 Int_t bin = hP->GetZaxis()->FindBin(iLabel.second);
321 hP->GetZaxis()->SetBinLabel(bin, iLabel.first);
322 hF->GetZaxis()->SetBinLabel(bin, iLabel.first);
344 for (
int i = 0; i <
fAxisNo; i++) {
static void PrintInfo(TString text, Hal::EInfo status)
CutMonitor & operator=(const CutMonitor &other)
void CopySettings(const CutMonitor *original)
void EnableExclusiveUpdate()
Int_t GetCutParameter(Int_t i) const
void AddCut(TString cut, Int_t parameter_no=0)
virtual void Update(Bool_t passed, TObject *obj)
void AddForcedCut(Cut *cut, Int_t no)
void SetYaxis(Int_t bins, Double_t min, Double_t max)
Bool_t AreSimilar(CutMonitor *other) const
Int_t GetCollectionID() const
virtual void TrueUpdate(Bool_t passed)
virtual Bool_t Init(Int_t task_id)
void SetZaxis(Int_t bins, Double_t min, Double_t max)
virtual Bool_t ObjMonitor() const
void SetAxis(Int_t bins, Double_t min, Double_t max, Int_t opt)
void SetAxisList(std::initializer_list< Double_t > axis, Char_t opt)
ECutUpdate GetUpdateRatio() const
virtual void CreateHistograms()
virtual CutMonitor * MakeCopy() const
void SetCollectionID(Int_t i)
Cut * GetCut(Int_t i) const
void SetXaxis(Int_t bins, Double_t min, Double_t max)
virtual Package * Report() const
virtual std::vector< std::pair< TString, Double_t > > GetBinLabels(Int_t par=0) const
void SetComment(TString name)
void AddObject(TObject *object)