|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "GaudiKernel/SystemOfUnits.h"
49 return StatusCode::SUCCESS;
54 ATH_CHECK(keepEventHandle.record(std::make_unique<int>(0)));
55 int& keepEvent = *keepEventHandle;
59 if (!muons.isValid()) {
61 return StatusCode::FAILURE;
63 MuonPassDecor muo_decor{makeHandle<bool>(ctx,
m_muonKeepKey)};
64 ATH_MSG_VERBOSE(
"Event "<<ctx.eventID().event_number()<<
" - Retrieved muon Container from "<<
m_muonSGKey.fullKey()<<
" which contains "
65 <<muons->size()<<
" muons. Created "<<muo_decor.decorKey()
70 std::vector<const xAOD::TruthParticle*> truth{};
74 if (!handle.isValid()) {
76 return StatusCode::FAILURE;
78 truth.reserve(handle->size());
79 std::copy_if(handle->begin(), handle->end(), std::back_inserter(truth),
81 return MC::isStable(tpart) &&
82 !HepMC::is_simulation_particle(tpart) &&
88 if(std::find_if(truth.begin(), truth.end(),
90 return xAOD::P4Helpers::deltaR2(truth_itr, mu_itr1) < m_thinningConeSize2;
92 muo_decor(*mu_itr1) =
true;
96 <<
", phi: "<<mu_itr1->phi()<<
", author: "<<mu_itr1->author());
104 if (mu_itr2 == mu_itr1)
continue;
106 <<
", phi: "<<mu_itr2->phi()<<
", author: "<<mu_itr2->author());
112 if (!passDiLepTrig) {
116 muo_decor(*mu_itr1) =
true;
117 muo_decor(*mu_itr2) =
true;
123 return StatusCode::SUCCESS;
127 if (!tracks.isValid()) {
129 return StatusCode::FAILURE;
131 ATH_MSG_VERBOSE(
"Event "<<ctx.eventID().event_number()<<
" - Retrieved track Container from "<<
m_trackSGKey.fullKey()<<
" which contains "
132 <<tracks->size()<<
" tracks.");
145 if (probe_trk == mu_itr1->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle))
continue;
148 trk_decor(*probe_trk) =
true;
164 return StatusCode::SUCCESS;
173 <<
", phi: "<<
mu->phi()<<
", needs to be more energetic than "<<
ptMin *
MeVtoGeV<<
" [GeV] and within "<<absEtaMax);
174 return !(!
mu ||
mu->pt() <
ptMin || std::abs(
mu->eta()) > absEtaMax);
180 return trigList.empty() || std::find_if(trigList.begin(), trigList.end(), [&](
const std::string& trig_item){
181 return m_matchingTool->match(*muon, trig_item, m_triggerMatchDeltaR);
182 }) != trigList.end();
193 const float mass2 = (mu1->
p4() + mu2->p4()).M2();
Gaudi::Property< bool > m_applyQualityMu1
Flag to toggle whether selection working point should be applied on the first muon.
Gaudi::Property< float > m_dPhiMin
Require a minimal delta Phi between the two selected candidates.
ToolHandle< CP::IMuonSelectionTool > m_muonSelTool
Selection tool to filter muons with poor quality.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_trkKeepKey
Gaudi::Property< bool > m_requireOS
Both particles have to be of opposite charge.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
bool passMuonCuts(const xAOD::Muon *muon, const float ptMin, const float absEtaMax, const bool applyQuality) const
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Gaudi::Property< float > m_thinningConeSize
Gaudi::Property< bool > m_applyQualityMu2
Flag to toggle whether the selection working point should be applied on the second muon.
float m_thinningConeSize2
Gaudi::Property< std::string > m_br_prefix
Name of the ouput selection flag.
Gaudi::Property< float > m_mu1PtMin
Pt cut on the primary muon in the event.
Gaudi::Property< bool > m_applyTrig
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthSGKey
Gaudi::Property< float > m_mu2PtMin
Pt cut on the second muon in the event.
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< bool > m_isMC
Flag whether it's MC.
Gaudi::Property< float > m_invariantMassHigh
Upper invariant mass selection window (Negative number refers to disable)
double deltaR2(double rapidity1, double phi1, double rapidity2, double phi2)
from bare rapidity,phi
bool empty() const
Test if the key is blank.
Class providing the definition of the 4-vector interface.
bool passKinematicCuts(const xAOD::IParticle *mu, const float ptMin, const float absEtaMax) const
Returns true of the pointer is valid and also whether the pt and absEta are above and below the thres...
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Property< float > m_invariantMassLow
Lower invariant mass selection window.
Gaudi::Property< float > m_mu2AbsEtaMax
Eta cut on the second muon in the event.
Gaudi::Property< std::vector< std::string > > m_orTrigs
List of triggers in which at least one muon in the pair needs to pass.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
float m_invariantMassHigh2
Handle class for adding a decoration to an object.
virtual StatusCode execute(const EventContext &ctx) const override
bool muonPairCheck(const xAOD::Muon *mu1, const probe_type *mu2) const
float m_invariantMassLow2
Out copy_if(In first, const In &last, Out res, const Pred &p)
SG::WriteHandleKey< int > m_skimmingKey
Event Decision Key.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< float > m_mu1AbsEtaMax
Eta cut on the primary muon in the event.
SG::ReadHandleKey< xAOD::MuonContainer > m_muonSGKey
StatusCode initialize() override
ToolHandle< Trig::IMatchingTool > m_matchingTool
Helpers for checking error return status codes and reporting errors.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackSGKey
Gaudi::Property< bool > m_useTrackProbe
Run the analysis with a Muon <--> Track pair — Muon has to hold criteria 1 and track to satisfy kinem...
void maskNearbyIDtracks(const xAOD::IParticle *mu, TrackPassDecor &decor) const
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonKeepKey
Keys to whitelist the muons & tracks needed for MCP studies to output.
DiMuonTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
bool passTrigger(const xAOD::Muon *muon, const std::vector< std::string > &trigList) const
Class describing a TrackParticle.
Gaudi::Property< std::vector< std::string > > m_andTrigs
List of trigger in which both muons need to pass the selection.