Commit aefd031d authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

tidy use braces

parent f0029a8c
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
......@@ -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;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "TrkCaloExtension/CaloExtension.h"
......@@ -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;
}
}
}
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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
}
......
......@@ -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 ? " **|":" |");
}
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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]; }
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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;
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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;
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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);
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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) { ;
}
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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);
}
}
}
......
......@@ -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;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -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());
}
......
......@@ -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());
}
}
}
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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 ;
}