CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtFullHadHypGenMatch.cc
Go to the documentation of this file.
3 
5  TtFullHadHypothesis( cfg )
6 {
7 }
8 
10 
11 void
13  const edm::Handle<std::vector<pat::Jet> >& jets,
14  std::vector<int>& match,
15  const unsigned int iComb)
16 {
17  // -----------------------------------------------------
18  // get genEvent (to distinguish between uds and c quarks)
19  // -----------------------------------------------------
21  evt.getByLabel("genEvt", genEvt);
22 
23  // -----------------------------------------------------
24  // add jets
25  // -----------------------------------------------------
26  for(unsigned idx=0; idx<match.size(); ++idx){
27  if( isValid(match[idx], jets) ){
28  switch(idx){
30  if( std::abs(genEvt->daughterQuarkOfWPlus()->pdgId())==4 )
31  setCandidate(jets, match[idx], lightQ_ , jetCorrectionLevel("cQuark"));
32  else
33  setCandidate(jets, match[idx], lightQ_ , jetCorrectionLevel("udsQuark"));
34  break;
36  if( std::abs(genEvt->daughterQuarkBarOfWPlus()->pdgId())==4 )
37  setCandidate(jets, match[idx], lightQBar_, jetCorrectionLevel("cQuark"));
38  else
39  setCandidate(jets, match[idx], lightQBar_, jetCorrectionLevel("udsQuark"));
40  break;
42  setCandidate(jets, match[idx], b_ , jetCorrectionLevel("bQuark")); break;
44  if( std::abs(genEvt->daughterQuarkOfWMinus()->pdgId())==4 )
45  setCandidate(jets, match[idx], lightP_ , jetCorrectionLevel("cQuark"));
46  else
47  setCandidate(jets, match[idx], lightP_ , jetCorrectionLevel("udsQuark"));
48  break;
50  if( std::abs(genEvt->daughterQuarkBarOfWMinus()->pdgId())==4 )
51  setCandidate(jets, match[idx], lightPBar_, jetCorrectionLevel("cQuark"));
52  else
53  setCandidate(jets, match[idx], lightPBar_, jetCorrectionLevel("udsQuark"));
54  break;
56  setCandidate(jets, match[idx], bBar_ , jetCorrectionLevel("bQuark")); break;
57  }
58  }
59  }
60 }
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType ...
#define abs(x)
Definition: mlp_lapack.h:159
reco::ShallowClonePtrCandidate * lightPBar_
vector< PseudoJet > jets
reco::ShallowClonePtrCandidate * lightQBar_
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
reco::ShallowClonePtrCandidate * lightP_
virtual void buildHypo(edm::Event &evt, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &match, const unsigned int iComb)
build event hypothesis from the reco objects of a semi-leptonic event
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
reco::ShallowClonePtrCandidate * bBar_
reco::ShallowClonePtrCandidate * b_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
reco::ShallowClonePtrCandidate * lightQ_
TtFullHadHypGenMatch(const edm::ParameterSet &cfg)