47 unique_ptr<std::vector<int>> product_Mothers(
new std::vector<int>);
60 MET =
LorentzVector(genMet->front().px(), genMet->front().py(), 0, genMet->front().pt());
62 product_MET->push_back(
MET);
68 for (GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p) {
72 if (
abs((*p).pdgId()) ==
m_PDG_[
pi] && ((*p).isHardProcess() || (*p).status() == 3)) {
82 product_Mothers->push_back((*p).pdgId());
84 TLorentzVector Boson((*p).px(), (*p).py(), (*p).pz(), (*p).energy());
91 for (GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p, ++
index) {
102 if (daugTaus.
empty())
103 allTaus.push_back(genRef);
114 if (!decayProducts.
empty()) {
119 int numElectrons = 0;
121 int numChargedPions = 0;
122 int numNeutralPions = 0;
124 int numNeutrinos = 0;
125 int numOtherParticles = 0;
131 else if (pdg_id == 13)
133 else if (pdg_id == 211 || pdg_id == 321)
135 else if (pdg_id == 111 || pdg_id == 130 || pdg_id == 310)
137 else if (pdg_id == 12 || pdg_id == 14 || pdg_id == 16) {
140 Neutrino.SetPxPyPzE((*pit)->px(), (*pit)->py(), (*pit)->pz(), (*pit)->energy());
142 }
else if (pdg_id == 22)
148 if (pdg_id != 12 && pdg_id != 14 && pdg_id != 16) {
149 TauDecayProduct.SetPxPyPzE((*pit)->px(), (*pit)->py(), (*pit)->pz(), (*pit)->energy());
150 Visible_Taus += TauDecayProduct;
157 int tauDecayMode =
kOther;
159 if (numOtherParticles == 0) {
160 if (numElectrons == 1) {
163 }
else if (numMuons == 1) {
165 tauDecayMode =
kMuon;
168 switch (numChargedPions) {
170 if (numNeutralPions != 0) {
174 switch (numPhotons) {
190 if (numNeutralPions != 0) {
194 switch (numPhotons) {
212 if ((Visible_Taus.eta() >
etaMin && Visible_Taus.eta() <
etaMax && Visible_Taus.phi() >
phiMin &&
213 Visible_Taus.phi() <
phiMax) &&
215 product_Electrons->push_back(Visible_Taus);
216 product_Leptons->push_back(Visible_Taus);
218 }
else if (tauDecayMode ==
kMuon) {
219 if ((Visible_Taus.eta() >
etaMin && Visible_Taus.eta() <
etaMax && Visible_Taus.phi() >
phiMin &&
220 Visible_Taus.phi() <
phiMax) &&
222 product_Muons->push_back(Visible_Taus);
223 product_Leptons->push_back(Visible_Taus);
226 if ((Visible_Taus.eta() >
etaMin && Visible_Taus.eta() <
etaMax && Visible_Taus.phi() >
phiMin &&
227 Visible_Taus.phi() <
phiMax) &&
229 product_OneProng->push_back(Visible_Taus);
230 product_OneAndThreeProng->push_back(Visible_Taus);
231 product_Neutrina->push_back(Neutrino);
234 if ((Visible_Taus.eta() >
etaMin && Visible_Taus.eta() <
etaMax && Visible_Taus.phi() >
phiMin &&
235 Visible_Taus.phi() <
phiMax) &&
237 product_ThreeProng->push_back(Visible_Taus);
238 product_OneAndThreeProng->push_back(Visible_Taus);
239 product_Neutrina->push_back(Neutrino);
241 }
else if (tauDecayMode ==
kOther) {
242 if ((Visible_Taus.eta() >
etaMin && Visible_Taus.eta() <
etaMax && Visible_Taus.phi() >
phiMin &&
243 Visible_Taus.phi() <
phiMax) &&
245 product_Other->push_back(Visible_Taus);
251 iEvent.
put(
std::move(product_Leptons),
"LeptonicTauLeptons");
252 iEvent.
put(
std::move(product_Electrons),
"LeptonicTauElectrons");
253 iEvent.
put(
std::move(product_Muons),
"LeptonicTauMuons");
254 iEvent.
put(
std::move(product_OneProng),
"HadronicTauOneProng");
255 iEvent.
put(
std::move(product_ThreeProng),
"HadronicTauThreeProng");
256 iEvent.
put(
std::move(product_OneAndThreeProng),
"HadronicTauOneAndThreeProng");
int pdgId() const final
PDG identifier.
edm::EDGetTokenT< reco::GenMETCollection > MCMET_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< int > m_PDG_
edm::EDGetTokenT< reco::GenParticleCollection > MC_
const_iterator end() const
Termination of iteration.
bool empty() const
Is the RefVector empty.
const_iterator begin() const
Initialize an iterator over the RefVector.
void getGenDecayProducts(const reco::GenParticleRef &, reco::GenParticleRefVector &, int status=1, int pdgId=0)
Abs< T >::type abs(const T &t)
math::XYZTLorentzVector LorentzVector
std::vector< LorentzVector > LorentzVectorCollection
bool isPromptDecayed() const
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
math::PtEtaPhiELorentzVectorF LorentzVector