Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:31

0001 #ifndef TtEventPartons_h
0002 #define TtEventPartons_h
0003 
0004 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0005 
0006 #include <vector>
0007 
0008 /**
0009    \class   TtEventPartons TtEventPartons.h "AnalysisDataFormats/TopObjects/interface/TtEventPartons.h"
0010 
0011    \brief   Common base class for TtFullLepEvtPartons, TtFullHadEvtPartons and TtSemiLepEvtPartons
0012 */
0013 
0014 namespace reco {
0015   class Candidate;
0016 }
0017 class TtGenEvent;
0018 
0019 class TtEventPartons {
0020 public:
0021   /// default constructor
0022   TtEventPartons() = default;
0023   /// default destructor
0024   virtual ~TtEventPartons() = default;
0025 
0026   /// return vector of partons in the order defined in the corresponding enum
0027   /// (method implemented in the derived classes)
0028   virtual std::vector<const reco::Candidate*> vec(const TtGenEvent& genEvt) const = 0;
0029 
0030   /// insert dummy index -3 for all partons that were chosen to be ignored
0031   void expand(std::vector<int>& vec) const;
0032 
0033 protected:
0034   /// return pointer to an empty reco::Candidate
0035   reco::Candidate* dummyCandidatePtr() const {
0036     return new reco::GenParticle(0, reco::Particle::LorentzVector(), reco::Particle::Point(), 0, 0, false);
0037   };
0038 
0039   /// erase partons from vector if they where chosen to be ignored
0040   void prune(std::vector<const reco::Candidate*>& vec) const;
0041 
0042   /// flag partons that were chosen not to be used
0043   std::vector<bool> ignorePartons_;
0044 };
0045 
0046 #endif