Commit 070be895 authored by Jochen Meyer's avatar Jochen Meyer Committed by Graeme Stewart
Browse files

addressing coverity defect (CalibNtupleUtils-00-00-23)

parent a272773b
......@@ -131,7 +131,7 @@ namespace MuonCalib{
inline void TimedSegment::setSigmaTimeHit(unsigned int i, double sigmaTime ){
if(i>m_sigmaTimesHit.size()){
std::cout << "m_sTimesHit has a too small size" << std::endl;
m_timesHit.insert(m_timesHit.begin()+i, sigmaTime);
m_sigmaTimesHit.insert(m_timesHit.begin()+i, sigmaTime);
}
else m_sigmaTimesHit.at(i) = sigmaTime;
// std::cout << i << " set " << sigmaTime << " in the sdt_vector, " << m_sigmaTimesHit.at(i) << std::endl;
......
2015-05-12 Jochen Meyer <jomeyer@mail.cern.ch>
* addressing coverity defect 12434 (again)
* copy-paste bug fix
* Tagged as CalibNtupleUtils-00-00-23
2015-05-04 Jochen Meyer <jomeyer@mail.cern.ch>
* addressing coverity defects 12674, 12434
* Tagged as CalibNtupleUtils-00-00-22
2014-09-17 Jochen Meyer <jomeyer@mail.cern.ch>
* fixing compiler warning
* Tagged as CalibNtupleUtils-00-00-21
......
......@@ -67,6 +67,10 @@ namespace MuonCalib {
TimedSegment& TimedSegment::operator=( const TimedSegment& rhs ){
if(this!=&rhs) {
std::for_each( hitsBegin(), hitsEnd(), DeleteObject() ) ;
m_tHitVec.clear();
m_timesHit.clear();
m_sigmaTimesHit.clear();
TimedHitVec temp_tHitVec ;
THitVecCit it = rhs.hitsBegin() ;
THitVecCit it_end = rhs.hitsEnd() ;
......@@ -78,9 +82,15 @@ namespace MuonCalib {
++i;
}
m_tHitVec = temp_tHitVec ;
m_time = rhs.time();
m_sigma_time = rhs.sigmaTime();
m_radiiHit = rhs.m_radiiHit;
m_mlHit = rhs.m_mlHit;
if(m_segment) delete m_segment;
m_segment = new MuonCalibSegment( *rhs.segment() );
if(m_segment_original) delete m_segment_original;
m_segment_original = new MuonCalibSegment( *rhs.originalSegment() );
}
m_time = rhs.time();
m_sigma_time = rhs.sigmaTime();
return (*this) ;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment