class rcRun : public genNamedObj<rcRun*>, public rcFsm

Class that represents a run

Inheritance:


Private Fields

bool bDisableTimer
If true we don't use timers
bool bPrintRunProgress
If true we print info about the run to cout
bool bTestMode
If treu we are running in a test mode
int iRunNb
The run number
int iUpdateFreqMsec
The update frequency in Milliseconds
int nEventsInDD
Number of events in the DD pool
int nEventsInDDStart
Number of events in the DD pool at the beginning of the run
int nEventsTaken
Number of events taken so far as obtained from the Readout object
int nMbyWritten
Number of MBytes written
int nSecRunning
Number of seconds running
char* pcName
The name of the run object
static const char* pcStates[eNStates]
Names of the states
Run_i* pMyImplObj
Pointer to the CORBA proxy Run_i object
rcPartition* pMyPartition
Pointer to the partition object or NULL if we are outside a run
smTimer* pMyTimer
Pointer to my timer object
struct run_parameters sRunParam
The run parameters

Private Methods

virtual void dump( ostream &os = cout )
Dumps information about the object to ostream os
static void dump_all( ostream &os = cout )
Iterates over all objects and calls dump
static run_parameters getLastRunParameters()
Returns the last run parameters
static int getNextRunNumber()
Returns the run number for the next run of the partition taking into account that several partitions are running in parallel
void identify( ostream &os = cout )
Prints a one-line summary about the object
static void listAll( ostream &os = cout )
Iterates over all objects and calls identify
rcRun( const char *name, struct run_parameters *rparam )
Constructor with name and run parameters
int storeBorInfo()
Stores the beginning of run information in an ASCII file
int storeEorInfo()
Stores the end run information in an ASCII file
static int storeNewRunNumber( int newRunNumber )
Stores a modified run number in the database
~rcRun()
Destructor

Private

Accessors
int getRunNb()
Return the run number
const char* getPurpose()
REturn the purpose
int getNbEventsTaken()
Return the number of events taken
int getSecRunning()
Return the number of seconds running
int getNbMbyWritten()
Return the number of MBy written so far
int getUpdateFreq()
Return the frequency in milliseconds with which we update the run status
void setUpdateFreq( int iMilliSec )
To set the frequency in milliseconds how we update
struct run_parameters getRunParameters const
Returns the run parameters
void setEventLimit( int iNewLimit )
To set the event limit
void setTimeLimit( int iNewLimit )
To set the time limit
void setVolumeLimit( int iNewLimit )
To set the volume limit
void show_status( ostream &os )
To print a full blown status report to ostream os
bool isActive()
Returns true if active
int relateToPartition( rcPartition *pPartition )
To relate to the partition object
int unrelateFromPartition( rcPartition *pPartition )
To cancel relation to the partition object
Run_i* getRunImpl()
Returns the pointer to the CORBA proxy implementation object
Finite State machine for the run object
void setCurrentState( int iNewState )
overloaded setCurrentState to allow adjusting pcStates
enum eStates
Enum with the states
enum eEvents
Enum for the events that the run can receive
static int stt[ eNStates ][ eNEvents ]
State transition table
int create()
Action for the create state - see above for details
int starting()
Action for the start state - see above for details
int running()
Action for the running state - see above for details
int paused()
Action for the paused state - see above for details
int ended()
Action for the ended state - see above for details

Inherited from genNamedObj:

Public Methods

static void add( const char *name, X x )
inline static X begin()
inline static X end()
static bool exists( const char *name )
static X get( const char *name )
int getLocation()
inline static int getNbElements()
static X getObject( const char *name )
static int getObjects( const char *name, list<X> &theList )
inline const char* getObjName()
inline static X next()
static void remove( const char *name )

Private Fields

static map < const char*, X, cstring_ordering_t > ::iterator m_It
static map < const char*, X, cstring_ordering_t > m_Map
char* m_Name

Inherited from rcFsm:

Public Methods

const char* getcCurrentState()
int getCurrentState()
bool getEventTrace()
char* getFsmName()
virtual void setCurrentState(int iNewState )
void setEventTrace( bool bTrace )
virtual int TakeEvent( rcEvent *Event )

Protected Fields

bool bEventTrace
bool bNoTimersAccepted
int iCurrentState
const char* pcCurrentState
char* pcFsmName

Protected Methods

virtual int canthappenEvent( rcEvent *pEvent )
virtual int ignoreEvent( rcEvent *pEvent )

Documentation

Class that represents a run. Instances of this class are created as runs are started by the partition object.
Its identifier, the run number, is currently maintained in an ASCII file pointed to by the environment variable \$RC_RUNNUMBER_FILE.

Its purpose is twofold:
begin{itemize}

  • First it is an active object that represents an active run and as such it performs a whole bunch of operations as we are taking data. These operations are done in periodic intervals, tasks typically include gathering status information and checking for automatic end run conditions (e.g. the desired number of events have been taken and the run should be ended now).
  • Second it should store the information about the run when it ends. This functionality is currently not implemented.

    The following things happens during the run state actions:

    • create: nothing really!
    • starting: initialise the run counters, store beginrun info in the ASCII file, send evStarted to self
    • running: in periodic intervales do:
      1. ask the readout object for information (the current number of events, nb of Mby written, ...),
      2. check whether an end run condition is valid
    • paused: cancel the timer to stop the automatic run update procedure 3. send event to self for the next update or an event to the partition in case the EoR condition has been detected
    • ended: store the end run info in the ASCII file,

    First version: April 6, 98, CW
    Last update: Feb 5, 2000, CW

  • rcRun( const char *name, struct run_parameters *rparam )
    Constructor with name and run parameters

    ~rcRun()
    Destructor

    static void listAll( ostream &os = cout )
    Iterates over all objects and calls identify

    static void dump_all( ostream &os = cout )
    Iterates over all objects and calls dump

    void identify( ostream &os = cout )
    Prints a one-line summary about the object

    virtual void dump( ostream &os = cout )
    Dumps information about the object to ostream os

    static int getNextRunNumber()
    Returns the run number for the next run of the partition taking into account that several partitions are running in parallel.
    Returns:
    the new run number or -1 if there is an error

    static int storeNewRunNumber( int newRunNumber )
    Stores a modified run number in the database
    Returns:
    rcSuccess or rcFailure

    static run_parameters getLastRunParameters()
    Returns the last run parameters. Returns NULL if they were never entered

    Accessors

    int getRunNb()
    Return the run number

    const char* getPurpose()
    REturn the purpose

    int getNbEventsTaken()
    Return the number of events taken

    int getSecRunning()
    Return the number of seconds running

    int getNbMbyWritten()
    Return the number of MBy written so far

    int getUpdateFreq()
    Return the frequency in milliseconds with which we update the run status

    void setUpdateFreq( int iMilliSec )
    To set the frequency in milliseconds how we update

    struct run_parameters getRunParameters const
    Returns the run parameters

    void setEventLimit( int iNewLimit )
    To set the event limit

    void setTimeLimit( int iNewLimit )
    To set the time limit

    void setVolumeLimit( int iNewLimit )
    To set the volume limit

    void show_status( ostream &os )
    To print a full blown status report to ostream os

    bool isActive()
    Returns true if active

    int relateToPartition( rcPartition *pPartition )
    To relate to the partition object

    int unrelateFromPartition( rcPartition *pPartition )
    To cancel relation to the partition object

    Run_i* getRunImpl()
    Returns the pointer to the CORBA proxy implementation object

    Finite State machine for the run object

    void setCurrentState( int iNewState )
    overloaded setCurrentState to allow adjusting pcStates

    enum eStates
    Enum with the states

    enum eEvents
    Enum for the events that the run can receive

    static int stt[ eNStates ][ eNEvents ]
    State transition table

    int create()
    Action for the create state - see above for details

    int starting()
    Action for the start state - see above for details

    int running()
    Action for the running state - see above for details

    int paused()
    Action for the paused state - see above for details

    int ended()
    Action for the ended state - see above for details

    int storeBorInfo()
    Stores the beginning of run information in an ASCII file

    int storeEorInfo()
    Stores the end run information in an ASCII file

    int iRunNb
    The run number

    char* pcName
    The name of the run object

    int nEventsTaken
    Number of events taken so far as obtained from the Readout object

    int nSecRunning
    Number of seconds running

    int nMbyWritten
    Number of MBytes written

    int nEventsInDDStart
    Number of events in the DD pool at the beginning of the run

    int nEventsInDD
    Number of events in the DD pool

    struct run_parameters sRunParam
    The run parameters

    int iUpdateFreqMsec
    The update frequency in Milliseconds

    static const char* pcStates[eNStates]
    Names of the states

    bool bDisableTimer
    If true we don't use timers

    smTimer* pMyTimer
    Pointer to my timer object

    rcPartition* pMyPartition
    Pointer to the partition object or NULL if we are outside a run

    bool bTestMode
    If treu we are running in a test mode

    bool bPrintRunProgress
    If true we print info about the run to cout

    Run_i* pMyImplObj
    Pointer to the CORBA proxy Run_i object


    This class has no child classes.

    alphabetic index hierarchy of classes


    this page has been generated automatically by doc++

    (c)opyright by Malte Zöckler, Roland Wunderling
    contact: doc++@zib.de