85 Double_t compValue = 0.;
89 compValue = values[cut];
92 Double_t cutMin = -9.e30;
93 Double_t cutMax = +9.e30;
100 THnBase* hn =
static_cast<THnBase*
>(
fCutMin[iCut]);
102 Double_t* vals =
new Double_t[hn->GetNdimensions()];
104 for (Int_t idim = 0; idim < hn->GetNdimensions(); idim++) {
110 Long_t bin = hn->GetBin(vals, kFALSE);
111 if (bin > 0) cutMin = hn->GetBinContent(bin);
115 THnBase* hx =
static_cast<THnBase*
>(
fCutMax[iCut]);
117 Double_t* vals =
new Double_t[hx->GetNdimensions()];
119 for (Int_t idim = 0; idim < hx->GetNdimensions(); idim++) {
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())
132 &&
fCutMax[iCut]->IsA() == TFormula::Class())) {
134 TFormula* formN =
static_cast<TFormula*
>(
fCutMin[iCut]);
137 TFormula* formM =
static_cast<TFormula*
>(
fCutMax[iCut]);
140 }
else if ((
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == TGraph::Class())
145 TGraph* graphN =
static_cast<TGraph*
>(
fCutMin[iCut]);
146 TGraph* graphM =
static_cast<TGraph*
>(
fCutMax[iCut]);
152 formX =
static_cast<TFormula*
>(graphN->GetListOfFunctions()->At(0));
155 if (!formX && graphM) {
156 formX =
static_cast<TFormula*
>(graphM->GetListOfFunctions()->At(0));
165 Int_t idx = TMath::BinarySearch(graphN->GetN(), graphN->GetX(), xval);
166 cutMin = graphN->GetY()[idx];
167 idx = TMath::BinarySearch(graphM->GetN(), graphM->GetX(), xval);
168 cutMax = graphM->GetY()[idx];
170 }
else if ((
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == TSpline3::Class())
172 &&
fCutMax[iCut]->IsA() == TSpline3::Class())) {
181 "Cut object not supported (this message should never appear)");
186 if (TMath::IsNaN(cutMin)) cutMin = compValue + 1.;
187 if (TMath::IsNaN(cutMax)) cutMax = compValue - 1.;
190 if (((compValue < cutMin) || (compValue > cutMax)) ^
fCutExclude[iCut])
213 if (!track)
return kFALSE;
225 const char* formulaMin,
226 const char* formulaMax,
227 Bool_t excludeRange) {
244 const char* formulaMin,
245 const char* formulaMax,
246 Bool_t excludeRange) {
263 TGraph*
const graphMin,
264 TGraph*
const graphMax,
265 Bool_t excludeRange) {
288 TGraph*
const graphMin,
289 TGraph*
const graphMax,
290 Bool_t excludeRange) {
313 THnBase*
const histMin,
314 THnBase*
const histMax,
315 Bool_t excludeRange) {
330 THnBase*
const histMin,
331 THnBase*
const histMax,
332 Bool_t excludeRange) {
350 printf(
"cut ranges for '%s'\n", GetTitle());
352 printf(
"All Cuts have to be fulfilled\n");
354 printf(
"Any Cut has to be fulfilled\n");
366 TFormula* form =
static_cast<TFormula*
>(
fVarFormula[iCut]);
367 tit = form->GetExpFormula();
369 for (Int_t j = 0; j < form->GetNpar(); j++)
370 tit.ReplaceAll(Form(
"[%d]", j), form->GetParName(j));
381 Bool_t bCutHn = (
fCutMin[iCut] &&
fCutMin[iCut]->IsA() == THnBase::Class());
387 THnBase* obj =
static_cast<THnBase*
>(
fCutMin[iCut]);
388 for (Int_t idim = 0; idim < obj->GetNdimensions(); idim++)
389 dep += Form(
"%s%s", (idim ?
"," :
""), obj->GetAxis(idim)->GetName());
390 dep.Prepend(
"histogram(");
395 TGraph* obj =
static_cast<TGraph*
>(
fCutMin[iCut]);
396 TFormula* form =
static_cast<TFormula*
>(obj->GetListOfFunctions()->At(0));
397 dep = form->GetExpFormula();
399 for (Int_t j = 0; j < form->GetNpar(); j++)
400 dep.ReplaceAll(Form(
"[%d]", j), form->GetParName(j));
401 dep.Prepend(
"graph(");
406 TFormula* obj =
static_cast<TFormula*
>(
fCutMin[iCut]);
407 dep = obj->GetExpFormula();
409 for (Int_t j = 0; j < obj->GetNpar(); j++)
410 dep.ReplaceAll(Form(
"[%d]", j), obj->GetParName(j));
411 dep.Prepend(
"formula(");
418 "Cut %02d: %s < %s < %s\n", iCut, dep.Data(), tit.Data(), dep.Data());
420 printf(
"Cut %02d: !(%s < %s < %s)\n",