00001
00002 #ifndef XAODPRIMITIVES_ISOLATIONCORRECTIONHELPER_H
00003 #define XAODPRIMITIVES_ISOLATIONCORRECTIONHELPER_H
00004
00005 #include <bitset>
00006 #include <vector>
00007
00008 namespace xAOD {
00009
00010 namespace Iso {
00011
00013 class IsolationCaloCorrectionBitsetHelper {
00014 public:
00016 static void decode( const IsolationCaloCorrectionBitset& bitset, std::vector<IsolationCaloCorrection>& results ) {
00017 results.clear();
00018 for( int i=0;i<static_cast<int>(IsolationCaloCorrection::numIsolationCaloCorrections);++i ){
00019 if( bitset.test(i) ) results.push_back( static_cast<IsolationCaloCorrection>(i) );
00020 }
00021 }
00022
00024 static void encode( const std::vector<IsolationCaloCorrection>& values, IsolationCaloCorrectionBitset& bitset ) {
00025 bitset.reset();
00026 for( auto value : values ){
00027 bitset.set(static_cast<int>(value));
00028 }
00029 }
00030 };
00031
00032
00033
00034
00036 class IsolationTrackCorrectionBitsetHelper {
00037 public:
00039 static void decode( const IsolationTrackCorrectionBitset& bitset, std::vector<IsolationTrackCorrection>& results ) {
00040 results.clear();
00041 for( int i=0;i<static_cast<int>(IsolationTrackCorrection::numIsolationTrackCorrections);++i ){
00042 if( bitset.test(i) ) results.push_back( static_cast<IsolationTrackCorrection>(i) );
00043 }
00044 }
00045
00047 static void encode( const std::vector<IsolationTrackCorrection>& values, IsolationTrackCorrectionBitset& bitset ) {
00048 bitset.reset();
00049 for( auto value : values ){
00050 bitset.set(static_cast<int>(value));
00051 }
00052 }
00053 };
00054
00055 }
00056 }
00057
00058 #endif