ATLAS Offline Software
Loading...
Searching...
No Matches
L2MuonSAIOMon.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "L2MuonSAIOMon.h"
6
8#include "MuonMatchingTool.h"
9#include "math.h"
10
11L2MuonSAIOMon :: L2MuonSAIOMon(const std::string& name, ISvcLocator* pSvcLocator )
12 : TrigMuonMonitorAlgorithm(name, pSvcLocator)
13{}
14
15StatusCode L2MuonSAIOMon :: initialize(){
16
18 ATH_CHECK( m_L2MuonCBIOContainerKey.initialize() );
19
20 unsigned int nchains = m_monitored_chains.size();
21 if(nchains!=m_monitored_chains_plateau.size()){
22 ATH_MSG_ERROR("Configuration seems to be wrong. The size of \"Plateaus\" should be same as \"MonitoredChainds\".");
23 return StatusCode::FAILURE;
24 } else {
25 for(unsigned int ichain=0; ichain<nchains; ++ichain){
27 }
28 }
29 return StatusCode::SUCCESS;
30}
31
32
33
34StatusCode L2MuonSAIOMon :: fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const {
35
36 ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
37
38 if( chain.find("probe") != std::string::npos ) return StatusCode::SUCCESS; // don't use TagAndProbe chains
39
40
41 const float ZERO_LIMIT = 0.00001;
42
43
44 //TDT workaround
45 std::vector< const xAOD::L2CombinedMuon* > Trig_L2IOobjects;
46 //std::vector< bool > pass_muCombHypo;
47 ATH_CHECK( matchL2IO_wContainer(ctx, chain, Trig_L2IOobjects) );
48 //bool pass_muCombHypo_evt = muCombHypo_TDTworkaround(chain, Trig_L2IOobjects, pass_muCombHypo);
49 ATH_MSG_DEBUG(" Trig_L2IOobjects.size(): " << Trig_L2IOobjects.size() );
50
51 // check basic EDM variables using single muon chain
52 for(const auto& Trig_L2IOobject : Trig_L2IOobjects){
53 ATH_MSG_DEBUG(" Trig_L2IOobject->muSATrack()->roiWord()/Trig_L2IOobject->pt(): " << Trig_L2IOobject->muSATrack()->roiWord() << "/" << Trig_L2IOobject->pt() );
54 // basic EDM variables
55 bool mf_failure = false;
56 auto cbioPt = Monitored::Scalar<float>(chain+"_Pt",-999.);
57 auto cbioEta = Monitored::Scalar<float>(chain+"_Eta",-999.);
58 auto cbioPhi = Monitored::Scalar<float>(chain+"_Phi",-999.);
59 cbioPt = Trig_L2IOobject->pt()/1e3 * Trig_L2IOobject->charge(); // convert to GeV
60 cbioEta = Trig_L2IOobject->eta();
61 cbioPhi = Trig_L2IOobject->phi();
62 ATH_MSG_DEBUG("cbioPt = " << cbioPt << ", cbioEta =" << cbioEta << ", cbioPhi = " << cbioPhi);
63 if(std::abs(cbioPt) < ZERO_LIMIT || std::abs(Trig_L2IOobject->muSATrack()->pt()) < ZERO_LIMIT) mf_failure = true;
64
65 if( mf_failure ) continue;
66
67 // region variables
68 auto isBarrel = Monitored::Scalar<bool>(chain+"_isBarrel",false);
69 auto isEndcap = Monitored::Scalar<bool>(chain+"_isEndcap",false);
70
71 // define regions
72 int saddr = Trig_L2IOobject->muSATrack()->sAddress();
73 if(saddr == -1) isEndcap = true;
74 else isBarrel = true;;
75
76
77 fill(m_group+"_"+chain, cbioPt, isBarrel, isEndcap);
78 fill(m_group+"_"+chain, cbioEta);
79 fill(m_group+"_"+chain, cbioPhi, isBarrel, isEndcap);
80
81 }
82
83 return StatusCode::SUCCESS;
84}
85
86
87StatusCode L2MuonSAIOMon :: fillVariablesPerOfflineMuonPerChain(const EventContext& ctx, const xAOD::Muon* mu, const std::string &chain) const {
88
89 ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
90
91 const float ZERO_LIMIT = 0.00001;
92
93 // get the best L2Inside-Out object matched to offline muon(dR between L2Inside-Out object and offline muon is minimum)
94 const xAOD::L2CombinedMuon* Trig_L2IOobject = searchL2InsideOut(ctx, mu, chain);
95
96 // offline muon variables
97 auto offPt = Monitored::Scalar<float>(chain+"_offPt",-999.);
98 auto offEta = Monitored::Scalar<float>(chain+"_offEta",-999.);
99 auto offPhi = Monitored::Scalar<float>(chain+"_offPhi",-999.);
100 offPt = mu->pt()/1e3 * mu->charge(); // convert to GeV
101 offEta = mu->eta();
102 offPhi = mu->phi();
103 float offCharge = mu->charge();
104
105
106 if( chain.find("probe") != std::string::npos ){ // L2Inside-Out efficiency using Tag&Probe chain
107 if(chain.find("L1MU14FCH") != std::string::npos){
108 if ( !getTrigDecisionTool()->isPassed("HLT_mu24_ivarmedium_L1MU14FCH", TrigDefs::requireDecision) ) return StatusCode::SUCCESS; // impose trigger pass in order to eliminate bias
109 }
110 else if(chain.find("L1MU18VFCH") != std::string::npos){
111 if ( !getTrigDecisionTool()->isPassed("HLT_mu24_ivarmedium_L1MU18VFCH", TrigDefs::requireDecision) ) return StatusCode::SUCCESS; // impose trigger pass in order to eliminate bias
112 }
113 else
114 {
115 return StatusCode::SUCCESS;
116 }
117
118 // search tag offline muon
119 const xAOD::Muon* tag = searchTagOfflineMuon( ctx, mu );
120 if( tag == nullptr ) return StatusCode::SUCCESS; // mu doesn't have no tag muons
121
122
123 // efficiency variables
124 auto passL2InsideOut = Monitored::Scalar<bool>(chain+"_passL2InsideOut",false);
125 auto passL2SA = Monitored::Scalar<bool>(chain+"_passL2SA",false);
126 auto offdR = Monitored::Scalar<float>(chain+"_offdR",1000.);
127 const ElementLink<xAOD::TrackParticleContainer> &tag_ms_track = tag->muonSpectrometerTrackParticleLink();
128 if( !tag_ms_track.isValid() ) return StatusCode::SUCCESS; // tag muon dosen't have ms track
129 const ElementLink<xAOD::TrackParticleContainer> &probe_ms_track = mu->muonSpectrometerTrackParticleLink();
130 if( !probe_ms_track.isValid() ) return StatusCode::SUCCESS; // probe muon dosen't have ms track
131 float tpext_deta = (*tag_ms_track)->eta() - (*probe_ms_track)->eta();
132 float tpext_dphi = xAOD::P4Helpers::deltaPhi((*tag_ms_track)->phi(), (*probe_ms_track)->phi());
133 offdR = std::sqrt(tpext_deta*tpext_deta + tpext_dphi*tpext_dphi);
134
135 passL2InsideOut = false;
136 passL2SA = false;
137
138 // retrieve probe l2SA objects
139 int legIndex_probe = 1; // probe
140 std::vector< TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> > featureCont = getTrigDecisionTool()->features<xAOD::L2StandAloneMuonContainer>( chain,
142 "HLT_MuonL2SAInfo",
145 legIndex_probe );
146
147 for(const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer>& probe_L2SALinkInfo : featureCont){
148 ATH_CHECK( probe_L2SALinkInfo.isValid() );
149 const ElementLink<xAOD::L2StandAloneMuonContainer> probe_L2SAobject = probe_L2SALinkInfo.link;
150 if( m_matchTool->isMatchedL2SA( (*probe_L2SAobject), mu ) ){
151 if( probe_L2SALinkInfo.state == TrigCompositeUtils::ActiveState::ACTIVE ) passL2SA = true;
152 }
153 }
154
155 if(passL2SA == true){
156 if(m_matchTool->isMatchedL2InsideOut( Trig_L2IOobject, mu ))
157 {
158 bool isPass = false;
159 ATH_CHECK(isPassedmuCombHypo( chain, Trig_L2IOobject ,isPass));
160 passL2InsideOut = isPass;
161 }
162 }
163 else{
164 return StatusCode::SUCCESS;
165 }
166
167
168 fill(m_group+"_"+chain, passL2InsideOut, passL2SA, offPt);
169
170 if( mu->pt()/1e3 > m_plateaus.at(chain) ){
171 fill(m_group+"_"+chain, passL2InsideOut, passL2SA, offEta, offPhi, offdR);
172 }
173 }
174 else{ // make detail histograms using normal L2Inside-Out chain
175 if( Trig_L2IOobject == nullptr ) return StatusCode::SUCCESS; // no L2Inside-Out objects
176 if( ! m_matchTool->isMatchedL2InsideOut(Trig_L2IOobject, mu) ) return StatusCode::SUCCESS; // offline muons is not matched to any L2Inside-Out objects
177
178
179 //L2Muon chamberID index
180 enum chamberID {
181 Inn_Barrel = 0,
182 Mid_Barrel,
183 Out_Barrel,
184 Inn_Endcap,
185 Mid_Endcap,
186 Out_Endcap
187 };
188 std::vector< int > L2Muon_chamberID_index;
189 auto mon_L2Muon_chamberID_index = Monitored::Collection(chain+"_L2Muon_chamberID_index",L2Muon_chamberID_index);
190 for( int i = 0; i < 6; i++){
191 L2Muon_chamberID_index.push_back(i);
192 }
193
194 // dR wrt offline
195 auto dRmin = Monitored::Scalar<float>(chain+"_dRmin",1000.);
196 dRmin = xAOD::P4Helpers::deltaR(mu, Trig_L2IOobject, false);
197
198 // region variables
199 const float ETA_OF_BARREL = 1.05;
200 auto regionBE = Monitored::Scalar<int>(chain+"_regionBE",-999);
201 auto isBarrel = Monitored::Scalar<bool>(chain+"_isBarrel",false);
202 auto isBarrelA = Monitored::Scalar<bool>(chain+"_isBarrelA",false);
203 auto isBarrelC = Monitored::Scalar<bool>(chain+"_isBarrelC",false);
204 auto isEndcap = Monitored::Scalar<bool>(chain+"_isEndcap",false);
205 auto isEndcapA = Monitored::Scalar<bool>(chain+"_isEndcapA",false);
206 auto isEndcapC = Monitored::Scalar<bool>(chain+"_isEndcapC",false);
207
208 // offline pt variables
209 auto pt4to6 = Monitored::Scalar<bool>(chain+"_pt4to6",false);
210 auto pt6to8 = Monitored::Scalar<bool>(chain+"_pt6to8",false);
211 auto ptover8 = Monitored::Scalar<bool>(chain+"_ptover8",false);
212
213 // define region
214 if( std::abs(offEta) < ETA_OF_BARREL ) {
215 regionBE = 0;
216 isBarrel = true;
217 if( offEta > 0. ) isBarrelA = true;
218 else isBarrelC = true;
219 }
220 else{
221 regionBE = 1;
222 isEndcap = true;
223 if( offEta > 0. ) isEndcapA = true;
224 else isEndcapC = true;
225 }
226
227 if( std::abs(offPt) > 4 ){
228 if( std::abs(offPt) < 6 ) pt4to6 = true;
229 else if( std::abs(offPt) < 8 ) pt6to8 = true;
230 else ptover8 = true;
231 }
232
233 // basic variables
234 auto cbioPt = Monitored::Scalar<float>(chain+"_Pt_wrt_offline",-999.);
235 auto cbioEta = Monitored::Scalar<float>(chain+"_Eta_wrt_offline",-999.);
236 auto cbioPhi = Monitored::Scalar<float>(chain+"_Phi_wrt_offline",-999.);
237 cbioPt = Trig_L2IOobject->pt()/1e3 * Trig_L2IOobject->charge(); // convert to GeV
238 cbioEta = Trig_L2IOobject->eta();
239 cbioPhi = Trig_L2IOobject->phi();
240
241 // L2Inside-Out track multiplicity per L2SA track
242 auto L2InsideOut_multiplicity = Monitored::Scalar<float>(chain+"_L2InsideOut_track_multiplicity",-999.);
243 L2InsideOut_multiplicity = 0;
244 std::vector< const xAOD::L2CombinedMuon* > Trig_L2IOobjects_tmp;
245 ATH_CHECK( matchL2IO_wContainer(ctx, chain, Trig_L2IOobjects_tmp) );
246 for(const auto& Trig_L2IOobject_tmp : Trig_L2IOobjects_tmp){
247 if( Trig_L2IOobject_tmp->muSATrack()->roiWord() == Trig_L2IOobject->muSATrack()->roiWord() ) L2InsideOut_multiplicity++;
248 }
249
250 // pt resolution
251 auto ptresol = Monitored::Scalar<float>(chain+"_ptresol",-999.);
252 if ( std::abs(offPt) > ZERO_LIMIT && std::abs(cbioPt) > ZERO_LIMIT ){
253 ptresol = std::abs(cbioPt)/std::abs(offPt) - 1.;
254 }
255
256 std::vector< float > ptresol_pos, ptresol_neg;
257 auto mon_ptresol_pos = Monitored::Collection(chain+"_ptresol_pos",ptresol_pos);
258 auto mon_ptresol_neg = Monitored::Collection(chain+"_ptresol_neg",ptresol_neg);
259 if( offCharge > 0. ) ptresol_pos.push_back(ptresol);
260 else ptresol_neg.push_back(ptresol);
261
262 // distance bw FTFroad and offlinesegment
263 std::vector< float > distance_bw_FTFroad_and_offlinesegment_Inn_Barrel;
264 std::vector< float > distance_bw_FTFroad_and_offlinesegment_Mid_Barrel;
265 std::vector< float > distance_bw_FTFroad_and_offlinesegment_Out_Barrel;
266 std::vector< float > distance_bw_FTFroad_and_offlinesegment_Inn_Endcap;
267 std::vector< float > distance_bw_FTFroad_and_offlinesegment_Mid_Endcap;
268 std::vector< float > distance_bw_FTFroad_and_offlinesegment_Out_Endcap;
269 auto mon_distance_bw_FTFroad_and_offlinesegment_Inn_Barrel = Monitored::Collection(chain+"_distance_bw_FTFroad_and_offlinesegment_Inn_Barrel",distance_bw_FTFroad_and_offlinesegment_Inn_Barrel);
270 auto mon_distance_bw_FTFroad_and_offlinesegment_Mid_Barrel = Monitored::Collection(chain+"_distance_bw_FTFroad_and_offlinesegment_Mid_Barrel",distance_bw_FTFroad_and_offlinesegment_Mid_Barrel);
271 auto mon_distance_bw_FTFroad_and_offlinesegment_Out_Barrel = Monitored::Collection(chain+"_distance_bw_FTFroad_and_offlinesegment_Out_Barrel",distance_bw_FTFroad_and_offlinesegment_Out_Barrel);
272 auto mon_distance_bw_FTFroad_and_offlinesegment_Inn_Endcap = Monitored::Collection(chain+"_distance_bw_FTFroad_and_offlinesegment_Inn_Endcap",distance_bw_FTFroad_and_offlinesegment_Inn_Endcap);
273 auto mon_distance_bw_FTFroad_and_offlinesegment_Mid_Endcap = Monitored::Collection(chain+"_distance_bw_FTFroad_and_offlinesegment_Mid_Endcap",distance_bw_FTFroad_and_offlinesegment_Mid_Endcap);
274 auto mon_distance_bw_FTFroad_and_offlinesegment_Out_Endcap = Monitored::Collection(chain+"_distance_bw_FTFroad_and_offlinesegment_Out_Endcap",distance_bw_FTFroad_and_offlinesegment_Out_Endcap);
275
276 std::vector< float > distance_bw_FTFroad_and_offlinesegment_vec;
277 std::vector< float > FTFroad_Aw;
278 std::vector< float > FTFroad_Bw;
279 std::vector< bool > FTFroad_fill;
280 for(int i=0; i<6; i++){
281 distance_bw_FTFroad_and_offlinesegment_vec.push_back(10000.);
282 FTFroad_Aw.push_back(Trig_L2IOobject->muSATrack()->roadAw(i, 0));
283 FTFroad_Bw.push_back(Trig_L2IOobject->muSATrack()->roadBw(i, 0));
284 FTFroad_fill.push_back(false);
285 }
286
287 // MDT hits residual
288 std::vector<float> res_Inn_Barrel, res_Mid_Barrel, res_Out_Barrel, res_Inn_Endcap, res_Mid_Endcap, res_Out_Endcap;
289 auto mon_res_Inn_Barrel = Monitored::Collection(chain+"_MDT_residual_Inn_Barrel",res_Inn_Barrel);
290 auto mon_res_Mid_Barrel = Monitored::Collection(chain+"_MDT_residual_Mid_Barrel",res_Mid_Barrel);
291 auto mon_res_Out_Barrel = Monitored::Collection(chain+"_MDT_residual_Out_Barrel",res_Out_Barrel);
292 auto mon_res_Inn_Endcap = Monitored::Collection(chain+"_MDT_residual_Inn_Endcap",res_Inn_Endcap);
293 auto mon_res_Mid_Endcap = Monitored::Collection(chain+"_MDT_residual_Mid_Endcap",res_Mid_Endcap);
294 auto mon_res_Out_Endcap = Monitored::Collection(chain+"_MDT_residual_Out_Endcap",res_Out_Endcap);
295
296 // distance bw MDT hits and offlinesegment
297 std::vector< float > distance_bw_MDT_and_offlinesegment_Inn_Barrel;
298 std::vector< float > distance_bw_MDT_and_offlinesegment_Mid_Barrel;
299 std::vector< float > distance_bw_MDT_and_offlinesegment_Out_Barrel;
300 std::vector< float > distance_bw_MDT_and_offlinesegment_Inn_Endcap;
301 std::vector< float > distance_bw_MDT_and_offlinesegment_Mid_Endcap;
302 std::vector< float > distance_bw_MDT_and_offlinesegment_Out_Endcap;
303 auto mon_distance_bw_MDT_and_offlinesegment_Inn_Barrel = Monitored::Collection(chain+"_distance_bw_MDT_and_offlinesegment_Inn_Barrel",distance_bw_MDT_and_offlinesegment_Inn_Barrel);
304 auto mon_distance_bw_MDT_and_offlinesegment_Mid_Barrel = Monitored::Collection(chain+"_distance_bw_MDT_and_offlinesegment_Mid_Barrel",distance_bw_MDT_and_offlinesegment_Mid_Barrel);
305 auto mon_distance_bw_MDT_and_offlinesegment_Out_Barrel = Monitored::Collection(chain+"_distance_bw_MDT_and_offlinesegment_Out_Barrel",distance_bw_MDT_and_offlinesegment_Out_Barrel);
306 auto mon_distance_bw_MDT_and_offlinesegment_Inn_Endcap = Monitored::Collection(chain+"_distance_bw_MDT_and_offlinesegment_Inn_Endcap",distance_bw_MDT_and_offlinesegment_Inn_Endcap);
307 auto mon_distance_bw_MDT_and_offlinesegment_Mid_Endcap = Monitored::Collection(chain+"_distance_bw_MDT_and_offlinesegment_Mid_Endcap",distance_bw_MDT_and_offlinesegment_Mid_Endcap);
308 auto mon_distance_bw_MDT_and_offlinesegment_Out_Endcap = Monitored::Collection(chain+"_distance_bw_MDT_and_offlinesegment_Out_Endcap",distance_bw_MDT_and_offlinesegment_Out_Endcap);
309 std::vector< float > distance_bw_MDT_and_offlinesegment_vec;
310 std::vector< int > MDTHitChamber_fill;
311 std::vector< int > MDTHitChamber;
312 std::vector< float > MDTHitR;
313 std::vector< float > MDTHitZ;
314
315 // # of MDT hits
316 std::vector<int> MDT_N_Inn_Barrel, MDT_N_Mid_Barrel, MDT_N_Out_Barrel, MDT_N_Inn_Endcap, MDT_N_Mid_Endcap, MDT_N_Out_Endcap;
317 auto mon_MDT_N_Inn_Barrel = Monitored::Collection(chain+"_MDT_N_Inn_Barrel",MDT_N_Inn_Barrel);
318 auto mon_MDT_N_Mid_Barrel = Monitored::Collection(chain+"_MDT_N_Mid_Barrel",MDT_N_Mid_Barrel);
319 auto mon_MDT_N_Out_Barrel = Monitored::Collection(chain+"_MDT_N_Out_Barrel",MDT_N_Out_Barrel);
320 auto mon_MDT_N_Inn_Endcap = Monitored::Collection(chain+"_MDT_N_Inn_Endcap",MDT_N_Inn_Endcap);
321 auto mon_MDT_N_Mid_Endcap = Monitored::Collection(chain+"_MDT_N_Mid_Endcap",MDT_N_Mid_Endcap);
322 auto mon_MDT_N_Out_Endcap = Monitored::Collection(chain+"_MDT_N_Out_Endcap",MDT_N_Out_Endcap);
323 int n_mdthits_BI = 0;
324 int n_mdthits_BM = 0;
325 int n_mdthits_BO = 0;
326 int n_mdthits_EI = 0;
327 int n_mdthits_EM = 0;
328 int n_mdthits_EO = 0;
329
330 int n_mdt_hits = Trig_L2IOobject->muSATrack()->nMdtHits();
331 for(int i_tube=0; i_tube<n_mdt_hits; i_tube++){
332 if( Trig_L2IOobject->muSATrack()->mdtHitIsOutlier(i_tube) != 0 ) continue;
333 float res = Trig_L2IOobject->muSATrack()->mdtHitResidual(i_tube);
334 int imr = Trig_L2IOobject->muSATrack()->mdtHitChamber(i_tube);
335 MDTHitChamber.push_back(imr);
336 MDTHitR.push_back(Trig_L2IOobject->muSATrack()->mdtHitR(i_tube));
337 MDTHitZ.push_back(Trig_L2IOobject->muSATrack()->mdtHitZ(i_tube));
338
339 if( imr == Inn_Barrel ){
340 n_mdthits_BI++;
341 res_Inn_Barrel.push_back(res);
342 }
343 else if( imr == Mid_Barrel ){
344 n_mdthits_BM++;
345 res_Mid_Barrel.push_back(res);
346 }
347 else if( imr == Out_Barrel ){
348 n_mdthits_BO++;
349 res_Out_Barrel.push_back(res);
350 }
351 else if( imr == Inn_Endcap ){
352 n_mdthits_EI++;
353 res_Inn_Endcap.push_back(res);
354 }
355 else if( imr == Mid_Endcap ){
356 n_mdthits_EM++;
357 res_Mid_Endcap.push_back(res);
358 }
359 else if( imr == Out_Endcap ){
360 n_mdthits_EO++;
361 res_Out_Endcap.push_back(res);
362 }
363 }
364
365 // reconstruction efficiency of superpoint
366 std::vector<bool> superpoint_exist_pt4to6, superpoint_exist_pt6to8, superpoint_exist_ptover8;
367 auto mon_superpoint_exist_pt4to6 = Monitored::Collection(chain+"_superpoint_pt4to6",superpoint_exist_pt4to6);
368 auto mon_superpoint_exist_pt6to8 = Monitored::Collection(chain+"_superpoint_pt6to8",superpoint_exist_pt6to8);
369 auto mon_superpoint_exist_ptover8 = Monitored::Collection(chain+"_superpoint_ptover8",superpoint_exist_ptover8);
370 std::vector<bool> segment_superpoint_exist(6, false);
371 std::vector<bool> offlinesegment_exist_pt4to6, offlinesegment_exist_pt6to8, offlinesegment_exist_ptover8;
372 auto mon_offlinesegment_exist_pt4to6 = Monitored::Collection(chain+"_offlinesegment_pt4to6",offlinesegment_exist_pt4to6);
373 auto mon_offlinesegment_exist_pt6to8 = Monitored::Collection(chain+"_offlinesegment_pt6to8",offlinesegment_exist_pt6to8);
374 auto mon_offlinesegment_exist_ptover8 = Monitored::Collection(chain+"_offlinesegment_ptover8",offlinesegment_exist_ptover8);
375
376 // # of superpoint
377 auto superpoint_multiplicity = Monitored::Scalar<int>(chain+"_superpoint_multiplicity",0);
378 std::vector< bool > superpoint_exist;
379 std::vector< float > superpointR;
380 int Num_L2Muon_chamberID = 12;
381 for( int i_chamber = 0; i_chamber < Num_L2Muon_chamberID; i_chamber++){
382 if( Trig_L2IOobject->muSATrack()->superPointR(i_chamber) < ZERO_LIMIT ){
383 superpoint_exist.push_back(false);
384 }
385 else{
386 superpoint_exist.push_back(true);
387 superpoint_multiplicity++;
388 }
389 superpointR.push_back(Trig_L2IOobject->muSATrack()->superPointR(i_chamber));
390 }
391
392
393 std::vector< bool > segment_exist(6, false);
394 for(unsigned int i_seg = 0; i_seg < mu->nMuonSegments(); i_seg++){
395 const xAOD::MuonSegment* segment = mu->muonSegment(i_seg);
396 if(!segment) continue;
397 float segmentX = segment->x();
398 float segmentY = segment->y();
399 float segmentZ = segment->z();
400 float segmentR = std::sqrt( std::pow(segmentX, 2.0) + std::pow(segmentY, 2.0) );
401 float segmentPx = segment->px();
402 float segmentPy = segment->py();
403 float segmentPz = segment->pz();
404 float segmentSector = segment->sector();
405 using namespace Muon::MuonStationIndex;
406 int segmentChamberIndex = toInt(segment->chamberIndex());
407 float distance_bw_FTFroad_and_offlinesegment = 99999.;
408 float distance_bw_MDT_and_offlinesegment = 99999.;
409 int roadChamberIndex = -1;
410 int MDTChamberIndex = -1;
411 if( segmentChamberIndex == 0 || segmentChamberIndex == 1 ){ // Inner Barrel
412 segment_exist.at(Inn_Barrel) = true;
413 roadChamberIndex = Inn_Barrel;
414 MDTChamberIndex = Inn_Barrel;
415 }
416 else if( segmentChamberIndex == 2 || segmentChamberIndex == 3 ){ // Middle Barrel
417 segment_exist.at(Mid_Barrel) = true;
418 roadChamberIndex = Mid_Barrel;
419 MDTChamberIndex = Mid_Barrel;
420 }
421 else if( segmentChamberIndex == 4 || segmentChamberIndex == 5 ){ // Outer Barrel
422 segment_exist.at(Out_Barrel) = true;
423 roadChamberIndex = Out_Barrel;
424 MDTChamberIndex = Out_Barrel;
425 }
426 else if( segmentChamberIndex == 7 || segmentChamberIndex == 8 ){ // Inner Endcap
427 segment_exist.at(Inn_Endcap) = true;
428 roadChamberIndex = Inn_Endcap;
429 MDTChamberIndex = Inn_Endcap;
430 }
431 else if( segmentChamberIndex == 9 || segmentChamberIndex == 10 ){ // Middle Endcap
432 segment_exist.at(Mid_Endcap) = true;
433 roadChamberIndex = Mid_Endcap;
434 MDTChamberIndex = Mid_Endcap;
435 }
436 else if( segmentChamberIndex == 11 || segmentChamberIndex == 12 ){ // Outer Endcap
437 segment_exist.at(Out_Endcap) = true;
438 roadChamberIndex = Out_Endcap;
439 MDTChamberIndex = Out_Endcap;
440 }
441
442 // Calc distance bw FTFroad and offlinesegment
443 if( roadChamberIndex != -1 ){
444 if( FTFroad_Aw.at(roadChamberIndex) > ZERO_LIMIT || FTFroad_Bw.at(roadChamberIndex) > ZERO_LIMIT ){
445 FTFroad_fill.at(roadChamberIndex) = true;
446 if( FTFroad_Aw.at(roadChamberIndex) < ZERO_LIMIT) distance_bw_FTFroad_and_offlinesegment = segmentR - FTFroad_Bw.at(roadChamberIndex);
447 else{
448 float ia = 1.0/FTFroad_Aw.at(roadChamberIndex);
449 float iaq = ia * ia;
450 distance_bw_FTFroad_and_offlinesegment = (segmentZ - ia * (segmentR - FTFroad_Bw.at(roadChamberIndex)))/std::sqrt(1.0 + iaq);
451 }
452 if( std::abs(distance_bw_FTFroad_and_offlinesegment) < std::abs(distance_bw_FTFroad_and_offlinesegment_vec.at(roadChamberIndex)) )
453 distance_bw_FTFroad_and_offlinesegment_vec.at(roadChamberIndex) = distance_bw_FTFroad_and_offlinesegment;
454 }
455 }
456
457 // Calc distance bw MDT hits and offlinesegment
458 if( MDTChamberIndex != -1 ){
459 float sector_phi = M_PI*(segmentSector - 1.0)/8.0;
460 float segmentR_projection = segmentX * std::cos(sector_phi) + segmentY * std::sin(sector_phi);
461 float segmentPr_projection = segmentPx * std::cos(sector_phi) + segmentPy * std::sin(sector_phi);
462
463 for(unsigned int i_tube=0; i_tube<MDTHitChamber.size(); i_tube++){
464 if( MDTHitChamber.at(i_tube) != MDTChamberIndex ) continue;
465 if( MDTChamberIndex < 3 ){ //Barrel
466 if( std::abs(segmentPz) < ZERO_LIMIT ) distance_bw_MDT_and_offlinesegment = MDTHitZ.at(i_tube) - segmentZ;
467 else{
468 float denominator = segmentPr_projection/segmentPz;
469 if( std::abs(denominator) < ZERO_LIMIT ) continue;
470 distance_bw_MDT_and_offlinesegment = MDTHitZ.at(i_tube) - ((MDTHitR.at(i_tube) - segmentR_projection)/denominator + segmentZ);
471 }
472 }
473 else{ //Endcap
474 if( std::abs(segmentPz) < ZERO_LIMIT ){
475 distance_bw_MDT_and_offlinesegment = MDTHitR.at(i_tube) - segmentR;
476 }
477 else{
478 float coeffi = (MDTHitZ.at(i_tube) - segmentZ)/segmentPz;
479 float segmentR_extrapolated = std::sqrt(std::pow(segmentX + coeffi * segmentPx, 2.0) + std::pow(segmentY + coeffi * segmentPy, 2.0));
480 distance_bw_MDT_and_offlinesegment = MDTHitR.at(i_tube) - segmentR_extrapolated;
481 }
482 }
483 distance_bw_MDT_and_offlinesegment_vec.push_back(distance_bw_MDT_and_offlinesegment);
484 MDTHitChamber_fill.push_back(MDTHitChamber.at(i_tube));
485 }
486 }
487 }
488
489 if( FTFroad_fill.at(Inn_Barrel) ){
490 distance_bw_FTFroad_and_offlinesegment_Inn_Barrel.push_back(distance_bw_FTFroad_and_offlinesegment_vec.at(Inn_Barrel));
491 }
492 if( FTFroad_fill.at(Mid_Barrel) ){
493 distance_bw_FTFroad_and_offlinesegment_Mid_Barrel.push_back(distance_bw_FTFroad_and_offlinesegment_vec.at(Mid_Barrel));
494 }
495 if( FTFroad_fill.at(Out_Barrel) ){
496 distance_bw_FTFroad_and_offlinesegment_Out_Barrel.push_back(distance_bw_FTFroad_and_offlinesegment_vec.at(Out_Barrel));
497 }
498 if( FTFroad_fill.at(Inn_Endcap) ){
499 distance_bw_FTFroad_and_offlinesegment_Inn_Endcap.push_back(distance_bw_FTFroad_and_offlinesegment_vec.at(Inn_Endcap));
500 }
501 if( FTFroad_fill.at(Mid_Endcap) ){
502 distance_bw_FTFroad_and_offlinesegment_Mid_Endcap.push_back(distance_bw_FTFroad_and_offlinesegment_vec.at(Mid_Endcap));
503 }
504 if( FTFroad_fill.at(Out_Endcap) ){
505 distance_bw_FTFroad_and_offlinesegment_Out_Endcap.push_back(distance_bw_FTFroad_and_offlinesegment_vec.at(Out_Endcap));
506 }
507
508 for( unsigned int i = 0; i < distance_bw_MDT_and_offlinesegment_vec.size(); i++ ){
509 if( MDTHitChamber_fill.at(i) == Inn_Barrel ){
510 distance_bw_MDT_and_offlinesegment_Inn_Barrel.push_back(distance_bw_MDT_and_offlinesegment_vec.at(i));
511 }
512 else if( MDTHitChamber_fill.at(i) == Mid_Barrel ){
513 distance_bw_MDT_and_offlinesegment_Mid_Barrel.push_back(distance_bw_MDT_and_offlinesegment_vec.at(i));
514 }
515 else if( MDTHitChamber_fill.at(i) == Out_Barrel ){
516 distance_bw_MDT_and_offlinesegment_Out_Barrel.push_back(distance_bw_MDT_and_offlinesegment_vec.at(i));
517 }
518 else if( MDTHitChamber_fill.at(i) == Inn_Endcap ){
519 distance_bw_MDT_and_offlinesegment_Inn_Endcap.push_back(distance_bw_MDT_and_offlinesegment_vec.at(i));
520 }
521 else if( MDTHitChamber_fill.at(i) == Mid_Endcap ){
522 distance_bw_MDT_and_offlinesegment_Mid_Endcap.push_back(distance_bw_MDT_and_offlinesegment_vec.at(i));
523 }
524 else if( MDTHitChamber_fill.at(i) == Out_Endcap ){
525 distance_bw_MDT_and_offlinesegment_Out_Endcap.push_back(distance_bw_MDT_and_offlinesegment_vec.at(i));
526 }
527 else{
528 ATH_MSG_WARNING( "undefined chamberID is pushed back into MDTHitChamber_fill" );
529 }
530 }
531
532 if( segment_exist.at(Inn_Barrel) ){
533 MDT_N_Inn_Barrel.push_back(n_mdthits_BI);
534 segment_superpoint_exist.at(Inn_Barrel) = superpoint_exist.at(Inn_Barrel);
535 }
536 if( segment_exist.at(Mid_Barrel) ){
537 MDT_N_Mid_Barrel.push_back(n_mdthits_BM);
538 segment_superpoint_exist.at(Mid_Barrel) = superpoint_exist.at(Mid_Barrel);
539 }
540 if( segment_exist.at(Out_Barrel) ){
541 MDT_N_Out_Barrel.push_back(n_mdthits_BO);
542 segment_superpoint_exist.at(Out_Barrel) = superpoint_exist.at(Out_Barrel);
543 }
544 if( segment_exist.at(Inn_Endcap) ){
545 MDT_N_Inn_Endcap.push_back(n_mdthits_EI);
546 segment_superpoint_exist.at(Inn_Endcap) = superpoint_exist.at(Inn_Endcap);
547 }
548 if( segment_exist.at(Mid_Endcap) ){
549 MDT_N_Mid_Endcap.push_back(n_mdthits_EM);
550 segment_superpoint_exist.at(Mid_Endcap) = superpoint_exist.at(Mid_Endcap);
551 }
552 if( segment_exist.at(Out_Endcap) ){
553 MDT_N_Out_Endcap.push_back(n_mdthits_EO);
554 segment_superpoint_exist.at(Out_Endcap) = superpoint_exist.at(Out_Endcap);
555 }
556
557 if( pt4to6 ){
558 offlinesegment_exist_pt4to6 = segment_exist;
559 superpoint_exist_pt4to6 = segment_superpoint_exist;
560 }
561 else if( pt6to8 ){
562 offlinesegment_exist_pt6to8 = segment_exist;
563 superpoint_exist_pt6to8 = segment_superpoint_exist;
564 }
565 else if( ptover8 ){
566 offlinesegment_exist_ptover8 = segment_exist;
567 superpoint_exist_ptover8 = segment_superpoint_exist;
568 }
569
570 fill(m_group+"_"+chain, dRmin, isBarrel, isEndcap);
571 fill(m_group+"_"+chain, cbioPt, isBarrel, isEndcap);
572 fill(m_group+"_"+chain, cbioEta);
573 fill(m_group+"_"+chain, cbioPhi, isBarrel, isEndcap);
574 fill(m_group+"_"+chain, L2InsideOut_multiplicity, offPt, isBarrel, isEndcap);
575 fill(m_group+"_"+chain, ptresol, offEta, pt4to6, pt6to8, ptover8);
576 fill(m_group+"_"+chain, ptresol, offPt, isBarrelA, isBarrelC, isEndcapA, isEndcapC);
577 fill(m_group+"_"+chain, mon_ptresol_pos, mon_ptresol_neg, isBarrelA, isBarrelC, isEndcapA, isEndcapC);
578 fill(m_group+"_"+chain, mon_distance_bw_FTFroad_and_offlinesegment_Inn_Barrel, pt4to6, pt6to8, ptover8);
579 fill(m_group+"_"+chain, mon_distance_bw_FTFroad_and_offlinesegment_Mid_Barrel, pt4to6, pt6to8, ptover8);
580 fill(m_group+"_"+chain, mon_distance_bw_FTFroad_and_offlinesegment_Out_Barrel, pt4to6, pt6to8, ptover8);
581 fill(m_group+"_"+chain, mon_distance_bw_FTFroad_and_offlinesegment_Inn_Endcap, pt4to6, pt6to8, ptover8);
582 fill(m_group+"_"+chain, mon_distance_bw_FTFroad_and_offlinesegment_Mid_Endcap, pt4to6, pt6to8, ptover8);
583 fill(m_group+"_"+chain, mon_distance_bw_FTFroad_and_offlinesegment_Out_Endcap, pt4to6, pt6to8, ptover8);
584 fill(m_group+"_"+chain, mon_res_Inn_Barrel);
585 fill(m_group+"_"+chain, mon_res_Mid_Barrel);
586 fill(m_group+"_"+chain, mon_res_Out_Barrel);
587 fill(m_group+"_"+chain, mon_res_Inn_Endcap);
588 fill(m_group+"_"+chain, mon_res_Mid_Endcap);
589 fill(m_group+"_"+chain, mon_res_Out_Endcap);
590 fill(m_group+"_"+chain, mon_distance_bw_MDT_and_offlinesegment_Inn_Barrel);
591 fill(m_group+"_"+chain, mon_distance_bw_MDT_and_offlinesegment_Mid_Barrel);
592 fill(m_group+"_"+chain, mon_distance_bw_MDT_and_offlinesegment_Out_Barrel);
593 fill(m_group+"_"+chain, mon_distance_bw_MDT_and_offlinesegment_Inn_Endcap);
594 fill(m_group+"_"+chain, mon_distance_bw_MDT_and_offlinesegment_Mid_Endcap);
595 fill(m_group+"_"+chain, mon_distance_bw_MDT_and_offlinesegment_Out_Endcap);
596 fill(m_group+"_"+chain, mon_MDT_N_Inn_Barrel);
597 fill(m_group+"_"+chain, mon_MDT_N_Mid_Barrel);
598 fill(m_group+"_"+chain, mon_MDT_N_Out_Barrel);
599 fill(m_group+"_"+chain, mon_MDT_N_Inn_Endcap);
600 fill(m_group+"_"+chain, mon_MDT_N_Mid_Endcap);
601 fill(m_group+"_"+chain, mon_MDT_N_Out_Endcap);
602 fill(m_group+"_"+chain, superpoint_multiplicity, regionBE, pt4to6, pt6to8, ptover8);
603 fill(m_group+"_"+chain, mon_L2Muon_chamberID_index, mon_superpoint_exist_pt4to6, mon_offlinesegment_exist_pt4to6);
604 fill(m_group+"_"+chain, mon_L2Muon_chamberID_index, mon_superpoint_exist_pt6to8, mon_offlinesegment_exist_pt6to8);
605 fill(m_group+"_"+chain, mon_L2Muon_chamberID_index, mon_superpoint_exist_ptover8, mon_offlinesegment_exist_ptover8);
606 }
607
608 return StatusCode::SUCCESS;
609}
610
611
612StatusCode L2MuonSAIOMon :: matchL2IO_wContainer(const EventContext &ctx, const std::string &chain, std::vector< const xAOD::L2CombinedMuon* > &Trig_L2IOobjects) const {
613
614 ATH_MSG_DEBUG ("matchL2IO_wContainer ..." );
615
616 // retrieve l2io objects
618
619 // retrieve l2SA objects
620 std::vector< TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> > featureCont;
621 if( chain.find("probe") != std::string::npos ){ // if tag & probe chain, retrieve probe L2SA objects
622 int legIndex_probe = 1; // probe
623 featureCont = getTrigDecisionTool()->features<xAOD::L2StandAloneMuonContainer>( chain,
625 "HLT_MuonL2SAInfo",
628 legIndex_probe );
629 }
630 else{
631 featureCont = getTrigDecisionTool()->features<xAOD::L2StandAloneMuonContainer>( chain,
633 "HLT_MuonL2SAInfo" );
634 }
635
636 // match l2io objects to l2sa objects using roiWord
637 std::vector< const xAOD::L2CombinedMuon* > matchSA_L2IOobjects;
638 for(const auto L2IOobject : *L2IOobjects){
639 ATH_MSG_DEBUG(" L2IOobject->muSATrack()->roiWord()/L2IOobject->pt(): " << L2IOobject->muSATrack()->roiWord() << "/" << L2IOobject->pt() );
640 for(const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer>& L2SALinkInfo : featureCont){
641 ATH_CHECK( L2SALinkInfo.isValid() );
642 const ElementLink<xAOD::L2StandAloneMuonContainer> L2SAobject = L2SALinkInfo.link;
643 if( !L2SAobject.isValid() ) continue;
644 ATH_MSG_DEBUG(" L2SAobject->roiWord()/L2SALinkInfo.state: " << (*L2SAobject)->roiWord() << "/" << L2SALinkInfo.state );
645
646 if( L2IOobject->muSATrack()->roiWord() != (*L2SAobject)->roiWord() ) continue;
647 if( L2SALinkInfo.state != TrigCompositeUtils::ActiveState::ACTIVE ){
648 break;
649 }else{
650 matchSA_L2IOobjects.push_back(L2IOobject);
651 ATH_MSG_DEBUG(" matchSA_L2IOobject->muSATrack()->roiWord()/matchSA_L2IOobject->pt(): " << L2IOobject->muSATrack()->roiWord() << "/" << L2IOobject->pt() );
652 break;
653 }
654 }
655 }
656 ATH_MSG_DEBUG(" matchSA_L2IOobjects.size(): " << matchSA_L2IOobjects.size() );
657
658 const size_t num_matchSAMuon = matchSA_L2IOobjects.size();
659 if( num_matchSAMuon == 0 ){
660 ATH_MSG_DEBUG(" NO matchSA_L2IOobjects ");
661 return StatusCode::SUCCESS;
662 }
663
664 std::vector< bool > isoverlap( num_matchSAMuon, false );
665 std::vector< bool > passOR( num_matchSAMuon, true );
666
667 // L2CBOverlapRemover
668 ATH_CHECK( L2OverlapRemover( matchSA_L2IOobjects, isoverlap, passOR ) );
669 for(unsigned int i=0; i<num_matchSAMuon; i++) { // push back trig Inside-Out objects passing L2CBOverlapRemover
670 if( isoverlap[i] && !passOR[i] ) continue;
671 Trig_L2IOobjects.push_back(matchSA_L2IOobjects.at(i));
672 }
673
674 return StatusCode::SUCCESS;
675}
676
677
678StatusCode L2MuonSAIOMon :: L2OverlapRemover( const std::vector< const xAOD::L2CombinedMuon* >& matchSA_L2IOobjects, std::vector< bool > &isoverlap, std::vector< bool > &passOR ) const {
679
680 ATH_MSG_DEBUG ("L2OverlapRemover ..." );
681
682 const size_t numMuon = matchSA_L2IOobjects.size();
683 bool errorWhenIdentifyingOverlap = false;
684
685 if(numMuon > 1){
686 std::vector<unsigned int> mucombResult;
687 //unsigned int i,j;
688 for(unsigned int i=0; i<numMuon; i++) {mucombResult.emplace_back(i); }
689 for(unsigned int i=0; i<numMuon-1; i++){
690 for(unsigned int j=i+1; j<numMuon; j++){
691 ATH_MSG_DEBUG("++ i=" << i << " vs j=" << j);
692 bool overlapped = isOverlap(matchSA_L2IOobjects.at(i), matchSA_L2IOobjects.at(j));
693 ATH_MSG_DEBUG("matchSA_L2IOobjects: i/j/Overlap = " << i << "/" << j << "/" << overlapped );
694 if( ! overlapped ){ // judged as different
695 ATH_MSG_DEBUG(" judged as: differenr objects");
696 if( mucombResult[i] == mucombResult[j] ) { // but marked as same by someone
697 ATH_MSG_DEBUG( "inconsistentency in muComb overlap removal for more than two objects" );
698 ATH_MSG_DEBUG( "two objects are judged as different but both were already marked as identical by someone else as: " );
699 ATH_MSG_DEBUG( "i/j/result[i]/result[j]=" << i << " / " << j << " / " << mucombResult[i] << " / " << mucombResult[j] );
700 errorWhenIdentifyingOverlap = true;
701 }
702 }
703 else{ // judged as overlap
704 if( (mucombResult[j] != j && mucombResult[i] != mucombResult[j]) || (mucombResult[j] == j && mucombResult[i] != i) ){
705 ATH_MSG_DEBUG( "inconsistentency in muComb based overlap removal for more than two objects" );
706 ATH_MSG_DEBUG( "two objects are judged as overlap but only either was already marked as overlap to someone else: " );
707 ATH_MSG_DEBUG( "i/j/result[i]/result[j]=" << i << " / " << j << " / " << mucombResult[i] << " / " << mucombResult[j] );
708 errorWhenIdentifyingOverlap = true;
709 }
710 ATH_MSG_DEBUG(" judged as: overlapped objects");
711 if( mucombResult[i] == i ) {
712 ATH_MSG_DEBUG( " i is not yet marked as overlap. so, it is a newly found overlap" );
713 ATH_MSG_DEBUG( " -> marking mucombResult[j] as i..." );
714 mucombResult[j] = i;
715 isoverlap[i] = true;
716 isoverlap[j] = true;
717 } else {
718 ATH_MSG_DEBUG( " both i/j already marked as overlap by: mucombResult[i]=" << mucombResult[i] );
719 ATH_MSG_DEBUG( " -> do nothing..." );
720 }
721 }
722 }
723 }
724
725
726 if( errorWhenIdentifyingOverlap ) {
727 ATH_MSG_WARNING( "error when resolving overlap. exitting with all EVs active..." );
728 } else {
729
730 unsigned int n_uniqueMuon = 0;
731 for(unsigned int i=0; i<numMuon; i++) {
732 ATH_MSG_DEBUG( "muComb based results: i=" << i << ": ");
733 if( mucombResult[i] != i ) {
734 ATH_MSG_DEBUG( " overlap to j=" << mucombResult[i] );
735 } else {
736 n_uniqueMuon++;
737 ATH_MSG_DEBUG( " unique" );
738 }
739 }
740
741 ATH_MSG_DEBUG( "nr of unique Muons after muComb-based removal=" << n_uniqueMuon );
742
743 if( numMuon != n_uniqueMuon ){
744 ATH_CHECK( chooseBestMuon(matchSA_L2IOobjects, passOR, mucombResult) );
745 } else {
746 ATH_MSG_DEBUG( "no overlap identified. exitting with all EventViews active" );
747 }
748 }
749 }
750
751 return StatusCode::SUCCESS;
752}
753
754
755bool L2MuonSAIOMon :: isOverlap( const xAOD::L2CombinedMuon* matchSA_L2IOobject1, const xAOD::L2CombinedMuon* matchSA_L2IOobject2 ) const {
756
757 ATH_MSG_DEBUG( " ...matchSA_L2IOobject1: pt/eta/phi=" << matchSA_L2IOobject1->pt()/Gaudi::Units::GeV << " / " << matchSA_L2IOobject1->eta() << " / " << matchSA_L2IOobject1->phi() );
758 ATH_MSG_DEBUG( " ...matchSA_L2IOobject2: pt/eta/phi=" << matchSA_L2IOobject2->pt()/Gaudi::Units::GeV << " / " << matchSA_L2IOobject2->eta() << " / " << matchSA_L2IOobject2->phi() );
759
760 const auto [mu1Pt, mu1Eta, mu1Phi] = L2ORPosForMatchFunc(matchSA_L2IOobject1);
761 const auto [mu2Pt, mu2Eta, mu2Phi] = L2ORPosForMatchFunc(matchSA_L2IOobject2);
762
763 // if dR or invMass is necessary but (eta,phi) info is not avaiable
764 // (i.e. eta,phi=0,0; rec failed)
765 const double ZERO_LIMIT_FOR_ETAPHI = 1e-4;
766 if( (std::abs(matchSA_L2IOobject1->eta()) <ZERO_LIMIT_FOR_ETAPHI && std::abs(matchSA_L2IOobject1->phi()) < ZERO_LIMIT_FOR_ETAPHI) ||
767 (std::abs(matchSA_L2IOobject2->eta()) <ZERO_LIMIT_FOR_ETAPHI && std::abs(matchSA_L2IOobject2->phi()) < ZERO_LIMIT_FOR_ETAPHI) ) {
768 ATH_MSG_DEBUG( " ...-> (eta,phi) info not available (rec at (eta,phi)=(0,0))" );
769 if( m_RequireDR || m_RequireMass ) {
770 ATH_MSG_DEBUG( " ...-> but dR of invMass check is required. cannot judge overlap -> return with false" );
771 return false;
772 }
773 }
774
775 // if charge or invMass is necessary but charge(=pT) info is not avaiable
776 const double ZERO_LIMIT_FOR_PT = 1e-4;
777 if( (std::abs(matchSA_L2IOobject1->pt()) <ZERO_LIMIT_FOR_PT) || (std::abs(matchSA_L2IOobject2->pt()) < ZERO_LIMIT_FOR_PT) ) {
778 ATH_MSG_DEBUG( " ...-> pT info not available (rec at pT=0)" );
780 ATH_MSG_DEBUG( " ...-> but same sign or invMass check is required. cannot judge overlap -> return with false" );
781 return false;
782 }
783 }
784
785
786 double absEta = (std::abs(mu1Pt) > std::abs(mu2Pt)) ? std::abs(mu1Eta) : std::abs(mu2Eta);
787 unsigned int iThres=0;
788 for(unsigned int i=0; i<(m_etaBins.size()-1); i++) {
789 if ( m_etaBins[i] <= absEta && absEta < m_etaBins[i+1] ) iThres = i;
790 }
791 float dRThres = m_dRCBThres[iThres];
792 float dRbySAThres = m_dRbySAThres[iThres];
793 float massThres = m_massCBThres[iThres];
794 ATH_MSG_DEBUG( " ...iThres=" << iThres );
795 if(m_RequireDR) ATH_MSG_DEBUG( " ...dR threshold=" << dRThres );
796 if(m_RequireDRbySA) ATH_MSG_DEBUG( " ...dR(byMF) threshold=" << dRbySAThres );
797 if(m_RequireMass) ATH_MSG_DEBUG( " ...mass threshold=" << massThres );
798
799
800
801 // same sign cut
802 bool sameSign = false;
803 if( m_RequireSameSign ) {
804 sameSign = ((mu1Pt*mu2Pt) > 0);
805 ATH_MSG_DEBUG( " ...-> sameSign=" << sameSign );
806 }
807
808 // dR cut
809 bool dRisClose = false;
810 float deta = mu1Eta - mu2Eta;
811 float dphi = xAOD::P4Helpers::deltaPhi(mu1Phi, mu2Phi);
812 float dR = std::sqrt(deta*deta + dphi*dphi);
813 if( m_RequireDR ) {
814 if( dR < dRThres ) dRisClose = true;
815 ATH_MSG_DEBUG( " ...-> dR=" << dR << " : dRisClose=" << dRisClose );
816 }
817
818 // dR(by L2SA) cut
819 bool dRbySAisClose = false;
820 const xAOD::L2StandAloneMuon* muSA1 = matchSA_L2IOobject1->muSATrack();
821 const xAOD::L2StandAloneMuon* muSA2 = matchSA_L2IOobject2->muSATrack();
822 if( m_RequireDRbySA ) {
823 // here, we do not check (eta,phi) of mF is not (0,0)
824 // (i.e. we apply muComb based cut even if muFast rec is failed)
825 float deta = muSA1->etaMS() - muSA2->etaMS();
826 float dphi = xAOD::P4Helpers::deltaPhi(muSA1->phiMS(), muSA2->phiMS());
827 float dRBySA = std::sqrt(deta*deta + dphi*dphi);
828 if( dRBySA < dRbySAThres ) dRbySAisClose = true;
829 ATH_MSG_DEBUG( " ...-> dR(by MF)=" << dRBySA << " : dRbySAisClose=" << dRbySAisClose );
830 }
831
832 // mass cut
833 const double TRACK_MASS = 0.; // just assume zero mass
834 bool massIsClose = false;
835 TLorentzVector lvioobj1, lvioobj2;
836 lvioobj1.SetPtEtaPhiM(std::abs(mu1Pt), mu1Eta, mu1Phi, TRACK_MASS);
837 lvioobj2.SetPtEtaPhiM(std::abs(mu2Pt), mu2Eta, mu2Phi, TRACK_MASS);
838 TLorentzVector lvsum = lvioobj1 + lvioobj2;
839 float invMass = lvsum.M();
840 if( m_RequireMass ) {
841 if( invMass < massThres ) massIsClose = true;
842 ATH_MSG_DEBUG( " ...-> invMass=" << invMass << " : massIsClose=" << massIsClose );
843 }
844
845
846 // total judge
847 bool overlap = false;
848 if( ((m_RequireSameSign && sameSign) || (! m_RequireSameSign)) &&
849 ((m_RequireDR && dRisClose) || (! m_RequireDR)) &&
850 ((m_RequireDRbySA && dRbySAisClose) || (! m_RequireDRbySA)) &&
851 ((m_RequireMass && massIsClose) || (! m_RequireMass)) ) {
852 overlap = true;
853 }
854 ATH_MSG_DEBUG( " ...=> isOverlap=" << overlap );
855
856 return overlap;
857}
858
859
860StatusCode L2MuonSAIOMon :: chooseBestMuon( const std::vector< const xAOD::L2CombinedMuon* >& matchSA_L2IOobjects, std::vector< bool > &passOR, std::vector< unsigned int > &mucombResult ) const{
861
862 const double ZERO_LIMIT = 1e-4;
863 unsigned int i,j,k;
864
865 ATH_MSG_DEBUG( "--- choose best among overlaps & disable EVs (muComb based) ---" );
866 for(i=0; i<matchSA_L2IOobjects.size(); i++) {
867 ATH_MSG_DEBUG( "++ i=" << i << ": result=" << mucombResult[i] );
868 if( mucombResult[i] != i ) {
869 ATH_MSG_DEBUG( " overlap to some one. skip." );
870 continue;
871 }
872 std::vector<unsigned int> others;
873 for(j=0; j<matchSA_L2IOobjects.size(); j++) {
874 if( mucombResult[j] == mucombResult[i] ) others.emplace_back(j);
875 }
876 if( others.size() == 1 ) {
877 ATH_MSG_DEBUG( " unique object. keep it active." );
878 continue;
879 }
880 else { // must choose one best
881 ATH_MSG_DEBUG( " overlapped objects among: " << others );
882 unsigned int bestMuon = 0;
883 float maxPtCombMf = 0.;
884 float mindRRoadRoI = 999.;
885 for(k=0; k<others.size(); k++) {
886 j=others[k];
887
888 float ptCombMf = std::abs(matchSA_L2IOobjects.at(j)->pt()/1e3);
889
890 const float roadPhiP = std::atan2(matchSA_L2IOobjects.at(j)->muSATrack()->dirPhiMS(),1.);
891 const float roadPhiM = std::atan2(-1*matchSA_L2IOobjects.at(j)->muSATrack()->dirPhiMS(),-1.);
892 const float roadPhi = (std::abs(xAOD::P4Helpers::deltaPhi(roadPhiP, matchSA_L2IOobjects.at(j)->muSATrack()->roiPhi()))
893 < std::abs(xAOD::P4Helpers::deltaPhi(roadPhiM, matchSA_L2IOobjects.at(j)->muSATrack()->roiPhi())))? roadPhiP : roadPhiM;
894 float roadAw = 0.;
895 if(std::abs(matchSA_L2IOobjects.at(j)->muSATrack()->roiEta()) < 1.05) { // barrel
896 if( std::abs(matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(1,0)) > ZERO_LIMIT ) roadAw = matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(1,0);
897 else if( std::abs(matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(2,0)) > ZERO_LIMIT ) roadAw = matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(2,0);
898 else if( std::abs(matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(0,0)) > ZERO_LIMIT ) roadAw = matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(0,0);
899 }
900 else { // endcap
901 if( std::abs(matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(4,0)) > ZERO_LIMIT ) roadAw = matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(4,0);
902 else if( std::abs(matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(5,0)) > ZERO_LIMIT ) roadAw = matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(5,0);
903 else if( std::abs(matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(3,0)) > ZERO_LIMIT ) roadAw = matchSA_L2IOobjects.at(j)->muSATrack()->roadAw(3,0);
904 }
905 float roadEta = 999.;
906 if(std::abs(roadAw) > ZERO_LIMIT) roadEta = -std::log(std::tan(0.5*std::atan(std::abs(roadAw))));
907 if(roadAw < 0) roadEta *= -1.;
908 float detaRoadRoI = roadEta - matchSA_L2IOobjects.at(j)->muSATrack()->roiEta();
909 float dphiRoadRoI = xAOD::P4Helpers::deltaPhi(roadPhi, matchSA_L2IOobjects.at(j)->muSATrack()->roiPhi());
910 float dRRoadRoI = std::sqrt(detaRoadRoI*detaRoadRoI + dphiRoadRoI*dphiRoadRoI);
911 ATH_MSG_DEBUG(" j="<< j << " , ptCombMf=" << ptCombMf << ", dRRoadRoI=" << dRRoadRoI);
912
913
914 if( (ptCombMf > maxPtCombMf) ||
915 (std::abs(ptCombMf - maxPtCombMf) < ZERO_LIMIT &&
916 dRRoadRoI < mindRRoadRoI) ) {
917 maxPtCombMf = ptCombMf;
918 mindRRoadRoI = dRRoadRoI;
919 bestMuon = j;
920 }
921 }
922 ATH_MSG_DEBUG( " best is: bestMuon/maxPtCombMf=" << bestMuon << " / " << maxPtCombMf );
923
924 for(k=0; k<others.size(); k++) {
925 j=others[k];
926 if( j != bestMuon ) {
927 ATH_MSG_DEBUG( " EventView( j=" << j << " ) is not active" );
928
929 passOR.at(j) = false;
930 }
931 else{
932 ATH_MSG_DEBUG( " EventView( j=" << j << " ) is best one" );
933 }
934 }
935 }
936 }
937
938
939 return StatusCode::SUCCESS;
940}
941
942
943StatusCode L2MuonSAIOMon :: muCombHypo_TDTworkaround( const std::string &chain, const std::vector< const xAOD::L2CombinedMuon* >& Trig_L2IOobjects, std::vector< bool > &pass_muCombHypo ) const{
944
945
946 int requireMuonNum = 1;
947
948 int passHypo_MuonNum = 0;
949 for(auto &Trig_L2IOobject : Trig_L2IOobjects){
950 bool isPass_muCombHypo = false;
951 ATH_CHECK(isPassedmuCombHypo( chain, Trig_L2IOobject ,isPass_muCombHypo));
952 bool pass_muCombHypo_obj = isPass_muCombHypo;
953 pass_muCombHypo.push_back(pass_muCombHypo_obj);
954 if( pass_muCombHypo_obj ) passHypo_MuonNum++;
955 }
956
957 if( passHypo_MuonNum >= requireMuonNum ){
958 ATH_MSG_DEBUG("this evt passed muCombhypo");
959 }
960 return StatusCode::SUCCESS;
961}
962
963
964StatusCode L2MuonSAIOMon :: isPassedmuCombHypo( const std::string &chain, const xAOD::L2CombinedMuon* Trig_L2IOobject , bool &pass_muCombHypo) const{
965 pass_muCombHypo = false;
966
967 // config
968 std::vector< float > my_EtaBins = {0, 1.05, 1.5, 2.0, 9.9};
969 std::vector< float > my_muCombThres = {0., 0., 0., 0.};
970 bool my_pikCuts = true;
971 float my_maxPtToApplyPik = 25.;
972 float my_chi2MaxID = 3.5;
973 ATH_CHECK( decision_ptthreshold( chain, my_EtaBins, my_muCombThres, my_pikCuts, my_maxPtToApplyPik, my_chi2MaxID ) );
974 bool pikCut = true;
975 bool stdCut = true;
976
977 auto ptValue = Trig_L2IOobject->pt() * Trig_L2IOobject->charge()/1e3;
978 float fexPt = ptValue;
979 if(my_pikCuts && (std::abs(fexPt) < my_maxPtToApplyPik)){
980 if(Trig_L2IOobject->idTrack()->chiSquared() > my_chi2MaxID){
981 ATH_MSG_DEBUG("this obj failed at Kpi rejection:idTrack_chiSquared = " << Trig_L2IOobject->idTrack()->chiSquared() );
982 pikCut = false;
983 }
984 }
985
986 float absEta = std::abs(Trig_L2IOobject->eta());
987 unsigned int iThres = 0;
988 for(unsigned int i=0; i<(my_EtaBins.size()-1); i++) {
989 if ( my_EtaBins[i] <= absEta && absEta < my_EtaBins[i+1] ) iThres = i;
990 }
991 const float muCombThres = my_muCombThres[iThres];
992 if(Trig_L2IOobject->pt()/1e3 < muCombThres){
993 ATH_MSG_DEBUG("this obj failed at std Pt cut:muCombThres = " << muCombThres);
994 stdCut = false;
995 }
996
997 if(stdCut && pikCut){
998 ATH_MSG_DEBUG("this obj passed muCombhypo");
999 pass_muCombHypo = true;
1000 }
1001 return StatusCode::SUCCESS;
1002}
1003
1004
1005StatusCode L2MuonSAIOMon :: decision_ptthreshold( const std::string &chain, std::vector< float > &my_EtaBins, std::vector< float > &my_muCombThres,
1006 bool &my_pikCuts, float &my_maxPtToApplyPik, float &my_chi2MaxID ) const{
1007
1008 my_maxPtToApplyPik = 25.;
1009 my_chi2MaxID = 3.5;
1010 ATH_MSG_DEBUG("this chain is" << chain);
1011 if(chain == "HLT_mu4_l2io_L1MU3V"){
1012 my_EtaBins = {0, 1.05, 1.5, 2.0, 9.9}; //4GeV_v15a
1013 my_muCombThres = {3.86, 3.77, 3.69, 3.70}; //4GeV_v15a
1014 my_pikCuts = false;
1015 }else if(chain == "HLT_mu24_ivarmedium_mu6_l2io_probe_L1MU14FCH"){
1016 my_EtaBins = {0, 1.05, 1.5, 2.0, 9.9}; //6GeV_v15a
1017 my_muCombThres = {5.87, 5.79, 5.70, 5.62}; //6GeV_v15a
1018 my_pikCuts = false;
1019 }else if(chain == "HLT_mu24_ivarmedium_mu6_l2io_probe_L1MU18VFCH"){
1020 my_EtaBins = {0, 1.05, 1.5, 2.0, 9.9}; //6GeV_v15a
1021 my_muCombThres = {5.87, 5.79, 5.70, 5.62}; //6GeV_v15a
1022 my_pikCuts = false;
1023 }else{
1024 ATH_MSG_ERROR("muCombHypo config is NOT defined in this package:chain = " << chain);
1025 }
1026 return StatusCode::SUCCESS;
1027}
1028
1029
1030std::tuple<float,float,float> L2MuonSAIOMon :: L2ORPosForMatchFunc(const xAOD::L2StandAloneMuon *trig){
1031 return std::forward_as_tuple(trig->pt(), trig->etaMS(), trig->phiMS());
1032}
1033
1034
1035std::tuple<float,float,float> L2MuonSAIOMon :: L2ORPosForMatchFunc(const xAOD::L2CombinedMuon *trig){
1036 return std::forward_as_tuple( (trig->pt()/1e3 * trig->charge() ), trig->eta(), trig->phi());
1037}
1038
1039
1040const xAOD::L2CombinedMuon* L2MuonSAIOMon :: searchL2InsideOut( const EventContext &ctx, const xAOD::Muon *mu, const std::string& trig) const {
1041 ATH_MSG_DEBUG("MuonMonitoring::searchL2InsideOut()");
1042
1043 const xAOD::L2CombinedMuon* offlinematched_L2IOobject = nullptr;
1044
1045 //TDT workaround
1046 std::vector< const xAOD::L2CombinedMuon* > Trig_L2IOobjects;
1047 if( !matchL2IO_wContainer(ctx, trig, Trig_L2IOobjects).isSuccess() ) {
1048 ATH_MSG_WARNING("matchL2IO_wContainer failed, returning nullptr");
1049 return offlinematched_L2IOobject;
1050 }
1051 if( Trig_L2IOobjects.empty() ) {
1052 return offlinematched_L2IOobject;
1053 }
1054
1055 float reqdR = 1000.;
1056
1057 double offlEta = mu->eta();
1058 double offlPhi = mu->phi();
1059
1060 int loop_counter = 0;
1061 int match_index = 0;
1062 for(auto Trig_L2IOobject : Trig_L2IOobjects){
1063 double trigEta = Trig_L2IOobject->eta();
1064 double trigPhi = Trig_L2IOobject->phi();
1065 double deta = offlEta - trigEta;
1066 double dphi = xAOD::P4Helpers::deltaPhi(offlPhi, trigPhi);
1067 double dR = std::sqrt(deta*deta + dphi*dphi);
1068
1069 ATH_MSG_VERBOSE("Trigger muon candidate eta=" << trigEta << " phi=" << trigPhi << " pt=" << Trig_L2IOobject->pt() << " dR=" << dR);
1070 if( dR<reqdR ){
1071 reqdR = dR;
1072 match_index = loop_counter;
1073 ATH_MSG_DEBUG("* Trigger muon eta=" << trigEta << " phi=" << trigPhi << " pt=" << Trig_L2IOobject->pt() << " dR=" << dR );
1074 }
1075 loop_counter++;
1076 }
1077
1078 offlinematched_L2IOobject = Trig_L2IOobjects.at(match_index);
1079 return offlinematched_L2IOobject;
1080}
1081
1082
1083const xAOD::Muon* L2MuonSAIOMon :: searchTagOfflineMuon( const EventContext& ctx, const xAOD::Muon* probe ) const{
1084 ATH_MSG_DEBUG("MuonMonitoring::searchTagOfflineMuon()");
1085
1086 const double ZERO_LIMIT = 0.00001;
1087
1088 double Jpsimass = 3.0969;
1089 double Zmass = 91.1876;
1090 double my_Jpsimass_lowlim = 81.;
1091 double my_Jpsimass_highlim = 101.;
1092 double my_Zmass_lowlim = 2.7;
1093 double my_Zmass_highlim = 3.5;
1094
1095 const xAOD::Muon *tag = nullptr;
1096
1098 if (! muons.isValid() ) {
1099 ATH_MSG_ERROR("evtStore() does not contain muon Collection with name "<< m_MuonContainerKey);
1100 return tag;
1101 }
1102
1103 double mass_diff_min = 999.;
1104 double tpdR_min = 999.;
1105 bool tpfromZ = false;
1106 for( const xAOD::Muon* mu : *muons ){
1107 if( mu->muonType()>m_muontype ) continue;
1108 if( mu->quality() != xAOD::Muon::Medium && mu->quality() != xAOD::Muon::Tight ) continue;
1109 if( mu->charge()*probe->charge() > 0 ) continue;
1110 const ElementLink<xAOD::TrackParticleContainer> &tag_ms_track = mu->muonSpectrometerTrackParticleLink();
1111 if( !tag_ms_track.isValid() ) continue; // tag muon dosen't have ms track
1112 TLorentzVector lvmu = mu->p4();
1113 TLorentzVector lvprobe = probe->p4();
1114 double dimu_mass = (lvmu+lvprobe).M()/1.e3;
1115 double tpdR = lvmu.DeltaR(lvprobe);
1116 if( dimu_mass > my_Jpsimass_lowlim && dimu_mass < my_Jpsimass_highlim ){
1117 if( tpfromZ ) continue; // Z has higher priority than Jpsi
1118 double mass_diff = std::abs(dimu_mass - Jpsimass);
1119 if( mass_diff - mass_diff_min < -1.*ZERO_LIMIT ){
1120 mass_diff_min = mass_diff;
1121 tpdR_min =tpdR;
1122 tag = mu;
1123 }
1124 else if( std::abs(mass_diff - mass_diff_min) < ZERO_LIMIT){
1125 if( tpdR - tpdR_min < 0. ){
1126 mass_diff_min = mass_diff;
1127 tpdR_min = tpdR;
1128 tag = mu;
1129 }
1130 }
1131 }
1132 else if( dimu_mass > my_Zmass_lowlim && dimu_mass < my_Zmass_highlim ){
1133 tpfromZ = true;
1134 double mass_diff = std::abs(dimu_mass - Zmass);
1135 if( mass_diff - mass_diff_min < -1.*ZERO_LIMIT ){
1136 mass_diff_min = mass_diff;
1137 tpdR_min =tpdR;
1138 tag = mu;
1139 }
1140 else if( std::abs(mass_diff - mass_diff_min) < ZERO_LIMIT){
1141 if( tpdR - tpdR_min < 0. ){
1142 mass_diff_min = mass_diff;
1143 tpdR_min =tpdR;
1144 tag = mu;
1145 }
1146 }
1147 }
1148 }
1149
1150 return tag;
1151}
#define M_PI
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
std::pair< std::vector< unsigned int >, bool > res
const float ZERO_LIMIT
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
const xAOD::Muon * searchTagOfflineMuon(const EventContext &ctx, const xAOD::Muon *probe) const
StatusCode isPassedmuCombHypo(const std::string &chain, const xAOD::L2CombinedMuon *Trig_L2IOobjects, bool &pass_muCombHypo) const
StatusCode matchL2IO_wContainer(const EventContext &ctx, const std::string &chain, std::vector< const xAOD::L2CombinedMuon * > &Trig_L2IOobjects) const
Gaudi::Property< std::vector< float > > m_monitored_chains_plateau
std::map< std::string, double > m_plateaus
StatusCode L2OverlapRemover(const std::vector< const xAOD::L2CombinedMuon * > &matchSA_L2IOobjects, std::vector< bool > &isoverlap, std::vector< bool > &passOR) const
StatusCode decision_ptthreshold(const std::string &chain, std::vector< float > &my_EtaBins, std::vector< float > &my_muCombThres, bool &my_pikCuts, float &my_maxPtToApplyPik, float &my_chi2MaxID) const
StatusCode chooseBestMuon(const std::vector< const xAOD::L2CombinedMuon * > &matchSA_L2IOobjects, std::vector< bool > &passOR, std::vector< unsigned int > &mucombResult) const
bool isOverlap(const xAOD::L2CombinedMuon *matchSA_L2IOobject1, const xAOD::L2CombinedMuon *matchSA_L2IOobject2) const
SG::ReadHandleKey< xAOD::L2CombinedMuonContainer > m_L2MuonCBIOContainerKey
static std::tuple< float, float, float > L2ORPosForMatchFunc(const xAOD::L2StandAloneMuon *trig)
Gaudi::Property< std::vector< float > > m_etaBins
const xAOD::L2CombinedMuon * searchL2InsideOut(const EventContext &ctx, const xAOD::Muon *mu, const std::string &trigger) const
Gaudi::Property< std::vector< float > > m_massCBThres
Gaudi::Property< std::vector< float > > m_dRCBThres
Gaudi::Property< std::vector< float > > m_dRbySAThres
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Gaudi::Property< std::string > m_group
Name of monitored group.
TrigMuonMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Gaudi::Property< std::vector< std::string > > m_monitored_chains
List of trigger chains that are monitored in fillVariablesPerChain and fillVariablesPerOfflineMuonPer...
Gaudi::Property< int > m_muontype
Requirement for the offline muon type considered in analyses.
virtual StatusCode initialize() override
initialize
ToolHandle< MuonMatchingTool > m_matchTool
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
float charge() const
get seeding muon charge
virtual double pt() const
The transverse momentum ( ) of the particle.
const xAOD::TrackParticle * idTrack() const
Get the ID track as a bare pointer.
const xAOD::L2StandAloneMuon * muSATrack() const
Get the SA muon as a bare pointer.
int mdtHitChamber(unsigned int tube) const
float roadAw(int station, int sector) const
Slope.
float roadBw(int station, int sector) const
Intercept.
float mdtHitZ(unsigned int tube) const
float etaMS() const
Get the eta at muon spectrometer.
float phiMS() const
Get the phi at muon spectrometer.
float mdtHitResidual(unsigned int tube) const
int mdtHitIsOutlier(unsigned int tube) const
virtual double pt() const
The transverse momentum ( ) of the particle.
float mdtHitR(unsigned int tube) const
uint32_t nMdtHits() const
Get the online ID, offline ID, R, Z, redidual, time, space and sigma of each MDT tube.
uint32_t roiWord() const
Get the RoI ID of the seeding LVL1 muon.
float superPointR(int chamber) const
Get the measured radious of the muon in one particular super point.
float px() const
float y() const
Returns the x position.
float pz() const
Returns the pz.
float py() const
Returns the py.
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
float z() const
Returns the y position.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition Muon_v1.cxx:71
float charge() const
float chiSquared() const
Returns the of the overall track fit.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
constexpr int toInt(const EnumType enumVal)
bool isBarrel(const ChIndex index)
Returns true if the chamber index points to a barrel chamber.
@ ACTIVE
The link was still active for one-or-more of the HLT Chains requested in the TDT.
Definition ActiveState.h:20
const std::string & featureString()
static const unsigned int includeFailedDecisions
Run3 synonym of alsoDeactivateTEs.
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
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
L2CombinedMuon_v1 L2CombinedMuon
Define the latest version of the muon CB class.
L2StandAloneMuonContainer_v2 L2StandAloneMuonContainer
Define the latest version of the muon SA container.
Muon_v1 Muon
Reference the current persistent version:
L2StandAloneMuon_v2 L2StandAloneMuon
Define the latest version of the muon SA class.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
Definition LinkInfo.h:22
void fill(H5::Group &out_file, size_t iterations)