CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/DataFormats/Candidate/interface/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/LeafCandidate.h"
00014 #include "DataFormats/Candidate/interface/iterator_imp_specific.h"
00015 
00016 namespace reco {
00017   class ShallowClonePtrCandidate : public LeafCandidate {
00018   public:
00020     typedef CandidateCollection daughters;
00022     ShallowClonePtrCandidate() : LeafCandidate() {  }
00024     explicit ShallowClonePtrCandidate( const CandidatePtr & masterClone ) : 
00025       LeafCandidate( * masterClone ), 
00026       masterClone_( masterClone ) { 
00027     }
00029     ShallowClonePtrCandidate( const CandidatePtr & masterClone, 
00030                            Charge q, const LorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ) ) : 
00031       LeafCandidate( q, p4, vtx ), masterClone_( masterClone ) { }
00033     ShallowClonePtrCandidate( const CandidatePtr & masterClone, 
00034                            Charge q, const PolarLorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ) ) : 
00035       LeafCandidate( 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 );
00058     using reco::LeafCandidate::daughter; // avoid hiding the base
00060     virtual bool hasMasterClonePtr() const;
00062     virtual const CandidatePtr & masterClonePtr() const;
00063 
00064 
00065     virtual bool isElectron() const;
00066     virtual bool isMuon() const;
00067     virtual bool isGlobalMuon() const;
00068     virtual bool isStandAloneMuon() const;
00069     virtual bool isTrackerMuon() const;
00070     virtual bool isCaloMuon() const;
00071     virtual bool isPhoton() const;
00072     virtual bool isConvertedPhoton() const;
00073     virtual bool isJet() const;
00074   private:
00075     // const iterator implementation
00076     typedef candidate::const_iterator_imp_specific<daughters> const_iterator_imp_specific;
00077     // iterator implementation
00078     typedef candidate::iterator_imp_specific<daughters> iterator_imp_specific;
00080     virtual bool overlap( const Candidate & c ) const { return masterClone_->overlap( c ); }
00082     CandidatePtr masterClone_;
00083   };
00084 
00085 }
00086 
00087 #endif