55 virtual void endJob()
override ;
70 edm::LogInfo(
"TruthTauDecayModeProducer") <<
"Initializing ctor of TruthTauDecayModeProducer";
78 edm::LogInfo(
"TruthTauDecayModeProducer") <<
"Registering products";
79 produces<std::vector<reco::PFTauDecayMode> >();
80 edm::LogInfo(
"TruthTauDecayModeProducer") <<
"TruthTauDecayModeProducer initialized";
95 std::vector<tauObjectsHolder> tausToAdd_;
105 iterGen != decayedMCTaus->end();
119 tausToAdd_.push_back(tempTauHolder);
129 for(GenJetCollection::const_iterator aGenJet = genJets->begin(); aGenJet != genJets->end(); ++aGenJet)
132 std::vector<const GenParticle*> theJetConstituents = aGenJet->getGenConstituents();
136 for( std::vector<const GenParticle*>::const_iterator aCandidate = theJetConstituents.begin();
137 aCandidate != theJetConstituents.end();
143 if (pdgId == 16 || pdgId == 12 || pdgId == 14)
150 if (theCandidate->charge() != 0)
156 tausToAdd_.push_back(tempTauHolder);
161 std::auto_ptr<vector<PFTauDecayMode> > pOut(
new std::vector<PFTauDecayMode> );
162 for(std::vector<tauObjectsHolder>::const_iterator iTempTau = tausToAdd_.begin();
163 iTempTau != tausToAdd_.end();
166 double leadTrackPt = 0.;
167 double leadTrackEta = 0.;
169 const std::vector<const Candidate*>* chargedObjects = &(iTempTau->chargedObjects);
170 for(std::vector<const Candidate*>::const_iterator iCharged = chargedObjects->begin();
171 iCharged != chargedObjects->end();
175 double trackPt = (*iCharged)->pt();
176 if (trackPt > leadTrackPt)
179 leadTrackEta = (*iCharged)->eta();
186 const std::vector<const Candidate*>* neutralObjects = &(iTempTau->neutralObjects);
187 for(std::vector<const Candidate*>::const_iterator iNeutral = neutralObjects->begin();
188 iNeutral != neutralObjects->end();
196 myFourVector += neutralPionsToAdd.
p4();
203 PFTauDecayMode decayModeToAdd(chargedObjectsToAdd, neutralPionsToAdd, theOutliers);
205 pOut->push_back(decayModeToAdd);
std::vector< const reco::Candidate * > neutralObjects
T getParameter(std::string const &) const
~TruthTauDecayModeProducer()
virtual void produce(edm::Event &, const edm::EventSetup &) override
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
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
Abs< T >::type abs(const T &t)
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
virtual void beginJob() override
std::vector< const reco::Candidate * > getGenChargedPions() const
void set(reco::Candidate &c) const
set up a candidate
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual void endJob() override