40 std::ostringstream err;
41 err<<
" cannot get collection: " 47 auto pOutVisTaus = std::make_unique<GenJetCollection>();
53 allStatus2Taus, 15, 2);
55 for (
IGR iTau=allStatus2Taus.
begin(); iTau!=allStatus2Taus.
end(); ++iTau ) {
65 if ( !status2TauDaughters.
empty() )
continue;
69 Particle::Charge
charge = 0;
70 Jet::Constituents constituents;
73 cout<<
"tau "<<(*iTau)<<endl;
76 igr!= descendents.
end(); ++igr ) {
78 int absPdgId =
abs((*igr)->pdgId());
89 cout<<
"\t"<<(*igr)<<endl;
91 charge += (*igr)->charge();
92 sumVisMom += (*igr)->p4();
96 constituents.push_back(
refToPtr( *igr) );
102 GenJet jet( sumVisMom, vertex, specific, constituents);
104 if (charge != (*iTau)->charge() )
105 std::cout<<
" charge of Tau: " << (*iTau) <<
" not equal to charge of sum of charge of all descendents. " << std::endl;
107 jet.setCharge(charge);
108 pOutVisTaus->push_back(
jet );
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
void findParticles(const reco::GenParticleCollection &sourceParticles, reco::GenParticleRefVector &particleRefs, int pdgId, int status)
find all particles of a given pdgId and status
const edm::EDGetTokenT< reco::GenParticleCollection > tokenGenParticles_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::InputTag inputTagGenParticles_
Input PFCandidates.
const_iterator end() const
Termination of iteration.
bool empty() const
Is the RefVector empty.
const bool verbose_
verbose ?
const_iterator begin() const
Initialize an iterator over the RefVector.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const bool includeNeutrinos_
if yes, neutrinos will be included, for debug purposes
Abs< T >::type abs(const T &t)
Jets made from MC generator particles.
XYZPointD XYZPoint
point in space with cartesian internal representation
void findDescendents(const reco::GenParticleRef &base, reco::GenParticleRefVector &descendents, int status, int pdgId=0)
find all descendents of a given status and pdgId (recursive)