36 ATH_MSG_ERROR(
"Failed to get TrackPositionProvider for cluster preselection!");
37 return StatusCode::FAILURE;
51 return StatusCode::SUCCESS;
56 const EventContext& ctx,
60 if (!data.caloObjects) {
61 ATH_MSG_ERROR(
"PFData::caloObjects is null; caller must set it before invoking the truth subtraction tool");
62 return StatusCode::FAILURE;
66 return StatusCode::SUCCESS;
78 const double gaussianRadius = 0.032;
79 const double gaussianRadiusError = 1.0e-3;
80 const double maximumRadiusSigma = 3.0;
88 for (
unsigned int iCalo = nCaloObj; iCalo < data.caloObjects->size(); ++iCalo) {
95 unsigned int nEFCaloObs = data.caloObjects->size();
97 for (
unsigned int iCalo = 0; iCalo < nEFCaloObs; ++iCalo) {
106 for (
unsigned iTrack = 0; iTrack < thisEflowCaloObject.
nTracks(); ++iTrack){
111 if (!thisEfRecTrack->
hasBin())
continue;
119 std::vector<eflowTrackClusterLink *> links = thisEfRecTrack->
getClusterMatches();
121 for (
auto thisLink : links){
135 for (; theCell != lastCell;){
139 double oldCellEnergy = theCell->
energy()*(theCell.
weight());
140 double subtractedCellWeight = (oldCellEnergy - truthEnergy)/oldCellEnergy;
144 lastCell = theCellLinks->
end();
147 theCell.
reweight(subtractedCellWeight);
154 float oldEnergy = thisCluster->
e();
156 if (0.0 != oldEnergy) {
157 float energyAdjustment = thisCluster->
e() / oldEnergy;
158 thisCluster->
setRawE(thisCluster->
rawE() * energyAdjustment);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Handle class for reading a decoration on an object.
double energy() const
get energy (data member)
void reweight(const weight_t newWeight)
Update the weight.
weight_t weight() const
Accessor for weight associated to this cell.
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
const_iterator end() const
const end method
const_iterator begin() const
const begin method
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
static std::unique_ptr< IPositionProvider > Get(const std::string &positionType)
An internal EDM object which stores information about systems of associated tracks and calorimeter cl...
void simulateShower(const EventContext &ctx, eflowLayerIntegrator *integrator, const eflowEEtaBinnedParameters *binnedParameters, const PFEnergyPredictorTool *energyP, bool useLegacyEnergyBinIndexing)
const eflowRecTrack * efRecTrack(int i) const
This class calculates the LHED (Layer of Highest Energy Density) in a cluster or group of clusters.
This class extends the information about a xAOD::Track.
const std::vector< eflowTrackClusterLink * > & getClusterMatches() const
double getCellTruthEnergy(const CaloCell *cell) const
bool isInDenseEnvironment() const
void setRawEta(flt_t)
Set for signal state UNCALIBRATED.
void setRawPhi(flt_t)
Set for signal state UNCALIBRATED.
void setRawE(flt_t)
Set Energy for signal state UNCALIBRATED.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
CaloClusterCellLink * getOwnCellLinks()
Get a pointer to the owned CaloClusterCellLink object (non-const version).
bool removeCell(const CaloCell *ptr)
Method to remove a cell to the cluster (slow!) (Beware: Kinematics not updated!).
static std::string release
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.