9 MCMET_{consumes<GenMETCollection>(mc.getUntrackedParameter<
edm::InputTag>(
"GenMET"))},
10 ptMinMCTau_{mc.getUntrackedParameter<
double>(
"ptMinTau", 5.)},
11 ptMinMCElectron_{mc.getUntrackedParameter<
double>(
"ptMinElectron", 5.)},
12 ptMinMCMuon_{mc.getUntrackedParameter<
double>(
"ptMinMuon", 2.)},
13 m_PDG_{mc.getUntrackedParameter<std::vector<int>>(
"BosonID")},
14 etaMin_{mc.getUntrackedParameter<
double>(
"EtaMin", -2.5)},
15 etaMax_{mc.getUntrackedParameter<
double>(
"EtaMax", 2.5)},
16 phiMin_{mc.getUntrackedParameter<
double>(
"PhiMin", -3.15)},
17 phiMax_{mc.getUntrackedParameter<
double>(
"PhiMax", 3.15)} {
20 produces<LorentzVectorCollection>(
"LeptonicTauLeptons");
21 produces<LorentzVectorCollection>(
"LeptonicTauElectrons");
22 produces<LorentzVectorCollection>(
"LeptonicTauMuons");
23 produces<LorentzVectorCollection>(
"HadronicTauOneProng");
24 produces<LorentzVectorCollection>(
"HadronicTauThreeProng");
25 produces<LorentzVectorCollection>(
"HadronicTauOneAndThreeProng");
26 produces<LorentzVectorCollection>(
"TauOther");
27 produces<LorentzVectorCollection>(
"Neutrina");
28 produces<LorentzVectorCollection>(
"MET");
29 produces<std::vector<int>>(
"Mothers");
44 unique_ptr<std::vector<int>> product_Mothers(
new std::vector<int>);
57 MET =
LorentzVector(genMet->front().px(), genMet->front().py(), 0, genMet->front().pt());
59 product_MET->push_back(MET);
65 for (GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p) {
69 if (
abs((*p).pdgId()) ==
m_PDG_[
pi] && ((*p).isHardProcess() || (*p).status() == 3)) {
79 product_Mothers->push_back((*p).pdgId());
81 TLorentzVector Boson((*p).px(), (*p).py(), (*p).pz(), (*p).energy());
88 for (GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p, ++
index) {
111 if (!decayProducts.
empty()) {
116 int numElectrons = 0;
118 int numChargedPions = 0;
119 int numNeutralPions = 0;
121 int numNeutrinos = 0;
122 int numOtherParticles = 0;
125 int pdg_id =
abs((*pit)->pdgId());
128 else if (pdg_id == 13)
130 else if (pdg_id == 211 || pdg_id == 321)
132 else if (pdg_id == 111 || pdg_id == 130 || pdg_id == 310)
134 else if (pdg_id == 12 || pdg_id == 14 || pdg_id == 16) {
137 Neutrino.SetPxPyPzE((*pit)->px(), (*pit)->py(), (*pit)->pz(), (*pit)->energy());
139 }
else if (pdg_id == 22)
145 if (pdg_id != 12 && pdg_id != 14 && pdg_id != 16) {
146 TauDecayProduct.SetPxPyPzE((*pit)->px(), (*pit)->py(), (*pit)->pz(), (*pit)->energy());
147 Visible_Taus += TauDecayProduct;
154 int tauDecayMode =
kOther;
156 if (numOtherParticles == 0) {
157 if (numElectrons == 1) {
160 }
else if (numMuons == 1) {
162 tauDecayMode =
kMuon;
165 switch (numChargedPions) {
167 if (numNeutralPions != 0) {
171 switch (numPhotons) {
187 if (numNeutralPions != 0) {
191 switch (numPhotons) {
210 Visible_Taus.phi() <
phiMax_) &&
212 product_Electrons->push_back(Visible_Taus);
213 product_Leptons->push_back(Visible_Taus);
215 }
else if (tauDecayMode ==
kMuon) {
217 Visible_Taus.phi() <
phiMax_) &&
219 product_Muons->push_back(Visible_Taus);
220 product_Leptons->push_back(Visible_Taus);
224 Visible_Taus.phi() <
phiMax_) &&
226 product_OneProng->push_back(Visible_Taus);
227 product_OneAndThreeProng->push_back(Visible_Taus);
228 product_Neutrina->push_back(Neutrino);
232 Visible_Taus.phi() <
phiMax_) &&
234 product_ThreeProng->push_back(Visible_Taus);
235 product_OneAndThreeProng->push_back(Visible_Taus);
236 product_Neutrina->push_back(Neutrino);
238 }
else if (tauDecayMode ==
kOther) {
240 Visible_Taus.phi() <
phiMax_) &&
242 product_Other->push_back(Visible_Taus);
248 iEvent.
put(
std::move(product_Leptons),
"LeptonicTauLeptons");
249 iEvent.
put(
std::move(product_Electrons),
"LeptonicTauElectrons");
250 iEvent.
put(
std::move(product_Muons),
"LeptonicTauMuons");
251 iEvent.
put(
std::move(product_OneProng),
"HadronicTauOneProng");
252 iEvent.
put(
std::move(product_ThreeProng),
"HadronicTauThreeProng");
253 iEvent.
put(
std::move(product_OneAndThreeProng),
"HadronicTauOneAndThreeProng");
269 if ((status == 0 || (*d)->status() ==
status) && (pdgId == 0 ||
std::abs((*d)->pdgId()) == pdgId)) {
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::GenMETCollection > MCMET_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const_iterator end() const
Termination of iteration.
etaMax_(conf.getParameter< double >("etaMax"))
bool empty() const
Is the RefVector empty.
const double ptMinMCElectron_
const_iterator begin() const
Initialize an iterator over the RefVector.
ESProducts< std::remove_reference_t< TArgs >...> products(TArgs &&...args)
int pdgId() const final
PDG identifier.
HLTTauMCProducer(const edm::ParameterSet &)
const double ptMinMCMuon_
Abs< T >::type abs(const T &t)
math::XYZTLorentzVector LorentzVector
std::vector< LorentzVector > LorentzVectorCollection
bool isPromptDecayed() const
const edm::EDGetTokenT< reco::GenParticleCollection > MC_
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
void getGenDecayProducts(const reco::GenParticleRef &, reco::GenParticleRefVector &, int status=1, int pdgId=0) const
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
etaMin_(conf.getParameter< double >("etaMin"))
math::PtEtaPhiELorentzVectorF LorentzVector
const std::vector< int > m_PDG_