13 #include "GaudiKernel/MsgStream.h"
32 bool passTopHad =
false;
33 bool passTopPair =
false;
35 HepMC::FourVector topListMomentum(0,0,0,0);
36 HepMC::FourVector topbListMomentum(0,0,0,0);
37 HepMC::FourVector topChildrenMomentum(0,0,0,0);
38 HepMC::FourVector topbChildrenMomentum(0,0,0,0);
40 double pTHadTopList = -1;
41 double pTHadTopChildren = -1;
42 const HepMC::FourVector
b(0,0,0,0);
47 const HepMC::GenEvent* genEvt = *itr;
50 for (
const auto&
part: *genEvt){
51 int pdgId =
part->pdg_id();
55 if (
part->momentum().perp() > topListMomentum.perp() ) topListMomentum =
part->momentum();
59 if (
part->momentum().perp() > topbListMomentum.perp() ) topbListMomentum =
part->momentum();
71 if (
pT > pTHadTopChildren){
72 pTHadTopChildren =
pT;
73 if (pdgId > 0) pTHadTopList = topListMomentum.perp();
74 else pTHadTopList = topbListMomentum.perp();
81 double pTPairList = std::sqrt(
std::pow( topListMomentum.px() + topbListMomentum.px() , 2 ) +
std::pow( topListMomentum.py() + topbListMomentum.py() , 2 ));
82 double pTPairChildren = std::sqrt(
std::pow( topChildrenMomentum.px() + topbChildrenMomentum.px() , 2 ) +
std::pow( topChildrenMomentum.py() + topbChildrenMomentum.py() , 2 ));
92 if ( passTopPair && passTopHad ) pass =
true;
93 setFilterPassed(pass);
95 return StatusCode::SUCCESS;
102 auto prod = initpart->production_vertex();
104 if(!prod)
return false;
107 for (
const auto&
p: prod->particles_in())
if (std::abs(
p->pdg_id()) == 6)
return true;
109 HepMC::GenVertex::particle_iterator firstParent = prod->particles_begin(
HepMC::parents);
110 HepMC::GenVertex::particle_iterator endParent = prod->particles_end(
HepMC::parents);
111 for(;firstParent!=endParent; ++firstParent){
112 if( std::abs( (*firstParent)->pdg_id() ) == 6 )
return true;
121 auto prod =
part->production_vertex();
123 if(!prod)
return part;
126 for (
const auto&
p: prod->particles_in())
if (
part->pdg_id() ==
p->pdg_id())
return findInitial(
part);
128 HepMC::GenVertex::particle_iterator firstParent = prod->particles_begin(
HepMC::parents);
129 HepMC::GenVertex::particle_iterator endParent = prod->particles_end(
HepMC::parents);
130 for(;firstParent!=endParent; ++firstParent){
131 if(
part->pdg_id() == (*firstParent)->pdg_id() )
return findInitial(*firstParent);
142 for(
const auto& firstChild: *
end){
143 if( std::abs(firstChild->pdg_id()) <= 5 )
return true;
155 for(
const auto& firstChild: *
end){
156 if( firstChild->pdg_id() ==
type )
return false;
166 auto prod = initpart->production_vertex();
168 HepMC::FourVector
b(0,0,0,0);
170 for(
const auto& firstChild: *prod){
171 if( std::abs( firstChild->pdg_id() ) == 5 ){
172 b.set(firstChild->momentum().x(), firstChild->momentum().y(), firstChild->momentum().z(), firstChild->momentum().t());