 |
ATLAS Offline Software
|
#include <HadronOriginClassifier.h>
|
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 | GEN_id { GEN_id::Pythia6 =0,
GEN_id::Pythia8 =1,
GEN_id::HerwigPP =2,
GEN_id::Sherpa =3
} |
|
|
| 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 |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) 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 |
|
void | buildPartonsHadronsMaps (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> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 28 of file HadronOriginClassifier.h.
◆ StoreGateSvc_t
◆ GEN_id
◆ 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.
◆ HadronOriginClassifier()
DerivationFramework::HadronOriginClassifier::HadronOriginClassifier |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~HadronOriginClassifier()
DerivationFramework::HadronOriginClassifier::~HadronOriginClassifier |
( |
| ) |
|
|
virtual |
◆ buildPartonsHadronsMaps()
Definition at line 428 of file HadronOriginClassifier.cxx.
430 const EventContext& ctx = Gaudi::Hive::currentContext();
432 if (!xTruthEventContainer.isValid()) {
437 std::set<const xAOD::TruthParticle*> usedHadron;
438 for (
const auto* truthevent : *xTruthEventContainer ) {
440 for(
unsigned int i = 0;
i < truthevent->nTruthParticles();
i++){
447 bool isbquark =
false;
448 bool iscquark =
false;
449 bool isHFhadron =
false;
451 int pdgid =
part->absPdgId();
526 if(usedHadron.insert(
part).second) {
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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()
Definition at line 561 of file HadronOriginClassifier.cxx.
564 usedHadron.insert(ihad);
567 int parent_flav,child_flav;
572 for(
unsigned int j=0; j<ihad->
nChildren(); ++j){
582 if(child_flav!=4 && child_flav!=5)
continue;
584 if(child_flav!=parent_flav)
continue;
590 if(isFinal && !decayed){
592 for(
unsigned int j=0; j<ihad->
nChildren(); ++j){
◆ findInitial()
Definition at line 810 of file HadronOriginClassifier.cxx.
813 if (!checked) checked = std::make_shared<std::set<const xAOD::TruthParticle*>>();
815 for(
unsigned int i=0;
i<
part->nParents(); ++
i){
819 if(checked->count(
parent))
continue;
◆ GetOriginMap()
Definition at line 360 of file HadronOriginClassifier.cxx.
362 std::map<const xAOD::TruthParticle*, int> mainHadronMap;
363 std::map<const xAOD::TruthParticle*, HF_id> partonsOrigin;
364 std::map<const xAOD::TruthParticle*, const xAOD::TruthParticle*> hadronsPartons;
365 std::map<const xAOD::TruthParticle*, HF_id> hadronsOrigin;
369 std::vector<const xAOD::TruthParticle*> matched_partons;
370 std::vector<const xAOD::TruthParticle*> matched_hadrons;
372 while (matched_partons.size()<partonsOrigin.size() && matched_hadrons.size()<mainHadronMap.size()){
381 if(
std::find(matched_partons.begin(), matched_partons.end(), (*itr).first) != matched_partons.end())
continue;
384 if ((*itr).first->pt()>0.)
385 v.SetPtEtaPhi((*itr).first->pt(),(*itr).first->eta(),(*itr).first->phi());
387 v.SetXYZ(0.,0.,(*itr).first->pz());
391 if(
std::find(matched_hadrons.begin(), matched_hadrons.end(), (*it).first) != matched_hadrons.end())
continue;
393 if((*it).second != (*itr).first->absPdgId())
continue;
395 vtmp.SetPtEtaPhi((*it).first->pt(),(*it).first->eta(),(*it).first->phi());
398 if(vtmp.DeltaR(
v) < dR){
401 parton = (*itr).first;
406 matched_partons.push_back(parton);
407 matched_hadrons.push_back(
hadron);
408 hadronsPartons[
hadron ] = parton;
418 if(hadronsPartons.find(
hadron)!=hadronsPartons.end()){
419 hadronsOrigin[
hadron] = partonsOrigin[ hadronsPartons[
hadron] ];
424 return hadronsOrigin;
◆ initialize()
StatusCode DerivationFramework::HadronOriginClassifier::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 36 of file HadronOriginClassifier.cxx.
42 static const std::vector<Sample> samples = {
105 {504330, 504332,
GEN_id::Pythia8}, {504334, 504336,
GEN_id::Pythia8}, {504338,
GEN_id::Pythia8}, {504342, 504344,
GEN_id::Pythia8}, {504346,
GEN_id::Pythia8},
330 for (
const auto&
s : samples) {
333 return StatusCode::SUCCESS;
350 return StatusCode::SUCCESS;
◆ inputHandles()
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()
Definition at line 539 of file HadronOriginClassifier.cxx.
541 if (!checked) checked = std::make_shared<std::set<const xAOD::TruthParticle*>>();
542 checked ->insert(
part);
544 for(
unsigned int i=0;
i<
part->nParents(); ++
i){
547 if(checked->count(
parent))
continue;
◆ isDirectlyFromGluonQuark()
◆ isDirectlyFromQuarkTop()
◆ isDirectlyFromQuarkTopPythia8()
bool DerivationFramework::HadronOriginClassifier::isDirectlyFromQuarkTopPythia8 |
( |
const xAOD::TruthParticle * |
part | ) |
const |
|
private |
◆ isDirectlyFromTop()
◆ isDirectlyFromWTop()
◆ isDirectlyFSR()
◆ isDirectlyFSRPythia6()
◆ isDirectlyFSRPythia8()
◆ isDirectlyMPIPythia6()
◆ isDirectlyMPIPythia8()
◆ isDirectlyMPISherpa()
◆ isFromGluonQuark()
◆ isFromQuarkTop()
◆ isFromQuarkTopPythia8()
◆ isFromTop()
◆ isFromWTop()
◆ IsHerwigPP()
bool DerivationFramework::HadronOriginClassifier::IsHerwigPP |
( |
| ) |
const |
|
inlineprivate |
◆ IsPythia6()
bool DerivationFramework::HadronOriginClassifier::IsPythia6 |
( |
| ) |
const |
|
inlineprivate |
◆ IsPythia8()
bool DerivationFramework::HadronOriginClassifier::IsPythia8 |
( |
| ) |
const |
|
inlineprivate |
◆ IsSherpa()
bool DerivationFramework::HadronOriginClassifier::IsSherpa |
( |
| ) |
const |
|
inlineprivate |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_DSID
Gaudi::Property<int> DerivationFramework::HadronOriginClassifier::m_DSID {this, "DSID", 410000} |
|
private |
◆ m_evtStore
◆ m_GenUsed
GEN_id DerivationFramework::HadronOriginClassifier::m_GenUsed {} |
|
private |
◆ m_HadronEtaMaxCut
Gaudi::Property<double> DerivationFramework::HadronOriginClassifier::m_HadronEtaMaxCut {this, "HadronetaMaxCut", 2.5} |
|
private |
◆ m_HadronPtMinCut
Gaudi::Property<double> DerivationFramework::HadronOriginClassifier::m_HadronPtMinCut {this, "HadronpTMinCut", 5000.} |
|
private |
◆ m_mcName
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
bool isDirectlyMPIPythia8(const xAOD::TruthParticle *part) const
Gaudi::Property< int > m_DSID
static bool isDirectlyMPISherpa(const xAOD::TruthParticle *part)
std::string find(const std::string &s)
return a remapped string
bool isFromQuarkTop(const xAOD::TruthParticle *part) const
bool isConditionC(const T &p)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool isFromQuarkTopPythia8(const xAOD::TruthParticle *part) const
bool isFromTop(const xAOD::TruthParticle *part) const
bool isBottomHadron(const T &p)
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadHandleKey< xAOD::TruthEventContainer > m_mcName
bool isDirectlyFSR(const xAOD::TruthParticle *part) const
Author: James Monk (jmonk@cern.ch)
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
const xAOD::TruthParticle * findInitial(const xAOD::TruthParticle *part, std::shared_ptr< std::set< const xAOD::TruthParticle * >> checked=nullptr) const
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
bool isBottom(const T &p)
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 isFromGluonQuark(const xAOD::TruthParticle *part) const
int leadingQuark(const T &p)
bool isDirectlyFromQuarkTop(const xAOD::TruthParticle *part) const
bool isFromWTop(const xAOD::TruthParticle *part) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Class describing a truth particle in the MC record.
bool isDirectlyFromWTop(const xAOD::TruthParticle *part) const
static bool isDirectlyFromGluonQuark(const xAOD::TruthParticle *part)
bool isDirectlyFSRPythia6(const xAOD::TruthParticle *part) const
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Class describing a truth vertex in the MC record.
size_t nChildren() const
Number of children of this particle.
const TruthParticle_v1 * child(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
bool isDirectlyFSRPythia8(const xAOD::TruthParticle *part) const
static bool isDirectlyMPIPythia6(const xAOD::TruthParticle *part)
#define ATH_MSG_WARNING(x)
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
static bool isDirectlyFromTop(const xAOD::TruthParticle *part)
bool isCharmHadron(const T &p)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool isDirectlyFromQuarkTopPythia8(const xAOD::TruthParticle *part) const
void buildPartonsHadronsMaps(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