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

#include <GIDI.hpp>

Inheritance diagram for GIDI::Map::Protare:

Public Member Functions

 Protare (HAPI::Node const &a_node, PoPI::Database const &a_pops, std::string const &a_basePath, Map const *const a_parent)
 ~Protare ()
EntryType entryType () const
bool isPhotoAtomic () 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 5286 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Protare()

GIDI::Map::Protare::Protare ( 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 Protare 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 370 of file GIDI_map.cc.

370 :
371 ProtareBase( a_node, a_basePath, a_parent ),
372 m_isPhotoAtomic( false ) {
373
374 if( interaction( ) == "" ) { // Some old GNDS 1.10 files do not have an "interaction" attribute.
376 if( PoPI::IDs::photon == projectileID( ) ) {
377 try {
378 PoPI::Base const &target( a_pops.get<PoPI::Base>( targetID( ) ) );
379 m_isPhotoAtomic = target.isChemicalElement( ); }
380 catch (...) { // Let's ignore, but user must understand that m_interaction and m_isPhotoAtomic may be wrong.
381 }
382 if( m_isPhotoAtomic ) setInteraction( GIDI_MapInteractionAtomicChars );
383 }
384 }
385 m_isPhotoAtomic = interaction( ) == GIDI_MapInteractionAtomicChars;
386}
#define GIDI_MapInteractionAtomicChars
Definition GIDI.hpp:5164
#define GIDI_MapInteractionNuclearChars
Definition GIDI.hpp:5163
void setInteraction(std::string const &a_interaction)
Definition GIDI.hpp:5262
std::string const & interaction() const
Definition GIDI.hpp:5261
std::string const & projectileID() const
Definition GIDI.hpp:5258
std::string const & targetID() const
Definition GIDI.hpp:5259
ProtareBase(HAPI::Node const &a_node, std::string const &a_basePath, Map const *const a_map)
Definition GIDI_map.cc:264
static std::string const photon
Definition PoPI.hpp:162

◆ ~Protare()

GIDI::Map::Protare::~Protare ( )

Definition at line 391 of file GIDI_map.cc.

391 {
392
393}

Member Function Documentation

◆ entryType()

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

Returns EntryType::protare.

Implements GIDI::Map::BaseEntry.

Definition at line 5295 of file GIDI.hpp.

◆ isPhotoAtomic()

bool GIDI::Map::Protare::isPhotoAtomic ( ) const
inline

Returns the value of the m_isPhotoAtomic member.

Definition at line 5297 of file GIDI.hpp.

◆ protare()

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

Returns a GIDI::Protare 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 405 of file GIDI_map.cc.

405 {
406
407 return( protareSingle( a_construction, a_pops, a_particleSubstitution ) );
408}
GIDI::ProtareSingle * protareSingle(Construction::Settings const &a_construction, PoPI::Database const &a_pops, ParticleSubstitution const &a_particleSubstitution) const
Definition GIDI_map.cc:420

◆ protareSingle()

GIDI::ProtareSingle * GIDI::Map::Protare::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.

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 420 of file GIDI_map.cc.

420 {
421
422 std::vector<std::string> libraries1;
423 libraries( libraries1 );
424
425 return( new ProtareSingle( a_construction, path( ), fileType( path( ) ), a_pops, a_particleSubstitution, libraries1, interaction( ), true ) );
426}
void libraries(std::vector< std::string > &a_libraries) const
Definition GIDI_map.cc:147
std::string path(PathForm a_form=PathForm::real) const
Definition GIDI_map.cc:133

Referenced by protare().

◆ toXMLList()

void GIDI::Map::Protare::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 435 of file GIDI_map.cc.

435 {
436
437 std::string attributes;
438
439 attributes = a_writeInfo.addAttribute( GIDI_projectileChars, projectileID( ) );
440 attributes += a_writeInfo.addAttribute( GIDI_targetChars, targetID( ) );
441 attributes += a_writeInfo.addAttribute( GIDI_evaluationChars, evaluation( ) );
442 attributes += a_writeInfo.addAttribute( GIDI_pathChars, path( PathForm::entered ) );
443 attributes += a_writeInfo.addAttribute( GIDI_interactionChars, interaction( ) );
444 a_writeInfo.addNodeStarterEnder( a_indent, moniker( ), attributes );
445}
#define GIDI_pathChars
Definition GIDI.hpp:450
#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
std::string const & evaluation() const
Definition GIDI.hpp:5260
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: