ThePEG::InterfacedBase Class Reference

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:

ThePEG::Base ThePEG::Named ThePEG::Pointer::ReferenceCounted ThePEG::Interfaced ThePEG::HandlerBaseT< ThePEG::UseRandom > ThePEG::CKMBase ThePEG::Cuts ThePEG::DecayMode ThePEG::EventGenerator ThePEG::EventManipulator ThePEG::FactoryBase ThePEG::HandlerBaseT< T > ThePEG::Helicity::VertexBase ThePEG::MassGenerator ThePEG::MatcherBase ThePEG::MECuts ThePEG::MultiCutBase ThePEG::OneCutBase ThePEG::ParticleData ThePEG::RandomGenerator ThePEG::RunningCoupling ThePEG::SamplerBase ThePEG::StandardModelBase ThePEG::Strategy ThePEG::TwoCutBase ThePEG::WidthGenerator

List of all members.

Public Types

enum  InitState { initializing = -1, uninitialized = 0, initialized = 1, runready = 2 }
 Enumeration reflecting the state of an InterfacedBase object. More...

Public Member Functions

virtual ~InterfacedBase ()
 The virtual (empty) destructor;.
string fullName () const
 Returns the full name of this object including its path, e.g.
string name () const
 Returns the name of this object, without the path.
string path () const
 Returns the path to this object including the trailing '/'.
string comment () const
 Returns a comment assigned to this object.
void setup (istream &is)
 Read setup info from a standard istream is.
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.
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).
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.
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently.

Static Public Member Functions

static void Init ()
 Standard Init function.

Protected Member Functions

virtual IBPtr clone () const =0
 Return a simple clone of this object.
 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.
virtual void doupdate ()
 Check sanity of the object during the setup phase.
virtual void doinit ()
 Initialize this object after the setup phase before saving an EventGenerator to disk.
virtual void doinitrun ()
 Initialize this object.
virtual void dofinish ()
 Finalize this object.
virtual IVector getReferences ()
 Return a vector of all pointers to Interfaced objects used in this object.
virtual void rebind (const TranslationMap &)
 Rebind pointer to other Interfaced objects.

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.

Static Private Attributes

static
AbstractClassDescription
< InterfacedBase
initInterfacedBase
 Standard Initialization object.

Friends

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

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...


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

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 58 of file InterfacedBase.h.


Member Function Documentation

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

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

/directory/subdirectory/name.

Definition at line 80 of file InterfacedBase.h.

References ThePEG::Named::name().

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

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

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

Reimplemented in ThePEG::EventGenerator.

Definition at line 93 of file InterfacedBase.h.

References ThePEG::Named::name().

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 112 of file InterfacedBase.h.

References readSetup(), and theComment.

virtual void ThePEG::InterfacedBase::readSetup ( istream &  is  )  [protected, virtual]

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::ConstituentParticleData, ThePEG::DecayMode, and ThePEG::ParticleData.

Referenced by setup().

virtual void ThePEG::InterfacedBase::doupdate (  )  [inline, protected, virtual]

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:
UpdateException if the setup is such that the object would not work properly.

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

Definition at line 153 of file InterfacedBase.h.

Referenced by update().

virtual void ThePEG::InterfacedBase::doinit (  )  [inline, protected, virtual]

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:
InitException if object could not be initialized properly.

Reimplemented in ThePEG::SimpleFlavour, ThePEG::StandardEventHandler, ThePEG::SubProcessHandler, ThePEG::Helicity::VertexBase, ThePEG::LesHouchesEventHandler, ThePEG::LesHouchesReader, ThePEG::MadGraphReader, ThePEG::MEee2gZ2qq, ThePEG::MENCDIS, ThePEG::LeptonLeptonRemnant, ThePEG::LHAPDF, ThePEG::PDFBase, ThePEG::DalitzDecayer, ThePEG::ParticleData, ThePEG::RemnantDecayer, ThePEG::SimpleBaryonRemnantDecayer, ThePEG::EventGenerator, ThePEG::RandomGenerator, ThePEG::AlphaSBase, and ThePEG::StandardModelBase.

Definition at line 176 of file InterfacedBase.h.

Referenced by init().

virtual void ThePEG::InterfacedBase::doinitrun (  )  [inline, protected, virtual]

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::FactoryBase, ThePEG::HepMCFile, ThePEG::LWHFactory, ThePEG::RivetAnalysis, ThePEG::XSecCheck, ThePEG::Cuts, ThePEG::ACDCSampler, ThePEG::SimpleFlavour, ThePEG::StandardEventHandler, ThePEG::SubProcessHandler, ThePEG::LesHouchesEventHandler, ThePEG::LesHouchesReader, ThePEG::LHAPDF, ThePEG::ParticleData, and ThePEG::EventGenerator.

Definition at line 193 of file InterfacedBase.h.

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

virtual void ThePEG::InterfacedBase::dofinish (  )  [inline, protected, virtual]

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::FactoryBase, ThePEG::GraphvizPlot, ThePEG::HepMCFile, ThePEG::RivetAnalysis, ThePEG::XSecCheck, ThePEG::ACDCSampler, ThePEG::EventHandler, ThePEG::StandardEventHandler, ThePEG::LesHouchesEventHandler, ThePEG::LesHouchesReader, ThePEG::MadGraphReader, ThePEG::LHAPDF, ThePEG::PartonExtractor, and ThePEG::EventGenerator.

Definition at line 205 of file InterfacedBase.h.

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

virtual IVector ThePEG::InterfacedBase::getReferences (  )  [inline, protected, virtual]

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

Returns:
a vector of pointers.

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

Definition at line 212 of file InterfacedBase.h.

virtual void ThePEG::InterfacedBase::rebind ( const TranslationMap  )  [inline, protected, virtual]

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:
RebindException if no cloned object was found for a given pointer.

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

Definition at line 221 of file InterfacedBase.h.

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::MadGraphReader, ThePEG::RemnantDecayer, and ThePEG::SimpleBaryonRemnantDecayer.

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

Function used to write out object persistently.

Parameters:
os the persistent output stream written to.

Reimplemented in ThePEG::FactoryBase, ThePEG::GraphvizPlot, ThePEG::HepMCFile, ThePEG::LWHFactory, ThePEG::RivetAnalysis, ThePEG::XSecCheck, ThePEG::Cuts, ThePEG::KTClus, ThePEG::KTRapidityCut, ThePEG::SimpleDISCut, ThePEG::SimpleKTCut, ThePEG::V2LeptonsCut, ThePEG::ACDCSampler, ThePEG::AnalysisHandler, ThePEG::ClusterCollapser, ThePEG::DecayHandler, ThePEG::EventHandler, ThePEG::FlavourGenerator, ThePEG::GaussianPtGenerator, ThePEG::LuminosityFunction, ThePEG::SamplerBase, ThePEG::SimpleFlavour, ThePEG::SimpleZGenerator, ThePEG::StandardEventHandler, ThePEG::SubProcessHandler, ThePEG::Helicity::VertexBase, ThePEG::Interfaced, ThePEG::LesHouchesEventHandler, ThePEG::LesHouchesFileReader, ThePEG::LesHouchesReader, ThePEG::MadGraphOneCut, ThePEG::MadGraphReader, ThePEG::MadGraphTwoCut, ThePEG::ME2to2Base, ThePEG::ME2to2QCD, ThePEG::MEBase, ThePEG::MECuts, ThePEG::MEee2gZ2qq, ThePEG::MENCDIS, ThePEG::ReweightBase, ThePEG::ReweightConstant, ThePEG::ReweightMinPT, ThePEG::BeamParticleData, ThePEG::LeptonLeptonRemnant, ThePEG::LHAPDF, ThePEG::PartonExtractor, ThePEG::PDFBase, ThePEG::RemnantHandler, ThePEG::SoftRemnantHandler, ThePEG::WeizsackerWilliamsPDF, ThePEG::ColourPairDecayer, ThePEG::ConstituentParticleData, ThePEG::DalitzDecayer, ThePEG::Decayer, ThePEG::DecayMode, ThePEG::MatcherBase, ThePEG::OmegaPhi3PiDecayer, ThePEG::Onium3GDecayer, ThePEG::ParticleData, ThePEG::QuarksToHadronsDecayer, ThePEG::RemnantData, ThePEG::RemnantDecayer, ThePEG::SimpleBaryonRemnantDecayer, ThePEG::Tau2HadronsDecayer, ThePEG::V2PPDecayer, ThePEG::WeakToHadronsDecayer, ThePEG::EventGenerator, ThePEG::MultiEventGenerator, ThePEG::RandomGenerator, ThePEG::StandardRandom, ThePEG::Strategy, ThePEG::AlphaSBase, ThePEG::O1AlphaS, ThePEG::RunningCoupling, ThePEG::StandardCKM, and ThePEG::StandardModelBase.

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

Function used to read in object persistently.

Parameters:
is the persistent input stream read from.
version the version number of the object when written.

Reimplemented in ThePEG::FactoryBase, ThePEG::GraphvizPlot, ThePEG::HepMCFile, ThePEG::LWHFactory, ThePEG::RivetAnalysis, ThePEG::XSecCheck, ThePEG::Cuts, ThePEG::KTClus, ThePEG::KTRapidityCut, ThePEG::SimpleDISCut, ThePEG::SimpleKTCut, ThePEG::V2LeptonsCut, ThePEG::ACDCSampler, ThePEG::AnalysisHandler, ThePEG::ClusterCollapser, ThePEG::DecayHandler, ThePEG::EventHandler, ThePEG::FlavourGenerator, ThePEG::GaussianPtGenerator, ThePEG::LuminosityFunction, ThePEG::SamplerBase, ThePEG::SimpleFlavour, ThePEG::SimpleZGenerator, ThePEG::StandardEventHandler, ThePEG::SubProcessHandler, ThePEG::Helicity::VertexBase, ThePEG::Interfaced, ThePEG::LesHouchesEventHandler, ThePEG::LesHouchesFileReader, ThePEG::LesHouchesReader, ThePEG::MadGraphOneCut, ThePEG::MadGraphReader, ThePEG::MadGraphTwoCut, ThePEG::ME2to2Base, ThePEG::ME2to2QCD, ThePEG::MEBase, ThePEG::MECuts, ThePEG::MEee2gZ2qq, ThePEG::MENCDIS, ThePEG::ReweightBase, ThePEG::ReweightConstant, ThePEG::ReweightMinPT, ThePEG::BeamParticleData, ThePEG::LeptonLeptonRemnant, ThePEG::LHAPDF, ThePEG::PartonExtractor, ThePEG::PDFBase, ThePEG::RemnantHandler, ThePEG::SoftRemnantHandler, ThePEG::WeizsackerWilliamsPDF, ThePEG::ColourPairDecayer, ThePEG::ConstituentParticleData, ThePEG::DalitzDecayer, ThePEG::Decayer, ThePEG::DecayMode, ThePEG::MatcherBase, ThePEG::OmegaPhi3PiDecayer, ThePEG::Onium3GDecayer, ThePEG::ParticleData, ThePEG::QuarksToHadronsDecayer, ThePEG::RemnantData, ThePEG::RemnantDecayer, ThePEG::SimpleBaryonRemnantDecayer, ThePEG::Tau2HadronsDecayer, ThePEG::V2PPDecayer, ThePEG::WeakToHadronsDecayer, ThePEG::EventGenerator, ThePEG::MultiEventGenerator, ThePEG::RandomGenerator, ThePEG::StandardRandom, ThePEG::Strategy, ThePEG::AlphaSBase, ThePEG::O1AlphaS, ThePEG::RunningCoupling, ThePEG::StandardCKM, and ThePEG::StandardModelBase.

virtual IBPtr ThePEG::InterfacedBase::clone (  )  const [protected, pure virtual]

Return a simple clone of this object.

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

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

Referenced by fullclone().

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.


Friends And Related Function Documentation

friend class BaseRepository [friend]

The BaseRepository is a close friend.

Definition at line 48 of file InterfacedBase.h.

friend class EventGenerator [friend]

The EventGenerator is a friend.

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

Definition at line 51 of file InterfacedBase.h.


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

Generated on Thu Apr 29 12:43:07 2010 for ThePEG by  doxygen 1.5.5