4 #include <boost/regex.hpp>
6 #include "Kappa/DataFormats/interface/Kappa.h"
8 #include "Artus/Core/interface/ProducerBase.h"
9 #include "Artus/Consumer/interface/LambdaNtupleConsumer.h"
10 #include "Artus/Utility/interface/Utility.h"
12 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
19 template<
class TGenLepton1,
class TGenLepton2>
25 std::vector<TGenLepton2*> product_type::*genLeptonsMember2) :
27 m_genLeptonsMember1(genLeptonsMember1),
28 m_genLeptonsMember2(genLeptonsMember2)
32 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override
34 ProducerBase<HttTypes>::Init(settings, metadata);
37 LambdaNtupleConsumer<HttTypes>::AddIntQuantity(metadata,
"nGenDiTauPairCandidates", [](event_type
const& event, product_type
const& product)
39 return static_cast<int>(product.m_genDiTauPairCandidates.size());
43 virtual void Produce(event_type
const& event, product_type & product,
44 setting_type
const& settings, metadata_type
const& metadata)
const override
46 product.m_genDiTauPairCandidates.clear();
49 for (
typename std::vector<TGenLepton1*>::iterator lepton1 = (product.*m_genLeptonsMember1).begin();
50 lepton1 != (product.*m_genLeptonsMember1).end(); ++lepton1)
52 for (
typename std::vector<TGenLepton2*>::iterator lepton2 = (product.*m_genLeptonsMember2).begin();
53 lepton2 != (product.*m_genLeptonsMember2).end(); ++lepton2)
58 bool pairInVector =
false;
59 for (std::vector<DiGenTauPair>::iterator pair = product.m_genDiTauPairCandidates.begin();
60 pair != product.m_genDiTauPairCandidates.end() && !pairInVector; ++pair)
62 if ((diGenTauPair.first->p4 == (*pair).second->p4) && (diGenTauPair.second->p4 == (*pair).first->p4))
65 if ((diGenTauPair.
GetDeltaR() > 0) && !pairInVector)
67 product.m_genDiTauPairCandidates.push_back(diGenTauPair);
74 std::vector<TGenLepton1*> product_type::*m_genLeptonsMember1;
75 std::vector<TGenLepton2*> product_type::*m_genLeptonsMember2;
virtual std::string GetProducerId() const override
Definition: GenDiTauPairCandidatesProducers.cc:27
Definition: GenDiTauPairCandidatesProducers.h:94
Definition: DiGenTauPair.h:7
GenTTPairCandidatesProducer()
Definition: GenDiTauPairCandidatesProducers.cc:5
GenMMPairCandidatesProducer()
Definition: GenDiTauPairCandidatesProducers.cc:61
GenEMPairCandidatesProducer()
Definition: GenDiTauPairCandidatesProducers.cc:47
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: GenDiTauPairCandidatesProducers.h:43
virtual std::string GetProducerId() const override
Definition: GenDiTauPairCandidatesProducers.cc:13
Definition: GenDiTauPairCandidatesProducers.h:115
virtual std::string GetProducerId() const override
Definition: GenDiTauPairCandidatesProducers.cc:69
Definition: GenDiTauPairCandidatesProducers.h:108
GenETPairCandidatesProducer()
Definition: GenDiTauPairCandidatesProducers.cc:33
virtual std::string GetProducerId() const override
Definition: GenDiTauPairCandidatesProducers.cc:55
GenEEPairCandidatesProducer()
Definition: GenDiTauPairCandidatesProducers.cc:75
Definition: GenDiTauPairCandidatesProducers.h:80
Definition: GenDiTauPairCandidatesProducers.h:87
virtual std::string GetProducerId() const override
Definition: GenDiTauPairCandidatesProducers.cc:83
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: GenDiTauPairCandidatesProducers.h:32
GenMTPairCandidatesProducer()
Definition: GenDiTauPairCandidatesProducers.cc:19
virtual std::string GetProducerId() const override
Definition: GenDiTauPairCandidatesProducers.cc:41
all data types which are used for Htt analyses
Definition: HttTypes.h:27
Definition: GenDiTauPairCandidatesProducers.h:101
double GetDeltaR()
Definition: DiGenTauPair.cc:14
Producers for generator-level di-tau pairs candidates.
Definition: GenDiTauPairCandidatesProducers.h:20
GenDiTauPairCandidatesProducerBase(std::vector< TGenLepton1 * > product_type::*genLeptonsMember1, std::vector< TGenLepton2 * > product_type::*genLeptonsMember2)
Definition: GenDiTauPairCandidatesProducers.h:24