11L2muCombMon :: L2muCombMon(
const std::string& name, ISvcLocator* pSvcLocator )
16StatusCode L2muCombMon :: initialize(){
23StatusCode L2muCombMon :: fillVariablesPerChain(
const EventContext &ctx,
const std::string &chain)
const {
31 const std::string featureStr{
"feature"};
39 if(saLinkInfo.size()>1){
52 cbPt = (*muEL)->pt()/1e3 * (*muEL)->charge();
53 cbEta = (*muEL)->eta();
54 cbPhi = (*muEL)->phi();
61 saEta = (*saEL)->eta();
62 saPhi = (*saEL)->phi();
67 float SATrackPt = -999.;
68 if( (*muEL)->muSATrackLink().isValid() ) {
69 SATrack = (*muEL)->muSATrack();
70 SATrackPt = SATrack->
pt();
79 bool off_cb_match =
false;
80 bool off_sa_match =
false;
88 if( RecMuonCBmatchL2SA && L2SA_success) off_sa_match =
true;
89 if( RecMuonCBmatchL2CB && L2CB_success) off_cb_match =
true;
93 if(!off_cb_match) L2CBOFFmatching_failure =
true;
95 else if (off_sa_match) L2CB_failure =
true;
98 fill(
m_group+
"_"+chain, saPt, saEta, saPhi, L2SA_success, L2CB_failure);
102 fill(
m_group+
"_"+chain, cbPt, cbEta, cbPhi, L2CB_success, L2CBOFFmatching_failure);
111 if( (*muEL)->muSATrackLink().isValid() && std::abs(saPt) >
ZERO_LIMIT ){
112 ptratio_toSA = std::abs(cbPt / saPt);
113 dEta_toSA = cbEta - saEta;
115 dR_toSA = sqrt(dEta_toSA*dEta_toSA + dPhi_toSA*dPhi_toSA);
117 fill(
m_group+
"_"+chain, ptratio_toSA, dEta_toSA, dPhi_toSA, dR_toSA);
129 if( (*muEL)->idTrackLink().isValid() ) {
130 idtrk = (*muEL)->idTrack();
131 trkPt = idtrk->
pt() / 1e3 * idtrk->
charge();
132 trkEta = idtrk->
eta();
133 trkPhi = idtrk->
phi0();
148 if( (*muEL)->idTrackLink().isValid() && std::abs(saPt) >
ZERO_LIMIT ){
149 ptratio_TrktoSA = std::abs(cbPt / saPt);
150 dEta_TrktoSA = cbEta - saEta;
152 dR_TrktoSA = sqrt(dEta_TrktoSA*dEta_TrktoSA + dPhi_TrktoSA*dPhi_TrktoSA);
154 fill(
m_group+
"_"+chain, ptratio_TrktoSA, dEta_TrktoSA, dPhi_TrktoSA, dR_TrktoSA);
159 std::vector<int> vec_MF_error;
165 vec_MF_error.push_back(2);
169 vec_MF_error.push_back(1);
173 vec_MF_error.push_back(3);
176 if(!
error) vec_MF_error.push_back(0);
182 return StatusCode::SUCCESS;
186StatusCode L2muCombMon :: fillVariablesPerOfflineMuonPerChain(
const EventContext&,
const xAOD::Muon* mu,
const std::string &chain)
const {
188 ATH_MSG_DEBUG (
"Filling histograms for " << name() <<
"...");
196 float offPt = mu->pt()/1e3;
203 if ( !muLinkInfo.
isValid() )
return StatusCode::SUCCESS;
211 if( !
m_matchTool->isMatchedL2CB(*muEL, mu) )
return StatusCode::SUCCESS;
215 float cbPt = (*muEL)->pt()/1e3;
216 if ( std::abs(offPt) >
ZERO_LIMIT && std::abs(cbPt) >
ZERO_LIMIT ) ptresol = std::abs(cbPt)/std::abs(offPt) - 1.;
241 return StatusCode::SUCCESS;
245StatusCode L2muCombMon :: fillVariables(
const EventContext &ctx)
const {
247 ATH_MSG_DEBUG (
"Filling histograms for " << name() <<
"...");
251 return StatusCode::SUCCESS;
256StatusCode L2muCombMon :: fillVariablesPerOfflineMuon(
const EventContext &ctx,
const xAOD::Muon* mu)
const {
262 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
ElementLink implementation for ROOT usage.
SG::ReadHandleKey< xAOD::L2CombinedMuonContainer > m_L2muCombContainerKey
Declare a monitored scalar variable.
StatusCode fillVariableEtaPhi(const EventContext &ctx, const SG::ReadHandleKey< DataVector< T > > &ReadHandleKey, std::string &&trigstep, std::tuple< bool, double, double >(*PosFunc)(const T *)=&TrigMuonMonitorAlgorithm::defaultPosFunc< T >) const
Function that fills variables of etaphi2D plots.
StatusCode fillVariablesRatioPlots(const EventContext &ctx, const xAOD::Muon *mu, std::string &&trigstep, xAOD::Muon::TrackParticleType type, FUNCT matchFunc) const
Function that fills variables of ratio plots.
Gaudi::Property< std::string > m_group
Name of monitored group.
TrigMuonMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
initialize
ToolHandle< MuonMatchingTool > m_matchTool
virtual double pt() const
The transverse momentum ( ) of the particle.
float z0() const
Returns the parameter.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float chiSquared() const
Returns the of the overall track fit.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float charge() const
Returns the charge.
float phi0() const
Returns the parameter, which has range to .
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
xAOD::TrigComposite Decision
void findLinks(const EventContext &ctx, const Decision *start, const std::string &linkName, std::vector< LinkInfo< T > > &links, unsigned int behaviour=TrigDefs::allFeaturesOfType, std::set< const xAOD::TrigComposite * > *fullyExploredFrom=nullptr)
search back the TC links for the object of type T linked to the one of TC (recursively) Populates pro...
static const unsigned int includeFailedDecisions
Run3 synonym of alsoDeactivateTEs.
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
L2CombinedMuonContainer_v1 L2CombinedMuonContainer
Define the latest version of the muon CB container.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
L2StandAloneMuon_v2 L2StandAloneMuon
Define the latest version of the muon SA class.
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
ElementLink< T > link
Link to the feature.
void fill(H5::Group &out_file, size_t iterations)