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  *  \author M. Maggi -- INFN Bari
0005  */
0006 
0007 #include "DataFormats/GEMRecHit/interface/GEMRecHit.h"
0008 
0009 GEMRecHit::GEMRecHit(const GEMDetId& gemId, int bx)
0010     : RecHit2DLocalPos(gemId),
0011       theGEMId(gemId),
0012       theBx(bx),
0013       theFirstStrip(99),
0014       theClusterSize(99),
0015       theLocalPosition(),
0016       theLocalError() {}
0017 
0018 GEMRecHit::GEMRecHit()
0019     : RecHit2DLocalPos(),
0020       theGEMId(),
0021       theBx(99),
0022       theFirstStrip(99),
0023       theClusterSize(99),
0024       theLocalPosition(),
0025       theLocalError() {}
0026 
0027 GEMRecHit::GEMRecHit(const GEMDetId& gemId, int bx, const LocalPoint& pos)
0028     : RecHit2DLocalPos(gemId), theGEMId(gemId), theBx(bx), theFirstStrip(99), theClusterSize(99), theLocalPosition(pos) {
0029   float stripResolution = 3.0;  //cm  this sould be taken from trimmed cluster size times strip size
0030                                 //    taken out from geometry service i.e. topology
0031   theLocalError = LocalError(stripResolution * stripResolution, 0., 0.);  //FIXME: is it really needed?
0032 }
0033 
0034 // Constructor from a local position and error, wireId and digi time.
0035 GEMRecHit::GEMRecHit(const GEMDetId& gemId, int bx, const LocalPoint& pos, const LocalError& err)
0036     : RecHit2DLocalPos(gemId),
0037       theGEMId(gemId),
0038       theBx(bx),
0039       theFirstStrip(99),
0040       theClusterSize(99),
0041       theLocalPosition(pos),
0042       theLocalError(err) {}
0043 
0044 // Constructor from a local position and error, wireId, bx and cluster size.
0045 GEMRecHit::GEMRecHit(
0046     const GEMDetId& gemId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err)
0047     : RecHit2DLocalPos(gemId),
0048       theGEMId(gemId),
0049       theBx(bx),
0050       theFirstStrip(firstStrip),
0051       theClusterSize(clustSize),
0052       theLocalPosition(pos),
0053       theLocalError(err) {}
0054 
0055 // Destructor
0056 GEMRecHit::~GEMRecHit() {}
0057 
0058 GEMRecHit* GEMRecHit::clone() const { return new GEMRecHit(*this); }
0059 
0060 // Access to component RecHits.
0061 // No components rechits: it returns a null vector
0062 std::vector<const TrackingRecHit*> GEMRecHit::recHits() const {
0063   std::vector<const TrackingRecHit*> nullvector;
0064   return nullvector;
0065 }
0066 
0067 // Non-const access to component RecHits.
0068 // No components rechits: it returns a null vector
0069 std::vector<TrackingRecHit*> GEMRecHit::recHits() {
0070   std::vector<TrackingRecHit*> nullvector;
0071   return nullvector;
0072 }
0073 
0074 // Comparison operator, based on the wireId and the digi time
0075 bool GEMRecHit::operator==(const GEMRecHit& hit) const { return this->geographicalId() == hit.geographicalId(); }
0076 
0077 // The ostream operator
0078 std::ostream& operator<<(std::ostream& os, const GEMRecHit& hit) {
0079   os << "pos: " << hit.localPosition().x();
0080   os << " +/- " << sqrt(hit.localPositionError().xx());
0081   return os;
0082 }