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 for (size_t itool = 0; itool < ntool; ++itool ) {
27 ATH_MSG_DEBUG(" " << m_weightTools[itool]->name());
28 if(msgLvl(MSG::DEBUG)) m_weightTools[itool]->print();
29 // Get the tool's message property:
30 const WeightToolBase* tool = dynamic_cast< const WeightToolBase* >( m_weightTools[ itool ].operator->() );
31 if( ! tool ) {
32 ATH_MSG_ERROR( "The received tool is not an WeightToolBase?!?" );
33 return StatusCode::FAILURE;
34 }
35 //strip the 'ToolSvc.' off the weight name
36 std::string toolName = m_weightTools[itool]->name();
37 if(toolName.starts_with ("ToolSvc.")) toolName.replace(0,8,"");
38 CutIdentifier cID = m_cutFlowSvc->registerTopFilter( toolName,
39 toolName, // description (can be improved FIXME)
41 "AllStreams",
42 true);
43 m_cutIDs.push_back(cID);
44 }
45
46 return StatusCode::SUCCESS;
47}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
uint32_t CutIdentifier
InstanceIdentifier is a unique identifer used for every filter.
Definition ICutFlowSvc.h:25