51 unique_ptr<std::vector<int> > product_Mothers(
new std::vector<int>);
56 if(!genParticles.
isValid())
return;
70 product_MET->push_back(
MET);
76 for(GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p) {
81 if(
abs((*p).pdgId())==
m_PDG_[
pi] && ( (*p).isHardProcess() || (*p).status() == 3 ) ){
91 product_Mothers->push_back((*p).pdgId());
93 TLorentzVector Boson((*p).px(),(*p).py(),(*p).pz(),(*p).energy());
100 for(GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p, ++
index) {
110 if( daugTaus.
size()==0 )
111 allTaus.push_back(genRef);
122 if( !decayProducts.
empty() ) {
128 int numElectrons = 0;
130 int numChargedPions = 0;
131 int numNeutralPions = 0;
133 int numNeutrinos = 0;
134 int numOtherParticles = 0;
138 if (pdg_id == 11) numElectrons++;
139 else if (pdg_id == 13) numMuons++;
140 else if (pdg_id == 211 || pdg_id == 321 ) numChargedPions++;
141 else if (pdg_id == 111 || pdg_id == 130 || pdg_id == 310) numNeutralPions++;
142 else if (pdg_id == 12 ||
147 Neutrino.SetPxPyPzE((*pit)->px(),(*pit)->py(),(*pit)->pz(),(*pit)->energy());
150 else if (pdg_id == 22) numPhotons++;
158 TauDecayProduct.SetPxPyPzE((*pit)->px(),(*pit)->py(),(*pit)->pz(),(*pit)->energy());
159 Visible_Taus+=TauDecayProduct;
164 int tauDecayMode =
kOther;
166 if ( numOtherParticles == 0 ){
167 if ( numElectrons == 1 ){
170 }
else if ( numMuons == 1 ){
172 tauDecayMode =
kMuon;
175 switch ( numChargedPions ){
177 if( numNeutralPions !=0 ){
181 switch ( numPhotons ){
197 if( numNeutralPions !=0 ){
201 switch ( numPhotons ){
221 product_Electrons->push_back(Visible_Taus);
222 product_Leptons->push_back(Visible_Taus);
225 else if (tauDecayMode ==
kMuon)
228 product_Muons->push_back(Visible_Taus);
229 product_Leptons->push_back(Visible_Taus);
237 product_OneProng->push_back(Visible_Taus);
238 product_OneAndThreeProng->push_back(Visible_Taus);
239 product_Neutrina->push_back(Neutrino);
246 product_ThreeProng->push_back(Visible_Taus);
247 product_OneAndThreeProng->push_back(Visible_Taus);
248 product_Neutrina->push_back(Neutrino);
251 else if (tauDecayMode ==
kOther)
254 product_Other->push_back(Visible_Taus);
260 iEvent.
put(
std::move(product_Leptons),
"LeptonicTauLeptons");
261 iEvent.
put(
std::move(product_Electrons),
"LeptonicTauElectrons");
262 iEvent.
put(
std::move(product_Muons),
"LeptonicTauMuons");
263 iEvent.
put(
std::move(product_OneProng),
"HadronicTauOneProng");
264 iEvent.
put(
std::move(product_ThreeProng),
"HadronicTauThreeProng");
265 iEvent.
put(
std::move(product_OneAndThreeProng),
"HadronicTauOneAndThreeProng");
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_
math::XYZTLorentzVector LorentzVector
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)
virtual int pdgId() const final
PDG identifier.
Abs< T >::type abs(const T &t)
std::vector< LorentzVector > LorentzVectorCollection
bool isPromptDecayed() const
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
size_type size() const
Size of the RefVector.
math::PtEtaPhiELorentzVectorF LorentzVector