21 declareInterface<IIsolationHelper>(
this);
29 return StatusCode::SUCCESS;
33 return StatusCode::SUCCESS;
50 if(
acc.isAvailable(par)) {
64 if(
acc.isAvailable(par)) {
75 std::vector<xAOD::Iso::IsolationCaloCorrection> results;
103 if(origMask == corrMask) {
111 value = origValue+origCorr-newCorr;
121 copy = shallowcopy.first;
122 copyaux = shallowcopy.second;
124 for(
auto par: *copy){
130 (*acc)(*par) = value;
135 acc2(*par) = corrMask.to_ulong();
141 ATH_CHECK(
evtStore()->record(shallowcopy.second,
"IsoFixed_"+muonkey+
"Aux."),
false );
150 if(
acc.isAvailable(par)) corrMask =
acc(par);
154 areacore = 5*0.025*7*
M_PI/128;
166 bool isCentral = fabs(par.eta())<1.5;
167 std::string esName = isCentral ?
"TopoClusterIsoCentralEventShape" :
"TopoClusterIsoForwardEventShape";
169 esName = isCentral ?
"ParticleFlowIsoCentralEventShape" :
"ParticleFlowIsoForwardEventShape";
174 if (
evtStore()->retrieve(edShape,esName).isFailure()) {
175 ATH_MSG_ERROR(
"Cannot retrieve density container " + esName +
" for isolation correction. No ED correction");
182 ATH_MSG_ERROR(
"Cannot retrieve density " + esName +
" for isolation correction. No ED correction");
#define ATH_CHECK
Evaluate an expression and check for errors.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
virtual StatusCode initialize()
initialize
IsolationHelper(const std::string &name)
Create a constructor for Athena.
virtual StatusCode finalize()
finalize
bool correction(float &value, const xAOD::IParticle &par, xAOD::Iso::IsolationType type, const xAOD::Iso::IsolationCaloCorrectionBitset &corrMask) const
bool getPileupCorrection(float &value, const xAOD::IParticle &par, xAOD::Iso::IsolationType type, xAOD::Iso::IsolationCaloCorrectionBitset corrMask) const
bool correctionBitset(xAOD::Iso::IsolationCaloCorrectionBitset &mask, const xAOD::IParticle &par, xAOD::Iso::IsolationType type) const
bool isolation(float &value, const xAOD::IParticle &par, xAOD::Iso::IsolationType type) const
bool updateIsolation(xAOD::MuonContainer *©, xAOD::ShallowAuxContainer *©aux, std::vector< xAOD::Iso::IsolationType > &types, xAOD::Iso::IsolationCaloCorrectionBitset corrMask, std::string muonkey, bool recordSG) const
bool getDensity(EventDensityID id, double &v) const
Get a density variable from the object.
Class providing the definition of the 4-vector interface.
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
Class creating a shallow copy of an existing auxiliary container.
Select isolated Photons, Electrons and Muons.
std::bitset< 32 > IsolationCaloCorrectionBitset
typedef of the bit word used to encode the corrections used to calculate the isolation
IsolationFlavour isolationFlavour(IsolationType type)
convert Isolation Type into Isolation Flavour
IsolationType
Overall enumeration for isolation types in xAOD files.
IsolationFlavour
Enumeration for different ways of calculating isolation in xAOD files.
@ neflowisol
neutral eflow
@ coreArea
area used to calculate this correction
@ coreEnergy
energy stored for this correction
IsolationCaloCorrection
Enumeration for different ways of correcting isolation in xAOD files.
@ ptCorrection
egamma ptcorrection
@ pileupCorrection
fully corrected
@ coreCone
core energy (in dR<0.1).
@ core57cells
core 5x7 cells
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
const SG::AuxElement::Accessor< uint32_t > getIsolationCorrectionBitsetAccessor(Iso::IsolationFlavour type)
Returns an accessor for the correction bitset corresponding to this IsolationType.
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, const EventContext &ctx)
Function making a shallow copy of a constant container.
const SG::AuxElement::Accessor< float > getIsolationCorrectionAccessor(Iso::IsolationFlavour type, Iso::IsolationCaloCorrection corr, Iso::IsolationCorrectionParameter param)
static const EventInfo_v1::Accessor< std::vector< std::string > > types("streamTagTypes")
const SG::AuxElement::Accessor< float > * getIsolationAccessor(Iso::IsolationType type)
Get the Accessor object for a given isolation type.
EventShape_v1 EventShape
Definition of the current event format version.
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".