19 produces<LorentzVectorCollection>(
"LeptonicTauLeptons");
20 produces<LorentzVectorCollection>(
"LeptonicTauElectrons");
21 produces<LorentzVectorCollection>(
"LeptonicTauMuons");
22 produces<LorentzVectorCollection>(
"HadronicTauOneProng");
23 produces<LorentzVectorCollection>(
"HadronicTauThreeProng");
24 produces<LorentzVectorCollection>(
"HadronicTauOneAndThreeProng");
25 produces<LorentzVectorCollection>(
"TauOther");
26 produces<LorentzVectorCollection>(
"Neutrina");
27 produces<std::vector<int> >(
"Mothers");
45 auto_ptr<std::vector<int> > product_Mothers(
new std::vector<int>);
54 for(GenParticleCollection::const_iterator
p = genParticles->begin();
p != genParticles->end(); ++
p) {
57 for(
size_t pi =0;
pi<m_PDG_.size();++
pi)
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) {
88 getGenDecayProducts(genRef, daugTaus, 0, 15);
89 if( daugTaus.
size()==0 )
98 getGenDecayProducts(*
t,decayProducts,1);
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 ){
148 tauDecayMode = kElectron;
149 }
else if ( numMuons == 1 ){
151 tauDecayMode =
kMuon;
154 switch ( numChargedPions ){
156 if( numNeutralPions !=0 ){
157 tauDecayMode = kOther;
160 switch ( numPhotons ){
162 tauDecayMode = kOneProng0pi0;
165 tauDecayMode = kOneProng1pi0;
168 tauDecayMode = kOneProng2pi0;
171 tauDecayMode = kOther;
176 if( numNeutralPions !=0 ){
177 tauDecayMode = kOther;
180 switch ( numPhotons ){
182 tauDecayMode = kThreeProng0pi0;
185 tauDecayMode = kThreeProng1pi0;
188 tauDecayMode = kOther;
197 if(tauDecayMode == kElectron)
199 if((
abs(Visible_Taus.eta())<
etaMax)&&(Visible_Taus.pt()>ptMinMCElectron_)){
200 product_Electrons->push_back(Visible_Taus);
201 product_Leptons->push_back(Visible_Taus);
204 else if (tauDecayMode ==
kMuon)
206 if((
abs(Visible_Taus.eta())<
etaMax)&&(Visible_Taus.pt()>ptMinMCMuon_)){
207 product_Muons->push_back(Visible_Taus);
208 product_Leptons->push_back(Visible_Taus);
211 else if(tauDecayMode == kOneProng0pi0 ||
212 tauDecayMode == kOneProng1pi0 ||
213 tauDecayMode == kOneProng2pi0 )
215 if ((
abs(Visible_Taus.eta()) <
etaMax) && (Visible_Taus.pt() > ptMinMCTau_)){
216 product_OneProng->push_back(Visible_Taus);
217 product_OneAndThreeProng->push_back(Visible_Taus);
218 product_Neutrina->push_back(Neutrino);
221 else if (tauDecayMode == kThreeProng0pi0 ||
222 tauDecayMode == kThreeProng1pi0 )
224 if((
abs(Visible_Taus.eta())<
etaMax)&&(Visible_Taus.pt()>ptMinMCTau_)) {
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)
232 if((
abs(Visible_Taus.eta())<
etaMax)&&(Visible_Taus.pt()>ptMinMCTau_)) {
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");
260 if( (status==0 || (*d)->status() ==
status) &&
261 (pdgId==0 ||
std::abs((*d)->pdgId()) == pdgId) ) {
266 getGenDecayProducts(*
d, products, status, pdgId);
T getUntrackedParameter(std::string const &, T const &) const
virtual int pdgId() const
PDG identifier.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const_iterator end() const
Termination of iteration.
bool empty() const
Is the RefVector empty.
const_iterator begin() const
Initialize an iterator over the RefVector.
HLTTauMCProducer(const edm::ParameterSet &)
ESProducts< T, S > products(const T &i1, const S &i2)
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
virtual void produce(edm::Event &, const edm::EventSetup &)
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.