22 declareInterface<IIsolationHelper>(
this);
30 return StatusCode::SUCCESS;
34 return StatusCode::SUCCESS;
51 if(
acc.isAvailable(par)) {
65 if(
acc.isAvailable(par)) {
76 std::vector<xAOD::Iso::IsolationCaloCorrection> results;
104 if(origMask == corrMask) {
112 value = origValue+origCorr-newCorr;
121 std::pair<std::unique_ptr<xAOD::MuonContainer>,
122 std::unique_ptr<xAOD::ShallowAuxContainer> > shallowcopy =
124 copy = shallowcopy.first.get();
125 copyaux = shallowcopy.second.get();
127 for(
auto par: *copy){
133 (*acc)(*par) = value;
138 acc2(*par) = corrMask.to_ulong();
143 ATH_CHECK(
evtStore()->record(std::move(shallowcopy.first),
"IsoFixed_"+muonkey),
false );
144 ATH_CHECK(
evtStore()->record(std::move(shallowcopy.second),
"IsoFixed_"+muonkey+
"Aux."),
false );
153 if(
acc.isAvailable(par)) corrMask =
acc(par);
157 areacore = 5*0.025*7*
M_PI/128;
169 bool isCentral = fabs(par.eta())<1.5;
170 std::string esName = isCentral ?
"TopoClusterIsoCentralEventShape" :
"TopoClusterIsoForwardEventShape";
172 esName = isCentral ?
"ParticleFlowIsoCentralEventShape" :
"ParticleFlowIsoForwardEventShape";
177 if (
evtStore()->retrieve(edShape,esName).isFailure()) {
178 ATH_MSG_ERROR(
"Cannot retrieve density container " + esName +
" for isolation correction. No ED correction");
185 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".