5#include "GaudiKernel/SystemOfUnits.h"
29 return StatusCode::FAILURE;
37 ATH_MSG_ERROR(
"Trying to configure hypo with no pT bins. This is probably a configuration mistake.");
38 return StatusCode::FAILURE;
41 for(
size_t j=0; j<
m_ptBins.size(); j++){
45 return StatusCode::FAILURE;
48 for (std::vector<float>::size_type i=0; i<
m_bins[j];++i) {
60 return StatusCode::SUCCESS;
70 ATH_MSG_DEBUG(
"Accept property is set: taking all the events");
79 if(! muon->primaryTrackParticle())
return false;
81 const xAOD::TrackParticle* tr = muon->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
88 std::vector<float> fexPt, fexEta, fexPhi, selPt, selEta, selPhi;
95 auto monitorIt =
Monitored::Group(
m_monTool, muonPtMon, muonEtaMon, muonPhiMon, muonPtSelMon, muonEtaSelMon, muonPhiSelMon);
100 ATH_MSG_VERBOSE(
"Retrieved track with abs pt "<< (*tr).pt()/Gaudi::Units::GeV <<
" GeV ");
101 fexPt.push_back(tr->
pt()/Gaudi::Units::GeV);
102 fexEta.push_back(tr->
eta());
103 fexPhi.push_back(tr->
phi());
106 float absEta = std::abs(tr->
eta());
108 for (std::vector<float>::size_type k=0; k<
m_bins[0]; ++k) {
111 if ( (std::abs(tr->
pt())/Gaudi::Units::GeV > (
threshold/Gaudi::Units::GeV)) &&
114 selPt.push_back(tr->
pt()/Gaudi::Units::GeV);
115 selEta.push_back(tr->
eta());
116 selPhi.push_back(tr->
phi());
120 <<
" with Charge " << tr->
charge()
121 <<
" and threshold cut is " <<
threshold/Gaudi::Units::GeV <<
" GeV"
122 <<
" so hypothesis is " << (
result?
"true":
"false"));
133 bool passCut =
false;
135 const xAOD::TrackParticle* metrack = muon->trackParticle( xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle );
136 float reducedChi2 = -10;
139 reducedChi2 = muon->primaryTrackParticle()->chiSquared()/muon->primaryTrackParticle()->numberDoF();
141 if(std::abs(reducedChi2) < 8.0 && !
m_muonSelTool->isBadMuon(*muon) && muon->author()==xAOD::Muon::MuidSA) passCut =
true;
152 size_t numTrigger =
m_ptBins.size();
153 size_t numMuon=toolInput.size();
162 return StatusCode::SUCCESS;
170 for(
auto& tool : toolInput) {
180 return StatusCode::SUCCESS;
189 for(
size_t cutIndex=0; cutIndex <
m_ptBins.size(); ++cutIndex) {
190 size_t elementIndex{0};
191 for(
auto& tool : toolInput) {
195 passingSelection[cutIndex].push_back(elementIndex);
205 if(passingSelection[cutIndex].
empty()){
206 ATH_MSG_DEBUG(
"No muons passed the selection "<<cutIndex<<
" rejecting...");
207 return StatusCode::SUCCESS;
210 std::set<size_t> passingIndices;
213 if(passingIndices.empty()) {
215 return StatusCode::SUCCESS;
217 for(
auto i : passingIndices) {
223 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Header file to be included by clients of the Monitored infrastructure.
static const Attributes_t empty
bool msgLvl(const MSG::Level lvl) const
Group of local monitoring quantities and retain correlation when filling histograms
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float charge() const
Returns the charge.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
void elementsInUniqueCombinations(const Index2DVec &indices, std::set< size_t > &participants, const std::function< bool(const Index1DVec &)> &filter)
std::vector< Index1DVec > Index2DVec
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version: