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

#include <GIDI.hpp>

Inheritance diagram for GIDI::Map::TNSL:

Public Member Functions

 TNSL (HAPI::Node const &a_node, PoPI::Database const &a_pops, std::string const &a_basePath, Map const *const a_parent)
 ~TNSL ()
EntryType entryType () const
std::string const & standardTarget () const
std::string const & standardEvaluation () const
GIDI::Protareprotare (Construction::Settings const &a_construction, PoPI::Database const &a_pops, ParticleSubstitution const &a_particleSubstitution) const
GIDI::ProtareSingleprotareSingle (Construction::Settings const &a_construction, PoPI::Database const &a_pops, ParticleSubstitution const &a_particleSubstitution) const
void toXMLList (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
Public Member Functions inherited from GIDI::Map::ProtareBase
 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
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
void libraries (std::vector< std::string > &a_libraries) const
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 5310 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ TNSL()

GIDI::Map::TNSL::TNSL ( HAPI::Node const & a_node,
PoPI::Database const & a_pops,
std::string const & a_basePath,
Map const *const a_parent )
Parameters
a_node[in] The HAPI::Node to be parsed to contruct a TNSL entry instance.
a_pops[in] A PoPI::Database instance used to get particle indices and possibly other particle information.
a_basePath[in] A path prepended to this entry's path.
a_parent[in] Pointer to the Map containing this.

Definition at line 455 of file GIDI_map.cc.

455 :
456 ProtareBase( a_node, a_basePath, a_parent ),
457 m_standardTarget( a_node.attribute_as_string( GIDI_standardTargetChars ) ),
458 m_standardEvaluation( a_node.attribute_as_string( GIDI_standardEvaluationChars ) ) {
459
460 setInteraction( "" );
461
462 HAPI::Node const &protare = a_node.child( GIDI_protareChars ); // Format 0.1 support. This format is deprecated.
463 if( !protare.empty() ) {
464 m_standardTarget = protare.attribute_as_string( GIDI_targetChars );
465 m_standardEvaluation = protare.attribute_as_string( GIDI_evaluationChars );
466 }
467}
#define GIDI_evaluationChars
Definition GIDI.hpp:415
#define GIDI_targetChars
Definition GIDI.hpp:414
#define GIDI_standardTargetChars
Definition GIDI.hpp:417
#define GIDI_protareChars
Definition GIDI.hpp:164
#define GIDI_standardEvaluationChars
Definition GIDI.hpp:418
void setInteraction(std::string const &a_interaction)
Definition GIDI.hpp:5262
ProtareBase(HAPI::Node const &a_node, std::string const &a_basePath, Map const *const a_map)
Definition GIDI_map.cc:264
GIDI::Protare * protare(Construction::Settings const &a_construction, PoPI::Database const &a_pops, ParticleSubstitution const &a_particleSubstitution) const
Definition GIDI_map.cc:486

◆ ~TNSL()

GIDI::Map::TNSL::~TNSL ( )

Definition at line 472 of file GIDI_map.cc.

472 {
473
474}

Member Function Documentation

◆ entryType()

EntryType GIDI::Map::TNSL::entryType ( ) const
inlinevirtual

Returns EntryType::TNSL.

Implements GIDI::Map::BaseEntry.

Definition at line 5320 of file GIDI.hpp.

◆ protare()

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

Returns a GIDI::ProtareTNSL instance of the protare reference by the m_path member.

Parameters
a_construction[in] Used to pass user options to the constructor.
a_pops[in] A PoPI::Database instance used to get particle indices and possibly other particle information.
a_particleSubstitution[in] Map of particles to substitute with another particles.
Returns
Returns the Protare matching the TNSL protare.

Implements GIDI::Map::ProtareBase.

Definition at line 486 of file GIDI_map.cc.

486 {
487
488 Map const *map = parent( );
489
490 ParticleSubstitution particleSubstitution;
491 std::vector<std::string> libraries1;
492 libraries( libraries1 );
493
494 ProtareSingle *protare1 = new ProtareSingle( a_construction, path( ), fileType( path( ) ), a_pops, particleSubstitution, libraries1, GIDI_MapInteractionTNSLChars, false );
495
496 while( true ) {
497 Map const *parent = map->parent( );
498
499 if( parent == nullptr ) break;
500 map = parent;
501 }
502 ProtareSingle *protare2 = static_cast<ProtareSingle *>( map->protare( a_construction, a_pops, PoPI::IDs::neutron, m_standardTarget, "", m_standardEvaluation ) );
503 if( protare2 == nullptr ) protare2 = static_cast<ProtareSingle *>( map->protare( a_construction, a_pops, PoPI::IDs::neutron, m_standardTarget ) );
504
505 ProtareTNSL *protareTNSL = new ProtareTNSL( a_construction, protare2, protare1 );
506
507 return( protareTNSL );
508}
#define GIDI_MapInteractionTNSLChars
Definition GIDI.hpp:5165
void libraries(std::vector< std::string > &a_libraries) const
Definition GIDI_map.cc:147
Map const * parent() const
Definition GIDI.hpp:5190
std::string path(PathForm a_form=PathForm::real) const
Definition GIDI_map.cc:133
std::map< std::string, ParticleInfo > ParticleSubstitution
Definition GIDI.hpp:487
static std::string const neutron
Definition PoPI.hpp:164

Referenced by TNSL().

◆ protareSingle()

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

Returns a GIDI::ProtareSingle instance of the protare reference by the m_path member. Note, this is different from the protare method which returns a GIDI::ProtareTNSL instance.

Parameters
a_construction[in] Used to pass user options to the constructor.
a_pops[in] A PoPI::Database instance used to get particle indices and possibly other particle information.
a_particleSubstitution[in] Map of particles to substitute with another particles.
Returns
Returns the Protare matching the TNSL protare.

Implements GIDI::Map::ProtareBase.

Definition at line 521 of file GIDI_map.cc.

521 {
522
523 std::vector<std::string> libraries1;
524 libraries( libraries1 );
525
526 return( new ProtareSingle( a_construction, path( ), fileType( path( ) ), a_pops, a_particleSubstitution, libraries1, GIDI_MapInteractionTNSLChars, false ) );
527}

◆ standardEvaluation()

std::string const & GIDI::Map::TNSL::standardEvaluation ( ) const
inline

Definition at line 5323 of file GIDI.hpp.

5323{ return( m_standardEvaluation ); }

Referenced by toXMLList().

◆ standardTarget()

std::string const & GIDI::Map::TNSL::standardTarget ( ) const
inline

Definition at line 5322 of file GIDI.hpp.

5322{ return( m_standardTarget ); }

Referenced by toXMLList().

◆ toXMLList()

void GIDI::Map::TNSL::toXMLList ( GUPI::WriteInfo & a_writeInfo,
std::string const & a_indent = "" ) const
virtual

Fills the argument a_writeInfo with the XML lines that represent this. Recursively enters each sub-node.

Parameters
a_writeInfo[in/out] Instance containing incremental indentation and other information and stores the appended lines.
a_indent[in] The amount to indent this node.

Implements GIDI::Map::BaseEntry.

Definition at line 536 of file GIDI_map.cc.

536 {
537
538 std::string attributes;
539
540 attributes = a_writeInfo.addAttribute( GIDI_projectileChars, projectileID( ) );
541 attributes += a_writeInfo.addAttribute( GIDI_targetChars, targetID( ) );
542 attributes += a_writeInfo.addAttribute( GIDI_evaluationChars, evaluation( ) );
543 attributes += a_writeInfo.addAttribute( GIDI_pathChars, path( PathForm::entered ) );
544 attributes += a_writeInfo.addAttribute( GIDI_standardTargetChars, standardTarget( ) );
545 attributes += a_writeInfo.addAttribute( GIDI_standardEvaluationChars, standardEvaluation( ) );
546 a_writeInfo.addNodeStarterEnder( a_indent, moniker( ), attributes );
547}
#define GIDI_pathChars
Definition GIDI.hpp:450
#define GIDI_projectileChars
Definition GIDI.hpp:413
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
std::string const & standardTarget() const
Definition GIDI.hpp:5322
std::string const & standardEvaluation() const
Definition GIDI.hpp:5323
std::string const & moniker() const
Definition GUPI.hpp:102
void addNodeStarterEnder(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:57
std::string addAttribute(std::string const &a_name, std::string const &a_value) const
Definition GUPI.hpp:60

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