Loading [MathJax]/extensions/tex2jax.js
 |
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 > &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 |
|
bool | isLooping (const xAOD::TruthParticle *part, std::shared_ptr< std::set< const xAOD::TruthParticle * >> checked=nullptr) const |
| init_part needed to detect looping graphs (sherpa) up to know only seen at parton level More...
|
|
const xAOD::TruthParticle * | findInitial (const xAOD::TruthParticle *part, bool looping, std::shared_ptr< std::set< const xAOD::TruthParticle * >> checked=nullptr) const |
|
bool | isFromTop (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isDirectlyFromWTop (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isFromGluonQuark (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isDirectlyFSRPythia6 (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isDirectlyFromQuarkTop (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isFromQuarkTop (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isDirectlyFSR (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isFromWTop (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isDirectlyMPIPythia8 (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isDirectlyFromQuarkTopPythia8 (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isFromQuarkTopPythia8 (const xAOD::TruthParticle *part, bool looping) const |
|
bool | isDirectlyFSRPythia8 (const xAOD::TruthParticle *part, bool looping) const |
|
bool | IsHerwigPP () const |
|
bool | IsPythia8 () const |
|
bool | IsPythia6 () const |
|
bool | IsSherpa () const |
|
bool | IsTtBb () const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 27 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 36 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 229 of file HadronOriginClassifier.cxx.
236 std::set<const xAOD::TruthParticle*> usedHadron;
237 for (
const auto* truthevent : *xTruthEventContainer ) {
239 for(
unsigned int i = 0;
i < truthevent->nTruthParticles();
i++){
246 bool isbquark =
false;
247 bool iscquark =
false;
248 bool isHFhadron =
false;
250 int pdgid = abs(
part->pdgId());
329 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 364 of file HadronOriginClassifier.cxx.
367 usedHadron.insert(ihad);
370 int parent_flav,child_flav;
375 for(
unsigned int j=0; j<ihad->
nChildren(); ++j){
385 if(child_flav!=4 && child_flav!=5)
continue;
387 if(child_flav!=parent_flav)
continue;
393 if(isFinal && !decayed){
395 for(
unsigned int j=0; j<ihad->
nChildren(); ++j){
◆ findInitial()
Definition at line 646 of file HadronOriginClassifier.cxx.
649 if (!checked) checked = std::make_shared<std::set<const xAOD::TruthParticle*>>();
651 for(
unsigned int i=0;
i<
part->nParents(); ++
i){
655 if(checked->count(
parent) && looping)
continue;
◆ GetOriginMap()
Definition at line 161 of file HadronOriginClassifier.cxx.
163 std::map<const xAOD::TruthParticle*, int> mainHadronMap;
164 std::map<const xAOD::TruthParticle*, HF_id> partonsOrigin;
165 std::map<const xAOD::TruthParticle*, const xAOD::TruthParticle*> hadronsPartons;
166 std::map<const xAOD::TruthParticle*, HF_id> hadronsOrigin;
170 std::vector<const xAOD::TruthParticle*> matched_partons;
171 std::vector<const xAOD::TruthParticle*> matched_hadrons;
173 while (matched_partons.size()<partonsOrigin.size() && matched_hadrons.size()<mainHadronMap.size()){
182 if(
std::find(matched_partons.begin(), matched_partons.end(), (*itr).first) != matched_partons.end())
continue;
185 if ((*itr).first->pt()>0.)
186 v.SetPtEtaPhi((*itr).first->pt(),(*itr).first->eta(),(*itr).first->phi());
188 v.SetXYZ(0.,0.,(*itr).first->pz());
192 if(
std::find(matched_hadrons.begin(), matched_hadrons.end(), (*it).first) != matched_hadrons.end())
continue;
194 if((*it).second != abs((*itr).first->pdgId()) )
continue;
196 vtmp.SetPtEtaPhi((*it).first->pt(),(*it).first->eta(),(*it).first->phi());
199 if(vtmp.DeltaR(
v) < dR){
202 parton = (*itr).first;
207 matched_partons.push_back(parton);
208 matched_hadrons.push_back(
hadron);
209 hadronsPartons[
hadron ] = parton;
219 if(hadronsPartons.find(
hadron)!=hadronsPartons.end()){
220 hadronsOrigin[
hadron] = partonsOrigin[ hadronsPartons[
hadron] ];
225 return hadronsOrigin;
◆ initialize()
StatusCode DerivationFramework::HadronOriginClassifier::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 37 of file HadronOriginClassifier.cxx.
41 static const std::vector<Sample> samples = {
92 {504330, 504332,
GEN_id::Pythia8}, {504334, 504336,
GEN_id::Pythia8}, {504338,
GEN_id::Pythia8}, {504342, 504344,
GEN_id::Pythia8}, {504346,
GEN_id::Pythia8},
130 for (
const auto&
s : samples) {
134 return StatusCode::SUCCESS;
151 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 342 of file HadronOriginClassifier.cxx.
344 if (!checked) checked = std::make_shared<std::set<const xAOD::TruthParticle*>>();
345 checked ->insert(
part);
347 for(
unsigned int i=0;
i<
part->nParents(); ++
i){
350 if(checked->count(
parent))
continue;
◆ isDirectlyFromGluonQuark()
bool DerivationFramework::HadronOriginClassifier::isDirectlyFromGluonQuark |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| |
|
staticprivate |
◆ isDirectlyFromQuarkTop()
bool DerivationFramework::HadronOriginClassifier::isDirectlyFromQuarkTop |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isDirectlyFromQuarkTopPythia8()
bool DerivationFramework::HadronOriginClassifier::isDirectlyFromQuarkTopPythia8 |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isDirectlyFromTop()
◆ isDirectlyFromWTop()
bool DerivationFramework::HadronOriginClassifier::isDirectlyFromWTop |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isDirectlyFSR()
bool DerivationFramework::HadronOriginClassifier::isDirectlyFSR |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isDirectlyFSRPythia6()
bool DerivationFramework::HadronOriginClassifier::isDirectlyFSRPythia6 |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isDirectlyFSRPythia8()
bool DerivationFramework::HadronOriginClassifier::isDirectlyFSRPythia8 |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isDirectlyMPIPythia6()
bool DerivationFramework::HadronOriginClassifier::isDirectlyMPIPythia6 |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| |
|
staticprivate |
◆ isDirectlyMPIPythia8()
bool DerivationFramework::HadronOriginClassifier::isDirectlyMPIPythia8 |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isDirectlyMPISherpa()
◆ isFromGluonQuark()
bool DerivationFramework::HadronOriginClassifier::isFromGluonQuark |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isFromQuarkTop()
bool DerivationFramework::HadronOriginClassifier::isFromQuarkTop |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isFromQuarkTopPythia8()
bool DerivationFramework::HadronOriginClassifier::isFromQuarkTopPythia8 |
( |
const xAOD::TruthParticle * |
part, |
|
|
bool |
looping |
|
) |
| const |
|
private |
◆ isFromTop()
◆ isFromWTop()
◆ IsHerwigPP()
bool DerivationFramework::HadronOriginClassifier::IsHerwigPP |
( |
| ) |
const |
|
inlineprivate |
◆ isLooping()
init_part needed to detect looping graphs (sherpa) up to know only seen at parton level
Definition at line 623 of file HadronOriginClassifier.cxx.
625 if(!
part->nParents())
return false;
628 if (!init_part) init_part = std::make_shared<std::set<const xAOD::TruthParticle*>>();
629 init_part->insert(
part);
631 for(
unsigned int i=0;
i<
part->nParents(); ++
i){
637 if( init_part->count(
parent))
return true;
◆ IsPythia6()
bool DerivationFramework::HadronOriginClassifier::IsPythia6 |
( |
| ) |
const |
|
inlineprivate |
◆ IsPythia8()
bool DerivationFramework::HadronOriginClassifier::IsPythia8 |
( |
| ) |
const |
|
inlineprivate |
◆ IsSherpa()
bool DerivationFramework::HadronOriginClassifier::IsSherpa |
( |
| ) |
const |
|
inlineprivate |
◆ IsTtBb()
bool DerivationFramework::HadronOriginClassifier::IsTtBb |
( |
| ) |
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
Gaudi::Property<std::string> DerivationFramework::HadronOriginClassifier::m_mcName {this, "MCCollectionName", "TruthEvents"} |
|
private |
◆ m_ttbb
bool DerivationFramework::HadronOriginClassifier::m_ttbb {false} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
bool isDirectlyMPIPythia8(const xAOD::TruthParticle *part, bool looping) const
Gaudi::Property< int > m_DSID
bool isFromTop(const xAOD::TruthParticle *part, bool looping) const
static bool isDirectlyMPISherpa(const xAOD::TruthParticle *part)
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool isConditionC(const T &p)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool isDirectlyFSR(const xAOD::TruthParticle *part, bool looping) const
bool isBottomHadron(const T &p)
bool isFromGluonQuark(const xAOD::TruthParticle *part, bool looping) const
virtual void setOwner(IDataHandleHolder *o)=0
Author: James Monk (jmonk@cern.ch)
bool isFromQuarkTop(const xAOD::TruthParticle *part, bool looping) 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
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const xAOD::TruthParticle * findInitial(const xAOD::TruthParticle *part, bool looping, std::shared_ptr< std::set< const xAOD::TruthParticle * >> checked=nullptr) const
static bool isDirectlyMPIPythia6(const xAOD::TruthParticle *part, bool looping)
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...
int leadingQuark(const T &p)
Class describing a truth particle in the MC record.
bool isFromWTop(const xAOD::TruthParticle *part, bool looping) const
bool isDirectlyFSRPythia8(const xAOD::TruthParticle *part, bool looping) const
bool isDirectlyFSRPythia6(const xAOD::TruthParticle *part, bool looping) const
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
static bool isDirectlyFromGluonQuark(const xAOD::TruthParticle *part, bool looping)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool isDirectlyFromQuarkTopPythia8(const xAOD::TruthParticle *part, bool looping) const
bool isDirectlyFromQuarkTop(const xAOD::TruthParticle *part, bool looping) const
Class describing a truth vertex in the MC record.
size_t nChildren() const
Number of children of this particle.
static bool isDirectlyFromTop(const xAOD::TruthParticle *part, bool looping)
const TruthParticle_v1 * child(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
Gaudi::Property< std::string > m_mcName
bool isDirectlyFromWTop(const xAOD::TruthParticle *part, bool looping) const
#define ATH_MSG_WARNING(x)
bool isFromQuarkTopPythia8(const xAOD::TruthParticle *part, bool looping) const
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
bool isCharmHadron(const T &p)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void buildPartonsHadronsMaps(std::map< const xAOD::TruthParticle *, int > &mainHadronMap, std::map< const xAOD::TruthParticle *, HF_id > &partonsOrigin) const
bool isLooping(const xAOD::TruthParticle *part, std::shared_ptr< std::set< const xAOD::TruthParticle * >> checked=nullptr) const
init_part needed to detect looping graphs (sherpa) up to know only seen at parton level
bool isCHadronFromB(const xAOD::TruthParticle *part, std::shared_ptr< std::set< const xAOD::TruthParticle * >> checked=nullptr) const