ATLAS Offline Software
Loading...
Searching...
No Matches
D3PD::CovarianceFillerTool Class Referenceabstract

Block filler tool for error and covariance matrix. More...

#include <CovarianceFillerTool.h>

Inheritance diagram for D3PD::CovarianceFillerTool:
Collaboration diagram for D3PD::CovarianceFillerTool:

Public Member Functions

 CovarianceFillerTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor.
virtual StatusCode book ()
 Book variables for this block.
virtual StatusCode fill (const AmgSymMatrix(5) &p)
 Fill one block — type-safe version.
virtual StatusCode fill (const AmgSymMatrix(3) &p)
virtual StatusCode fill (const Amg::MatrixX &p)
 BlockFillerToolImpl (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor.
virtual StatusCode configureD3PD (IAddVariable *tree, const std::type_info &ti)
 Configure during initialization: type-check.
StatusCode configureD3PD (IAddVariable *tree)
 Configure the parent tree.
virtual StatusCode fillUntyped (const void *p, bool again=false)
 Fill one block.
virtual StatusCode fill (const Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > &p)=0
 Fill one block — type-safe version.
virtual StatusCode fillAgain (const Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > &p)
 Fill one block, after AGAIN has been returned (type-safe).
virtual StatusCode addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
 Add a variable to the tuple.
StatusCode addVariable (const std::string &name, Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > *&ptr, const std::string &docstring="")
 Make the template implementation from IAddVariable visible.
StatusCode addVariable (const std::string &name, Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > *&ptr, const std::string &docstring, const U &defval)
 Make the template implementation from IAddVariable visible.
virtual StatusCode addDimensionedVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)
 Add a variable to the tuple.
StatusCode addDimensionedVariable (const std::string &name, Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > *&ptr, const std::string &dim, const std::string &docstring="")
 Add a variable to the tuple.
StatusCode addDimensionedVariable (const std::string &name, Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > *&ptr, const std::string &dim, const std::string &docstring, const U &defval)
 Add a variable to the tuple.

Protected Member Functions

StatusCode configureImpl (IAddVariable *tree, const std::type_info &ti, const std::type_info &fill_ti)
 Configure during initialization: type-check.
StatusCode configureImpl (IAddVariable *tree, const std::type_info &ti, const std::vector< const std::type_info * > &tis, size_t &which)
 Configure during initialization: type-check.
StatusCode convert (void const *&p) const
 Do type conversion.

Protected Attributes

ObjectMetadata m_metadata
 Metadata about the variables created by this object.

Private Attributes

bool m_writeError
 parameters
bool m_writeDiagCovariance
bool m_writeOffDiagCovariance
bool m_isPosition
bool m_isTrackPerigee
int m_nParameters
std::vector< float * > m_err
 Variables: uncertainty.
std::vector< float * > m_cov
 Variables: covariance matrix.
std::string m_prefix
 Property: the variable prefix for this block.
std::string m_suffix
 Property: the variable prefix for this block.
std::string m_blockName
 Property: the name of this block.
TypeConverter m_converter
 Helper to do type conversions.
IAddVariablem_tree
 Reference to the block name.

Static Private Attributes

static const std::string s_emptyString
 Used to provide a default value for blockName.

Detailed Description

Block filler tool for error and covariance matrix.

Definition at line 29 of file CovarianceFillerTool.h.

Constructor & Destructor Documentation

◆ CovarianceFillerTool()

D3PD::CovarianceFillerTool::CovarianceFillerTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 31 of file CovarianceFillerTool.cxx.

35 : BlockFillerTool<Types<AmgSymMatrix(5),AmgSymMatrix(3),Amg::MatrixX>> (type, name, parent)
36{
37 declareProperty ("Error", m_writeError=true);
38 declareProperty ("DiagCovariance", m_writeDiagCovariance=false);
39 declareProperty ("OffDiagCovariance", m_writeOffDiagCovariance=false);
40 declareProperty ("IsPosition", m_isPosition=false);
41 declareProperty ("IsTrackPerigee", m_isTrackPerigee=false);
42 declareProperty ("NParameters", m_nParameters=0);
43}
#define AmgSymMatrix(dim)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
std::tuple< WrapType< TYPES >... > Types
A simple tuple of multiple types.

Member Function Documentation

◆ addDimensionedVariable() [1/3]

StatusCode D3PD::AddVariable::addDimensionedVariable ( const std::string & name,
const std::type_info & ti,
void *& ptr,
const std::string & dim,
const std::string & docstring = "",
const void * defval = 0 )
virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Definition at line 119 of file AddVariable.cxx.

129{
130 if (!m_tree) {
131 // Called from constructor --- just initialize pointer.
132 ptr = 0;
133 return StatusCode::SUCCESS;
134 }
135
137 ti, ptr, dim,
138 docstring, defval ) );
140 ti, ptr, dim,
142}
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode addDimensionedVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Type-safe wrapper for block filler tools.

◆ addDimensionedVariable() [2/3]

StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string & name,
Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > *& ptr,
const std::string & dim,
const std::string & docstring,
const U & defval )
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [3/3]

StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string & name,
Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > *& ptr,
const std::string & dim,
const std::string & docstring = "" )
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ addVariable() [1/3]

StatusCode D3PD::AddVariable::addVariable ( const std::string & name,
const std::type_info & ti,
void *& ptr,
const std::string & docstring = "",
const void * defval = 0 )
virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Definition at line 93 of file AddVariable.cxx.

90{
91 if (!m_tree) {
92 // Called from constructor --- just initialize pointer.
93 ptr = 0;
95 }
96
98 ti, ptr, docstring, defval ) );
101}
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.

◆ addVariable() [2/3]

StatusCode D3PD::IAddVariable::addVariable ( const std::string & name,
Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > *& ptr,
const std::string & docstring,
const U & defval )
inherited

Make the template implementation from IAddVariable visible.

◆ addVariable() [3/3]

StatusCode D3PD::IAddVariable::addVariable ( const std::string & name,
Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > *& ptr,
const std::string & docstring = "" )
inherited

Make the template implementation from IAddVariable visible.

◆ BlockFillerToolImpl()

( const std::string & type,
const std::string & name,
const IInterface * parent )
inherited

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

◆ book()

StatusCode D3PD::CovarianceFillerTool::book ( )
virtual

Book variables for this block.

Implements D3PD::BlockFillerTool< Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > >.

Definition at line 49 of file CovarianceFillerTool.cxx.

50{
51
53 REPORT_MESSAGE (MSG::WARNING) << "CovarianceFillerTool is configured as a position and a track perigee error matrix filler"
54 << " ===> Filling a generic covariance matrix";
55 m_isPosition = false;
56 m_isTrackPerigee = false;
57 }
58
59 if( m_isPosition ){
60 m_nParameters = 3;
61 }else if( m_isTrackPerigee ){
62 m_nParameters = 5;
63 }else{
64 //REPORT_MESSAGE (MSG::DEBUG) << "CovarianceFillerTool is filling a generic covariance matrix";
65 }
66
67 if(m_nParameters<=0){
68 REPORT_MESSAGE (MSG::WARNING) << "CovarianceFillerTool is configured to fill a generic covariance matrix of size <= 0";
69 return StatusCode::SUCCESS;
70 }
71
72 if( m_writeError )
73 m_err.resize (m_nParameters);
74
75 int ncov = 0;
77 ncov = m_nParameters;
79 ncov += m_nParameters * (m_nParameters - 1) / 2;
80 m_cov.resize (ncov);
81
82 if( m_isPosition ){
83 if( m_writeError ){
84 CHECK( addVariable ("err_x", m_err[0]) );
85 CHECK( addVariable ("err_y", m_err[1]) );
86 CHECK( addVariable ("err_z", m_err[2]) );
87 }
88 size_t icov = 0;
90 CHECK( addVariable ("cov_x", m_cov[icov++]) );
91 CHECK( addVariable ("cov_y", m_cov[icov++]) );
92 CHECK( addVariable ("cov_z", m_cov[icov++]) );
93 }
95 CHECK( addVariable ("cov_xy", m_cov[icov++]) );
96 CHECK( addVariable ("cov_xz", m_cov[icov++]) );
97 CHECK( addVariable ("cov_yz", m_cov[icov++]) );
98 }
99 }else if( m_isTrackPerigee ){
100 if( m_writeError ) {
101 CHECK( addVariable ("err_d0", m_err[0]) );
102 CHECK( addVariable ("err_z0", m_err[1]) );
103 CHECK( addVariable ("err_phi", m_err[2]) );
104 CHECK( addVariable ("err_theta", m_err[3]) );
105 CHECK( addVariable ("err_qoverp",m_err[4]) );
106 }
107
108 size_t icov = 0;
110 CHECK( addVariable ("cov_d0", m_cov[icov++]) );
111 CHECK( addVariable ("cov_z0", m_cov[icov++]) );
112 CHECK( addVariable ("cov_phi", m_cov[icov++]) );
113 CHECK( addVariable ("cov_theta", m_cov[icov++]) );
114 CHECK( addVariable ("cov_qoverp", m_cov[icov++]) );
115 }
117 CHECK( addVariable ("cov_d0_z0", m_cov[icov++]) );
118 CHECK( addVariable ("cov_d0_phi", m_cov[icov++]) );
119 CHECK( addVariable ("cov_d0_theta", m_cov[icov++]) );
120 CHECK( addVariable ("cov_d0_qoverp", m_cov[icov++]) );
121 CHECK( addVariable ("cov_z0_phi", m_cov[icov++]) );
122 CHECK( addVariable ("cov_z0_theta", m_cov[icov++]) );
123 CHECK( addVariable ("cov_z0_qoverp", m_cov[icov++]) );
124 CHECK( addVariable ("cov_phi_theta", m_cov[icov++]) );
125 CHECK( addVariable ("cov_phi_qoverp", m_cov[icov++]) );
126 CHECK( addVariable ("cov_theta_qoverp",m_cov[icov++]) );
127 }
128 }else{
129 std::ostringstream str;
130 if( m_writeError ) {
131 for(int i=0; i<m_nParameters; i++){
132 str.str("");
133 str << "err_par" << i;
134 CHECK( addVariable (str.str().c_str(), m_err[i]) );
135 }
136 }
137 size_t icov = 0;
139 for(int i=0; i<m_nParameters; i++){
140 str.str("");
141 str << "cov_par" << i << "_par" << i;
142 CHECK( addVariable (str.str().c_str(), m_cov[icov++]) );
143 }
144 }
146 for(int i=0; i<m_nParameters; i++){
147 for(int j=i+1; j<m_nParameters; j++){
148 str.str("");
149 str << "cov_par" << i << "_par" << j;
150 CHECK( addVariable (str.str().c_str(), m_cov[icov++]) );
151 }
152 }
153 }
154 assert (icov == m_cov.size());
155 }
156
157 return StatusCode::SUCCESS;
158}
#define REPORT_MESSAGE(LVL)
Report a message.
std::vector< float * > m_cov
Variables: covariance matrix.
std::vector< float * > m_err
Variables: uncertainty.
StatusCode addVariable(const std::string &name, T *&ptr, const std::string &docstring="")
Add a variable to the tuple.

◆ configureD3PD() [1/2]

StatusCode D3PD::AddVariable::configureD3PD ( IAddVariable * tree)
inherited

Configure the parent tree.

Parameters
treeThe parent IAddVariable instance.

Definition at line 69 of file AddVariable.cxx.

62{
63 m_tree = tree;
64 m_metadata.clear();
66}

◆ configureD3PD() [2/2]

virtual StatusCode D3PD::BlockFillerTool< Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > >::configureD3PD ( IAddVariable * tree,
const std::type_info & ti )
virtualinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.

configureD3PD should check that the type of the object coming as input is compatible with what it expects, and raise an error otherwise.

◆ configureImpl() [1/2]

StatusCode D3PD::BlockFillerToolImpl::configureImpl ( IAddVariable * tree,
const std::type_info & ti,
const std::type_info & fill_ti )
protectedinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.
fill_tiis the type of object that the user code will expect.

This is the common implementation for the configureD3PD method of IBlockFillerTool. It checks that the type of the object coming as input is compatible with what the user code is expecting, and raises an error otherwise.

Definition at line 70 of file BlockFillerToolImpl.cxx.

58{
60 CHECK( m_converter.init (ti, fill_ti) );
61
63}

◆ configureImpl() [2/2]

StatusCode D3PD::BlockFillerToolImpl::configureImpl ( IAddVariable * tree,
const std::type_info & ti,
const std::vector< const std::type_info * > & tis,
size_t & which )
protectedinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.
tisList of possible input types that we can accept.
[out]whichIndex of the accepted type.

This is the common implementation for the configureD3PD method of IBlockFillerTool. It checks that the type of the object coming as input is compatible with what the user code is expecting, and raises an error otherwise.

This version allows for one of a set of types to match. If successful, WHICH is set to the index (0-based) of the matching type.

Definition at line 91 of file BlockFillerToolImpl.cxx.

87{
89 CHECK( m_converter.init (ti, tis, which) );
91}

◆ convert()

StatusCode D3PD::BlockFillerToolImpl::convert ( void const *& p) const
protectedinherited

Do type conversion.

Parameters
p[in,out]Pointer to convert.

On entry, p is a pointer to an object of the type that was passed into configureImpl as ti. Convert the pointer to point to an object of the type that was given as fill_ti. If the conversion fails, the pointer is set to 0 (and FAILURE is returned).

Definition at line 107 of file BlockFillerToolImpl.cxx.

106{
107 p = m_converter.convertUntyped (p);
108 if (!p) {
110 << "Pointer conversion from " << m_converter.srcName() << " to "
111 << m_converter.dstName() << "failed.";
112 return StatusCode::FAILURE;
113 }
114 return StatusCode::SUCCESS;
115}

◆ fill() [1/4]

virtual StatusCode D3PD::BlockFillerTool< Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > >::fill ( const Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > & p)
pure virtualinherited

Fill one block — type-safe version.

Parameters
pThe input object.

This is called once per object. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

◆ fill() [2/4]

StatusCode D3PD::CovarianceFillerTool::fill ( const Amg::MatrixX & p)
virtual

Definition at line 282 of file CovarianceFillerTool.cxx.

283{
284
285 if(m_nParameters<=0){
286 return StatusCode::SUCCESS;
287 }
288
289 if( m_isTrackPerigee ) {
290 if (m.rows() > 0) {
291 if( m_writeError ) {
292 *m_err[0] = Amg::error(m,Trk::d0);
293 *m_err[1] = Amg::error(m,Trk::z0);
294 *m_err[2] = Amg::error(m,Trk::phi0);
295 *m_err[3] = Amg::error(m,Trk::theta);
296 *m_err[4] = Amg::error(m,Trk::qOverP);
297 }
298 size_t icov = 0;
300 *m_cov[icov++] = m(Trk::d0,Trk::d0);
301 *m_cov[icov++] = m(Trk::z0,Trk::z0);
302 *m_cov[icov++] = m(Trk::phi0,Trk::phi0);
303 *m_cov[icov++] = m(Trk::theta,Trk::theta);
304 *m_cov[icov++] = m(Trk::qOverP,Trk::qOverP);
305 }
307 *m_cov[icov++] = m(Trk::d0,Trk::z0);
308 *m_cov[icov++] = m(Trk::d0,Trk::phi0);
309 *m_cov[icov++] = m(Trk::d0,Trk::theta);
310 *m_cov[icov++] = m(Trk::d0,Trk::qOverP);
311 *m_cov[icov++] = m(Trk::z0,Trk::phi0);
312 *m_cov[icov++] = m(Trk::z0,Trk::theta);
313 *m_cov[icov++] = m(Trk::z0,Trk::qOverP);
314 *m_cov[icov++] = m(Trk::phi0,Trk::theta);
315 *m_cov[icov++] = m(Trk::phi0,Trk::qOverP);
316 *m_cov[icov++] = m(Trk::theta,Trk::qOverP);
317 }
318 assert (icov == m_cov.size());
319 }
320 } else if( m_isPosition ){
321 if( m_writeError ) {
322 *m_err[0] = Amg::error(m,Trk::x);
323 *m_err[1] = Amg::error(m,Trk::y);
324 *m_err[2] = Amg::error(m,Trk::z);
325 }
326
327 size_t icov = 0;
329 *m_cov[icov++] = m(Trk::x,Trk::x);
330 *m_cov[icov++] = m(Trk::y,Trk::y);
331 *m_cov[icov++] = m(Trk::z,Trk::z);
332 }
334 *m_cov[icov++] = m(Trk::x,Trk::y);
335 *m_cov[icov++] = m(Trk::x,Trk::z);
336 *m_cov[icov++] = m(Trk::y,Trk::z);
337 }
338 assert (icov == m_cov.size());
339 }else{
340 if( m_writeError ) {
341 for(int i=0; i<m_nParameters; i++){
343 }
344 }
345
346 size_t icov = 0;
348 for(int i=0; i<m_nParameters; i++)
349 *m_cov[icov++] = m((Trk::ParamDefs)i,(Trk::ParamDefs)i);
350 }
352 for(int i=0; i<m_nParameters; i++) {
353 for(int j=i+1; j<m_nParameters; j++)
354 *m_cov[icov++] = m((Trk::ParamDefs)i,(Trk::ParamDefs)j);
355 }
356 }
357 assert (icov == m_cov.size());
358 }
359
360 return StatusCode::SUCCESS;
361}
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
ParamDefs
This file defines the parameter enums in the Trk namespace.
Definition ParamDefs.h:32
@ x
Definition ParamDefs.h:55
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ phi0
Definition ParamDefs.h:65
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ y
Definition ParamDefs.h:56
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64

◆ fill() [3/4]

StatusCode D3PD::CovarianceFillerTool::fill ( const AmgSymMatrix(3) & p)
virtual

Definition at line 232 of file CovarianceFillerTool.cxx.

233{
234
235 if(m_nParameters<=0){
236 return StatusCode::SUCCESS;
237 }
238
239 if( m_isPosition ){
240 if( m_writeError ) {
241 *m_err[0] = sqrt(m(Trk::x,Trk::x));
242 *m_err[1] = sqrt(m(Trk::y,Trk::y));
243 *m_err[2] = sqrt(m(Trk::z,Trk::z));
244 }
245
246 size_t icov = 0;
248 *m_cov[icov++] = m(Trk::x,Trk::x);
249 *m_cov[icov++] = m(Trk::y,Trk::y);
250 *m_cov[icov++] = m(Trk::z,Trk::z);
251 }
253 *m_cov[icov++] = m(Trk::x,Trk::y);
254 *m_cov[icov++] = m(Trk::x,Trk::z);
255 *m_cov[icov++] = m(Trk::y,Trk::z);
256 }
257 assert (icov == m_cov.size());
258 }else{
259 if( m_writeError ) {
260 for(int i=0; i<m_nParameters; i++){
261 *m_err[i] = sqrt(m((Trk::ParamDefs)i,(Trk::ParamDefs)i));
262 }
263 }
264
265 size_t icov = 0;
267 for(int i=0; i<m_nParameters; i++)
268 *m_cov[icov++] = m((Trk::ParamDefs)i,(Trk::ParamDefs)i);
269 }
271 for(int i=0; i<m_nParameters; i++) {
272 for(int j=i+1; j<m_nParameters; j++)
273 *m_cov[icov++] = m((Trk::ParamDefs)i,(Trk::ParamDefs)j);
274 }
275 }
276 assert (icov == m_cov.size());
277 }
278
279 return StatusCode::SUCCESS;
280}

◆ fill() [4/4]

StatusCode D3PD::CovarianceFillerTool::fill ( const AmgSymMatrix(5) & m)
virtual

Fill one block — type-safe version.

Parameters
pThe input object.

This is called once per object. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

Parameters
mThe input object.

This is called once per object. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

Definition at line 169 of file CovarianceFillerTool.cxx.

170{
171
172 if(m_nParameters<=0){
173 return StatusCode::SUCCESS;
174 }
175
176 if( m_isTrackPerigee ) {
177 if (m.rows() > 0) {
178 if( m_writeError ) {
179 *m_err[0] = Amg::error(m,Trk::d0);
180 *m_err[1] = Amg::error(m,Trk::z0);
181 *m_err[2] = Amg::error(m,Trk::phi0);
182 *m_err[3] = Amg::error(m,Trk::theta);
183 *m_err[4] = Amg::error(m,Trk::qOverP);
184 }
185 size_t icov = 0;
187 *m_cov[icov++] = m(Trk::d0,Trk::d0);
188 *m_cov[icov++] = m(Trk::z0,Trk::z0);
189 *m_cov[icov++] = m(Trk::phi0,Trk::phi0);
190 *m_cov[icov++] = m(Trk::theta,Trk::theta);
191 *m_cov[icov++] = m(Trk::qOverP,Trk::qOverP);
192 }
194 *m_cov[icov++] = m(Trk::d0,Trk::z0);
195 *m_cov[icov++] = m(Trk::d0,Trk::phi0);
196 *m_cov[icov++] = m(Trk::d0,Trk::theta);
197 *m_cov[icov++] = m(Trk::d0,Trk::qOverP);
198 *m_cov[icov++] = m(Trk::z0,Trk::phi0);
199 *m_cov[icov++] = m(Trk::z0,Trk::theta);
200 *m_cov[icov++] = m(Trk::z0,Trk::qOverP);
201 *m_cov[icov++] = m(Trk::phi0,Trk::theta);
202 *m_cov[icov++] = m(Trk::phi0,Trk::qOverP);
203 *m_cov[icov++] = m(Trk::theta,Trk::qOverP);
204 }
205 assert (icov == m_cov.size());
206 }
207 }
208 else{
209 if( m_writeError ) {
210 for(int i=0; i<m_nParameters; i++){
212 }
213 }
214
215 size_t icov = 0;
217 for(int i=0; i<m_nParameters; i++)
218 *m_cov[icov++] = m((Trk::ParamDefs)i,(Trk::ParamDefs)i);
219 }
221 for(int i=0; i<m_nParameters; i++) {
222 for(int j=i+1; j<m_nParameters; j++)
223 *m_cov[icov++] = m((Trk::ParamDefs)i,(Trk::ParamDefs)j);
224 }
225 }
226 assert (icov == m_cov.size());
227 }
228
229 return StatusCode::SUCCESS;
230}

◆ fillAgain()

virtual StatusCode D3PD::BlockFillerTool< Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > >::fillAgain ( const Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > & p)
virtualinherited

Fill one block, after AGAIN has been returned (type-safe).

Parameters
pThe input object.

Once fill returns AGAIN, the parent should call fillAgain with the same arguments. This continues until fillAgain returns something other than AGAIN.

By default, this just calls fill().

◆ fillUntyped()

virtual StatusCode D3PD::BlockFillerTool< Types< AmgSymMatrix(5), AmgSymMatrix(3), Amg::MatrixX > >::fillUntyped ( const void * p,
bool again = false )
virtualinherited

Fill one block.

Parameters
pThe input object.
againSet if this is a subsequent call requested by an AGAIN return

This is called once per object. The type of the object at which p points is given by the ti argument to configureD3PD. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

If the return status is the special code AGAIN (defined above), then this filler tool wants to make multiple entries. The parent should set up to capture a new ‘row’ and run through the list of block filler tools again, but for this tool call fillAgainUntyped instead of fillUntyped. This should be repeated as long as fillAgainUntyped returns AGAIN.

Once fillUntyped returns AGAIN, the parent should call fillUntyped with the same p argument and again set to true. This continues until fillUntyped returns something other than AGAIN.

Not all parents may support this. In that case, returning AGAIN will be treated as an error.

Member Data Documentation

◆ m_blockName

std::string D3PD::BlockFillerToolImpl::m_blockName
privateinherited

Property: the name of this block.

Definition at line 118 of file BlockFillerToolImpl.h.

◆ m_converter

TypeConverter D3PD::BlockFillerToolImpl::m_converter
privateinherited

Helper to do type conversions.

Definition at line 121 of file BlockFillerToolImpl.h.

◆ m_cov

std::vector<float*> D3PD::CovarianceFillerTool::m_cov
private

Variables: covariance matrix.

Definition at line 76 of file CovarianceFillerTool.h.

◆ m_err

std::vector<float*> D3PD::CovarianceFillerTool::m_err
private

Variables: uncertainty.

Definition at line 73 of file CovarianceFillerTool.h.

◆ m_isPosition

bool D3PD::CovarianceFillerTool::m_isPosition
private

Definition at line 68 of file CovarianceFillerTool.h.

◆ m_isTrackPerigee

bool D3PD::CovarianceFillerTool::m_isTrackPerigee
private

Definition at line 69 of file CovarianceFillerTool.h.

◆ m_metadata

ObjectMetadata D3PD::AddVariable::m_metadata
protectedinherited

Metadata about the variables created by this object.

Definition at line 129 of file AddVariable.h.

◆ m_nParameters

int D3PD::CovarianceFillerTool::m_nParameters
private

Definition at line 70 of file CovarianceFillerTool.h.

◆ m_prefix

std::string D3PD::BlockFillerToolImpl::m_prefix
privateinherited

Property: the variable prefix for this block.

Definition at line 112 of file BlockFillerToolImpl.h.

◆ m_suffix

std::string D3PD::BlockFillerToolImpl::m_suffix
privateinherited

Property: the variable prefix for this block.

Definition at line 115 of file BlockFillerToolImpl.h.

◆ m_tree

IAddVariable* D3PD::AddVariable::m_tree
privateinherited

Reference to the block name.

The parent IAddVariable instance.

Definition at line 143 of file AddVariable.h.

◆ m_writeDiagCovariance

bool D3PD::CovarianceFillerTool::m_writeDiagCovariance
private

Definition at line 66 of file CovarianceFillerTool.h.

◆ m_writeError

bool D3PD::CovarianceFillerTool::m_writeError
private

parameters

Definition at line 65 of file CovarianceFillerTool.h.

◆ m_writeOffDiagCovariance

bool D3PD::CovarianceFillerTool::m_writeOffDiagCovariance
private

Definition at line 67 of file CovarianceFillerTool.h.

◆ s_emptyString

const std::string D3PD::AddVariable::s_emptyString
staticprivateinherited

Used to provide a default value for blockName.

Definition at line 41 of file AddVariable.h.


The documentation for this class was generated from the following files: