CbmRoot
Loading...
Searching...
No Matches
LmvmCuts.h
Go to the documentation of this file.
1/* Copyright (C) 2015-2021 Justus-Liebig-Universitaet Giessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Elena Lebedeva [committer], Gregor Pitsch, Semen Lebedev */
4
5#ifndef LMVM_CUTS_H
6#define LMVM_CUTS_H
7
8#include <Logger.h>
9
10#include <math.h>
11
12#include "LmvmDef.h"
13
14
15class LmvmCuts {
16public:
18
19 bool IsTopologyCutOk(ELmvmTopologyCut cut, double mom1, double mom2, double minAngle)
20 {
21 double angleCut = 0., ppCut = 0.;
22 if (cut == ELmvmTopologyCut::ST) {
23 angleCut = fStCutAngle;
24 ppCut = fStCutPP;
25 }
26 else if (cut == ELmvmTopologyCut::RT) {
27 angleCut = fRtCutAngle;
28 ppCut = fRtCutPP;
29 }
30 else if (cut == ELmvmTopologyCut::TT) {
31 angleCut = fTtCutAngle;
32 ppCut = fTtCutPP;
33 }
34 else {
35 LOG(error) << "LmvmCuts::IsTopologyCut cut is not defined.";
36 }
37 double sqrt_mom = std::sqrt(mom1 * mom2);
38 double val = -1. * (angleCut / ppCut) * sqrt_mom + angleCut;
39 if (!(sqrt_mom < ppCut && val > minAngle)) return true;
40 return false;
41 }
42
43 bool IsChi2PrimaryOk(double chi2Prim) { return (chi2Prim < fChi2PrimCut); }
44
45 bool IsGammaCutOk(double minv) { return (minv >= fGammaCut); }
46
47 bool IsPtCutOk(double pt) { return (pt > fPtCut); }
48
49 bool IsMvdCutOk(int stationNum, double dmvd, double mom)
50 {
51 if (stationNum <= 0 || stationNum > 2) {
52 LOG(error) << "LmvmCuts::IsMvdCut stationNum is not in valid. stationNum = " << stationNum;
53 return false;
54 }
55 // it is assumed that stationNum can be 1 or 2
56 LOG(info) << "I am in LmvmCuts::IsMvdCutOk"; // TODO: delete this line
57 double cutD = (stationNum == 1) ? fMvd1CutD : fMvd2CutD;
58 double cutP = (stationNum == 1) ? fMvd1CutP : fMvd2CutP;
59 double val = -1. * (cutP / cutD) * dmvd + cutP;
60 if (!(dmvd < cutD && val > mom)) {
61 LOG(info) << "MVD cut passed.";
62 return true;
63 } // TODO: delete cout
64 else { // TODO: delete cout and set back 'return' without else bracket
65 LOG(info) << "MVD cut not passed.";
66 return false;
67 }
68 }
69
70 std::string ToString()
71 {
72 std::stringstream ss;
73 ss << "LMVM cuts:" << std::endl
74 << "fChiPrimCut = " << fChi2PrimCut << std::endl
75 << "fPtCut = " << fPtCut << std::endl
76 << "fAngleCut = " << fAngleCut << std::endl
77 << "fGammaCut = " << fGammaCut << std::endl
78 << "fStCut (ang,pp) = (" << fStCutAngle << "," << fStCutPP << ")" << std::endl
79 << "fRtCut (ang,pp) = (" << fRtCutAngle << "," << fRtCutPP << ")" << std::endl
80 << "fTtCut (ang,pp) = (" << fTtCutAngle << "," << fTtCutPP << ")" << std::endl
81 << "fMvd1Cut (p,d) = (" << fMvd1CutP << "," << fMvd1CutD << ")" << std::endl
82 << "fMvd2Cut (p,d) = (" << fMvd2CutP << "," << fMvd2CutD << ")" << std::endl
83 << "fMomentumCut = " << fMomentumCut << std::endl;
84 return ss.str();
85 }
86
87public:
88 // ID cuts, we use CbmLitGlobalElectronId for identification
89 double fMomentumCut = -1.; // if fMomentumCut < 0 it is not used
90
91 // Analysis cuts
92 double fPtCut = 0.2;
93 double fAngleCut = 1.;
94 double fChi2PrimCut = 3.0;
95 double fGammaCut = 0.025;
96 double fStCutAngle = 2.3;
97 double fStCutPP = 2.9;
98 double fTtCutAngle = 2.2;
99 double fTtCutPP = 3.2;
100 double fRtCutAngle = 2.4;
101 double fRtCutPP = 3.0;
102 double fMvd1CutP = 1.2;
103 double fMvd1CutD = 0.4;
104 double fMvd2CutP = 1.5;
105 double fMvd2CutD = 0.5;
106};
107
108#endif
ELmvmTopologyCut
Definition LmvmDef.h:15
bool IsChi2PrimaryOk(double chi2Prim)
Definition LmvmCuts.h:43
double fRtCutPP
Definition LmvmCuts.h:101
double fMvd1CutP
Definition LmvmCuts.h:102
bool IsMvdCutOk(int stationNum, double dmvd, double mom)
Definition LmvmCuts.h:49
double fMvd1CutD
Definition LmvmCuts.h:103
double fStCutPP
Definition LmvmCuts.h:97
double fTtCutAngle
Definition LmvmCuts.h:98
bool IsTopologyCutOk(ELmvmTopologyCut cut, double mom1, double mom2, double minAngle)
Definition LmvmCuts.h:19
bool IsGammaCutOk(double minv)
Definition LmvmCuts.h:45
double fRtCutAngle
Definition LmvmCuts.h:100
double fGammaCut
Definition LmvmCuts.h:95
std::string ToString()
Definition LmvmCuts.h:70
double fAngleCut
Definition LmvmCuts.h:93
double fPtCut
Definition LmvmCuts.h:92
bool IsPtCutOk(double pt)
Definition LmvmCuts.h:47
double fMomentumCut
Definition LmvmCuts.h:89
double fTtCutPP
Definition LmvmCuts.h:99
double fMvd2CutP
Definition LmvmCuts.h:104
double fChi2PrimCut
Definition LmvmCuts.h:94
double fStCutAngle
Definition LmvmCuts.h:96
double fMvd2CutD
Definition LmvmCuts.h:105
LmvmCuts()
Definition LmvmCuts.h:17