Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmccoll committed Apr 3, 2017
1 parent 548e308 commit d74aaa1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 31 deletions.
6 changes: 3 additions & 3 deletions DataFormats/GEMRecHit/interface/ME0Segment.h
Expand Up @@ -26,10 +26,10 @@ class ME0Segment final : public RecSegment {

/// Constructor
ME0Segment(const std::vector<const ME0RecHit*>& proto_segment, const LocalPoint& origin,
const LocalVector& direction, const AlgebraicSymMatrix& errors, double chi2);
const LocalVector& direction, const AlgebraicSymMatrix& errors, float chi2);

ME0Segment(const std::vector<const ME0RecHit*>& proto_segment, const LocalPoint& origin,
const LocalVector& direction, const AlgebraicSymMatrix& errors, double chi2, float time, float timeErr, float deltaPhi);
const LocalVector& direction, const AlgebraicSymMatrix& errors, float chi2, float time, float timeErr, float deltaPhi);

/// Destructor
virtual ~ME0Segment();
Expand Down Expand Up @@ -83,7 +83,7 @@ class ME0Segment final : public RecSegment {
LocalPoint theOrigin; // in chamber frame - the GeomDet local coordinate system
LocalVector theLocalDirection; // in chamber frame - the GeomDet local coordinate system
AlgebraicSymMatrix theCovMatrix; // the covariance matrix
double theChi2; // the Chi squared of the segment fit
float theChi2; // the Chi squared of the segment fit
float theTimeValue; // the best time estimate of the segment
float theTimeUncrt; // the uncertainty on the time estimation
float theDeltaPhi; // Difference in segment phi position: outer layer - inner lay
Expand Down
39 changes: 12 additions & 27 deletions DataFormats/GEMRecHit/src/ME0Segment.cc
Expand Up @@ -32,46 +32,31 @@ class ProjectionMatrixDiag {
};

ME0Segment::ME0Segment(const std::vector<const ME0RecHit*>& proto_segment, const LocalPoint& origin,
const LocalVector& direction, const AlgebraicSymMatrix& errors, double chi2) :
RecSegment(buildDetId(proto_segment.front()->me0Id())),
theOrigin(origin),
theLocalDirection(direction), theCovMatrix(errors), theChi2(chi2){
theTimeValue = 0.0;
theTimeUncrt = 0.0;
theDeltaPhi = 0.0;
for(unsigned int i=0; i<proto_segment.size(); ++i)
theME0RecHits.push_back(*proto_segment[i]);
}
const LocalVector& direction, const AlgebraicSymMatrix& errors, float chi2) :
RecSegment(buildDetId(proto_segment.front()->me0Id())), theOrigin(origin), theLocalDirection(direction), theCovMatrix(errors),
theChi2(chi2), theTimeValue(0.), theTimeUncrt(0.), theDeltaPhi(0.){
for(const auto* rh : proto_segment ) theME0RecHits.push_back(*rh);
}

ME0Segment::ME0Segment(const std::vector<const ME0RecHit*>& proto_segment, const LocalPoint& origin,
const LocalVector& direction, const AlgebraicSymMatrix& errors, double chi2, float time, float timeErr, float deltaPhi) :
RecSegment(buildDetId(proto_segment.front()->me0Id())),
theOrigin(origin),
theLocalDirection(direction), theCovMatrix(errors), theChi2(chi2){
theTimeValue = time;
theTimeUncrt = timeErr;
theDeltaPhi = deltaPhi;

for(unsigned int i=0; i<proto_segment.size(); ++i)
theME0RecHits.push_back(*proto_segment[i]);
const LocalVector& direction, const AlgebraicSymMatrix& errors, float chi2, float time, float timeErr, float deltaPhi) :
RecSegment(buildDetId(proto_segment.front()->me0Id())), theOrigin(origin), theLocalDirection(direction), theCovMatrix(errors),
theChi2(chi2),theTimeValue(time), theTimeUncrt(timeErr), theDeltaPhi(deltaPhi){
for(const auto* rh : proto_segment ) theME0RecHits.push_back(*rh);
}

ME0Segment::~ME0Segment() {}

std::vector<const TrackingRecHit*> ME0Segment::recHits() const{
std::vector<const TrackingRecHit*> pointersOfRecHits;
for (std::vector<ME0RecHit>::const_iterator irh = theME0RecHits.begin(); irh!=theME0RecHits.end(); ++irh) {
pointersOfRecHits.push_back(&(*irh));
}
for(const auto& rh : theME0RecHits ) pointersOfRecHits.push_back(&rh);
return pointersOfRecHits;
}

std::vector<TrackingRecHit*> ME0Segment::recHits() {

std::vector<TrackingRecHit*> pointersOfRecHits;
for (std::vector<ME0RecHit>::iterator irh = theME0RecHits.begin(); irh!=theME0RecHits.end(); ++irh) {
pointersOfRecHits.push_back(&(*irh));
}
for(auto& rh : theME0RecHits ) pointersOfRecHits.push_back(&rh);
return pointersOfRecHits;
}

Expand Down
2 changes: 1 addition & 1 deletion DataFormats/GEMRecHit/src/classes_def.xml
Expand Up @@ -46,7 +46,7 @@
<class name="GEMSegmentRef" splitLevel="0"/>

<class name="ME0Segment" ClassVersion="13">
<version ClassVersion="13" checksum="3580185462"/>
<version ClassVersion="13" checksum="2586529869"/>
<version ClassVersion="12" checksum="759556370"/>
<version ClassVersion="11" checksum="513208975"/>
<version ClassVersion="10" checksum="2562385753"/>
Expand Down

0 comments on commit d74aaa1

Please sign in to comment.