Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:09

0001 #ifndef DataFormats_FTLRecHit_FTLTrackingRecHit_h
0002 #define DataFormats_FTLRecHit_FTLTrackingRecHit_h
0003 
0004 /// Basic template class for a RecHit wrapping a Ref to an object
0005 
0006 #include <cassert>
0007 #include "DataFormats/TrackingRecHit/interface/RecHit2DLocalPos.h"
0008 
0009 template <typename ObjRef>
0010 class FTLTrackingRecHit : public RecHit2DLocalPos {
0011 public:
0012   typedef ObjRef ref_type;
0013   typedef typename ObjRef::value_type obj_type;
0014 
0015   FTLTrackingRecHit() {}
0016   FTLTrackingRecHit(DetId id, const ObjRef &objref, const LocalPoint &pos, const LocalError &err)
0017       : RecHit2DLocalPos(id), objref_(objref), pos_(pos), err_(err) {}
0018 
0019   FTLTrackingRecHit<ObjRef> *clone() const override { return new FTLTrackingRecHit<ObjRef>(*this); }
0020 
0021   LocalPoint localPosition() const override { return pos_; }
0022   LocalError localPositionError() const override { return err_; }
0023 
0024   const ObjRef &objRef() const { return objref_; }
0025 
0026   float energy() const { return objref_->energy(); }
0027 
0028   float time() const { return objref_->time(); }
0029   float timeError() const { return objref_->timeError(); }
0030 
0031   bool sharesInput(const TrackingRecHit *other, SharedInputType what) const override { assert(false); }
0032 
0033 protected:
0034   ObjRef objref_;
0035   LocalPoint pos_;
0036   LocalError err_;
0037 };
0038 
0039 // Instantiations and specializations for FTLRecHitRef and reco::CaloClusterPtr
0040 #include "DataFormats/FTLRecHit/interface/FTLRecHitCollections.h"
0041 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
0042 typedef FTLTrackingRecHit<FTLRecHitRef> FTLTrackingRecHitFromHit;
0043 typedef std::vector<FTLTrackingRecHitFromHit> FTLTrackingRecHitCollection;
0044 
0045 template <>
0046 bool FTLTrackingRecHit<FTLRecHitRef>::sharesInput(const TrackingRecHit *other, SharedInputType what) const;
0047 
0048 #endif