CMS 3D CMS Logo

TtDecayChannelSelector.h
Go to the documentation of this file.
1 #include <vector>
2 #include <cstring>
3 #include <iostream>
4 
7 
9 public:
11  enum { Elec = 0, Muon = 1, Tau = 2 };
13  typedef std::vector<int> Decay;
14 
20  bool operator()(const reco::GenParticleCollection& parts, std::string inputType) const;
21 
22 private:
24  unsigned int decayChannel() const;
25  // return the check sum of all entries
26  unsigned int checkSum(const Decay& vec) const;
28  bool search(reco::GenParticleCollection::const_iterator& part, int pdgId, std::string& inputType) const;
30  bool search(reco::GenParticle::const_iterator& part, int pdgId, std::string& inputType) const;
32  bool tauDecay(const reco::Candidate&) const;
34  unsigned int countProngs(const reco::Candidate& part) const;
35 
36 private:
38  bool invert_;
44  bool allowMuon_;
56 };
57 
58 inline unsigned int TtDecayChannelSelector::decayChannel() const {
59  unsigned int channel = 0;
60  if (std::count(decayBranchA_.begin(), decayBranchA_.end(), 1) > 0) {
61  ++channel;
62  }
63  if (std::count(decayBranchB_.begin(), decayBranchB_.end(), 1) > 0) {
64  ++channel;
65  }
66  return channel;
67 }
68 
69 inline unsigned int TtDecayChannelSelector::checkSum(const Decay& vec) const {
70  unsigned int sum = 0;
71  for (unsigned int d = 0; d < vec.size(); ++d) {
72  sum += vec[d];
73  }
74  return sum;
75 }
TtDecayChannelSelector::Elec
Definition: TtDecayChannelSelector.h:11
TtDecayChannelSelector::allow3Prong_
bool allow3Prong_
allow 2-prong tau decays
Definition: TtDecayChannelSelector.h:48
TtDecayChannelSelector::allowMuon_
bool allowMuon_
allow tau decays into muon
Definition: TtDecayChannelSelector.h:44
TtDecayChannelSelector::TtDecayChannelSelector
TtDecayChannelSelector(const edm::ParameterSet &)
std contructor
Definition: TtDecayChannelSelector.cc:15
TtDecayChannelSelector::decayChannel
unsigned int decayChannel() const
return decay channel to select for from configuration
Definition: TtDecayChannelSelector.h:58
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition: GenParticleFwd.h:13
TtDecayChannelSelector::decayBranchB_
Decay decayBranchB_
top decay branch 2
Definition: TtDecayChannelSelector.h:52
reco::candidate::const_iterator
Definition: const_iterator.h:14
TtDecayChannelSelector::allowElectron_
bool allowElectron_
allow tau decays into electron
Definition: TtDecayChannelSelector.h:42
TtDecayChannelSelector::~TtDecayChannelSelector
~TtDecayChannelSelector()
default destructor
Definition: TtDecayChannelSelector.cc:59
TtDecayChannelSelector::Decay
std::vector< int > Decay
typedef to simplify the decay vectors
Definition: TtDecayChannelSelector.h:13
Tau
Definition: Tau.py:1
Muon
Definition: Muon.py:1
GenParticle.h
contentValuesFiles.parts
parts
Definition: contentValuesFiles.py:58
part
part
Definition: HCALResponse.h:20
TtDecayChannelSelector::allow1Prong_
bool allow1Prong_
allow 1-prong tau decays
Definition: TtDecayChannelSelector.h:46
TtDecayChannelSelector::invert_
bool invert_
invert selection
Definition: TtDecayChannelSelector.h:38
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TtDecayChannelSelector::search
bool search(reco::GenParticleCollection::const_iterator &part, int pdgId, std::string &inputType) const
search for particle with pdgId in given listing (for top)
Definition: TtDecayChannelSelector.cc:168
edm::ParameterSet
Definition: ParameterSet.h:47
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
TtDecayChannelSelector::checkSum
unsigned int checkSum(const Decay &vec) const
Definition: TtDecayChannelSelector.h:69
TtDecayChannelSelector::allowedDecays_
Decay allowedDecays_
Definition: TtDecayChannelSelector.h:55
reco::Candidate
Definition: Candidate.h:27
TtDecayChannelSelector::decayBranchA_
Decay decayBranchA_
top decay branch 1
Definition: TtDecayChannelSelector.h:50
TtDecayChannelSelector::operator()
bool operator()(const reco::GenParticleCollection &parts, std::string inputType) const
operator for decay channel selection
Definition: TtDecayChannelSelector.cc:61
ztail.d
d
Definition: ztail.py:151
ParameterSet.h
TtDecayChannelSelector::countProngs
unsigned int countProngs(const reco::Candidate &part) const
count the number of charged particles for tau decays
Definition: TtDecayChannelSelector.cc:186
TtDecayChannelSelector::restrictTauDecays_
bool restrictTauDecays_
restrict tau decays
Definition: TtDecayChannelSelector.h:40
TtDecayChannelSelector::tauDecay
bool tauDecay(const reco::Candidate &) const
check tau decay to be leptonic, 1-prong or 3-prong
Definition: TtDecayChannelSelector.cc:199
TtDecayChannelSelector
Definition: TtDecayChannelSelector.h:8