CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtDecayChannelSelector.h
Go to the documentation of this file.
1 #include "vector"
2 #include "string.h"
3 #include <iostream>
4 
7 
9 
10  public:
11 
13  enum {Elec=0, Muon=1, Tau =2};
15  typedef std::vector<int> Decay;
16 
22  bool operator()(const reco::GenParticleCollection& parts, std::string inputType) const;
23 
24  private:
25 
27  unsigned int decayChannel() const;
28  // return the check sum of all entries
29  unsigned int checkSum(const Decay& vec) const;
31  bool search(reco::GenParticleCollection::const_iterator& part, int pdgId, std::string& inputType) const;
33  bool search(reco::GenParticle::const_iterator& part, int pdgId, std::string& inputType) const;
35  bool tauDecay(const reco::Candidate&) const;
37  unsigned int countProngs(const reco::Candidate& part) const;
38 
39  private:
40 
42  bool invert_;
58 };
59 
60 inline unsigned int
62 {
63  unsigned int channel=0;
64  if( std::count(decayBranchA_.begin(), decayBranchA_.end(), 1) > 0 ){
65  ++channel;
66  }
67  if( std::count(decayBranchB_.begin(), decayBranchB_.end(), 1) > 0 ){
68  ++channel;
69  }
70  return channel;
71 }
72 
73 inline unsigned int
75 {
76  unsigned int sum=0;
77  for(unsigned int d=0; d<vec.size(); ++d){
78  sum+=vec[d];
79  }
80  return sum;
81 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Decay decayBranchA_
top decay branch 1
bool search(reco::GenParticleCollection::const_iterator &part, int pdgId, std::string &inputType) const
search for particle with pdgId in given listing (for top)
bool restrictTauDecays_
restrict tau decays
TtDecayChannelSelector(const edm::ParameterSet &)
std contructor
unsigned int countProngs(const reco::Candidate &part) const
count the number of charged particles for tau decays
Decay decayBranchB_
top decay branch 2
bool tauDecay(const reco::Candidate &) const
check tau decay to be leptonic, 1-prong or 3-prong
bool allow3Prong_
allow 2-prong tau decays
part
Definition: HCALResponse.h:21
std::vector< int > Decay
typedef to simplify the decay vectors
unsigned int decayChannel() const
return decay channel to select for from configuration
unsigned int checkSum(const Decay &vec) const
~TtDecayChannelSelector()
default destructor
bool operator()(const reco::GenParticleCollection &parts, std::string inputType) const
operator for decay channel selection
bool allowLepton_
allow leptonic tau decays
bool allow1Prong_
allow 1-prong tau decays
bool invert_
invert selection