LCCD  1.5.0
Public Member Functions | Protected Attributes | List of all members
lccd::SimpleFileHandler Class Reference

Implementation of ConditionsHandlerBase that reads the conditions data from an LCIO file. More...

#include <SimpleFileHandler.hh>

Inheritance diagram for lccd::SimpleFileHandler:
lccd::ConditionsHandlerBase lccd::IConditionsHandler

Public Member Functions

 SimpleFileHandler (const std::string &fileName, const std::string &name, const std::string &inputCollection="")
 Default constructor. More...
 
virtual void update (LCCDTimeStamp timestamp)
 Retrieves the conditions data on first call. More...
 
virtual void registerDefaultCollection (lcio::LCCollection *col)
 Register a pointer to a default collection which will be passed to the IConditionsChangeListener if no data can be found for a given time stamp. More...
 
virtual lcio::LCCollection * defaultCollection ()
 The default collection registered with the handler. More...
 
virtual lcio::LCCollection * lastValidCollection ()
 The last valid collection held by the handler. More...
 
- Public Member Functions inherited from lccd::ConditionsHandlerBase
 ConditionsHandlerBase (const ConditionsHandlerBase &)=delete
 
ConditionsHandlerBaseoperator= (const ConditionsHandlerBase &)=delete
 
 ConditionsHandlerBase (const std::string &name)
 Default c'tor - need a name for the conditions data set.
 
virtual void updateEvent (lcio::LCEvent *evt)
 Retrieves the new conditions data if required by evt->getTimestamp() and adds a collection to event with its name. More...
 
virtual lcio::LCCollection * currentCollection ()
 Returns the current collection of conditions data.
 
virtual void registerChangeListener (IConditionsChangeListener *cl)
 Every IConditionsChangeListener will be notified if the conditions data of this instance has changed.
 
virtual void removeChangeListener (IConditionsChangeListener *cl)
 Remove the specified listener from list of registered listeners ;.
 
virtual bool isChangeListenerRegistered (IConditionsChangeListener *cl)
 checks if the changeListner is Registered
 
virtual const std::string name ()
 The name of this conditions handler - used, e.g. More...
 
virtual LCCDTimeStamp validSince ()
 First timestamp for which the current conditions data is valid.
 
virtual LCCDTimeStamp validTill ()
 Last timestamp for which the current conditions data is valid.
 

Protected Attributes

std::string _fileName {}
 Name of LCIO input file with conditions data.
 
std::string _inputCollection {}
 Name of LCCollection in first event.
 
bool _firstCall {}
 
- Protected Attributes inherited from lccd::ConditionsHandlerBase
lcio::LCCollection * _col = nullptr
 The current collection of conditions data. More...
 
std::string _name {}
 Name assigned with conditions data.
 
LCCDTimeStamp _validSince {}
 First timestamp for which the current data is valid. More...
 
LCCDTimeStamp _validTill {}
 Last timestamp for which the current data is valid. More...
 
std::vector
< IConditionsChangeListener * > 
_changeListeners {}
 The registered change listeners.
 

Additional Inherited Members

- Protected Member Functions inherited from lccd::ConditionsHandlerBase
virtual void notifyListeners ()
 Tell all registered listeners that the conditions data has changed.
 

Detailed Description

Implementation of ConditionsHandlerBase that reads the conditions data from an LCIO file.

The conditions data has to be in the first event. The data will get an infinite validity time intervall assigned.
This can be used, e.g. to read a set of calibration constants that will be used unaltered throughout the job.

Upon registering an IConditionsChangeListener with this Conditions Handler the call-back method registeredWithHandler( IConditionsHandler* ch ) will be called. Likewise calling removeChangeListener( IConditionsChangeListener* cl) will call the call-back method deRegisteredWithHandler( IConditionsHandler* ch )

Note: The data isn't read from the file until update() is called. Note: The use of default Collections is not implemented for this Class.

Author
F.Gaede, S.Aplin, DESY
Version
Id:
SimpleFileHandler.hh,v 1.3 2007-04-27 13:21:31 gaede Exp

Constructor & Destructor Documentation

lccd::SimpleFileHandler::SimpleFileHandler ( const std::string &  fileName,
const std::string &  name,
const std::string &  inputCollection = "" 
)

Default constructor.

You have to specify the following parameters:

Parameters
fileName,:the LCIO file that holds the conditions data.
name,:of this conditions data set - used, e.g. as collection name in update(LCEvent* evt)
inputCollection,:name of collection in input file - if not given the name of this conditions data set is used

References lccd::ConditionsHandlerBase::_col, and _inputCollection.

Member Function Documentation

lcio::LCCollection * lccd::SimpleFileHandler::defaultCollection ( )
virtual

The default collection registered with the handler.

Warning
Not implemented, use will cause exception to be thrown.

Implements lccd::ConditionsHandlerBase.

References lccd::ConditionsHandlerBase::name().

lcio::LCCollection * lccd::SimpleFileHandler::lastValidCollection ( )
virtual

The last valid collection held by the handler.

Warning
Not implemented, use will cause exception to be thrown.

Implements lccd::ConditionsHandlerBase.

References lccd::ConditionsHandlerBase::name().

void lccd::SimpleFileHandler::registerDefaultCollection ( lcio::LCCollection *  col)
virtual

Register a pointer to a default collection which will be passed to the IConditionsChangeListener if no data can be found for a given time stamp.

Warning
Not implemented, use will cause exception to be thrown.

Implements lccd::ConditionsHandlerBase.

References lccd::ConditionsHandlerBase::name().

void lccd::SimpleFileHandler::update ( LCCDTimeStamp  timestamp)
virtual

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