3 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
5 #include <boost/algorithm/string.hpp>
6 #include <boost/algorithm/string/trim.hpp>
12 return "TagAndProbeMuonPairProducer";
49 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override;
51 virtual void Produce(event_type
const& event, product_type& product,
52 setting_type
const& settings, metadata_type
const& metadata)
const override;
57 float (setting_type::*GetMuonDeltaBetaCorrectionFactor)(void)
const;
58 bool MuonIDshortTerm =
false;
59 bool IsMediumMuon2016ShortTerm(KMuon* muon, event_type
const& event, product_type& product)
const;
60 bool IsMediumMuon2016(KMuon* muon, event_type
const& event, product_type& product)
const;
67 return "TagAndProbeElectronPairProducer";
118 LOG(FATAL) <<
"Could not find ElectronID " << electronID <<
"! If you want the ValidElectronsProducer to use no special ID, use \"none\" as argument."<< std::endl;
122 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override;
124 virtual void Produce(event_type
const& event, product_type& product,
125 setting_type
const& settings, metadata_type
const& metadata)
const override;
130 std::string electronIDName;
131 double electronMvaIDCutEB1;
132 double electronMvaIDCutEB2;
133 double electronMvaIDCutEE;
134 bool IsMVABased(KElectron* electron, event_type
const& event,
const std::string &idName)
const;
289 return "TagAndProbeGenElectronProducer";
306 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override
308 ProducerBase<HttTypes>::Init(settings, metadata);
309 validElectronsInput =
ToValidElectronsInput(boost::algorithm::to_lower_copy(boost::algorithm::trim_copy(settings.GetValidElectronsInput())));
312 virtual void Produce(event_type
const& event, product_type& product,
313 setting_type
const& settings, metadata_type
const& metadata)
const override
315 assert(event.m_electrons);
316 bool IsData = settings.GetInputIsData();
319 std::vector<KElectron*> electrons;
322 electrons.resize(product.m_correctedElectrons.size());
323 size_t electronIndex = 0;
324 for (std::vector<std::shared_ptr<KElectron> >::iterator electron = product.m_correctedElectrons.begin();
325 electron != product.m_correctedElectrons.end(); ++electron)
327 electrons[electronIndex] = electron->get();
333 electrons.resize(event.m_electrons->size());
334 size_t electronIndex = 0;
335 for (KElectrons::iterator electron = event.m_electrons->begin(); electron !=
event.m_electrons->end(); ++electron)
337 electrons[electronIndex] = &(*electron);
342 for (
typename std::vector<KElectron*>::iterator electron = electrons.begin(); electron != electrons.end(); ++electron)
344 product.m_validElectrons.push_back(*electron);
348 (*electron)->p4.Pt() > 10.0 &&
349 std::abs((*electron)->p4.Eta()) < 2.5
351 product.m_TagAndProbeGenElectrons.push_back(*electron);
364 return "TagAndProbeGenMuonProducer";
381 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override
383 ProducerBase<HttTypes>::Init(settings, metadata);
384 validMuonsInput =
ToValidMuonsInput(boost::algorithm::to_lower_copy(boost::algorithm::trim_copy(settings.GetValidMuonsInput())));
387 virtual void Produce(event_type
const& event, product_type& product,
388 setting_type
const& settings, metadata_type
const& metadata)
const override
390 assert(event.m_muons);
391 bool IsData = settings.GetInputIsData();
394 std::vector<KMuon*> muons;
397 muons.resize(product.m_correctedMuons.size());
398 size_t muonIndex = 0;
399 for (std::vector<std::shared_ptr<KMuon> >::iterator muon = product.m_correctedMuons.begin();
400 muon != product.m_correctedMuons.end(); ++muon)
402 muons[muonIndex] = muon->get();
408 muons.resize(event.m_muons->size());
409 size_t muonIndex = 0;
410 for (KMuons::iterator muon = event.m_muons->begin(); muon !=
event.m_muons->end(); ++muon)
412 muons[muonIndex] = &(*muon);
417 for (
typename std::vector<KMuon*>::iterator muon = muons.begin(); muon != muons.end(); ++muon)
419 product.m_validMuons.push_back(*muon);
423 (*muon)->p4.Pt() > 10.0 &&
424 std::abs((*muon)->p4.Eta()) < 2.5
426 product.m_TagAndProbeGenMuons.push_back(*muon);
439 return "TagAndProbeGenTauProducer";
456 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override
458 ProducerBase<HttTypes>::Init(settings, metadata);
459 validTausInput =
ToValidTausInput(boost::algorithm::to_lower_copy(boost::algorithm::trim_copy(settings.GetValidTausInput())));
462 virtual void Produce(event_type
const& event, product_type& product,
463 setting_type
const& settings, metadata_type
const& metadata)
const override
465 assert(event.m_taus);
466 bool IsData = settings.GetInputIsData();
469 std::vector<KTau*> taus;
472 taus.resize(product.m_correctedTaus.size());
474 for (std::vector<std::shared_ptr<KTau> >::iterator tau = product.m_correctedTaus.begin();
475 tau != product.m_correctedTaus.end(); ++tau)
477 taus[tauIndex] = tau->get();
483 taus.resize(event.m_taus->size());
485 for (KTaus::iterator tau = event.m_taus->begin(); tau !=
event.m_taus->end(); ++tau)
487 taus[tauIndex] = &(*tau);
492 for (
typename std::vector<KTau*>::iterator tau = taus.begin(); tau != taus.end(); ++tau)
494 product.m_validTaus.push_back(*tau);
498 (*tau)->p4.Pt() > 10.0 &&
499 std::abs((*tau)->p4.Eta()) < 2.5
501 product.m_TagAndProbeGenTaus.push_back(*tau);
Definition: TagAndProbePairProducer.h:435
Definition: TagAndProbePairProducer.h:285
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: TagAndProbePairProducer.h:312
ValidMuonsInput
Definition: TagAndProbePairProducer.h:15
Definition: TagAndProbePairProducer.h:63
virtual std::string GetProducerId() const override
Definition: TagAndProbePairProducer.h:363
static MuonID ToMuonID(std::string const &muonID)
Definition: TagAndProbePairProducer.h:38
ValidElectronsInput ToValidElectronsInput(std::string const &validElectronsInput)
Definition: TagAndProbePairProducer.h:299
virtual std::string GetProducerId() const override
Definition: TagAndProbePairProducer.h:438
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: TagAndProbePairProducer.h:306
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: TagAndProbePairProducer.h:462
virtual std::string GetProducerId() const override
Definition: TagAndProbePairProducer.h:11
static ValidMuonsInput ToValidMuonsInput(std::string const &validMuonsInput)
Definition: TagAndProbePairProducer.h:21
ValidTausInput
Definition: TagAndProbePairProducer.h:442
Definition: TagAndProbePairProducer.h:360
ValidElectronsInput
Definition: TagAndProbePairProducer.h:70
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: TagAndProbePairProducer.cc:502
static ElectronID ToElectronID(std::string const &electronID)
Definition: TagAndProbePairProducer.h:101
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: TagAndProbePairProducer.cc:492
Definition: TagAndProbePairProducer.h:8
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: TagAndProbePairProducer.h:381
MuonID
Definition: TagAndProbePairProducer.h:28
virtual std::string GetProducerId() const override
Definition: TagAndProbePairProducer.h:288
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: TagAndProbePairProducer.cc:11
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: TagAndProbePairProducer.h:456
static ValidElectronsInput ToValidElectronsInput(std::string const &validElectronsInput)
Definition: TagAndProbePairProducer.h:76
ValidMuonsInput
Definition: TagAndProbePairProducer.h:367
MuonID muonID
Definition: TagAndProbePairProducer.h:54
ValidTausInput ToValidTausInput(std::string const &validTausInput)
Definition: TagAndProbePairProducer.h:449
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: TagAndProbePairProducer.cc:390
virtual std::string GetProducerId() const override
Definition: TagAndProbePairProducer.h:66
ValidMuonsInput ToValidMuonsInput(std::string const &validMuonsInput)
Definition: TagAndProbePairProducer.h:374
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: TagAndProbePairProducer.h:387
ValidElectronsInput
Definition: TagAndProbePairProducer.h:292
ElectronID
Definition: TagAndProbePairProducer.h:83
ElectronID electronID
Definition: TagAndProbePairProducer.h:127