71 edm::LogInfo(
"TruthTauDecayModeProducer") <<
"Initializing ctor of TruthTauDecayModeProducer";
79 edm::LogInfo(
"TruthTauDecayModeProducer") <<
"Registering products";
80 produces<std::vector<reco::PFTauDecayMode> >();
81 edm::LogInfo(
"TruthTauDecayModeProducer") <<
"TruthTauDecayModeProducer initialized";
96 std::vector<tauObjectsHolder> tausToAdd_;
106 iterGen != decayedMCTaus->end();
120 tausToAdd_.push_back(tempTauHolder);
130 for(GenJetCollection::const_iterator aGenJet = genJets->begin(); aGenJet != genJets->end(); ++aGenJet)
133 std::vector<const GenParticle*> theJetConstituents = aGenJet->getGenConstituents();
137 for( std::vector<const GenParticle*>::const_iterator aCandidate = theJetConstituents.begin();
138 aCandidate != theJetConstituents.end();
144 if (pdgId == 16 || pdgId == 12 || pdgId == 14)
151 if (theCandidate->charge() != 0)
157 tausToAdd_.push_back(tempTauHolder);
162 std::auto_ptr<vector<PFTauDecayMode> > pOut(
new std::vector<PFTauDecayMode> );
163 for(std::vector<tauObjectsHolder>::const_iterator iTempTau = tausToAdd_.begin();
164 iTempTau != tausToAdd_.end();
167 double leadTrackPt = 0.;
168 double leadTrackEta = 0.;
170 const std::vector<const Candidate*>* chargedObjects = &(iTempTau->chargedObjects);
171 for(std::vector<const Candidate*>::const_iterator iCharged = chargedObjects->begin();
172 iCharged != chargedObjects->end();
176 double trackPt = (*iCharged)->pt();
177 if (trackPt > leadTrackPt)
180 leadTrackEta = (*iCharged)->eta();
187 const std::vector<const Candidate*>* neutralObjects = &(iTempTau->neutralObjects);
188 for(std::vector<const Candidate*>::const_iterator iNeutral = neutralObjects->begin();
189 iNeutral != neutralObjects->end();
197 myFourVector += neutralPionsToAdd.
p4();
204 PFTauDecayMode decayModeToAdd(chargedObjectsToAdd, neutralPionsToAdd, theOutliers);
206 pOut->push_back(decayModeToAdd);
std::vector< const reco::Candidate * > neutralObjects
T getParameter(std::string const &) const
~TruthTauDecayModeProducer()
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
virtual void produce(edm::Event &, const edm::EventSetup &)
void setPFTauRef(const PFTauRef &theTau)
#define DEFINE_FWK_MODULE(type)
bool isFinalStateTau() const
TruthTauDecayModeProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< const reco::Candidate * > chargedObjects
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
std::vector< const reco::Candidate * > getGenNeutralPions() const
std::vector< const reco::Candidate * > getGenChargedPions() const
void set(reco::Candidate &c) const
set up a candidate
math::XYZTLorentzVector LorentzVector
Lorentz vector.