ATLAS Offline Software
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 
7 NAME: EMBremFit.cxx
8 PACKAGE: offline/Reconstruction/egammaEvent
9 
10 AUTHORS: Anne-Catherine Le Bihan
11 CREATED: March 2006
12 
13 PURPOSE: object containing information about Bremstrahlung fit
14 
15 ********************************************************************/
16 
17 // INCLUDE HEADER FILES:
18 
19 #include "egammaEvent/EMBremFit.h"
20 #include "AthenaKernel/BaseInfo.h"
21 #include "AthenaKernel/ClassName.h"
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
35  : egDetail()
36 { }
37 
38 // interfaces
40 const 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 
67 
68  if ( hasIntParameter(key) ) {
69  set_parameterInt(key,(int)value,overwrite);
70  }
71 
72  using elParams = std::pair<egammaParameters::ParamDef, double>;
73 
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 
114 
115  using elParams = std::pair<egammaParameters::ParamDef, int>;
116 
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 
140 void
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 
EMBremFit::BremD0
void BremD0(float)
Definition: EMBremFit.cxx:180
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
egammaParameters::bremRadius
@ bremRadius
estimated brem radius from EMBremFit (mm) [x-y plane]
Definition: egammaParamDefs.h:245
EMBremFit::BremPhi0
void BremPhi0(float)
Definition: EMBremFit.cxx:181
egammaParameters::bremNZ
@ bremNZ
number of Z hits included in the EMBremFit
Definition: egammaParamDefs.h:254
EMBremFit::BremInvpTerr
void BremInvpTerr(float)
Definition: EMBremFit.cxx:188
egammaParameters::bremNR
@ bremNR
number of R hits included in the EMBremFit
Definition: egammaParamDefs.h:252
EMBremFit::bremFitStatus
int bremFitStatus() const
Minuit EMBremFit fit status.
Definition: EMBremFit.cxx:173
egammaParameters::bremErrorFlag
@ bremErrorFlag
Flag to tell why the EMBremFit was not called.
Definition: egammaParamDefs.h:262
EMBremFit::set_parameter
void set_parameter(egammaParameters::ParamDef, double, bool overwrite=false)
general set method for parameters
Definition: EMBremFit.cxx:66
EMBremFit::EMBremFit
EMBremFit()
Default constructor.
Definition: EMBremFit.cxx:34
get_generator_info.result
result
Definition: get_generator_info.py:21
EMBremFit::intParameter
virtual int intParameter(egammaParameters::ParamDef) const
Definition: EMBremFit.cxx:95
EMBremFit::set_linkIndex
void set_linkIndex(int)
Definition: EMBremFit.cxx:199
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
EMBremFit::BremZ0
void BremZ0(float)
Definition: EMBremFit.cxx:183
EMBremFit::bremRadius
float bremRadius() const
estimated brem radius from EMBremFit (mm) [x-y plane]
Definition: EMBremFit.cxx:162
EMBremFit::BremErrorFlag
void BremErrorFlag(int)
Definition: EMBremFit.cxx:197
egammaParameters::bremNTRT
@ bremNTRT
number of TRT hits included in the EMBremFit
Definition: egammaParamDefs.h:256
EMBremFit::linkIndex
int linkIndex() const
Index of track this EMBremFit belongs to.
Definition: EMBremFit.cxx:176
egammaParameters::bremPhi0
@ bremPhi0
azimuth angle of the momentum at the point of closest approach after EMBremFit
Definition: egammaParamDefs.h:237
egammaParameters::bremZ0
@ bremZ0
the z value at the point of closest approach after EMBremFit
Definition: egammaParamDefs.h:241
egammaParameters::ParamDef
ParamDef
Definition: egammaParamDefs.h:99
EMBremFit::BremNTRT
void BremNTRT(int)
Definition: EMBremFit.cxx:190
EMBremFit::BremDzDr
void BremDzDr(float)
Definition: EMBremFit.cxx:184
athena.value
value
Definition: athena.py:124
EMBremFit::BremFitChi2
void BremFitChi2(float)
Definition: EMBremFit.cxx:198
EMBremFit::BremNZ
void BremNZ(int)
Definition: EMBremFit.cxx:192
EMBremFit::BremFitStatus
void BremFitStatus(int)
Definition: EMBremFit.cxx:196
egammaParameters::EgParamUndefined
const double EgParamUndefined
Definition: egammaParamDefs.h:78
EMBremFit::bremErrorFlag
int bremErrorFlag() const
Flag to tell why the EMBremFit was not called.
Definition: EMBremFit.cxx:174
x
#define x
EMBremFit::hasParameter
virtual bool hasParameter(egammaParameters::ParamDef) const
Definition: EMBremFit.cxx:201
EMBremFit::bremInvpT
float bremInvpT() const
1/pT estimate according to EMBremFit
Definition: EMBremFit.cxx:159
EMBremFit::BremInvpT
void BremInvpT(float)
Definition: EMBremFit.cxx:182
EMBremFit::BremClusterRadius
void BremClusterRadius(float)
Definition: EMBremFit.cxx:194
EMBremFit::BremRadius
void BremRadius(float)
Definition: EMBremFit.cxx:185
EMBremFit::bremFitChi2
float bremFitChi2() const
chi2 of EMBremFit
Definition: EMBremFit.cxx:175
EMBremFit::BremX
void BremX(float)
Definition: EMBremFit.cxx:186
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
egammaParameters::bremFitChi2
@ bremFitChi2
chi2 of EMBremFit
Definition: egammaParamDefs.h:264
ClassName.h
An interface for getting the name of a class as a string.
BaseInfo.h
Provide an interface for finding inheritance information at run time.
EMBremFit::print
void print() const
Definition: EMBremFit.cxx:141
egammaParameters::bremD0
@ bremD0
transverse impact parameter (distance of closest approach) after EMBremFit
Definition: egammaParamDefs.h:235
EMBremFit::bremDzDr
float bremDzDr() const
1/tan(theta) of the track after EMBremFit
Definition: EMBremFit.cxx:161
ClassName::name
static std::string name()
Return the name of class T as a string.
EMBremFit::bremNZ
int bremNZ() const
number of Z hits included in the EMBremFit
Definition: EMBremFit.cxx:169
EMBremFit::bremPhi0
float bremPhi0() const
azimuth angle of the momentum at the point of closest approach after EMBremFit
Definition: EMBremFit.cxx:158
EMBremFit::m_parametersInt
std::vector< std::pair< egammaParameters::ParamDef, int > > m_parametersInt
Definition: EMBremFit.h:140
egammaParameters::bremClusterRadius
@ bremClusterRadius
cluster radius (mm) [x-y plane] from EMBremFit (depth)
Definition: egammaParamDefs.h:258
EMBremFit::BremNR
void BremNR(int)
Definition: EMBremFit.cxx:191
EMBremFit::bremNTRT
int bremNTRT() const
number of TRT hits included in the EMBremFit
Definition: EMBremFit.cxx:167
EMBremFit::bremZ0
float bremZ0() const
the z value at the point of closest approach after EMBremFit
Definition: EMBremFit.cxx:160
egammaParameters::bremFitStatus
@ bremFitStatus
Minuit EMBremFit fit status.
Definition: egammaParamDefs.h:260
EMBremFit::s_className
static const std::string s_className
Definition: EMBremFit.h:141
egammaParameters::bremX
@ bremX
EMBremFit track impact in 2nd sampling - cluster distance (mm): Delta phi(EMBremFit track impact in 2...
Definition: egammaParamDefs.h:248
EMBremFit::bremClusterRadius
float bremClusterRadius() const
cluster radius (mm) [x-y plane] from EMBremFit (depth)
Definition: EMBremFit.cxx:171
EMBremFit::bremX
float bremX() const
EMBremFit track impact in 2nd.
Definition: EMBremFit.cxx:163
EMBremFit
Definition: EMBremFit.h:27
EMBremFit::m_parameters
std::vector< std::pair< egammaParameters::ParamDef, double > > m_parameters
Definition: EMBremFit.h:139
SG_ADD_BASE
SG_ADD_BASE(EMBremFit, egDetail)
EMBremFit::bremNR
int bremNR() const
number of R hits included in the EMBremFit
Definition: EMBremFit.cxx:168
EMBremFit::set_parameterInt
void set_parameterInt(egammaParameters::ParamDef, int, bool overwrite=false)
Definition: EMBremFit.cxx:113
EMBremFit::parameter
virtual double parameter(egammaParameters::ParamDef) const
Definition: EMBremFit.cxx:45
EMBremFit::bremInvpTerr
float bremInvpTerr() const
error associated to 1/pT by EMBremFit
Definition: EMBremFit.cxx:165
egammaParameters::linkIndex
@ linkIndex
link index for multiple track and vertex matches
Definition: egammaParamDefs.h:574
EMBremFit::className
virtual const std::string & className() const
Definition: EMBremFit.cxx:40
egammaParameters::bremDzDr
@ bremDzDr
1/tan(theta) of the track after EMBremFit
Definition: egammaParamDefs.h:243
egDetail
Definition: egDetail.h:29
EMBremFit::hasIntParameter
virtual bool hasIntParameter(egammaParameters::ParamDef) const
checks if the parameter is integer
Definition: EMBremFit.cxx:216
egammaParameters::bremInvpT
@ bremInvpT
1/pT estimate according to EMBremFit
Definition: egammaParamDefs.h:239
egammaParameters::bremInvpTerr
@ bremInvpTerr
error associated to 1/pT by EMBremFit
Definition: egammaParamDefs.h:250
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
EMBremFit::bremD0
float bremD0() const
transverse impact parameter (distance of closest approach) after EMBremFit
Definition: EMBremFit.cxx:157
EMBremFit.h