41#include "GaudiKernel/SystemOfUnits.h"
105 ATH_MSG_ERROR(
"Configured to use modified topocluster collection but \"CaloCalTopoClusters\" collection specified!");
106 return StatusCode::FAILURE;
108 ATH_MSG_INFO(
"Configured to use standard topocluster collection.");
114 ATH_MSG_ERROR(
"Configured to use topocluster collection \"" <<
m_clcollKey.key() <<
"\", but modified clusters flag not set!");
115 return StatusCode::FAILURE;
130 if(
m_pfcollKey.key() ==
"JetETMissParticleFlowObjects") {
132 ATH_MSG_ERROR(
"This is no longer supported -- please use the CHSParticleFlowObjects collection, which has the four-vector corrections built in.");
133 return StatusCode::FAILURE;
140 std::string hybridname =
"Etmiss";
147 return StatusCode::SUCCESS;
154 ATH_MSG_WARNING(
"Invalid pointer to MissingETContainer supplied! Abort.");
155 return StatusCode::FAILURE;
159 ATH_MSG_WARNING(
"Invalid pointer to MissingETAssociationMap supplied! Abort.");
160 return StatusCode::FAILURE;
163 ATH_MSG_WARNING(
"Attempting to build PFlow MET without a track collection.");
164 return StatusCode::FAILURE;
176 if (!topoclusterCont.
isValid()) {
178 return StatusCode::FAILURE;
181 ATH_MSG_DEBUG(
"Successfully retrieved topocluster collection");
183 std::string hybridname =
"Etmiss";
192 ATH_MSG_WARNING(
"Trying to do something currently unsupported- lets abort");
193 return StatusCode::FAILURE;
247 return StatusCode::FAILURE;
250 ATH_MSG_DEBUG(
"Successfully retrieved primary vertex container");
251 ATH_MSG_DEBUG(
"Container holds " << vxCont->size() <<
" vertices");
253 for(
const auto *
const vx : *vxCont) {
256 {constits.
pv = vx;
break;}
259 ATH_MSG_DEBUG(
"Failed to find primary vertex! Reject all tracks.");
269 return StatusCode::FAILURE;
276 constits.
feCont =
nullptr;
280 return StatusCode::FAILURE;
290 return StatusCode::FAILURE;
297 return StatusCode::SUCCESS;
311 return StatusCode::FAILURE;
314 std::vector<const IParticle*> constlist;
315 constlist.reserve(20);
316 std::vector<const IParticle*> hardObjs_tmp;
317 for(
const auto *
const obj : *hardObjs) {
318 hardObjs_tmp.push_back(obj);
322 for(
const auto& obj : hardObjs_tmp) {
325 ATH_MSG_VERBOSE(
"Object type, pt, eta, phi = " << obj->type() <<
", " << obj->pt() <<
", " << obj->eta() <<
"," << obj->phi() );
329 ATH_MSG_ERROR(
"Attempting to build FlowElement MET without a track collection.");
330 return StatusCode::FAILURE;
332 std::map<const IParticle*, MissingETBase::Types::constvec_t> momentumOverride;
334 float UEcorr_Pt = 0.;
347 ATH_MSG_DEBUG(
"Attempting to build PFlow without a track collection.");
348 return StatusCode::FAILURE;
350 std::map<const IParticle*,MissingETBase::Types::constvec_t> momentumOverride;
356 std::vector<const IParticle*> tclist;
360 for(
const auto& cl : tclist) {
362 constlist.push_back((*constits.
tcCont)[cl->index()]);
371 return StatusCode::SUCCESS;
379 if (!vx)
return false;
380 return static_cast<bool> (
m_trkseltool->accept( *trk, vx ));
395 float ptcone20 = 0., isolfrac = 0., etcone10 = 0., EoverP = 0.;
398 std::vector<Iso::IsolationType> trkIsoCones;
406 ptcone20 = !trkIsoResult.
ptcones.empty() ? trkIsoResult.
ptcones[0] : 0;
407 isolfrac = ptcone20/trk->
pt();
410 std::vector<Iso::IsolationType> caloIsoCones;
420 caloIsoCorr_coreCone);
421 if(!caloIsoResult.
etcones.empty()) {
425 ATH_MSG_WARNING(
"isGoodEoverP: Failed to retrieve the isolation core correction (etcone10)! Setting etcone10=0");
428 EoverP = etcone10/trk->
pt();
435 if(Rerr>0.4)
return false;
436 else if (EoverP<0.65 && ((EoverP>0.1 && Rerr>0.05) || Rerr>0.1))
return false;
439 float trkptsum = ptcone20+trk->
pt();
440 if(etcone10/trkptsum<0.6 && trk->
pt()/trkptsum>0.6)
return false;
447 std::vector<TLorentzVector>& v_clus,
448 TLorentzVector& clus,
451 const float MinDistCone,
455 unsigned int seed = floor( clus.Pt() * Gaudi::Units::GeV );
459 bool isNextToPart(
true);
460 bool isNextToHR(
true);
463 int numOfRndTrials = 0;
464 const int maxNumOfRndTrials = 100;
466 while(isNextToPart || isNextToHR ){
467 isNextToPart =
false;
470 phiRnd = hole.Uniform( -std::numbers::pi, std::numbers::pi);
472 if(dR > MinDistCone){
476 for(
const auto& clus_j : v_clus) {
478 if(dR < MinDistCone){
485 if(numOfRndTrials == maxNumOfRndTrials){
487 return StatusCode::SUCCESS;
495 TLorentzVector tv_UEcorr;
496 std::pair <double, double> eta_rndphi = std::make_pair(clus.Eta(), phiRnd);
502 for(
const auto fe_itr : *constits.feCont){
503 if(fe_itr->pt() < 0 || fe_itr->e() < 0){
513 double dR =
P4Helpers::deltaR( fe_itr->eta(), fe_itr->phi(), eta_rndphi.first, eta_rndphi.second );
516 TLorentzVector tv_fe = fe_itr->p4();
517 tv_fe.RotateZ(dphi_angle);
522 UEcorr = tv_UEcorr.Pt();
524 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
DataVector adapter that acts like it holds const pointers.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Helper class to provide constant type-safe access to aux data.
Helper class to provide type-safe access to aux data.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
float qOverP() const
Returns the parameter.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float z() const
Returns the z position.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
static const SG::Decorator< float > dec_UEcorr("UEcorr_Pt")
static const SG::ConstAccessor< char > PVMatchedAcc("matchedToPV")
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
@ Muon
The object is a muon.
@ etcone20
Calorimeter isolation.
@ ptcone20
Track isolation.
@ coreTrackPtr
tracks pointer
@ coreEnergy
energy stored for this correction
@ coreCone
core energy (in dR<0.1).
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
setRcore setEtHad setFside pt
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
MissingETContainer_v1 MissingETContainer
MissingETAssociationMap_v1 MissingETAssociationMap
Version control by type defintion.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
static bool insert(MissingETComponentMap *pMap, const MissingET *pMET, const IParticle *pPart, MissingETBase::Types::weight_t weight=MissingETBase::Types::weight_t())
Insert contributing signal or physics object by pointer, with optional kinematic weight object.
Iso::IsolationCaloCorrectionBitset calobitset
std::vector< float > etcones
std::map< Iso::IsolationCaloCorrection, std::map< Iso::IsolationCorrectionParameter, float > > coreCorrections
Iso::IsolationTrackCorrectionBitset trackbitset
std::vector< float > ptcones