45 auto_ptr<std::vector<int> > product_Mothers(
new std::vector<int>);
50 GenParticleCollection::const_iterator
p = genParticles->begin();
52 for (;p != genParticles->end(); ++
p ) {
66 product_Mothers->push_back((*p).pdgId());
68 std::vector<GenParticle*> decayProducts;
70 TLorentzVector Boson((*p).px(),(*p).py(),(*p).pz(),(*p).energy());
72 for (GenParticle::const_iterator BosonIt=(*p).begin(); BosonIt != (*p).end(); BosonIt++){
75 if (
abs((*BosonIt).pdgId()) == 15 && ((*BosonIt).status()==3))
77 decayProducts.
clear();
79 for (GenParticle::const_iterator TauIt = (*BosonIt).begin(); TauIt != (*BosonIt).end(); TauIt++) {
82 if (
abs((*TauIt).pdgId()) == 15 && ((*TauIt).status()==2))
92 if ( !decayProducts.empty() )
101 int numChargedPions = 0;
102 int numNeutralPions = 0;
103 int numNeutrinos = 0;
104 int numOtherParticles = 0;
107 for (std::vector<GenParticle*>::iterator pit = decayProducts.begin(); pit != decayProducts.end(); pit++)
109 int pdg_id =
abs((*pit)->pdgId());
110 if (pdg_id == 11) numElectrons++;
111 else if (pdg_id == 13) numMuons++;
112 else if (pdg_id == 211) numChargedPions++;
113 else if (pdg_id == 111) numNeutralPions++;
114 else if (pdg_id == 12 ||
119 Neutrino.SetPxPyPzE((*pit)->px(),(*pit)->py(),(*pit)->pz(),(*pit)->energy());
122 else if (pdg_id != 22) {
129 TauDecayProduct.SetPxPyPzE((*pit)->px(),(*pit)->py(),(*pit)->pz(),(*pit)->energy());
130 Visible_Taus+=TauDecayProduct;
135 int tauDecayMode =
kOther;
137 if ( numOtherParticles == 0 ){
138 if ( numElectrons == 1 ){
141 }
else if ( numMuons == 1 ){
143 tauDecayMode =
kMuon;
146 switch ( numChargedPions ){
148 switch ( numNeutralPions ){
161 switch ( numNeutralPions ){
180 product_Electrons->push_back(Visible_Taus);
181 product_Leptons->push_back(Visible_Taus);
184 else if (tauDecayMode ==
kMuon)
188 product_Muons->push_back(Visible_Taus);
189 product_Leptons->push_back(Visible_Taus);
197 product_OneProng->push_back(Visible_Taus);
198 product_OneAndThreeProng->push_back(Visible_Taus);
199 product_Neutrina->push_back(Neutrino);
206 product_ThreeProng->push_back(Visible_Taus);
207 product_OneAndThreeProng->push_back(Visible_Taus);
208 product_Neutrina->push_back(Neutrino);
211 else if (tauDecayMode ==
kOther)
214 product_Other->push_back(Visible_Taus);
223 iEvent.
put(product_Leptons,
"LeptonicTauLeptons");
224 iEvent.
put(product_Electrons,
"LeptonicTauElectrons");
225 iEvent.
put(product_Muons,
"LeptonicTauMuons");
226 iEvent.
put(product_OneProng,
"HadronicTauOneProng");
227 iEvent.
put(product_ThreeProng,
"HadronicTauThreeProng");
228 iEvent.
put(product_OneAndThreeProng,
"HadronicTauOneAndThreeProng");
229 iEvent.
put(product_Other,
"TauOther");
230 iEvent.
put(product_Neutrina,
"Neutrina");
231 iEvent.
put(product_Mothers,
"Mothers");
std::vector< reco::GenParticle * > getGenStableDecayProducts(const reco::GenParticle *particle)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< int > m_PDG_
edm::EDGetTokenT< reco::GenParticleCollection > MC_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Abs< T >::type abs(const T &t)
std::vector< LorentzVector > LorentzVectorCollection
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector