Skip to content

Commit 229e092

Browse files
authored
[PWGDQ] add tag and probe method for dalitz selection (#15948)
1 parent 3a7a7cb commit 229e092

3 files changed

Lines changed: 447 additions & 234 deletions

File tree

PWGDQ/Core/AnalysisCut.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12-
// Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no
13-
//
14-
// Class for analysis cuts applied on the variables defined in the VarManager
12+
/// \author Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no
13+
/// \file AnalysisCut.h
14+
/// \brief Class for analysis cuts applied on the variables defined in the VarManager
1515
//
1616

1717
#ifndef PWGDQ_CORE_ANALYSISCUT_H_
@@ -22,6 +22,7 @@
2222

2323
#include <Rtypes.h>
2424

25+
#include <memory>
2526
#include <vector>
2627

2728
//_________________________________________________________________________
@@ -49,29 +50,29 @@ class AnalysisCut : public TNamed
4950
void PrintCuts();
5051

5152
struct CutContainer {
52-
short fVar; // variable to be cut upon
53+
int16_t fVar; // variable to be cut upon
5354
float fLow; // lower limit for the var
5455
float fHigh; // upper limit for the var
5556
bool fExclude; // if true, use the selection range for exclusion
5657

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

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

67-
TF1* fFuncLow; // function for the lower limit cut
68-
TF1* fFuncHigh; // function for the upper limit cut
68+
std::shared_ptr<TF1> fFuncLow; // function for the lower limit cut
69+
std::shared_ptr<TF1> fFuncHigh; // function for the upper limit cut
6970
};
7071

7172
protected:
7273
std::vector<CutContainer> fCuts;
7374

74-
ClassDef(AnalysisCut, 1);
75+
ClassDef(AnalysisCut, 2);
7576
};
7677

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

88-
if constexpr (std::is_same_v<T1, TF1*>) {
89+
if constexpr (std::is_same_v<T1, std::shared_ptr<TF1>>) {
8990
if (dependentVar < 0) {
9091
return;
9192
}
@@ -95,7 +96,7 @@ void AnalysisCut::AddCut(int var, T1 cutLow, T2 cutHigh, bool exclude,
9596
cut.fFuncLow = nullptr;
9697
cut.fLow = cutLow;
9798
}
98-
if constexpr (std::is_same_v<T2, TF1*>) {
99+
if constexpr (std::is_same_v<T2, std::shared_ptr<TF1>>) {
99100
if (dependentVar < 0) {
100101
return;
101102
}

0 commit comments

Comments
 (0)