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