22 #include <boost/format.hpp> 34 hepMCProductTag_(iConfig.getParameter<
edm::InputTag>(
"hepMCProductTag")) {
50 cout <<
"Proc: 2-->2 2-->3 Total" << endl;
63 using namespace HepMC;
72 for (GenEvent::particle_const_iterator it = myEvt->particles_begin();
73 it != myEvt->particles_end(); ++it) {
74 if ((*it)->status() == 3) {
75 int abs_id =
abs((*it)->pdg_id());
76 if (abs_id==11 || abs_id==13 || abs_id==15) {
84 cerr <<
"ERROR: ComphepSingletopFilter: no charged lepton" << endl;
89 vector<const GenParticle *> vgp_bsec;
91 GenVertex * gv_hard = gp_clep->production_vertex();
93 for (GenVertex::particle_iterator it = gv_hard->particles_begin(
children);
94 it != gv_hard->particles_end(
children); ++it) {
95 int pdg_id = (*it)->pdg_id();
96 if (
abs(pdg_id) == 5) {
97 if (pdg_id * (gp_clep->pdg_id()) < 0) {
100 vgp_bsec.push_back(*it);
105 bool process22 = (vgp_bsec.empty());
107 GenVertex * gv =
nullptr;
109 for (GenVertex::particle_iterator it = gv_hard->particles_begin(
parents);
110 it != gv_hard->particles_end(
parents); ++it) {
111 if ((*it)->pdg_id() == id_bdec) {
112 gv = (*it)->production_vertex();
117 cerr <<
"ERROR: ComphepSingletopFilter: HepMC inconsistency" << endl;
122 gv = vgp_bsec.back()->end_vertex();
127 for (GenVertex::particle_iterator it = gv->particles_begin(
children);
128 it != gv->particles_end(
children); ++it) {
129 if ((*it)->pdg_id() == -id_bdec) {
130 if (!gp || (*it)->momentum().perp2() > gp->momentum().perp2()) {
136 gv = gp->end_vertex();
137 vgp_bsec.push_back(gp);
143 if (vgp_bsec.empty()) {
144 cerr <<
"ERROR: ComphepSingletopFilter: HepMC inconsistency" << endl;
148 double pt = vgp_bsec.back()->momentum().perp();
bool filter(edm::Event &, const edm::EventSetup &) override
T getParameter(std::string const &) const
~ComphepSingletopFilter() override
Abs< T >::type abs(const T &t)
format
Some error handling for the usage.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const HepMC::GenEvent * GetEvent() const
ComphepSingletopFilter(const edm::ParameterSet &)
edm::InputTag hepMCProductTag_