CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/DataFormats/RPCRecHit/src/RPCRecHit.cc

Go to the documentation of this file.
00001 /*
00002  *  See header file for a description of this class.
00003  *
00004  *  $Date: 2007/08/02 05:48:27 $
00005  *  $Revision: 1.7 $
00006  *  \author M. Maggi -- INFN Bari
00007  */
00008 
00009 
00010 #include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
00011 
00012 
00013 RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx) :  RecHit2DLocalPos(rpcId),
00014   theRPCId(rpcId), theBx(bx),theFirstStrip(99),theClusterSize(99), theLocalPosition(), theLocalError() 
00015 {
00016 }
00017 
00018 RPCRecHit::RPCRecHit() :  RecHit2DLocalPos(),
00019   theRPCId(), theBx(99),theFirstStrip(99),theClusterSize(99), theLocalPosition(), theLocalError() 
00020 {
00021 }
00022 
00023 
00024 RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos) :  RecHit2DLocalPos(rpcId),
00025   theRPCId(rpcId), theBx(bx), theFirstStrip(99),theClusterSize(99), theLocalPosition(pos) 
00026 {
00027   float stripResolution = 3.0 ; //cm  this sould be taken from trimmed cluster size times strip size 
00028                                  //    taken out from geometry service i.e. topology
00029   theLocalError =
00030     LocalError(stripResolution*stripResolution, 0., 0.); //FIXME: is it really needed?
00031 }
00032 
00033 
00034 
00035 // Constructor from a local position and error, wireId and digi time.
00036 RPCRecHit::RPCRecHit(const RPCDetId& rpcId,
00037                      int bx,
00038                      const LocalPoint& pos,
00039                      const LocalError& err) :  RecHit2DLocalPos(rpcId),
00040   theRPCId(rpcId), theBx(bx),theFirstStrip(99), theClusterSize(99), theLocalPosition(pos), theLocalError(err) 
00041 {
00042 }
00043 
00044 
00045 // Constructor from a local position and error, wireId, bx and cluster size.
00046 RPCRecHit::RPCRecHit(const RPCDetId& rpcId,
00047                      int bx,
00048                      int firstStrip,
00049                      int clustSize,
00050                      const LocalPoint& pos,
00051                      const LocalError& err) :  RecHit2DLocalPos(rpcId),
00052   theRPCId(rpcId), theBx(bx),theFirstStrip(firstStrip), theClusterSize(clustSize), theLocalPosition(pos), theLocalError(err) 
00053 {
00054 }
00055 
00056 
00057 
00058 
00059 // Destructor
00060 RPCRecHit::~RPCRecHit()
00061 {
00062 }
00063 
00064 
00065 
00066 RPCRecHit * RPCRecHit::clone() const {
00067   return new RPCRecHit(*this);
00068 }
00069 
00070 
00071 // Access to component RecHits.
00072 // No components rechits: it returns a null vector
00073 std::vector<const TrackingRecHit*> RPCRecHit::recHits() const {
00074   std::vector<const TrackingRecHit*> nullvector;
00075   return nullvector; 
00076 }
00077 
00078 
00079 
00080 // Non-const access to component RecHits.
00081 // No components rechits: it returns a null vector
00082 std::vector<TrackingRecHit*> RPCRecHit::recHits() {
00083   std::vector<TrackingRecHit*> nullvector;
00084   return nullvector; 
00085 }
00086 
00087 
00088 // Comparison operator, based on the wireId and the digi time
00089 bool RPCRecHit::operator==(const RPCRecHit& hit) const {
00090   return this->geographicalId() == hit.geographicalId(); 
00091 }
00092 
00093 
00094 // The ostream operator
00095 std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit) {
00096   os << "pos: " << hit.localPosition().x() ; 
00097   os << " +/- " << sqrt(hit.localPositionError().xx()) ;
00098   return os;
00099 }