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