LCCD
1.5.0
|
Implementation of ConditionsHandlerBase that reads the conditions data from an LCIO file. More...
#include <SimpleFileHandler.hh>
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 | |
ConditionsHandlerBase & | operator= (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. | |
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.
lccd::SimpleFileHandler::SimpleFileHandler | ( | const std::string & | fileName, |
const std::string & | name, | ||
const std::string & | inputCollection = "" |
||
) |
Default constructor.
You have to specify the following 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.
|
virtual |
The default collection registered with the handler.
Implements lccd::ConditionsHandlerBase.
References lccd::ConditionsHandlerBase::name().
|
virtual |
The last valid collection held by the handler.
Implements lccd::ConditionsHandlerBase.
References lccd::ConditionsHandlerBase::name().
|
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.
Implements lccd::ConditionsHandlerBase.
References lccd::ConditionsHandlerBase::name().
|
virtual |
Retrieves the conditions data on first call.
Subsequent calls have no effect.
Notifies all registered listeners on first call.
Implements lccd::ConditionsHandlerBase.
References lccd::ConditionsHandlerBase::_col, _fileName, _inputCollection, lccd::ConditionsHandlerBase::_validSince, lccd::ConditionsHandlerBase::_validTill, lccd::LCCDMinusInf, lccd::LCCDPlusInf, lccd::ConditionsHandlerBase::name(), and lccd::ConditionsHandlerBase::notifyListeners().