Belle II Software development
NoKickCuts Class Reference

This class is an auxiliary class that implement methods to access to a single cut, used in NoKickRTSel class. More...

#include <NoKickCuts.h>

Inheritance diagram for NoKickCuts:

Public Types

enum  EMinMax {
  c_Min ,
  c_Max
}
 enum for minimum/maximum value of cuts More...
 
enum  EParameters {
  c_Omega ,
  c_D0 ,
  c_Phi0 ,
  c_Z0 ,
  c_Tanlambda
}
 enum for parameters name More...
 
enum  ECutName {
  c_Norm ,
  c_Pow ,
  c_Bkg
}
 enum for the cuts name More...
 

Public Member Functions

 NoKickCuts ()
 constructor of the class without arguments, used in cuts evaluations
 
 NoKickCuts (std::string m_fileName)
 constructor with name of the CutFile, used in cuts application
 
std::vector< double > cutSelector (double sintheta, double momentum, int layer1, int layer2, EParameters par)
 This methods selects 2 cuts (minimum and maximum inside a vector) from the information of theta, momentum, the layers and the parameter.
 
double getCut (int layer1, int layer2, EParameters par, EMinMax m, ECutName cut)
 
void FillCuts (std::string m_fileName)
 This method fill the cuts (used in NoKickCutsEval method) to create the cutfile.
 

Private Member Functions

 ClassDef (NoKickCuts, 1)
 Making this class a ROOT class.
 

Private Attributes

std::vector< std::vector< std::vector< std::vector< double > > > > m_cutNorm
 matrix of fit-parameter of cut, norm
 
std::vector< std::vector< std::vector< std::vector< double > > > > m_cutPow
 matrix of fit-parameter of cut, power
 
std::vector< std::vector< std::vector< std::vector< double > > > > m_cutBkg
 matrix of fit-parameter of cut, constant
 
int m_nbinpar = 5
 number of track parameter
 
int m_nbinlay = 7
 number of layers (IP too)
 

Detailed Description

This class is an auxiliary class that implement methods to access to a single cut, used in NoKickRTSel class.

Definition at line 25 of file NoKickCuts.h.

Member Enumeration Documentation

◆ ECutName

enum ECutName

enum for the cuts name

Definition at line 53 of file NoKickCuts.h.

53 {
54 c_Norm,
55 c_Pow,
56 c_Bkg
57 };

◆ EMinMax

enum EMinMax

enum for minimum/maximum value of cuts

Definition at line 38 of file NoKickCuts.h.

38 {
39 c_Min,
40 c_Max
41 };

◆ EParameters

enum for parameters name

Definition at line 44 of file NoKickCuts.h.

44 {
45 c_Omega,
46 c_D0,
47 c_Phi0,
48 c_Z0,
49 c_Tanlambda
50 };

Constructor & Destructor Documentation

◆ NoKickCuts() [1/2]

NoKickCuts ( )
inline

constructor of the class without arguments, used in cuts evaluations

Definition at line 29 of file NoKickCuts.h.

29{}

◆ NoKickCuts() [2/2]

NoKickCuts ( std::string  m_fileName)
inlineexplicit

constructor with name of the CutFile, used in cuts application

Definition at line 32 of file NoKickCuts.h.

33 {
34 if (m_fileName.size() != 0) FillCuts(m_fileName); //else cuts not applied
35 }
void FillCuts(std::string m_fileName)
This method fill the cuts (used in NoKickCutsEval method) to create the cutfile.
Definition: NoKickCuts.cc:59

Member Function Documentation

◆ cutSelector()

std::vector< double > cutSelector ( double  sintheta,
double  momentum,
int  layer1,
int  layer2,
EParameters  par 
)

This methods selects 2 cuts (minimum and maximum inside a vector) from the information of theta, momentum, the layers and the parameter.

The method takes the cuts from cutfile using the method getCuts and then evaluate the effective cut using theta and momentum behaviour, from the function Norm/(p^Pow*sqrt(sin(theta)))+Bkg. input: (sin(angle), momentum, first layer, second layer, track parameter) output: evaluated cut value

Definition at line 18 of file NoKickCuts.cc.

19{
20 std::vector<double> out;
21 for (int i = c_Min; i <= c_Max; i++) {
22 double cut = getCut(layer1, layer2, par, (EMinMax)i, c_Norm) /
23 (sqrt(sinTheta) * pow(momentum, getCut(layer1, layer2, par, (EMinMax)i, c_Pow)))
24 + getCut(layer1, layer2, par, (EMinMax)i, c_Bkg);
25 out.push_back(cut);
26 }
27 return out;
28}
double getCut(int layer1, int layer2, EParameters par, EMinMax m, ECutName cut)
Definition: NoKickCuts.cc:30
EMinMax
enum for minimum/maximum value of cuts
Definition: NoKickCuts.h:38
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ FillCuts()

void FillCuts ( std::string  m_fileName)

This method fill the cuts (used in NoKickCutsEval method) to create the cutfile.

input: (name of the cutFile)

Definition at line 59 of file NoKickCuts.cc.

60{
61 TFile* file = TFile::Open(m_fileName.c_str());
62
63
64 TH3F* input_norm_m = (TH3F*)file->Get("output_norm_m");
65 TH3F* input_pow_m = (TH3F*)file->Get("output_pow_m");
66 TH3F* input_bkg_m = (TH3F*)file->Get("output_bkg_m") ;
67
68 TH3F* input_norm_M = (TH3F*)file->Get("output_norm_M");
69 TH3F* input_pow_M = (TH3F*)file->Get("output_pow_M");
70 TH3F* input_bkg_M = (TH3F*)file->Get("output_bkg_M");
71
72
73 for (int mm = 0; mm < 2; mm++) {
74 std::vector<std::vector<std::vector<double>>> m_cutNorm_minmax;
75 std::vector<std::vector<std::vector<double>>> m_cutPow_minmax;
76 std::vector<std::vector<std::vector<double>>> m_cutBkg_minmax;
77 for (int par = 0; par < m_nbinpar; par++) {
78 std::vector<std::vector<double>> m_cutNorm_par;
79 std::vector<std::vector<double>> m_cutPow_par;
80 std::vector<std::vector<double>> m_cutBkg_par;
81 for (int lay1 = 0; lay1 < m_nbinlay; lay1++) {
82 std::vector<double> m_cutNorm_lay1;
83 std::vector<double> m_cutPow_lay1;
84 std::vector<double> m_cutBkg_lay1;
85 for (int lay2 = 0; lay2 < m_nbinlay; lay2++) {
86 int binNumber = input_norm_m->GetBin(par, lay1, lay2);
87
88 if (mm == 0) {
89 m_cutNorm_lay1.push_back(input_norm_m->GetBinContent(binNumber));
90 m_cutPow_lay1.push_back(input_pow_m->GetBinContent(binNumber));
91 m_cutBkg_lay1.push_back(input_bkg_m->GetBinContent(binNumber));
92 }
93 if (mm == 1) {
94 m_cutNorm_lay1.push_back(input_norm_M->GetBinContent(binNumber));
95 m_cutPow_lay1.push_back(input_pow_M->GetBinContent(binNumber));
96 m_cutBkg_lay1.push_back(input_bkg_M->GetBinContent(binNumber));
97 }
98 }
99 m_cutNorm_par.push_back(m_cutNorm_lay1);
100 m_cutPow_par.push_back(m_cutPow_lay1);
101 m_cutBkg_par.push_back(m_cutBkg_lay1);
102 m_cutNorm_lay1.clear();
103 m_cutPow_lay1.clear();
104 m_cutBkg_lay1.clear();
105 }
106 m_cutNorm_minmax.push_back(m_cutNorm_par);
107 m_cutPow_minmax.push_back(m_cutPow_par);
108 m_cutBkg_minmax.push_back(m_cutBkg_par);
109 m_cutNorm_par.clear();
110 m_cutPow_par.clear();
111 m_cutBkg_par.clear();
112 }
113 m_cutNorm.push_back(m_cutNorm_minmax);
114 m_cutPow.push_back(m_cutPow_minmax);
115 m_cutBkg.push_back(m_cutBkg_minmax);
116 m_cutNorm_minmax.clear();
117 m_cutPow_minmax.clear();
118 m_cutBkg_minmax.clear();
119 }
120 file->Close();
121 delete file;
122
123
124}
std::vector< std::vector< std::vector< std::vector< double > > > > m_cutPow
matrix of fit-parameter of cut, power
Definition: NoKickCuts.h:86
int m_nbinpar
number of track parameter
Definition: NoKickCuts.h:89
int m_nbinlay
number of layers (IP too)
Definition: NoKickCuts.h:90
std::vector< std::vector< std::vector< std::vector< double > > > > m_cutNorm
matrix of fit-parameter of cut, norm
Definition: NoKickCuts.h:85
std::vector< std::vector< std::vector< std::vector< double > > > > m_cutBkg
matrix of fit-parameter of cut, constant
Definition: NoKickCuts.h:87

◆ getCut()

double getCut ( int  layer1,
int  layer2,
EParameters  par,
EMinMax  m,
ECutName  cut 
)

numeration order inside vector<vector<vector<vector<double>>>> cut: <EMinMax<EParameters<layer_int<layer_ext>>>> EMinMax: 0=min,1=max EParameters: 0=omega, 1=d0, 2=phi0, 3=z0, 4=tanLmabda

Definition at line 30 of file NoKickCuts.cc.

31{
32 std::vector<std::vector <std::vector <std::vector<double>>>> cutVector;
33 double out;
34
35 switch (cut) {
36 case c_Norm:
37 cutVector = m_cutNorm;
38 break;
39
40 case c_Pow:
41 cutVector = m_cutPow;
42 break;
43
44 case c_Bkg:
45 cutVector = m_cutBkg;
46 break;
47 }
55 out = cutVector.at(m).at(par).at(layer1).at(layer2);
56 return out;
57}

Member Data Documentation

◆ m_cutBkg

std::vector<std::vector <std::vector<std::vector <double> > > > m_cutBkg
private

matrix of fit-parameter of cut, constant

Definition at line 87 of file NoKickCuts.h.

◆ m_cutNorm

std::vector<std::vector <std::vector<std::vector <double> > > > m_cutNorm
private

matrix of fit-parameter of cut, norm

Definition at line 85 of file NoKickCuts.h.

◆ m_cutPow

std::vector<std::vector <std::vector<std::vector <double> > > > m_cutPow
private

matrix of fit-parameter of cut, power

Definition at line 86 of file NoKickCuts.h.

◆ m_nbinlay

int m_nbinlay = 7
private

number of layers (IP too)

Definition at line 90 of file NoKickCuts.h.

◆ m_nbinpar

int m_nbinpar = 5
private

number of track parameter

Definition at line 89 of file NoKickCuts.h.


The documentation for this class was generated from the following files: