Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI::Map::ProtareBase Class Referenceabstract

#include <GIDI.hpp>

Inheritance diagram for GIDI::Map::ProtareBase:

Public Member Functions

 ProtareBase (HAPI::Node const &a_node, std::string const &a_basePath, Map const *const a_map)
 ~ProtareBase ()
std::string const & projectileID () const
std::string const & targetID () const
std::string const & evaluation () const
std::string const & interaction () const
void setInteraction (std::string const &a_interaction)
bool isMatch (std::string const &a_projectileID, std::string const &a_targetID, std::string const &a_evaluation="") const
std::string const & library () const
std::string const & resolvedLibrary () const
ProtareBase const * findProtareEntry (std::string const &a_projectileID, std::string const &a_targetID, std::string const &a_library="", std::string const &a_evaluation="") const
void findProtareEntries (FindProtareEntries &a_protareEntries, std::regex const &a_projectileID, std::regex const &a_targetID, std::regex const &a_library=std::regex(".*"), std::regex const &a_evaluation=std::regex(".*")) const
virtual GIDI::Protareprotare (Construction::Settings const &a_construction, PoPI::Database const &a_pops, ParticleSubstitution const &a_particleSubstitution) const =0
virtual GIDI::ProtareSingleprotareSingle (Construction::Settings const &a_construction, PoPI::Database const &a_pops, ParticleSubstitution const &a_particleSubstitution) const =0
GUPI::AncestryfindInAncestry3 (LUPI_maybeUnused std::string const &a_item)
GUPI::Ancestry const * findInAncestry3 (LUPI_maybeUnused std::string const &a_item) const
Public Member Functions inherited from GIDI::Map::BaseEntry
 BaseEntry (HAPI::Node const &a_node, std::string const &a_basePath, Map const *a_parent)
virtual ~BaseEntry ()=0
std::string const & name () const
Map const * parent () const
std::string path (PathForm a_form=PathForm::real) const
virtual EntryType entryType () const =0
void libraries (std::vector< std::string > &a_libraries) const
virtual void toXMLList (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const =0
Public Member Functions inherited from GUPI::Ancestry
 Ancestry (std::string const &a_moniker, std::string const &a_attribute="")
virtual ~Ancestry ()
Ancestryoperator= (Ancestry const &a_ancestry)
std::string const & moniker () const
void setMoniker (std::string const &a_moniker)
Ancestryancestor ()
Ancestry const * ancestor () const
void setAncestor (Ancestry *a_ancestor)
std::string attribute () const
Ancestryroot ()
Ancestry const * root () const
bool isChild (Ancestry *a_instance)
bool isParent (Ancestry *a_parent)
bool isRoot () const
AncestryfindInAncestry (std::string const &a_href)
Ancestry const * findInAncestry (std::string const &a_href) const
virtual AncestryfindInAncestry3 (std::string const &a_item)=0
virtual Ancestry const * findInAncestry3 (std::string const &a_item) const =0
virtual LUPI_HOST void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
virtual std::string xlinkItemKey () const
std::string toXLink () const
void printXML () const

Additional Inherited Members

Public Types inherited from GIDI::Map::BaseEntry
enum class  PathForm { entered , cumulative , real }
Static Public Member Functions inherited from GUPI::Ancestry
static std::string buildXLinkItemKey (std::string const &a_name, std::string const &a_key)

Detailed Description

Definition at line 5246 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ ProtareBase()

GIDI::Map::ProtareBase::ProtareBase ( HAPI::Node const & a_node,
std::string const & a_basePath,
Map const *const a_parent )
Parameters
a_node[in] The HAPI::Node to be parsed.
a_basePath[in] A path prepended to this entry's path.
a_parent[in] Pointer to the Map containing this.

Definition at line 264 of file GIDI_map.cc.

264 :
265 BaseEntry( a_node, a_basePath, a_parent ),
266 m_projectileID( a_node.attribute_as_string( GIDI_projectileChars ) ),
267 m_targetID( a_node.attribute_as_string( GIDI_targetChars ) ),
268 m_evaluation( a_node.attribute_as_string( GIDI_evaluationChars ) ),
269 m_interaction( a_node.attribute_as_string( GIDI_interactionChars ) ) {
270
271}
#define GIDI_projectileChars
Definition GIDI.hpp:413
#define GIDI_evaluationChars
Definition GIDI.hpp:415
#define GIDI_targetChars
Definition GIDI.hpp:414
#define GIDI_interactionChars
Definition GIDI.hpp:416
BaseEntry(HAPI::Node const &a_node, std::string const &a_basePath, Map const *a_parent)
Definition GIDI_map.cc:110

Referenced by findProtareEntry(), GIDI::Map::Protare::Protare(), and GIDI::Map::TNSL::TNSL().

◆ ~ProtareBase()

GIDI::Map::ProtareBase::~ProtareBase ( )

Definition at line 276 of file GIDI_map.cc.

276 {
277
278}

Member Function Documentation

◆ evaluation()

std::string const & GIDI::Map::ProtareBase::evaluation ( ) const
inline

◆ findInAncestry3() [1/2]

GUPI::Ancestry * GIDI::Map::ProtareBase::findInAncestry3 ( LUPI_maybeUnused std::string const & a_item)
inline

Always returns nullptr.

Definition at line 5277 of file GIDI.hpp.

◆ findInAncestry3() [2/2]

GUPI::Ancestry const * GIDI::Map::ProtareBase::findInAncestry3 ( LUPI_maybeUnused std::string const & a_item) const
inline

Always returns nullptr.

Definition at line 5278 of file GIDI.hpp.

◆ findProtareEntries()

void GIDI::Map::ProtareBase::findProtareEntries ( FindProtareEntries & a_protareEntries,
std::regex const & a_projectileID,
std::regex const & a_targetID,
std::regex const & a_library = std::regex( ".*" ),
std::regex const & a_evaluation = std::regex( ".*" ) ) const
virtual

Returns the list of all Protare entries that match a_projectileID, a_targetID, a_library and a_evaluation. The arguments a_projectileID, a_targetID, a_library and a_evaluation can be an C++ regex string. An empty string for any of the arguments will match all.

Parameters
a_protareEntries[out] The list of ProtareBase found.
a_projectileID[in] The projectile's id to match.
a_targetID[in] The target's id to match.
a_library[in] The library to match.
a_evaluation[in] The evaluation to match.

Implements GIDI::Map::BaseEntry.

Definition at line 332 of file GIDI_map.cc.

333 {
334
335 if( regex_match( m_projectileID, a_projectileID ) ) {
336 if( regex_match( m_targetID, a_targetID ) ) {
337 if( regex_match( parent( )->library( ), a_library ) ) {
338 if( regex_match( m_evaluation, a_evaluation ) ) a_protareEntries.push_back( this );
339 }
340 }
341 }
342}
Map const * parent() const
Definition GIDI.hpp:5190
std::string const & library() const
Definition GIDI_map.cc:284

◆ findProtareEntry()

ProtareBase const * GIDI::Map::ProtareBase::findProtareEntry ( std::string const & a_projectileID,
std::string const & a_targetID,
std::string const & a_library = "",
std::string const & a_evaluation = "" ) const
virtual

Compares a_projectileID, a_targetID and a_evaluation to this data and returns true if they match and false otherwise. If a_evaluation is an empty string, only a_projectileID and a_targetID are compared.

Parameters
a_projectileID[in] The projectile's id to match.
a_targetID[in] The target's id to match.
a_library[in] The library to match.
a_evaluation[in] The evaluation to match.
Returns
The this pointer if this matches otherwise a nullptr.

Implements GIDI::Map::BaseEntry.

Definition at line 310 of file GIDI_map.cc.

311 {
312
313 if( !PoPI::compareSpecialParticleIDs( a_projectileID, projectileID( ) ) ) return( nullptr );
314 if( a_targetID != targetID( ) ) return( nullptr );
315 if( ( a_library != "" ) && ( parent( )->library( ) != a_library ) ) return( nullptr );
316 if( ( a_evaluation == "" ) || ( a_evaluation == evaluation( ) ) ) return( this );
317 return( nullptr );
318}
std::string const & evaluation() const
Definition GIDI.hpp:5260
std::string const & projectileID() const
Definition GIDI.hpp:5258
std::string const & targetID() const
Definition GIDI.hpp:5259
bool compareSpecialParticleIDs(std::string const &a_id1, std::string const &a_id2)
Definition PoPI_misc.cc:133

Referenced by GIDI::Map::Map::findProtareEntry().

◆ interaction()

std::string const & GIDI::Map::ProtareBase::interaction ( ) const
inline

Returns the value of the m_interaction member.

Definition at line 5261 of file GIDI.hpp.

Referenced by GIDI::Map::Protare::Protare(), GIDI::Map::Protare::protareSingle(), and GIDI::Map::Protare::toXMLList().

◆ isMatch()

bool GIDI::Map::ProtareBase::isMatch ( std::string const & a_projectileID,
std::string const & a_targetID,
std::string const & a_evaluation = "" ) const

Compares a_projectileID, a_targetID and a_evaluation to this data and returns true if they match and false otherwise. If a_evaluation is an empty string, only a_projectileID and a_targetID are compared.

Parameters
a_projectileID[in] The projectile's id to match.
a_targetID[in] The target's id to match.
a_evaluation[in] The evaluation to match.
Returns
true if match and false otherwise.

Definition at line 354 of file GIDI_map.cc.

354 {
355
356 if( !PoPI::compareSpecialParticleIDs( a_projectileID, m_projectileID ) ) return( false );
357 if( a_targetID != m_targetID ) return( false );
358 if( a_evaluation == "" ) return( true );
359 return( a_evaluation == m_evaluation );
360}

Referenced by GIDI::Map::Map::availableEvaluations().

◆ library()

std::string const & GIDI::Map::ProtareBase::library ( ) const

Returns the library this is contained in.

Definition at line 284 of file GIDI_map.cc.

284 {
285
286 return( parent( )->library( ) );
287}

Referenced by findProtareEntries(), findProtareEntry(), and library().

◆ projectileID()

std::string const & GIDI::Map::ProtareBase::projectileID ( ) const
inline

Returns the value of the m_projectileID member.

Definition at line 5258 of file GIDI.hpp.

Referenced by findProtareEntry(), GIDI::Map::MapWalkDirectoryCallback(), GIDI::Map::Protare::Protare(), GIDI::Map::Protare::toXMLList(), and GIDI::Map::TNSL::toXMLList().

◆ protare()

virtual GIDI::Protare * GIDI::Map::ProtareBase::protare ( Construction::Settings const & a_construction,
PoPI::Database const & a_pops,
ParticleSubstitution const & a_particleSubstitution ) const
pure virtual

Implemented in GIDI::Map::Protare, and GIDI::Map::TNSL.

Referenced by GIDI::Map::Map::protare().

◆ protareSingle()

virtual GIDI::ProtareSingle * GIDI::Map::ProtareBase::protareSingle ( Construction::Settings const & a_construction,
PoPI::Database const & a_pops,
ParticleSubstitution const & a_particleSubstitution ) const
pure virtual

Implemented in GIDI::Map::Protare, and GIDI::Map::TNSL.

◆ resolvedLibrary()

std::string const & GIDI::Map::ProtareBase::resolvedLibrary ( ) const

Returns the resolved library this is contained in.

Definition at line 293 of file GIDI_map.cc.

293 {
294
295 return( parent( )->resolvedLibrary( ) );
296}
std::string const & resolvedLibrary() const
Definition GIDI_map.cc:293

Referenced by resolvedLibrary().

◆ setInteraction()

void GIDI::Map::ProtareBase::setInteraction ( std::string const & a_interaction)
inline

Set the m_interaction member to a_interaction.

Definition at line 5262 of file GIDI.hpp.

Referenced by GIDI::Map::Protare::Protare(), and GIDI::Map::TNSL::TNSL().

◆ targetID()

std::string const & GIDI::Map::ProtareBase::targetID ( ) const
inline

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