4 #include "HepMC/GenVertex.h"
19 int st = partonStatus_.size();
20 int pt = partonPt_.size();
22 if (
partonId_.size() != partonStatus_.size() ||
partonId_.size() != partonPt_.size()) {
26 id = particleId_.size();
27 st = particleStatus_.size();
28 pt = particlePt_.size();
30 if (particleId_.size() != particleStatus_.size() || particleId_.size() != particlePt_.size()) {
36 HepMC::GenEvent::particle_const_iterator
begin = evt->particles_begin();
37 HepMC::GenEvent::particle_const_iterator
end = evt->particles_end();
39 bool foundParticle =
false;
40 bool foundParton =
false;
42 HepMC::GenEvent::particle_const_iterator it =
begin;
43 while ((!foundParton || !foundParticle) && it != end) {
45 bool isThisPhoton =
false;
59 if (!((*it)->production_vertex())) {
62 const HepMC::GenVertex* productionVertex = (*it)->production_vertex();
64 size_t numberOfMothers = productionVertex->particles_in_size();
65 if (numberOfMothers <= 0) {
70 HepMC::GenVertex::particles_in_const_iterator motherIt = productionVertex->particles_in_const_begin();
71 for (; motherIt != productionVertex->particles_in_const_end(); motherIt++) {
72 if (fabs((*motherIt)->pdg_id()) <= 22) {
79 if ((isFrag ==
true) && (isThisPhoton ==
true)) {
88 return (foundParton && foundParticle);
EcalGenEvtSelectorFrag(const edm::ParameterSet &pset)
bool selectParticle(HepMC::GenParticle *par, int status, int pdg, double ptMin, double etaMax)
std::vector< int > partonStatus_
bool filter(HepMC::GenEvent *) override
std::vector< double > particlePt_
std::vector< int > partonId_
std::vector< int > particleId_
T getParameter(std::string const &) const
std::vector< double > partonPt_
std::vector< int > particleStatus_