45 src_( cfg.getParameter<
InputTag>(
"src" ) ),
46 printP4_( cfg.getUntrackedParameter<bool>(
"printP4",
false ) ),
47 printPtEtaPhi_( cfg.getUntrackedParameter<bool>(
"printPtEtaPhi",
false ) ),
48 printVertex_( cfg.getUntrackedParameter<bool>(
"printVertex",
false ) ) {
52 if(
find( skip.begin(), skip.end(), &
c ) != skip.end() )
return false;
62 for(
size_t i = 0;
i < ndau; ++
i )
71 event.getByLabel(
src_, particles );
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() ) != 0 )
86 moms.push_back( mom );
92 cout <<
"-- decay: --" << endl;
93 if( moms.size() > 0 ) {
94 if ( moms.size() > 1 )
95 for(
size_t m = 0;
m < moms.size(); ++
m ) {
96 string dec =
decay( * moms[
m ], skip );
98 cout <<
"{ " << dec <<
" } ";
103 if ( nodes.size() > 0 ) {
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 );
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 ) ) {
156 string dec =
decay( * 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
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
virtual double energy() const =0
energy
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 pt() const =0
transverse momentum
#define DEFINE_FWK_MODULE(type)
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 int status() const =0
status word
virtual double pz() const =0
z coordinate of momentum vector
virtual double vx() const =0
x 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_
void getData(T &iHolder) const
virtual double vy() const =0
y coordinate of vertex position
virtual size_type numberOfDaughters() const =0
number of daughters
std::string decay(const reco::Candidate &, std::list< const reco::Candidate * > &) const
bool select(const reco::Candidate &) const
select candidate
ParticleDecayDrawer(const edm::ParameterSet &)
bool printP4_
print parameters
virtual double py() const =0
y coordinate of momentum vector
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
HepPDT::ParticleData ParticleData
virtual double px() const =0
x coordinate of momentum vector
virtual int pdgId() const =0
PDG identifier.
virtual double vz() const =0
z coordinate of vertex position
void analyze(const edm::Event &, const edm::EventSetup &)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity