ATLAS Offline Software
Loading...
Searching...
No Matches
SumOfWeightsAlg.cxx File Reference
#include "SumOfWeightsAlg.h"
#include "CxxUtils/checker_macros.h"
#include "ReweightUtils/WeightToolBase.h"
#include "xAODCutFlow/CutBookkeeper.h"
#include <string>
Include dependency graph for SumOfWeightsAlg.cxx:

Go to the source code of this file.

Functions

StatusCode SumOfWeightsAlg::initialize ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options.

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode SumOfWeightsAlg::initialize ATLAS_NOT_THREAD_SAFE ( )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Definition at line 16 of file SumOfWeightsAlg.cxx.

16 {
17 // ^ due to registerTopFilter
18
19 ATH_MSG_DEBUG("Initializing " << name() << "...");
20 ATH_MSG_DEBUG("Retrieving tools...");
21 ATH_CHECK(m_weightTools.retrieve());
22
23 ATH_MSG_DEBUG("Tool retrieval completed.");
24 unsigned int ntool = m_weightTools.size();
25 ATH_MSG_DEBUG(" Tool count: " << ntool);
26 const std::string allStreamsStr{"AllStreams"};
27 for (size_t itool = 0; itool < ntool; ++itool ) {
28 ATH_MSG_DEBUG(" " << m_weightTools[itool]->name());
29 if(msgLvl(MSG::DEBUG)) m_weightTools[itool]->print();
30 // Get the tool's message property:
31 const WeightToolBase* tool = dynamic_cast< const WeightToolBase* >( m_weightTools[ itool ].operator->() );
32 if( ! tool ) {
33 ATH_MSG_ERROR( "The received tool is not an WeightToolBase?!?" );
34 return StatusCode::FAILURE;
35 }
36 //strip the 'ToolSvc.' off the weight name
37 std::string toolName = m_weightTools[itool]->name();
38 if(toolName.starts_with ("ToolSvc.")) toolName.replace(0,8,"");
39 CutIdentifier cID = m_cutFlowSvc->registerTopFilter( toolName,
40 toolName, // description (can be improved FIXME)
42 allStreamsStr,
43 true);
44 m_cutIDs.push_back(cID);
45 }
46
47 return StatusCode::SUCCESS;
48}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
uint32_t CutIdentifier
InstanceIdentifier is a unique identifer used for every filter.
Definition ICutFlowSvc.h:25