Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoCandidate_CaloRecHitCandidate_h
0002 #define RecoCandidate_CaloRecHitCandidate_h
0003 /** \class reco::CaloRecHitCandidate
0004  *
0005  * Reco Candidates with a CaloRecHit component
0006  *
0007  * \author Luca Lista, INFN
0008  *
0009  *
0010  */
0011 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
0012 #include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
0013 #include "DataFormats/Common/interface/Ptr.h"
0014 
0015 namespace reco {
0016 
0017   class CaloRecHitCandidate : public LeafCandidate {
0018   public:
0019     typedef edm::Ptr<CaloRecHit> CaloRecHitRef;
0020     /// default constructor
0021     CaloRecHitCandidate() : LeafCandidate() {}
0022     /// constructor from values
0023     CaloRecHitCandidate(const LorentzVector& p4, Charge q = 0, const Point& vtx = Point(0, 0, 0))
0024         : LeafCandidate(q, p4, vtx) {}
0025     /// constructor from values
0026     CaloRecHitCandidate(const PolarLorentzVector& p4, Charge q = 0, const Point& vtx = Point(0, 0, 0))
0027         : LeafCandidate(q, p4, vtx) {}
0028     /// destructor
0029     ~CaloRecHitCandidate() override;
0030     /// returns a clone of the candidate
0031     CaloRecHitCandidate* clone() const override;
0032     /// set CaloRecHit reference
0033     void setCaloRecHit(const CaloRecHitRef& r) { caloRecHit_ = r; }
0034     /// reference to a CaloRecHit
0035     CaloRecHitRef caloRecHit() const { return caloRecHit_; }
0036 
0037   private:
0038     /// check overlap with another candidate
0039     bool overlap(const Candidate&) const override;
0040     /// reference to a CaloRecHit
0041     CaloRecHitRef caloRecHit_;
0042   };
0043   /// get default Track component
0044   GET_DEFAULT_CANDIDATE_COMPONENT(CaloRecHitCandidate, edm::Ptr<CaloRecHit>, caloRecHit);
0045 
0046 }  // namespace reco
0047 
0048 #endif