Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SiTrackerMultiRecHit_H
0002 #define SiTrackerMultiRecHit_H
0003 
0004 #include "DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h"
0005 #include "DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h"
0006 #include <vector>
0007 #include <map>
0008 /*
0009 A rechit type suitable for tracking algorithm that use soft hit-to-track assignement, 
0010 such as the Deterministic Annealing Filter (DAF) or the Multi Track Filter (MTF).
0011 it contains an OwnVector with the component rechits and a vector of weights 
0012 */
0013 class SiTrackerMultiRecHit : public BaseTrackerRecHit {
0014 public:
0015   typedef BaseTrackerRecHit Base;
0016   SiTrackerMultiRecHit() : theHits(), theWeights(), annealing_(0) {}
0017   ~SiTrackerMultiRecHit() override {}
0018 
0019   SiTrackerMultiRecHit(const LocalPoint&,
0020                        const LocalError&,
0021                        GeomDet const& idet,
0022                        const std::vector<std::pair<const TrackingRecHit*, float> >&,
0023                        double);
0024 
0025   SiTrackerMultiRecHit* clone() const override { return new SiTrackerMultiRecHit(*this); }
0026 #ifdef NO_DICT
0027   RecHitPointer cloneSH() const override { return std::make_shared<SiTrackerMultiRecHit>(*this); }
0028 #endif
0029 
0030   //  virtual int dimension() const {return 2;}
0031   int dimension() const override;
0032   void getKfComponents(KfComponentsHolder& holder) const override;
0033 
0034   // at the momement nobody care of MultiHit!!!
0035   // used by trackMerger (to be improved)
0036   OmniClusterRef const& firstClusterRef() const override {
0037     return static_cast<BaseTrackerRecHit const&>(theHits.front()).firstClusterRef();
0038   }
0039 
0040   /// Access to component RecHits (if any)
0041   std::vector<const TrackingRecHit*> recHits() const override;
0042 
0043   /// Non-const access to component RecHits (if any)
0044   std::vector<TrackingRecHit*> recHits() override;
0045 
0046   //vector of weights
0047   std::vector<float> const& weights() const { return theWeights; }
0048   std::vector<float>& weights() { return theWeights; }
0049 
0050   //returns the weight for the i component
0051   using TrackingRecHit::weight;
0052   float weight(unsigned int i) const { return theWeights[i]; }
0053   float& weight(unsigned int i) { return theWeights[i]; }
0054 
0055   //get the annealing
0056   virtual double getAnnealingFactor() const { return annealing_; }
0057 
0058   bool sharesInput(const TrackingRecHit* other, SharedInputType what) const override;
0059 
0060 private:
0061   edm::OwnVector<TrackingRecHit> theHits;
0062   std::vector<float> theWeights;
0063   double annealing_;
0064 };
0065 
0066 // Comparison operators
0067 inline bool operator<(const SiTrackerMultiRecHit& one, const SiTrackerMultiRecHit& other) {
0068   if (one.geographicalId() < other.geographicalId()) {
0069     return true;
0070   } else {
0071     return false;
0072   }
0073 }
0074 
0075 #endif