CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
TtSemiLepKinFitProducer< LeptonCollection > Class Template Reference
Inheritance diagram for TtSemiLepKinFitProducer< LeptonCollection >:
edm::stream::EDProducer<>

Classes

struct  KinFitResult
 

Public Member Functions

 TtSemiLepKinFitProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

TtSemiLepKinFitter::Constraint constraint (unsigned)
 
std::vector< TtSemiLepKinFitter::Constraintconstraints (std::vector< unsigned > &)
 
bool doBTagging (bool &useBTag_, edm::Handle< std::vector< pat::Jet >> &jets, std::vector< int > &combi, std::string &bTagAlgo_, double &minBTagValueBJets_, double &maxBTagValueNonBJets_)
 
TtSemiLepKinFitter::Param param (unsigned)
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::vector< edm::ParameterSetbResolutions_
 
std::string bTagAlgo_
 input tag for b-tagging algorithm More...
 
std::vector< unsigned > constraints_
 constrains More...
 
std::unique_ptr< TtSemiLepKinFitterfitter
 
std::vector< double > jetEnergyResolutionEtaBinning_
 
std::vector< double > jetEnergyResolutionScaleFactors_
 scale factors for jet energy resolution More...
 
unsigned int jetParam_
 
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
 
unsigned int lepParam_
 
std::vector< edm::ParameterSetlepResolutions_
 
edm::EDGetTokenT< LeptonCollection > lepsToken_
 
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
 
double maxBTagValueNonBJet_
 max value of bTag for a non-b-jet More...
 
double maxDeltaS_
 maximal chi2 equivalent More...
 
double maxF_
 maximal deviation for contstraints More...
 
int maxNComb_
 maximal number of combinations to be written to the event More...
 
int maxNJets_
 maximal number of jets (-1 possible to indicate 'all') More...
 
unsigned int maxNrIter_
 maximal number of iterations to be performed for the fit More...
 
unsigned int metParam_
 
std::vector< edm::ParameterSetmetResolutions_
 
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
 
double minBTagValueBJet_
 min value of bTag for a b-jet More...
 
double mTop_
 
double mW_
 
std::vector< edm::ParameterSetudscResolutions_
 config-file-based object resolutions More...
 
bool useBTag_
 switch to tell whether to use b-tagging or not More...
 
bool useOnlyMatch_
 switch to use only a combination given by another hypothesis More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

template<typename LeptonCollection>
class TtSemiLepKinFitProducer< LeptonCollection >

Definition at line 10 of file TtSemiLepKinFitProducer.cc.

Constructor & Destructor Documentation

◆ TtSemiLepKinFitProducer()

template<typename LeptonCollection >
TtSemiLepKinFitProducer< LeptonCollection >::TtSemiLepKinFitProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 92 of file TtSemiLepKinFitProducer.cc.

References TtSemiLepKinFitProducer< LeptonCollection >::bResolutions_, looper::cfg, TtSemiLepKinFitProducer< LeptonCollection >::constraints(), TtSemiLepKinFitProducer< LeptonCollection >::constraints_, Exception, TtSemiLepKinFitProducer< LeptonCollection >::fitter, TtSemiLepKinFitProducer< LeptonCollection >::jetEnergyResolutionEtaBinning_, TtSemiLepKinFitProducer< LeptonCollection >::jetEnergyResolutionScaleFactors_, TtSemiLepKinFitProducer< LeptonCollection >::jetParam_, TtSemiLepKinFitProducer< LeptonCollection >::lepParam_, TtSemiLepKinFitProducer< LeptonCollection >::lepResolutions_, TtSemiLepKinFitProducer< LeptonCollection >::maxDeltaS_, TtSemiLepKinFitProducer< LeptonCollection >::maxF_, TtSemiLepKinFitProducer< LeptonCollection >::maxNrIter_, TtSemiLepKinFitProducer< LeptonCollection >::metParam_, TtSemiLepKinFitProducer< LeptonCollection >::metResolutions_, TtSemiLepKinFitProducer< LeptonCollection >::mTop_, TtSemiLepKinFitProducer< LeptonCollection >::mW_, TtSemiLepKinFitProducer< LeptonCollection >::param(), and TtSemiLepKinFitProducer< LeptonCollection >::udscResolutions_.

93  : jetsToken_(consumes<std::vector<pat::Jet>>(cfg.getParameter<edm::InputTag>("jets"))),
94  lepsToken_(consumes<LeptonCollection>(cfg.getParameter<edm::InputTag>("leps"))),
95  metsToken_(consumes<std::vector<pat::MET>>(cfg.getParameter<edm::InputTag>("mets"))),
96  matchToken_(mayConsume<std::vector<std::vector<int>>>(cfg.getParameter<edm::InputTag>("match"))),
97  useOnlyMatch_(cfg.getParameter<bool>("useOnlyMatch")),
98  bTagAlgo_(cfg.getParameter<std::string>("bTagAlgo")),
99  minBTagValueBJet_(cfg.getParameter<double>("minBDiscBJets")),
100  maxBTagValueNonBJet_(cfg.getParameter<double>("maxBDiscLightJets")),
101  useBTag_(cfg.getParameter<bool>("useBTagging")),
102  maxNJets_(cfg.getParameter<int>("maxNJets")),
103  maxNComb_(cfg.getParameter<int>("maxNComb")),
104  maxNrIter_(cfg.getParameter<unsigned>("maxNrIter")),
105  maxDeltaS_(cfg.getParameter<double>("maxDeltaS")),
106  maxF_(cfg.getParameter<double>("maxF")),
107  jetParam_(cfg.getParameter<unsigned>("jetParametrisation")),
108  lepParam_(cfg.getParameter<unsigned>("lepParametrisation")),
109  metParam_(cfg.getParameter<unsigned>("metParametrisation")),
110  constraints_(cfg.getParameter<std::vector<unsigned>>("constraints")),
111  mW_(cfg.getParameter<double>("mW")),
112  mTop_(cfg.getParameter<double>("mTop")),
113  jetEnergyResolutionScaleFactors_(cfg.getParameter<std::vector<double>>("jetEnergyResolutionScaleFactors")),
114  jetEnergyResolutionEtaBinning_(cfg.getParameter<std::vector<double>>("jetEnergyResolutionEtaBinning")),
115  udscResolutions_(0),
116  bResolutions_(0),
117  lepResolutions_(0),
118  metResolutions_(0) {
119  if (cfg.exists("udscResolutions") && cfg.exists("bResolutions") && cfg.exists("lepResolutions") &&
120  cfg.exists("metResolutions")) {
121  udscResolutions_ = cfg.getParameter<std::vector<edm::ParameterSet>>("udscResolutions");
122  bResolutions_ = cfg.getParameter<std::vector<edm::ParameterSet>>("bResolutions");
123  lepResolutions_ = cfg.getParameter<std::vector<edm::ParameterSet>>("lepResolutions");
124  metResolutions_ = cfg.getParameter<std::vector<edm::ParameterSet>>("metResolutions");
125  } else if (cfg.exists("udscResolutions") || cfg.exists("bResolutions") || cfg.exists("lepResolutions") ||
126  cfg.exists("metResolutions")) {
127  throw cms::Exception("Configuration") << "Parameters 'udscResolutions', 'bResolutions', 'lepResolutions', "
128  "'metResolutions' should be used together.\n";
129  }
130 
131  fitter = std::make_unique<TtSemiLepKinFitter>(param(jetParam_),
132  param(lepParam_),
133  param(metParam_),
134  maxNrIter_,
135  maxDeltaS_,
136  maxF_,
138  mW_,
139  mTop_,
141  &bResolutions_,
146 
147  produces<std::vector<pat::Particle>>("PartonsHadP");
148  produces<std::vector<pat::Particle>>("PartonsHadQ");
149  produces<std::vector<pat::Particle>>("PartonsHadB");
150  produces<std::vector<pat::Particle>>("PartonsLepB");
151  produces<std::vector<pat::Particle>>("Leptons");
152  produces<std::vector<pat::Particle>>("Neutrinos");
153 
154  produces<std::vector<std::vector<int>>>();
155  produces<std::vector<double>>("Chi2");
156  produces<std::vector<double>>("Prob");
157  produces<std::vector<int>>("Status");
158 
159  produces<int>("NumberOfConsideredJets");
160 }
std::vector< edm::ParameterSet > bResolutions_
std::vector< double > jetEnergyResolutionScaleFactors_
scale factors for jet energy resolution
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
std::string bTagAlgo_
input tag for b-tagging algorithm
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
double minBTagValueBJet_
min value of bTag for a b-jet
std::vector< TtSemiLepKinFitter::Constraint > constraints(std::vector< unsigned > &)
int maxNJets_
maximal number of jets (-1 possible to indicate &#39;all&#39;)
std::unique_ptr< TtSemiLepKinFitter > fitter
std::vector< double > jetEnergyResolutionEtaBinning_
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
std::vector< unsigned > constraints_
constrains
unsigned int maxNrIter_
maximal number of iterations to be performed for the fit
std::vector< edm::ParameterSet > udscResolutions_
config-file-based object resolutions
int maxNComb_
maximal number of combinations to be written to the event
double maxF_
maximal deviation for contstraints
edm::EDGetTokenT< LeptonCollection > lepsToken_
std::vector< edm::ParameterSet > metResolutions_
bool useOnlyMatch_
switch to use only a combination given by another hypothesis
bool useBTag_
switch to tell whether to use b-tagging or not
TtSemiLepKinFitter::Param param(unsigned)
double maxDeltaS_
maximal chi2 equivalent
std::vector< edm::ParameterSet > lepResolutions_

Member Function Documentation

◆ constraint()

template<typename LeptonCollection >
TtSemiLepKinFitter::Constraint TtSemiLepKinFitProducer< LeptonCollection >::constraint ( unsigned  val)
private

Definition at line 422 of file TtSemiLepKinFitProducer.cc.

References Exception, TtSemiLepKinFitter::kEqualTopMasses, TtSemiLepKinFitter::kNeutrinoMass, TtSemiLepKinFitter::kSumPt, TtSemiLepKinFitter::kTopHadMass, TtSemiLepKinFitter::kTopLepMass, TtSemiLepKinFitter::kWHadMass, TtSemiLepKinFitter::kWLepMass, mps_fire::result, and heppy_batch::val.

422  {
424  switch (val) {
427  break;
430  break;
433  break;
436  break;
439  break;
442  break;
445  break;
446  default:
447  throw cms::Exception("Configuration") << "Chosen fit constraint is not supported: " << val << "\n";
448  break;
449  }
450  return result;
451 }
Constraint
supported constraints

◆ constraints()

template<typename LeptonCollection >
std::vector< TtSemiLepKinFitter::Constraint > TtSemiLepKinFitProducer< LeptonCollection >::constraints ( std::vector< unsigned > &  val)
private

Definition at line 454 of file TtSemiLepKinFitProducer.cc.

References HLT_2022v12_cff::constraint, mps_fire::i, mps_fire::result, and heppy_batch::val.

Referenced by TtSemiLepKinFitProducer< LeptonCollection >::TtSemiLepKinFitProducer().

455  {
456  std::vector<TtSemiLepKinFitter::Constraint> result;
457  for (unsigned i = 0; i < val.size(); ++i) {
458  result.push_back(constraint(val[i]));
459  }
460  return result;
461 }
TtSemiLepKinFitter::Constraint constraint(unsigned)

◆ doBTagging()

template<typename LeptonCollection >
bool TtSemiLepKinFitProducer< LeptonCollection >::doBTagging ( bool &  useBTag_,
edm::Handle< std::vector< pat::Jet >> &  jets,
std::vector< int > &  combi,
std::string &  bTagAlgo_,
double &  minBTagValueBJets_,
double &  maxBTagValueNonBJets_ 
)
private

Definition at line 163 of file TtSemiLepKinFitProducer.cc.

References TtSemiLepEvtPartons::HadB, PDWG_EXODelayedJetMET_cff::jets, TtSemiLepEvtPartons::LepB, TtSemiLepEvtPartons::LightQ, and TtSemiLepEvtPartons::LightQBar.

168  {
169  if (!useBTag_) {
170  return true;
171  }
172  if (useBTag_ && (*jets)[combi[TtSemiLepEvtPartons::HadB]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
173  (*jets)[combi[TtSemiLepEvtPartons::LepB]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
174  (*jets)[combi[TtSemiLepEvtPartons::LightQ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
175  (*jets)[combi[TtSemiLepEvtPartons::LightQBar]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_) {
176  return true;
177  } else {
178  return false;
179  }
180 }
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
std::string bTagAlgo_
input tag for b-tagging algorithm
double minBTagValueBJet_
min value of bTag for a b-jet
bool useBTag_
switch to tell whether to use b-tagging or not

◆ param()

template<typename LeptonCollection >
TtSemiLepKinFitter::Param TtSemiLepKinFitProducer< LeptonCollection >::param ( unsigned  val)
private

Definition at line 402 of file TtSemiLepKinFitProducer.cc.

References Exception, TopKinFitter::kEMom, TopKinFitter::kEtEtaPhi, TopKinFitter::kEtThetaPhi, mps_fire::result, and heppy_batch::val.

Referenced by TtSemiLepKinFitProducer< LeptonCollection >::TtSemiLepKinFitProducer().

402  {
404  switch (val) {
407  break;
410  break;
413  break;
414  default:
415  throw cms::Exception("Configuration") << "Chosen jet parametrization is not supported: " << val << "\n";
416  break;
417  }
418  return result;
419 }
Param
supported parameterizations
Definition: TopKinFitter.h:22

◆ produce()

template<typename LeptonCollection >
void TtSemiLepKinFitProducer< LeptonCollection >::produce ( edm::Event evt,
const edm::EventSetup setup 
)
overrideprivate

Definition at line 183 of file TtSemiLepKinFitProducer.cc.

References edm::Event::getByToken(), TtSemiLepEvtPartons::HadB, mps_fire::i, heavyIonCSV_trainingSettings::idx, createfilelist::int, PDWG_EXODelayedJetMET_cff::jets, TtSemiLepEvtPartons::LepB, TtSemiLepHitFitProducer_Electrons_cfi::leps, TtSemiLepEvtPartons::LightQ, TtSemiLepEvtPartons::LightQBar, match(), singleTopDQM_cfi::mets, eostools::move(), stdcomb::next_combination(), nPartons, edm::Event::put(), mps_fire::result, mps_update::status, and trackerHitRTTI::vector.

183  {
184  std::unique_ptr<std::vector<pat::Particle>> pPartonsHadP(new std::vector<pat::Particle>);
185  std::unique_ptr<std::vector<pat::Particle>> pPartonsHadQ(new std::vector<pat::Particle>);
186  std::unique_ptr<std::vector<pat::Particle>> pPartonsHadB(new std::vector<pat::Particle>);
187  std::unique_ptr<std::vector<pat::Particle>> pPartonsLepB(new std::vector<pat::Particle>);
188  std::unique_ptr<std::vector<pat::Particle>> pLeptons(new std::vector<pat::Particle>);
189  std::unique_ptr<std::vector<pat::Particle>> pNeutrinos(new std::vector<pat::Particle>);
190 
191  std::unique_ptr<std::vector<std::vector<int>>> pCombi(new std::vector<std::vector<int>>);
192  std::unique_ptr<std::vector<double>> pChi2(new std::vector<double>);
193  std::unique_ptr<std::vector<double>> pProb(new std::vector<double>);
194  std::unique_ptr<std::vector<int>> pStatus(new std::vector<int>);
195 
196  std::unique_ptr<int> pJetsConsidered(new int);
197 
199  evt.getByToken(jetsToken_, jets);
200 
202  evt.getByToken(metsToken_, mets);
203 
205  evt.getByToken(lepsToken_, leps);
206 
207  const unsigned int nPartons = 4;
208 
209  std::vector<int> match;
210  bool invalidMatch = false;
211  if (useOnlyMatch_) {
212  *pJetsConsidered = nPartons;
214  evt.getByToken(matchToken_, matchHandle);
215  match = *(matchHandle->begin());
216  // check if match is valid
217  if (match.size() != nPartons)
218  invalidMatch = true;
219  else {
220  for (unsigned int idx = 0; idx < match.size(); ++idx) {
221  if (match[idx] < 0 || match[idx] >= (int)jets->size()) {
222  invalidMatch = true;
223  break;
224  }
225  }
226  }
227  }
228 
229  // -----------------------------------------------------
230  // skip events with no appropriate lepton candidate in
231  // or empty MET or less jets than partons or invalid match
232  // -----------------------------------------------------
233 
234  if (leps->empty() || mets->empty() || jets->size() < nPartons || invalidMatch) {
235  // the kinFit getters return empty objects here
236  pPartonsHadP->push_back(fitter->fittedHadP());
237  pPartonsHadQ->push_back(fitter->fittedHadQ());
238  pPartonsHadB->push_back(fitter->fittedHadB());
239  pPartonsLepB->push_back(fitter->fittedLepB());
240  pLeptons->push_back(fitter->fittedLepton());
241  pNeutrinos->push_back(fitter->fittedNeutrino());
242  // indices referring to the jet combination
243  std::vector<int> invalidCombi;
244  for (unsigned int i = 0; i < nPartons; ++i)
245  invalidCombi.push_back(-1);
246  pCombi->push_back(invalidCombi);
247  // chi2
248  pChi2->push_back(-1.);
249  // chi2 probability
250  pProb->push_back(-1.);
251  // status of the fitter
252  pStatus->push_back(-1);
253  // number of jets
254  *pJetsConsidered = jets->size();
255  // feed out all products
256  evt.put(std::move(pCombi));
257  evt.put(std::move(pPartonsHadP), "PartonsHadP");
258  evt.put(std::move(pPartonsHadQ), "PartonsHadQ");
259  evt.put(std::move(pPartonsHadB), "PartonsHadB");
260  evt.put(std::move(pPartonsLepB), "PartonsLepB");
261  evt.put(std::move(pLeptons), "Leptons");
262  evt.put(std::move(pNeutrinos), "Neutrinos");
263  evt.put(std::move(pChi2), "Chi2");
264  evt.put(std::move(pProb), "Prob");
265  evt.put(std::move(pStatus), "Status");
266  evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets");
267  return;
268  }
269 
270  // -----------------------------------------------------
271  // analyze different jet combinations using the KinFitter
272  // (or only a given jet combination if useOnlyMatch=true)
273  // -----------------------------------------------------
274 
275  std::vector<int> jetIndices;
276  if (!useOnlyMatch_) {
277  for (unsigned int i = 0; i < jets->size(); ++i) {
278  if (maxNJets_ >= (int)nPartons && maxNJets_ == (int)i) {
279  *pJetsConsidered = i;
280  break;
281  }
282  jetIndices.push_back(i);
283  }
284  }
285 
286  std::vector<int> combi;
287  for (unsigned int i = 0; i < nPartons; ++i) {
288  if (useOnlyMatch_)
289  combi.push_back(match[i]);
290  else
291  combi.push_back(i);
292  }
293 
294  std::list<KinFitResult> FitResultList;
295 
296  do {
297  for (int cnt = 0; cnt < TMath::Factorial(combi.size()); ++cnt) {
298  // take into account indistinguishability of the two jets from the hadr. W decay,
299  // reduces combinatorics by a factor of 2
302  std::vector<pat::Jet> jetCombi;
303  jetCombi.resize(nPartons);
304  jetCombi[TtSemiLepEvtPartons::LightQ] = (*jets)[combi[TtSemiLepEvtPartons::LightQ]];
306  jetCombi[TtSemiLepEvtPartons::HadB] = (*jets)[combi[TtSemiLepEvtPartons::HadB]];
307  jetCombi[TtSemiLepEvtPartons::LepB] = (*jets)[combi[TtSemiLepEvtPartons::LepB]];
308 
309  // do the kinematic fit
310  const int status = fitter->fit(jetCombi, (*leps)[0], (*mets)[0]);
311 
312  if (status == 0) { // only take into account converged fits
313  KinFitResult result;
314  result.Status = status;
315  result.Chi2 = fitter->fitS();
316  result.Prob = fitter->fitProb();
317  result.HadB = fitter->fittedHadB();
318  result.HadP = fitter->fittedHadP();
319  result.HadQ = fitter->fittedHadQ();
320  result.LepB = fitter->fittedLepB();
321  result.LepL = fitter->fittedLepton();
322  result.LepN = fitter->fittedNeutrino();
323  result.JetCombi = combi;
324 
325  FitResultList.push_back(result);
326  }
327  }
328  if (useOnlyMatch_)
329  break; // don't go through combinatorics if useOnlyMatch was chosen
330  next_permutation(combi.begin(), combi.end());
331  }
332  if (useOnlyMatch_)
333  break; // don't go through combinatorics if useOnlyMatch was chosen
334  } while (stdcomb::next_combination(jetIndices.begin(), jetIndices.end(), combi.begin(), combi.end()));
335 
336  // sort results w.r.t. chi2 values
337  FitResultList.sort();
338 
339  // -----------------------------------------------------
340  // feed out result
341  // starting with the JetComb having the smallest chi2
342  // -----------------------------------------------------
343 
344  if ((unsigned)FitResultList.size() < 1) { // in case no fit results were stored in the list (all fits aborted)
345  pPartonsHadP->push_back(fitter->fittedHadP());
346  pPartonsHadQ->push_back(fitter->fittedHadQ());
347  pPartonsHadB->push_back(fitter->fittedHadB());
348  pPartonsLepB->push_back(fitter->fittedLepB());
349  pLeptons->push_back(fitter->fittedLepton());
350  pNeutrinos->push_back(fitter->fittedNeutrino());
351  // indices referring to the jet combination
352  std::vector<int> invalidCombi;
353  for (unsigned int i = 0; i < nPartons; ++i)
354  invalidCombi.push_back(-1);
355  pCombi->push_back(invalidCombi);
356  // chi2
357  pChi2->push_back(-1.);
358  // chi2 probability
359  pProb->push_back(-1.);
360  // status of the fitter
361  pStatus->push_back(-1);
362  } else {
363  unsigned int iComb = 0;
364  for (typename std::list<KinFitResult>::const_iterator result = FitResultList.begin(); result != FitResultList.end();
365  ++result) {
366  if (maxNComb_ >= 1 && iComb == (unsigned int)maxNComb_)
367  break;
368  iComb++;
369  // partons
370  pPartonsHadP->push_back(result->HadP);
371  pPartonsHadQ->push_back(result->HadQ);
372  pPartonsHadB->push_back(result->HadB);
373  pPartonsLepB->push_back(result->LepB);
374  // lepton
375  pLeptons->push_back(result->LepL);
376  // neutrino
377  pNeutrinos->push_back(result->LepN);
378  // indices referring to the jet combination
379  pCombi->push_back(result->JetCombi);
380  // chi2
381  pChi2->push_back(result->Chi2);
382  // chi2 probability
383  pProb->push_back(result->Prob);
384  // status of the fitter
385  pStatus->push_back(result->Status);
386  }
387  }
388  evt.put(std::move(pCombi));
389  evt.put(std::move(pPartonsHadP), "PartonsHadP");
390  evt.put(std::move(pPartonsHadQ), "PartonsHadQ");
391  evt.put(std::move(pPartonsHadB), "PartonsHadB");
392  evt.put(std::move(pPartonsLepB), "PartonsLepB");
393  evt.put(std::move(pLeptons), "Leptons");
394  evt.put(std::move(pNeutrinos), "Neutrinos");
395  evt.put(std::move(pChi2), "Chi2");
396  evt.put(std::move(pProb), "Prob");
397  evt.put(std::move(pStatus), "Status");
398  evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets");
399 }
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
std::string bTagAlgo_
input tag for b-tagging algorithm
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
static const unsigned int nPartons
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
double minBTagValueBJet_
min value of bTag for a b-jet
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
int maxNJets_
maximal number of jets (-1 possible to indicate &#39;all&#39;)
bool doBTagging(bool &useBTag_, edm::Handle< std::vector< pat::Jet >> &jets, std::vector< int > &combi, std::string &bTagAlgo_, double &minBTagValueBJets_, double &maxBTagValueNonBJets_)
std::unique_ptr< TtSemiLepKinFitter > fitter
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
int maxNComb_
maximal number of combinations to be written to the event
edm::EDGetTokenT< LeptonCollection > lepsToken_
bool useOnlyMatch_
switch to use only a combination given by another hypothesis
bool useBTag_
switch to tell whether to use b-tagging or not
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
bool next_combination(BidIt n_begin, BidIt n_end, BidIt r_begin, BidIt r_end)
Definition: combination.h:19
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ bResolutions_

template<typename LeptonCollection >
std::vector<edm::ParameterSet> TtSemiLepKinFitProducer< LeptonCollection >::bResolutions_
private

◆ bTagAlgo_

template<typename LeptonCollection >
std::string TtSemiLepKinFitProducer< LeptonCollection >::bTagAlgo_
private

input tag for b-tagging algorithm

Definition at line 40 of file TtSemiLepKinFitProducer.cc.

◆ constraints_

template<typename LeptonCollection >
std::vector<unsigned> TtSemiLepKinFitProducer< LeptonCollection >::constraints_
private

◆ fitter

template<typename LeptonCollection >
std::unique_ptr<TtSemiLepKinFitter> TtSemiLepKinFitProducer< LeptonCollection >::fitter
private

◆ jetEnergyResolutionEtaBinning_

template<typename LeptonCollection >
std::vector<double> TtSemiLepKinFitProducer< LeptonCollection >::jetEnergyResolutionEtaBinning_
private

◆ jetEnergyResolutionScaleFactors_

template<typename LeptonCollection >
std::vector<double> TtSemiLepKinFitProducer< LeptonCollection >::jetEnergyResolutionScaleFactors_
private

scale factors for jet energy resolution

Definition at line 66 of file TtSemiLepKinFitProducer.cc.

Referenced by TtSemiLepKinFitProducer< LeptonCollection >::TtSemiLepKinFitProducer().

◆ jetParam_

template<typename LeptonCollection >
unsigned int TtSemiLepKinFitProducer< LeptonCollection >::jetParam_
private

◆ jetsToken_

template<typename LeptonCollection >
edm::EDGetTokenT<std::vector<pat::Jet> > TtSemiLepKinFitProducer< LeptonCollection >::jetsToken_
private

Definition at line 32 of file TtSemiLepKinFitProducer.cc.

◆ lepParam_

template<typename LeptonCollection >
unsigned int TtSemiLepKinFitProducer< LeptonCollection >::lepParam_
private

◆ lepResolutions_

template<typename LeptonCollection >
std::vector<edm::ParameterSet> TtSemiLepKinFitProducer< LeptonCollection >::lepResolutions_
private

◆ lepsToken_

template<typename LeptonCollection >
edm::EDGetTokenT<LeptonCollection> TtSemiLepKinFitProducer< LeptonCollection >::lepsToken_
private

Definition at line 33 of file TtSemiLepKinFitProducer.cc.

◆ matchToken_

template<typename LeptonCollection >
edm::EDGetTokenT<std::vector<std::vector<int> > > TtSemiLepKinFitProducer< LeptonCollection >::matchToken_
private

Definition at line 36 of file TtSemiLepKinFitProducer.cc.

◆ maxBTagValueNonBJet_

template<typename LeptonCollection >
double TtSemiLepKinFitProducer< LeptonCollection >::maxBTagValueNonBJet_
private

max value of bTag for a non-b-jet

Definition at line 44 of file TtSemiLepKinFitProducer.cc.

◆ maxDeltaS_

template<typename LeptonCollection >
double TtSemiLepKinFitProducer< LeptonCollection >::maxDeltaS_
private

maximal chi2 equivalent

Definition at line 55 of file TtSemiLepKinFitProducer.cc.

Referenced by TtSemiLepKinFitProducer< LeptonCollection >::TtSemiLepKinFitProducer().

◆ maxF_

template<typename LeptonCollection >
double TtSemiLepKinFitProducer< LeptonCollection >::maxF_
private

maximal deviation for contstraints

Definition at line 57 of file TtSemiLepKinFitProducer.cc.

Referenced by TtSemiLepKinFitProducer< LeptonCollection >::TtSemiLepKinFitProducer().

◆ maxNComb_

template<typename LeptonCollection >
int TtSemiLepKinFitProducer< LeptonCollection >::maxNComb_
private

maximal number of combinations to be written to the event

Definition at line 50 of file TtSemiLepKinFitProducer.cc.

◆ maxNJets_

template<typename LeptonCollection >
int TtSemiLepKinFitProducer< LeptonCollection >::maxNJets_
private

maximal number of jets (-1 possible to indicate 'all')

Definition at line 48 of file TtSemiLepKinFitProducer.cc.

◆ maxNrIter_

template<typename LeptonCollection >
unsigned int TtSemiLepKinFitProducer< LeptonCollection >::maxNrIter_
private

maximal number of iterations to be performed for the fit

Definition at line 53 of file TtSemiLepKinFitProducer.cc.

Referenced by TtSemiLepKinFitProducer< LeptonCollection >::TtSemiLepKinFitProducer().

◆ metParam_

template<typename LeptonCollection >
unsigned int TtSemiLepKinFitProducer< LeptonCollection >::metParam_
private

◆ metResolutions_

template<typename LeptonCollection >
std::vector<edm::ParameterSet> TtSemiLepKinFitProducer< LeptonCollection >::metResolutions_
private

◆ metsToken_

template<typename LeptonCollection >
edm::EDGetTokenT<std::vector<pat::MET> > TtSemiLepKinFitProducer< LeptonCollection >::metsToken_
private

Definition at line 34 of file TtSemiLepKinFitProducer.cc.

◆ minBTagValueBJet_

template<typename LeptonCollection >
double TtSemiLepKinFitProducer< LeptonCollection >::minBTagValueBJet_
private

min value of bTag for a b-jet

Definition at line 42 of file TtSemiLepKinFitProducer.cc.

◆ mTop_

template<typename LeptonCollection >
double TtSemiLepKinFitProducer< LeptonCollection >::mTop_
private

◆ mW_

template<typename LeptonCollection >
double TtSemiLepKinFitProducer< LeptonCollection >::mW_
private

◆ udscResolutions_

template<typename LeptonCollection >
std::vector<edm::ParameterSet> TtSemiLepKinFitProducer< LeptonCollection >::udscResolutions_
private

config-file-based object resolutions

Definition at line 69 of file TtSemiLepKinFitProducer.cc.

Referenced by TtSemiLepKinFitProducer< LeptonCollection >::TtSemiLepKinFitProducer().

◆ useBTag_

template<typename LeptonCollection >
bool TtSemiLepKinFitProducer< LeptonCollection >::useBTag_
private

switch to tell whether to use b-tagging or not

Definition at line 46 of file TtSemiLepKinFitProducer.cc.

◆ useOnlyMatch_

template<typename LeptonCollection >
bool TtSemiLepKinFitProducer< LeptonCollection >::useOnlyMatch_
private

switch to use only a combination given by another hypothesis

Definition at line 38 of file TtSemiLepKinFitProducer.cc.