CMS 3D CMS Logo

ShallowClonePtrCandidate.h

Go to the documentation of this file.
00001 #ifndef Candidate_ShallowClonePtrCandidate_h
00002 #define Candidate_ShallowClonePtrCandidate_h
00003 
00013 #include "DataFormats/Candidate/interface/Candidate.h"
00014 #include "DataFormats/Candidate/interface/iterator_imp_specific.h"
00015 
00016 namespace reco {
00017   class ShallowClonePtrCandidate : public Candidate {
00018   public:
00020     typedef CandidateCollection daughters;
00022     ShallowClonePtrCandidate() : Candidate() {  }
00024     explicit ShallowClonePtrCandidate( const CandidatePtr & masterClone ) : 
00025       Candidate( * masterClone ), 
00026       masterClone_( masterClone ) { 
00027     }
00029     ShallowClonePtrCandidate( const CandidatePtr & masterClone, 
00030                            Charge q, const LorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ) ) : 
00031       Candidate( q, p4, vtx ), masterClone_( masterClone ) { }
00033     ShallowClonePtrCandidate( const CandidatePtr & masterClone, 
00034                            Charge q, const PolarLorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ) ) : 
00035       Candidate( q, p4, vtx ), masterClone_( masterClone ) { }
00037     virtual ~ShallowClonePtrCandidate();
00039     virtual ShallowClonePtrCandidate * clone() const;
00041     virtual const_iterator begin() const;
00043     virtual const_iterator end() const;
00045     virtual iterator begin();
00047     virtual iterator end();
00049     virtual size_t numberOfDaughters() const;
00051     virtual size_t numberOfMothers() const;
00053     virtual const Candidate * daughter( size_type i ) const;
00055     virtual const Candidate * mother( size_type i ) const;
00057     virtual Candidate * daughter( size_type i );
00059     virtual bool hasMasterClonePtr() const;
00061     virtual const CandidatePtr & masterClonePtr() const;
00062 
00063 
00064     virtual bool isElectron() const;
00065     virtual bool isMuon() const;
00066     virtual bool isGlobalMuon() const;
00067     virtual bool isStandAloneMuon() const;
00068     virtual bool isTrackerMuon() const;
00069     virtual bool isCaloMuon() const;
00070     virtual bool isPhoton() const;
00071     virtual bool isConvertedPhoton() const;
00072     virtual bool isJet() const;
00073   private:
00074     // const iterator implementation
00075     typedef candidate::const_iterator_imp_specific<daughters> const_iterator_imp_specific;
00076     // iterator implementation
00077     typedef candidate::iterator_imp_specific<daughters> iterator_imp_specific;
00079     virtual bool overlap( const Candidate & c ) const { return masterClone_->overlap( c ); }
00081     CandidatePtr masterClone_;
00082   };
00083 
00084 }
00085 
00086 #endif

Generated on Tue Jun 9 17:27:27 2009 for CMSSW by  doxygen 1.5.4