ATLAS Offline Software
Loading...
Searching...
No Matches
MissingMassOutput.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Class handling the output of the MissingMassCalculator
6// author Michael Huebner <michael.huebner@no.spam.cern.ch>
7
8// Local include(s):
10
11
12
13using namespace DiTauMassTools;
14using ROOT::Math::PtEtaPhiMVector;
15using ROOT::Math::XYVector;
16
17// Default Constructor
20
21// Default Desctructor
24
25//------- clearing output
26void MissingMassOutput::ClearOutput(bool fUseVerbose) {
27
28 if(fUseVerbose == 1){ Info("DiTauMassTools", "MissingMassCalculator::ClearOutput()"); }
30
31 for (int imeth=0; imeth<MMCFitMethod::MAX; ++imeth)
32 {
33 if(fUseVerbose == 1){ Info("DiTauMassTools", "%s", ("MissingMassCalculator::ClearOutput(): clearing for method "+std::to_string(imeth)).c_str()); }
34 m_FitSignificance[imeth] = -1.0;
35 m_FittedMass[imeth] = 0.0;
36 m_nuvec1[imeth].SetPxPyPzE(0.0,0.0,0.0,0.0);
37 m_objvec1[imeth].SetPxPyPzE(0.0,0.0,0.0,0.0);
38 m_nuvec2[imeth].SetPxPyPzE(0.0,0.0,0.0,0.0);
39 m_objvec2[imeth].SetPxPyPzE(0.0,0.0,0.0,0.0);
40 m_totalvec[imeth].SetPxPyPzE(0.0,0.0,0.0,0.0);
41 m_FittedMetVec[imeth].SetXY(0.0,0.0);
42 }
43
44 m_RMS2MPV = 0.0;
45
46 return;
47}
48
49
50// return fit status
52 return m_FitStatus;
53}
54
55// returns fit significance
56double MissingMassOutput::GetFitSignificance(int fitcode) const {
57 double signif = -1.0;
58 if (fitcode<0 || fitcode >= MMCFitMethod::MAX) {
59 Error("DiTauMassTools", "%s", ("MissingMassCalculator::GetFitSignificance ERROR ! fitcode="+std::to_string(fitcode)
60 +". Should be between 0 and "+std::to_string(MMCFitMethod::MAX-1)).c_str());
61 } else {
62 signif = m_FitSignificance[fitcode];
63 }
64
65 return signif;
66}
67
68// returns RMS/MPV according to histogram method
70 return m_RMS2MPV;
71}
72
73// returns fitted Mass
74double MissingMassOutput::GetFittedMass(int fitcode) const {
75 // 0 best parameter space
76 // 1 best mass
77 // best nu from hist
78 double mass = 0.0;
79 if (fitcode<0 || fitcode >= MMCFitMethod::MAX) {
80 Error("DiTauMassTools", "%s", ("MissingMassCalculator::GetFittedMass ERROR ! fitcode="+std::to_string(fitcode)
81 +". Should be between 0 and "+std::to_string(MMCFitMethod::MAX-1)).c_str());
82 } else {
83 mass = m_FittedMass[fitcode];
84 }
85
86 return mass;
87}
88
89// returns upper error on fitted Mass
90double MissingMassOutput::GetFittedMassErrorUp(int fitcode) const {
91 // 0 best parameter space
92 // 1 best mass
93 // best nu from hist
94 double massUpperError = 0.0;
95 if (fitcode<0 || fitcode >= MMCFitMethod::MAX) {
96 Error("DiTauMassTools", "%s", ("MissingMassCalculator::GetFittedMass ERROR ! fitcode="+std::to_string(fitcode)
97 +". Should be between 0 and "+std::to_string(MMCFitMethod::MAX-1)).c_str());
98 } else {
99 massUpperError = m_FittedMassUpperError[fitcode];
100 }
101
102 return massUpperError;
103}
104
105// returns upper error on fitted Mass
107 // 0 best parameter space
108 // 1 best mass
109 // best nu from hist
110 double massLowerError = 0.0;
111 if (fitcode<0 || fitcode >= MMCFitMethod::MAX) {
112 Error("DiTauMassTools", "%s", ("MissingMassCalculator::GetFittedMass ERROR ! fitcode="+std::to_string(fitcode)
113 +". Should be between 0 and "+std::to_string(MMCFitMethod::MAX-1)).c_str());
114 } else {
115 massLowerError = m_FittedMassLowerError[fitcode];
116 }
117
118 return massLowerError;
119}
120
122{
123 return m_NTrials;
124}
125
127{
128 return m_NSuccesses;
129}
130
132{
133 return m_NSolutions;
134}
135
136// sum of weights of all solutions
138{
139 return m_SumW;
140}
141
142// average RMS of solutions in one event
144{
145 return m_AveSolRMS;
146}
147
148std::shared_ptr<TH1F> MissingMassOutput::GetMassHistogram() const
149{
150 return m_hMfit_all;
151}
152
154{
155 return m_hMfit_allNoWeight;
156}
157
158// returns neutrino 4-vec
159PtEtaPhiMVector MissingMassOutput::GetNeutrino4vec(int fitcode, int ind) const
160{
161 PtEtaPhiMVector vec(0.0,0.0,0.0,0.0);
162 if (fitcode!=MMCFitMethod::MAXW && fitcode!=MMCFitMethod::MLNU3P )
163 {
164 Error("DiTauMassTools", "%s", ("MissingMassCalculator::GetNeutrino4Vec ERROR ! fitcode="+std::to_string(fitcode)
165 +". Should be either "+std::to_string(MMCFitMethod::MAXW)+" or "+std::to_string(MMCFitMethod::MLNU3P)).c_str());
166 }
167 else if (m_FitStatus>0)
168 {
169 if(ind==0) vec = m_nuvec1[fitcode];
170 else if(ind==1) vec = m_nuvec2[fitcode];
171 }
172 return vec;
173}
174
175// returns neutrino 4-vec
176PtEtaPhiMVector MissingMassOutput::GetTau4vec(int fitcode, int ind) const
177{
178 PtEtaPhiMVector vec(0.0,0.0,0.0,0.0);
179 if (fitcode!=MMCFitMethod::MAXW && fitcode!=MMCFitMethod::MLNU3P )
180 {
181 Error("DiTauMassTools", "%s", ("MissingMassCalculator::GetTau4vec ERROR ! fitcode="+std::to_string(fitcode)
182 +". Should be either "+std::to_string(MMCFitMethod::MAXW)+" or "+std::to_string(MMCFitMethod::MLNU3P)).c_str());
183 }
184 else if (m_FitStatus>0)
185 {
186 if(ind==0) vec = m_objvec1[fitcode];
187 else if(ind==1) vec = m_objvec2[fitcode];
188 }
189 return vec;
190}
191
192// returns 4-vec for resonance
193PtEtaPhiMVector MissingMassOutput::GetResonanceVec(int fitcode) const {
194 PtEtaPhiMVector vec(0.0,0.0,0.0,0.0);
195 if (fitcode!=MMCFitMethod::MAXW && fitcode!=MMCFitMethod::MLNU3P )
196 {
197 Error("DiTauMassTools", "%s", ("MissingMassCalculator::GetResonanceVec ERROR ! fitcode="+std::to_string(fitcode)
198 +". Should be either "+std::to_string(MMCFitMethod::MAXW)+" or "+std::to_string(MMCFitMethod::MLNU3P)).c_str());
199 }
200 else if (m_FitStatus>0)
201 {
202 vec = m_objvec1[fitcode]+m_objvec2[fitcode];
203 }
204
205 return vec;
206}
207
208// returns 2-vec for fitted MET
209XYVector MissingMassOutput::GetFittedMetVec(int fitcode) const {
210 XYVector vec(0.0,0.0);
211 if (fitcode!=MMCFitMethod::MAXW && fitcode!=MMCFitMethod::MLNU3P )
212 {
213 Error("DiTauMassTools", "%s", ("MissingMassCalculator::GetFittedMetVec ERROR ! fitcode="+std::to_string(fitcode)
214 +". Should be either "+std::to_string(MMCFitMethod::MAXW)+" or "+std::to_string(MMCFitMethod::MLNU3P)).c_str());
215 }
216 else if (m_FitStatus>0)
217 {
218 vec=m_FittedMetVec[fitcode];
219 }
220
221 return vec;
222}
std::vector< size_t > vec
PtEtaPhiMVector m_objvec2[MMCFitMethod::MAX]
double GetFittedMassErrorUp(int fitcode) const
PtEtaPhiMVector m_nuvec1[MMCFitMethod::MAX]
PtEtaPhiMVector GetTau4vec(int fitcode, int ind) const
PtEtaPhiMVector GetNeutrino4vec(int fitcode, int ind) const
std::shared_ptr< TH1F > m_hMfit_allNoWeight
std::shared_ptr< TH1F > GetMassHistogramNoWeight() const
XYVector m_FittedMetVec[MMCFitMethod::MAX]
double m_FittedMassUpperError[MMCFitMethod::MAX]
double GetFittedMassErrorLow(int fitcode) const
std::shared_ptr< TH1F > m_hMfit_all
PtEtaPhiMVector m_totalvec[MMCFitMethod::MAX]
double m_FittedMassLowerError[MMCFitMethod::MAX]
PtEtaPhiMVector m_nuvec2[MMCFitMethod::MAX]
double m_FittedMass[MMCFitMethod::MAX]
XYVector GetFittedMetVec(int fitcode) const
std::shared_ptr< TH1F > GetMassHistogram() const
PtEtaPhiMVector m_objvec1[MMCFitMethod::MAX]
double GetFitSignificance(int fitcode) const
PtEtaPhiMVector GetResonanceVec(int fitcode) const
double m_FitSignificance[MMCFitMethod::MAX]
double GetFittedMass(int fitcode) const