|
ATLAS Offline Software
|
Go to the documentation of this file.
11 ,m_vTrigChainNames({})
22 TH1::AddDirectory(kFALSE);
30 return StatusCode::FAILURE;
45 if ( !
sc.isSuccess() ) {
46 ATH_MSG_WARNING(
"Error parsing trigger chain list, using empty list instead.");
50 }
else sc = StatusCode::SUCCESS;
68 ATH_MSG_DEBUG(
"Exiting AthMonitorAlgorithm::initialize() successfully.");
78 if (!filterItr->accept()) {
80 return StatusCode::SUCCESS;
87 return StatusCode::SUCCESS;
114 std::string lowerCaseStr =
str;
118 if( lowerCaseStr ==
"user" ) {
120 }
else if( lowerCaseStr ==
"online" ) {
122 }
else if( lowerCaseStr ==
"tier0" ) {
124 }
else if( lowerCaseStr ==
"tier0raw" ) {
126 }
else if( lowerCaseStr ==
"tier0esd" ) {
128 }
else if( lowerCaseStr ==
"aod" ) {
130 }
else if( lowerCaseStr ==
"altprod" ) {
133 ATH_MSG_WARNING(
"AthMonitorAlgorithm::envStringToEnum(): Unknown environment "
134 <<
str<<
", returning user.");
142 std::string lowerCaseStr =
str;
146 if( lowerCaseStr ==
"userdefined" ) {
148 }
else if( lowerCaseStr ==
"montecarlo" ) {
150 }
else if( lowerCaseStr ==
"collisions" ) {
152 }
else if( lowerCaseStr ==
"cosmics" ) {
154 }
else if( lowerCaseStr ==
"heavyioncollisions" ) {
157 ATH_MSG_WARNING(
"AthMonitorAlgorithm::dataTypeStringToEnum(): Unknown data type "
158 <<
str<<
", returning userDefined.");
171 if (!isInitialized()) {
173 "It seems that the AthMonitorAlgorithm::initialize was not called "
174 "in derived class initialize method");
178 [](
const std::string&
s,
auto h) { return s +
"," + h.first; });
179 ATH_MSG_FATAL(
"The tool " <<
name <<
" could not be found in the tool array of the "
180 <<
"monitoring algorithm " <<
m_name <<
". This probably reflects a discrepancy between "
181 <<
"your python configuration and c++ filling code. Note: your available groups are {"
182 << available <<
"}.");
198 if (vTrigNames.empty())
return true;
210 bool expressPass = passedBits & TrigDefs::Express_passed;
217 return group->isPassed();
226 return lumi->lbAverageInteractionsPerCrossing();
228 ATH_MSG_DEBUG(
"AthMonitorAlgorithm::lbAverageInteractionsPerCrossing() - luminosity tools are not retrieved.");
238 float muToLumi =
lumi->muToLumi();
240 return lumi->lbLuminosityPerBCIDVector().at (ctx.eventID().bunch_crossing_id()) / muToLumi;
244 ATH_MSG_DEBUG(
"AthMonitorAlgorithm::lbInteractionsPerCrossing() - luminosity tools are not retrieved.");
254 return lumi->lbAverageLuminosity();
256 ATH_MSG_DEBUG(
"AthMonitorAlgorithm::lbAverageLuminosity() - luminosity tools are not retrieved.");
266 return lumi->lbLuminosityPerBCIDVector().at (ctx.eventID().bunch_crossing_id());
268 ATH_MSG_DEBUG(
"AthMonitorAlgorithm::lbLuminosityPerBCID() - luminosity tools are not retrieved.");
285 ATH_MSG_DEBUG(
"AthMonitorAlgorithm::lbAverageLivefraction() - luminosity not available.");
302 ATH_MSG_DEBUG(
"AthMonitorAlgorithm::livefractionPerBCID() - luminosity not available.");
313 ATH_MSG_DEBUG(
"AthMonitorAlgorithm::lbLumiWeight() - luminosity tools are not retrieved.");
330 ATH_MSG_DEBUG(
"AthMonitorAlgorithm::lbDuration() - luminosity tools are not retrieved.");
338 std::stringstream
ss(
line);
342 while ( std::getline(
ss,
item,
',') ) {
343 std::stringstream iss(
item);
348 return StatusCode::SUCCESS;
virtual float livefractionPerBCID(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the live fraction per bunch crossing ID.
Gaudi::Property< std::string > m_dataTypeStr
DataType string pulled from the job option and converted to enum.
virtual float lbInteractionsPerCrossing(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate instantaneous number of interactions, i.e.
virtual double lbLumiWeight(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the average integrated luminosity multiplied by the live fraction.
Group
Properties of a chain group.
Gaudi::Property< std::string > m_environmentStr
Environment string pulled from the job option and converted to enum.
virtual float lbAverageLuminosity(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Tool to tell whether a specific trigger is passed.
Gaudi::Property< std::string > m_triggerChainString
Trigger chain string pulled from the job option and parsed into a vector.
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
std::vector< std::string > m_vTrigChainNames
Vector of trigger chain names parsed from trigger chain string.
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Key for retrieving EventInfo from StoreGate.
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
std::unordered_map< std::string, size_t > m_toolLookupMap
AthMonitorAlgorithm::Environment_t m_environment
Instance of the Environment_t enum.
bool empty() const
Test if the key is blank.
bool trigChainsArePassed(const std::vector< std::string > &vTrigNames) const
Check whether triggers are passed.
float lbAverageLiveFraction(bool highPriority=true) const
Luminosity-averaged live fraction over all physics BCIDs.
const ToolHandle< GenericMonitoringTool > m_dummy
An algorithm that can be simultaneously executed in multiple threads.
virtual float lbLuminosityPerBCID(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the instantaneous luminosity per bunch crossing.
ToolHandleArray< IDQFilterTool > m_DQFilterTools
Array of Data Quality filter tools.
DataType_t dataTypeStringToEnum(const std::string &str) const
Convert the data type string from the python configuration to an enum object.
virtual ~AthMonitorAlgorithm()
Destructor.
::StatusCode StatusCode
StatusCode definition for legacy code.
void tolower(std::string &s)
Gaudi::Property< float > m_defaultLBDuration
Default duration of one lumi block.
virtual StatusCode fillHistograms(const EventContext &ctx) const =0
adds event to the monitoring histograms
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
DataType_t
Specifies what type of input data is being monitored.
virtual StatusCode execute(const EventContext &ctx) const override
Applies filters and trigger requirements.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
Environment_t
Specifies the processing environment.
const std::vector< float > & l1LiveFractionVector(bool highPriority=true) const
Return vector with all BCIDs indexed by BCID number.
AthMonitorAlgorithm::DataType_t m_dataType
Instance of the DataType_t enum.
double lbDuration() const
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
virtual float lbAverageLivefraction(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the average luminosity livefraction.
Gaudi::Property< bool > m_enforceExpressTriggers
StatusCode initialize(bool used=true)
virtual float lbAverageInteractionsPerCrossing(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the average mu, i.e.
virtual StatusCode initialize() override
initialize
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey
#define ATH_MSG_WARNING(x)
virtual StatusCode parseList(const std::string &line, std::vector< std::string > &result) const
Parse a string into a vector.
Environment_t envStringToEnum(const std::string &str) const
Convert the environment string from the python configuration to an enum object.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadCondHandleKey< TrigLiveFractionCondData > m_trigLiveFractionDataKey
virtual double lbDuration(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the duration of the luminosity block (in seconds)
Gaudi::Property< bool > m_useLumi
Allows use of various luminosity functions.
SG::ReadCondHandleKey< LBDurationCondData > m_lbDurationDataKey
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.