ATLAS Offline Software
Loading...
Searching...
No Matches
IsolationCorrectionHelper.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef XAODPRIMITIVES_ISOLATIONCORRECTIONHELPER_H
8#define XAODPRIMITIVES_ISOLATIONCORRECTIONHELPER_H
9
10#include <bitset>
11#include <vector>
12
13namespace xAOD {
14
15 namespace Iso {
16
19 public:
21 static void decode( const IsolationCaloCorrectionBitset& bitset, std::vector<IsolationCaloCorrection>& results ) {
22 results.clear();
23 for( int i=0;i<static_cast<int>(IsolationCaloCorrection::numIsolationCaloCorrections);++i ){
24 if( bitset.test(i) ) results.push_back( static_cast<IsolationCaloCorrection>(i) );
25 }
26 }
27
29 static void encode( const std::vector<IsolationCaloCorrection>& values, IsolationCaloCorrectionBitset& bitset ) {
30 bitset.reset();
31 for( auto value : values ){
32 bitset.set(static_cast<int>(value));
33 }
34 }
35 };
36
37
38
39
42 public:
44 static void decode( const IsolationTrackCorrectionBitset& bitset, std::vector<IsolationTrackCorrection>& results ) {
45 results.clear();
46 for( int i=0;i<static_cast<int>(IsolationTrackCorrection::numIsolationTrackCorrections);++i ){
47 if( bitset.test(i) ) results.push_back( static_cast<IsolationTrackCorrection>(i) );
48 }
49 }
50
52 static void encode( const std::vector<IsolationTrackCorrection>& values, IsolationTrackCorrectionBitset& bitset ) {
53 bitset.reset();
54 for( auto value : values ){
55 bitset.set(static_cast<int>(value));
56 }
57 }
58 };
59
60 }
61}
62
63#endif
helper to encode and decode the isolation corrections
static void decode(const IsolationCaloCorrectionBitset &bitset, std::vector< IsolationCaloCorrection > &results)
decode the bitset into the individual corrections
static void encode(const std::vector< IsolationCaloCorrection > &values, IsolationCaloCorrectionBitset &bitset)
encode the bitset given a vector of corrections
helper to encode and decode the isolation corrections
static void decode(const IsolationTrackCorrectionBitset &bitset, std::vector< IsolationTrackCorrection > &results)
decode the bitset into the individual corrections
static void encode(const std::vector< IsolationTrackCorrection > &values, IsolationTrackCorrectionBitset &bitset)
encode the bitset given a vector of corrections
Namespace holding the IsolationType enumeration.
std::bitset< 32 > IsolationCaloCorrectionBitset
typedef of the bit word used to encode the corrections used to calculate the isolation
IsolationCaloCorrection
Enumeration for different ways of correcting isolation in xAOD files.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
static AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(EmTauRoI_v1, uint32_t, roiWord, setRoIWord) uint32_t EmTauRoI_v1 const SG::AuxElement::Accessor< std::vector< float > > values("thrValues")
This is a convenience function for accessing the threshold pattern part of the RoI.