CP::IEfficiencyScaleFactorTool Class Reference

#include <IEfficiencyScaleFactorTool.h>

Inheritance diagram for CP::IEfficiencyScaleFactorTool:
CP::ISystematicsTool asg::IAsgTool CP::ElectronChargeEfficiencyCorrectionTool

List of all members.

Public Member Functions

virtual ~IEfficiencyScaleFactorTool ()
 Default destructor.
virtual CorrectionCode getEfficiencyScaleFactor (const xAOD::IParticle &p, double &sf) const =0
virtual CorrectionCode applyEfficiencyScaleFactor (const xAOD::IParticle &p) const =0

Detailed Description

General interface for tools providing analysis efficiency scale factors

This is a generic interface that should be implemented by all analysis tools that provide efficiency scale factors for xAOD::IParticle type objects.

Note:
If your tool needs type specific variables that the xAOD::IParticle interface doesn't provide, please rely on the xAOD::IParticle::type() function to identify whether you received an appropriate object. And then use static_cast to cast the reference to the right type. Like:
 {.cpp}
 if( p.type() != xAOD::Type::Electron ) {
    ATH_MSG_ERROR( "Object of wrong type (" << p.type() << ") received" );
    return CP::CorrectionCode::Error;
 }
 const xAOD::Electron& el = static_cast< const xAOD::Electron& >( p );

Just be very careful about writing the code correctly, as a wrong static_cast could lead to memory corruption. But since its much faster than dynamic_cast, it's still recommended to use this sort of code.

Revision
790193
Date
2016-12-16 17:36:15 +0100 (Fri, 16 Dec 2016)

Member Function Documentation

virtual CorrectionCode CP::IEfficiencyScaleFactorTool::applyEfficiencyScaleFactor ( const xAOD::IParticle p  )  const [pure virtual]

Decorate a particle with its efficiency scale factor

This function can be used to decorate a particle type object with an efficiency scale factor. The name and type of the scale factor variable is up to the specific tool implementation.

Parameters:
p The particle for which a scale factor is to be calculated
Returns:
CP::CorrectionCode::Error in case of a serious problem, CP::CorrectionCode::OutOfValidityRange if no scale factor is available for the received object, or CP::CorrectionCode::Ok if the scale factor could be correctly provided

Implemented in CP::ElectronChargeEfficiencyCorrectionTool.

virtual CorrectionCode CP::IEfficiencyScaleFactorTool::getEfficiencyScaleFactor ( const xAOD::IParticle p,
double &  sf 
) const [pure virtual]

Retrieve an efficiency scale factor for a particle type object

This function is used to retrieve the efficiency scale factor for a specific particle object.

Parameters:
p The particle for which a scale factor is to be calculated
sf A reference to the scale factor variable to be set
Returns:
CP::CorrectionCode::Error in case of a serious problem, CP::CorrectionCode::OutOfValidityRange if no scale factor is available for the received object, or CP::CorrectionCode::Ok if the scale factor could be correctly provided

Implemented in CP::ElectronChargeEfficiencyCorrectionTool.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 15 Apr 2017 for RootCore Packages by  doxygen 1.6.1