Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas
athena
Commits
0be8d723
Commit
0be8d723
authored
Apr 18, 2020
by
Christos Anastopoulos
Browse files
tidy use braces
parent
f0029a8c
Changes
62
Hide whitespace changes
Inline
Side-by-side
Tracking/TrkEvent/TrkCaloCluster_OnTrack/src/CaloCluster_OnTrack.cxx
View file @
0be8d723
...
...
@@ -66,8 +66,10 @@ Trk::CaloCluster_OnTrack& Trk::CaloCluster_OnTrack::operator=(const Trk::CaloClu
{
if
(
&
cot
!=
this
)
{
if
(
m_surface
&&
m_surface
->
isFree
())
{
delete
m_surface
;}
if
(
m_globalpos
)
delete
m_globalpos
;
if
(
m_eloss
)
delete
m_eloss
;
if
(
m_globalpos
)
{
delete
m_globalpos
;
}
if
(
m_eloss
)
{
delete
m_eloss
;
}
Trk
::
MeasurementBase
::
operator
=
(
cot
);
m_surface
=
cot
.
m_surface
?
(
cot
.
m_surface
->
isFree
()
?
cot
.
m_surface
->
clone
()
:
cot
.
m_surface
)
:
nullptr
;
m_globalpos
=
cot
.
m_globalpos
?
new
Amg
::
Vector3D
(
*
cot
.
m_globalpos
)
:
nullptr
;
...
...
Tracking/TrkEvent/TrkCaloExtension/src/CaloExtension.cxx
View file @
0be8d723
...
...
@@ -19,7 +19,8 @@ namespace Trk {
CaloExtension
::~
CaloExtension
()
{
delete
m_caloEntryLayerIntersection
;
delete
m_muonEntryLayerIntersection
;
for
(
auto
ptr
:
m_caloLayerIntersections
)
delete
ptr
;
for
(
auto
ptr
:
m_caloLayerIntersections
)
{
delete
ptr
;
}
}
}
Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h
View file @
0be8d723
...
...
@@ -138,8 +138,9 @@ protected:
inline
CompetingRIOsOnTrack
::
AssignmentProb
CompetingRIOsOnTrack
::
assignmentProbability
(
unsigned
int
indx
)
const
{
assert
(
indx
<
numberOfContainedROTs
()
);
if
(
indx
<
numberOfContainedROTs
()
)
if
(
indx
<
numberOfContainedROTs
()
)
{
return
m_assignProb
->
operator
[](
indx
);
}
return
0
;
// could consider throwing an exception here - EJWM
}
...
...
Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.cxx
View file @
0be8d723
...
...
@@ -93,8 +93,9 @@ void Trk::CompetingRIOsOnTrack::setLocalParametersAndErrorMatrix() {
meanWeightMatrix
=
Amg
::
MatrixX
(
rioOnTrack
(
0
).
localCovariance
().
rows
(),
rioOnTrack
(
0
).
localCovariance
().
cols
());
meanWeightMatrix
.
setZero
();
for
(
int
i
=
0
;
i
<
meanWeightMatrix
.
cols
();
++
i
)
for
(
int
i
=
0
;
i
<
meanWeightMatrix
.
cols
();
++
i
)
{
meanWeightMatrix
(
i
,
i
)
=
1.0e-10
;
}
}
// std::cout << "CompROT - mean weight: " << meanWeightMatrix << std::endl;
m_localCovariance
=
meanWeightMatrix
.
inverse
();
...
...
@@ -159,25 +160,30 @@ MsgStream& Trk::CompetingRIOsOnTrack::dump( MsgStream& out ) const
out
<<
" - effective pars locX : "
;
if
(
m_localParams
.
contains
(
Trk
::
locX
))
{
out
<<
(
m_localParams
)[
Trk
::
locX
];
if
(
m_localParams
.
contains
(
Trk
::
locY
))
out
<<
" and "
<<
(
m_localParams
)[
Trk
::
locY
];
}
else
out
<<
"ill-defined! They are "
<<
m_localParams
;
if
(
m_localParams
.
contains
(
Trk
::
locY
))
{
out
<<
" and "
<<
(
m_localParams
)[
Trk
::
locY
];
}
}
else
{
out
<<
"ill-defined! They are "
<<
m_localParams
;
}
////out << std::endl<<" - effective error dLocX : " << m_localErrMat.error(Trk::locX);
if
(
m_localParams
.
contains
(
Trk
::
locY
))
if
(
m_localParams
.
contains
(
Trk
::
locY
))
{
////out << " and " << m_localErrMat.error(Trk::locY);
out
<<
std
::
endl
// << std::setiosflags(ios::right)<<std::setiosflags(ios::adjustfield)
<<
std
::
setiosflags
(
std
::
ios
::
fixed
)
<<
std
::
resetiosflags
(
std
::
ios
::
scientific
)
<<
std
::
setprecision
(
6
);
}
out
<<
" - Contains: |ROT# identifier locX dLocX locY dlocY ass.Prob |"
;
for
(
unsigned
int
i
=
0
;
i
<
this
->
numberOfContainedROTs
();
++
i
)
{
out
<<
std
::
endl
<<
" | "
<<
i
<<
" "
<<
this
->
rioOnTrack
(
i
).
identify
()
<<
" "
;
if
(
this
->
rioOnTrack
(
i
).
localParameters
().
contains
(
Trk
::
locX
))
if
(
this
->
rioOnTrack
(
i
).
localParameters
().
contains
(
Trk
::
locX
))
{
out
<<
std
::
setw
(
10
)
<<
this
->
rioOnTrack
(
i
).
localParameters
()[
Trk
::
locX
]
<<
" "
<<
1
/
this
->
rioOnTrack
(
i
).
localCovariance
()(
Trk
::
locX
,
Trk
::
locX
);
else
out
<<
" "
;
if
(
this
->
rioOnTrack
(
i
).
localParameters
().
contains
(
Trk
::
locY
))
}
else
{
out
<<
" "
;
}
if
(
this
->
rioOnTrack
(
i
).
localParameters
().
contains
(
Trk
::
locY
))
{
out
<<
" "
<<
std
::
setw
(
10
)
<<
this
->
rioOnTrack
(
i
).
localParameters
()[
Trk
::
locY
]
<<
" "
<<
1
/
this
->
rioOnTrack
(
i
).
localCovariance
()(
Trk
::
locY
,
Trk
::
locY
)
<<
" "
;
else
out
<<
" "
;
}
else
{
out
<<
" "
;
}
out
<<
" "
<<
m_assignProb
->
at
(
i
)
<<
(
m_indexMaxAssignProb
==
i
?
" **|"
:
" |"
);
}
...
...
@@ -194,25 +200,30 @@ std::ostream& Trk::CompetingRIOsOnTrack::dump( std::ostream& out ) const
out
<<
" - effective pars locX : "
;
if
(
m_localParams
.
contains
(
Trk
::
locX
))
{
out
<<
(
m_localParams
)[
Trk
::
locX
];
if
(
m_localParams
.
contains
(
Trk
::
locY
))
out
<<
" and "
<<
(
m_localParams
)[
Trk
::
locY
];
}
else
out
<<
"ill-defined! They are "
<<
m_localParams
;
if
(
m_localParams
.
contains
(
Trk
::
locY
))
{
out
<<
" and "
<<
(
m_localParams
)[
Trk
::
locY
];
}
}
else
{
out
<<
"ill-defined! They are "
<<
m_localParams
;
}
////out <<std::endl<< " - effective error dLocX : " << m_localErrMat.error(Trk::locX);
if
(
m_localParams
.
contains
(
Trk
::
locY
))
if
(
m_localParams
.
contains
(
Trk
::
locY
))
{
////out <<" and "<< m_localErrMat.error(Trk::locY);
out
<<
std
::
endl
// << std::setiosflags(ios::right)<<std::setiosflags(ios::adjustfield)
<<
std
::
setiosflags
(
std
::
ios
::
fixed
)
<<
std
::
resetiosflags
(
std
::
ios
::
scientific
)
<<
std
::
setprecision
(
6
);
}
out
<<
" - Contains: |ROT# identifier locX dLocX locY dlocY ass.Prob |"
;
for
(
unsigned
int
i
=
0
;
i
<
this
->
numberOfContainedROTs
();
++
i
)
{
out
<<
std
::
endl
<<
" | "
<<
i
<<
" "
<<
this
->
rioOnTrack
(
i
).
identify
()
<<
" "
;
if
(
this
->
rioOnTrack
(
i
).
localParameters
().
contains
(
Trk
::
locX
))
if
(
this
->
rioOnTrack
(
i
).
localParameters
().
contains
(
Trk
::
locX
))
{
out
<<
std
::
setw
(
10
)
<<
this
->
rioOnTrack
(
i
).
localParameters
()[
Trk
::
locX
]
<<
" "
<<
1
/
this
->
rioOnTrack
(
i
).
localCovariance
()(
Trk
::
locX
,
Trk
::
locX
);
else
out
<<
" "
;
if
(
this
->
rioOnTrack
(
i
).
localParameters
().
contains
(
Trk
::
locY
))
}
else
{
out
<<
" "
;
}
if
(
this
->
rioOnTrack
(
i
).
localParameters
().
contains
(
Trk
::
locY
))
{
out
<<
" "
<<
std
::
setw
(
10
)
<<
this
->
rioOnTrack
(
i
).
localParameters
()[
Trk
::
locY
]
<<
" "
<<
1
/
this
->
rioOnTrack
(
i
).
localCovariance
()(
Trk
::
locY
,
Trk
::
locY
)
<<
" "
;
else
out
<<
" "
;
}
else
{
out
<<
" "
;
}
out
<<
" "
<<
m_assignProb
->
at
(
i
)
<<
(
m_indexMaxAssignProb
==
i
?
" **|"
:
" |"
);
}
...
...
Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.h
View file @
0be8d723
...
...
@@ -188,11 +188,13 @@ inline bool LocalParameters::contains(ParamDefs par) const
{
return
(
m_parameterkey
&
(
1
<<
int
(
par
)));
}
inline
const
double
&
LocalParameters
::
operator
[](
ParamDefs
par
)
const
{
if
(
m_parameterkey
==
31
||
m_parameterkey
==
1
||
m_parameterkey
==
3
)
return
Amg
::
VectorX
::
operator
[](
par
);
{
if
(
m_parameterkey
==
31
||
m_parameterkey
==
1
||
m_parameterkey
==
3
)
{
return
Amg
::
VectorX
::
operator
[](
par
);
}
return
Amg
::
VectorX
::
operator
[](
s_projectionMatrices
.
accessor
(
m_parameterkey
,
par
));
}
inline
double
&
LocalParameters
::
operator
[](
ParamDefs
par
)
{
if
(
m_parameterkey
==
31
||
m_parameterkey
==
1
||
m_parameterkey
==
3
)
return
Amg
::
VectorX
::
operator
[](
par
);
{
if
(
m_parameterkey
==
31
||
m_parameterkey
==
1
||
m_parameterkey
==
3
)
{
return
Amg
::
VectorX
::
operator
[](
par
);
}
return
Amg
::
VectorX
::
operator
[](
s_projectionMatrices
.
accessor
(
m_parameterkey
,
par
));
}
inline
double
LocalParameters
::
get
(
ParamDefs
par
)
const
{
return
(
*
this
)[
par
];
}
...
...
Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCurvilinearToLocal.cxx
View file @
0be8d723
...
...
@@ -101,7 +101,8 @@ MsgStream& Trk::operator << ( MsgStream& sl, const Trk::JacobianCurvilinearToLoc
for
(
int
irow
=
0
;
irow
<
5
;
irow
++
){
for
(
int
icol
=
0
;
icol
<
5
;
icol
++
){
sl
<<
(
jac
)(
irow
,
icol
);
if
(
irow
<
4
||
icol
<
4
)
sl
<<
" "
;
if
(
irow
<
4
||
icol
<
4
)
{
sl
<<
" "
;
}
}
sl
<<
std
::
endl
;
}
...
...
@@ -118,7 +119,8 @@ std::ostream& Trk::operator << ( std::ostream& sl, const Trk::JacobianCurvilinea
for
(
int
irow
=
0
;
irow
<
5
;
irow
++
){
for
(
int
icol
=
0
;
icol
<
5
;
icol
++
){
sl
<<
(
jac
)(
irow
,
icol
);
if
(
irow
<
4
||
icol
<
4
)
sl
<<
" "
;
if
(
irow
<
4
||
icol
<
4
)
{
sl
<<
" "
;
}
}
sl
<<
std
::
endl
;
}
...
...
Tracking/TrkEvent/TrkEventPrimitives/src/JacobianLocalToCurvilinear.cxx
View file @
0be8d723
...
...
@@ -90,7 +90,8 @@ MsgStream& Trk::operator << ( MsgStream& sl, const Trk::JacobianLocalToCurviline
for
(
int
irow
=
0
;
irow
<
5
;
irow
++
){
for
(
int
icol
=
0
;
icol
<
5
;
icol
++
){
sl
<<
(
jac
)(
irow
,
icol
);
if
(
irow
<
4
||
icol
<
4
)
sl
<<
" "
;
if
(
irow
<
4
||
icol
<
4
)
{
sl
<<
" "
;
}
}
sl
<<
std
::
endl
;
}
...
...
@@ -107,7 +108,8 @@ std::ostream& Trk::operator << ( std::ostream& sl, const Trk::JacobianLocalToCur
for
(
int
irow
=
0
;
irow
<
5
;
irow
++
){
for
(
int
icol
=
0
;
icol
<
5
;
icol
++
){
sl
<<
(
jac
)(
irow
,
icol
);
if
(
irow
<
4
||
icol
<
4
)
sl
<<
" "
;
if
(
irow
<
4
||
icol
<
4
)
{
sl
<<
" "
;
}
}
sl
<<
std
::
endl
;
}
...
...
Tracking/TrkEvent/TrkEventPrimitives/src/JacobianPerigeeToCartesian.cxx
View file @
0be8d723
...
...
@@ -27,7 +27,8 @@ Trk::JacobianPerigeeToCartesian::JacobianPerigeeToCartesian(const double d0,
double
cost
=
std
::
cos
(
theta
);
double
rho
=
std
::
fabs
(
qOverP
);
int
charge
=+
1
;
if
(
qOverP
<
0
)
charge
=
-
1
;
if
(
qOverP
<
0
)
{
charge
=
-
1
;
}
// transformation of track parameters
double
px
=
cosp
*
sint
/
rho
;
...
...
Tracking/TrkEvent/TrkEventPrimitives/src/LocalParameters.cxx
View file @
0be8d723
...
...
@@ -123,14 +123,16 @@ MsgStream& operator << ( MsgStream& sl, const Trk::LocalParameters& lp)
sl
<<
"Trk::LocalParameters "
<<
": ("
;
for
(
int
ipar
=
0
;
ipar
<
lp
.
dimension
();
++
ipar
)
{
sl
<<
lp
(
ipar
);
if
(
ipar
+
1
<
lp
.
dimension
())
sl
<<
", "
;
else
sl
<<
") - key: "
<<
lp
.
m_parameterkey
<<
"("
;
if
(
ipar
+
1
<
lp
.
dimension
())
{
sl
<<
", "
;
}
else
{
sl
<<
") - key: "
<<
lp
.
m_parameterkey
<<
"("
;
}
}
for
(
int
itag
=
0
,
ipos
=
1
;
itag
<
5
;
++
itag
,
ipos
*=
2
)
{
bool
bit
=
(
lp
.
m_parameterkey
&
ipos
);
if
(
bit
)
sl
<<
"1"
;
else
sl
<<
"0"
;
if
(
bit
)
{
sl
<<
"1"
;
}
else
{
sl
<<
"0"
;
}
}
sl
<<
")"
;
sl
.
precision
(
ss
);
sl
<<
std
::
resetiosflags
(
std
::
ios
::
fixed
);
...
...
@@ -145,14 +147,16 @@ std::ostream& operator << ( std::ostream& sl, const Trk::LocalParameters& lp)
sl
<<
"Trk::LocalParameters "
<<
": ("
;
for
(
int
ipar
=
0
;
ipar
<
lp
.
dimension
();
++
ipar
)
{
sl
<<
lp
(
ipar
);
if
(
ipar
+
1
<
lp
.
dimension
())
sl
<<
", "
;
else
sl
<<
") - key: "
<<
lp
.
m_parameterkey
<<
"("
;
if
(
ipar
+
1
<
lp
.
dimension
())
{
sl
<<
", "
;
}
else
{
sl
<<
") - key: "
<<
lp
.
m_parameterkey
<<
"("
;
}
}
for
(
int
itag
=
0
,
ipos
=
1
;
itag
<
5
;
++
itag
,
ipos
*=
2
)
{
bool
bit
=
(
lp
.
m_parameterkey
&
ipos
);
if
(
bit
)
sl
<<
"1"
;
else
sl
<<
"0"
;
if
(
bit
)
{
sl
<<
"1"
;
}
else
{
sl
<<
"0"
;
}
}
sl
<<
")"
;
sl
.
precision
(
ss
);
sl
<<
std
::
resetiosflags
(
std
::
ios
::
fixed
);
...
...
Tracking/TrkEvent/TrkEventPrimitives/src/ProjectionMatricesSet.cxx
View file @
0be8d723
...
...
@@ -25,7 +25,8 @@ Trk::ProjectionMatricesSet::ProjectionMatricesSet(int maxdim) :
for
(
int
itag
=
0
,
ipos
=
1
;
itag
<
m_maxdim
;
++
itag
,
ipos
*=
2
)
{
bool
bit
=
(
imatx
&
ipos
);
parameterTag
[
itag
]
=
bit
;
if
(
bit
)
++
cols
;
if
(
bit
)
{
++
cols
;
}
}
Amg
::
MatrixX
*
reduction
=
nullptr
;
...
...
@@ -49,8 +50,9 @@ Trk::ProjectionMatricesSet::ProjectionMatricesSet(int maxdim) :
accessorInt
[
irow
]
=
-
100
;
++
reduc
;
}
else
else
{
accessorInt
[
irow
]
=
reduc
;
}
}
// the expansion matrix is the transposed reduction matrix
...
...
@@ -76,11 +78,13 @@ Trk::ProjectionMatricesSet::~ProjectionMatricesSet()
{
std
::
vector
<
const
Amg
::
MatrixX
*>::
const_iterator
matrixIter
=
m_expansions
.
begin
();
std
::
vector
<
const
Amg
::
MatrixX
*>::
const_iterator
matrixIterEnd
=
m_expansions
.
end
();
for
(
;
matrixIter
!=
matrixIterEnd
;
delete
(
*
matrixIter
),
++
matrixIter
)
;
for
(
;
matrixIter
!=
matrixIterEnd
;
delete
(
*
matrixIter
),
++
matrixIter
)
{
;
}
matrixIter
=
m_reductions
.
begin
();
matrixIterEnd
=
m_reductions
.
end
();
for
(
;
matrixIter
!=
matrixIterEnd
;
delete
(
*
matrixIter
),
++
matrixIter
)
;
for
(
;
matrixIter
!=
matrixIterEnd
;
delete
(
*
matrixIter
),
++
matrixIter
)
{
;
}
}
Tracking/TrkEvent/TrkEventUtils/src/IdentifierExtractor.cxx
View file @
0be8d723
...
...
@@ -19,7 +19,8 @@ void Trk::IdentifierExtractor::extract(std::vector<Identifier>& ids, const std::
for
(;
it
!=
itEnd
;
it
++
)
{
Identifier
id
=
extract
(
*
it
);
if
(
id
.
is_valid
()
)
ids
.
push_back
(
id
);
if
(
id
.
is_valid
()
)
{
ids
.
push_back
(
id
);
}
}
}
...
...
Tracking/TrkEvent/TrkEventUtils/src/MeasurementTypeID.cxx
View file @
0be8d723
...
...
@@ -19,43 +19,50 @@
Trk
::
TrackState
::
MeasurementType
Trk
::
MeasurementTypeID
::
defineType
(
const
Trk
::
MeasurementBase
*
meas
)
const
{
if
(
meas
==
nullptr
)
return
Trk
::
TrackState
::
unidentified
;
if
(
meas
==
nullptr
)
{
return
Trk
::
TrackState
::
unidentified
;
}
const
Trk
::
RIO_OnTrack
*
testROT
=
nullptr
;
Trk
::
RoT_Extractor
::
extract
(
testROT
,
meas
);
// get std and competing ROTs
if
(
testROT
!=
nullptr
)
{
if
(
!
(
testROT
->
identify
().
is_valid
()))
return
Trk
::
TrackState
::
unidentified
;
if
(
m_idHelper
->
is_pixel
(
testROT
->
identify
()))
if
(
!
(
testROT
->
identify
().
is_valid
()))
{
return
Trk
::
TrackState
::
unidentified
;
}
if
(
m_idHelper
->
is_pixel
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
Pixel
;
else
if
(
m_idHelper
->
is_sct
(
testROT
->
identify
()))
}
else
if
(
m_idHelper
->
is_sct
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
SCT
;
else
if
(
m_idHelper
->
is_trt
(
testROT
->
identify
()))
}
else
if
(
m_idHelper
->
is_trt
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
TRT
;
else
if
(
m_idHelper
->
is_mdt
(
testROT
->
identify
()))
}
else
if
(
m_idHelper
->
is_mdt
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
MDT
;
else
if
(
m_idHelper
->
is_tgc
(
testROT
->
identify
()))
}
else
if
(
m_idHelper
->
is_tgc
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
TGC
;
else
if
(
m_idHelper
->
is_rpc
(
testROT
->
identify
()))
}
else
if
(
m_idHelper
->
is_rpc
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
RPC
;
else
if
(
m_idHelper
->
is_csc
(
testROT
->
identify
()))
}
else
if
(
m_idHelper
->
is_csc
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
CSC
;
else
if
(
m_idHelper
->
is_stgc
(
testROT
->
identify
()))
}
else
if
(
m_idHelper
->
is_stgc
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
STGC
;
else
if
(
m_idHelper
->
is_mm
(
testROT
->
identify
()))
}
else
if
(
m_idHelper
->
is_mm
(
testROT
->
identify
()))
{
return
Trk
::
TrackState
::
MM
;
else
return
Trk
::
TrackState
::
unidentified
;
}
else
{
return
Trk
::
TrackState
::
unidentified
;
}
}
const
Trk
::
PseudoMeasurementOnTrack
*
testPseudo
=
dynamic_cast
<
const
Trk
::
PseudoMeasurementOnTrack
*>
(
meas
);
if
(
testPseudo
!=
nullptr
)
return
Trk
::
TrackState
::
Pseudo
;
if
(
testPseudo
!=
nullptr
)
{
return
Trk
::
TrackState
::
Pseudo
;
}
const
Trk
::
Segment
*
testSegment
=
dynamic_cast
<
const
Trk
::
Segment
*>
(
meas
);
if
(
testSegment
!=
nullptr
)
return
Trk
::
TrackState
::
Segment
;
if
(
testSegment
!=
nullptr
)
{
return
Trk
::
TrackState
::
Segment
;
}
const
Trk
::
VertexOnTrack
*
testVertex
=
dynamic_cast
<
const
Trk
::
VertexOnTrack
*>
(
meas
);
if
(
testVertex
!=
nullptr
)
return
Trk
::
TrackState
::
Vertex
;
if
(
testVertex
!=
nullptr
)
{
return
Trk
::
TrackState
::
Vertex
;
}
const
Trk
::
SpacePoint
*
testSpacePoint
=
dynamic_cast
<
const
Trk
::
SpacePoint
*>
(
meas
);
if
(
testSpacePoint
!=
nullptr
)
return
Trk
::
TrackState
::
SpacePoint
;
if
(
testSpacePoint
!=
nullptr
)
{
return
Trk
::
TrackState
::
SpacePoint
;
}
return
Trk
::
TrackState
::
unidentified
;
}
Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx
View file @
0be8d723
...
...
@@ -35,8 +35,10 @@ Trk::Perigee Trk::PerigeeFromVertexCreator::createPerigee(Amg::Vector3D& vertex,
double
phi0
=
phi
-
Q
*
rho
;
// check phi0 for [-Pi,+Pi) range
while
(
phi0
>
M_PI
)
phi0
-=
M_PI
;
while
(
phi0
<
-
M_PI
)
phi0
+=
M_PI
;
while
(
phi0
>
M_PI
)
{
phi0
-=
M_PI
;
}
while
(
phi0
<
-
M_PI
)
{
phi0
+=
M_PI
;
}
return
Trk
::
Perigee
(
d0
,
z0
,
phi0
,
theta
,
qOverP
,
PerigeeSurface
());
}
...
...
@@ -64,8 +66,10 @@ Trk::Perigee* Trk::PerigeeFromVertexCreator::createNewPerigee(Amg::Vector3D& ver
double
phi0
=
phi
-
Q
*
rho
;
// check phi0 for [-Pi,+Pi) range
while
(
phi0
>
M_PI
)
phi0
-=
M_PI
;
while
(
phi0
<
-
M_PI
)
phi0
+=
M_PI
;
while
(
phi0
>
M_PI
)
{
phi0
-=
M_PI
;
}
while
(
phi0
<
-
M_PI
)
{
phi0
+=
M_PI
;
}
return
new
Trk
::
Perigee
(
d0
,
z0
,
phi0
,
theta
,
qOverP
,
PerigeeSurface
());
}
...
...
Tracking/TrkEvent/TrkEventUtils/src/RoT_Extractor.cxx
View file @
0be8d723
...
...
@@ -23,10 +23,12 @@ void Trk::RoT_Extractor::extract(std::vector<const RIO_OnTrack*>& rots, const st
if
(
convertCompRots
&&
nullptr
==
rot
)
{
const
Trk
::
CompetingRIOsOnTrack
*
comprot
=
dynamic_cast
<
const
Trk
::
CompetingRIOsOnTrack
*>
(
*
it
);
if
(
comprot
)
if
(
comprot
)
{
rot
=
&
comprot
->
rioOnTrack
(
comprot
->
indexOfMaxAssignProb
());
}
}
if
(
nullptr
!=
rot
)
rots
.
push_back
(
rot
);
if
(
nullptr
!=
rot
)
{
rots
.
push_back
(
rot
);
}
}
}
...
...
@@ -37,8 +39,9 @@ void Trk::RoT_Extractor::extract(const Trk::RIO_OnTrack*& rot,
if
(
rot
==
nullptr
)
{
const
Trk
::
CompetingRIOsOnTrack
*
comprot
=
dynamic_cast
<
const
Trk
::
CompetingRIOsOnTrack
*>
(
meas
);
if
(
comprot
)
if
(
comprot
)
{
rot
=
&
comprot
->
rioOnTrack
(
comprot
->
indexOfMaxAssignProb
());
}
}
}
Tracking/TrkEvent/TrkLinks/src/LinkToXAODNeutralParticle.cxx
View file @
0be8d723
...
...
@@ -20,7 +20,8 @@ namespace Trk
if
(
isValid
()
)
{
const
xAOD
::
NeutralParticle
*
neut
=
this
->
cachedElement
();
if
(
nullptr
!=
neut
)
return
dynamic_cast
<
const
Trk
::
NeutralParameters
*
>
(
&
neut
->
perigeeParameters
()
);
if
(
nullptr
!=
neut
)
{
return
dynamic_cast
<
const
Trk
::
NeutralParameters
*
>
(
&
neut
->
perigeeParameters
()
);
}
return
nullptr
;
}
return
nullptr
;
...
...
Tracking/TrkEvent/TrkLinks/src/LinkToXAODTrackParticle.cxx
View file @
0be8d723
...
...
@@ -20,7 +20,8 @@ namespace Trk
if
(
isValid
()
)
{
const
xAOD
::
TrackParticle
*
trk
=
this
->
cachedElement
();
if
(
nullptr
!=
trk
)
return
dynamic_cast
<
const
Trk
::
TrackParameters
*
>
(
&
trk
->
perigeeParameters
()
);
if
(
nullptr
!=
trk
)
{
return
dynamic_cast
<
const
Trk
::
TrackParameters
*
>
(
&
trk
->
perigeeParameters
()
);
}
return
nullptr
;
}
return
nullptr
;
...
...
Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h
View file @
0be8d723
...
...
@@ -149,7 +149,8 @@ inline double Trk::MaterialEffectsBase::thicknessInX0() const
inline
bool
Trk
::
MaterialEffectsBase
::
type
(
const
Trk
::
MaterialEffectsBase
::
MaterialEffectsType
&
type
)
const
{
if
(
type
==
NumberOfMaterialEffectsTypes
)
return
false
;
if
(
type
==
NumberOfMaterialEffectsTypes
)
{
return
false
;
}
return
((
1
<<
static_cast
<
int
>
(
type
))
&
m_typeFlags
)
!=
0
;
}
...
...
Tracking/TrkEvent/TrkMaterialOnTrack/src/MaterialEffectsBase.cxx
View file @
0be8d723
...
...
@@ -44,8 +44,9 @@ Trk::MaterialEffectsBase& Trk::MaterialEffectsBase::operator= (const Trk::Materi
m_tInX0
=
rhs
.
m_tInX0
;
m_typeFlags
=
rhs
.
m_typeFlags
;
// copy only if assoc. surface is free and not part of detStore
if
(
m_associatedSurface
&&
!
m_associatedSurface
->
associatedDetectorElement
())
if
(
m_associatedSurface
&&
!
m_associatedSurface
->
associatedDetectorElement
())
{
delete
m_associatedSurface
;
}
if
(
rhs
.
m_associatedSurface
)
{
m_associatedSurface
=
(
!
rhs
.
m_associatedSurface
->
associatedDetectorElement
())
?
rhs
.
m_associatedSurface
->
clone
()
:
rhs
.
m_associatedSurface
;
...
...
@@ -56,9 +57,10 @@ Trk::MaterialEffectsBase& Trk::MaterialEffectsBase::operator= (const Trk::Materi
Trk
::
MaterialEffectsBase
::~
MaterialEffectsBase
()
{
if
(
m_associatedSurface
!=
nullptr
&&
m_associatedSurface
->
associatedDetectorElement
()
==
nullptr
)
if
(
m_associatedSurface
!=
nullptr
&&
m_associatedSurface
->
associatedDetectorElement
()
==
nullptr
)
{
delete
m_associatedSurface
;
}
}
std
::
string
Trk
::
MaterialEffectsBase
::
dumpType
()
const
{
std
::
string
type
;
...
...
@@ -105,9 +107,10 @@ MsgStream& Trk::MaterialEffectsBase::dump ( MsgStream& sl ) const
if
(
m_associatedSurface
==
nullptr
)
{
sl
<<
"NULL"
;
}
else
{
if
(
m_associatedSurface
->
associatedDetectorElement
()
!=
nullptr
)
if
(
m_associatedSurface
->
associatedDetectorElement
()
!=
nullptr
)
{
sl
<<
"from detector Element"
;
else
sl
<<
associatedSurface
()
<<
endmsg
;
}
else
{
sl
<<
associatedSurface
()
<<
endmsg
;
}
}
sl
<<
endmsg
;
return
sl
;
...
...
@@ -121,9 +124,10 @@ std::ostream& Trk::MaterialEffectsBase::dump ( std::ostream& sl ) const
if
(
m_associatedSurface
==
nullptr
)
{
sl
<<
"NULL"
;
}
else
{
if
(
m_associatedSurface
->
associatedDetectorElement
()
!=
nullptr
)
if
(
m_associatedSurface
->
associatedDetectorElement
()
!=
nullptr
)
{
sl
<<
"from detector Element"
;
else
sl
<<
associatedSurface
()
<<
std
::
endl
;
}
else
{
sl
<<
associatedSurface
()
<<
std
::
endl
;
}
}
sl
<<
std
::
endl
;
return
sl
;
...
...
Tracking/TrkEvent/TrkMaterialOnTrack/src/MaterialEffectsOnTrack.cxx
View file @
0be8d723
...
...
@@ -83,11 +83,13 @@ Trk::MaterialEffectsOnTrack& Trk::MaterialEffectsOnTrack::operator= (const Trk::
if
(
this
!=&
rhs
)
{
Trk
::
MaterialEffectsBase
::
operator
=
(
rhs
);
if
(
m_scatteringAngles
)
delete
m_scatteringAngles
;
if
(
m_scatteringAngles
)
{
delete
m_scatteringAngles
;
}
m_scatteringAngles
=
rhs
.
m_scatteringAngles
?
new
Trk
::
ScatteringAngles
(
*
rhs
.
m_scatteringAngles
)
:
nullptr
;
if
(
m_energyLoss
)
delete
m_energyLoss
;
if
(
m_energyLoss
)
{
delete
m_energyLoss
;
}
m_energyLoss
=
rhs
.
m_energyLoss
?
rhs
.
m_energyLoss
->
clone
()
:
nullptr
;
}
...
...
@@ -97,8 +99,10 @@ Trk::MaterialEffectsOnTrack& Trk::MaterialEffectsOnTrack::operator= (const Trk::
Trk
::
MaterialEffectsOnTrack
::~
MaterialEffectsOnTrack
()
{
if
(
m_scatteringAngles
)
delete
m_scatteringAngles
;
if
(
m_energyLoss
)
delete
m_energyLoss
;
if
(
m_scatteringAngles
)
{
delete
m_scatteringAngles
;
}
if
(
m_energyLoss
)
{
delete
m_energyLoss
;
}
}
// Overload of << operator for MsgStream for debug output
...
...
@@ -108,10 +112,12 @@ MsgStream& Trk::MaterialEffectsOnTrack::dump ( MsgStream& sl ) const
Trk
::
MaterialEffectsBase
::
dump
(
sl
);
sl
<<
"MaterialEffects, Scatterer? : "
<<
(
scatteringAngles
()
?
"yes:"
:
"none"
)
<<
endmsg
;
if
(
scatteringAngles
())
sl
<<
*
scatteringAngles
()
<<
endmsg
;
if
(
scatteringAngles
())
{
sl
<<
*
scatteringAngles
()
<<
endmsg
;
}
sl
<<
"MaterialEffects, E-loss ? : "
<<
(
energyLoss
()
?
"yes:"
:
"none"
)
<<
endmsg
;
if
(
energyLoss
())
sl
<<
*
energyLoss
()
<<
endmsg
;
if
(
energyLoss
())
{
sl
<<
*
energyLoss
()
<<
endmsg
;
}
return
sl
;
}
//Overload of << operator for std::ostream for debug output
...
...
@@ -121,10 +127,12 @@ std::ostream& Trk::MaterialEffectsOnTrack::dump ( std::ostream& sl ) const
Trk
::
MaterialEffectsBase
::
dump
(
sl
);
sl
<<
"MaterialEffects, Scatterer? : "
<<
(
scatteringAngles
()
?
"yes:"
:
"none"
)
<<
std
::
endl
;
if
(
scatteringAngles
())
sl
<<
*
scatteringAngles
()
<<
std
::
endl
;
if
(
scatteringAngles
())
{
sl
<<
*
scatteringAngles
()
<<
std
::
endl
;
}
sl
<<
"MaterialEffects, E-loss ? : "
<<
(
energyLoss
()
?
"yes:"
:
"none"
)
<<
std
::
endl
;
if
(
energyLoss
())
sl
<<
*
energyLoss
()
<<
std
::
endl
;
if
(
energyLoss
())
{
sl
<<
*
energyLoss
()
<<
std
::
endl
;
}
return
sl
;
}
...
...
Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
View file @
0be8d723
...
...
@@ -25,7 +25,8 @@ namespace Trk
{
// flip the charge according to qOverP
if
(
parameters
[
6
]
<
0.
)
this
->
m_chargeDef
.
setCharge
(
-
1
);
if
(
parameters
[
6
]
<
0.
)
{
this
->
m_chargeDef
.
setCharge
(
-
1
);
}
// assign the parameters
this
->
m_parameters
[
locX
]
=
0.
;
this
->
m_parameters
[
locY
]
=
0.
;
...
...
@@ -52,10 +53,11 @@ namespace Trk
this
->
m_covariance
=
cov
;
this
->
m_position
=
pos
;
// flip the charge according to qOverP
if
(
tqOverP
<
0.
)
if
(
tqOverP
<
0.
)
{
this
->
m_chargeDef
.
setCharge
(
-
1.
);
else
}
else
{