45 auto_ptr<std::vector<int> > product_Mothers(
new std::vector<int>);
54 for(GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p) {
59 if(
abs((*p).pdgId())==
m_PDG_[
pi] && ( (*p).isHardProcess() || (*p).status() == 3 ) ){
69 product_Mothers->push_back((*p).pdgId());
71 TLorentzVector Boson((*p).px(),(*p).py(),(*p).pz(),(*p).energy());
78 for(GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p, ++
index) {
89 if( daugTaus.
size()==0 )
101 if( !decayProducts.
empty() ) {
107 int numElectrons = 0;
109 int numChargedPions = 0;
110 int numNeutralPions = 0;
112 int numNeutrinos = 0;
113 int numOtherParticles = 0;
116 int pdg_id =
abs((*pit)->pdgId());
117 if (pdg_id == 11) numElectrons++;
118 else if (pdg_id == 13) numMuons++;
119 else if (pdg_id == 211 || pdg_id == 321 ) numChargedPions++;
120 else if (pdg_id == 111 || pdg_id == 130 || pdg_id == 310) numNeutralPions++;
121 else if (pdg_id == 12 ||
126 Neutrino.SetPxPyPzE((*pit)->px(),(*pit)->py(),(*pit)->pz(),(*pit)->energy());
129 else if (pdg_id == 22) numPhotons++;
137 TauDecayProduct.SetPxPyPzE((*pit)->px(),(*pit)->py(),(*pit)->pz(),(*pit)->energy());
138 Visible_Taus+=TauDecayProduct;
143 int tauDecayMode =
kOther;
145 if ( numOtherParticles == 0 ){
146 if ( numElectrons == 1 ){
149 }
else if ( numMuons == 1 ){
151 tauDecayMode =
kMuon;
154 switch ( numChargedPions ){
156 if( numNeutralPions !=0 ){
160 switch ( numPhotons ){
176 if( numNeutralPions !=0 ){
180 switch ( numPhotons ){
200 product_Electrons->push_back(Visible_Taus);
201 product_Leptons->push_back(Visible_Taus);
204 else if (tauDecayMode ==
kMuon)
207 product_Muons->push_back(Visible_Taus);
208 product_Leptons->push_back(Visible_Taus);
216 product_OneProng->push_back(Visible_Taus);
217 product_OneAndThreeProng->push_back(Visible_Taus);
218 product_Neutrina->push_back(Neutrino);
225 product_ThreeProng->push_back(Visible_Taus);
226 product_OneAndThreeProng->push_back(Visible_Taus);
227 product_Neutrina->push_back(Neutrino);
230 else if (tauDecayMode ==
kOther)
233 product_Other->push_back(Visible_Taus);
239 iEvent.
put(product_Leptons,
"LeptonicTauLeptons");
240 iEvent.
put(product_Electrons,
"LeptonicTauElectrons");
241 iEvent.
put(product_Muons,
"LeptonicTauMuons");
242 iEvent.
put(product_OneProng,
"HadronicTauOneProng");
243 iEvent.
put(product_ThreeProng,
"HadronicTauThreeProng");
244 iEvent.
put(product_OneAndThreeProng,
"HadronicTauOneAndThreeProng");
245 iEvent.
put(product_Other,
"TauOther");
246 iEvent.
put(product_Neutrina,
"Neutrina");
247 iEvent.
put(product_Mothers,
"Mothers");
virtual int pdgId() const
PDG identifier.
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
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.