27 #include "HepMC/GenEvent.h" 31 hepMCProductTag_(iConfig.getUntrackedParameter<
edm::InputTag>(
"hepMCProductTag",
edm::InputTag(
"generator",
"unsmeared"))) {
34 edm::LogInfo(
"SingleTopMatchingFilter")<<
"+++ maximum pt of associated-b pTMax = "<<
pTMax_;
61 bool bQuarksOpposite =
false;
62 for(HepMC::GenEvent::particle_const_iterator
i = myEvt->particles_begin();
63 (*i)->status() == 3; ++
i) {
71 if ((*i)->pdg_id() == -5)
72 bQuarksOpposite = !bQuarksOpposite;
83 for (HepMC::GenEvent::particle_const_iterator
p = myEvt->particles_begin();
p!=myEvt->particles_end(); ++
p){
85 if ((*p)->status() == 2 &&
abs((*p)->pdg_id()) == 5){
87 for (HepMC::GenVertex::particle_iterator
m = (*p)->production_vertex()->particles_begin(
HepMC::parents);
90 if(
abs((*m)->barcode()) < 5){
91 if(secBcount == 1)
break;
93 pTSecB = (*p)->operator HepMC::FourVector().perp();
94 etaSecB = (*p)->operator HepMC::FourVector().eta();
99 if(pTSecB <
pTMax_) accEvt =
true;
103 hbEta->Fill(etaSecB);
139 std::cout<<
"STFilter ++ accepted_events/input_events = "<<
accepted_events<<
"/"<<input_events<<
" = "<<fraction<<std::endl;
140 std::cout<<
"STFilter ++ efficiency = "<<percent<<
" % +/- "<<error<<
" %"<<std::endl;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
STFilter(const edm::ParameterSet &)
vector< ParameterSet > Parameters
Abs< T >::type abs(const T &t)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool filter(edm::Event &, const edm::EventSetup &) override
const HepMC::GenEvent * GetEvent() const
unsigned int accepted_events
unsigned int input_events
edm::InputTag hepMCProductTag_
std::string fOutputFileName