![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
46 #include "Gaudi/Interfaces/IOptionsSvc.h"
81 ATH_MSG_FATAL(
"Input MissingETComponentMap name must be provided.");
82 return StatusCode::FAILURE;
87 ATH_MSG_FATAL(
"Output MissingETContainer name must be provided.");
88 return StatusCode::FAILURE;
92 ATH_MSG_INFO (
"Configured to rebuild following MET Terms:");
129 ATH_MSG_FATAL(
"Error in configuration -- jet input and term keys must both be specified.");
130 return StatusCode::FAILURE;
158 ATH_CHECK( trkSelTool->setProperty(
"maxZ0SinTheta",1.5) );
159 ATH_CHECK( trkSelTool->setProperty(
"maxD0overSigmaD0",3.) );
160 ATH_CHECK( trkSelTool->setProperty(
"CutLevel",
"TightPrimary") );
162 m_trkseltool = ToolHandle<InDet::IInDetTrackSelectionTool>(trkSelTool);
165 std::string toolName =
"IDTrkSel_METUtil";
166 ATH_MSG_INFO(
"METRebuilder: Autoconfiguring " << toolName);
167 m_trkseltool.setTypeAndName(
"InDet::InDetTrackSelectionTool/"+toolName);
168 std::string fullToolName =
"ToolSvc."+toolName;
169 josvc->set(fullToolName +
".maxZ0SinTheta", Gaudi::Utils::toString<float>(1.5));
170 josvc->set(fullToolName +
".maxD0overSigmaD0",Gaudi::Utils::toString<float>(1.5));
171 josvc->set(fullToolName +
".CutLevel",
"TightPrimary");
188 return StatusCode::SUCCESS;
198 return StatusCode::SUCCESS;
203 std::unique_ptr<MissingETContainer> outCont = std::make_unique<xAOD::MissingETContainer>();
204 std::unique_ptr<MissingETAuxContainer> metAuxCont = std::make_unique<xAOD::MissingETAuxContainer>();
212 return StatusCode::SUCCESS;
223 if (!
Gamma.isValid()) {
225 return StatusCode::FAILURE;
238 return StatusCode::FAILURE;
254 return StatusCode::FAILURE;
268 return StatusCode::FAILURE;
273 return StatusCode::SUCCESS;
283 *metterm = *metterm_ref;
285 return StatusCode::SUCCESS;
298 ATH_MSG_WARNING(
"Could not find METComponent for " << metKey <<
" in MET Map!");
299 return StatusCode::FAILURE;
304 return StatusCode::FAILURE;
315 if(component->
empty())
return StatusCode::SUCCESS;
320 bool originalInputs = (testCollection == collection);
321 bool matchCollection =
true;
322 if(!collection->
empty()) {
325 if(!originalInputs) {
328 ATH_MSG_WARNING(
"Modified container provided without originalObjectLink -- cannot proceed.");
329 matchCollection =
false;
332 matchCollection = (sourceCollection == testCollection);
335 if(!matchCollection) {
336 ATH_MSG_WARNING(
"Problem with input object container -- skipping this term.");
337 return StatusCode::SUCCESS;
347 iObj!=collection->
end(); ++iObj ) {
351 if(!originalInputs) pObj = *
objLinkAcc(*pObj);
355 ATH_MSG_VERBOSE(
"Object with pt " << (*iObj)->pt() <<
" has weight " << objWeight.
wet() );
361 met->add((*iObj)->pt()*
cos((*iObj)->phi())*objWeight.
wpx(),
362 (*iObj)->pt()*
sin((*iObj)->phi())*objWeight.
wpy(),
363 (*iObj)->pt()*objWeight.
wet());
366 ATH_MSG_VERBOSE(
"Object with pt " << (*iObj)->pt() <<
" not found." );
375 <<
" mpx: " <<
met->mpx()
376 <<
" mpy: " <<
met->mpy()
379 return StatusCode::SUCCESS;
385 const std::string& softKey,
392 const std::string& softJetScale) {
395 doJvfCut,pureTrkSoft,softJetScale,
dummy);
399 const std::string& softKey,
406 const std::string& softJetScale,
410 ATH_MSG_WARNING(
"Could not find METComponent for " << jetKey <<
" in MET Map!");
411 return StatusCode::FAILURE;
416 return StatusCode::FAILURE;
421 MissingET* metSoft = (*metCont)[softKey];
426 ATH_MSG_WARNING(
"Could not retrieve soft track component -- STVF calculation failed!");
427 return StatusCode::FAILURE;
431 doJvfCut,pureTrkSoft,softJetScale,
442 const std::string& softJetScale,
446 if(component->
empty())
return StatusCode::SUCCESS;
458 return StatusCode::FAILURE;
461 for(
const auto *
const vx : *PV) {
469 return StatusCode::SUCCESS;
477 float trksumpt_allsoft(0.);
480 ATH_MSG_WARNING(
"Could not retrieve soft track component -- STVF calculation failed!");
481 return StatusCode::FAILURE;
488 bool originalInputs = (testCollection == collcast);
489 bool matchCollection =
true;
493 if(!originalInputs) {
496 ATH_MSG_WARNING(
"Modified container provided without originalObjectLink -- cannot proceed.");
497 matchCollection =
false;
500 matchCollection = (sourceCollection == testCollection);
504 if(!matchCollection) {
505 ATH_MSG_WARNING(
"Problem with input object container -- skipping these terms.");
506 return StatusCode::SUCCESS;
512 iJet!=
jets->end(); ++iJet ) {
515 if(!originalInputs) pJet = *
objLinkAcc(*pJet);
524 passJVF = (*iJet)->pt()>50
e3 || fabs((*iJet)->eta())>2.4 || fabs(jvf[
pv->index()])>
m_jetJvfCut;
525 ATH_MSG_VERBOSE(
"Jet with pt " << (*iJet)->pt() <<
" has jvf = " << jvf[
pv->index()]);
530 ATH_MSG_VERBOSE(
"Retain jet with pt " << (*iJet)->pt() <<
" at full scale.");
532 metJet->
add((*iJet)->px()*jetWeight.
wpx(),
533 (*iJet)->py()*jetWeight.
wpy(),
534 (*iJet)->pt()*jetWeight.
wet());
537 double trkjetpx(0), trkjetpy(0), trkjetpt(0);
542 for(
const auto& trk : jettracks) {
544 bool badTrack =
false;
545 if( (fabs((trk)->
eta())<1.5 && (trk)->
pt()>200
e3) ||
546 (fabs((trk)->
eta())>=1.5 && (trk)->
pt()>120
e3) ) {
548 float Rerr =
Amg::error(trk->definingParametersCovMatrix(),4)/fabs(trk->qOverP());
550 if(Rerr>0.4 || trk->pt()>2*(*iJet)->pt()) badTrack =
true;
552 bool uniqueTrack =
true;
554 if(!badTrack && uniqueTrack) {
557 trkjetpx += trk->pt()*
cos(trk->phi());
558 trkjetpy += trk->pt()*
sin(trk->phi());
559 trkjetpt += trk->pt();
563 trksumpt_allsoft += trk->pt();
570 metSoft->
add(trkjetpx,trkjetpy,trkjetpt);
574 ATH_MSG_VERBOSE(
"Soft jet pt = " << jetP.Pt() <<
", track pt = " << trkjetpt);
575 if(trkjetpt>jetP.Pt() || !passJVF) {
577 <<
" at track scale (pt = " << trkjetpt <<
").");
578 metSoft->
add(trkjetpx,trkjetpy,trkjetpt);
581 <<
" at constituent scale (pt = " << jetP.Pt() <<
").");
582 metSoft->
add(jetP.Px()*jetWeight.
wpx(),
583 jetP.Py()*jetWeight.
wpy(),
584 jetP.Pt()*jetWeight.
wet());
596 <<
" mpx: " << metJet->
mpx()
597 <<
" mpy: " << metJet->
mpy()
601 <<
" mpx: " << metSoft->
mpx()
602 <<
" mpy: " << metSoft->
mpy()
607 return StatusCode::SUCCESS;
633 for(
size_t iTrk=0; iTrk<
el->nTrackParticles(); ++iTrk) {
640 for(
size_t iVtx=0; iVtx<ph->
nVertices(); ++iVtx) {
672 for(
const auto& trklink : trackLinks) {
679 if(
mu->inDetTrackParticleLink().isValid()) {
SG::ReadHandleKey< xAOD::VertexContainer > m_PVKey
size_t nVertices() const
Return the number xAOD::Vertex/vertices that match the photon candidate.
Const iterator class for DataVector/DataList.
Electron_v1 Electron
Definition of the current "egamma version".
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Gaudi::Property< std::string > m_gammaTerm
SG::AuxElement::Decorator< char > m_trkUsedDec
Helper class to provide type-safe access to aux data.
float sumet() const
Returns.
Weight weight(const IParticle *pPart) const
Get kinematic weight for a given object.
SG::ReadHandleKey< xAOD::MissingETComponentMap > m_METMapKey
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
double wet() const
Returns .
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Gaudi::Property< double > m_jetJvfCut
static size_t invalidIndex()
Access invalid index indicator.
const ort::objLinkAccessor_t objLinkAcc("overlapObject")
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
Class providing the definition of the 4-vector interface.
static Types::bitmask_t idTrack(Region reg=Region::FullAcceptance)
Bit pattern indicating a ID Track MET term.
@ SoftEvent
Indicator for the MET term from reconstructed soft event signals (tracks, clusters) or MC truth parti...
SG::ReadHandleKey< xAOD::TauJetContainer > m_TauJetContainerKey
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
Gaudi::Property< std::string > m_softJetScale
static const MissingETComponent * getComponent(const MissingETComponentMap *pMap, const IParticle *pPart)
Access non-modifiable contribution object.
virtual StatusCode rebuildJetMET(const std::string &jetKey, const std::string &softKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETComponentMap *metMap, bool doTracks=true) override
Gaudi::Property< std::string > m_muonTerm
Gaudi::Property< bool > m_jetDoJvf
Gaudi::Property< std::string > m_softTerm
Helper class to provide type-safe access to aux data.
::StatusCode StatusCode
StatusCode definition for legacy code.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
Class describing a tau jet.
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Gaudi::Property< std::string > m_jetTerm
SG::ReadHandleKey< xAOD::JetContainer > m_JetContainerKey
const T * front() const
Access the first element in the collection as an rvalue.
Principal data object for Missing ET.
std::vector< ElementLink< xAOD::TrackParticleContainer > > trackParticleLinks(const xAOD::TauJet *tau, xAOD::TauJetParameters::TauTrackFlag flag=xAOD::TauJetParameters::TauTrackFlag::classifiedCharged)
static const MissingET * getMissingET(const MissingETComponentMap *pMap, const IParticle *pPart)
float mpx() const
Returns .
Gaudi::Property< bool > m_trk_doPVsel
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
double wpy() const
Returns .
const std::string & name() const
Identifier getters.
Athena::TPCnvVers::Old Athena::TPCnvVers::Old MissingET
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void add(const IParticle *particle)
Add particle kinematics to MET.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Container for xAOD::MissingET_v1 objects.
virtual StatusCode copyMET(const std::string &metKey, xAOD::MissingETContainer *metCont, const xAOD::MissingETComponentMap *metMap) override
Gaudi::Property< bool > m_doSTVF
Gaudi::Property< std::string > m_eleTerm
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 ...
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
MissingETBase::Types::bitmask_t source() const
MET object source tag.
size_t findIndex(const IParticle *pPart) const
Find index of given object in contributing object store.
double wpx() const
Returns .
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
virtual StatusCode rebuildMET(const std::string &metKey, xAOD::MissingETContainer *metCont, const xAOD::IParticleContainer *collection, const xAOD::MissingETComponentMap *metMap, bool doTracks=true) override
Photon_v1 Photon
Definition of the current "egamma version".
struct TBPatternUnitContext Muon
Gaudi::Property< double > m_jetPtCut
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
bool acceptTrack(const xAOD::TrackParticle *trk, const xAOD::Vertex *pv) const
Class describing a Vertex.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
const MissingET * metObject() const
Access MET object.
#define ATH_MSG_WARNING(x)
Kinematic weight descriptor.
Gaudi::Property< std::string > m_softTermType
@ Tau
The object is a tau (jet)
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
StatusCode fillMET(xAOD::MissingET *&met, xAOD::MissingETContainer *metCont, const std::string &metKey, const MissingETBase::Types::bitmask_t metSource)
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronContainerKey
Class describing a TrackParticle.
virtual StatusCode execute() override
Gaudi::Property< std::string > m_tauTerm
float mpy() const
Returns .
SG::WriteHandleKey< xAOD::MissingETContainer > m_OutMETKey
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
Gaudi::Property< std::string > m_outMETTerm
bool empty() const noexcept
Returns true if the collection is empty.
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkseltool
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
SG::ReadHandleKey< xAOD::PhotonContainer > m_PhotonContainerKey
METRebuilder()
Default constructor:
MET component descriptor contains object links and corresponding parameters.
bool empty() const
Empty list of contributing objects indicator.
void associateTracks(const xAOD::IParticle *obj)
std::vector< const IParticle * > objects() const
Access contributing objects.