Bunch crossing tool reading the configuration from the web. More...
#include <WebBunchCrossingTool.h>
Classes | |
class | IOV |
Simplified IOV class. More... | |
Public Member Functions | |
WebBunchCrossingTool (const std::string &name="WebBunchCrossingTool") | |
Create a proper constructor for Athena. | |
StatusCode | loadConfig (int bgkey) |
Load a given bunch group key. | |
StatusCode | loadConfig (unsigned int run, unsigned int lb) |
Load the configuration of a given LB. | |
Protected Member Functions | |
virtual StatusCode | beginEvent () |
Function called at the beginning of each event. |
Bunch crossing tool reading the configuration from the web.
The atlas-trigconf.cern.ch webpage now provides the bunch crossing configuration as JSON data as well. This tool can be used to read this configuration directly from the webpage.
Internally the tool uses ROOT's TSocket to communicate with the webpage.
The tool tries to minimise the times it needs to contact the webserver, but still, it's not supposed to be the fastest implementation of the interface.
Trig::WebBunchCrossingTool::WebBunchCrossingTool | ( | const std::string & | name = "WebBunchCrossingTool" |
) |
Create a proper constructor for Athena.
Default constructor
StatusCode Trig::WebBunchCrossingTool::beginEvent | ( | ) | [protected, virtual] |
Function called at the beginning of each event.
This function takes care of keeping the tool up to date with the correct configuration for the currently loaded event. It needs the EventInfo object to do so.
StatusCode::SUCCESS
if the right configuration could be loaded, or StatusCode::FAILURE
if not. Reimplemented from asg::AsgMetadataTool.
StatusCode Trig::WebBunchCrossingTool::loadConfig | ( | unsigned int | run, | |
unsigned int | lb | |||
) |
Load the configuration of a given LB.
This function can be used to load the bunch structure information for a given run and luminosity block number.
First the function checks in its cache which BG key this period corresponds to. If the requested luminosity block is already known in the cache, then the function asks loadConfig(int) to load the configuration. If the luminosity block is not known, the function reads the configuration for the entire run from the webpage, and lets cacheJSONConfig(...) load it into the internal cache. After the new configuration is cached, the function calls itself recursively, because this time it will know right away what to do.
run | The run number of the data you're analysing | |
lb | The luminosity block number of the data you're analysing |
StatusCode::SUCCESS
if the configuration was loaded successfully, or StatusCode::FAILURE
if it wasn't StatusCode Trig::WebBunchCrossingTool::loadConfig | ( | int | bgkey | ) |
Load a given bunch group key.
This is the fairly complicated function which (if necessary) loads the configuration belonging to BG key "bgkey" from either the internal cache of the tool, or from the atlas-trigconf.cern.ch webpage directly.
bgkey | The bunch group key that should be loaded |
StatusCode::SUCCESS
if the operation was successful, or StatusCode::FAILURE
if it wasn't