Commit e712da97 authored by Marcin Nowak's avatar Marcin Nowak Committed by Graeme Stewart
Browse files

new autoloading for namespaces from python (xAODPrimitives-01-03-04)

	* xAODPrimitives\selection.xml: add entry
	xAOD::Iso::ROOT6_NamespaceAutoloadHook for ROOT6 namespace
	autoloading (replaces previous fix)
	* tagging as xAODPrimitives-01-03-04

2014-12-08 Edward.Moyse@cern.ch
	* Fix for ROOT6 from David Malon
	* tagging as xAODPrimitives-01-03-03

2014-12-05 J.-B. de Vivie
	* Missing toString for ptvarconeXX
	* tagging as xAODPrimitives-01-03-02

2014-12-05 J.-B. de Vivie
	* Forgot to remove coreTopodR10 = 99
	* tagging as xAODPrimitives-01-03-01

2014-12-04 J.-B. de Vivie
	* Repace back enum class by enum !
 	* replace coreTopodR10 by coreCone. In the accessor, core57 will be flavour independant, coreCone flavor dep (neflowiso or topoetcone)
...
(Long ChangeLog diff - truncated)
parent 7fc7d0ff
......@@ -2,7 +2,7 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: getIsolationAccessor.cxx 618838 2014-09-27 19:31:26Z christos $
// $Id: getIsolationAccessor.cxx 630627 2014-11-24 14:35:22Z emoyse $
// System include(s):
#include <vector>
......@@ -37,117 +37,29 @@ namespace xAOD {
static std::vector< SmartPointer_t > sAccessors;
// Create the accessor objects if they don't exist yet:
if( ! sAccessors.size() ) {
if( sAccessors.empty() ) {
// Make the vector large enough for all the accessors:
sAccessors.resize( 100 );
sAccessors.resize( Iso::numIsolationTypes );
// Etcone variables:
DEFINE_ISO_ACCESSOR( etcone10 );
DEFINE_ISO_ACCESSOR( etcone15 );
DEFINE_ISO_ACCESSOR( etcone20 );
DEFINE_ISO_ACCESSOR( etcone25 );
DEFINE_ISO_ACCESSOR( etcone30 );
DEFINE_ISO_ACCESSOR( etcone35 );
DEFINE_ISO_ACCESSOR( etcone40 );
DEFINE_ISO_ACCESSOR( etcone45 );
// Ptcone variables:
DEFINE_ISO_ACCESSOR( ptcone10 );
DEFINE_ISO_ACCESSOR( ptcone15 );
DEFINE_ISO_ACCESSOR( ptcone20 );
DEFINE_ISO_ACCESSOR( ptcone25 );
DEFINE_ISO_ACCESSOR( ptcone30 );
DEFINE_ISO_ACCESSOR( ptcone35 );
DEFINE_ISO_ACCESSOR( ptcone40 );
DEFINE_ISO_ACCESSOR( ptcone45 );
// Nucone variables:
DEFINE_ISO_ACCESSOR( nucone10 );
DEFINE_ISO_ACCESSOR( nucone15 );
DEFINE_ISO_ACCESSOR( nucone20 );
DEFINE_ISO_ACCESSOR( nucone25 );
DEFINE_ISO_ACCESSOR( nucone30 );
DEFINE_ISO_ACCESSOR( nucone35 );
DEFINE_ISO_ACCESSOR( nucone40 );
DEFINE_ISO_ACCESSOR( nucone45 );
// EtconeNoEm variables:
DEFINE_ISO_ACCESSOR( etconeNoEm10 );
DEFINE_ISO_ACCESSOR( etconeNoEm15 );
DEFINE_ISO_ACCESSOR( etconeNoEm20 );
DEFINE_ISO_ACCESSOR( etconeNoEm25 );
DEFINE_ISO_ACCESSOR( etconeNoEm30 );
DEFINE_ISO_ACCESSOR( etconeNoEm35 );
DEFINE_ISO_ACCESSOR( etconeNoEm40 );
DEFINE_ISO_ACCESSOR( etconeNoEm45 );
// Etcone_ptcorrected variables:
DEFINE_ISO_ACCESSOR( etcone10_ptcorrected );
DEFINE_ISO_ACCESSOR( etcone15_ptcorrected );
DEFINE_ISO_ACCESSOR( etcone20_ptcorrected );
DEFINE_ISO_ACCESSOR( etcone25_ptcorrected );
DEFINE_ISO_ACCESSOR( etcone30_ptcorrected );
DEFINE_ISO_ACCESSOR( etcone35_ptcorrected );
DEFINE_ISO_ACCESSOR( etcone40_ptcorrected );
DEFINE_ISO_ACCESSOR( etcone45_ptcorrected );
// Etcone_corrected variables:
DEFINE_ISO_ACCESSOR( etcone10_corrected );
DEFINE_ISO_ACCESSOR( etcone15_corrected );
DEFINE_ISO_ACCESSOR( etcone20_corrected );
DEFINE_ISO_ACCESSOR( etcone25_corrected );
DEFINE_ISO_ACCESSOR( etcone30_corrected );
DEFINE_ISO_ACCESSOR( etcone35_corrected );
DEFINE_ISO_ACCESSOR( etcone40_corrected );
DEFINE_ISO_ACCESSOR( etcone45_corrected );
// TopoEtcone variables:
DEFINE_ISO_ACCESSOR( topoetcone10 );
DEFINE_ISO_ACCESSOR( topoetcone15 );
DEFINE_ISO_ACCESSOR( topoetcone20 );
DEFINE_ISO_ACCESSOR( topoetcone25 );
DEFINE_ISO_ACCESSOR( topoetcone30 );
DEFINE_ISO_ACCESSOR( topoetcone35 );
DEFINE_ISO_ACCESSOR( topoetcone40 );
DEFINE_ISO_ACCESSOR( topoetcone45 );
// TopoEtcone_ptcorrected variables:
DEFINE_ISO_ACCESSOR( topoetcone10_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone15_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone20_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone25_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone30_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone35_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone40_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone45_ptcorrected );
// TopoEtcone_corrected variables:
DEFINE_ISO_ACCESSOR( topoetcone10_corrected );
DEFINE_ISO_ACCESSOR( topoetcone15_corrected );
DEFINE_ISO_ACCESSOR( topoetcone20_corrected );
DEFINE_ISO_ACCESSOR( topoetcone25_corrected );
DEFINE_ISO_ACCESSOR( topoetcone30_corrected );
DEFINE_ISO_ACCESSOR( topoetcone35_corrected );
DEFINE_ISO_ACCESSOR( topoetcone40_corrected );
DEFINE_ISO_ACCESSOR( topoetcone45_corrected );
DEFINE_ISO_ACCESSOR( topoetcone10_core57cells );
DEFINE_ISO_ACCESSOR( topoetcone15_core57cells );
DEFINE_ISO_ACCESSOR( topoetcone20_core57cells );
DEFINE_ISO_ACCESSOR( topoetcone25_core57cells );
DEFINE_ISO_ACCESSOR( topoetcone30_core57cells );
DEFINE_ISO_ACCESSOR( topoetcone35_core57cells );
DEFINE_ISO_ACCESSOR( topoetcone40_core57cells );
DEFINE_ISO_ACCESSOR( topoetcone45_core57cells );
DEFINE_ISO_ACCESSOR( topoetcone10_core57cells_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone15_core57cells_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone20_core57cells_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone25_core57cells_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone30_core57cells_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone35_core57cells_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone40_core57cells_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone45_core57cells_ptcorrected );
DEFINE_ISO_ACCESSOR( topoetcone10_core57cells_corrected );
DEFINE_ISO_ACCESSOR( topoetcone15_core57cells_corrected );
DEFINE_ISO_ACCESSOR( topoetcone20_core57cells_corrected );
DEFINE_ISO_ACCESSOR( topoetcone25_core57cells_corrected );
DEFINE_ISO_ACCESSOR( topoetcone30_core57cells_corrected );
DEFINE_ISO_ACCESSOR( topoetcone35_core57cells_corrected );
DEFINE_ISO_ACCESSOR( topoetcone40_core57cells_corrected );
DEFINE_ISO_ACCESSOR( topoetcone45_core57cells_corrected );
// Mini-Isolation (http://arxiv.org/abs/1007.2221) variables:
DEFINE_ISO_ACCESSOR(ptvarcone20);
DEFINE_ISO_ACCESSOR(ptvarcone30);
DEFINE_ISO_ACCESSOR(ptvarcone40);
// neutral eflow
DEFINE_ISO_ACCESSOR(neflowisol20);
DEFINE_ISO_ACCESSOR(neflowisol30);
DEFINE_ISO_ACCESSOR(neflowisol40);
}
// Look up the element, throwing an exception for too large
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: getIsolationCorrectionAccessor.cxx 625328 2014-10-31 09:39:45Z laplace $
// System include(s):
#include <vector>
#include <memory>
#include <map>
#include <stdexcept>
// Local include(s):
#include "xAODPrimitives/tools/getIsolationCorrectionAccessor.h"
/// The type to be used as the smart pointer
#if __cplusplus >= 201100
typedef std::unique_ptr< SG::AuxElement::Accessor< float > > SmartPointer_t;
typedef std::unique_ptr< SG::AuxElement::Accessor< uint32_t > > SmartPointerUint_t; // Needs to match size of IsolationCalo/TrackCorrectionBitset
#else
typedef std::auto_ptr< SG::AuxElement::Accessor< float > > SmartPointer_t;
typedef std::auto_ptr< SG::AuxElement::Accessor< uint32_t > > SmartPointerUint_t; // Needs to match size of IsolationCalo/TrackCorrectionBitset
#endif // C++11
namespace xAOD {
SG::AuxElement::Accessor< uint32_t >*
getIsolationCorrectionBitsetAccessor( Iso::IsolationFlavour type ){
// Thought we could try it this way, since it's likely to be pretty sparse?
// Can optimise if necessary
static std::map<Iso::IsolationFlavour, SmartPointerUint_t > sAccessors;
if (sAccessors.find(type)==sAccessors.end()){
// create Accessor
std::string name(Iso::toString(type));
name+="CorrBitset";
sAccessors[type] = SmartPointerUint_t( new SG::AuxElement::Accessor< uint32_t >( name ) ) ;
}
return sAccessors[ type ].get();
}
SG::AuxElement::Accessor< float >*
getIsolationCorrectionAccessor( Iso::IsolationFlavour type, Iso::IsolationCaloCorrection corr, Iso::IsolationCorrectionParameter param ){
static std::map<uint32_t, SmartPointer_t > sAccessors;
uint32_t hash = (static_cast<uint8_t>(corr)<<8)+(static_cast<uint8_t>(param));
if(corr == Iso::coreCone) hash += (static_cast<uint8_t>(type)<<16);
assert (0 <= static_cast<int>(param) && static_cast<int>(param) < xAOD::Iso::NumCorrParameters);
if (sAccessors.find(hash)==sAccessors.end()){
std::string name(Iso::toString(type));
if (corr == Iso::coreCone)
name+=toString(corr);
else
name = toString(corr);
if (param==xAOD::Iso::coreEnergy || param==xAOD::Iso::coreArea){
name+=toString(param );
}else{
throw std::runtime_error("IsolationCorrectionParameter out of bounds");
}
name+="Correction";
sAccessors[hash] = SmartPointer_t( new SG::AuxElement::Accessor< float >( name ) ) ;
}
return sAccessors[hash].get();
}
// Isolation Calo
SG::AuxElement::Accessor< float >*
getIsolationCorrectionAccessor( Iso::IsolationType type, Iso::IsolationCaloCorrection corr){
static std::map<uint32_t, SmartPointer_t > sAccessors;
uint32_t hash = (static_cast<uint8_t>(type)<<16)+(static_cast<uint8_t>(corr)<<8);
if (sAccessors.find(hash)==sAccessors.end()){
std::string name(Iso::toString(type));
name+=toString(corr);
name+="Correction";
sAccessors[hash] = SmartPointer_t( new SG::AuxElement::Accessor< float >( name ) ) ;
}
return sAccessors[hash].get();
}
SG::AuxElement::Accessor< float >*
getIsolationCorrectionAccessor( Iso::IsolationFlavour type, Iso::IsolationTrackCorrection corr ){
static std::map<uint32_t, SmartPointer_t > sAccessors;
uint32_t hash = (static_cast<uint8_t>(type)<<16)+(static_cast<uint8_t>(corr)<<8);
if (sAccessors.find(hash)==sAccessors.end()){
std::string name(Iso::toString(type));
name+=toString(corr);
name+="Correction";
sAccessors[hash] = SmartPointer_t( new SG::AuxElement::Accessor< float >( name ) ) ;
}
return sAccessors[hash].get();
}
} // namespace xAOD
package xAODPrimitives
# $Id: requirements 617099 2014-09-17 07:41:26Z schaffer $
# $Id: requirements 625835 2014-11-03 17:30:11Z neldik $
author Edward Moyse <Edward.Moyse@cern.ch>
author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
......@@ -18,9 +18,14 @@ apply_pattern installed_library
private
use TestTools TestTools-* AtlasTest
use AtlasReflex AtlasReflex-* External
apply_pattern UnitTest_run unit_test=ut_xAOD_primitives_enums_test
macro_append ut_xAOD_primitives_enums_test_dependencies " xAODPrimitives "
application ut_xAOD_primitives_enums_test ../test/ut_xAOD_primitives_enums_test.cxx
apply_pattern lcgdict dict=xAODPrimitives selectionfile=selection.xml \
headerfiles="../xAODPrimitives/xAODPrimitivesDict.h" \
extralibfiles=../Root/dict/*.cxx
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "xAODPrimitives/IsolationType.h"
#include "xAODPrimitives/IsolationConeSize.h"
#include "xAODPrimitives/IsolationFlavour.h"
#include "xAODPrimitives/IsolationCorrection.h"
#include "xAODPrimitives/IsolationCorrectionHelper.h"
#include "xAODPrimitives/IsolationHelpers.h"
#include <iostream>
#include <algorithm>
#include <vector>
unsigned int encode();
unsigned int decode();
unsigned int testCaloBitset();
unsigned int testTrackBitset();
using namespace xAOD;
int main() {
std::cout << " testing encoding " << std::endl;
unsigned int nfailures = encode();
nfailures += decode();
std::cout << " total number of failures " << nfailures << std::endl;
std::cout << " testing calo bitset " << std::endl;
unsigned int nfailures2 = testCaloBitset();
std::cout << " total number of failures " << nfailures2 << std::endl;
std::cout << " testing track bitset " << std::endl;
unsigned int nfailures3 = testTrackBitset();
std::cout << " total number of failures " << nfailures3 << std::endl;
return ( nfailures+nfailures2+nfailures3 != 0 ) ? -1 : 0;
}
bool check( bool result, std::string message, Iso::IsolationType type, unsigned int& nfailures ){
if( !result ) {
++nfailures;
std::cout << "WARNING " << message << " for type " << type << std::endl;
}
return result;
}
unsigned int encode() {
unsigned int nfailures = 0;
for( int i = 0 ; i < static_cast<int>(Iso::IsolationType::numIsolationTypes) ; ++i ){
// current number of failures
unsigned int startFailures = nfailures;
// skip invalid entries
if( i%10 >= static_cast<int>(Iso::IsolationConeSize::numIsolationConeSizes) ) continue;
Iso::IsolationType type = static_cast<Iso::IsolationType>(i);
// decode and check cone size
Iso::IsolationConeSize coneSize = Iso::enumconeSize(type);
check( coneSize <= Iso::IsolationConeSize::numIsolationConeSizes, "invalid cone size",type,nfailures);
float fsize = Iso::coneSize(coneSize);
check (Iso::coneSize(fsize)==coneSize, "Cone size conversion to float & back failed",type,nfailures);
// decode and check flavour
Iso::IsolationFlavour flavour = Iso::isolationFlavour(type);
check( flavour <= Iso::IsolationFlavour::numIsolationFlavours, "invalid flavour",type,nfailures);
// encode isolation type
Iso::IsolationType typeE = Iso::isolationType(flavour,coneSize);
check( typeE == type, "inconsistent conversion of type",type,nfailures);
if( startFailures != nfailures ){
std::cout << " detected a failure with type " << static_cast<int>(type) << " typeE " << static_cast<int>(typeE)
<< " coneSize " << static_cast<int>(coneSize) << " flavour " << static_cast<int>(flavour) << std::endl;
}
}
return nfailures;
}
unsigned int decode() {
return 0;
}
bool compareBitsets( const std::vector<Iso::IsolationCaloCorrection>& vec1, const std::vector<Iso::IsolationCaloCorrection>& vec2 ){
if( vec1.size() != vec2.size() ){
std::cout << " incompatible sizes " << vec1.size() << " " << vec2.size() << std::endl;
return false;
}
unsigned int nfound = 0;
for( auto item : vec1 ){
auto pos = std::find(vec2.begin(),vec2.end(),item);
if( pos != vec2.end() ) ++nfound;
}
if( nfound != vec1.size() ){
std::cout << " not all elements found " << nfound << " total " << vec1.size() <<std::endl;
return false;
}
return true;
}
bool compareBitsets( const std::vector<Iso::IsolationTrackCorrection>& vec1, const std::vector<Iso::IsolationTrackCorrection>& vec2 ){
if( vec1.size() != vec2.size() ){
std::cout << " incompatible sizes " << vec1.size() << " " << vec2.size() << std::endl;
return false;
}
unsigned int nfound = 0;
for( auto item : vec1 ){
auto pos = std::find(vec2.begin(),vec2.end(),item);
if( pos != vec2.end() ) ++nfound;
}
if( nfound != vec1.size() ){
std::cout << " not all elements found " << nfound << " total " << vec1.size() <<std::endl;
return false;
}
return true;
}
unsigned int testCaloBitset() {
unsigned int nfailures = 0;
for( int i=0;i<static_cast<int>(Iso::IsolationCaloCorrection::numIsolationCaloCorrections);++i ){
Iso::IsolationCaloCorrection cori = static_cast<Iso::IsolationCaloCorrection>(i);
std::vector<Iso::IsolationCaloCorrection> vec1 = {cori};
std::vector<Iso::IsolationCaloCorrection> results;
Iso::IsolationCaloCorrectionBitset bitset;
Iso::IsolationCaloCorrectionBitsetHelper::encode(vec1,bitset);
Iso::IsolationCaloCorrectionBitsetHelper::decode(bitset,results);
if(!compareBitsets(vec1,results)) ++nfailures;
for( int j=i+1;j<static_cast<int>(Iso::IsolationCaloCorrection::numIsolationCaloCorrections);++j ){
Iso::IsolationCaloCorrection corj = static_cast<Iso::IsolationCaloCorrection>(j);
std::vector<Iso::IsolationCaloCorrection> vec2 = vec1;
vec2.push_back(corj);
Iso::IsolationCaloCorrectionBitsetHelper::encode(vec2,bitset);
Iso::IsolationCaloCorrectionBitsetHelper::decode(bitset,results);
if(!compareBitsets(vec2,results)) ++nfailures;
for( int k=j+1;k<static_cast<int>(Iso::IsolationCaloCorrection::numIsolationCaloCorrections);++k ){
Iso::IsolationCaloCorrection cork = static_cast<Iso::IsolationCaloCorrection>(k);
std::vector<Iso::IsolationCaloCorrection> vec3 = vec2;
vec3.push_back(cork);
Iso::IsolationCaloCorrectionBitsetHelper::encode(vec3,bitset);
Iso::IsolationCaloCorrectionBitsetHelper::decode(bitset,results);
if(!compareBitsets(vec3,results)) ++nfailures;
}
}
}
return nfailures;
}
unsigned int testTrackBitset() {
unsigned int nfailures = 0;
for( int i=0;i<static_cast<int>(Iso::IsolationTrackCorrection::numIsolationTrackCorrections);++i ){
Iso::IsolationTrackCorrection cori = static_cast<Iso::IsolationTrackCorrection>(i);
std::vector<Iso::IsolationTrackCorrection> vec1 = {cori};
std::vector<Iso::IsolationTrackCorrection> results;
Iso::IsolationTrackCorrectionBitset bitset;
Iso::IsolationTrackCorrectionBitsetHelper::encode(vec1,bitset);
Iso::IsolationTrackCorrectionBitsetHelper::decode(bitset,results);
if(!compareBitsets(vec1,results)) ++nfailures;
for( int j=i+1;j<static_cast<int>(Iso::IsolationTrackCorrection::numIsolationTrackCorrections);++j ){
Iso::IsolationTrackCorrection corj = static_cast<Iso::IsolationTrackCorrection>(j);
std::vector<Iso::IsolationTrackCorrection> vec2 = vec1;
vec2.push_back(corj);
Iso::IsolationTrackCorrectionBitsetHelper::encode(vec2,bitset);
Iso::IsolationTrackCorrectionBitsetHelper::decode(bitset,results);
if(!compareBitsets(vec2,results)) ++nfailures;
for( int k=j+1;k<static_cast<int>(Iso::IsolationTrackCorrection::numIsolationTrackCorrections);++k ){
Iso::IsolationTrackCorrection cork = static_cast<Iso::IsolationTrackCorrection>(k);
std::vector<Iso::IsolationTrackCorrection> vec3 = vec2;
vec3.push_back(cork);
Iso::IsolationTrackCorrectionBitsetHelper::encode(vec3,bitset);
Iso::IsolationTrackCorrectionBitsetHelper::decode(bitset,results);
if(!compareBitsets(vec3,results)) ++nfailures;
}
}
}
return nfailures;
}
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: IsolationType.h 618834 2014-09-27 16:40:39Z christos $
#ifndef XAODPRIMITIVES_ISOLATIONCONESIZE_H
#define XAODPRIMITIVES_ISOLATIONCONESIZE_H
namespace xAOD {
namespace Iso {
/// Enumeration for different cone sizes
///
enum IsolationConeSize {
cone10 = 0,
cone15 = 1,
cone20 = 2,
cone25 = 3,
cone30 = 4,
cone35 = 5,
cone40 = 6,
cone45 = 7,
numIsolationConeSizes=8
};
static inline const char* toString(IsolationConeSize conesize)
{
switch (conesize)
{
case cone10: return "cone10";
case cone15: return "cone15";
case cone20: return "cone20";
case cone25: return "cone25";
case cone30: return "cone30";
case cone35: return "cone35";
case cone40: return "cone40";
case cone45: return "cone45";
case numIsolationConeSizes:
default:
return "Unknown size";
}
}
} // namespace Iso
} // namespace xAOD
#endif // XAODPRIMITIVES_ISOLATIONCONESIZE_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODPRIMITIVES_ISOLATIONCORRECTION_H
#define XAODPRIMITIVES_ISOLATIONCORRECTION_H
#include <bitset>
#include <vector>
namespace xAOD {
namespace Iso {
/// Enumeration for different ways of correcting isolation in xAOD files
///
enum IsolationCaloCorrection {
/// no correction
noneCaloCorrection = 0,
/// core for muons
coreMuon = 1,
/// core 5x7 cells
core57cells = 2,
/// core energy (in dR<0.1).
coreCone = 3,
/// egamma ptcorrection
ptCorrection = 4,
/// fully corrected
pileupCorrection = 5,
/// unknown
numIsolationCaloCorrections=6
}; // enum IsolationCaloCorrection
static inline const char* toString(IsolationCaloCorrection corr)
{
switch (corr)
{
case noneCaloCorrection: return "none";
case coreMuon: return "coreMuon";
case core57cells: return "core57cells";
case coreCone: return "coreCone";
case ptCorrection: return "pt";
case pileupCorrection: return "pileup";
case numIsolationCaloCorrections:
default: return "[Unknown IsolationCaloCorrection]";
}
}
enum IsolationTrackCorrection {
/// no correction
noneTrackCorrection = 0,
/// tracks pointer
coreTrackPtr = 1,
/// tracks in cone
coreTrackCone = 2,
/// pT of the track (needed by trigger)
coreTrackPt = 3,
/// unknown
numIsolationTrackCorrections=4
}; // enum IsolationTrackCorrection
static inline const char* toString(IsolationTrackCorrection corr)
{
switch (corr)