Skip to content
Snippets Groups Projects
Commit b34e98db authored by Charles Burton's avatar Charles Burton
Browse files

cosmetic changes

1. update example AthMonitorAlgorithm to use new Monitored interface names
2. refactor fill() function to avoid code duplication
parent 37aa860b
No related branches found
No related tags found
No related merge requests found
...@@ -79,24 +79,24 @@ public: ...@@ -79,24 +79,24 @@ public:
/** /**
* Adds variables from an event to a group by name. * Adds variables from an event to a group by name.
* *
* At the end of the fillHistograms routine, one should save the monitored variables
* to the group. This function wraps the process of getting the desired group by a
* call to AthMonitorAlgorithm::getGroup() and a call to Monitored::Group::fill(),
* which also disables the auto-fill feature to avoid double-filling. Note, users
* should avoid using this specific function name in daughter classes.
*
* @param groupName The string name of the GenericMonitoringTool * @param groupName The string name of the GenericMonitoringTool
* @param variables Variables desired to be saved. * @param variables Variables desired to be saved.
* @return StatusCode * @return StatusCode
*/ */
template <typename... T> template <typename... T>
void fill( const std::string& groupName, T&&... variables ) const { void fill( const std::string& groupName, T&&... variables ) const {
Monitored::Group(getGroup(groupName),std::forward<T>(variables)...).fill(); fill(getGroup(groupName),std::forward<T>(variables)...);
} }
/** /**
* Adds variables from an event to a group by object reference. * Adds variables from an event to a group by the group's object reference.
*
* At the end of the fillHistograms routine, one should save the monitored variables
* to the group. This function wraps the process of getting the desired group by a
* call to AthMonitorAlgorithm::getGroup() and a call to Monitored::Group::fill(),
* which also disables the auto-fill feature to avoid double-filling. Note, users
* should avoid using this specific function name in daughter classes.
* *
* @param groupHandle A reference of the GenericMonitoringTool to which add variables. * @param groupHandle A reference of the GenericMonitoringTool to which add variables.
* @param variables Variables desired to be saved * @param variables Variables desired to be saved
......
...@@ -87,7 +87,8 @@ def ExampleMonitoringConfig(inputFlags): ...@@ -87,7 +87,8 @@ def ExampleMonitoringConfig(inputFlags):
anotherGroup.defineHistogram('lbWithFilter;lbWithFilter',title='Lumi;lb;Events', anotherGroup.defineHistogram('lbWithFilter;lbWithFilter',title='Lumi;lb;Events',
path='top',xbins=1000,xmin=-0.5,xmax=999.5) path='top',xbins=1000,xmin=-0.5,xmax=999.5)
anotherGroup.defineHistogram('run;run',title='Run Number;run;Events',
path='top',xbins=1000000,xmin=-0.5,xmax=999999.5)
### STEP 6 ### ### STEP 6 ###
# Finalize. The return value should be a tuple of the ComponentAccumulator # Finalize. The return value should be a tuple of the ComponentAccumulator
......
...@@ -22,10 +22,10 @@ StatusCode ExampleMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co ...@@ -22,10 +22,10 @@ StatusCode ExampleMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
using namespace Monitored; using namespace Monitored;
// Declare the quantities which should be monitored // Declare the quantities which should be monitored
auto lumiPerBCID = MonitoredScalar::declare<float>("lumiPerBCID",0.0); auto lumiPerBCID = Monitored::Scalar<float>("lumiPerBCID",0.0);
auto lb = MonitoredScalar::declare<int>("lb",0); auto lb = Monitored::Scalar<int>("lb",0);
auto run = MonitoredScalar::declare<int>("run",0); auto run = Monitored::Scalar<int>("run",0);
auto random = MonitoredScalar::declare<float>("random",0.0); auto random = Monitored::Scalar<float>("random",0.0);
// Set the values of the monitored variables for the event // Set the values of the monitored variables for the event
lumiPerBCID = lbAverageInteractionsPerCrossing(); lumiPerBCID = lbAverageInteractionsPerCrossing();
lb = GetEventInfo(ctx)->lumiBlock(); lb = GetEventInfo(ctx)->lumiBlock();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment