 |
ATLAS Offline Software
|
Go to the documentation of this file.
41 #include "GaudiKernel/SystemOfUnits.h"
62 m_trkseltool(this,
""),
63 m_trkIsolationTool(this,
""),
64 m_caloIsolationTool(this,
"")
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");
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);
320 std::sort(hardObjs_tmp.begin(),hardObjs_tmp.end(),
greaterPt);
322 for(
const auto&
obj : hardObjs_tmp) {
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.;
337 dec_UEcorr(*
obj) = UEcorr_Pt;
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 ));
398 std::vector<Iso::IsolationType> trkIsoCones;
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");
435 if(Rerr>0.4)
return false;
436 else if (
EoverP<0.65 && ((
EoverP>0.1 && Rerr>0.05) || Rerr>0.1))
return false;
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 = 0;
457 if( !v_clus.empty() ){
462 bool isNextToPart(
true);
463 bool isNextToHR(
true);
466 int numOfRndTrials = 0;
467 const int maxNumOfRndTrials = 100;
469 while(isNextToPart || isNextToHR ){
470 isNextToPart =
false;
475 if(dR > MinDistCone){
479 for(
const auto& clus_j : v_clus) {
481 if(dR < MinDistCone){
488 if(numOfRndTrials == maxNumOfRndTrials){
490 return StatusCode::SUCCESS;
498 TLorentzVector tv_UEcorr;
499 std::pair <double, double> eta_rndphi = std::make_pair(clus.Eta(), phiRnd);
505 for(
const auto fe_itr : *constits.feCont){
506 if(fe_itr->pt() < 0 || fe_itr->e() < 0){
512 if(fe_itr->isCharged() && !PVMatchedAcc(*fe_itr)){
516 double dR =
P4Helpers::deltaR( fe_itr->eta(), fe_itr->phi(), eta_rndphi.first, eta_rndphi.second );
519 TLorentzVector tv_fe = fe_itr->p4();
520 tv_fe.RotateZ(dphi_angle);
525 UEcorr = tv_UEcorr.Pt();
527 return StatusCode::SUCCESS;
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ coreEnergy
energy stored for this correction
const_pointer_type cptr()
Dereference the pointer.
DataVector adapter that acts like it holds const pointers.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
@ coreTrackPtr
tracks pointer
Iso::IsolationTrackCorrectionBitset trackbitset
@ ptcone20
Track isolation.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
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.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
@ etcone20
Calorimeter isolation.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::map< Iso::IsolationCaloCorrection, std::map< Iso::IsolationCorrectionParameter, float > > coreCorrections
float z() const
Returns the z position.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
double deltaR(const I4Momentum &p4, double eta, double phi)
from 1 I4Momentum
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Container for xAOD::MissingET_v1 objects.
float qOverP() const
Returns the parameter.
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
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 ...
std::vector< float > etcones
@ coreCone
core energy (in dR<0.1).
std::vector< float > ptcones
struct TBPatternUnitContext Muon
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
Class describing a TrackParticle.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
size_type size() const noexcept
Returns the number of elements in the collection.
Iso::IsolationCaloCorrectionBitset calobitset