CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TtSemiLepHypothesis Class Referenceabstract

#include <TtSemiLepHypothesis.h>

Inheritance diagram for TtSemiLepHypothesis:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper TtSemiLepHypGenMatch TtSemiLepHypGeom TtSemiLepHypHitFit TtSemiLepHypKinFit TtSemiLepHypMaxSumPtWMass TtSemiLepHypMVADisc TtSemiLepHypWMassDeltaTopMass TtSemiLepHypWMassMaxSumPt

Public Member Functions

 TtSemiLepHypothesis (const edm::ParameterSet &)
 default constructor More...
 
 ~TtSemiLepHypothesis () override
 default destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void buildHypo (const edm::Handle< edm::View< reco::RecoCandidate > > &leps, const edm::Handle< std::vector< pat::MET > > &mets, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &jetPartonAssociation)
 minimalistic build function for simple hypotheses More...
 
virtual void buildHypo (edm::Event &event, const edm::Handle< edm::View< reco::RecoCandidate > > &lepton, const edm::Handle< std::vector< pat::MET > > &neutrino, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &jetPartonAssociation, const unsigned int iComb)=0
 build event hypothesis from the reco objects of a semi-leptonic event More...
 
virtual void buildKey ()=0
 build the event hypothesis key More...
 
reco::CompositeCandidate hypo ()
 return event hypothesis More...
 
bool isValid (const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
 check if index is in valid range of selected jets More...
 
std::string jetCorrectionLevel (const std::string &quarkType)
 helper function to construct the proper correction level string for corresponding quarkType More...
 
int key () const
 
WDecay::LeptonType leptonType (const reco::RecoCandidate *cand)
 determine lepton type of reco candidate and return a corresponding WDecay::LeptonType; the type is kNone if it is whether a muon nor an electron More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 produce the event hypothesis as CompositeCandidate and Key More...
 
void resetCandidates ()
 reset candidate pointers before hypo build process More...
 
template<typename C >
void setCandidate (const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
 use one object in a collection to set a ShallowClonePtrCandidate More...
 
void setCandidate (const edm::Handle< std::vector< pat::Jet > > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone, const std::string &correctionLevel)
 use one object in a jet collection to set a ShallowClonePtrCandidate with proper jet corrections More...
 
void setNeutrino (const edm::Handle< std::vector< pat::MET > > &met, const edm::Handle< edm::View< reco::RecoCandidate > > &leps, const int &idx, const int &type)
 set neutrino, using mW = 80.4 to calculate the neutrino pz More...
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Protected Attributes

bool getMatch_
 
reco::ShallowClonePtrCandidatehadronicB_
 
std::string jetCorrectionLevel_
 
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
 input label for all necessary collections More...
 
int key_
 hypothesis key (to be set by the buildKey function) More...
 
edm::EDGetTokenT< edm::View< reco::RecoCandidate > > lepsToken_
 
reco::ShallowClonePtrCandidatelepton_
 
reco::ShallowClonePtrCandidateleptonicB_
 
reco::ShallowClonePtrCandidatelightQ_
 
reco::ShallowClonePtrCandidatelightQBar_
 
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
 
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
 
reco::ShallowClonePtrCandidateneutrino_
 
int neutrinoSolutionType_
 algorithm used to calculate neutrino solutions (see cfi for further details) More...
 
edm::EDGetTokenT< int > nJetsConsideredToken_
 
int numberOfRealNeutrinoSolutions_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 31 of file TtSemiLepHypothesis.h.

Constructor & Destructor Documentation

◆ TtSemiLepHypothesis()

TtSemiLepHypothesis::TtSemiLepHypothesis ( const edm::ParameterSet cfg)
explicit

default constructor

Definition at line 10 of file TtSemiLepHypothesis.cc.

11  : jetsToken_(consumes<std::vector<pat::Jet> >(cfg.getParameter<edm::InputTag>("jets"))),
13  metsToken_(consumes<std::vector<pat::MET> >(cfg.getParameter<edm::InputTag>("mets"))),
14  nJetsConsideredToken_(consumes<int>(cfg.getParameter<edm::InputTag>("nJetsConsidered"))),
16  lightQ_(nullptr),
17  lightQBar_(nullptr),
18  hadronicB_(nullptr),
19  leptonicB_(nullptr),
20  neutrino_(nullptr),
21  lepton_(nullptr) {
22  getMatch_ = false;
23  if (cfg.exists("match")) {
24  getMatch_ = true;
25  matchToken_ = consumes<std::vector<std::vector<int> > >(cfg.getParameter<edm::InputTag>("match"));
26  }
27  if (cfg.exists("neutrinoSolutionType"))
28  neutrinoSolutionType_ = cfg.getParameter<int>("neutrinoSolutionType");
29  else
31  if (cfg.exists("jetCorrectionLevel")) {
32  jetCorrectionLevel_ = cfg.getParameter<std::string>("jetCorrectionLevel");
33  }
34  produces<std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > > >();
35  produces<int>("Key");
36  produces<int>("NumberOfRealNeutrinoSolutions");
37  produces<int>("NumberOfConsideredJets");
38 }

References looper::cfg, getMatch_, jetCorrectionLevel_, matchToken_, neutrinoSolutionType_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~TtSemiLepHypothesis()

TtSemiLepHypothesis::~TtSemiLepHypothesis ( )
override

default destructor

Definition at line 41 of file TtSemiLepHypothesis.cc.

41  {
42  if (lightQ_)
43  delete lightQ_;
44  if (lightQBar_)
45  delete lightQBar_;
46  if (hadronicB_)
47  delete hadronicB_;
48  if (leptonicB_)
49  delete leptonicB_;
50  if (neutrino_)
51  delete neutrino_;
52  if (lepton_)
53  delete lepton_;
54 }

References hadronicB_, lepton_, leptonicB_, lightQ_, lightQBar_, and neutrino_.

Member Function Documentation

◆ buildHypo() [1/2]

void TtSemiLepHypothesis::buildHypo ( const edm::Handle< edm::View< reco::RecoCandidate > > &  leps,
const edm::Handle< std::vector< pat::MET > > &  mets,
const edm::Handle< std::vector< pat::Jet > > &  jets,
std::vector< int > &  jetPartonAssociation 
)
protected

minimalistic build function for simple hypotheses

return key minimalistic build function for simple hypotheses

Definition at line 249 of file TtSemiLepHypothesis.cc.

252  {
253  // -----------------------------------------------------
254  // add jets
255  // -----------------------------------------------------
256  for (unsigned idx = 0; idx < match.size(); ++idx) {
257  if (isValid(match[idx], jets)) {
258  switch (idx) {
261  break;
264  break;
267  break;
270  break;
271  }
272  }
273  }
274 
275  // -----------------------------------------------------
276  // add lepton
277  // -----------------------------------------------------
278  if (leps->empty())
279  return;
281  match.push_back(0);
282 
283  // -----------------------------------------------------
284  // add neutrino
285  // -----------------------------------------------------
286  if (mets->empty())
287  return;
288  if (neutrinoSolutionType_ == -1)
290  else
292 }

References TtSemiLepEvtPartons::HadB, hadronicB_, heavyIonCSV_trainingSettings::idx, isValid(), jetCorrectionLevel(), singleTopDQM_cfi::jets, TtSemiLepEvtPartons::LepB, TtSemiLepHitFitProducer_Electrons_cfi::leps, lepton_, leptonicB_, TtSemiLepEvtPartons::LightQ, lightQ_, TtSemiLepEvtPartons::LightQBar, lightQBar_, match(), singleTopDQM_cfi::mets, neutrino_, neutrinoSolutionType_, setCandidate(), and setNeutrino().

Referenced by TtSemiLepHypGeom::buildHypo(), TtSemiLepHypMaxSumPtWMass::buildHypo(), TtSemiLepHypWMassMaxSumPt::buildHypo(), TtSemiLepHypWMassDeltaTopMass::buildHypo(), TtSemiLepHypMVADisc::buildHypo(), and produce().

◆ buildHypo() [2/2]

virtual void TtSemiLepHypothesis::buildHypo ( edm::Event event,
const edm::Handle< edm::View< reco::RecoCandidate > > &  lepton,
const edm::Handle< std::vector< pat::MET > > &  neutrino,
const edm::Handle< std::vector< pat::Jet > > &  jets,
std::vector< int > &  jetPartonAssociation,
const unsigned int  iComb 
)
protectedpure virtual

◆ buildKey()

virtual void TtSemiLepHypothesis::buildKey ( )
protectedpure virtual

◆ hypo()

reco::CompositeCandidate TtSemiLepHypothesis::hypo ( )
protected

return event hypothesis

Definition at line 128 of file TtSemiLepHypothesis.cc.

128  {
129  // check for sanity of the hypothesis
130  if (!lightQ_ || !lightQBar_ || !hadronicB_ || !leptonicB_ || !neutrino_ || !lepton_)
131  return reco::CompositeCandidate();
132 
133  // setup transient references
134  reco::CompositeCandidate hyp, hadTop, hadW, lepTop, lepW;
135 
136  AddFourMomenta addFourMomenta;
137  // build up the top branch that decays leptonically
140  addFourMomenta.set(lepW);
141  lepTop.addDaughter(lepW, TtSemiLepDaughter::LepW);
143  addFourMomenta.set(lepTop);
144 
145  // build up the top branch that decays hadronically
148  addFourMomenta.set(hadW);
149  hadTop.addDaughter(hadW, TtSemiLepDaughter::HadW);
151  addFourMomenta.set(hadTop);
152 
153  // build ttbar hypotheses
156  addFourMomenta.set(hyp);
157 
158  return hyp;
159 }

References reco::CompositeCandidate::addDaughter(), TtSemiLepDaughter::HadB, TtSemiLepDaughter::HadP, TtSemiLepDaughter::HadQ, hadronicB_, TtSemiLepDaughter::HadTop, TtSemiLepDaughter::HadW, TtSemiLepDaughter::Lep, TtSemiLepDaughter::LepB, lepton_, leptonicB_, TtSemiLepDaughter::LepTop, TtSemiLepDaughter::LepW, lightQ_, lightQBar_, neutrino_, TtSemiLepDaughter::Nu, and AddFourMomenta::set().

Referenced by produce().

◆ isValid()

bool TtSemiLepHypothesis::isValid ( const int &  idx,
const edm::Handle< std::vector< pat::Jet > > &  jets 
)
inlineprotected

check if index is in valid range of selected jets

Definition at line 69 of file TtSemiLepHypothesis.h.

69  {
70  return (0 <= idx && idx < (int)jets->size());
71  };

References heavyIonCSV_trainingSettings::idx, and singleTopDQM_cfi::jets.

Referenced by ntupleDataFormat._Object::_checkIsValid(), TtSemiLepHypGenMatch::buildHypo(), buildHypo(), and core.AutoHandle.AutoHandle::ReallyLoad().

◆ jetCorrectionLevel()

std::string TtSemiLepHypothesis::jetCorrectionLevel ( const std::string &  quarkType)
protected

helper function to construct the proper correction level string for corresponding quarkType

helper function to construct the proper correction level string for corresponding quarkType, for unknown quarkTypes an empty string is returned

Definition at line 174 of file TtSemiLepHypothesis.cc.

174  {
175  // jetCorrectionLevel was not configured
176  if (jetCorrectionLevel_.empty())
177  throw cms::Exception("Configuration")
178  << "Unconfigured jetCorrectionLevel. Please use an appropriate, non-empty string.\n";
179 
180  // quarkType is unknown
181  if (!(quarkType == "wQuarkMix" || quarkType == "udsQuark" || quarkType == "cQuark" || quarkType == "bQuark"))
182  throw cms::Exception("Configuration") << quarkType << " is unknown as a quarkType for the jetCorrectionLevel.\n";
183 
184  // combine correction level; start with a ':' even if
185  // there is no flavor tag to be added, as it is needed
186  // by setCandidate to disentangle the correction tag
187  // from a potential flavor tag, which can be empty
189  if (level == "L5Flavor:" || level == "L6UE:" || level == "L7Parton:") {
190  if (quarkType == "wQuarkMix") {
191  level += "wMix";
192  }
193  if (quarkType == "udsQuark") {
194  level += "uds";
195  }
196  if (quarkType == "cQuark") {
197  level += "charm";
198  }
199  if (quarkType == "bQuark") {
200  level += "bottom";
201  }
202  } else {
203  level += "none";
204  }
205  return level;
206 }

References jetCorrectionLevel_, personalPlayback::level, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by TtSemiLepHypGenMatch::buildHypo(), and buildHypo().

◆ key()

int TtSemiLepHypothesis::key ( ) const
inlineprotected

Definition at line 65 of file TtSemiLepHypothesis.h.

65 { return key_; };

References key_.

Referenced by produce().

◆ leptonType()

WDecay::LeptonType TtSemiLepHypothesis::leptonType ( const reco::RecoCandidate cand)
protected

determine lepton type of reco candidate and return a corresponding WDecay::LeptonType; the type is kNone if it is whether a muon nor an electron

Definition at line 162 of file TtSemiLepHypothesis.cc.

162  {
163  // check whetherwe are dealing with a reco muon or a reco electron
165  if (dynamic_cast<const reco::Muon*>(cand)) {
167  } else if (dynamic_cast<const reco::GsfElectron*>(cand)) {
169  }
170  return type;
171 }

References WDecay::kElec, WDecay::kMuon, and WDecay::kNone.

Referenced by TtSemiLepHypGenMatch::findMatchingLepton(), and setNeutrino().

◆ produce()

void TtSemiLepHypothesis::produce ( edm::Event evt,
const edm::EventSetup setup 
)
overrideprotectedvirtual

produce the event hypothesis as CompositeCandidate and Key

Implements edm::EDProducer.

Definition at line 57 of file TtSemiLepHypothesis.cc.

57  {
60 
63 
66 
69 
70  std::vector<std::vector<int> > matchVec;
71  if (getMatch_) {
73  evt.getByToken(matchToken_, matchHandle);
74  matchVec = *matchHandle;
75  } else {
76  std::vector<int> dummyMatch;
77  for (unsigned int i = 0; i < 4; ++i)
78  dummyMatch.push_back(-1);
79  matchVec.push_back(dummyMatch);
80  }
81 
82  // declare unique_ptr for products
83  std::unique_ptr<std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > > > pOut(
84  new std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > >);
85  std::unique_ptr<int> pKey(new int);
86  std::unique_ptr<int> pNeutrinoSolutions(new int);
87  std::unique_ptr<int> pJetsConsidered(new int);
88 
89  // go through given vector of jet combinations
90  unsigned int idMatch = 0;
91  typedef std::vector<std::vector<int> >::iterator MatchVecIterator;
92  for (MatchVecIterator match = matchVec.begin(); match != matchVec.end(); ++match) {
93  // reset pointers
95  // build hypothesis
96  buildHypo(evt, leps, mets, jets, *match, idMatch++);
97  pOut->push_back(std::make_pair(hypo(), *match));
98  }
99  // feed out hyps and matches
100  evt.put(std::move(pOut));
101 
102  // build and feed out key
103  buildKey();
104  *pKey = key();
105  evt.put(std::move(pKey), "Key");
106 
107  // feed out number of real neutrino solutions
108  *pNeutrinoSolutions = numberOfRealNeutrinoSolutions_;
109  evt.put(std::move(pNeutrinoSolutions), "NumberOfRealNeutrinoSolutions");
110 
111  // feed out number of considered jets
112  *pJetsConsidered = *nJetsConsidered;
113  evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets");
114 }

References buildHypo(), buildKey(), edm::Event::getByToken(), getMatch_, hypo(), mps_fire::i, singleTopDQM_cfi::jets, jetsToken_, key(), TtSemiLepHitFitProducer_Electrons_cfi::leps, lepsToken_, match(), matchToken_, singleTopDQM_cfi::mets, metsToken_, eostools::move(), TtSemiLepHypGenMatch_cfi::nJetsConsidered, nJetsConsideredToken_, numberOfRealNeutrinoSolutions_, L1TrackObjectNtupleMaker_cfg::pOut, edm::Event::put(), resetCandidates(), and trackerHitRTTI::vector.

◆ resetCandidates()

void TtSemiLepHypothesis::resetCandidates ( )
protected

reset candidate pointers before hypo build process

Definition at line 117 of file TtSemiLepHypothesis.cc.

117  {
119  lightQ_ = nullptr;
120  lightQBar_ = nullptr;
121  hadronicB_ = nullptr;
122  leptonicB_ = nullptr;
123  neutrino_ = nullptr;
124  lepton_ = nullptr;
125 }

References hadronicB_, lepton_, leptonicB_, lightQ_, lightQBar_, neutrino_, and numberOfRealNeutrinoSolutions_.

Referenced by produce().

◆ setCandidate() [1/2]

template<typename C >
void TtSemiLepHypothesis::setCandidate ( const edm::Handle< C > &  handle,
const int &  idx,
reco::ShallowClonePtrCandidate *&  clone 
)
protected

use one object in a collection to set a ShallowClonePtrCandidate

Definition at line 123 of file TtSemiLepHypothesis.h.

125  {
126  typedef typename C::value_type O;
128  clone = new reco::ShallowClonePtrCandidate(ptr, ptr->charge(), ptr->p4(), ptr->vertex());
129 }

References clone(), patZpeak::handle, and heavyIonCSV_trainingSettings::idx.

Referenced by TtSemiLepHypGenMatch::buildHypo(), TtSemiLepHypHitFit::buildHypo(), TtSemiLepHypKinFit::buildHypo(), and buildHypo().

◆ setCandidate() [2/2]

void TtSemiLepHypothesis::setCandidate ( const edm::Handle< std::vector< pat::Jet > > &  handle,
const int &  idx,
reco::ShallowClonePtrCandidate *&  clone,
const std::string &  correctionLevel 
)
protected

use one object in a jet collection to set a ShallowClonePtrCandidate with proper jet corrections

Definition at line 209 of file TtSemiLepHypothesis.cc.

212  {
214  // disentangle the correction from the potential flavor tag
215  // by the separating ':'; the flavor tag can be empty though
216  std::string step = correctionLevel.substr(0, correctionLevel.find(':'));
217  std::string flavor = correctionLevel.substr(1 + correctionLevel.find(':'));
218  float corrFactor = 1.;
219  if (flavor == "wMix")
220  corrFactor = 0.75 * ptr->jecFactor(step, "uds") + 0.25 * ptr->jecFactor(step, "charm");
221  else
222  corrFactor = ptr->jecFactor(step, flavor);
223  clone = new reco::ShallowClonePtrCandidate(ptr, ptr->charge(), ptr->p4() * corrFactor, ptr->vertex());
224 }

References reco::LeafCandidate::charge(), clone(), patZpeak::handle, heavyIonCSV_trainingSettings::idx, pat::Jet::jecFactor(), reco::LeafCandidate::p4(), AlCaHLTBitMon_QueryRunRegistry::string, and reco::LeafCandidate::vertex().

◆ setNeutrino()

void TtSemiLepHypothesis::setNeutrino ( const edm::Handle< std::vector< pat::MET > > &  met,
const edm::Handle< edm::View< reco::RecoCandidate > > &  leps,
const int &  idx,
const int &  type 
)
protected

set neutrino, using mW = 80.4 to calculate the neutrino pz

Definition at line 227 of file TtSemiLepHypothesis.cc.

230  {
232  MEzCalculator mez;
233  mez.SetMET(*(met->begin()));
234  if (leptonType(&(leps->front())) == WDecay::kMuon)
235  mez.SetLepton((*leps)[idx], true);
236  else if (leptonType(&(leps->front())) == WDecay::kElec)
237  mez.SetLepton((*leps)[idx], false);
238  else
239  throw cms::Exception("UnimplementedFeature")
240  << "Type of lepton given together with MET for solving neutrino kinematics is neither muon nor electron.\n";
241  double pz = mez.Calculate(type);
244  ptr->px(), ptr->py(), pz, sqrt(ptr->px() * ptr->px() + ptr->py() * ptr->py() + pz * pz));
245  neutrino_ = new reco::ShallowClonePtrCandidate(ptr, ptr->charge(), p4, ptr->vertex());
246 }

References MEzCalculator::Calculate(), reco::LeafCandidate::charge(), Exception, heavyIonCSV_trainingSettings::idx, MEzCalculator::IsComplex(), WDecay::kElec, WDecay::kMuon, TtSemiLepHitFitProducer_Electrons_cfi::leps, leptonType(), BTaggingMonitor_cfi::met, neutrino_, numberOfRealNeutrinoSolutions_, p4, reco::LeafCandidate::px(), reco::LeafCandidate::py(), MEzCalculator::SetLepton(), MEzCalculator::SetMET(), mathSSE::sqrt(), and reco::LeafCandidate::vertex().

Referenced by TtSemiLepHypGenMatch::buildHypo(), and buildHypo().

Member Data Documentation

◆ getMatch_

bool TtSemiLepHypothesis::getMatch_
protected

internal check whether the match information exists or not, if false a blind dummy match vector will be used internally

Definition at line 93 of file TtSemiLepHypothesis.h.

Referenced by produce(), and TtSemiLepHypothesis().

◆ hadronicB_

reco::ShallowClonePtrCandidate* TtSemiLepHypothesis::hadronicB_
protected

◆ jetCorrectionLevel_

std::string TtSemiLepHypothesis::jetCorrectionLevel_
protected

specify the desired jet correction level (the default should be L3Absolute-'abs')

Definition at line 102 of file TtSemiLepHypothesis.h.

Referenced by jetCorrectionLevel(), and TtSemiLepHypothesis().

◆ jetsToken_

edm::EDGetTokenT<std::vector<pat::Jet> > TtSemiLepHypothesis::jetsToken_
protected

input label for all necessary collections

Definition at line 95 of file TtSemiLepHypothesis.h.

Referenced by produce().

◆ key_

int TtSemiLepHypothesis::key_
protected

◆ lepsToken_

edm::EDGetTokenT<edm::View<reco::RecoCandidate> > TtSemiLepHypothesis::lepsToken_
protected

Definition at line 96 of file TtSemiLepHypothesis.h.

Referenced by produce().

◆ lepton_

reco::ShallowClonePtrCandidate* TtSemiLepHypothesis::lepton_
protected

◆ leptonicB_

reco::ShallowClonePtrCandidate* TtSemiLepHypothesis::leptonicB_
protected

◆ lightQ_

reco::ShallowClonePtrCandidate* TtSemiLepHypothesis::lightQ_
protected

candidates for internal use for the creation of the hypothesis candidate

Definition at line 112 of file TtSemiLepHypothesis.h.

Referenced by TtSemiLepHypGenMatch::buildHypo(), TtSemiLepHypHitFit::buildHypo(), TtSemiLepHypKinFit::buildHypo(), buildHypo(), hypo(), resetCandidates(), and ~TtSemiLepHypothesis().

◆ lightQBar_

reco::ShallowClonePtrCandidate* TtSemiLepHypothesis::lightQBar_
protected

◆ matchToken_

edm::EDGetTokenT<std::vector<std::vector<int> > > TtSemiLepHypothesis::matchToken_
protected

Definition at line 98 of file TtSemiLepHypothesis.h.

Referenced by produce(), and TtSemiLepHypothesis().

◆ metsToken_

edm::EDGetTokenT<std::vector<pat::MET> > TtSemiLepHypothesis::metsToken_
protected

Definition at line 97 of file TtSemiLepHypothesis.h.

Referenced by produce().

◆ neutrino_

reco::ShallowClonePtrCandidate* TtSemiLepHypothesis::neutrino_
protected

◆ neutrinoSolutionType_

int TtSemiLepHypothesis::neutrinoSolutionType_
protected

algorithm used to calculate neutrino solutions (see cfi for further details)

Definition at line 106 of file TtSemiLepHypothesis.h.

Referenced by TtSemiLepHypGenMatch::buildHypo(), buildHypo(), and TtSemiLepHypothesis().

◆ nJetsConsideredToken_

edm::EDGetTokenT<int> TtSemiLepHypothesis::nJetsConsideredToken_
protected

Definition at line 99 of file TtSemiLepHypothesis.h.

Referenced by produce().

◆ numberOfRealNeutrinoSolutions_

int TtSemiLepHypothesis::numberOfRealNeutrinoSolutions_
protected

number of real neutrino solutions: -1 if not determined, 0 if only complex, 2 if two real solutions

Definition at line 109 of file TtSemiLepHypothesis.h.

Referenced by produce(), resetCandidates(), and setNeutrino().

personalPlayback.level
level
Definition: personalPlayback.py:22
TtSemiLepDaughter::LepW
static const std::string LepW
Definition: TtSemiLeptonicEvent.h:9
TtSemiLepDaughter::Nu
static const std::string Nu
Definition: TtSemiLeptonicEvent.h:9
mps_fire.i
i
Definition: mps_fire.py:428
TtSemiLepHypothesis::jetsToken_
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
input label for all necessary collections
Definition: TtSemiLepHypothesis.h:95
TtSemiLepEvtPartons::LightQBar
Definition: TtSemiLepEvtPartons.h:25
TtSemiLepHypothesis::hypo
reco::CompositeCandidate hypo()
return event hypothesis
Definition: TtSemiLepHypothesis.cc:128
step
step
Definition: StallMonitor.cc:94
TtSemiLepHypothesis::key_
int key_
hypothesis key (to be set by the buildKey function)
Definition: TtSemiLepHypothesis.h:104
TtSemiLepEvtPartons::LepB
Definition: TtSemiLepEvtPartons.h:25
patZpeak.handle
handle
Definition: patZpeak.py:23
TtSemiLepDaughter::Lep
static const std::string Lep
Definition: TtSemiLeptonicEvent.h:9
TtSemiLepHypothesis::neutrinoSolutionType_
int neutrinoSolutionType_
algorithm used to calculate neutrino solutions (see cfi for further details)
Definition: TtSemiLepHypothesis.h:106
L1TrackObjectNtupleMaker_cfg.pOut
pOut
Definition: L1TrackObjectNtupleMaker_cfg.py:172
TtSemiLepHypothesis::buildKey
virtual void buildKey()=0
build the event hypothesis key
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
singleTopDQM_cfi.mets
mets
Definition: singleTopDQM_cfi.py:43
MEzCalculator
Definition: MEzCalculator.h:18
edm::Handle
Definition: AssociativeIterator.h:50
TtSemiLepHypothesis::getMatch_
bool getMatch_
Definition: TtSemiLepHypothesis.h:93
TtSemiLepHypothesis::setNeutrino
void setNeutrino(const edm::Handle< std::vector< pat::MET > > &met, const edm::Handle< edm::View< reco::RecoCandidate > > &leps, const int &idx, const int &type)
set neutrino, using mW = 80.4 to calculate the neutrino pz
Definition: TtSemiLepHypothesis.cc:227
TtSemiLepHypothesis::setCandidate
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
Definition: TtSemiLepHypothesis.h:123
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TtSemiLepHitFitProducer_Electrons_cfi.leps
leps
Definition: TtSemiLepHitFitProducer_Electrons_cfi.py:5
TtSemiLepDaughter::HadP
static const std::string HadP
Definition: TtSemiLeptonicEvent.h:10
TtSemiLepDaughter::HadQ
static const std::string HadQ
Definition: TtSemiLeptonicEvent.h:10
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
reco::LeafCandidate::py
double py() const final
y coordinate of momentum vector
Definition: LeafCandidate.h:142
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
MEzCalculator::SetLepton
void SetLepton(const pat::Particle &lepton, bool isMuon=true)
Set lepton.
Definition: MEzCalculator.h:31
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
TtSemiLepHypothesis::leptonicB_
reco::ShallowClonePtrCandidate * leptonicB_
Definition: TtSemiLepHypothesis.h:115
MEzCalculator::IsComplex
bool IsComplex() const
check for complex root
Definition: MEzCalculator.h:51
reco::CompositeCandidate::addDaughter
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
Definition: CompositeCandidate.cc:108
TtSemiLepDaughter::LepTop
static const std::string LepTop
Definition: TtSemiLeptonicEvent.h:9
TtSemiLepHypothesis::lepsToken_
edm::EDGetTokenT< edm::View< reco::RecoCandidate > > lepsToken_
Definition: TtSemiLepHypothesis.h:96
TtSemiLepHypothesis::lightQBar_
reco::ShallowClonePtrCandidate * lightQBar_
Definition: TtSemiLepHypothesis.h:113
edm::View
Definition: CaloClusterFwd.h:14
TtSemiLepHypothesis::matchToken_
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
Definition: TtSemiLepHypothesis.h:98
MEzCalculator::Calculate
double Calculate(int type=1)
member functions
Definition: MEzCalculator.cc:14
TtSemiLepEvtPartons::HadB
Definition: TtSemiLepEvtPartons.h:25
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
cand
Definition: decayParser.h:32
TtSemiLepEvtPartons::LightQ
Definition: TtSemiLepEvtPartons.h:25
TtSemiLepHypothesis::lightQ_
reco::ShallowClonePtrCandidate * lightQ_
Definition: TtSemiLepHypothesis.h:112
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
p4
double p4[4]
Definition: TauolaWrapper.h:92
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
reco::LeafCandidate::charge
int charge() const final
electric charge
Definition: LeafCandidate.h:106
TtSemiLepHypothesis::jetCorrectionLevel
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType
Definition: TtSemiLepHypothesis.cc:174
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
TtSemiLepDaughter::HadW
static const std::string HadW
Definition: TtSemiLeptonicEvent.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TtSemiLepHypothesis::jetCorrectionLevel_
std::string jetCorrectionLevel_
Definition: TtSemiLepHypothesis.h:102
reco::LeafCandidate::vertex
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: LeafCandidate.h:165
edm::Ptr
Definition: AssociationVector.h:31
looper.cfg
cfg
Definition: looper.py:296
TtSemiLepHypGenMatch_cfi.nJetsConsidered
nJetsConsidered
number of considered jets
Definition: TtSemiLepHypGenMatch_cfi.py:16
WDecay::LeptonType
LeptonType
Definition: TopGenEvent.h:27
MEzCalculator::SetMET
void SetMET(const pat::MET &MET)
Set MET.
Definition: MEzCalculator.h:25
TtSemiLepHypothesis::hadronicB_
reco::ShallowClonePtrCandidate * hadronicB_
Definition: TtSemiLepHypothesis.h:114
WDecay::kNone
Definition: TopGenEvent.h:27
TtSemiLepDaughter::LepB
static const std::string LepB
Definition: TtSemiLeptonicEvent.h:9
eostools.move
def move(src, dest)
Definition: eostools.py:511
TtSemiLepDaughter::HadTop
static const std::string HadTop
Definition: TtSemiLeptonicEvent.h:10
WDecay::kMuon
Definition: TopGenEvent.h:27
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
TtSemiLepHypothesis::key
int key() const
Definition: TtSemiLepHypothesis.h:65
Exception
Definition: hltDiff.cc:245
AddFourMomenta::set
void set(reco::Candidate &c) const
set up a candidate
Definition: AddFourMomenta.cc:6
TtSemiLepHypothesis::metsToken_
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
Definition: TtSemiLepHypothesis.h:97
TtSemiLepHypothesis::lepton_
reco::ShallowClonePtrCandidate * lepton_
Definition: TtSemiLepHypothesis.h:117
cms::Exception
Definition: Exception.h:70
AddFourMomenta
Definition: AddFourMomenta.h:18
TtSemiLepHypothesis::nJetsConsideredToken_
edm::EDGetTokenT< int > nJetsConsideredToken_
Definition: TtSemiLepHypothesis.h:99
reco::ShallowClonePtrCandidate
Definition: ShallowClonePtrCandidate.h:15
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:159
WDecay::kElec
Definition: TopGenEvent.h:27
TtSemiLepDaughter::HadB
static const std::string HadB
Definition: TtSemiLeptonicEvent.h:10
reco::LeafCandidate::px
double px() const final
x coordinate of momentum vector
Definition: LeafCandidate.h:140
TtSemiLepHypothesis::neutrino_
reco::ShallowClonePtrCandidate * neutrino_
Definition: TtSemiLepHypothesis.h:116
edm::InputTag
Definition: InputTag.h:15
TtSemiLepHypothesis::numberOfRealNeutrinoSolutions_
int numberOfRealNeutrinoSolutions_
Definition: TtSemiLepHypothesis.h:109
TtSemiLepHypothesis::buildHypo
void buildHypo(const edm::Handle< edm::View< reco::RecoCandidate > > &leps, const edm::Handle< std::vector< pat::MET > > &mets, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &jetPartonAssociation)
minimalistic build function for simple hypotheses
Definition: TtSemiLepHypothesis.cc:249
pat::Jet::jecFactor
float jecFactor(const std::string &level, const std::string &flavor="none", const std::string &set="") const
reco::CompositeCandidate
Definition: CompositeCandidate.h:21
TtSemiLepHypothesis::resetCandidates
void resetCandidates()
reset candidate pointers before hypo build process
Definition: TtSemiLepHypothesis.cc:117
TtSemiLepHypothesis::leptonType
WDecay::LeptonType leptonType(const reco::RecoCandidate *cand)
determine lepton type of reco candidate and return a corresponding WDecay::LeptonType; the type is kN...
Definition: TtSemiLepHypothesis.cc:162
TtSemiLepHypothesis::isValid
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
Definition: TtSemiLepHypothesis.h:69