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;
123 copy = shallowcopy.first.get();
124 copyaux = shallowcopy.second.get();
126 for(
auto par: *copy){
132 (*acc)(*par) = value;
137 acc2(*par) = corrMask.to_ulong();
142 ATH_CHECK(
evtStore()->record(std::move(shallowcopy.first),
"IsoFixed_"+muonkey),
false );
143 ATH_CHECK(
evtStore()->record(std::move(shallowcopy.second),
"IsoFixed_"+muonkey+
"Aux."),
false );
152 if(
acc.isAvailable(par)) corrMask =
acc(par);
156 areacore = 5*0.025*7*
M_PI/128;
168 bool isCentral = fabs(par.eta())<1.5;
169 std::string esName = isCentral ?
"TopoClusterIsoCentralEventShape" :
"TopoClusterIsoForwardEventShape";
171 esName = isCentral ?
"ParticleFlowIsoCentralEventShape" :
"ParticleFlowIsoForwardEventShape";
176 if (
evtStore()->retrieve(edShape,esName).isFailure()) {
177 ATH_MSG_ERROR(
"Cannot retrieve density container " + esName +
" for isolation correction. No ED correction");
184 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
typename ShallowCopyResult< T >::type ShallowCopyResult_t
Return type of xAOD::shallowCopy.
const SG::AuxElement::Accessor< uint32_t > getIsolationCorrectionBitsetAccessor(Iso::IsolationFlavour type)
Returns an accessor for the correction bitset corresponding to this IsolationType.
const SG::AuxElement::Accessor< float > getIsolationCorrectionAccessor(Iso::IsolationFlavour type, Iso::IsolationCaloCorrection corr, Iso::IsolationCorrectionParameter param)
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.
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.
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.