52 if(
find( skip.begin(), skip.end(), &
c ) != skip.end() )
return false;
62 for(
size_t i = 0;
i < ndau; ++
i )
72 list<const Candidate *>
skip;
73 vector<const Candidate *>
nodes, moms;
75 p != particles->end(); ++
p ) {
76 if(
p->numberOfMothers() > 1 ) {
78 skip.push_back( & *
p );
79 nodes.push_back( & *
p );
80 for(
size_t j = 0; j <
p->numberOfMothers(); ++ j ) {
83 while ( ( grandMom = mom->
mother() ) !=
nullptr )
86 moms.push_back( mom );
92 cout <<
"-- decay: --" << endl;
94 if ( moms.size() > 1 )
95 for(
size_t m = 0;
m < moms.size(); ++
m ) {
98 cout <<
"{ " << dec <<
" } ";
103 if ( !nodes.empty() ) {
105 if ( nodes.size() > 1 ) {
106 for(
size_t n = 0;
n < nodes.size(); ++
n ) {
107 skip.remove( nodes[
n ] );
108 string dec =
decay( * nodes[ n ], skip );
109 if ( ! dec.empty() ) {
110 if ( dec.find(
"->", 0 ) != string::npos )
111 cout <<
" ( " << dec <<
" )";
117 skip.remove( nodes[ 0 ] );
126 if (
printP4_ ) cout <<
" (" << c.
px() <<
", " << c.
py() <<
", " << c.
pz() <<
"; " << c.
energy() <<
")";
128 if (
printVertex_ ) cout <<
" {" << c.
vx() <<
", " << c.
vy() <<
", " << c.
vz() <<
"}";
133 list<const Candidate *> &
skip )
const {
135 if (
find( skip.begin(), skip.end(), &
c ) != skip.end() )
137 skip.push_back( & c );
142 assert( pd !=
nullptr );
143 out += ( pd->name() +
printP4( c ) );
146 for(
size_t i = 0;
i < ndau; ++
i )
149 if ( validDau == 0 )
return out;
153 for(
size_t i = 0;
i < ndau; ++
i ) {
155 if (
accept( * d, skip ) ) {
157 if ( dec.find(
"->", 0 ) != string::npos )
158 out += (
" ( " + dec +
" )" );
160 out += (
" " +
dec );
bool hasValidDaughters(const reco::Candidate &) const
has valid daughters in the chain
virtual double pz() const =0
z coordinate of momentum vector
virtual double vx() const =0
x coordinate of vertex position
bool accept(const reco::Candidate &, const std::list< const reco::Candidate * > &) const
accept candidate
std::string printP4(const reco::Candidate &) const
print 4 momenta
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
virtual double vy() const =0
y coordinate of vertex position
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::ESHandle< ParticleDataTable > pdt_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool getData(T &iHolder) const
virtual int status() const =0
status word
virtual double energy() const =0
energy
virtual double py() const =0
y coordinate of momentum vector
#define DEFINE_FWK_MODULE(type)
std::string decay(const reco::Candidate &, std::list< const reco::Candidate * > &) const
bool select(const reco::Candidate &) const
select candidate
virtual int pdgId() const =0
PDG identifier.
ParticleDecayDrawer(const edm::ParameterSet &)
bool printP4_
print parameters
void analyze(const edm::Event &, const edm::EventSetup &) override
HepPDT::ParticleData ParticleData
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
virtual double vz() const =0
z coordinate of vertex position
virtual double px() const =0
x coordinate of momentum vector
virtual size_type numberOfDaughters() const =0
number of daughters
virtual double phi() const =0
momentum azimuthal angle
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken_