Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:21

0001 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0002 #include "DataFormats/TrackingRecHit/interface/KfComponentsHolder.h"
0003 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0004 
0005 #include "FWCore/Utilities/interface/Exception.h"
0006 #include <string>
0007 #include <typeinfo>
0008 
0009 void TrackingRecHit::recHitsV(std::vector<const TrackingRecHit*>& v) const { v = recHits(); }
0010 void TrackingRecHit::recHitsV(std::vector<TrackingRecHit*>& v) { v = recHits(); }
0011 
0012 bool TrackingRecHit::sharesInput(const TrackingRecHit* other, SharedInputType what) const {
0013   //
0014   // for the time being: don't force implementation in all derived classes
0015   // but throw exception to indicate missing implementation
0016   //
0017   std::string msg("Missing implementation of TrackingRecHit::sharedInput in ");
0018   msg += typeid(*this).name();
0019   throw cms::Exception(msg);
0020   return false;
0021 }
0022 
0023 void TrackingRecHit::getKfComponents(KfComponentsHolder& holder) const { holder.genericFill(*this); }
0024 
0025 namespace {
0026   inline void throwError() { throw cms::Exception("Global coordinates missing from this TrackingRecHit used"); }
0027 }  // namespace
0028 
0029 const GeomDetUnit* TrackingRecHit::detUnit() const { return det(); }
0030 
0031 GlobalPoint TrackingRecHit::globalPosition() const {
0032   throwError();
0033   return GlobalPoint();
0034 }
0035 GlobalError TrackingRecHit::globalPositionError() const {
0036   throwError();
0037   return GlobalError();
0038 }
0039 
0040 float TrackingRecHit::errorGlobalR() const {
0041   throwError();
0042   return 0;
0043 }
0044 float TrackingRecHit::errorGlobalZ() const {
0045   throwError();
0046   return 0;
0047 }
0048 float TrackingRecHit::errorGlobalRPhi() const {
0049   throwError();
0050   return 0;
0051 }