|
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 { Pythia6 =0,
Pythia8 =1,
HerwigPP =2,
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 31 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 43 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 227 of file HadronOriginClassifier.cxx.
234 std::set<const xAOD::TruthParticle*> usedHadron;
235 for (
const auto* truthevent : *xTruthEventContainer ) {
237 for(
unsigned int i = 0;
i < truthevent->nTruthParticles();
i++){
244 bool isbquark =
false;
245 bool iscquark =
false;
246 bool isHFhadron =
false;
248 int pdgid = abs(
part->pdgId());
252 else if(pdgid == 4 ){
327 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 362 of file HadronOriginClassifier.cxx.
365 usedHadron.insert(ihad);
368 int parent_flav,child_flav;
373 for(
unsigned int j=0; j<ihad->
nChildren(); ++j){
383 if(child_flav!=4 && child_flav!=5)
continue;
385 if(child_flav!=parent_flav)
continue;
391 if(isFinal && !decayed){
393 for(
unsigned int j=0; j<ihad->
nChildren(); ++j){
◆ findInitial()
Definition at line 644 of file HadronOriginClassifier.cxx.
647 if (!checked) checked = std::make_shared<std::set<const xAOD::TruthParticle*>>();
649 for(
unsigned int i=0;
i<
part->nParents(); ++
i){
653 if(checked->count(
parent) && looping)
continue;
◆ GetOriginMap()
Definition at line 159 of file HadronOriginClassifier.cxx.
161 std::map<const xAOD::TruthParticle*, int> mainHadronMap;
162 std::map<const xAOD::TruthParticle*, HF_id> partonsOrigin;
163 std::map<const xAOD::TruthParticle*, const xAOD::TruthParticle*> hadronsPartons;
164 std::map<const xAOD::TruthParticle*, HF_id> hadronsOrigin;
168 std::vector<const xAOD::TruthParticle*> matched_partons;
169 std::vector<const xAOD::TruthParticle*> matched_hadrons;
171 while (matched_partons.size()<partonsOrigin.size() && matched_hadrons.size()<mainHadronMap.size()){
180 if(
std::find(matched_partons.begin(), matched_partons.end(), (*itr).first) != matched_partons.end())
continue;
183 if ((*itr).first->pt()>0.)
184 v.SetPtEtaPhi((*itr).first->pt(),(*itr).first->eta(),(*itr).first->phi());
186 v.SetXYZ(0.,0.,(*itr).first->pz());
190 if(
std::find(matched_hadrons.begin(), matched_hadrons.end(), (*it).first) != matched_hadrons.end())
continue;
192 if((*it).second != abs((*itr).first->pdgId()) )
continue;
194 vtmp.SetPtEtaPhi((*it).first->pt(),(*it).first->eta(),(*it).first->phi());
197 if(vtmp.DeltaR(
v) < dR){
200 parton = (*itr).first;
205 matched_partons.push_back(parton);
206 matched_hadrons.push_back(
hadron);
207 hadronsPartons[
hadron ] = parton;
217 if(hadronsPartons.find(
hadron)!=hadronsPartons.end()){
218 hadronsOrigin[
hadron] = partonsOrigin[ hadronsPartons[
hadron] ];
223 return hadronsOrigin;
◆ initialize()
StatusCode DerivationFramework::HadronOriginClassifier::initialize |
( |
| ) |
|
|
overridevirtual |
◆ 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.
◆ interfaceID()
static const InterfaceID& DerivationFramework::HadronOriginClassifier::interfaceID |
( |
| ) |
|
|
inlinestatic |
◆ isCHadronFromB()
Definition at line 340 of file HadronOriginClassifier.cxx.
342 if (!checked) checked = std::make_shared<std::set<const xAOD::TruthParticle*>>();
343 checked ->insert(
part);
345 for(
unsigned int i=0;
i<
part->nParents(); ++
i){
348 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 621 of file HadronOriginClassifier.cxx.
623 if(!
part->nParents())
return false;
626 if (!init_part) init_part = std::make_shared<std::set<const xAOD::TruthParticle*>>();
627 init_part->insert(
part);
629 for(
unsigned int i=0;
i<
part->nParents(); ++
i){
635 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
int DerivationFramework::HadronOriginClassifier::m_DSID |
|
private |
◆ m_evtStore
◆ m_GenUsed
GEN_id DerivationFramework::HadronOriginClassifier::m_GenUsed |
|
private |
◆ m_HadronEtaMaxCut
double DerivationFramework::HadronOriginClassifier::m_HadronEtaMaxCut |
|
private |
◆ m_HadronPtMinCut
double DerivationFramework::HadronOriginClassifier::m_HadronPtMinCut |
|
private |
◆ m_mcName
std::string DerivationFramework::HadronOriginClassifier::m_mcName |
|
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
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 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)
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
const TruthParticle_v1 * child(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
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