8 #include "GaudiKernel/MsgStream.h"
12 ISvcLocator* pSvcLocator)
38 return StatusCode::SUCCESS;
44 return StatusCode::SUCCESS;
63 const HepMC::GenEvent* genEvt = (*itr);
67 for(
const auto&
part: *genEvt) {
77 int pdgid = abs(
part->pdg_id());
100 if(isbhadron || ischadron){
117 if(ischadron && !ischadronfromb) ++nC;
148 if(
m_selectB && 5 == flavortype) pass=
true;
149 if(
m_selectC && 4 == flavortype) pass=
true;
150 if(
m_selectL && 0 == flavortype) pass=
true;
152 setFilterPassed(pass);
153 return StatusCode::SUCCESS;
160 const HepMC::FourVector& p4 =
part->momentum();
161 double pt = p4.perp();
162 double eta = std::abs(p4.eta());
173 const HepMC::FourVector& p4 =
part->momentum();
174 double pt = p4.perp();
175 double eta = std::abs(p4.eta());
186 int rest1(std::abs(pdgid%1000));
187 int rest2(std::abs(pdgid%10000));
189 if ( rest2 >= 5000 && rest2 < 6000 )
return 5;
190 if( rest1 >= 500 && rest1 < 600 )
return 5;
192 if ( rest2 >= 4000 && rest2 < 5000 )
return 4;
193 if( rest1 >= 400 && rest1 < 500 )
return 4;
204 if(
type == 5)
return true;
215 if(
type == 4)
return true;
225 auto prod =
part->production_vertex();
226 if(!prod)
return true;
229 for(
const auto& firstParent: prod->particles_in()){
230 int mothertype =
hadronType( firstParent->pdg_id() );
231 if( mothertype ==
type ){
236 HepMC::GenVertex::particle_iterator firstParent = prod->particles_begin(
HepMC::parents);
237 HepMC::GenVertex::particle_iterator endParent = prod->particles_end(
HepMC::parents);
238 for(;firstParent!=endParent; ++firstParent){
239 int mothertype =
hadronType( (*firstParent)->pdg_id() );
240 if( mothertype ==
type ){
253 if(!
end)
return true;
256 for(
const auto& firstChild:
end->particles_in()){
257 int childtype =
hadronType( firstChild->pdg_id() );
258 if( childtype ==
type ){
263 HepMC::GenVertex::particle_iterator firstChild =
end->particles_begin(
HepMC::children);
265 for(;firstChild!=endChild; ++firstChild){
266 int childtype =
hadronType( (*firstChild)->pdg_id() );
267 if( childtype ==
type ){
280 auto prod =
part->production_vertex();
281 if(!prod)
return false;
283 for(
const auto& firstParent: HepMC::ancestor_particles(prod)){
284 int mothertype =
hadronType( firstParent->pdg_id() );
285 if( 4 == mothertype || 5 == mothertype ){
290 HepMC::GenVertex::particle_iterator firstParent = prod->particles_begin(HepMC::ancestors);
291 HepMC::GenVertex::particle_iterator endParent = prod->particles_end(HepMC::ancestors);
292 for(;firstParent!=endParent; ++firstParent){
293 int mothertype =
hadronType( (*firstParent)->pdg_id() );
294 if( 4 == mothertype || 5 == mothertype ){
307 auto prod =
part->production_vertex();
308 if(!prod)
return false;
310 for(
const auto& firstParent:HepMC::ancestor_particles(prod)){
316 HepMC::GenVertex::particle_iterator firstParent = prod->particles_begin(HepMC::ancestors);
317 HepMC::GenVertex::particle_iterator endParent = prod->particles_end(HepMC::ancestors);
318 for(;firstParent!=endParent; ++firstParent){
333 auto prod =
part->production_vertex();
335 if(!prod)
return part;
337 for(
const auto& firstParent: prod->particles_in()){
338 if(
part->pdg_id() == firstParent->pdg_id() ){
343 HepMC::GenVertex::particle_iterator firstParent = prod->particles_begin(
HepMC::parents);
344 HepMC::GenVertex::particle_iterator endParent = prod->particles_end(
HepMC::parents);
345 for(;firstParent!=endParent; ++firstParent){
346 if(
part->pdg_id() == (*firstParent)->pdg_id() ){
365 auto prod =
part->production_vertex();
367 if(!prod)
return false;
369 for (
auto firstParent: prod->particles_in()){
370 if( std::abs( firstParent->pdg_id() ) == 6 )
return true;
373 HepMC::GenVertex::particle_iterator firstParent = prod->particles_begin(
HepMC::parents);
374 HepMC::GenVertex::particle_iterator endParent = prod->particles_end(
HepMC::parents);
375 for(;firstParent!=endParent; ++firstParent){
376 if( std::abs( (*firstParent)->pdg_id() ) == 6 )
return true;
387 auto prod =
part->production_vertex();
389 if(!prod)
return false;
391 for(
const auto& firstParent: prod->particles_in()){
392 if( std::abs( firstParent->pdg_id() ) == 24 ){
393 if(
isFromTop(firstParent) )
return true;
397 HepMC::GenVertex::particle_iterator firstParent = prod->particles_begin(
HepMC::parents);
398 HepMC::GenVertex::particle_iterator endParent = prod->particles_end(
HepMC::parents);
399 for(;firstParent!=endParent; ++firstParent){
400 if( std::abs( (*firstParent)->pdg_id() ) == 24 ){
401 if(
isFromTop(*firstParent) )
return true;