| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Gaudi::ParticlePropertySvc Class Reference

This service provides access to particle properties. More...

`#include <src/ParticlePropertySvc.h>`

Inheritance diagram for Gaudi::ParticlePropertySvc:
[legend]
Collaboration diagram for Gaudi::ParticlePropertySvc:
[legend]

## Public Types
typedef ParticleProperty * | mapped_type
typedef std::map< int, mapped_type > | MapID
typedef std::map< std::string, mapped_type > | MapName
typedef std::map< int, mapped_type > | MapStdHepID
typedef std::map< int, mapped_type > | MapPythiaID
typedef std::vector< ParticleProperty * > | VectPP
typedef VectPP::const_iterator | const_iterator
typedef VectPP::iterator | iterator
Public Types inherited from extends< Service, IParticlePropertySvc >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
StatusCode | initialize () override
| Initialise the service. More...
StatusCode | finalize () override
| Finalise the service. More...
StatusCode | push_back (const std::string &particle, int geantId, int jetsetId, double charge, double mass, double tlife, const std::string &evtName, int pythiaId, double maxWidth) override
| Create a new particle property. More...
StatusCode | push_back (ParticleProperty *pp) override
| Add a new particle property. More...
const_iterator | begin () const override
| Get a const reference to the beginning of the container. More...
const_iterator | end () const override
| Get a const reference to the end of the container. More...
int | size () const override
| Get the container size. More...
ParticleProperty * | find (int geantId) override
| Retrieve a property by geant3 id. More...
ParticleProperty * | find (const std::string &name) override
| Retrieve a property by particle name. More...
ParticleProperty * | findByStdHepID (int stdHepId) override
| Retrieve a property by StdHep id. More...
ParticleProperty * | findByPythiaID (int pythiaID) override
| Retrieve a property by Pythia id. More...
StatusCode | erase (int geantId) override
| Erase a property by geant3 id. More...
StatusCode | erase (const std::string &name) override
| Erase a property by particle name. More...
StatusCode | eraseByStdHepID (int stdHepId) override
| Erase a property by StdHep id ??? More...
| ParticlePropertySvc (const std::string &name, ISvcLocator *svc)
| Standard Constructor. More...
| ~ParticlePropertySvc () override=default
| Destructor. More...
Public Member Functions inherited from extends< Service, IParticlePropertySvc >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
| Declare used tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| PropertyHolder ()=default
| ~PropertyHolder () override=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces... >
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Member Functions
const ParticleProperty * | anti (const ParticleProperty *pp) const
| helper (protected) function to find an antiparticle for the given particle ID (StdHepID) More...
StatusCode | setAntiParticles ()
| helper (protected) function to set the valid particle<–>antiparticle relations More...
StatusCode | rebuild ()
| rebuild "the linear container" from the map More...
StatusCode | erase (const ParticleProperty *pp)
| remove particle property from all maps More...
StatusCode | parse (const std::string &file)
| parse the file More...
StatusCode | parse ()
| Parses the file and fill all the maps. More...
StatusCode | addParticles ()
bool | diff (const ParticleProperty *o, const ParticleProperty *n, const MSG::Level l=MSG::DEBUG) const
Protected Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | setUpMessaging ()
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Private Attributes
Gaudi::Property< std::string > | m_filename
Gaudi::Property< std::vector< std::string > > | m_other {this, "OtherFiles", {}, "additional file names"}
Gaudi::Property< std::vector< std::string > > | m_particles
VectPP | m_vectpp
| Vector of all particle properties. More...
MapID | m_idmap
| Map for geant IDs. More...
MapName | m_namemap
| Map for particle names. More...
MapStdHepID | m_stdhepidmap
| Map for StdHep Ids. More...
MapPythiaID | m_pythiaidmap
| Map for Pythia Ids. More...
std::set< std::unique_ptr< ParticleProperty > > | m_owned
std::set< std::string > | m_replaced
SmartIF< IFileAccess > | m_fileAccess

## Additional Inherited Members
Protected Attributes inherited from Service
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::Property< int > | m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
Gaudi::Property< bool > | m_auditInit {this, "AuditServices", false, "[[deprecated]] unused"}
Gaudi::Property< bool > | m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
Gaudi::Property< bool > | m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
Gaudi::Property< bool > | m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...

## Detailed Description

This service provides access to particle properties.

The settable property of this service is the ParticlePropertiesFile, an ASCII file containing the list of properties for the particles. The default file is: "$PARAMFILESROOT/data/ParticleTable.txt" or if $PARAMFILESROOT is not defined "ParticleTable.txt"

Author
  Iain Last
  Gloria Corti 8/11/1999 change default file from $CDF/particle.cdf to $LHCBDBASE/cdf/particle.cdf on Unix and use environment variable also on WinNT Also introduce finding of particle by StdHepID
  Vanya BELYAEV

Date
  2006-09-22 1) Modified to add possibility to redefine properties of existing particles and to read additional files. New property "OtherFiles" (default is empty vector) is introduces. Service parsed additional files after the main one.

// read additional properties
ParticlePropertySvc.OtherFiles = {
"$SOMELOCATION1/file1.txt" ,
"$SOMELOCATION2/file2.txt"
} ;

2) Add possibility to modify only certain particles through the new property "Particles" (default is empty list), Each line is interpreted as a line in particle data table, e.g.

// redefine the properties of H_20 and H_30 particles:
ParticlePropertySvc.Particles = {
"H_20 88 35 0.0 120.0 9.4e-26 Higgs'0 35 0.0e+00" ,
"H_30 89 36 0.0 40.0 1.0e-12 A0 36 0.0e+00"
} ;

The replaces/modified particles are reported.

Definition at line 72 of file ParticlePropertySvc.h.

## Member Typedef Documentation

typedef VectPP::const_iterator IParticlePropertySvc::const_iterator

Definition at line 27 of file IParticlePropertySvc.h.

typedef VectPP::iterator IParticlePropertySvc::iterator

Definition at line 28 of file IParticlePropertySvc.h.

typedef std::map<int, mapped_type> Gaudi::ParticlePropertySvc::MapID

Definition at line 77 of file ParticlePropertySvc.h.

typedef std::map<std::string, mapped_type> Gaudi::ParticlePropertySvc::MapName

Definition at line 78 of file ParticlePropertySvc.h.

typedef ParticleProperty* Gaudi::ParticlePropertySvc::mapped_type

Definition at line 76 of file ParticlePropertySvc.h.

typedef std::map<int, mapped_type> Gaudi::ParticlePropertySvc::MapPythiaID

Definition at line 80 of file ParticlePropertySvc.h.

typedef std::map<int, mapped_type> Gaudi::ParticlePropertySvc::MapStdHepID

Definition at line 79 of file ParticlePropertySvc.h.

typedef std::vector<ParticleProperty*> IParticlePropertySvc::VectPP

Definition at line 26 of file IParticlePropertySvc.h.

## Constructor & Destructor Documentation

Gaudi::ParticlePropertySvc::ParticlePropertySvc | ( | const std::string & | name,
|  | ISvcLocator * | svc
| ) |  |

Standard Constructor.

Parameters

  name | String with service name
  svc | Pointer to service locator interface

Todo:
  : remove reference to LHCb-specific environment variable

Definition at line 56 of file ParticlePropertySvc.cpp.

56 : base_class( name, svc )
57 {
59 // Redefine the default name:
60 if ( System::getEnv( "PARAMFILESROOT", m_filename.value() ) ) {
61 m_filename.value() += "/data/ParticleTable.txt";
62 }
63 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:581
extends< Service, IParticlePropertySvc >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:15
Gaudi::ParticlePropertySvc::m_filename
Gaudi::Property< std::string > m_filename
Definition: ParticlePropertySvc.h:164

Gaudi::ParticlePropertySvc::~ParticlePropertySvc | ( |  | ) |
| override default

Destructor.

## Member Function Documentation

StatusCode Gaudi::ParticlePropertySvc::addParticles | ( |  | ) |
| protected

Definition at line 387 of file ParticlePropertySvc.cpp.

388 {
389 // loop over all "explicit" particles
390 for ( const auto& item : m_particles ) {
391 std::istringstream input( item );
392 // get the name
393 std::string p_name;
394 int p_geant;
395 int p_jetset;
396 double p_charge;
397 double p_mass;
398 double p_ltime;
399 std::string p_evtgen;
400 int p_pythia;
401 double p_maxwid;
402 if ( input >> p_name >> p_geant >> p_jetset >> p_charge >> p_mass >> p_ltime >> p_evtgen >> p_pythia >>
403 p_maxwid ) {
404 always() << " Add/Modify the particle: "
405 << " name='" << p_name << "'"
406 << " geant=" << p_geant << " jetset=" << p_jetset << " charge=" << p_charge << " mass=" << p_mass
407 << " ltime=" << p_ltime << " evtgen='" << p_evtgen << "'"
408 << " pythia=" << p_pythia << " maxwid=" << p_maxwid << endmsg;
409 //
410 StatusCode sc = push_back( p_name, p_geant, p_jetset, p_charge, p_mass * Gaudi::Units::GeV,
411 p_ltime * Gaudi::Units::s, p_evtgen, p_pythia, p_maxwid * Gaudi::Units::GeV );
412 if ( sc.isFailure() ) {
413 return sc;
414 } // RETURN
415 } else {
416 error() << " could not parse '" << item << "'" << endmsg;
417 return StatusCode::FAILURE; // RETURN
418 }
419 }
420 //
421 return StatusCode::SUCCESS;
422 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Units::s
constexpr double s
Definition: SystemOfUnits.h:135
std::istringstream
STL class.
StatusCode::FAILURE
Definition: StatusCode.h:31
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
Gaudi::ParticlePropertySvc::push_back
StatusCode push_back(const std::string &particle, int geantId, int jetsetId, double charge, double mass, double tlife, const std::string &evtName, int pythiaId, double maxWidth) override
Create a new particle property.
Definition: ParticlePropertySvc.cpp:140
std::string
STL class.
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Gaudi::ParticlePropertySvc::m_particles
Gaudi::Property< std::vector< std::string > > m_particles
Definition: ParticlePropertySvc.h:167
Gaudi::Units::GeV
constexpr double GeV
Definition: SystemOfUnits.h:161
CommonMessagingBase::always
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
Definition: CommonMessaging.h:97
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

const ParticleProperty * Gaudi::ParticlePropertySvc::anti | ( | const ParticleProperty * | pp | ) | const
| protected

helper (protected) function to find an antiparticle for the given particle ID (StdHepID)

Helper (protected) function to find an antiparticle for the given particle ID (StdHepID)

Parameters

  pp | pointer to particle property

Returns
  pointer to antiparticle

Definition at line 320 of file ParticlePropertySvc.cpp.

321 {
322 if ( !pp ) {
323 return nullptr;
324 }
325 const int ID = pp->pdgID();
326 const int antiID = -1 * ID;
327 for ( const auto& ap : m_vectpp ) {
328 if ( ap && antiID == ap->pdgID() ) {
329 return ap;
330 } // RETURN
331 };
332 //
333 return pp; // RETURN
334 }
ParticleProperty::pdgID
int pdgID() const
Get the PDG (= JETSET) ID.
Definition: ParticleProperty.h:54
compareOutputFiles.pp
pp
Definition: compareOutputFiles.py:467
Gaudi::ParticlePropertySvc::m_vectpp
VectPP m_vectpp
Vector of all particle properties.
Definition: ParticlePropertySvc.h:170

const_iterator Gaudi::ParticlePropertySvc::begin | ( |  | ) | const
| inline override

Get a const reference to the beginning of the container.

Definition at line 111 of file ParticlePropertySvc.h.

111 { return m_vectpp.begin(); }
std::vector::begin
T begin(T...args)
Gaudi::ParticlePropertySvc::m_vectpp
VectPP m_vectpp
Vector of all particle properties.
Definition: ParticlePropertySvc.h:170

bool Gaudi::ParticlePropertySvc::diff | ( | const ParticleProperty * | o,
|  | const ParticleProperty * | n,
|  | const MSG::Level | l = `MSG::DEBUG`
| ) |  | const
| protected

Definition at line 430 of file ParticlePropertySvc.cpp.

431 {
432 //
433 if ( o == n ) {
434 return false;
435 }
436 //
437 auto& log = msgStream();
438 log << l;
439 if ( !o || !n ) {
440 log << MSG::WARNING << " ParticleProperty* point to NULL" << endmsg;
441 return true; // RETURN
442 }
443 //
444 bool result = false;
445 if ( o->particle() != n->particle() ) {
446 result = true;
447 log << " Name:'" << o->particle() << "'/'" << n->particle() << "'";
448 }
449 if ( o->geantID() != n->geantID() ) {
450 result = true;
451 log << " G3ID:" << o->geantID() << "/" << n->geantID() << "'";
452 }
453 if ( o->pdgID() != n->pdgID() ) {
454 result = true;
455 log << " PDGID:" << o->pdgID() << "/" << n->pdgID() << "'";
456 }
457 if ( o->pythiaID() != n->pythiaID() ) {
458 result = true;
459 log << " PYID:" << o->pythiaID() << "/" << n->pythiaID() << "'";
460 }
461 if ( o->charge() != n->charge() ) {
462 result = true;
463 log << " Q:" << o->charge() << "/" << n->charge() << "'";
464 }
465 if ( o->mass() != n->mass() ) {
466 result = true;
467 log << " M:" << o->mass() << "/" << n->mass() << "'";
468 }
469 if ( o->lifetime() != n->lifetime() ) {
470 result = true;
471 log << " T:" << o->lifetime() << "/" << n->lifetime() << "'";
472 }
473 if ( o->evtGenName() != n->evtGenName() ) {
474 result = true;
475 log << " EvtGen:" << o->evtGenName() << "/" << n->evtGenName() << "'";
476 }
477 if ( o->maxWidth() != n->maxWidth() ) {
478 result = true;
479 log << " WMAX:" << o->maxWidth() << "/" << n->maxWidth() << "'";
480 }
481 if ( result ) {
482 log << endmsg;
483 }
484 //
485 return result;
486 }
ParticleProperty::pdgID
int pdgID() const
Get the PDG (= JETSET) ID.
Definition: ParticleProperty.h:54
ParticleProperty::geantID
int geantID() const
Get the GEANT3 ID.
Definition: ParticleProperty.h:48
ParticleProperty::maxWidth
double maxWidth() const
Get the max width deviation.
Definition: ParticleProperty.h:96
ParticleProperty::lifetime
double lifetime() const
Get the particle lifetime.
Definition: ParticleProperty.h:78
gaudirun.l
dictionary l
Definition: gaudirun.py:440
ParticleProperty::charge
double charge() const
Get the particle charge.
Definition: ParticleProperty.h:66
CommonMessagingBase::msgStream
MsgStream & msgStream() const
Return an uninitialized MsgStream.
Definition: CommonMessaging.h:78
MSG::WARNING
Definition: IMessageSvc.h:16
ParticleProperty::particle
const std::string & particle() const
Get the particle name.
Definition: ParticleProperty.h:42
ParticleProperty::mass
double mass() const
Get the particle mass.
Definition: ParticleProperty.h:72
ParticleProperty::pythiaID
int pythiaID() const
Get the Pythia ID.
Definition: ParticleProperty.h:90
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
ParticleProperty::evtGenName
const std::string & evtGenName() const
Get the EvtGen name.
Definition: ParticleProperty.h:84
Gaudi.Configuration.log
log
Definition: Configuration.py:13

const_iterator Gaudi::ParticlePropertySvc::end | ( |  | ) | const
| inline override

Get a const reference to the end of the container.

Definition at line 113 of file ParticlePropertySvc.h.

113 { return m_vectpp.end(); }
std::vector::end
T end(T...args)
Gaudi::ParticlePropertySvc::m_vectpp
VectPP m_vectpp
Vector of all particle properties.
Definition: ParticlePropertySvc.h:170

StatusCode Gaudi::ParticlePropertySvc::erase | ( | int | geantId | ) |
| inline override

Erase a property by geant3 id.

Definition at line 125 of file ParticlePropertySvc.h.

125 { return erase( find( geantId ) ); }
Gaudi::ParticlePropertySvc::erase
StatusCode erase(int geantId) override
Erase a property by geant3 id.
Definition: ParticlePropertySvc.h:125
Gaudi::ParticlePropertySvc::find
ParticleProperty * find(int geantId) override
Retrieve a property by geant3 id.
Definition: ParticlePropertySvc.h:117

StatusCode Gaudi::ParticlePropertySvc::erase | ( | const std::string & | name | ) |
| inline override

Erase a property by particle name.

Definition at line 127 of file ParticlePropertySvc.h.

127 { return erase( find( name ) ); }
Gaudi::ParticlePropertySvc::erase
StatusCode erase(int geantId) override
Erase a property by geant3 id.
Definition: ParticlePropertySvc.h:125
Gaudi::ParticlePropertySvc::find
ParticleProperty * find(int geantId) override
Retrieve a property by geant3 id.
Definition: ParticlePropertySvc.h:117

StatusCode Gaudi::ParticlePropertySvc::erase | ( | const ParticleProperty * | pp | ) |
| protected

remove particle property from all maps

Definition at line 229 of file ParticlePropertySvc.cpp.

230 {
231 if ( !pp ) {
232 return StatusCode::FAILURE;
233 }
234
235 _remove_( m_idmap, pp );
236 _remove_( m_namemap, pp );
237 _remove_( m_stdhepidmap, pp );
238 _remove_( m_pythiaidmap, pp );
239 //
240 return rebuild();
241 }
Gaudi::ParticlePropertySvc::rebuild
StatusCode rebuild()
rebuild "the linear container" from the map
Definition: ParticlePropertySvc.cpp:370
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::ParticlePropertySvc::m_namemap
MapName m_namemap
Map for particle names.
Definition: ParticlePropertySvc.h:172
Gaudi::ParticlePropertySvc::m_stdhepidmap
MapStdHepID m_stdhepidmap
Map for StdHep Ids.
Definition: ParticlePropertySvc.h:173
Gaudi::ParticlePropertySvc::m_idmap
MapID m_idmap
Map for geant IDs.
Definition: ParticlePropertySvc.h:171
Gaudi::ParticlePropertySvc::m_pythiaidmap
MapPythiaID m_pythiaidmap
Map for Pythia Ids.
Definition: ParticlePropertySvc.h:174

StatusCode Gaudi::ParticlePropertySvc::eraseByStdHepID | ( | int | stdHepId | ) |
| inline override

Erase a property by StdHep id ???

Definition at line 129 of file ParticlePropertySvc.h.

129 { return erase( findByStdHepID( stdHepId ) ); }
Gaudi::ParticlePropertySvc::erase
StatusCode erase(int geantId) override
Erase a property by geant3 id.
Definition: ParticlePropertySvc.h:125
Gaudi::ParticlePropertySvc::findByStdHepID
ParticleProperty * findByStdHepID(int stdHepId) override
Retrieve a property by StdHep id.
Definition: ParticlePropertySvc.h:121

StatusCode Gaudi::ParticlePropertySvc::finalize | ( |  | ) |
| override

Finalise the service.

finalize

finalize the base class

Definition at line 121 of file ParticlePropertySvc.cpp.

122 {
123 if ( !m_other.empty() ) {
124 info() << "Additional Properties have been read from files: " << Gaudi::Utils::toString( m_other ) << endmsg;
125 }
126
127 if ( !m_replaced.empty() ) {
128 always() << "Properties have been redefined for " << m_replaced.size()
129 << " particles : " << Gaudi::Utils::toString( m_replaced ) << endmsg;
130 }
131
132 m_fileAccess.reset();
133
135 return Service::finalize();
136 }
std::set::empty
T empty(T...args)
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:174
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:112
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:346
Gaudi::ParticlePropertySvc::m_fileAccess
SmartIF< IFileAccess > m_fileAccess
Definition: ParticlePropertySvc.h:180
Gaudi::ParticlePropertySvc::m_replaced
std::set< std::string > m_replaced
Definition: ParticlePropertySvc.h:178
std::set::size
T size(T...args)
Gaudi::ParticlePropertySvc::m_other
Gaudi::Property< std::vector< std::string > > m_other
Definition: ParticlePropertySvc.h:166
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:92
CommonMessagingBase::always
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
Definition: CommonMessaging.h:97
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

ParticleProperty* Gaudi::ParticlePropertySvc::find | ( | int | geantId | ) |
| inline override

Retrieve a property by geant3 id.

Definition at line 117 of file ParticlePropertySvc.h.

117 { return m_idmap[geantId]; }
Gaudi::ParticlePropertySvc::m_idmap
MapID m_idmap
Map for geant IDs.
Definition: ParticlePropertySvc.h:171

ParticleProperty* Gaudi::ParticlePropertySvc::find | ( | const std::string & | name | ) |
| inline override

Retrieve a property by particle name.

Definition at line 119 of file ParticlePropertySvc.h.

119 { return m_namemap[name]; }
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
Gaudi::ParticlePropertySvc::m_namemap
MapName m_namemap
Map for particle names.
Definition: ParticlePropertySvc.h:172

ParticleProperty* Gaudi::ParticlePropertySvc::findByPythiaID | ( | int | pythiaID | ) |
| inline override

Retrieve a property by Pythia id.

Definition at line 123 of file ParticlePropertySvc.h.

123 { return m_pythiaidmap[pythiaID]; }
Gaudi::ParticlePropertySvc::m_pythiaidmap
MapPythiaID m_pythiaidmap
Map for Pythia Ids.
Definition: ParticlePropertySvc.h:174

ParticleProperty* Gaudi::ParticlePropertySvc::findByStdHepID | ( | int | stdHepId | ) |
| inline override

Retrieve a property by StdHep id.

Definition at line 121 of file ParticlePropertySvc.h.

121 { return m_stdhepidmap[stdHepId]; }
Gaudi::ParticlePropertySvc::m_stdhepidmap
MapStdHepID m_stdhepidmap
Map for StdHep Ids.
Definition: ParticlePropertySvc.h:173

StatusCode Gaudi::ParticlePropertySvc::initialize | ( |  | ) |
| override

Initialise the service.

initialize the service and setProperties

Definition at line 67 of file ParticlePropertySvc.cpp.

68 {
69 StatusCode sc = Service::initialize();
70 if ( sc.isFailure() ) {
71 return sc;
72 }
73
74 sc = setProperties();
75 if ( sc.isFailure() ) {
76 error() << " Could not set the properties " << endmsg;
77 return sc;
78 }
79
80 m_fileAccess = service( "VFSSvc" );
81 if ( !m_fileAccess ) {
82 error() << " Cannot retrieve the VFS service " << endmsg;
83 return StatusCode::FAILURE;
84 }
85
86 sc = parse();
87 if ( sc.isFailure() ) {
88 error() << " Could not parse the file " << endmsg;
89 return sc;
90 }
91 if ( !m_particles.empty() ) {
92 sc = addParticles();
93 if ( sc.isFailure() ) {
94 error() << " Could not treat particles! " << endmsg;
95 return sc;
96 }
97 }
98 debug() << "ParticleProperties parsed successfully" << endmsg;
99
100 debug() << "Access properties" << endmsg;
101 // For debugging purposes print out the size of the internal maps
102 // particle name as key: all particles in database are present here
103 debug() << "NameMap size =" << m_namemap.size() << endmsg;
104 // Geant3 ID as key: all particles in database are present here
105 debug() << "GeantID Map size =" << m_idmap.size() << endmsg;
106 // StdHep ID as key: some particles have no valid StdHep ID
107 debug() << "StdHepID Map size =" << m_stdhepidmap.size() << endmsg;
108 // Pythia ID as key: some particles are not defined in Pythia
109 debug() << "PythiaID Map size =" << m_pythiaidmap.size() << endmsg;
110
111 if ( !m_replaced.empty() ) {
112 info() << "Properties have been redefined for " << m_replaced.size()
113 << " particles : " << Gaudi::Utils::toString( m_replaced ) << endmsg;
114 }
115
116 return StatusCode::SUCCESS;
117 }
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:64
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::set::empty
T empty(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:31
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:112
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:346
Gaudi::ParticlePropertySvc::m_namemap
MapName m_namemap
Map for particle names.
Definition: ParticlePropertySvc.h:172
Gaudi::ParticlePropertySvc::parse
StatusCode parse()
Parses the file and fill all the maps.
Definition: ParticlePropertySvc.cpp:245
Gaudi::ParticlePropertySvc::m_fileAccess
SmartIF< IFileAccess > m_fileAccess
Definition: ParticlePropertySvc.h:180
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
Gaudi::ParticlePropertySvc::m_replaced
std::set< std::string > m_replaced
Definition: ParticlePropertySvc.h:178
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Service::setProperties
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
Definition: Service.cpp:295
Gaudi::ParticlePropertySvc::m_stdhepidmap
MapStdHepID m_stdhepidmap
Map for StdHep Ids.
Definition: ParticlePropertySvc.h:173
std::map::size
T size(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:115
Gaudi::ParticlePropertySvc::addParticles
StatusCode addParticles()
Definition: ParticlePropertySvc.cpp:387
Gaudi::ParticlePropertySvc::m_idmap
MapID m_idmap
Map for geant IDs.
Definition: ParticlePropertySvc.h:171
Gaudi::ParticlePropertySvc::m_particles
Gaudi::Property< std::vector< std::string > > m_particles
Definition: ParticlePropertySvc.h:167
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn&#39;t already exist.
Definition: Service.h:85
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi::ParticlePropertySvc::m_pythiaidmap
MapPythiaID m_pythiaidmap
Map for Pythia Ids.
Definition: ParticlePropertySvc.h:174

StatusCode Gaudi::ParticlePropertySvc::parse | ( | const std::string & | file | ) |
| protected

parse the file

Definition at line 273 of file ParticlePropertySvc.cpp.

274 {
275 auto infile = ( m_fileAccess ? m_fileAccess->open( file ) : nullptr );
276 if ( !infile ) {
277 error() << "Unable to open properties file : " << file << endmsg;
278 return StatusCode::FAILURE;
279 }
280
281 StatusCode sc = StatusCode::SUCCESS;
282 info() << "Opened particle properties file : " << file << endmsg;
283
284 std::vector<std::string> tokens;
285 tokens.reserve( 9 );
286 std::string line;
287 while ( std::getline( *infile, line ) ) {
288 // parse each line of the file (comment lines begin with # in the cdf
289 // file,
290 if ( line.front() == '#' ) continue;
291
292 tokens.clear();
293 ba::trim_left_if( line, ba::is_space() );
294 ba::split( tokens, line, ba::is_space(), boost::token_compress_on );
295 if ( tokens.size() != 9 ) continue;
296
297 auto gid = std::stoi( tokens[1] );
298 auto jid = std::stoi( tokens[2] );
299 // Change the particles that do not correspond to a pdg number
300 if ( jid == 0 ) jid = 10000000 * gid;
301
302 // add a particle property
303 sc = push_back( tokens[0], gid, jid, std::stod( tokens[3] ), std::stod( tokens[4] ) * Gaudi::Units::GeV,
304 std::stod( tokens[5] ) * Gaudi::Units::s, tokens[6], std::stoi( tokens[7] ),
305 std::stod( tokens[8] ) * Gaudi::Units::GeV );
306
307 if ( sc.isFailure() ) {
308 error() << "Error from ParticlePropertySvc::push_back for particle='" << tokens[0] << "'" << endmsg;
309 }
310 }
311 return StatusCode::SUCCESS;
312 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::Units::s
constexpr double s
Definition: SystemOfUnits.h:135
StatusCode::FAILURE
Definition: StatusCode.h:31
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:112
std::string::front
T front(T...args)
std::stod
T stod(T...args)
std::getline
T getline(T...args)
Gaudi::ParticlePropertySvc::m_fileAccess
SmartIF< IFileAccess > m_fileAccess
Definition: ParticlePropertySvc.h:180
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
Gaudi::ParticlePropertySvc::push_back
StatusCode push_back(const std::string &particle, int geantId, int jetsetId, double charge, double mass, double tlife, const std::string &evtName, int pythiaId, double maxWidth) override
Create a new particle property.
Definition: ParticlePropertySvc.cpp:140
std::string
STL class.
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
std::vector::clear
T clear(T...args)
std::vector::size
T size(T...args)
std::vector< std::string >
Gaudi::Units::GeV
constexpr double GeV
Definition: SystemOfUnits.h:161
std::stoi
T stoi(T...args)
IFileAccess::open
virtual std::unique_ptr< std::istream > open(const std::string &url)=0
Find the URL and returns a unique_ptr to an input stream interface of an object that can be used to r...
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
plotSpeedupsPyRoot.line
line
Definition: plotSpeedupsPyRoot.py:172
std::vector::reserve
T reserve(T...args)

StatusCode Gaudi::ParticlePropertySvc::parse | ( |  | ) |
| protected

Parses the file and fill all the maps.

Definition at line 245 of file ParticlePropertySvc.cpp.

246 {
247
248 // parse "the main" file
249 StatusCode sc = parse( m_filename );
250 if ( sc.isFailure() ) {
251 return sc;
252 }
253
254 // parse "other" files
255 for ( auto& file : m_other ) {
256 sc = parse( file );
257 if ( sc.isFailure() ) {
258 return sc;
259 }
260 }
261
262 // Now check that the file format was consistent with what parser
263 // expected
264 if ( m_namemap.empty() ) {
265 error() << "Format of input file inconsistent with what expected"
266 << " - Check you are using ParticleData.txt" << endmsg;
267 return StatusCode::FAILURE;
268 }
269
270 return sc;
271 }
std::map::empty
T empty(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::ParticlePropertySvc::m_namemap
MapName m_namemap
Map for particle names.
Definition: ParticlePropertySvc.h:172
Gaudi::ParticlePropertySvc::parse
StatusCode parse()
Parses the file and fill all the maps.
Definition: ParticlePropertySvc.cpp:245
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Gaudi::ParticlePropertySvc::m_other
Gaudi::Property< std::vector< std::string > > m_other
Definition: ParticlePropertySvc.h:166
Gaudi::ParticlePropertySvc::m_filename
Gaudi::Property< std::string > m_filename
Definition: ParticlePropertySvc.h:164
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

StatusCode Gaudi::ParticlePropertySvc::push_back | ( | const std::string & | particle,
|  | int | geantId,
|  | int | jetsetId,
|  | double | charge,
|  | double | mass,
|  | double | tlife,
|  | const std::string & | evtName,
|  | int | pythiaId,
|  | double | maxWidth
| ) |  |
| override

Create a new particle property.

Create a particle property and insert it in the maps.

Attention
  ParticlePropertySvc IS the owner if this property! String name of the particle.

Parameters

  geantId | Geant3 ID of the particle.
  jetsetId | Jetset ID of the particle.
  charge | Particle charge (/e).
  mass | Particle mass (GeV).
  tlife | Particle lifetime (s).
  evtName | String name of the particle in EvtGen.
  pythiaId | Pythia ID of the particle.

Returns
  StatusCode - SUCCESS if the particle property was added.

Definition at line 140 of file ParticlePropertySvc.cpp.

143 {
144 //
145 auto i = m_owned.insert( make_unique_<ParticleProperty>( particle, geantId, jetsetId, charge, mass, tlife, evtName,
146 pythiaId, maxWidth ) );
147 //
148 return i.second ? push_back( i.first->get() ) : StatusCode::FAILURE;
149 }
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::ParticlePropertySvc::push_back
StatusCode push_back(const std::string &particle, int geantId, int jetsetId, double charge, double mass, double tlife, const std::string &evtName, int pythiaId, double maxWidth) override
Create a new particle property.
Definition: ParticlePropertySvc.cpp:140
std::set::insert
T insert(T...args)
Gaudi::ParticlePropertySvc::m_owned
std::set< std::unique_ptr< ParticleProperty > > m_owned
Definition: ParticlePropertySvc.h:177

StatusCode Gaudi::ParticlePropertySvc::push_back | ( | ParticleProperty * | pp | ) |
| override

Add a new particle property.

Add a particle property.

Attention
  ParticlePropertySvc is not the owner of this property!

Parameters

  pp,a | particle property class.

Returns
  StatusCode - SUCCESS if the particle property was added.

Definition at line 153 of file ParticlePropertySvc.cpp.

154 {
155 if ( !pp ) {
156 return StatusCode::FAILURE;
157 }
158 //
159 { // try to add into Geant(3)ID map
160 const int ID = pp->geantID();
161 // is this already in the map?
162 auto ifind = m_idmap.find( ID );
163 if ( m_idmap.end() != ifind && 0 != m_idmap[ID] ) {
164 diff( ifind->second, pp );
165 m_replaced.insert( m_idmap[ID]->particle() );
166 }
167 // put it into the map
168 m_idmap[ID] = pp;
169 }
170 //
171 { // try to add into Name map
172 const std::string& particle = pp->particle();
173 // is this already in the map?
174 auto ifind = m_namemap.find( particle );
175 if ( ifind != m_namemap.end() && ifind->second ) {
176 diff( ifind->second, pp );
177 m_replaced.insert( ifind->second->particle() );
178 }
179 // put it into the map
180 m_namemap[particle] = pp;
181 }
182 //
183 // add to StdHep map only if StdHep ID different from zero and if
184 // not Cerenkov (StdHep ID = gamma)
185 if ( 0 != pp->jetsetID() && "Tcherenkov" != pp->particle() ) { // try to add into StdHepID map
186 const int ID = pp->jetsetID();
187 // is this already in the map?
188 auto ifind = m_stdhepidmap.find( ID );
189 if ( m_stdhepidmap.end() != ifind && ifind->second ) {
190 diff( ifind->second, pp );
191 m_replaced.insert( ifind->second->particle() );
192 }
193 // put it into the map
194 m_stdhepidmap[ID] = pp;
195 }
196 //
197 // add to Pythia map only if Pythia ID is different from
198 // zero ( StdHep id is always different from zero in this case )
199 if ( 0 != pp->pythiaID() && 0 != pp->jetsetID() &&
200 "Tcherenkov" != pp->particle() ) { // try to add into PythiaID map
201 const int ID = pp->pythiaID();
202 // is this already in the map?
203 auto ifind = m_pythiaidmap.find( ID );
204 if ( m_pythiaidmap.end() != ifind && ifind->second ) {
205 diff( ifind->second, pp );
206 m_replaced.insert( ifind->second->particle() );
207 }
208 // put it into the map
209 m_pythiaidmap[ID] = pp;
210 }
211 //
212 return rebuild();
213 }
Gaudi::ParticlePropertySvc::rebuild
StatusCode rebuild()
rebuild "the linear container" from the map
Definition: ParticlePropertySvc.cpp:370
ParticleProperty::geantID
int geantID() const
Get the GEANT3 ID.
Definition: ParticleProperty.h:48
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::ParticlePropertySvc::m_namemap
MapName m_namemap
Map for particle names.
Definition: ParticlePropertySvc.h:172
std::map::end
T end(T...args)
std::string
STL class.
Gaudi::ParticlePropertySvc::m_replaced
std::set< std::string > m_replaced
Definition: ParticlePropertySvc.h:178
ParticleProperty::jetsetID
int jetsetID() const
Get the JETSET(StdHep) ID.
Definition: ParticleProperty.h:60
Gaudi::ParticlePropertySvc::m_stdhepidmap
MapStdHepID m_stdhepidmap
Map for StdHep Ids.
Definition: ParticlePropertySvc.h:173
std::set::insert
T insert(T...args)
std::map::find
T find(T...args)
Gaudi::ParticlePropertySvc::diff
bool diff(const ParticleProperty *o, const ParticleProperty *n, const MSG::Level l=MSG::DEBUG) const
Definition: ParticlePropertySvc.cpp:430
compareOutputFiles.pp
pp
Definition: compareOutputFiles.py:467
Gaudi::ParticlePropertySvc::m_idmap
MapID m_idmap
Map for geant IDs.
Definition: ParticlePropertySvc.h:171
ParticleProperty::particle
const std::string & particle() const
Get the particle name.
Definition: ParticleProperty.h:42
ParticleProperty::pythiaID
int pythiaID() const
Get the Pythia ID.
Definition: ParticleProperty.h:90
Gaudi::ParticlePropertySvc::m_pythiaidmap
MapPythiaID m_pythiaidmap
Map for Pythia Ids.
Definition: ParticlePropertySvc.h:174

StatusCode Gaudi::ParticlePropertySvc::rebuild | ( |  | ) |
| protected

rebuild "the linear container" from the map

Definition at line 370 of file ParticlePropertySvc.cpp.

371 {
372 std::set<mapped_type> local;
373 m_vectpp.clear();
374 m_vectpp.reserve( m_idmap.size() + 100 );
375 // load information from maps into the set
376 _load_( m_idmap, local );
377 _load_( m_namemap, local );
378 _load_( m_stdhepidmap, local );
379 _load_( m_pythiaidmap, local );
380 // load information from set to the linear container vector
381 std::copy( std::begin( local ), std::end( local ), std::back_inserter( m_vectpp ) );
382 return setAntiParticles();
383 }
std::copy
T copy(T...args)
Gaudi::ParticlePropertySvc::m_namemap
MapName m_namemap
Map for particle names.
Definition: ParticlePropertySvc.h:172
std::end
T end(T...args)
std::vector::clear
T clear(T...args)
Gaudi::ParticlePropertySvc::m_stdhepidmap
MapStdHepID m_stdhepidmap
Map for StdHep Ids.
Definition: ParticlePropertySvc.h:173
std::map::size
T size(T...args)
std::set
STL class.
std::begin
T begin(T...args)
std::back_inserter
T back_inserter(T...args)
Gaudi::ParticlePropertySvc::m_idmap
MapID m_idmap
Map for geant IDs.
Definition: ParticlePropertySvc.h:171
Gaudi::ParticlePropertySvc::setAntiParticles
StatusCode setAntiParticles()
helper (protected) function to set the valid particle<–>antiparticle relations
Definition: ParticlePropertySvc.cpp:341
Gaudi::ParticlePropertySvc::m_vectpp
VectPP m_vectpp
Vector of all particle properties.
Definition: ParticlePropertySvc.h:170
Gaudi::ParticlePropertySvc::m_pythiaidmap
MapPythiaID m_pythiaidmap
Map for Pythia Ids.
Definition: ParticlePropertySvc.h:174
std::vector::reserve
T reserve(T...args)

StatusCode Gaudi::ParticlePropertySvc::setAntiParticles | ( |  | ) |
| protected

helper (protected) function to set the valid particle<–>antiparticle relations

Returns
  status code

Definition at line 341 of file ParticlePropertySvc.cpp.

342 {
343 // initialize particle<-->antiParticle relations
344 for ( auto& pp : m_vectpp ) {
345 if ( !pp ) {
346 continue;
347 } // CONTINUE
348 const ParticleProperty* ap = anti( pp );
349 if ( ap ) {
350 pp->setAntiParticle( ap );
351 }
352 }
353 return StatusCode::SUCCESS;
354 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
ParticleProperty
A trivial class to hold information about a single particle properties.
Definition: ParticleProperty.h:18
Gaudi::ParticlePropertySvc::anti
const ParticleProperty * anti(const ParticleProperty *pp) const
helper (protected) function to find an antiparticle for the given particle ID (StdHepID) ...
Definition: ParticlePropertySvc.cpp:320
compareOutputFiles.pp
pp
Definition: compareOutputFiles.py:467
Gaudi::ParticlePropertySvc::m_vectpp
VectPP m_vectpp
Vector of all particle properties.
Definition: ParticlePropertySvc.h:170

int Gaudi::ParticlePropertySvc::size | ( |  | ) | const
| inline override

Get the container size.

Definition at line 115 of file ParticlePropertySvc.h.

115 { return m_vectpp.size(); };
std::vector::size
T size(T...args)
Gaudi::ParticlePropertySvc::m_vectpp
VectPP m_vectpp
Vector of all particle properties.
Definition: ParticlePropertySvc.h:170

## Member Data Documentation

SmartIF<IFileAccess> Gaudi::ParticlePropertySvc::m_fileAccess
| private

Definition at line 180 of file ParticlePropertySvc.h.

Gaudi::Property<std::string> Gaudi::ParticlePropertySvc::m_filename
| private

Initial value:
{this, "ParticlePropertiesFile", "ParticleTable.txt",
"Filename of the particle properties file"}

Definition at line 164 of file ParticlePropertySvc.h.

MapID Gaudi::ParticlePropertySvc::m_idmap
| private

Map for geant IDs.

Definition at line 171 of file ParticlePropertySvc.h.

MapName Gaudi::ParticlePropertySvc::m_namemap
| private

Map for particle names.

Definition at line 172 of file ParticlePropertySvc.h.

Gaudi::Property<std::vector<std::string> > Gaudi::ParticlePropertySvc::m_other {this, "OtherFiles", {}, "additional file names"}
| private

Definition at line 166 of file ParticlePropertySvc.h.

std::set<std::unique_ptr<ParticleProperty> > Gaudi::ParticlePropertySvc::m_owned
| private

Definition at line 177 of file ParticlePropertySvc.h.

Gaudi::Property<std::vector<std::string> > Gaudi::ParticlePropertySvc::m_particles
| private

Initial value:
{
this, "Particles", {}, "properties to be redefined explicitly"}

Definition at line 167 of file ParticlePropertySvc.h.

MapPythiaID Gaudi::ParticlePropertySvc::m_pythiaidmap
| private

Map for Pythia Ids.

Definition at line 174 of file ParticlePropertySvc.h.

std::set<std::string> Gaudi::ParticlePropertySvc::m_replaced
| private

Definition at line 178 of file ParticlePropertySvc.h.

MapStdHepID Gaudi::ParticlePropertySvc::m_stdhepidmap
| private

Map for StdHep Ids.

Definition at line 173 of file ParticlePropertySvc.h.

VectPP Gaudi::ParticlePropertySvc::m_vectpp
| private

Vector of all particle properties.

Definition at line 170 of file ParticlePropertySvc.h.

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

- GaudiPartProp/src/ParticlePropertySvc.h
- GaudiPartProp/src/ParticlePropertySvc.cpp