CbmRoot
Loading...
Searching...
No Matches
LmvmCand.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], Semen Lebedev */
4
5#ifndef LMVM_CAND_H
6#define LMVM_CAND_H
7
8#include "LmvmDef.h"
9#include "TVector3.h"
10
11class LmvmCand {
12 public:
14
16 {
18 fMcMotherId = -1;
19 fStsMcTrackId = -1;
20 fRichMcTrackId = -1;
21 fTrdMcTrackId = -1;
22 fTofMcTrackId = -1;
23 }
24
26 {
27 if (cut == ELmvmTopologyCut::TT) {
28 fIsTtCut = value;
29 }
30 if (cut == ELmvmTopologyCut::ST) {
31 fIsStCut = value;
32 }
33 if (cut == ELmvmTopologyCut::RT) {
34 fIsRtCut = value;
35 }
36 }
37
38 bool IsCutTill(ELmvmAnaStep step) const
39 {
40 if (step == ELmvmAnaStep::Mc) return true;
41 if (step == ELmvmAnaStep::Reco && fIsRec) return true;
42 if (step == ELmvmAnaStep::Acc && IsCutTill(ELmvmAnaStep::Reco) && fIsAcc) return true;
43 if (step == ELmvmAnaStep::Chi2Prim && IsCutTill(ELmvmAnaStep::Acc) && fIsChi2Prim) return true;
44 if (step == ELmvmAnaStep::ElId && IsCutTill(ELmvmAnaStep::Chi2Prim) && fIsElectron) return true;
45 if (step == ELmvmAnaStep::GammaCut && IsCutTill(ELmvmAnaStep::ElId) && fIsGammaCut) return true;
48 if (step == ELmvmAnaStep::StCut && IsCutTill(ELmvmAnaStep::Mvd2Cut) && fIsStCut) return true;
49 if (step == ELmvmAnaStep::RtCut && IsCutTill(ELmvmAnaStep::StCut) && fIsRtCut) return true;
50 if (step == ELmvmAnaStep::TtCut && IsCutTill(ELmvmAnaStep::RtCut) && fIsTtCut) return true;
51 if (step == ELmvmAnaStep::PtCut && IsCutTill(ELmvmAnaStep::TtCut) && fIsPtCut) return true;
52 return false;
53 }
54
55 // track parameters
56 TVector3 fPosition;
57 TVector3 fMomentum;
58 double fMass = -1.; // mass from MC
59 double fMassSig = -1.; // mass of signal mother (remains '-1' if candidate is not signal electron)
60 double fWeight = -1.; // fW * MinvScale(double minv) for PLUTOs. For UrQMDs: fWeight = 1;
61 double fEnergy = 0.;
62 double fRapidity = 0.;
63 int fCharge = 0;
64 double fChi2Prim = 0.;
65 double fChi2Sts = 0.;
66 double fChi2Rich = 0.;
67 double fChi2Trd = 0.;
68 double fChi2Tof = -1.;
69 double fLength = 0.; // length of according global track
70 double fTime = 0.;
71 double fTofDist = -1.; // Hit-Track-Distance in ToF
72
73 // To investigate misidentifications in single sub detectors
74 bool fIsRichElectron = false;
75 bool fIsTrdElectron = false;
76 bool fIsTofElectron = false;
77
78 int fMcPdg = -1;
79 int fMcMotherId = -1;
80 int fEventNumber = 0;
81 int fStsMcTrackId = -1;
83 int fTrdMcTrackId = -1;
84 int fTofMcTrackId = -1;
85 int fStsInd = -1;
86 int fRichInd = -1;
87 int fTrdInd = -1;
88 int fTofHitInd = -1;
89 int fTofTrackInd = -1;
90 int fGTrackInd = -1;
91 int fNofHitsSts = -1; // TODO: delete nofHits (necessary)?
92 int fNofHitsMvd = -1;
93 int fNofHitsRich = -1;
94 int fNofHitsTrd = -1;
95 int fNofHitsTof = -1;
96 double fRichAnn = 0.;
97 double fTrdAnn = 0.;
98 double fMass2 = -1.; // square mass calculated by TOF
99 double fTrdLikeEl = -1.;
100 double fTrdLikePi = -1.;
101 double fELossSts = -1.;
102
103 // Cuts. If true then cut is passed
104 bool fIsRec = false;
105 bool fIsAcc = false;
106 bool fIsChi2Prim = false;
107 bool fIsElectron = false;
108 bool fIsGammaCut = true; // Will be set to 'false' as soon as a partner with minv < 25 MeV is found
109 bool fIsMvd1Cut = false;
110 bool fIsMvd2Cut = false;
111 bool fIsTtCut = false;
112 bool fIsStCut = false;
113 bool fIsRtCut = false;
114 bool fIsPtCut = false;
115
116 std::string fName = ""; // to distinguish between data from different folders in LmvmEventMix
117 std::string fTaskId =
118 ""; // to distinguish between events with same event number but different tasksId in LmvmEventMix
119
120 // MC
122 bool IsMcSignal() const { return fMcSrc == ELmvmSrc::Signal; }
123 bool IsMcPi0() const { return fMcSrc == ELmvmSrc::Pi0; }
124 bool IsMcGamma() const { return fMcSrc == ELmvmSrc::Gamma; }
125 bool IsMcEta() const { return fMcSrc == ELmvmSrc::Eta; }
126 // for candidates BG is all candidates which are not signal
127 bool fIsMcBg() const { return fMcSrc != ELmvmSrc::Signal; }
128};
129
130#endif
ELmvmSrc
Definition LmvmDef.h:23
@ Signal
Definition LmvmDef.h:24
@ Gamma
Definition LmvmDef.h:27
@ Undefined
Definition LmvmDef.h:29
ELmvmAnaStep
Definition LmvmDef.h:34
ELmvmTopologyCut
Definition LmvmDef.h:15
double fChi2Rich
Definition LmvmCand.h:66
double fChi2Tof
Definition LmvmCand.h:68
bool IsMcPi0() const
Definition LmvmCand.h:123
int fNofHitsMvd
Definition LmvmCand.h:92
int fMcPdg
Definition LmvmCand.h:78
double fELossSts
Definition LmvmCand.h:101
int fNofHitsRich
Definition LmvmCand.h:93
bool fIsTrdElectron
Definition LmvmCand.h:75
bool fIsGammaCut
Definition LmvmCand.h:108
bool fIsRtCut
Definition LmvmCand.h:113
int fRichInd
Definition LmvmCand.h:86
double fTrdLikeEl
Definition LmvmCand.h:99
double fChi2Sts
Definition LmvmCand.h:65
int fGTrackInd
Definition LmvmCand.h:90
int fStsMcTrackId
Definition LmvmCand.h:81
int fCharge
Definition LmvmCand.h:63
double fEnergy
Definition LmvmCand.h:61
int fTofMcTrackId
Definition LmvmCand.h:84
int fEventNumber
Definition LmvmCand.h:80
double fMassSig
Definition LmvmCand.h:59
bool IsMcSignal() const
Definition LmvmCand.h:122
bool fIsRichElectron
Definition LmvmCand.h:74
int fTofHitInd
Definition LmvmCand.h:88
void SetIsTopologyCutElectron(ELmvmTopologyCut cut, bool value)
Definition LmvmCand.h:25
double fTrdLikePi
Definition LmvmCand.h:100
LmvmCand()
Definition LmvmCand.h:13
int fNofHitsSts
Definition LmvmCand.h:91
bool fIsTofElectron
Definition LmvmCand.h:76
int fTofTrackInd
Definition LmvmCand.h:89
double fRapidity
Definition LmvmCand.h:62
std::string fTaskId
Definition LmvmCand.h:117
double fChi2Trd
Definition LmvmCand.h:67
bool fIsRec
Definition LmvmCand.h:104
bool fIsElectron
Definition LmvmCand.h:107
void ResetMcParams()
Definition LmvmCand.h:15
bool fIsChi2Prim
Definition LmvmCand.h:106
bool IsMcEta() const
Definition LmvmCand.h:125
double fTofDist
Definition LmvmCand.h:71
TVector3 fPosition
Definition LmvmCand.h:56
double fMass2
Definition LmvmCand.h:98
double fRichAnn
Definition LmvmCand.h:96
int fTrdMcTrackId
Definition LmvmCand.h:83
bool fIsAcc
Definition LmvmCand.h:105
bool fIsTtCut
Definition LmvmCand.h:111
bool fIsMvd2Cut
Definition LmvmCand.h:110
int fStsInd
Definition LmvmCand.h:85
bool fIsMcBg() const
Definition LmvmCand.h:127
std::string fName
Definition LmvmCand.h:116
int fMcMotherId
Definition LmvmCand.h:79
double fMass
Definition LmvmCand.h:58
int fRichMcTrackId
Definition LmvmCand.h:82
double fTime
Definition LmvmCand.h:70
bool IsMcGamma() const
Definition LmvmCand.h:124
int fNofHitsTof
Definition LmvmCand.h:95
ELmvmSrc fMcSrc
Definition LmvmCand.h:121
int fTrdInd
Definition LmvmCand.h:87
bool fIsMvd1Cut
Definition LmvmCand.h:109
double fWeight
Definition LmvmCand.h:60
double fChi2Prim
Definition LmvmCand.h:64
bool fIsStCut
Definition LmvmCand.h:112
TVector3 fMomentum
Definition LmvmCand.h:57
double fTrdAnn
Definition LmvmCand.h:97
bool fIsPtCut
Definition LmvmCand.h:114
int fNofHitsTrd
Definition LmvmCand.h:94
double fLength
Definition LmvmCand.h:69
bool IsCutTill(ELmvmAnaStep step) const
Definition LmvmCand.h:38