88 Double_t compValue = 0.;
91 compValue = values[cut];
94 Double_t cutMin = -9.e30;
95 Double_t cutMax = +9.e30;
102 THnBase* hn =
static_cast<THnBase*
>(
fCutMin[iCut]);
104 Double_t* vals =
new Double_t[hn->GetNdimensions()];
106 for (Int_t idim = 0; idim < hn->GetNdimensions(); idim++) {
108 hn->GetAxis(idim)->GetName())];
111 Long_t bin = hn->GetBin(vals, kFALSE);
112 if (bin > 0) cutMin = hn->GetBinContent(bin);
116 THnBase* hx =
static_cast<THnBase*
>(
fCutMax[iCut]);
118 Double_t* vals =
new Double_t[hx->GetNdimensions()];
120 for (Int_t idim = 0; idim < hx->GetNdimensions(); idim++) {
122 hx->GetAxis(idim)->GetName())];
125 Long_t bin = hx->GetBin(vals, kFALSE);
126 if (bin > 0) cutMax = hx->GetBinContent(bin);
130 else if ((
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == TFormula::Class())
131 || (
fCutMax[iCut] &&
fCutMax[iCut]->IsA() == TFormula::Class())) {
133 TFormula* formN =
static_cast<TFormula*
>(
fCutMin[iCut]);
136 TFormula* formM =
static_cast<TFormula*
>(
fCutMax[iCut]);
139 else if ((
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == TGraph::Class())
144 TGraph* graphN =
static_cast<TGraph*
>(
fCutMin[iCut]);
145 TGraph* graphM =
static_cast<TGraph*
>(
fCutMax[iCut]);
151 formX =
static_cast<TFormula*
>(graphN->GetListOfFunctions()->At(0));
154 if (!formX && graphM) {
155 formX =
static_cast<TFormula*
>(graphM->GetListOfFunctions()->At(0));
164 Int_t idx = TMath::BinarySearch(graphN->GetN(), graphN->GetX(), xval);
165 cutMin = graphN->GetY()[idx];
166 idx = TMath::BinarySearch(graphM->GetN(), graphM->GetX(), xval);
167 cutMax = graphM->GetY()[idx];
169 else if ((
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == TSpline3::Class())
170 || (
fCutMax[iCut] &&
fCutMax[iCut]->IsA() == TSpline3::Class())) {
179 Error(
"IsSelected:",
"Cut object not supported (this message should never appear)");
184 if (TMath::IsNaN(cutMin)) cutMin = compValue + 1.;
185 if (TMath::IsNaN(cutMax)) cutMax = compValue - 1.;
339 printf(
"cut ranges for '%s'\n", GetTitle());
342 printf(
"Any Cut has to be fulfilled\n");
354 TFormula* form =
static_cast<TFormula*
>(
fVarFormula[iCut]);
355 tit = form->GetExpFormula();
357 for (Int_t j = 0; j < form->GetNpar(); j++)
358 tit.ReplaceAll(Form(
"[%d]", j), form->GetParName(j));
365 Bool_t bCutGraph = (
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == TGraph::Class());
366 Bool_t bCutForm = (
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == TFormula::Class());
367 Bool_t bCutHn = (
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == THnBase::Class());
373 THnBase* obj =
static_cast<THnBase*
>(
fCutMin[iCut]);
374 for (Int_t idim = 0; idim < obj->GetNdimensions(); idim++)
375 dep += Form(
"%s%s", (idim ?
"," :
""), obj->GetAxis(idim)->GetName());
376 dep.Prepend(
"histogram(");
381 TGraph* obj =
static_cast<TGraph*
>(
fCutMin[iCut]);
382 TFormula* form =
static_cast<TFormula*
>(obj->GetListOfFunctions()->At(0));
383 dep = form->GetExpFormula();
385 for (Int_t j = 0; j < form->GetNpar(); j++)
386 dep.ReplaceAll(Form(
"[%d]", j), form->GetParName(j));
387 dep.Prepend(
"graph(");
392 TFormula* obj =
static_cast<TFormula*
>(
fCutMin[iCut]);
393 dep = obj->GetExpFormula();
395 for (Int_t j = 0; j < obj->GetNpar(); j++)
396 dep.ReplaceAll(Form(
"[%d]", j), obj->GetParName(j));
397 dep.Prepend(
"formula(");
402 if (!inverse) printf(
"Cut %02d: %s < %s < %s\n", iCut, dep.Data(), tit.Data(), dep.Data());
404 printf(
"Cut %02d: !(%s < %s < %s)\n", iCut, dep.Data(), tit.Data(), dep.Data());