Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions PWGDQ/Core/AnalysisCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//
// Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no
//
// Class for analysis cuts applied on the variables defined in the VarManager
/// \author Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no
/// \file AnalysisCut.h
/// \brief Class for analysis cuts applied on the variables defined in the VarManager
//

#ifndef PWGDQ_CORE_ANALYSISCUT_H_
Expand All @@ -22,6 +22,7 @@

#include <Rtypes.h>

#include <memory>
#include <vector>

//_________________________________________________________________________
Expand Down Expand Up @@ -49,29 +50,29 @@ class AnalysisCut : public TNamed
void PrintCuts();

struct CutContainer {
short fVar; // variable to be cut upon
int16_t fVar; // variable to be cut upon
float fLow; // lower limit for the var
float fHigh; // upper limit for the var
bool fExclude; // if true, use the selection range for exclusion

short fDepVar; // first (optional) variable on which the cut depends
int16_t fDepVar; // first (optional) variable on which the cut depends
float fDepLow; // lower limit for the first dependent var
float fDepHigh; // upper limit for the first dependent var
bool fDepExclude; // if true, then use the dependent variable range as exclusion

short fDepVar2; // second (optional) variable on which the cut depends
int16_t fDepVar2; // second (optional) variable on which the cut depends
float fDep2Low; // lower limit for the second dependent var
float fDep2High; // upper limit for the second dependent var
bool fDep2Exclude; // if true, then use the dependent variable range as exclusion

TF1* fFuncLow; // function for the lower limit cut
TF1* fFuncHigh; // function for the upper limit cut
std::shared_ptr<TF1> fFuncLow; // function for the lower limit cut
std::shared_ptr<TF1> fFuncHigh; // function for the upper limit cut
};

protected:
std::vector<CutContainer> fCuts;

ClassDef(AnalysisCut, 1);
ClassDef(AnalysisCut, 2);
};

//____________________________________________________________________________
Expand All @@ -85,7 +86,7 @@ void AnalysisCut::AddCut(int var, T1 cutLow, T2 cutHigh, bool exclude,
//
CutContainer cut = {};

if constexpr (std::is_same_v<T1, TF1*>) {
if constexpr (std::is_same_v<T1, std::shared_ptr<TF1>>) {
if (dependentVar < 0) {
return;
}
Expand All @@ -95,7 +96,7 @@ void AnalysisCut::AddCut(int var, T1 cutLow, T2 cutHigh, bool exclude,
cut.fFuncLow = nullptr;
cut.fLow = cutLow;
}
if constexpr (std::is_same_v<T2, TF1*>) {
if constexpr (std::is_same_v<T2, std::shared_ptr<TF1>>) {
if (dependentVar < 0) {
return;
}
Expand Down
Loading
Loading