ATLAS Offline Software
Loading...
Searching...
No Matches
EMBremFit.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5 /********************************************************************
6
7NAME: EMBremFit.cxx
8PACKAGE: offline/Reconstruction/egammaEvent
9
10AUTHORS: Anne-Catherine Le Bihan
11CREATED: March 2006
12
13PURPOSE: object containing information about Bremstrahlung fit
14
15********************************************************************/
16
17// INCLUDE HEADER FILES:
18
22#include "GaudiKernel/GaudiException.h"
23#include <cmath>
24#include <iomanip>
25#include <iostream>
26
27// END OF HEADER FILES INCLUDE
28
29// ----------------------------
30// Constructor
31// ----------------------------
32
33// give default values
37
38// interfaces
40const std::string& EMBremFit::className() const
41{
42 return s_className;
43}
44
46
47 if ( hasIntParameter(key) ) {
48 return (double) intParameter(key);
49 }
50
51 using elParams = std::pair<egammaParameters::ParamDef, double>;
52
54 std::vector<elParams>::const_iterator p = m_parameters.begin();
55
56 for (;p !=m_parameters.end(); ++p) {
57 if ( (*p).first == key ) {
58 result = (*p).second;
59 break;
60 }
61 }
62
63 return result;
64}
65
66void EMBremFit::set_parameter(egammaParameters::ParamDef key, double value, bool overwrite) {
67
68 if ( hasIntParameter(key) ) {
69 set_parameterInt(key,(int)value,overwrite);
70 }
71
72 using elParams = std::pair<egammaParameters::ParamDef, double>;
73
74 std::vector<elParams>::iterator p = m_parameters.begin();
75
76 for (;p !=m_parameters.end(); ++p) {
77 if ( (*p).first == key ) break;
78 }
79
80 if ( p == m_parameters.end() ) {
81 m_parameters.emplace_back(key,value );
82 }
83 else {
84 if ( overwrite ) {
85 (*p).second = value;
86 }
87 else {
88 throw GaudiException("parameter not saved", "EMBremFit::set_parameter(...)", StatusCode::FAILURE);
89 }
90 }
91
92}
93
94
96
97
98 using elParams = std::pair<egammaParameters::ParamDef, int>;
99
101 std::vector<elParams>::const_iterator p = m_parametersInt.begin();
102
103 for (;p !=m_parametersInt.end(); ++p) {
104 if ( (*p).first == key ){
105 result = (*p).second;
106 break;
107 }
108 }
109
110 return result;
111}
112
113void EMBremFit::set_parameterInt(egammaParameters::ParamDef key, int value, bool overwrite) {
114
115 using elParams = std::pair<egammaParameters::ParamDef, int>;
116
117 std::vector<elParams>::iterator p = m_parametersInt.begin();
118
119 for (;p !=m_parametersInt.end(); ++p) {
120 if ( (*p).first == key ) break;
121 }
122
123 if ( p == m_parametersInt.end() ) {
124 m_parametersInt.emplace_back(key,value );
125 }
126 else {
127 if ( overwrite ) {
128 (*p).second = value;
129 }
130 else {
131 throw GaudiException("parameter not saved", "EMBremFit::set_parameter(...)", StatusCode::FAILURE);
132 }
133 }
134
135}
136
137
138// print track match quantities
139
140void
142{
143 std::cout << " EMBremFit : "<< parameter(egammaParameters::bremD0) << std::endl;
144 std::cout << " EMBremFit : "<< parameter(egammaParameters::bremPhi0) << std::endl;
145 std::cout << " EMBremFit : "<< parameter(egammaParameters::bremInvpT) << std::endl;
146 std::cout << " EMBremFit : "<< parameter(egammaParameters::bremZ0) << std::endl;
147 std::cout << " EMBremFit : "<< parameter(egammaParameters::bremDzDr) << std::endl;
148 std::cout << " EMBremFit : "<< parameter(egammaParameters::bremRadius)<< std::endl;
149 std::cout << " EMBremFit : "<< parameter(egammaParameters::bremX) << std::endl;
150 std::cout << " " << std::endl;
151
152 std::cout << " EMBremInput : fit status : "<< intParameter(egammaParameters::bremFitStatus) << std::endl;
153
154}
155// return the values of the different variables in the EMBremFit object
156
164
166
170
172
177
178// set values for the different variables in the EMBremFit object
179
187
189
193
195
200
202 if ( hasIntParameter(key) ) return true;
203 if (key == egammaParameters::bremD0) return true;
204 if (key == egammaParameters::bremPhi0) return true;
205 if (key == egammaParameters::bremInvpT) return true;
206 if (key == egammaParameters::bremZ0) return true;
207 if (key == egammaParameters::bremDzDr) return true;
208 if (key == egammaParameters::bremRadius) return true;
209 if (key == egammaParameters::bremX) return true;
210 if (key == egammaParameters::bremInvpTerr) return true;
211 if (key == egammaParameters::bremClusterRadius) return true;
212 if (key == egammaParameters::bremFitChi2) return true;
213 return false;
214}
215
217 if (key == egammaParameters::bremNR) return true;
218 if (key == egammaParameters::bremNZ) return true;
219 if (key == egammaParameters::bremNTRT) return true;
220 if (key == egammaParameters::bremFitStatus) return true;
221 if (key == egammaParameters::bremErrorFlag) return true;
222 if (key == egammaParameters::linkIndex) return true;
223 return false;
224}
225
226
An interface for getting the name of a class as a string.
Provide an interface for finding inheritance information at run time.
#define SG_ADD_BASE(D, B)
Add a new base class B to class D.
#define x
static std::string name()
Return the name of class T as a string.
EMBremFit is made by EMBremsstrahlungBuilder.
Definition EMBremFit.h:27
int bremNR() const
number of R hits included in the EMBremFit
void BremNZ(int)
int linkIndex() const
Index of track this EMBremFit belongs to.
void BremZ0(float)
float bremZ0() const
the z value at the point of closest approach after EMBremFit
float bremD0() const
transverse impact parameter (distance of closest approach) after EMBremFit
virtual bool hasParameter(egammaParameters::ParamDef) const
void BremPhi0(float)
void BremNR(int)
virtual bool hasIntParameter(egammaParameters::ParamDef) const
checks if the parameter is integer
void BremRadius(float)
void BremInvpT(float)
int bremErrorFlag() const
Flag to tell why the EMBremFit was not called.
float bremDzDr() const
1/tan(theta) of the track after EMBremFit
void print() const
float bremInvpTerr() const
error associated to 1/pT by EMBremFit
void BremClusterRadius(float)
int bremNZ() const
number of Z hits included in the EMBremFit
void BremErrorFlag(int)
void BremFitChi2(float)
void BremDzDr(float)
virtual const std::string & className() const
Definition EMBremFit.cxx:40
float bremX() const
EMBremFit track impact in 2nd.
virtual double parameter(egammaParameters::ParamDef) const
Definition EMBremFit.cxx:45
int bremNTRT() const
number of TRT hits included in the EMBremFit
void set_parameter(egammaParameters::ParamDef, double, bool overwrite=false)
general set method for parameters
Definition EMBremFit.cxx:66
std::vector< std::pair< egammaParameters::ParamDef, int > > m_parametersInt
Definition EMBremFit.h:134
void BremD0(float)
void BremX(float)
std::vector< std::pair< egammaParameters::ParamDef, double > > m_parameters
Definition EMBremFit.h:133
float bremRadius() const
estimated brem radius from EMBremFit (mm) [x-y plane]
EMBremFit()
Default constructor.
Definition EMBremFit.cxx:34
void set_linkIndex(int)
virtual int intParameter(egammaParameters::ParamDef) const
Definition EMBremFit.cxx:95
float bremFitChi2() const
chi2 of EMBremFit
static const std::string s_className
Definition EMBremFit.h:135
int bremFitStatus() const
Minuit EMBremFit fit status.
void set_parameterInt(egammaParameters::ParamDef, int, bool overwrite=false)
float bremInvpT() const
1/pT estimate according to EMBremFit
void BremNTRT(int)
float bremPhi0() const
azimuth angle of the momentum at the point of closest approach after EMBremFit
void BremFitStatus(int)
float bremClusterRadius() const
cluster radius (mm) [x-y plane] from EMBremFit (depth)
void BremInvpTerr(float)
Base class for detailed egamma information.
Definition egDetail.h:29
egDetail()=default
Default constructor.
@ bremNTRT
number of TRT hits included in the EMBremFit
@ bremFitStatus
Minuit EMBremFit fit status.
@ bremNR
number of R hits included in the EMBremFit
@ bremRadius
estimated brem radius from EMBremFit (mm) [x-y plane]
@ bremErrorFlag
Flag to tell why the EMBremFit was not called.
@ bremD0
transverse impact parameter (distance of closest approach) after EMBremFit
@ bremInvpTerr
error associated to 1/pT by EMBremFit
@ bremDzDr
1/tan(theta) of the track after EMBremFit
@ bremZ0
the z value at the point of closest approach after EMBremFit
@ linkIndex
link index for multiple track and vertex matches
@ bremClusterRadius
cluster radius (mm) [x-y plane] from EMBremFit (depth)
@ bremNZ
number of Z hits included in the EMBremFit
@ bremInvpT
1/pT estimate according to EMBremFit
@ bremX
EMBremFit track impact in 2nd sampling - cluster distance (mm): Delta phi(EMBremFit track impact in 2...
@ bremFitChi2
chi2 of EMBremFit
@ bremPhi0
azimuth angle of the momentum at the point of closest approach after EMBremFit
const double EgParamUndefined