ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::HadronOriginClassifier Class Reference

#include <HadronOriginClassifier.h>

Inheritance diagram for DerivationFramework::HadronOriginClassifier:
Collaboration diagram for DerivationFramework::HadronOriginClassifier:

Public Types

enum  HF_id {
  extrajet =0 , c_MPI =-1 , b_MPI =1 , c_FSR =-2 ,
  b_FSR =2 , c_from_W =-3 , b_from_W =3 , c_from_top =-4 ,
  b_from_top =4 , c_from_H =-5 , b_from_H =5
}
enum class  GEN_id { Pythia6 =0 , Pythia8 =1 , HerwigPP =2 , Sherpa =3 }

Public Member Functions

 HadronOriginClassifier (const std::string &t, const std::string &n, const IInterface *p)
virtual ~HadronOriginClassifier ()
virtual StatusCode initialize () override
std::map< const xAOD::TruthParticle *, HF_idGetOriginMap (const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void fillHadronMap (std::set< const xAOD::TruthParticle * > &usedHadron, std::map< const xAOD::TruthParticle *, int > &mainHadronMap, const xAOD::TruthParticle *mainhad, const xAOD::TruthParticle *ihad, bool decayed=false) const
void buildPartonsHadronsMaps (const EventContext &ctx, std::map< const xAOD::TruthParticle *, int > &mainHadronMap, std::map< const xAOD::TruthParticle *, HF_id > &partonsOrigin) const
bool isCHadronFromB (const xAOD::TruthParticle *part, std::shared_ptr< std::set< const xAOD::TruthParticle * > > checked=nullptr) const
const xAOD::TruthParticlefindInitial (const xAOD::TruthParticle *part, std::shared_ptr< std::set< const xAOD::TruthParticle * > > checked=nullptr) const
bool isFromTop (const xAOD::TruthParticle *part) const
bool isDirectlyFromWTop (const xAOD::TruthParticle *part) const
bool isFromGluonQuark (const xAOD::TruthParticle *part) const
bool isDirectlyFSRPythia6 (const xAOD::TruthParticle *part) const
bool isDirectlyFromQuarkTop (const xAOD::TruthParticle *part) const
bool isFromQuarkTop (const xAOD::TruthParticle *part) const
bool isDirectlyFSR (const xAOD::TruthParticle *part) const
bool isFromWTop (const xAOD::TruthParticle *part) const
bool isDirectlyMPIPythia8 (const xAOD::TruthParticle *part) const
bool isDirectlyFromQuarkTopPythia8 (const xAOD::TruthParticle *part) const
bool isFromQuarkTopPythia8 (const xAOD::TruthParticle *part) const
bool isDirectlyFSRPythia8 (const xAOD::TruthParticle *part) const
bool IsHerwigPP () const
bool IsPythia8 () const
bool IsPythia6 () const
bool IsSherpa () const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static bool isDirectlyFromTop (const xAOD::TruthParticle *part)
static bool isDirectlyFromGluonQuark (const xAOD::TruthParticle *part)
static bool isDirectlyMPIPythia6 (const xAOD::TruthParticle *part)
static bool isDirectlyMPISherpa (const xAOD::TruthParticle *part)

Private Attributes

SG::ReadHandleKey< xAOD::TruthEventContainerm_mcName {this, "MCCollectionName", "TruthEvents", "TruthEventContainer key"}
Gaudi::Property< double > m_HadronPtMinCut {this, "HadronpTMinCut", 5000.}
Gaudi::Property< double > m_HadronEtaMaxCut {this, "HadronetaMaxCut", 2.5}
 MeV.
Gaudi::Property< int > m_DSID {this, "DSID", 410000}
GEN_id m_GenUsed {}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 28 of file HadronOriginClassifier.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ GEN_id

Enumerator
Pythia6 
Pythia8 
HerwigPP 
Sherpa 

Definition at line 44 of file HadronOriginClassifier.h.

44{ Pythia6=0, Pythia8=1, HerwigPP=2, Sherpa=3 };

◆ HF_id

Enumerator
extrajet 
c_MPI 
b_MPI 
c_FSR 
b_FSR 
c_from_W 
b_from_W 
c_from_top 
b_from_top 
c_from_H 
b_from_H 

Definition at line 37 of file HadronOriginClassifier.h.

Constructor & Destructor Documentation

◆ HadronOriginClassifier()

DerivationFramework::HadronOriginClassifier::HadronOriginClassifier ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 29 of file HadronOriginClassifier.cxx.

29 :
30 AthAlgTool(t,n,p)
31 {
32 }
AthAlgTool()
Default constructor:

◆ ~HadronOriginClassifier()

DerivationFramework::HadronOriginClassifier::~HadronOriginClassifier ( )
virtual

Definition at line 34 of file HadronOriginClassifier.cxx.

34{}

Member Function Documentation

◆ buildPartonsHadronsMaps()

void DerivationFramework::HadronOriginClassifier::buildPartonsHadronsMaps ( const EventContext & ctx,
std::map< const xAOD::TruthParticle *, int > & mainHadronMap,
std::map< const xAOD::TruthParticle *, HF_id > & partonsOrigin ) const
private

Definition at line 428 of file HadronOriginClassifier.cxx.

428 {
429 // Extract the TruthParticles container.
430 SG::ReadHandle<xAOD::TruthEventContainer> xTruthEventContainer(m_mcName, ctx);
431 if (!xTruthEventContainer.isValid()) {
432 ATH_MSG_WARNING("Could not retrieve " <<m_mcName);
433 }
434
435 // Create a container with TruthParticles to store the hadrons that has already been saved.
436 std::set<const xAOD::TruthParticle*> usedHadron;
437 for ( const auto* truthevent : *xTruthEventContainer ) {
438 // Use a for to go through the TruthParticles.
439 for(unsigned int i = 0; i < truthevent->nTruthParticles(); i++){
440 // Extract the i-th particle.
441 const xAOD::TruthParticle* part = truthevent->truthParticle(i);
442 if(!part) continue;
443 // Simulated particles are not considered.
444 if(HepMC::is_simulation_particle(part)) break;
445 // Create a set of boolean variables to indicate the type of particle.
446 bool isbquark = false; // The particle is a b-quark.
447 bool iscquark = false; // The particle is a c-quark.
448 bool isHFhadron = false; // The particle is a HF hadron.
449 // Extract the pdgid of the particle and use it to determine the type of particle.
450 int pdgid = part->absPdgId();
451 if( MC::isBottom(pdgid) ){
452 isbquark=true;
453 }
454 else if( MC::isCharm(pdgid) ){
455 iscquark=true;
456 }
457 else if(MC::isBottomHadron(part) || MC::isCharmHadron(part)){
458 isHFhadron=true;
459 }
460 else{
461 continue;
462 }
463 // For HF quarks (b or c), check their category.
464 // The category is determined looking for the parents.
465 if(isbquark){
466 // In this case, the parton is a b-quark.
467 // Check the category of the b-quark.
468 if(isDirectlyFromWTop(part)){
469 partonsOrigin[ part ] = b_from_W;
470 }
471 else if(isDirectlyFromTop(part)){
472 partonsOrigin[ part ] = b_from_top;
473 }
474 else if((IsHerwigPP()||IsSherpa())&&isDirectlyFSR(part)){
475 partonsOrigin[ part ] = b_FSR;
476 }
477 else if(IsPythia8()&&isDirectlyFSRPythia8(part)){
478 partonsOrigin[ part ] = b_FSR;
479 }
480 else if(IsPythia6()&&isDirectlyFSRPythia6(part)){
481 partonsOrigin[ part ] = b_FSR;
482 }
483 else if(IsPythia6()&&isDirectlyMPIPythia6(part)){
484 partonsOrigin[ part ] = b_MPI;
485 }
486 else if(IsPythia8()&&isDirectlyMPIPythia8(part)){
487 partonsOrigin[ part ] = b_MPI;
488 }
489 else if(IsSherpa()&&isDirectlyMPISherpa(part)){
490 partonsOrigin[ part ] = b_MPI;
491 }
492 }
493 if(iscquark){
494 // In this case, the parton is a c-quark.
495 // Check the category of the b-quark.
496 if(isDirectlyFromWTop(part)){
497 partonsOrigin[ part ] = c_from_W;
498 }
499 else if(isDirectlyFromTop(part)){
500 partonsOrigin[ part ] = c_from_top;
501 }
502 else if((IsHerwigPP()&&IsSherpa())&&isDirectlyFSR(part)){
503 partonsOrigin[ part ] = c_FSR;
504 }
505 else if(IsPythia8()&&isDirectlyFSRPythia8(part)){
506 partonsOrigin[ part ] = c_FSR;
507 }
508 else if(IsPythia6()&&isDirectlyFSRPythia6(part)){
509 partonsOrigin[ part ] = c_FSR;
510 }
511 else if(IsPythia6()&&isDirectlyMPIPythia6(part)){
512 partonsOrigin[ part ] = c_MPI;
513 }
514 else if(IsPythia8()&&isDirectlyMPIPythia8(part)){
515 partonsOrigin[ part ] = c_MPI;
516 }
517 else if(IsSherpa()&&isDirectlyMPISherpa(part)){
518 partonsOrigin[ part ] = c_MPI;
519 }
520 }
521 // The HF hadrons are stored in the map mainHadronMap if they are not repeated.
522 if(isHFhadron && !isCHadronFromB(part)){
523 // In this case, the particle is a HF hadron but not a C-Hadron from a B-hadron.
524 // If the hadron is not in usedHadron, then add it in mainHadronMap with fillHadronMap function.
525 if(usedHadron.insert(part).second) {
526 fillHadronMap(usedHadron, mainHadronMap,part,part);
527 }
528 }
529 }//loop on particles
530 }//loop on truthevent container
531 }
#define ATH_MSG_WARNING(x)
static bool isDirectlyMPIPythia6(const xAOD::TruthParticle *part)
static bool isDirectlyFromTop(const xAOD::TruthParticle *part)
bool isCHadronFromB(const xAOD::TruthParticle *part, std::shared_ptr< std::set< const xAOD::TruthParticle * > > checked=nullptr) const
bool isDirectlyMPIPythia8(const xAOD::TruthParticle *part) const
bool isDirectlyFSRPythia8(const xAOD::TruthParticle *part) const
bool isDirectlyFromWTop(const xAOD::TruthParticle *part) const
bool isDirectlyFSR(const xAOD::TruthParticle *part) const
SG::ReadHandleKey< xAOD::TruthEventContainer > m_mcName
bool isDirectlyFSRPythia6(const xAOD::TruthParticle *part) const
void fillHadronMap(std::set< const xAOD::TruthParticle * > &usedHadron, std::map< const xAOD::TruthParticle *, int > &mainHadronMap, const xAOD::TruthParticle *mainhad, const xAOD::TruthParticle *ihad, bool decayed=false) const
static bool isDirectlyMPISherpa(const xAOD::TruthParticle *part)
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
bool isCharmHadron(const T &p)
bool isCharm(const T &p)
bool isBottom(const T &p)
bool isBottomHadron(const T &p)
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillHadronMap()

void DerivationFramework::HadronOriginClassifier::fillHadronMap ( std::set< const xAOD::TruthParticle * > & usedHadron,
std::map< const xAOD::TruthParticle *, int > & mainHadronMap,
const xAOD::TruthParticle * mainhad,
const xAOD::TruthParticle * ihad,
bool decayed = false ) const
private

Definition at line 560 of file HadronOriginClassifier.cxx.

560 {
561 // Fist, check that the consdired hadron has a non-null pointer
562 if (!ihad) return;
563 usedHadron.insert(ihad);
564 // Create two variables to indicate the flavour of the parents and childrens particles that will be considered.
565 // Create a boolean to indicate if the particles considered are from the final state.
566 int parent_flav,child_flav;
567 bool isFinal = true;
568 // Check if the considered hadron has children.
569 if(!ihad->nChildren()) return;
570 // Use a for to go through the children.
571 for(unsigned int j=0; j<ihad->nChildren(); ++j){
572 // Extract the j-th children.
573 const xAOD::TruthParticle* child = ihad->child(j);
574 if(!child) continue;
575 if(decayed){
576 fillHadronMap(usedHadron, mainHadronMap,mainhad,child,true);
577 isFinal=false;
578 }
579 else{
580 child_flav = std::abs(MC::leadingQuark(child));
581 if(child_flav!=4 && child_flav!=5) continue;
582 parent_flav = std::abs(MC::leadingQuark(mainhad));
583 if(child_flav!=parent_flav) continue;
584 fillHadronMap(usedHadron, mainHadronMap,mainhad,child);
585 isFinal=false;
586 }
587 }
588
589 if(isFinal && !decayed){
590 mainHadronMap[mainhad]=std::abs(MC::leadingQuark(mainhad));
591 for(unsigned int j=0; j<ihad->nChildren(); ++j){
592 const xAOD::TruthParticle* child = ihad->child(j);
593 if(!child) continue;
594 fillHadronMap(usedHadron, mainHadronMap,mainhad,child,true);
595 }
596 }
597 }
const TruthParticle_v1 * child(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
size_t nChildren() const
Number of children of this particle.
int leadingQuark(const T &p)
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ findInitial()

const xAOD::TruthParticle * DerivationFramework::HadronOriginClassifier::findInitial ( const xAOD::TruthParticle * part,
std::shared_ptr< std::set< const xAOD::TruthParticle * > > checked = nullptr ) const
private

Definition at line 809 of file HadronOriginClassifier.cxx.

809 {
810 // If the particle has no parent, return the particle.
811 if(!part->nParents()) return part;
812 if (!checked) checked = std::make_shared<std::set<const xAOD::TruthParticle*>>();
813 // Use a for to go through the parents.
814 for(unsigned int i=0; i<part->nParents(); ++i){
815 // Extract the i-th parent.
816 const xAOD::TruthParticle* parent = part->parent(i);
817 if(!parent) continue;
818 if(checked->count(parent)) continue;
819 checked->insert(parent);
820 // If the parent has the same pdgId as the particle, then it means that the parent is the same as the considered particle.
821 // This happens if the particle irradiates for example.
822 // In this case, try to look for the first parent of i-th parent that is being considered.
823 // Repeat the process until you find a particle different from the considred one or that has no parent.
824
825 if( part->pdgId() == parent->pdgId() ){
826 return findInitial(parent, std::move(checked));
827 }
828 }
829 // In this case, no parent different from the considered particle has been found.
830 // Hence, return the particle.
831 return part;
832 }
const xAOD::TruthParticle * findInitial(const xAOD::TruthParticle *part, std::shared_ptr< std::set< const xAOD::TruthParticle * > > checked=nullptr) const

◆ GetOriginMap()

std::map< const xAOD::TruthParticle *, DerivationFramework::HadronOriginClassifier::HF_id > DerivationFramework::HadronOriginClassifier::GetOriginMap ( const EventContext & ctx) const

Definition at line 360 of file HadronOriginClassifier.cxx.

360 {
361 // Create a set of maps to store the information about the hadrons and the partons
362 std::map<const xAOD::TruthParticle*, int> mainHadronMap; // Map with main hadrons and their flavor.
363 std::map<const xAOD::TruthParticle*, HF_id> partonsOrigin; // Map with partons and their category (from top, W, H, MPI, FSR, extra).
364 std::map<const xAOD::TruthParticle*, const xAOD::TruthParticle*> hadronsPartons; // Map with hadrons and their matched parton.
365 std::map<const xAOD::TruthParticle*, HF_id> hadronsOrigin; // Map with hadrons and their category (from top, W, H, MPI, FSR, extra)
366 // Fill the maps mainHadronMap and partonsOrigin
367 buildPartonsHadronsMaps(ctx, mainHadronMap, partonsOrigin);
368 // Create two maps to know which partons and hadrons have already been matched.
369 std::vector<const xAOD::TruthParticle*> matched_partons;
370 std::vector<const xAOD::TruthParticle*> matched_hadrons;
371 // Use a while to go through the HF hadrons in mainHadronMap and partons in partonsOrigin.
372 while (matched_partons.size()<partonsOrigin.size() && matched_hadrons.size()<mainHadronMap.size()){
373 // Create a float variable to store the DeltaR between a parton and the closest hadron.
374 float dR=999.;
375 // Create two pointers for TruthParticle type to go through the partons and hadrons.
376 const xAOD::TruthParticle* hadron=nullptr;
377 const xAOD::TruthParticle* parton=nullptr;
378 // Use a for to go through the partonsOrigin.
379 for(std::map<const xAOD::TruthParticle*, HF_id>::iterator itr = partonsOrigin.begin(); itr!=partonsOrigin.end(); ++itr){
380 // Check if the parton has already been matched to an hadron.
381 if(std::find(matched_partons.begin(), matched_partons.end(), (*itr).first) != matched_partons.end()) continue;
382 // Extract the pt of the parton.
383 TVector3 v, vtmp;
384 if ((*itr).first->pt()>0.)
385 v.SetPtEtaPhi((*itr).first->pt(),(*itr).first->eta(),(*itr).first->phi());
386 else // Protection against FPE from eta and phi calculation
387 v.SetXYZ(0.,0.,(*itr).first->pz());
388 // Use a for to go through the HF hadrons in mainHadronMap.
389 for(std::map<const xAOD::TruthParticle*, int>::iterator it = mainHadronMap.begin(); it!=mainHadronMap.end(); ++it){
390 // Check if the hadron has already been matched to a parton.
391 if(std::find(matched_hadrons.begin(), matched_hadrons.end(), (*it).first) != matched_hadrons.end()) continue;
392 // Check if the hadron's flavour matches the one of the parton.
393 if((*it).second != (*itr).first->absPdgId()) continue;
394 // Extract the pt of the hadron.
395 vtmp.SetPtEtaPhi((*it).first->pt(),(*it).first->eta(),(*it).first->phi());
396 // Compute Delta R between hadron and parton and store in dR if it is smaller than the current value.
397 // Also store the parton and hadron in the pointers that have been previous created.
398 if(vtmp.DeltaR(v) < dR){
399 dR = vtmp.DeltaR(v);
400 hadron = (*it).first;
401 parton = (*itr).first;
402 }
403 }//loop hadrons
404 }//loop partons
405 // Add the matched part-hadron pair in the corresponding maps.
406 matched_partons.push_back(parton);
407 matched_hadrons.push_back(hadron);
408 hadronsPartons[ hadron ] = parton;
409 }
410
411 // Use a for to go through the HF hadrons in mainHadronMap.
412 for(std::map<const xAOD::TruthParticle*, int>::iterator it = mainHadronMap.begin(); it!=mainHadronMap.end(); ++it){
413 // Extract the current hadron.
414 const xAOD::TruthParticle* hadron = (*it).first;
415 // Check if the hadron has been matched to a parton.
416 // If it has been matched to any hadron, use it to determine the origin.
417 // Otherwise, the hadron is considered extra.
418 if(hadronsPartons.find(hadron)!=hadronsPartons.end()){
419 hadronsOrigin[hadron] = partonsOrigin[ hadronsPartons[hadron] ];
420 } else{
421 hadronsOrigin[hadron] = extrajet;
422 }
423 }
424 return hadronsOrigin;
425 }
void buildPartonsHadronsMaps(const EventContext &ctx, std::map< const xAOD::TruthParticle *, int > &mainHadronMap, std::map< const xAOD::TruthParticle *, HF_id > &partonsOrigin) const

◆ initialize()

StatusCode DerivationFramework::HadronOriginClassifier::initialize ( )
overridevirtual

Definition at line 36 of file HadronOriginClassifier.cxx.

36 {
37 ATH_MSG_INFO("Initialize " );
38 ATH_MSG_INFO("DSID " << m_DSID );
39
40 ATH_CHECK(m_mcName.initialize());
41
42 static const std::vector<Sample> samples = {
43 // all Herwig++/Herwig7 showered samples
44 {346346, 346348, GEN_id::HerwigPP},
45 {410003, GEN_id::HerwigPP}, {410008, GEN_id::HerwigPP}, //aMC@NLO+Hpp
46 {410004, GEN_id::HerwigPP}, {410163, GEN_id::HerwigPP}, //Powheg+Hpp
47 {410232, 410233, GEN_id::HerwigPP}, //first attempt for Powheg+H7 / aMC@NLO+H7
48 {410525, 410530, GEN_id::HerwigPP}, //New Powheg+H7 samples
49 {407037, 407040, GEN_id::HerwigPP}, //Powheg+Hpp MET/HT sliced
50 {410536, 410537, GEN_id::HerwigPP}, {410245, GEN_id::HerwigPP}, //aMC@NLO+H++ , ttbb
51 {410557, 410559, GEN_id::HerwigPP}, // new Powheg+H7, mc16
52 {411082, 411090, GEN_id::HerwigPP}, //Powheg+H7 HF-filtered
53 {407354, 407356, GEN_id::HerwigPP}, //Powheg+H7 ttbar HT-filtered
54 {411233, 411234, GEN_id::HerwigPP}, //Powheg+H7.1.3 ttbar
55 {411316, GEN_id::HerwigPP}, //Powheg+H7 allhad ttbar
56 {411329, 411334, GEN_id::HerwigPP}, //Powheg+H7.1.3 ttbar HF-filtered
57 {411335, 411337, GEN_id::HerwigPP}, //Powheg+H7.1.3 ttbar HT-filtered
58 {412116, 412117, GEN_id::HerwigPP}, //amc@NLO+H7.1.3 ttbar
59 {504329, GEN_id::HerwigPP}, {504333, GEN_id::HerwigPP}, {504341, GEN_id::HerwigPP}, //amc@NLO+H7.2.1 refined ttZ
60 {601239, 601240, GEN_id::HerwigPP},
61 {601668, GEN_id::HerwigPP},
62 {603905, 603906, GEN_id::HerwigPP}, // ttbb Powheg+H7 dilep, ljet, allhad
63 {504337, GEN_id::HerwigPP}, {504345, GEN_id::HerwigPP}, // aMC@NLO+H7 ttZ
64 {526034, GEN_id::HerwigPP}, // aMC@NLO+H7 4tops
65 {600666, 600667, GEN_id::HerwigPP}, // Powheg+H7 ttbar H7UE
66 {601414, 601415, GEN_id::HerwigPP}, // Powheg+H7 ttbar A14
67 {602635, 602635, GEN_id::HerwigPP}, // Powheg+H7 ttH PDF4LHC21
68 {602846, 602849, GEN_id::HerwigPP}, // Powheg+H7 ttW NNPDF30NLO EW
69
70 // all Pythia8 showered samples
71 {304014, GEN_id::Pythia8}, // amc@NLO+P8 3top
72 {346229, 346234, GEN_id::Pythia8}, // amc@NLO+P8 tHjb
73 {410006, GEN_id::Pythia8}, //Powheg+P8 old main31
74 {410081, GEN_id::Pythia8}, //amc@NLO+P8 ttV
75 {410500, GEN_id::Pythia8}, //Powheg+P8 new main31, hdamp=mt
76 {410501, 410508, GEN_id::Pythia8}, //Powheg+P8 new main31, hdamp=1.5m // Boosted samples are included 410507 410508
77 {410511, 410524, GEN_id::Pythia8}, //Powheg+P8 new main31, hdamp=1.5mt, radiation systematics
78 {410531, 410535, GEN_id::Pythia8}, //Powheg+P8 allhad samples
79 {346343, 346345, GEN_id::Pythia8}, //Powheg+P8 ttH
80 {412123, GEN_id::Pythia8}, // MG+P8 ttW
81 {410155, GEN_id::Pythia8}, // aMC@NlO+P8 ttW
82 {410159, 410160, GEN_id::Pythia8}, //aMC@NLO+P8, old settings
83 {410218, 410220, GEN_id::Pythia8}, // aMC@NlO+P8 ttZ
84 {410276, 410278, GEN_id::Pythia8}, // aMC@NlO+P8 ttZ_lowMass
85 {410225, 410227, GEN_id::Pythia8}, {410274, 410275, GEN_id::Pythia8}, //aMC@NLO+P8, new settings
86 {410568, 410569, GEN_id::Pythia8}, // nonallhad boosted c-filtered
87 {410244, GEN_id::Pythia8}, //aMC@NLO+P8, ttbb (old)
88 {410441, 410442, GEN_id::Pythia8}, //new aMC@NLO+P8 mc16, new shower starting scale
89 {410464, 410466, GEN_id::Pythia8}, //new aMC@NLO+P8 mc16, new shower starting scale, no shower weights
90 {410470, 410472, GEN_id::Pythia8}, {410480, 410482, GEN_id::Pythia8}, //new Powheg+P8 mc16
91 {410452, GEN_id::Pythia8}, //new aMC@NLO+P8 FxFx mc16
92 {411073, 411081, GEN_id::Pythia8}, //Powheg+P8 HF-filtered
93 {412043, 412044, GEN_id::Pythia8}, {500326, GEN_id::Pythia8}, //aMC@NLO+P8 4top
94 {412066, 412074, GEN_id::Pythia8}, //aMC@NLO+P8 HF-filtered
95 {411068, 411070, GEN_id::Pythia8}, //Powheg+P8 ttbb
96 {410265, 410267, GEN_id::Pythia8}, //aMC@NLO+P8 ttbb
97 {411178, 411180, GEN_id::Pythia8}, {411275, GEN_id::Pythia8}, //Powheg+P8 ttbb OTF production - ATLMCPROD-7240
98 {501720, GEN_id::Pythia8}, // aMC@NLO+P8 FxFx ttW
99 {600791, 600792, GEN_id::Pythia8}, //Powheg+P8 ttbb - ATLMCPROD-9179
100 {600737, 600738, GEN_id::Pythia8}, //Powheg+P8 ttbb - ATLMCPROD-9179
101 {601226, 601228, GEN_id::Pythia8}, // Powheg+P8 ttbb bornzerodamp cut 5, ATLMCPROD-9694
102 {407342, 407344, GEN_id::Pythia8}, {411391, GEN_id::Pythia8}, //Powheg+P8 ttbar HT-filtered
103 {407345, 407347, GEN_id::Pythia8}, //Powheg+P8 ttbar MET-filtered
104 {407348, 407350, GEN_id::Pythia8}, //aMC@NLO+P8 ttbar HT-filtered
105 {504330, 504332, GEN_id::Pythia8}, {504334, 504336, GEN_id::Pythia8}, {504338, GEN_id::Pythia8}, {504342, 504344, GEN_id::Pythia8}, {504346, GEN_id::Pythia8}, //aMC@NLO+P8 refined ttZ
106 {601491, 601492, GEN_id::Pythia8}, //Pow+Py8 ttbar pTHard variations - ATLMCPROD-10168
107 {601495, 601498, GEN_id::Pythia8}, //Pow+Py8 ttbar pTHard variations - ATLMCPROD-10168
108 {601229, 601230, GEN_id::Pythia8}, // mc23 ttbar dilep, singlelep
109 {601237, GEN_id::Pythia8}, // mc23 ttbar allhad
110 {601398, 601399, GEN_id::Pythia8}, // mc23 ttbar dilep, singlelep hdamp517p5
111 {601491, GEN_id::Pythia8}, {601495, GEN_id::Pythia8}, {601497, GEN_id::Pythia8}, // mc23 ttbar pThard variations, dilep, singlelep, allhad
112 {601783, 601784, GEN_id::Pythia8}, // Powheg+P8 ttbb bornzerodamp cut 5 pThard variations - ATLMCPROD-10527
113 {603003, 603004, GEN_id::Pythia8}, // Powheg+P8 ttbb nominal and pthard1 allhad
114 {603190, 603193, GEN_id::Pythia8}, // Powheg+P8 ttbb nominal and pthard1 dilep, ljet
115 {604482, 604483, GEN_id::Pythia8}, // mc23 Powheg+P8 ttbar recoilToTop
116 {411369, 411374, GEN_id::Pythia8}, // PP8 ttbar Var1
117 {411290, GEN_id::Pythia8}, // PP8 ttbar rb1p05
118 {508792, GEN_id::Pythia8}, // aMC@NLO+P8 ttbar smeftsim
119 {510203, GEN_id::Pythia8}, // aMC@NLO+P8 4tops
120 {522035, 522038, GEN_id::Pythia8}, // aMC@NLO+P8 ttZqq
121 {523243, GEN_id::Pythia8}, // aMC@NLO+P8 4tops
122 {601356, 601357, GEN_id::Pythia8}, // PP8 ttbar Trec
123 {602067, 602072, GEN_id::Pythia8}, // PP8 ttH pthard1/2
124 {602637, GEN_id::Pythia8}, // PP8 ttH PDF4LHC21
125 {602852, 602853, GEN_id::Pythia8}, // PP8 ttH PDF4LHC21 pthard1
126 {602886, 602889, GEN_id::Pythia8}, // PP8 ttW NNPDF23
127 {603851, 603854, GEN_id::Pythia8}, // PP8 ggH
128 {604224, GEN_id::Pythia8}, // PP8 ttH allhad HTop
129
130 // all Sherpa showered samples
131 {410186, 410189, GEN_id::Sherpa}, //Sherpa 2.2.0
132 {410249, 410252, GEN_id::Sherpa}, //Sherpa 2.2.1
133 {410342, 410347, GEN_id::Sherpa}, //Sherpa 2.2.1 sys
134 {410350, 410355, GEN_id::Sherpa}, //Sherpa 2.2.1 sys
135 {410357, 410359, GEN_id::Sherpa}, //Sherpa 2.2.1 sys
136 {410361, 410367, GEN_id::Sherpa}, //Sherpa 2.2.1 sys
137 {410281, 410283, GEN_id::Sherpa}, //Sherpa BFilter
138 {410051, GEN_id::Sherpa}, //Sherpa ttbb (ICHEP sample)
139 {410323, 410325, GEN_id::Sherpa}, {410369, GEN_id::Sherpa}, //New Sherpa 2.2.1 ttbb
140 {364345, 364348, GEN_id::Sherpa}, //Sherpa 2.2.4 (test)
141 {410424, 410427, GEN_id::Sherpa}, //Sherpa 2.2.4
142 {410661, 410664, GEN_id::Sherpa}, //Sherpa 2.2.4 ttbb
143 {421152, 421158, GEN_id::Sherpa}, //Sherpa2.2.8 ttbar
144 {413023, GEN_id::Sherpa}, // sherpa 2.2.1 ttZ
145 {700000, GEN_id::Sherpa}, // Sherpa 2.2.8 ttW
146 {700168, GEN_id::Sherpa}, // Sherpa 2.2.10 ttW
147 {700205, GEN_id::Sherpa}, // Sherpa 2.2.10 ttW EWK
148 {700309, GEN_id::Sherpa}, // Sherpa 2.2.11 ttZ
149 {700051, 700054, GEN_id::Sherpa}, //Sherpa2.2.8 ttbb
150 {700121, 700124, GEN_id::Sherpa}, //Sherpa2.2.10 ttbar
151 {700164, 700167, GEN_id::Sherpa}, //Sherpa2.2.10 ttbb
152 {700807, 700809, GEN_id::Sherpa}, //Sherpa2.2.14 ttbar
153 {700659, 700662, GEN_id::Sherpa}, // Sherpa 2.2.12 ttbar maxHTavrgTopPT
154 {700712, GEN_id::Sherpa}, // Sherpa 2.2.14 4tops muQHT2
155 {700986, 700997, GEN_id::Sherpa}, // Sherpa 2.2.14 ttW
156 {701251, 701259, GEN_id::Sherpa}, // Sherpa ttW
157
158 // everything else from HFDSIDList
159 // and the mc20/mc23 central pages as of Sept 2025
160 {301528, 301532, GEN_id::Pythia6},
161 {301539, GEN_id::Sherpa},
162 {302910, 302924, GEN_id::Sherpa},
163 {303480, 303487, GEN_id::Sherpa},
164 {303722, 303726, GEN_id::Pythia6},
165 {306600, 306617, GEN_id::Sherpa},
166 {307479, 307502, GEN_id::Sherpa},
167 {343362, GEN_id::Pythia6},
168 {343431, 343434, GEN_id::Pythia8},
169 {343637, GEN_id::Pythia6},
170 {343852, 343854, GEN_id::Pythia8},
171 {344171, GEN_id::Pythia6},
172 {345935, GEN_id::Pythia8},
173 {345951, GEN_id::Pythia8},
174 {346031, GEN_id::Pythia8},
175 {407009, 407012, GEN_id::Pythia6},
176 {407029, 407036, GEN_id::Pythia6},
177 {407041, 407048, GEN_id::Pythia8},
178 {407200, 407204, GEN_id::Pythia8},
179 {407320, 407321, GEN_id::Pythia8},
180 {407322, 407323, GEN_id::Pythia6},
181 {407324, 407335, GEN_id::Pythia8},
182 {407351, 407353, GEN_id::Pythia8},
183 {407357, 407359, GEN_id::HerwigPP},
184 {410000, 410002, GEN_id::Pythia6},
185 {410007, GEN_id::Pythia6},
186 {410009, GEN_id::Pythia6},
187 {410021, 410024, GEN_id::Sherpa},
188 {410028, 410029, GEN_id::Pythia8},
189 {410037, 410046, GEN_id::Pythia6},
190 {410052, 410058, GEN_id::Sherpa},
191 {410060, GEN_id::HerwigPP},
192 {410066, 410070, GEN_id::Pythia8},
193 {410073, GEN_id::Pythia8},
194 {410075, GEN_id::Pythia8},
195 {410082, 410084, GEN_id::Pythia8},
196 {410087, 410089, GEN_id::Pythia8},
197 {410111, 410116, GEN_id::Pythia8},
198 {410120, 410121, GEN_id::Pythia6},
199 {410142, 410144, GEN_id::Sherpa},
200 {410156, 410157, GEN_id::Pythia8},
201 {410161, 410162, GEN_id::Pythia6},
202 {410175, 410176, GEN_id::Pythia8},
203 {410178, 410179, GEN_id::Pythia8},
204 {410181, 410182, GEN_id::Pythia8},
205 {410184, 410185, GEN_id::Sherpa},
206 {410190, 410213, GEN_id::Pythia8},
207 {410234, GEN_id::Pythia8},
208 {410248, GEN_id::Pythia8},
209 {410257, 410262, GEN_id::Pythia8},
210 {410284, 410322, GEN_id::Pythia8},
211 {410326, 410339, GEN_id::Sherpa},
212 {410368, GEN_id::Pythia8},
213 {410370, 410394, GEN_id::Pythia8},
214 {410395, 410396, GEN_id::HerwigPP},
215 {410397, 410399, GEN_id::Pythia8},
216 {410404, 410405, GEN_id::Pythia8},
217 {410410, 410413, GEN_id::Pythia8},
218 {410420, 410423, GEN_id::Sherpa},
219 {410428, 410431, GEN_id::Pythia8},
220 {410432, 410433, GEN_id::HerwigPP},
221 {410434, 410435, GEN_id::Pythia8},
222 {410444, 410445, GEN_id::Pythia8},
223 {410446, GEN_id::HerwigPP},
224 {410447, GEN_id::Pythia8},
225 {410467, GEN_id::Pythia8},
226 {410468, GEN_id::HerwigPP},
227 {410469, GEN_id::Pythia8},
228 {410491, 410498, GEN_id::Pythia8},
229 {410509, GEN_id::Pythia8},
230 {410542, GEN_id::Pythia8},
231 {410544, GEN_id::Pythia8},
232 {410545, 410546, GEN_id::HerwigPP},
233 {410555, GEN_id::HerwigPP},
234 {410633, 410637, GEN_id::Pythia8},
235 {410690, 410691, GEN_id::Pythia8},
236 {411000, 411005, GEN_id::Pythia8},
237 {411044, 411059, GEN_id::Pythia8},
238 {411125, 411142, GEN_id::HerwigPP},
239 {411143, 411160, GEN_id::Pythia8},
240 {411168, GEN_id::HerwigPP},
241 {411169, GEN_id::Pythia8},
242 {411235, 411268, GEN_id::Pythia8},
243 {411269, GEN_id::HerwigPP},
244 {411278, GEN_id::Pythia6},
245 {411279, 411281, GEN_id::Pythia8},
246 {411282, GEN_id::HerwigPP},
247 {411286, GEN_id::Pythia8},
248 {411288, 411289, GEN_id::Pythia8},
249 {411292, 411307, GEN_id::Pythia8},
250 {411310, GEN_id::Pythia8},
251 {412008, 412014, GEN_id::Pythia8},
252 {412017, 412025, GEN_id::Pythia8},
253 {412028, 412036, GEN_id::Pythia8},
254 {412039, 412040, GEN_id::Pythia8},
255 {412090, 412092, GEN_id::HerwigPP},
256 {412112, 412114, GEN_id::Pythia8},
257 {412175, GEN_id::HerwigPP},
258 {413005, GEN_id::Sherpa},
259 {413008, GEN_id::Sherpa},
260 {413022, GEN_id::Sherpa},
261 {426072, GEN_id::Pythia6},
262 {426075, 426078, GEN_id::Pythia6},
263 {426082, GEN_id::Pythia6},
264 {426085, 426088, GEN_id::Pythia6},
265 {426090, 426097, GEN_id::Pythia6},
266 {500462, 500463, GEN_id::Pythia8},
267 {500800, GEN_id::Pythia8},
268 {502957, 502958, GEN_id::Pythia8},
269 {504553, GEN_id::HerwigPP},
270 {504554, GEN_id::Pythia8},
271 {504689, GEN_id::HerwigPP},
272 {508772, 508773, GEN_id::Pythia8},
273 {508780, GEN_id::HerwigPP},
274 {508781, GEN_id::Pythia8},
275 {508985, 508986, GEN_id::Pythia8},
276 {510212, 510213, GEN_id::Pythia8},
277 {521379, 521380, GEN_id::Pythia8},
278 {521384, 521385, GEN_id::Pythia8},
279 {522023, 522026, GEN_id::Pythia8},
280 {522027, GEN_id::HerwigPP},
281 {522028, 522030, GEN_id::Pythia8},
282 {522031, GEN_id::HerwigPP},
283 {522032, 522034, GEN_id::Pythia8},
284 {522039, GEN_id::HerwigPP},
285 {522040, 522042, GEN_id::Pythia8},
286 {542859, 542860, GEN_id::Pythia8},
287 {542867, 542868, GEN_id::Pythia8},
288 {545023, 545024, GEN_id::Pythia8},
289 {545025, 545026, GEN_id::HerwigPP},
290 {545790, 545791, GEN_id::Pythia8},
291 {561980, GEN_id::Pythia8},
292 {561982, 561990, GEN_id::Pythia8},
293 {600031, GEN_id::Pythia8},
294 {600638, 600639, GEN_id::Pythia8},
295 {600668, GEN_id::HerwigPP},
296 {600787, 600790, GEN_id::HerwigPP},
297 {600793, 600796, GEN_id::Pythia8},
298 {601284, GEN_id::Pythia8},
299 {601403, GEN_id::Pythia8},
300 {601407, GEN_id::Pythia8},
301 {601607, GEN_id::HerwigPP},
302 {601656, GEN_id::Pythia8},
303 {601669, 601670, GEN_id::Pythia8},
304 {601672, GEN_id::Pythia8},
305 {601708, GEN_id::Pythia8},
306 {602423, GEN_id::Pythia8},
307 {602636, GEN_id::HerwigPP},
308 {602638, GEN_id::Pythia8},
309 {602646, 602647, GEN_id::Pythia8},
310 {602687, 602688, GEN_id::Pythia8},
311 {602843, 602844, GEN_id::Pythia8},
312 {602850, 602851, GEN_id::Pythia8},
313 {603011, 603013, GEN_id::Pythia8},
314 {603855, 603856, GEN_id::HerwigPP},
315 {603872, 603873, GEN_id::Pythia8},
316 {603986, 603989, GEN_id::Pythia8},
317 {604008, 604009, GEN_id::HerwigPP},
318 {604018, 604021, GEN_id::Pythia8},
319 {604468, 604481, GEN_id::Pythia8},
320 {700706, GEN_id::Sherpa},
321 {700737, 700756, GEN_id::Sherpa},
322 {700810, GEN_id::Sherpa},
323 {701260, 701262, GEN_id::Sherpa},
324 {701265, 701282, GEN_id::Sherpa},
325 {802380, 802381, GEN_id::Pythia8},
326 {950787, GEN_id::Pythia8},
327 };
328
329 // Linear search for sample and assign properties:
330 for (const auto& s : samples) {
331 if (m_DSID>=s.low && m_DSID<=s.high) {
332 m_GenUsed = s.gen;
333 return StatusCode::SUCCESS;
334 }
335 }
336
337 // the default is Pythia6, so no need to list the Pythia6 showered samples
338 // these are:
339 // 410000-410002
340 // 410007, 410009, 410120-410121
341 // 301528-301532
342 // 303722-303726
343 // 407009-407012
344 // 407029-407036
345 // 410120
346 // 426090-426097
347 // 429007
349
350 return StatusCode::SUCCESS;
351 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isCHadronFromB()

bool DerivationFramework::HadronOriginClassifier::isCHadronFromB ( const xAOD::TruthParticle * part,
std::shared_ptr< std::set< const xAOD::TruthParticle * > > checked = nullptr ) const
private

Definition at line 538 of file HadronOriginClassifier.cxx.

538 {
539 if(!MC::isCharmHadron(part)) return false;
540 if (!checked) checked = std::make_shared<std::set<const xAOD::TruthParticle*>>();
541 checked ->insert(part);
542
543 for(unsigned int i=0; i<part->nParents(); ++i){
544 const xAOD::TruthParticle* parent = part->parent(i);
545 if(!parent) continue;
546 if(checked->count(parent)) continue;
547 checked->insert(parent);
548 if( MC::isBottomHadron(parent) ){
549 return true;
550 }
551 if(MC::isCharmHadron(parent)){
552 if(isCHadronFromB(parent))return true;
553 }
554 }
555
556 return false;
557 }

◆ isDirectlyFromGluonQuark()

bool DerivationFramework::HadronOriginClassifier::isDirectlyFromGluonQuark ( const xAOD::TruthParticle * part)
staticprivate

Definition at line 658 of file HadronOriginClassifier.cxx.

658 {
659 if(!part->nParents()) return false;
660 for(unsigned int i=0; i<part->nParents(); ++i){
661 const xAOD::TruthParticle* parent = part->parent(i);
662 if(!parent) continue;
663 if( MC::isPhoton(parent) || parent->absPdgId()<MC::BQUARK ) return true;
664 }
665 return false;
666 }
bool isPhoton(const T &p)
static const int BQUARK

◆ isDirectlyFromQuarkTop()

bool DerivationFramework::HadronOriginClassifier::isDirectlyFromQuarkTop ( const xAOD::TruthParticle * part) const
private

Definition at line 704 of file HadronOriginClassifier.cxx.

704 {
705 if(!part->nParents()) return false;
706 for(unsigned int i=0; i<part->nParents(); ++i){
707 const xAOD::TruthParticle* parent = part->parent(i);
708 if(!parent) continue;
709 if( parent->absPdgId()<MC::TQUARK ) {
710 if(isFromTop(parent)){
711 return true;
712 }
713 else if(isFromWTop(parent)){
714 return true;
715 }
716 }
717 }
718
719 return false;
720 }
bool isFromTop(const xAOD::TruthParticle *part) const
bool isFromWTop(const xAOD::TruthParticle *part) const
static const int TQUARK

◆ isDirectlyFromQuarkTopPythia8()

bool DerivationFramework::HadronOriginClassifier::isDirectlyFromQuarkTopPythia8 ( const xAOD::TruthParticle * part) const
private

Definition at line 749 of file HadronOriginClassifier.cxx.

749 {
750 // First, make sure the consdired particle has a non-null pointer and it has parents.
751 // Otherwise, return false.
752 if(!part->nParents()) return false;
753 // Use a for to go through the parents.
754 for(unsigned int i=0; i<part->nParents(); ++i){
755 // Extract the i-th parent.
756 const xAOD::TruthParticle* parent = part->parent(i);
757 if(!parent) continue;
758 // Check if the parent is a quark different from the top.
759 if( parent->absPdgId()<MC::TQUARK ) {
760 // In this case, the parent is a quark different from top.
761 // Check if it comes from the decay chain of the t->Wb.
762 // If it is the case, return true.
763 if(isFromWTop(parent)){
764 return true;
765 }
766 }
767 }
768 // In this case, any of the parents of the particle comes from t->Wb chaing.
769 // Hence, the particle does not come from the top directly and false is returned.
770 return false;
771 }

◆ isDirectlyFromTop()

bool DerivationFramework::HadronOriginClassifier::isDirectlyFromTop ( const xAOD::TruthParticle * part)
staticprivate

Definition at line 615 of file HadronOriginClassifier.cxx.

615 {
616 // First, make sure the consdired particle has a non-null pointer and it has parents.
617 // Otherwise, return false.
618 if(!part || !part->nParents()) return false;
619 // Go through the parents of the particle.
620 for(unsigned int i=0; i<part->nParents(); ++i){
621 // Extract the i-th parent.
622 const xAOD::TruthParticle* parent = part->parent(i);
623 if(!parent) continue;
624 // If the i-th parent is a top, then return true
625 if( MC::isTop(parent) ) return true;
626 }
627 // If a top is no the parent, then return false.
628 return false;
629 }
bool isTop(const T &p)

◆ isDirectlyFromWTop()

bool DerivationFramework::HadronOriginClassifier::isDirectlyFromWTop ( const xAOD::TruthParticle * part) const
private

Definition at line 640 of file HadronOriginClassifier.cxx.

640 {
641 // First, make sure the consdired particle has a non-null pointer and it has parents.
642 // Otherwise, return false.
643 if(!part || !part->nParents()) return false;
644 // Use a for to go though the parents.
645 for(unsigned int i=0; i<part->nParents(); ++i){
646 // Get the i-th parent.
647 const xAOD::TruthParticle* parent = part->parent(i);
648 if(!parent) continue;
649 if( MC::isW(parent)){
650 if( isFromTop(parent) ) return true;
651 }
652 }
653 // In this case, none of the parents of the particle is a W from top.
654 // Hence, return false.
655 return false;
656 }
bool isW(const T &p)

◆ isDirectlyFSR()

bool DerivationFramework::HadronOriginClassifier::isDirectlyFSR ( const xAOD::TruthParticle * part) const
private

Definition at line 692 of file HadronOriginClassifier.cxx.

692 {
693 if(!part->nParents()) return false;
694 for(unsigned int i=0; i<part->nParents(); ++i){
695 const xAOD::TruthParticle* parent = part->parent(i);
696 if(!parent) continue;
697 if( MC::isPhoton(parent) || MC::isGluon(parent) ){
698 if( isFromQuarkTop( parent ) ) return true;
699 }
700 }
701 return false;
702 }
bool isFromQuarkTop(const xAOD::TruthParticle *part) const
bool isGluon(const T &p)

◆ isDirectlyFSRPythia6()

bool DerivationFramework::HadronOriginClassifier::isDirectlyFSRPythia6 ( const xAOD::TruthParticle * part) const
private

Definition at line 673 of file HadronOriginClassifier.cxx.

673 {
674 if(!part->nParents()) return false;
675 for(unsigned int i=0; i<part->nParents(); ++i){
676 const xAOD::TruthParticle* parent = part->parent(i);
677 if(!parent) continue;
678 if(!MC::isW(parent)) continue;
679 if(MC::isCharm(part)){
680 //trick to get at least 50% of PowhegPythia c from FSR
681 if(part->pdgId()==-(parent->pdgId())/6){
682 if( isFromGluonQuark(parent) ) return true;
683 }
684 }
685 else{
686 if( isFromGluonQuark(parent) ) return true;
687 }
688 }
689 return false;
690 }
bool isFromGluonQuark(const xAOD::TruthParticle *part) const

◆ isDirectlyFSRPythia8()

bool DerivationFramework::HadronOriginClassifier::isDirectlyFSRPythia8 ( const xAOD::TruthParticle * part) const
private

Definition at line 729 of file HadronOriginClassifier.cxx.

729 {
730 // First, check if the particle has parents and return false if it does not.
731 if(!part->nParents()) return false;
732 // Use a for to go through the parents.
733 for(unsigned int i=0; i<part->nParents(); ++i){
734
735 // Extract the i-th parent.
736
737 const xAOD::TruthParticle* parent = part->parent(i);
738 if(!parent) continue;
739 if( MC::isPhoton(parent) || MC::isGluon(parent) ){
740 if( isFromQuarkTopPythia8( parent ) ) return true;
741 }
742 }
743 // In this case, no parent from the particle is a gluon or a photon coming from a top
744 // Hence, the particle is not from FSR and false is not returned.
745 return false;
746 }
bool isFromQuarkTopPythia8(const xAOD::TruthParticle *part) const

◆ isDirectlyMPIPythia6()

bool DerivationFramework::HadronOriginClassifier::isDirectlyMPIPythia6 ( const xAOD::TruthParticle * part)
staticprivate

Definition at line 781 of file HadronOriginClassifier.cxx.

781 {
782 if(!part->nParents()) return false;
783 for(unsigned int i=0; i<part->nParents(); ++i){
784 const xAOD::TruthParticle* parent = part->parent(i);
785 if(!parent) continue;
786 if( parent->absPdgId() == MC::PROTON && MC::isPhysical(part) ) return true;
787 }
788 return false;
789 }
static const int PROTON
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.

◆ isDirectlyMPIPythia8()

bool DerivationFramework::HadronOriginClassifier::isDirectlyMPIPythia8 ( const xAOD::TruthParticle * part) const
private

Definition at line 791 of file HadronOriginClassifier.cxx.

791 {
792 const xAOD::TruthParticle* initpart = findInitial(part);
793 return MC::Pythia8::isConditionC(initpart);
794 }
bool isConditionC(const T &p)

◆ isDirectlyMPISherpa()

bool DerivationFramework::HadronOriginClassifier::isDirectlyMPISherpa ( const xAOD::TruthParticle * part)
staticprivate

Definition at line 796 of file HadronOriginClassifier.cxx.

796 {
797 if(!part->hasProdVtx()) return false;
798 const xAOD::TruthVertex* vertex = part->prodVtx();
799 return HepMC::status(vertex) == 2;
800 }
int status(const T &p)
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15

◆ isFromGluonQuark()

bool DerivationFramework::HadronOriginClassifier::isFromGluonQuark ( const xAOD::TruthParticle * part) const
private

Definition at line 668 of file HadronOriginClassifier.cxx.

668 {
669 const xAOD::TruthParticle* initpart = findInitial(part);
670 return isDirectlyFromGluonQuark(initpart);
671 }
static bool isDirectlyFromGluonQuark(const xAOD::TruthParticle *part)

◆ isFromQuarkTop()

bool DerivationFramework::HadronOriginClassifier::isFromQuarkTop ( const xAOD::TruthParticle * part) const
private

Definition at line 722 of file HadronOriginClassifier.cxx.

722 {
723 const xAOD::TruthParticle* initpart = findInitial(part);
724 return isDirectlyFromQuarkTop(initpart);
725 }
bool isDirectlyFromQuarkTop(const xAOD::TruthParticle *part) const

◆ isFromQuarkTopPythia8()

bool DerivationFramework::HadronOriginClassifier::isFromQuarkTopPythia8 ( const xAOD::TruthParticle * part) const
private

Definition at line 774 of file HadronOriginClassifier.cxx.

774 {
775 // Find the first parent of the considered particle that is different from the particle.
776 const xAOD::TruthParticle* initpart = findInitial(part);
777 // Check if this parent comes from the top with function isDirectlyFromQuarkTopPythia8.
778 return isDirectlyFromQuarkTopPythia8(initpart);
779 }
bool isDirectlyFromQuarkTopPythia8(const xAOD::TruthParticle *part) const

◆ isFromTop()

bool DerivationFramework::HadronOriginClassifier::isFromTop ( const xAOD::TruthParticle * part) const
private

Definition at line 607 of file HadronOriginClassifier.cxx.

607 {
608 // Find the first parent of the considered particle that is different from the particle.
609 const xAOD::TruthParticle* initpart = findInitial(part);
610 // Check if this parent comes from the top with function isDirectlyFromTop.
611 return isDirectlyFromTop(initpart);
612 }

◆ isFromWTop()

bool DerivationFramework::HadronOriginClassifier::isFromWTop ( const xAOD::TruthParticle * part) const
private

Definition at line 633 of file HadronOriginClassifier.cxx.

633 {
634 // Find the first parent of the considered particle that is different from the particle.
635 const xAOD::TruthParticle* initpart = findInitial(part);
636 return isDirectlyFromWTop(initpart);
637 }

◆ IsHerwigPP()

bool DerivationFramework::HadronOriginClassifier::IsHerwigPP ( ) const
inlineprivate

Definition at line 83 of file HadronOriginClassifier.h.

◆ IsPythia6()

bool DerivationFramework::HadronOriginClassifier::IsPythia6 ( ) const
inlineprivate

Definition at line 85 of file HadronOriginClassifier.h.

85{return m_GenUsed==GEN_id::Pythia6;};

◆ IsPythia8()

bool DerivationFramework::HadronOriginClassifier::IsPythia8 ( ) const
inlineprivate

Definition at line 84 of file HadronOriginClassifier.h.

84{return m_GenUsed==GEN_id::Pythia8;};

◆ IsSherpa()

bool DerivationFramework::HadronOriginClassifier::IsSherpa ( ) const
inlineprivate

Definition at line 86 of file HadronOriginClassifier.h.

86{return m_GenUsed==GEN_id::Sherpa;};

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_DSID

Gaudi::Property<int> DerivationFramework::HadronOriginClassifier::m_DSID {this, "DSID", 410000}
private

Definition at line 91 of file HadronOriginClassifier.h.

91{this, "DSID", 410000};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_GenUsed

GEN_id DerivationFramework::HadronOriginClassifier::m_GenUsed {}
private

Definition at line 92 of file HadronOriginClassifier.h.

92{};

◆ m_HadronEtaMaxCut

Gaudi::Property<double> DerivationFramework::HadronOriginClassifier::m_HadronEtaMaxCut {this, "HadronetaMaxCut", 2.5}
private

MeV.

Definition at line 90 of file HadronOriginClassifier.h.

90{this, "HadronetaMaxCut", 2.5};

◆ m_HadronPtMinCut

Gaudi::Property<double> DerivationFramework::HadronOriginClassifier::m_HadronPtMinCut {this, "HadronpTMinCut", 5000.}
private

Definition at line 89 of file HadronOriginClassifier.h.

89{this, "HadronpTMinCut", 5000.};

◆ m_mcName

SG::ReadHandleKey<xAOD::TruthEventContainer> DerivationFramework::HadronOriginClassifier::m_mcName {this, "MCCollectionName", "TruthEvents", "TruthEventContainer key"}
private

Definition at line 88 of file HadronOriginClassifier.h.

88{this, "MCCollectionName", "TruthEvents", "TruthEventContainer key"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: