48 auto_ptr<std::vector<int> > product_Mothers(
new std::vector<int>);
53 if(!genParticles.
isValid())
return;
67 product_MET->push_back(
MET);
73 for(GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p) {
78 if(
abs((*p).pdgId())==
m_PDG_[
pi] && ( (*p).isHardProcess() || (*p).status() == 3 ) ){
88 product_Mothers->push_back((*p).pdgId());
90 TLorentzVector Boson((*p).px(),(*p).py(),(*p).pz(),(*p).energy());
97 for(GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p, ++
index) {
107 if( daugTaus.
size()==0 )
119 if( !decayProducts.
empty() ) {
125 int numElectrons = 0;
127 int numChargedPions = 0;
128 int numNeutralPions = 0;
130 int numNeutrinos = 0;
131 int numOtherParticles = 0;
134 int pdg_id =
abs((*pit)->pdgId());
135 if (pdg_id == 11) numElectrons++;
136 else if (pdg_id == 13) numMuons++;
137 else if (pdg_id == 211 || pdg_id == 321 ) numChargedPions++;
138 else if (pdg_id == 111 || pdg_id == 130 || pdg_id == 310) numNeutralPions++;
139 else if (pdg_id == 12 ||
144 Neutrino.SetPxPyPzE((*pit)->px(),(*pit)->py(),(*pit)->pz(),(*pit)->energy());
147 else if (pdg_id == 22) numPhotons++;
155 TauDecayProduct.SetPxPyPzE((*pit)->px(),(*pit)->py(),(*pit)->pz(),(*pit)->energy());
156 Visible_Taus+=TauDecayProduct;
161 int tauDecayMode =
kOther;
163 if ( numOtherParticles == 0 ){
164 if ( numElectrons == 1 ){
167 }
else if ( numMuons == 1 ){
169 tauDecayMode =
kMuon;
172 switch ( numChargedPions ){
174 if( numNeutralPions !=0 ){
178 switch ( numPhotons ){
194 if( numNeutralPions !=0 ){
198 switch ( numPhotons ){
218 product_Electrons->push_back(Visible_Taus);
219 product_Leptons->push_back(Visible_Taus);
222 else if (tauDecayMode ==
kMuon)
225 product_Muons->push_back(Visible_Taus);
226 product_Leptons->push_back(Visible_Taus);
234 product_OneProng->push_back(Visible_Taus);
235 product_OneAndThreeProng->push_back(Visible_Taus);
236 product_Neutrina->push_back(Neutrino);
243 product_ThreeProng->push_back(Visible_Taus);
244 product_OneAndThreeProng->push_back(Visible_Taus);
245 product_Neutrina->push_back(Neutrino);
248 else if (tauDecayMode ==
kOther)
251 product_Other->push_back(Visible_Taus);
257 iEvent.
put(product_Leptons,
"LeptonicTauLeptons");
258 iEvent.
put(product_Electrons,
"LeptonicTauElectrons");
259 iEvent.
put(product_Muons,
"LeptonicTauMuons");
260 iEvent.
put(product_OneProng,
"HadronicTauOneProng");
261 iEvent.
put(product_ThreeProng,
"HadronicTauThreeProng");
262 iEvent.
put(product_OneAndThreeProng,
"HadronicTauOneAndThreeProng");
263 iEvent.
put(product_Other,
"TauOther");
264 iEvent.
put(product_Neutrina,
"Neutrina");
265 iEvent.
put(product_MET,
"MET");
266 iEvent.
put(product_Mothers,
"Mothers");
virtual int pdgId() const
PDG identifier.
edm::EDGetTokenT< reco::GenMETCollection > MCMET_
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)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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.)
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
math::PtEtaPhiELorentzVectorF LorentzVector