23StatusCode L2MuonSAMon :: fillVariablesPerChain(
const EventContext &ctx,
const std::string &chain)
const {
25 ATH_MSG_DEBUG(
"Filling histograms for " << name() <<
", chain " << chain <<
"...");
32 const bool isPh2FastReco = chain.find(
"newFast") != std::string::npos;
34 std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureCont =
40 ATH_MSG_DEBUG(
"Found EFFastReco object with pt = " << (*muEL)->pt() <<
", eta = " << (*muEL)->eta() <<
", phi = " << (*muEL)->phi());
49 saPt = (*muEL)->pt() * (*muEL)->charge() / Gaudi::Units::GeV;
50 saEta = (*muEL)->eta();
51 saPhi = (*muEL)->phi();
52 if(std::abs(saPt) <
ZERO_LIMIT) mf_failure =
true;
57 roiEta = l1roi ? l1roi->
eta() : -999.;
58 roiPhi = l1roi ? l1roi->
phi() : -999.;
60 fill(
m_group+
"_"+chain, roiEta, roiPhi, mf_failure);
61 if ( mf_failure )
continue;
67 if(std::abs(saEta) < 1.05) isBarrel =
true;
70 fill(
m_group+
"_"+chain, saPt, saEta, saPhi, isBarrel, isEndcap);
72 return StatusCode::SUCCESS;
75 std::vector< TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> > featureCont =
92 saEta = (*muEL)->eta();
93 saPhi = (*muEL)->phi();
94 saddr = (*muEL)->sAddress();
95 roiEta = (*muEL)->roiEta();
96 roiPhi = (*muEL)->roiPhi();
98 ATH_MSG_DEBUG(
"saPt = " << saPt <<
", saEta =" << saEta <<
", saPhi = " << saPhi <<
", saddr = " << saddr);
99 if(std::abs(saPt) <
ZERO_LIMIT) mf_failure =
true;
101 fill(
m_group+
"_"+chain, roiEta, roiPhi, mf_failure);
102 if( mf_failure )
continue;
108 if(saddr == -1) isEndcap =
true;
109 else isBarrel =
true;;
111 fill(
m_group+
"_"+chain, saPt, saEta, saPhi, saddr, isBarrel, isEndcap);
115 std::vector<int> proc_flow;
118 bool isL1hitThere =
false;
119 bool isL1emuOkForTriggerPlane =
false;
120 bool isMDThitThereForTriggerPlane =
false;
121 bool isMDTFitOkForTriggerPlane =
false;
122 bool isMDTFitOkFor2Plane =
false;
133 nRPC = (*muEL)->rpcHitLayer().size();
134 TGCMidRhoChi2 = (*muEL)->tgcMidRhoChi2();
135 TGCMidPhiChi2 = (*muEL)->tgcMidPhiChi2();
136 nTGCMidRho = (*muEL)->tgcMidRhoN();
137 nTGCMidPhi = (*muEL)->tgcMidPhiN();
139 fill(
m_group+
"_"+chain, nRPC, TGCMidRhoChi2, TGCMidPhiChi2, nTGCMidRho, nTGCMidPhi, isBarrel, isEndcap);
144 if( nRPC > 0 ) isL1hitThere =
true;
145 float rpcFitMidSlope = (*muEL)->rpcFitMidSlope();
146 if( std::abs(rpcFitMidSlope) >
ZERO_LIMIT ) isL1emuOkForTriggerPlane =
true;
149 if( nTGCMidRho > 0 && nTGCMidPhi > 0 ) isL1hitThere =
true;
150 float TGCMid1Z = (*muEL)->tgcMid1Z();
151 if( std::abs(TGCMid1Z) >
ZERO_LIMIT ) isL1emuOkForTriggerPlane =
true;
171 if( saPhi < 0 )
sign = -1;
175 std::vector<float> sp_r, sp_z;
180 if( std::abs((*muEL)->superPointR(inner)) >
ZERO_LIMIT ) {
181 sp_r.push_back(
sign * (*muEL)->superPointR(inner) );
182 sp_z.push_back( (*muEL)->superPointZ(inner) );
184 if( std::abs((*muEL)->superPointR(middle)) >
ZERO_LIMIT ) {
185 sp_r.push_back(
sign * (*muEL)->superPointR(middle) );
186 sp_z.push_back( (*muEL)->superPointZ(middle) );
188 if( std::abs((*muEL)->superPointR(outer)) >
ZERO_LIMIT ) {
189 sp_r.push_back(
sign * (*muEL)->superPointR(outer) );
190 sp_z.push_back( (*muEL)->superPointZ(outer) );
205 MDTInnChi2 = (*muEL)->superPointChi2(inner);
206 MDTMidChi2 = (*muEL)->superPointChi2(middle);
207 MDTOutChi2 = (*muEL)->superPointChi2(outer);
210 std::vector<float> res_inn, res_mid, res_out;
217 n_mdt_hits = (*muEL)->nMdtHits();
219 for (
int i_tube=0; i_tube<n_mdt_hits; i_tube++) {
220 float res = (*muEL)->mdtHitResidual(i_tube) / 10 ;
221 int imr = (*muEL)->mdtHitChamber(i_tube);
225 res_inn.push_back(
res);
227 else if (imr == middle) {
229 res_mid.push_back(
res);
231 else if (imr == outer) {
233 res_out.push_back(
res);
237 fill(
m_group+
"_"+chain, MDTInnChi2, MDTMidChi2, MDTOutChi2, n_mdt_hits, n_mdt_hits_inner, n_mdt_hits_middle, n_mdt_hits_outer, mon_res_inn, mon_res_mid, mon_res_out,
lb, isBarrel, isEndcap);
241 float MDTInnR = (*muEL)->superPointR(inner);
242 float MDTMidR = (*muEL)->superPointR(middle);
243 float MDTOutR = (*muEL)->superPointR(outer);
245 if( n_mdt_hits_middle > 0 ) isMDThitThereForTriggerPlane =
true;
246 if( MDTMidR >
ZERO_LIMIT ) isMDTFitOkForTriggerPlane =
true;
247 if( isMDTFitOkForTriggerPlane && (MDTInnR >
ZERO_LIMIT || MDTOutR >
ZERO_LIMIT) ) isMDTFitOkFor2Plane =
true;
249 proc_flow.push_back(1);
250 if( isL1hitThere ) proc_flow.push_back(2);
251 if( isL1emuOkForTriggerPlane ) proc_flow.push_back(3);
252 if( isMDThitThereForTriggerPlane ) proc_flow.push_back(4);
253 if( isMDTFitOkForTriggerPlane ) proc_flow.push_back(5);
254 if( isMDTFitOkFor2Plane ) proc_flow.push_back(6);
261 if(RecMuonCB ==
nullptr)
continue;
263 std::vector<float> res_inn_OffMatch = res_inn;
264 std::vector<float> res_mid_OffMatch = res_mid;
265 std::vector<float> res_out_OffMatch = res_out;
267 auto mon_res_inn_OffMatch =
Monitored::Collection(chain+
"_MDT_Inn_residual_OffMatch",res_inn_OffMatch);
268 auto mon_res_mid_OffMatch =
Monitored::Collection(chain+
"_MDT_Mid_residual_OffMatch",res_mid_OffMatch);
269 auto mon_res_out_OffMatch =
Monitored::Collection(chain+
"_MDT_Out_residual_OffMatch",res_out_OffMatch);
271 fill(
m_group+
"_"+chain, mon_res_inn_OffMatch, mon_res_mid_OffMatch, mon_res_out_OffMatch, isBarrel, isEndcap);
275 return StatusCode::SUCCESS;
280StatusCode L2MuonSAMon :: fillVariablesPerOfflineMuonPerChain(
const EventContext& ctx,
const xAOD::Muon* mu,
const std::string &chain)
const {
282 ATH_MSG_DEBUG (
"Filling histograms for " << name() <<
", chain: " << chain
283 <<
", offMuon with pt = " << mu->pt() <<
", eta = " << mu->eta() <<
", phi = " << mu->phi());
293 float offPt = mu->pt() / Gaudi::Units::GeV;
294 float offPhi = mu->phi();
295 float offCharge = mu->charge();
296 offPt_signed = offPt * offCharge;
298 float muSAPt{0.}, muSAdR{0.}, roiEta{0.}, roiPhi{0.};
299 bool isMatchedL2SA =
false;
301 const bool isPh2FastReco = chain.find(
"newFast") != std::string::npos;
304 bool isPassedL2 {
false};
307 isMatchedL2SA =
true;
310 muSAPt = muSA->
pt() * muSA->
charge() / Gaudi::Units::GeV;
312 bool isPassedL1 {
false};
314 roiEta = l1roi ? l1roi->
eta() : -999.;
315 roiPhi = l1roi ? l1roi->
phi() : -999.;
318 isMatchedL2SA =
false;
321 if ( !muLinkInfo.
isValid() )
return StatusCode::SUCCESS;
330 if ( !muLinkInfo.
isValid() )
return StatusCode::SUCCESS;
332 isMatchedL2SA =
m_matchTool->isMatchedL2SA( *muEL, mu);
335 muSAPt = (*muEL)->pt();
336 roiEta = (*muEL)->roiEta();
337 roiPhi = (*muEL)->roiPhi();
345 if( !isMatchedL2SA )
return StatusCode::SUCCESS;
352 roidEta = roiEta - offEta;
354 roidR = sqrt(roidEta*roidEta + roidPhi*roidPhi);
356 fill(
m_group+
"_"+chain, roidEta, roidPhi, roidR, offEta);
362 ptresol = std::abs(muSAPt)/std::abs(offPt) - 1.;
363 ATH_MSG_ALWAYS(
"Pt: "<< muSAPt <<
" vs " << offPt * offCharge <<
" => ptresol = " << ptresol);
364 invptresol = (1./(offPt * offCharge) - 1./muSAPt) / (1./(offPt * offCharge));
368 std::vector<float> invptresol_pos, invptresol_neg;
373 if( offCharge > 0. ) invptresol_pos.push_back(invptresol);
374 else invptresol_neg.push_back(invptresol);
377 const float ETA_OF_BARREL = 1.05;
378 const float ETA_OF_ENDCAP1 = 1.5;
379 const float ETA_OF_ENDCAP2 = 2.0;
380 const float ETA_OF_ENDCAP3 = 2.5;
404 if( std::abs(offEta) < ETA_OF_BARREL ) {
405 if( offEta > 0. ) isBarrelA =
true;
406 else isBarrelC =
true;
409 if( offEta > 0. ) isEndcapA =
true;
410 else isEndcapC =
true;
414 if( std::abs(offEta) < ETA_OF_BARREL ){
416 if( offEta > 0. ) isBarrelA =
true;
417 else isBarrelC =
true;
419 else if ( std::abs(offEta) < ETA_OF_ENDCAP1 ){
421 if( offEta > 0. ) isEndcap1A =
true;
422 else isEndcap1C =
true;
424 else if ( std::abs(offEta) < ETA_OF_ENDCAP2 ){
426 if( offEta > 0. ) isEndcap2A =
true;
427 else isEndcap2C =
true;
429 else if ( std::abs(offEta) < ETA_OF_ENDCAP3 ){
431 if( offEta > 0. ) isEndcap3A =
true;
432 else isEndcap3C =
true;
436 if( std::abs(offPt) > 4 ){
437 if( std::abs(offPt) < 6 ) pt4to6 =
true;
438 else if( std::abs(offPt) < 8 ) pt6to8 =
true;
443 fill(
m_group+
"_"+chain, ptresol, offPt_signed, offEta, isBarrel, isEndcap1, isEndcap2, isEndcap3, isBarrelA, isBarrelC, isEndcapA, isEndcapC, pt4to6, pt6to8, ptover8);
444 fill(
m_group+
"_"+chain, mon_invptresol_pos, mon_invptresol_neg, isBarrelA, isBarrelC, isEndcap1A, isEndcap2A, isEndcap3A, isEndcap1C, isEndcap2C, isEndcap3C);
447 return StatusCode::SUCCESS;