Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:29

0001 /*
0002  *  See header file for a description of this class.
0003  *
0004  *  $Date: 2013/04/24 16:54:24 $
0005  *  $Revision: 1.1 $
0006  *  \author M. Maggi -- INFN Bari
0007  */
0008 
0009 #include "DataFormats/GEMRecHit/interface/ME0RecHit.h"
0010 
0011 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof)
0012     : RecHit2DLocalPos(me0Id), theME0Id(me0Id), theTOF(tof), theLocalPosition(), theLocalError() {}
0013 
0014 ME0RecHit::ME0RecHit() : RecHit2DLocalPos(), theME0Id(), theTOF(0.), theLocalPosition(), theLocalError() {}
0015 
0016 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof, const LocalPoint& pos)
0017     : RecHit2DLocalPos(me0Id), theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError() {}
0018 
0019 // Constructor from a local position and error, wireId and digi time.
0020 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof, const LocalPoint& pos, const LocalError& err)
0021     : RecHit2DLocalPos(me0Id), theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError(err) {}
0022 
0023 // Destructor
0024 ME0RecHit::~ME0RecHit() {}
0025 
0026 ME0RecHit* ME0RecHit::clone() const { return new ME0RecHit(*this); }
0027 
0028 // Access to component RecHits.
0029 // No components rechits: it returns a null vector
0030 std::vector<const TrackingRecHit*> ME0RecHit::recHits() const {
0031   std::vector<const TrackingRecHit*> nullvector;
0032   return nullvector;
0033 }
0034 // Non-const access to component RecHits.
0035 // No components rechits: it returns a null vector
0036 std::vector<TrackingRecHit*> ME0RecHit::recHits() {
0037   std::vector<TrackingRecHit*> nullvector;
0038   return nullvector;
0039 }
0040 
0041 // Comparison operator, based on the wireId and the digi time
0042 bool ME0RecHit::operator==(const ME0RecHit& hit) const { return this->geographicalId() == hit.geographicalId(); }
0043 
0044 // The ostream operator
0045 std::ostream& operator<<(std::ostream& os, const ME0RecHit& hit) {
0046   os << "pos: x = " << hit.localPosition().x();
0047   os << " +/- " << sqrt(hit.localPositionError().xx()) << " cm";
0048   os << " y = " << hit.localPosition().y();
0049   os << " +/- " << sqrt(hit.localPositionError().yy()) << " cm";
0050   return os;
0051 }