thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.4

InterfacedBase is the base class of all Interfaced objects to be handled by the BaseRepository class. More...

#include <InterfacedBase.h>

Inheritance diagram for ThePEG::InterfacedBase:

Classes

struct  UpdateChecker
 Functor class to be used to update a range of dependent object. More...
 
struct  UpdateMapChecker
 Functor class to be used to update a range of dependent object in a map. More...
 

Public Types

enum  InitState { initializing = -1, uninitialized = 0, initialized = 1, runready = 2 }
 Enumeration reflecting the state of an InterfacedBase object. More...
 
- Public Types inherited from ThePEG::Pointer::ReferenceCounted
typedef unsigned int CounterType
 The integer type used for counting.
 

Public Member Functions

virtual ~InterfacedBase ()
 The virtual (empty) destructor;.
 
string fullName () const
 Returns the full name of this object including its path, e.g. More...
 
string name () const
 Returns the name of this object, without the path.
 
string path () const
 Returns the path to this object including the trailing '/'. More...
 
string comment () const
 Returns a comment assigned to this object.
 
void setup (istream &is)
 Read setup info from a standard istream is. More...
 
virtual IBPtr fullclone () const
 Return a full clone of this object possibly doing things to the clone to make it sane.
 
virtual void debugme () const
 Print out debugging information for this object on std::cerr. More...
 
Inlined access function.
void update ()
 Calls the doupdate() function with recursion prevention.
 
void init ()
 Calls the doinit() function with recursion prevention.
 
virtual bool preInitialize () const
 Return true if this object needs to be initialized before all other objects (except those for which this function also returns true). More...
 
void initrun ()
 Calls the doinitrun() function with recursion prevention.
 
void finish ()
 Calls the dofinish() function with recursion prevention.
 
void touch ()
 This function should be called every time something in this object has changed in a way that a sanity check with update() is needed.
 
void reset ()
 Set the state of this object to uninitialized.
 
void clear ()
 Calls reset() and unTouch().
 
InitState state () const
 Return the state of initialization of this object.
 
bool locked () const
 Return true if the BaseRepository is not allowed to change the state of this object.
 
bool touched () const
 Return true if the state of this object has been changed since the last call to update().
 
Functions used by the persistent I/O system.
void persistentOutput (PersistentOStream &os) const
 Function used to write out object persistently. More...
 
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently. More...
 
- Public Member Functions inherited from ThePEG::Base
virtual ~Base ()
 The virtual destructor.
 
void debug () const
 Print out debugging information for this object on std::cerr. More...
 
- Public Member Functions inherited from ThePEG::Pointer::ReferenceCounted
CounterType referenceCount () const
 Return the reference count.
 
- Public Member Functions inherited from ThePEG::Named
 Named (const string &newName=string())
 Constructor with name.
 
const string & name () const
 Return name.
 
bool operator== (const Named &other) const
 Test for equality.
 
bool operator< (const Named &other) const
 Lexicographical comparison.
 

Static Public Member Functions

static void Init ()
 Standard Init function.
 
- Static Public Member Functions inherited from ThePEG::Base
static void Init ()
 The standard Init function used to initialize the interfaces. More...
 

Protected Member Functions

virtual IBPtr clone () const =0
 Return a simple clone of this object. More...
 
 InterfacedBase ()
 Protected default constructor.
 
 InterfacedBase (string newName)
 Protected constructor with the name given as argument.
 
 InterfacedBase (const InterfacedBase &i)
 Protected copy-constructor.
 
Standard InterfacedBase virtual functions.
virtual void readSetup (istream &is)
 Read setup info from a standard istream is. More...
 
virtual void doupdate ()
 Check sanity of the object during the setup phase. More...
 
virtual void doinit ()
 Initialize this object after the setup phase before saving an EventGenerator to disk. More...
 
virtual void doinitrun ()
 Initialize this object. More...
 
virtual void dofinish ()
 Finalize this object. More...
 
virtual IVector getReferences ()
 Return a vector of all pointers to Interfaced objects used in this object. More...
 
virtual void rebind (const TranslationMap &)
 Rebind pointer to other Interfaced objects. More...
 
- Protected Member Functions inherited from ThePEG::Pointer::ReferenceCounted
 ReferenceCounted ()
 Default constructor.
 
 ReferenceCounted (const ReferenceCounted &)
 Copy-constructor.
 
ReferenceCountedoperator= (const ReferenceCounted &)
 Assignment.
 
- Protected Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 Assignment.
 
const string & name (const string &newName)
 Set new name.
 

Private Member Functions

void name (string newName)
 Set a new name (full name including path).
 
void lock ()
 Lock this object.
 
void unlock ()
 Unlock this object.
 
void untouch ()
 Clear the isTouched flag.
 
string addComment (string)
 Used by the interface to add comments.
 
InterfacedBaseoperator= (const InterfacedBase &)
 Private and non-existent assignment operator.
 

Private Attributes

bool isLocked
 True if this object is not to be changed by the user interface.
 
bool isTouched
 True if this object has been chaged since the last call to update().
 
InitState initState
 Indicate if this object has been initialized or not, or if it is being initialized.
 
string theComment
 A comment assigned to this object.
 
map< string, string > objectDefaults
 A map listing object-specific defaults set for the given interfaces.
 

Static Private Attributes

static AbstractClassDescription< InterfacedBaseinitInterfacedBase
 Standard Initialization object.
 

Friends

class BaseRepository
 The BaseRepository is a close friend. More...
 
class InterfaceBase
 The InterfaceBase is a close friend. More...
 
class EventGenerator
 The EventGenerator is a friend. More...
 

Additional Inherited Members

- Public Attributes inherited from ThePEG::Pointer::ReferenceCounted
const unsigned long uniqueId
 The unique ID. More...
 

Detailed Description

InterfacedBase is the base class of all Interfaced objects to be handled by the BaseRepository class.

InterfacedBase objects can be manipulated through objects of the InterfaceBase class dealing with setting parameters, switches and pointers to other InterfacedBase objects.

The InterfacedBase has a number of virtual methods to be implemented by sub classes for checking the state of the object, initializing the object etc.

The InterfacedBase is derived from the PersistentBase class to allow for persistent I/O, and from the Named for handling the name of the object. The full name of the object is of the form /dir/subdir/name analogous to the file name in a Unix file system.

It is possible to lock an InterfacedBase object in which case the BaseRepository will not do anything that will change the state of this object.

See also
BaseRepository
InterfaceBase

Definition at line 45 of file InterfacedBase.h.

Member Enumeration Documentation

◆ InitState

Enumeration reflecting the state of an InterfacedBase object.

Enumerator
initializing 

The object is currently being initialized.

I.e. either of update(), init(), initrun() or finish() are being run.

uninitialized 

The object has not been initialized.

initialized 

The object has been initialized.

runready 

The object is initialized and the initrun() method has been called.

Definition at line 61 of file InterfacedBase.h.

Member Function Documentation

◆ clone()

virtual IBPtr ThePEG::InterfacedBase::clone ( ) const
protectedpure virtual

Return a simple clone of this object.

Should be implemented as return new_ptr(*this); by a derived class.

Implemented in ThePEG::EventGenerator, ThePEG::Cuts, ThePEG::ParticleData, ThePEG::EventHandler, ThePEG::DecayMode, ThePEG::StandardEventHandler, ThePEG::PartonExtractor, ThePEG::SimpleFlavour, ThePEG::StandardModelBase, ThePEG::FuzzyTheta, ThePEG::LesHouchesEventHandler, ThePEG::ClusterCollapser, ThePEG::AnalysisHandler, ThePEG::LHAPDF, ThePEG::SimpleBaryonRemnantDecayer, ThePEG::MadGraphTwoCut, ThePEG::MECuts, ThePEG::QuarksToHadronsDecayer, ThePEG::LuminosityFunction, ThePEG::JetRegion, ThePEG::UnResolvedRemnant, ThePEG::MadGraphOneCut, ThePEG::SubProcessHandler, ThePEG::ACDCSampler, ThePEG::LesHouchesFileReader, ThePEG::MultiEventGenerator, ThePEG::JetCuts, ThePEG::V2LeptonsCut, ThePEG::SimpleDISCut, ThePEG::SoftRemnantHandler, ThePEG::DeltaMeasureCuts, ThePEG::JetPairRegion, ThePEG::MultiJetRegion, ThePEG::MENCDIS, ThePEG::KTClus, ThePEG::BudnevPDF, ThePEG::MEee2gZ2qq, ThePEG::RemnantData, ThePEG::WeizsackerWilliamsPDF, ThePEG::Onium3GDecayer, ThePEG::NLOHepMC3File, ThePEG::NLOHepMCFile, ThePEG::MEGG2GG, ThePEG::SimpleKTCut, ThePEG::LWHFactory, ThePEG::DecayHandler, ThePEG::MEQG2QG, ThePEG::Strategy, ThePEG::KTRapidityCut, ThePEG::ProgressLog, ThePEG::V2PPDecayer, ThePEG::MEQQ2QQ, ThePEG::FastJetFinder, ThePEG::MEQQ2GG, ThePEG::MEqq2qq, ThePEG::GRV94L, ThePEG::GRV94M, ThePEG::O1AlphaS, ThePEG::MEGG2QQ, ThePEG::HepMC3File, ThePEG::HepMCFile, ThePEG::HIHepMCFile, ThePEG::OmegaPhi3PiDecayer, ThePEG::XSecCheck, ThePEG::LeptonLeptonPDF, ThePEG::Tau2HadronsDecayer, ThePEG::GraphvizPlot, ThePEG::FixedTargetLuminosity, ThePEG::MadGraphReader, ThePEG::ColourPairDecayer, ThePEG::OneJetCut, ThePEG::MEQQ2qq, ThePEG::MEQq2Qq, ThePEG::NJetsCut, ThePEG::NLORivetAnalysis, ThePEG::WeakToHadronsDecayer, ThePEG::DalitzDecayer, ThePEG::NoRemnants, ThePEG::FlatDecayer, ThePEG::GaussianPtGenerator, ThePEG::RivetAnalysis, ThePEG::SimpleZGenerator, ThePEG::StandardRandom, ThePEG::ReweightConstant, ThePEG::NoPDF, ThePEG::DummyDecayer, ThePEG::StandardCKM, ThePEG::ReweightMinPT, ThePEG::FixedCMSLuminosity, ThePEG::BreitWignerMass, ThePEG::Matcher< T >, ThePEG::SimpleAlphaEM, and ThePEG::ThePEGStrategy.

Referenced by fullclone().

◆ debugme()

virtual void ThePEG::InterfacedBase::debugme ( ) const
virtual

Print out debugging information for this object on std::cerr.

To be called from within a debugger via the debug() function.

Reimplemented from ThePEG::Base.

◆ dofinish()

virtual void ThePEG::InterfacedBase::dofinish ( )
inlineprotectedvirtual

Finalize this object.

Called in the run phase just after a run has ended. Used eg. to write out statistics.

This method is called after the running phase through the finish() and can eg. be used to write out statistics. When implemented by a sub class it is important that the dofinish() method of the base class is called while the finish() methd is called for other objects.

Reimplemented in ThePEG::EventGenerator, ThePEG::LesHouchesReader, ThePEG::FactoryBase, ThePEG::EventHandler, ThePEG::PartonExtractor, ThePEG::StandardEventHandler, ThePEG::LesHouchesEventHandler, ThePEG::LHAPDF, ThePEG::ACDCSampler, ThePEG::MadGraphReader, ThePEG::XSecCheck, ThePEG::HepMC3File, ThePEG::HepMCFile, ThePEG::HIHepMCFile, ThePEG::NLORivetAnalysis, ThePEG::GraphvizPlot, ThePEG::NLOHepMC3File, ThePEG::NLOHepMCFile, and ThePEG::RivetAnalysis.

Definition at line 208 of file InterfacedBase.h.

Referenced by ThePEG::EventHandler::dofinish(), ThePEG::LesHouchesReader::dofinish(), and finish().

◆ doinit()

virtual void ThePEG::InterfacedBase::doinit ( )
inlineprotectedvirtual

Initialize this object after the setup phase before saving an EventGenerator to disk.

Nothing should have changed since the last update() call.

This method is called after the setup phase through the init() method to indicate that the setup of a run is finished. This is typpically done in a setup program before this object has been saved to a run file. It must therefore be made sure that the state of this object after this method has been executed will not be changed if it is written to a file and read in again. When implemented by a sub class it is important that the doinit() method of the base class is called first and then, if the initialization of this object depends on other objects, that the init() method of these objects are called. Only then should the class-local initialization proceed. To avoid circular loops, it is important that the doinit() method is called for the base class, while the init() method is called for other objects.

Exceptions
InitExceptionif object could not be initialized properly.

Reimplemented in ThePEG::EventGenerator, ThePEG::LesHouchesReader, ThePEG::MEBase, ThePEG::ParticleData, ThePEG::MEGroup, ThePEG::RandomGenerator, ThePEG::SimpleFlavour, ThePEG::StandardModelBase, ThePEG::StandardEventHandler, ThePEG::LesHouchesEventHandler, ThePEG::Helicity::VertexBase, ThePEG::PDFBase, ThePEG::LHAPDF, ThePEG::RemnantDecayer, ThePEG::MixedParticleData, ThePEG::UnResolvedRemnant, ThePEG::SubProcessHandler, ThePEG::LesHouchesFileReader, ThePEG::MENCDIS, ThePEG::MEee2gZ2qq, ThePEG::SimpleBaryonRemnantDecayer, ThePEG::MadGraphReader, ThePEG::FixedTargetLuminosity, ThePEG::AlphaSBase, ThePEG::NLORivetAnalysis, ThePEG::DalitzDecayer, ThePEG::RivetAnalysis, and ThePEG::FastJetFinder.

Definition at line 179 of file InterfacedBase.h.

Referenced by init().

◆ doinitrun()

virtual void ThePEG::InterfacedBase::doinitrun ( )
inlineprotectedvirtual

Initialize this object.

Called in the run phase just before a run begins.

This method is called just before running starts through the initrun() method to indicate that the actual running is to start. When implemented by a sub class it is important that the doinitrun() method of the base class is called first and then, if the initialization of this object depends on other objects, that the initrun() method of these objects are called. Only then should the class-local initialization proceed. To avoid circular loops, it is important that the doinitrun() method is called for the base class, while the initrun() method is called for other objects.

Reimplemented in ThePEG::EventGenerator, ThePEG::LesHouchesReader, ThePEG::MEBase, ThePEG::Cuts, ThePEG::ParticleData, ThePEG::FactoryBase, ThePEG::MEGroup, ThePEG::SimpleFlavour, ThePEG::StandardEventHandler, ThePEG::LesHouchesEventHandler, ThePEG::LHAPDF, ThePEG::SubProcessHandler, ThePEG::ACDCSampler, ThePEG::LWHFactory, ThePEG::ProgressLog, ThePEG::XSecCheck, ThePEG::HepMC3File, ThePEG::HepMCFile, ThePEG::HIHepMCFile, ThePEG::NLORivetAnalysis, ThePEG::NLOHepMC3File, ThePEG::NLOHepMCFile, ThePEG::RivetAnalysis, and ThePEG::FastJetFinder.

Definition at line 196 of file InterfacedBase.h.

Referenced by ThePEG::XSecCheck::doinitrun(), and initrun().

◆ doupdate()

virtual void ThePEG::InterfacedBase::doupdate ( )
inlineprotectedvirtual

Check sanity of the object during the setup phase.

This function is called everytime the object is changed through an interface during the setup phase. Also if the setup is changed for an object on which this is dependent. Note that the generator() is not available when this method is called.

This method may be called by the user interface during the setup phase through the update() method after manipulating objects to check the sanity of the object. When implemented by a sub class it is important that the doupdate() method of the base class is called, then if the sanity of this object depend on other objects, the update() method of these should be called. Then if touched() is true for this object or for the ones on which this depends, it is an indication that some things have changed since last time doupdate() was called, and the actual checking of the state of this object is called for. To avoid circular loops, it is important that the doupdate() method is called for the base class, while the update() method is called for other objects.

Exceptions
UpdateExceptionif the setup is such that the object would not work properly.

Reimplemented in ThePEG::ParticleData, ThePEG::StandardEventHandler, ThePEG::DecayMode, ThePEG::MatcherBase, and ThePEG::MECuts.

Definition at line 156 of file InterfacedBase.h.

Referenced by update().

◆ fullName()

string ThePEG::InterfacedBase::fullName ( ) const
inline

Returns the full name of this object including its path, e.g.

/directory/subdirectory/name.

Definition at line 83 of file InterfacedBase.h.

References ThePEG::Named::name().

◆ getReferences()

virtual IVector ThePEG::InterfacedBase::getReferences ( )
inlineprotectedvirtual

Return a vector of all pointers to Interfaced objects used in this object.

Returns
a vector of pointers.

Reimplemented in ThePEG::ParticleData, ThePEG::MEGroup, ThePEG::EventHandler, ThePEG::DecayMode, ThePEG::Helicity::VertexBase, ThePEG::MultiEventGenerator, and ThePEG::DalitzDecayer.

Definition at line 215 of file InterfacedBase.h.

◆ path()

string ThePEG::InterfacedBase::path ( ) const
inline

Returns the path to this object including the trailing '/'.

fullName() = path() + name().

Definition at line 96 of file InterfacedBase.h.

References ThePEG::Named::name().

◆ persistentInput()

void ThePEG::InterfacedBase::persistentInput ( PersistentIStream is,
int  version 
)

Function used to read in object persistently.

Parameters
isthe persistent input stream read from.
versionthe version number of the object when written.

Referenced by fullclone().

◆ persistentOutput()

void ThePEG::InterfacedBase::persistentOutput ( PersistentOStream os) const

Function used to write out object persistently.

Parameters
osthe persistent output stream written to.

Referenced by fullclone().

◆ preInitialize()

virtual bool ThePEG::InterfacedBase::preInitialize ( ) const
virtual

Return true if this object needs to be initialized before all other objects (except those for which this function also returns true).

This default version always returns false, but subclasses may override it to return true.

Reimplemented in ThePEG::LesHouchesReader, ThePEG::StandardModelBase, ThePEG::RemnantDecayer, ThePEG::LesHouchesFileReader, ThePEG::MadGraphReader, and ThePEG::SimpleBaryonRemnantDecayer.

Referenced by init().

◆ readSetup()

virtual void ThePEG::InterfacedBase::readSetup ( istream &  is)
protectedvirtual

Read setup info from a standard istream is.

May be called by the Repository to initialize an object. This function is called by the non virtual setup() function. A sub-class implementing it should first call the base class version before parsing the is. If the is is not empty after readSetup is called the remaining string will be assigned to the comment() of the object.

Reimplemented in ThePEG::ParticleData, ThePEG::DecayMode, and ThePEG::ConstituentParticleData.

Referenced by setup().

◆ rebind()

virtual void ThePEG::InterfacedBase::rebind ( const TranslationMap )
inlineprotectedvirtual

Rebind pointer to other Interfaced objects.

Called in the setup phase after all objects used in an EventGenerator has been cloned so that the pointers will refer to the cloned objects afterwards.

Exceptions
RebindExceptionif no cloned object was found for a given pointer.

Reimplemented in ThePEG::ParticleData, ThePEG::MEGroup, ThePEG::EventHandler, ThePEG::DecayMode, ThePEG::Helicity::VertexBase, ThePEG::MultiEventGenerator, and ThePEG::DalitzDecayer.

Definition at line 224 of file InterfacedBase.h.

◆ setup()

void ThePEG::InterfacedBase::setup ( istream &  is)
inline

Read setup info from a standard istream is.

May be called by the Repository to initialize an object. This function first calls the virtual readSetup() function to allow the sub classes the part is to initialize themselves. What ever is left in is after that will be assigned to the comment() of the object.

Definition at line 115 of file InterfacedBase.h.

References readSetup(), and theComment.

Friends And Related Function Documentation

◆ BaseRepository

friend class BaseRepository
friend

The BaseRepository is a close friend.

Definition at line 48 of file InterfacedBase.h.

◆ EventGenerator

friend class EventGenerator
friend

The EventGenerator is a friend.

Definition at line 54 of file InterfacedBase.h.

◆ InterfaceBase

friend class InterfaceBase
friend

The InterfaceBase is a close friend.

Definition at line 51 of file InterfacedBase.h.


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