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_id > GetOriginMap (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< StoreGateSvc > StoreGateSvc_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::TruthParticle * findInitial (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::TruthEventContainer > m_mcName {this, "MCCollectionName", "TruthEvents", "TruthEventContainer key"}
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticlesKey {this, "TruthParticlesKey", "TruthParticles", "TruthParticleContainer key"}
SG::ReadHandleKey< xAOD::TruthVertexContainer > m_truthVerticesKey {this, "TruthVerticesKey", "TruthVertices", "TruthVertexContainer 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 30 of file HadronOriginClassifier.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ GEN_id

Enumerator
Pythia6 
Pythia8 
HerwigPP 
Sherpa 

Definition at line 46 of file HadronOriginClassifier.h.

46{ 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 39 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 433 of file HadronOriginClassifier.cxx.

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

565 {
566 // Fist, check that the consdired hadron has a non-null pointer
567 if (!ihad) return;
568 usedHadron.insert(ihad);
569 // Create two variables to indicate the flavour of the parents and childrens particles that will be considered.
570 // Create a boolean to indicate if the particles considered are from the final state.
571 int parent_flav,child_flav;
572 bool isFinal = true;
573 // Check if the considered hadron has children.
574 if(!ihad->nChildren()) return;
575 // Use a for to go through the children.
576 for(unsigned int j=0; j<ihad->nChildren(); ++j){
577 // Extract the j-th children.
578 const xAOD::TruthParticle* child = ihad->child(j);
579 if(!child) continue;
580 if(decayed){
581 fillHadronMap(usedHadron, mainHadronMap,mainhad,child,true);
582 isFinal=false;
583 }
584 else{
585 child_flav = std::abs(MC::leadingQuark(child));
586 if(child_flav!=4 && child_flav!=5) continue;
587 parent_flav = std::abs(MC::leadingQuark(mainhad));
588 if(child_flav!=parent_flav) continue;
589 fillHadronMap(usedHadron, mainHadronMap,mainhad,child);
590 isFinal=false;
591 }
592 }
593
594 if(isFinal && !decayed){
595 mainHadronMap[mainhad]=std::abs(MC::leadingQuark(mainhad));
596 for(unsigned int j=0; j<ihad->nChildren(); ++j){
597 const xAOD::TruthParticle* child = ihad->child(j);
598 if(!child) continue;
599 fillHadronMap(usedHadron, mainHadronMap,mainhad,child,true);
600 }
601 }
602 }
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 814 of file HadronOriginClassifier.cxx.

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

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

◆ 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 543 of file HadronOriginClassifier.cxx.

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

◆ isDirectlyFromGluonQuark()

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

Definition at line 663 of file HadronOriginClassifier.cxx.

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

◆ isDirectlyFromQuarkTop()

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

Definition at line 709 of file HadronOriginClassifier.cxx.

709 {
710 if(!part->nParents()) return false;
711 for(unsigned int i=0; i<part->nParents(); ++i){
712 const xAOD::TruthParticle* parent = part->parent(i);
713 if(!parent) continue;
714 if( parent->absPdgId()<MC::TQUARK ) {
715 if(isFromTop(parent)){
716 return true;
717 }
718 else if(isFromWTop(parent)){
719 return true;
720 }
721 }
722 }
723
724 return false;
725 }
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 754 of file HadronOriginClassifier.cxx.

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

◆ isDirectlyFromTop()

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

Definition at line 620 of file HadronOriginClassifier.cxx.

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

◆ isDirectlyFromWTop()

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

Definition at line 645 of file HadronOriginClassifier.cxx.

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

◆ isDirectlyFSR()

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

Definition at line 697 of file HadronOriginClassifier.cxx.

697 {
698 if(!part->nParents()) return false;
699 for(unsigned int i=0; i<part->nParents(); ++i){
700 const xAOD::TruthParticle* parent = part->parent(i);
701 if(!parent) continue;
702 if( MC::isPhoton(parent) || MC::isGluon(parent) ){
703 if( isFromQuarkTop( parent ) ) return true;
704 }
705 }
706 return false;
707 }
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 678 of file HadronOriginClassifier.cxx.

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

◆ isDirectlyFSRPythia8()

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

Definition at line 734 of file HadronOriginClassifier.cxx.

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

◆ isDirectlyMPIPythia6()

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

Definition at line 786 of file HadronOriginClassifier.cxx.

786 {
787 if(!part->nParents()) return false;
788 for(unsigned int i=0; i<part->nParents(); ++i){
789 const xAOD::TruthParticle* parent = part->parent(i);
790 if(!parent) continue;
791 if( parent->absPdgId() == MC::PROTON && MC::isPhysical(part) ) return true;
792 }
793 return false;
794 }
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 796 of file HadronOriginClassifier.cxx.

796 {
797 const xAOD::TruthParticle* initpart = findInitial(part);
798 return MC::Pythia8::isConditionC(initpart);
799 }
bool isConditionC(const T &p)

◆ isDirectlyMPISherpa()

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

Definition at line 801 of file HadronOriginClassifier.cxx.

801 {
802 if(!part->hasProdVtx()) return false;
803 const xAOD::TruthVertex* vertex = part->prodVtx();
804 return HepMC::status(vertex) == 2;
805 }
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 673 of file HadronOriginClassifier.cxx.

673 {
674 const xAOD::TruthParticle* initpart = findInitial(part);
675 return isDirectlyFromGluonQuark(initpart);
676 }
static bool isDirectlyFromGluonQuark(const xAOD::TruthParticle *part)

◆ isFromQuarkTop()

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

Definition at line 727 of file HadronOriginClassifier.cxx.

727 {
728 const xAOD::TruthParticle* initpart = findInitial(part);
729 return isDirectlyFromQuarkTop(initpart);
730 }
bool isDirectlyFromQuarkTop(const xAOD::TruthParticle *part) const

◆ isFromQuarkTopPythia8()

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

Definition at line 779 of file HadronOriginClassifier.cxx.

779 {
780 // Find the first parent of the considered particle that is different from the particle.
781 const xAOD::TruthParticle* initpart = findInitial(part);
782 // Check if this parent comes from the top with function isDirectlyFromQuarkTopPythia8.
783 return isDirectlyFromQuarkTopPythia8(initpart);
784 }
bool isDirectlyFromQuarkTopPythia8(const xAOD::TruthParticle *part) const

◆ isFromTop()

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

Definition at line 612 of file HadronOriginClassifier.cxx.

612 {
613 // Find the first parent of the considered particle that is different from the particle.
614 const xAOD::TruthParticle* initpart = findInitial(part);
615 // Check if this parent comes from the top with function isDirectlyFromTop.
616 return isDirectlyFromTop(initpart);
617 }

◆ isFromWTop()

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

Definition at line 638 of file HadronOriginClassifier.cxx.

638 {
639 // Find the first parent of the considered particle that is different from the particle.
640 const xAOD::TruthParticle* initpart = findInitial(part);
641 return isDirectlyFromWTop(initpart);
642 }

◆ IsHerwigPP()

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

Definition at line 85 of file HadronOriginClassifier.h.

◆ IsPythia6()

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

Definition at line 87 of file HadronOriginClassifier.h.

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

◆ IsPythia8()

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

Definition at line 86 of file HadronOriginClassifier.h.

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

◆ IsSherpa()

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

Definition at line 88 of file HadronOriginClassifier.h.

88{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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
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 381 of file AthCommonDataStore.h.

◆ m_DSID

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

Definition at line 96 of file HadronOriginClassifier.h.

96{this, "DSID", 410000};

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_GenUsed

GEN_id DerivationFramework::HadronOriginClassifier::m_GenUsed {}
private

Definition at line 97 of file HadronOriginClassifier.h.

97{};

◆ m_HadronEtaMaxCut

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

MeV.

Definition at line 95 of file HadronOriginClassifier.h.

95{this, "HadronetaMaxCut", 2.5};

◆ m_HadronPtMinCut

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

Definition at line 94 of file HadronOriginClassifier.h.

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

◆ m_mcName

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

Definition at line 90 of file HadronOriginClassifier.h.

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

◆ m_truthParticlesKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::HadronOriginClassifier::m_truthParticlesKey {this, "TruthParticlesKey", "TruthParticles", "TruthParticleContainer key"}
private

Definition at line 92 of file HadronOriginClassifier.h.

92{this, "TruthParticlesKey", "TruthParticles", "TruthParticleContainer key"};

◆ m_truthVerticesKey

SG::ReadHandleKey<xAOD::TruthVertexContainer> DerivationFramework::HadronOriginClassifier::m_truthVerticesKey {this, "TruthVerticesKey", "TruthVertices", "TruthVertexContainer key"}
private

Definition at line 93 of file HadronOriginClassifier.h.

93{this, "TruthVerticesKey", "TruthVertices", "TruthVertexContainer key"};

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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