ATLAS Offline Software
MuFastSteering.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MuFastSteering.h"
9 #include "xAODTrigger/MuonRoI.h"
10 
11 #include "CxxUtils/phihelper.h"
15 
16 #include "GaudiKernel/IIncidentSvc.h"
18 
19 // --------------------------------------------------------------------------------
20 // --------------------------------------------------------------------------------
21 
22 MuFastSteering::MuFastSteering(const std::string& name, ISvcLocator* svc)
24  m_recMuonRoIUtils()
25 {
26 }
27 // --------------------------------------------------------------------------------
28 // --------------------------------------------------------------------------------
29 
31 {
32  // Locate DataPreparator
33  ATH_CHECK(m_dataPreparator.retrieve());
34 
35  // Locate PatternFinder
36  ATH_CHECK(m_patternFinder.retrieve());
37 
38  // Locate StationFitter
39  ATH_CHECK(m_stationFitter.retrieve());
40 
41  // Locate TrackFitter
42  ATH_CHECK(m_trackFitter.retrieve());
43 
44  // Locate TrackExtrapolator
45  ATH_CHECK(m_trackExtrapolator.retrieve());
46 
47  // BackExtrapolator services
49 
50  // CscSegmentMaker
51  ATH_CHECK(m_cscsegmaker.retrieve());
52 
53  // FtfRoadDefiner
54  ATH_CHECK(m_ftfRoadDefiner.retrieve());
55 
56  // Set service tools
57  m_trackExtrapolator->setExtrapolatorTool(&m_backExtrapolatorTool);
58  m_dataPreparator->setExtrapolatorTool(&m_backExtrapolatorTool);
59 
60  // set road width in case TGC/RPC readout failure
62 
63  m_dataPreparator->setRpcGeometry(m_use_rpc);
64 
65  // set the flag whether to use NSW or not
66  m_dataPreparator->setStgcGeometry(m_use_stgc);
67  m_dataPreparator->setMmGeometry(m_use_mm);
68 
69  m_dataPreparator->setRoIBasedDataAccess(m_use_RoIBasedDataAccess_MDT,
75 
76  // set data or MC flag
78 
81  ATH_CHECK(m_trackFitter->setMCFlag(m_use_mcLUT));
82  m_trackFitter -> setUseEIFromBarrel( m_use_endcapInnerFromBarrel );
83 
84  // DataHandles for AthenaMT
89  // for Inside-Out mode ---
92  // ----
93  ATH_CHECK(m_muFastContainerKey.initialize());
96 
98  if (not m_monTool.name().empty()) {
99  ATH_CHECK(m_monTool.retrieve());
100  }
101  ATH_MSG_DEBUG( "topoRoad = " << m_topoRoad);
102 
103  if (m_fill_FSIDRoI) {
104  ATH_MSG_INFO("will fill " << m_muIdContainerKey.key() << " in Full Scan mode. Please check if it's correct.");
105  }
106 
107  ATH_MSG_DEBUG("InsideOutMode: " << m_insideOut);
108  ATH_MSG_DEBUG("Multi-TrackMode: " << m_multiTrack << "/ run for endcap RoI -> " << m_doEndcapForl2mt);
109 
110  //
111  // Initialize the calibration streamer
112  //
113 
114  if (m_doCalStream) {
115  ATH_CHECK(m_jobOptionsSvc.retrieve());
116 
117  if (m_jobOptionsSvc->has("MuonHltCalibrationConfig.MuonCalBufferName")) {
118  if (m_calBufferName.fromString(m_jobOptionsSvc->get("MuonHltCalibrationConfig.MuonCalBufferName","")).isSuccess()) {
119  ATH_MSG_DEBUG("Set property " << m_calBufferName << " from MuonHltCalibrationConfig.MuonCalBufferName");
120  }
121  } else {
122  ATH_MSG_DEBUG("Could not parse MuonHltCalibrationConfig.MuonCalBufferName from JobOptionsSvc");
123  }
124  if (m_jobOptionsSvc->has("MuonHltCalibrationConfig.MuonCalBufferSize")) {
125  if (m_calBufferSize.fromString(m_jobOptionsSvc->get("MuonHltCalibrationConfig.MuonCalBufferSize","")).isSuccess()) {
126  ATH_MSG_DEBUG("Set property " << m_calBufferSize << " from MuonHltCalibrationConfig.MuonCalBufferSize");
127  }
128  }
129  else {
130  ATH_MSG_DEBUG("Could not parse MuonHltCalibrationConfig.MuonCalBufferSize from JobOptionsSvc");
131  }
132 
133  // retrieve the calibration streamer
134  ATH_CHECK(m_calStreamer.retrieve());
135  // set properties
136  m_calStreamer->setBufferName(m_calBufferName);
137  ATH_MSG_DEBUG("Initialized the Muon Calibration Streamer. Buffer name: " << m_calBufferName
138  << ", buffer size: " << m_calBufferSize
139  << " doDataScouting: " << m_calDataScouting);
140 
141 
142  ATH_CHECK(m_incidentSvc.retrieve());
144  }
145 
146 
147  return StatusCode::SUCCESS;
148 }
149 
151 {
152  // close the calibration stream
153  if ( m_doCalStream ) {
154  if (m_calStreamer->isStreamOpen()){
155  StatusCode sc = m_calStreamer->closeStream();
156  if ( sc != StatusCode::SUCCESS ) {
157  ATH_MSG_ERROR("Failed to close the calibration stream");}
158  else {
159  ATH_MSG_INFO("Calibration stream closed");
160  }
161  }
162  }
163  return StatusCode::SUCCESS;
164 }
165 
166 
167 
168 void MuFastSteering::handle(const Incident& incident) {
169 
170 
171  if (incident.type() == AthenaInterprocess::UpdateAfterFork::type() && m_doCalStream) {
172  ATH_MSG_DEBUG("+-----------------------------------+");
173  ATH_MSG_DEBUG("| handle for UpdateAfterFork called |");
174  ATH_MSG_DEBUG("+-----------------------------------+");
175  const AthenaInterprocess::UpdateAfterFork& updinc = dynamic_cast<const AthenaInterprocess::UpdateAfterFork&>(incident);
176 
177  ATH_MSG_DEBUG(" MuonCalBufferName = " << m_calBufferName);
178  ATH_MSG_DEBUG(" MuonCalBufferSize = " << m_calBufferSize);
179  ATH_MSG_DEBUG(" MuonCalBufferWId = " << updinc.workerID());
180  ATH_MSG_DEBUG("=================================================");
181 
182 
183  std::string worker_name=std::to_string(updinc.workerID());
184  //
185  // Create the calibration stream
186 
187  m_calStreamer->setInstanceName(worker_name);
188 
189  //open the stream
190  if ( m_calStreamer->openStream(m_calBufferSize).isSuccess() ) {
191  ATH_MSG_INFO("Opened the connection to the circular buffer " << m_calBufferName.value());
192  } else {
193  ATH_MSG_ERROR("Failed to open the connection to the circular buffer " << m_calBufferName.value());
194  }
195  }
196 }
197 
198 
199 
200 
201 // --------------------------------------------------------------------------------
202 // --------------------------------------------------------------------------------
203 
205  const DataVector<LVL1::RecMuonRoI>& collection )
206 {
207  for ( auto recRoI: collection ) {
208  if ( recRoI->roiWord() == roiWord ){
209  return recRoI;
210  }
211  }
212  return nullptr;
213 }
214 
215 // --------------------------------------------------------------------------------
216 // --------------------------------------------------------------------------------
217 
219  const xAOD::MuonRoIContainer& collection )
220 {
221  for ( auto recRoI: collection ) {
222  if ( recRoI->roiWord() == roiWord ){
223  return recRoI;
224  }
225  }
226  return nullptr;
227 }
228 
229 // --------------------------------------------------------------------------------
230 // --------------------------------------------------------------------------------
231 
232 StatusCode MuFastSteering::execute(const EventContext& ctx) const
233 {
234  auto totalTimer = Monitored::Timer( "TIME_Total" );
235  auto monitorIt = Monitored::Group(m_monTool, totalTimer );
236 
237  // retrieve with ReadHandle
238  auto roiCollectionHandle = SG::makeHandle( m_roiCollectionKey, ctx );
239  const TrigRoiDescriptorCollection *roiCollection = roiCollectionHandle.cptr();
240  if (!roiCollectionHandle.isValid()){
241  ATH_MSG_ERROR("ReadHandle for TrigRoiDescriptorCollection key:" << m_roiCollectionKey.key() << " isn't Valid");
242  return StatusCode::FAILURE;
243  }
244 
245  if(m_useRun3Config) {
246 
247  auto recRoiCollectionHandle = SG::makeHandle( m_recRoiCollectionKey, ctx );
248  const xAOD::MuonRoIContainer *recRoiCollection = recRoiCollectionHandle.cptr();
249  if (!recRoiCollectionHandle.isValid()){
250  ATH_MSG_ERROR("ReadHandle for xAOD::MuonRoIContainer key:" << m_recRoiCollectionKey.key() << " isn't Valid");
251  return StatusCode::FAILURE;
252  }
253 
254  std::vector< const TrigRoiDescriptor* > internalRoI;
255  TrigRoiDescriptorCollection::const_iterator p_roids = roiCollection->begin();
256  TrigRoiDescriptorCollection::const_iterator p_roidsEn = roiCollection->end();
257 
258  for(; p_roids != p_roidsEn; ++p_roids ) {
259  internalRoI.push_back(*p_roids);
260  ATH_MSG_DEBUG("REGTEST: " << m_roiCollectionKey.key() << " eta = " << "(" << (*p_roids)->etaMinus() << ")" << (*p_roids)->eta() << "(" << (*p_roids)->etaPlus() << ")");
261  ATH_MSG_DEBUG("REGTEST: " << m_roiCollectionKey.key() << " phi = " << "(" << (*p_roids)->phiMinus() << ")" << (*p_roids)->phi() << "(" << (*p_roids)->phiPlus() << ")");
262  ATH_MSG_DEBUG("REGTEST: " << m_roiCollectionKey.key() << " zed = " << "(" << (*p_roids)->zedMinus() << ")" << (*p_roids)->zed() << "(" << (*p_roids)->zedPlus() << ")");
263  }
264  ATH_MSG_DEBUG("REGTEST: " << m_roiCollectionKey.key() << " size = " << internalRoI.size());
265 
266  // make RecMURoIs maching with MURoIs
267  std::vector< const xAOD::MuonRoI* > recRoIVector;
268  std::vector< const xAOD::MuonRoI* > surrRoIs;
269 
270  for (size_t size=0; size<roiCollection->size(); size++){
271  const xAOD::MuonRoI* recRoI = matchingRecRoI( roiCollection->at(size)->roiWord(), *recRoiCollection );
272  if( recRoI == nullptr ) continue;
273  recRoIVector.push_back(recRoI);
274  ATH_MSG_DEBUG("REGTEST: " << m_recRoiCollectionKey.key() << " eta/phi = " << (recRoI)->eta() << "/" << (recRoI)->phi());
275  ATH_MSG_DEBUG("REGTEST: " << m_recRoiCollectionKey.key() << " size = " << recRoIVector.size());
276  }
277 
278  bool dynamicDeltaRpc = false;
279  int nPassedBarrelSurrRoi = 0;
280  if(m_topoRoad ){
281  for( const auto recRoI: *recRoiCollection ){
282  if(std::find(recRoIVector.begin(), recRoIVector.end(), recRoI) != recRoIVector.end()) continue;
283 
284  bool surrounding = false;
285  for( const auto matchedRoI: recRoIVector ){
286  float deta = std::abs(recRoI->eta() - matchedRoI->eta());
287  float dphi = std::abs(recRoI->phi() - matchedRoI->phi());
288  if( dphi > M_PI )dphi = 2.*M_PI - dphi;
289  if( deta < m_dEtasurrRoI && dphi < m_dPhisurrRoI)
290  surrounding = true;
291  }
292 
293  if(surrounding)
294  surrRoIs.push_back(recRoI);
295  }
296 
297  ATH_MSG_DEBUG("surrRoI: " << " size = " << surrRoIs.size());
298  for( const auto recRoI: surrRoIs ){
299  ATH_MSG_DEBUG("surrRoI: " << " eta/phi = " << (recRoI)->eta() << "/" << (recRoI)->phi() );
300  if( std::abs((recRoI)->eta()) <= 1.05 && (recRoI)->getThrNumber() >= 1 )nPassedBarrelSurrRoi++;
301  }
302  ATH_MSG_DEBUG( "nPassedBarrelSurrRoi = " << nPassedBarrelSurrRoi);
303  //dynamicDeltaRpcMode
304  if( nPassedBarrelSurrRoi >= 1 )
305  dynamicDeltaRpc = true;
306  }
307 
308  // record data objects with WriteHandle
309  auto muFastContainer = SG::makeHandle(m_muFastContainerKey, ctx);
310  ATH_CHECK(muFastContainer.record(std::make_unique<xAOD::L2StandAloneMuonContainer>(), std::make_unique<xAOD::L2StandAloneMuonAuxContainer>()));
311 
312  auto muCompositeContainer = SG::makeHandle(m_muCompositeContainerKey, ctx);
313  ATH_CHECK(muCompositeContainer.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()));
314 
315  auto muIdContainer = SG::makeHandle(m_muIdContainerKey, ctx);
316  ATH_CHECK(muIdContainer.record(std::make_unique<TrigRoiDescriptorCollection>()));
317 
318  auto muMsContainer = SG::makeHandle(m_muMsContainerKey, ctx);
319  ATH_CHECK(muMsContainer.record(std::make_unique<TrigRoiDescriptorCollection>()));
320 
321 
322  // Inside-out L2Muon mode
323  if(m_insideOut) {
324  ATH_MSG_DEBUG("start inside-out mode...");
325 
326  auto muonCBColl = SG::makeHandle (m_outputCBmuonCollKey, ctx);
327  ATH_CHECK( muonCBColl.record (std::make_unique<xAOD::L2CombinedMuonContainer>(),
328  std::make_unique<xAOD::L2CombinedMuonAuxContainer>()) );
329 
330  auto trackHandle = SG::makeHandle( m_FTFtrackKey, ctx );
331  if (!trackHandle.isValid()){
332  ATH_MSG_ERROR("ReadHandle for TrackParticleContainer key:" << m_FTFtrackKey.key() << " isn't Valid");
333  return StatusCode::FAILURE;
334  }
335  const xAOD::TrackParticleContainer *tracks = trackHandle.cptr();
336 
337  ATH_CHECK(findMuonSignatureIO(*tracks, internalRoI, recRoIVector,
338  *muonCBColl, *muFastContainer, dynamicDeltaRpc, ctx ));
339 
340  if (msgLvl(MSG::DEBUG)) {
341  ATH_MSG_DEBUG("REGTEST: xAOD::L2CombinedMuonContainer key:" << m_outputCBmuonCollKey.key() << " size = " << muonCBColl->size());
342  for (const auto p_CBmuon : *muonCBColl){
343  ATH_MSG_DEBUG("REGTEST: xAOD::L2CombinedMuonContainer key:" << m_outputCBmuonCollKey.key() << " pt = " << (*p_CBmuon).pt() << " GeV");
344  ATH_MSG_DEBUG("REGTEST: xAOD::L2CombinedMuonContainer key:" << m_outputCBmuonCollKey.key() << " eta/phi = " << (*p_CBmuon).eta() << "/" << (*p_CBmuon).phi());
345  }
346  }
347 
348  }
349  else if(m_multiTrack){ //multi-track SA mode
350  ATH_MSG_DEBUG("start multi-track SA mode...");
351  ATH_CHECK(findMultiTrackSignature(internalRoI, recRoIVector, *muFastContainer, dynamicDeltaRpc, ctx));
352  }
353  else {
354  // to StatusCode findMuonSignature()
355  ATH_CHECK(findMuonSignature(internalRoI, recRoIVector,
356  *muFastContainer, *muIdContainer, *muMsContainer, dynamicDeltaRpc, ctx));
357  }
358 
359  if (msgLvl(MSG::DEBUG)) {
360  // DEBUG TEST: Recorded data objects
361  ATH_MSG_DEBUG("Recorded data objects");
362  ATH_MSG_DEBUG("REGTEST: xAOD::L2StandAloneMuonContainer key:" << m_muFastContainerKey.key() << " size = " << muFastContainer->size());
363 
364  for (auto p_muon : *muFastContainer) {
365  ATH_MSG_DEBUG("REGTEST: xAOD::L2StandAloneMuonContainer key:" << m_muFastContainerKey.key() << " pt = " << (*p_muon).pt() << " GeV");
366  ATH_MSG_DEBUG("REGTEST: xAOD::L2StandAloneMuonContainer key:" << m_muFastContainerKey.key() << " eta/phi = " << (*p_muon).eta() << "/" << (*p_muon).phi());
367  }
368 
369  ATH_MSG_DEBUG("REGTEST: TrigRoiDescriptorCollection key:" << m_muIdContainerKey.key() << " size = " << muIdContainer->size());
370  for (auto p_muonID : *muIdContainer) {
371  ATH_MSG_DEBUG("REGTEST: TrigRoiDescriptorCollection key:" << m_muIdContainerKey.key() << " eta/phi = " << (*p_muonID).eta() << "/" << (*p_muonID).phi());
372  }
373 
374  ATH_MSG_DEBUG("REGTEST: TrigRoiDescriptorCollection key:" << m_muMsContainerKey.key() << " size = " << muMsContainer->size());
375  for (auto p_muonMS : *muMsContainer) {
376  ATH_MSG_DEBUG("REGTEST: TrigRoiDescriptorCollection key:" << m_muMsContainerKey.key() << " eta/phi = " << (*p_muonMS).eta() << "/" << (*p_muonMS).phi());
377  }
378  }
379 
380  }
381  else { // use Run2 L1Muon EDM
382 
383  auto recRoiCollectionHandle = SG::makeHandle( m_run2recRoiCollectionKey, ctx );
384  const DataVector<LVL1::RecMuonRoI> *recRoiCollection = recRoiCollectionHandle.cptr();
385  if (!recRoiCollectionHandle.isValid()){
386  ATH_MSG_ERROR("ReadHandle for DataVector<LVL1::RecMuonRoI> key:" << m_run2recRoiCollectionKey.key() << " isn't Valid");
387  return StatusCode::FAILURE;
388  }
389 
390  std::vector< const TrigRoiDescriptor* > internalRoI;
391  TrigRoiDescriptorCollection::const_iterator p_roids = roiCollection->begin();
392  TrigRoiDescriptorCollection::const_iterator p_roidsEn = roiCollection->end();
393 
394  for(; p_roids != p_roidsEn; ++p_roids ) {
395  internalRoI.push_back(*p_roids);
396  ATH_MSG_DEBUG("REGTEST: " << m_roiCollectionKey.key() << " eta = " << "(" << (*p_roids)->etaMinus() << ")" << (*p_roids)->eta() << "(" << (*p_roids)->etaPlus() << ")");
397  ATH_MSG_DEBUG("REGTEST: " << m_roiCollectionKey.key() << " phi = " << "(" << (*p_roids)->phiMinus() << ")" << (*p_roids)->phi() << "(" << (*p_roids)->phiPlus() << ")");
398  ATH_MSG_DEBUG("REGTEST: " << m_roiCollectionKey.key() << " zed = " << "(" << (*p_roids)->zedMinus() << ")" << (*p_roids)->zed() << "(" << (*p_roids)->zedPlus() << ")");
399  }
400  ATH_MSG_DEBUG("REGTEST: " << m_roiCollectionKey.key() << " size = " << internalRoI.size());
401 
402  // make RecMURoIs maching with MURoIs
403  std::vector< const LVL1::RecMuonRoI* > recRoIVector;
404  std::vector< const LVL1::RecMuonRoI* > surrRoIs;
405 
406  for (size_t size=0; size<roiCollection->size(); size++){
407  const LVL1::RecMuonRoI* recRoI = matchingRecRoI( roiCollection->at(size)->roiWord(), *recRoiCollection );
408  if( recRoI == nullptr ) continue;
409  recRoIVector.push_back(recRoI);
410  ATH_MSG_DEBUG("REGTEST: " << m_recRoiCollectionKey.key() << " eta/phi = " << (recRoI)->eta() << "/" << (recRoI)->phi());
411  ATH_MSG_DEBUG("REGTEST: " << m_recRoiCollectionKey.key() << " size = " << recRoIVector.size());
412  }
413 
414  bool dynamicDeltaRpc = false;
415  int nPassedBarrelSurrRoi = 0;
416  if(m_topoRoad ){
417  for( const auto recRoI: *recRoiCollection ){
418  if(std::find(recRoIVector.begin(), recRoIVector.end(), recRoI) != recRoIVector.end()) continue;
419 
420  bool surrounding = false;
421  for( const auto matchedRoI: recRoIVector ){
422  float deta = std::abs(recRoI->eta() - matchedRoI->eta());
423  float dphi = std::abs(recRoI->phi() - matchedRoI->phi());
424  if( dphi > M_PI )dphi = 2.*M_PI - dphi;
425  if( deta < m_dEtasurrRoI && dphi < m_dPhisurrRoI)
426  surrounding = true;
427  }
428 
429  if(surrounding)
430  surrRoIs.push_back(recRoI);
431  }
432 
433  ATH_MSG_DEBUG("surrRoI: " << " size = " << surrRoIs.size());
434  for( const auto recRoI: surrRoIs ){
435  ATH_MSG_DEBUG("surrRoI: " << " eta/phi = " << (recRoI)->eta() << "/" << (recRoI)->phi() );
436  if( std::abs((recRoI)->eta()) <= 1.05 && (recRoI)->getThresholdNumber() >= 1 )nPassedBarrelSurrRoi++;
437  }
438  ATH_MSG_DEBUG( "nPassedBarrelSurrRoi = " << nPassedBarrelSurrRoi);
439  //dynamicDeltaRpcMode
440  if( nPassedBarrelSurrRoi >= 1 )
441  dynamicDeltaRpc = true;
442  }
443 
444  // record data objects with WriteHandle
445  auto muFastContainer = SG::makeHandle(m_muFastContainerKey, ctx);
446  ATH_CHECK(muFastContainer.record(std::make_unique<xAOD::L2StandAloneMuonContainer>(), std::make_unique<xAOD::L2StandAloneMuonAuxContainer>()));
447 
448  auto muCompositeContainer = SG::makeHandle(m_muCompositeContainerKey, ctx);
449  ATH_CHECK(muCompositeContainer.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()));
450 
451  auto muIdContainer = SG::makeHandle(m_muIdContainerKey, ctx);
452  ATH_CHECK(muIdContainer.record(std::make_unique<TrigRoiDescriptorCollection>()));
453 
454  auto muMsContainer = SG::makeHandle(m_muMsContainerKey, ctx);
455  ATH_CHECK(muMsContainer.record(std::make_unique<TrigRoiDescriptorCollection>()));
456 
457 
458  // Inside-out L2Muon mode
459  if(m_insideOut) {
460  ATH_MSG_DEBUG("start inside-out mode...");
461 
462  auto muonCBColl = SG::makeHandle (m_outputCBmuonCollKey, ctx);
463  ATH_CHECK( muonCBColl.record (std::make_unique<xAOD::L2CombinedMuonContainer>(),
464  std::make_unique<xAOD::L2CombinedMuonAuxContainer>()) );
465 
466  auto trackHandle = SG::makeHandle( m_FTFtrackKey, ctx );
467  if (!trackHandle.isValid()){
468  ATH_MSG_ERROR("ReadHandle for TrackParticleContainer key:" << m_FTFtrackKey.key() << " isn't Valid");
469  return StatusCode::FAILURE;
470  }
471  const xAOD::TrackParticleContainer *tracks = trackHandle.cptr();
472 
473  ATH_CHECK(findMuonSignatureIO(*tracks, internalRoI, recRoIVector,
474  *muonCBColl, *muFastContainer, dynamicDeltaRpc, ctx ));
475 
476  if (msgLvl(MSG::DEBUG)) {
477  ATH_MSG_DEBUG("REGTEST: xAOD::L2CombinedMuonContainer key:" << m_outputCBmuonCollKey.key() << " size = " << muonCBColl->size());
478  for (const auto p_CBmuon : *muonCBColl){
479  ATH_MSG_DEBUG("REGTEST: xAOD::L2CombinedMuonContainer key:" << m_outputCBmuonCollKey.key() << " pt = " << (*p_CBmuon).pt() << " GeV");
480  ATH_MSG_DEBUG("REGTEST: xAOD::L2CombinedMuonContainer key:" << m_outputCBmuonCollKey.key() << " eta/phi = " << (*p_CBmuon).eta() << "/" << (*p_CBmuon).phi());
481  }
482  }
483 
484  }
485  else if(m_multiTrack){ //multi-track SA mode
486  ATH_MSG_DEBUG("start multi-track SA mode...");
487  ATH_CHECK(findMultiTrackSignature(internalRoI, recRoIVector, *muFastContainer, dynamicDeltaRpc, ctx));
488  }
489  else {
490  // to StatusCode findMuonSignature()
491  ATH_CHECK(findMuonSignature(internalRoI, recRoIVector,
492  *muFastContainer, *muIdContainer, *muMsContainer, dynamicDeltaRpc, ctx));
493  }
494 
495  if (msgLvl(MSG::DEBUG)) {
496  // DEBUG TEST: Recorded data objects
497  ATH_MSG_DEBUG("Recorded data objects");
498  ATH_MSG_DEBUG("REGTEST: xAOD::L2StandAloneMuonContainer key:" << m_muFastContainerKey.key() << " size = " << muFastContainer->size());
499 
500  for (auto p_muon : *muFastContainer) {
501  ATH_MSG_DEBUG("REGTEST: xAOD::L2StandAloneMuonContainer key:" << m_muFastContainerKey.key() << " pt = " << (*p_muon).pt() << " GeV");
502  ATH_MSG_DEBUG("REGTEST: xAOD::L2StandAloneMuonContainer key:" << m_muFastContainerKey.key() << " eta/phi = " << (*p_muon).eta() << "/" << (*p_muon).phi());
503  }
504 
505  ATH_MSG_DEBUG("REGTEST: TrigRoiDescriptorCollection key:" << m_muIdContainerKey.key() << " size = " << muIdContainer->size());
506  for (auto p_muonID : *muIdContainer) {
507  ATH_MSG_DEBUG("REGTEST: TrigRoiDescriptorCollection key:" << m_muIdContainerKey.key() << " eta/phi = " << (*p_muonID).eta() << "/" << (*p_muonID).phi());
508  }
509 
510  ATH_MSG_DEBUG("REGTEST: TrigRoiDescriptorCollection key:" << m_muMsContainerKey.key() << " size = " << muMsContainer->size());
511  for (auto p_muonMS : *muMsContainer) {
512  ATH_MSG_DEBUG("REGTEST: TrigRoiDescriptorCollection key:" << m_muMsContainerKey.key() << " eta/phi = " << (*p_muonMS).eta() << "/" << (*p_muonMS).phi());
513  }
514  }
515 
516  }
517 
518  ATH_MSG_DEBUG("StatusCode MuFastSteering::execute() success");
519  return StatusCode::SUCCESS;
520 }
521 
522 // --------------------------------------------------------------------------------
523 // --------------------------------------------------------------------------------
524 
525 StatusCode MuFastSteering::findMuonSignature(const std::vector<const TrigRoiDescriptor*>& roids,
526  const std::vector<const LVL1::RecMuonRoI*>& muonRoIs,
528  TrigRoiDescriptorCollection& outputID,
529  TrigRoiDescriptorCollection& outputMS,
530  const bool dynamicDeltaRpc,
531  const EventContext& ctx) const
532 {
533  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMuonSignature start");
534  StatusCode sc = StatusCode::SUCCESS;
535 
536  auto prepTimer = Monitored::Timer( "TIME_Data_Preparator" );
537  auto patternTimer = Monitored::Timer( "TIME_Pattern_Finder" );
538  auto stationFitterTimer = Monitored::Timer( "TIME_Station_Fitter" );
539  auto trackFitterTimer = Monitored::Timer( "TIME_Track_Fitter" );
540  auto trackExtraTimer = Monitored::Timer( "TIME_Track_Extrapolator" );
541  auto calibrationTimer = Monitored::Timer( "TIME_Calibration_Streamer" );
542 
543  auto monitorIt = Monitored::Group(m_monTool, prepTimer, patternTimer, stationFitterTimer,
544  trackFitterTimer, trackExtraTimer, calibrationTimer );
545 
546  TrigL2MuonSA::RpcHits rpcHits;
547  TrigL2MuonSA::TgcHits tgcHits;
548  TrigL2MuonSA::MdtRegion mdtRegion;
549  TrigL2MuonSA::MuonRoad muonRoad;
550  TrigL2MuonSA::RpcFitResult rpcFitResult;
551  TrigL2MuonSA::TgcFitResult tgcFitResult;
552  TrigL2MuonSA::MdtHits mdtHits_normal;
553  TrigL2MuonSA::MdtHits mdtHits_overlap;
554  TrigL2MuonSA::CscHits cscHits;
555  TrigL2MuonSA::StgcHits stgcHits;
556  TrigL2MuonSA::MmHits mmHits;
557 
560 
561  // muonRoIs = RecMURoIs, roids = MURoIs
562  p_roids = roids.begin();
563  for (p_roi=(muonRoIs).begin(); p_roi!=(muonRoIs).end(); ++p_roi) {
564 
565  prepTimer.start();
566  std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
567  rpcHits.clear();
568  tgcHits.clear();
569  mdtRegion.Clear();
570  muonRoad.Clear();
571  rpcFitResult.Clear();
572  tgcFitResult.Clear();
573  mdtHits_normal.clear();
574  mdtHits_overlap.clear();
575  cscHits.clear();
576  stgcHits.clear();
577  mmHits.clear();
578 
579  if ( m_recMuonRoIUtils.isBarrel(*p_roi) ) { // Barrel
580  ATH_MSG_DEBUG("Barrel");
581 
585 
586  // Data preparation
587  sc = m_dataPreparator->prepareData(*p_roi,
588  *p_roids,
589  m_insideOut,
590  rpcHits,
591  muonRoad,
592  mdtRegion,
593  rpcFitResult,
594  mdtHits_normal,
595  mdtHits_overlap,
596  dynamicDeltaRpc);
597  if (!sc.isSuccess()) {
598  ATH_MSG_WARNING("Data preparation failed");
599  TrigL2MuonSA::TrackPattern trackPattern;
600  trackPatterns.push_back(trackPattern);
601  // Update output trigger element
602  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
603  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
604  stgcHits, mmHits,
605  trackPatterns, outputTracks, outputID, outputMS, ctx);
606  continue;
607  }
608  prepTimer.stop();
609 
610  // Pattern finding
611  patternTimer.start();
612  sc = m_patternFinder->findPatterns(muonRoad,
613  mdtHits_normal,
614  trackPatterns);
615  if (!sc.isSuccess()) {
616  ATH_MSG_WARNING("Pattern finder failed");
617  // Update output trigger element
618  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
619  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
620  stgcHits, mmHits,
621  trackPatterns, outputTracks, outputID, outputMS, ctx);
622  continue;
623  }
624  patternTimer.stop();
625 
626  // Superpoint fit
627  stationFitterTimer.start();
628  sc = m_stationFitter->findSuperPoints(*p_roids,
629  muonRoad,
630  rpcFitResult,
631  trackPatterns);
632  if (!sc.isSuccess()) {
633  ATH_MSG_WARNING("Super point fitter failed");
634  // Update output trigger element
635  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
636  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
637  stgcHits, mmHits,
638  trackPatterns, outputTracks, outputID, outputMS, ctx);
639  continue;
640  }
641  stationFitterTimer.stop();
642 
643  // Track fitting
644  trackFitterTimer.start();
645  sc = m_trackFitter->findTracks(*p_roids,
646  rpcFitResult,
647  trackPatterns);
648 
649  if (!sc.isSuccess()) {
650  ATH_MSG_WARNING("Track fitter failed");
651  // Update output trigger element
652  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
653  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
654  stgcHits, mmHits,
655  trackPatterns, outputTracks, outputID, outputMS, ctx);
656  continue;
657  }
658  trackFitterTimer.stop();
659 
660  } else { // Endcap
661  ATH_MSG_DEBUG("Endcap");
662 
663  prepTimer.start();
664  // Data preparation
665  sc = m_dataPreparator->prepareData(*p_roi,
666  *p_roids,
667  m_insideOut,
668  tgcHits,
669  muonRoad,
670  mdtRegion,
671  tgcFitResult,
672  mdtHits_normal,
673  mdtHits_overlap,
674  cscHits,
675  stgcHits,
676  mmHits);
677  if (!sc.isSuccess()) {
678  ATH_MSG_WARNING("Data preparation failed");
679  TrigL2MuonSA::TrackPattern trackPattern;
680  trackPatterns.push_back(trackPattern);
681  // Update output trigger element
682  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
683  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
684  stgcHits, mmHits,
685  trackPatterns, outputTracks, outputID, outputMS, ctx);
686  continue;
687  }
688  prepTimer.stop();
689 
690  // Pattern finding
691  patternTimer.start();
692  sc = m_patternFinder->findPatterns(muonRoad,
693  mdtHits_normal,
694  stgcHits,
695  mmHits,
696  trackPatterns);
697 
698 
699 
700  if (!sc.isSuccess()) {
701  ATH_MSG_WARNING("Pattern finder failed");
702  // Update output trigger element
703  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
704  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
705  stgcHits, mmHits,
706  trackPatterns, outputTracks, outputID, outputMS, ctx);
707  continue;
708  }
709  patternTimer.stop();
710 
711  // Superpoint fit
712  stationFitterTimer.start();
714  sc = m_stationFitter->findSuperPointsSimple(*p_roids,
715  muonRoad,
716  tgcFitResult,
717  trackPatterns,
718  stgcHits,
719  mmHits);
720  }else{
721  sc = m_stationFitter->findSuperPoints(*p_roids,
722  muonRoad,
723  tgcFitResult,
724  trackPatterns,
725  stgcHits,
726  mmHits);
727  }
729  m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
730 
731  if (!sc.isSuccess()) {
732  ATH_MSG_WARNING("Super point fitter failed");
733  // Update output trigger element
734  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
735  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
736  stgcHits, mmHits,
737  trackPatterns, outputTracks, outputID, outputMS, ctx);
738  continue;
739  }
740 
741  stationFitterTimer.stop();
742 
743  // Track fittingh
744  trackFitterTimer.start();
745  sc = m_trackFitter->findTracks(*p_roids,
746  tgcFitResult,
747  trackPatterns,
748  muonRoad);
749 
750  if (!sc.isSuccess()) {
751  ATH_MSG_WARNING("Track fitter failed");
752  // Update output trigger element
753  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
754  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
755  stgcHits, mmHits,
756  trackPatterns, outputTracks, outputID, outputMS, ctx);
757  continue;
758  }
759  trackFitterTimer.stop();
760  }
761 
762  // fix if eta is strange
763  const float ETA_LIMIT = 2.8;
764  const float DELTA_ETA_LIMIT = 1.0;
765  const float ZERO_LIMIT = 1.e-5;
766  for (TrigL2MuonSA::TrackPattern& track : trackPatterns) {
767  float roiEta = (*p_roi)->eta();
768  if (std::abs(track.pt) > ZERO_LIMIT
769  && ( std::abs(track.etaMap) > ETA_LIMIT || std::abs(track.etaMap-roiEta) > DELTA_ETA_LIMIT ) ) {
770  track.etaMap = roiEta;
771  }
772  }
773 
774  // Track extrapolation for ID combined
775  trackExtraTimer.start();
776 
777  sc = m_trackExtrapolator->extrapolateTrack(trackPatterns, m_winPt);
778 
779  if (sc != StatusCode::SUCCESS) {
780  ATH_MSG_WARNING("Track extrapolator failed");
781  // Update output trigger element
782  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
783  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
784  stgcHits, mmHits,
785  trackPatterns, outputTracks, outputID, outputMS, ctx);
786  continue;
787  }
788  trackExtraTimer.stop();
789 
790  // Update monitoring variables
791  sc = updateMonitor(*p_roi, mdtHits_normal, trackPatterns );
792  if (sc != StatusCode::SUCCESS) {
793  ATH_MSG_WARNING("Failed to update monitoring variables");
794  // Update output trigger element
795  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
796  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
797  stgcHits, mmHits,
798  trackPatterns, outputTracks, outputID, outputMS, ctx);
799  continue;
800  }
801 
802  // Update output trigger element
803  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
804  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
805  stgcHits, mmHits,
806  trackPatterns, outputTracks, outputID, outputMS, ctx);
807 
808 
809  ++p_roids;
810  if (p_roids==roids.end()) break;
811  }
812 
813  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMuonSignature success");
814  return StatusCode::SUCCESS;
815 }
816 
817 // --------------------------------------------------------------------------------
818 // --------------------------------------------------------------------------------
819 
820 StatusCode MuFastSteering::findMuonSignature(const std::vector<const TrigRoiDescriptor*>& roids,
821  const std::vector<const xAOD::MuonRoI*>& muonRoIs,
823  TrigRoiDescriptorCollection& outputID,
824  TrigRoiDescriptorCollection& outputMS,
825  const bool dynamicDeltaRpc,
826  const EventContext& ctx) const
827 {
828  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMuonSignature start");
829  StatusCode sc = StatusCode::SUCCESS;
830 
831  auto prepTimer = Monitored::Timer( "TIME_Data_Preparator" );
832  auto patternTimer = Monitored::Timer( "TIME_Pattern_Finder" );
833  auto stationFitterTimer = Monitored::Timer( "TIME_Station_Fitter" );
834  auto trackFitterTimer = Monitored::Timer( "TIME_Track_Fitter" );
835  auto trackExtraTimer = Monitored::Timer( "TIME_Track_Extrapolator" );
836  auto calibrationTimer = Monitored::Timer( "TIME_Calibration_Streamer" );
837 
838  auto monitorIt = Monitored::Group(m_monTool, prepTimer, patternTimer, stationFitterTimer,
839  trackFitterTimer, trackExtraTimer, calibrationTimer );
840 
841  TrigL2MuonSA::RpcHits rpcHits;
842  TrigL2MuonSA::TgcHits tgcHits;
843  TrigL2MuonSA::MdtRegion mdtRegion;
844  TrigL2MuonSA::MuonRoad muonRoad;
845  TrigL2MuonSA::RpcFitResult rpcFitResult;
846  TrigL2MuonSA::TgcFitResult tgcFitResult;
847  TrigL2MuonSA::MdtHits mdtHits_normal;
848  TrigL2MuonSA::MdtHits mdtHits_overlap;
849  TrigL2MuonSA::CscHits cscHits;
850  TrigL2MuonSA::StgcHits stgcHits;
851  TrigL2MuonSA::MmHits mmHits;
852 
855 
856  // muonRoIs = RecMURoIs, roids = MURoIs
857  p_roids = roids.begin();
858  for (p_roi=(muonRoIs).begin(); p_roi!=(muonRoIs).end(); ++p_roi) {
859 
860  prepTimer.start();
861  std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
862  rpcHits.clear();
863  tgcHits.clear();
864  mdtRegion.Clear();
865  muonRoad.Clear();
866  rpcFitResult.Clear();
867  tgcFitResult.Clear();
868  mdtHits_normal.clear();
869  mdtHits_overlap.clear();
870  cscHits.clear();
871  stgcHits.clear();
872  mmHits.clear();
873 
874  if ( m_recMuonRoIUtils.isBarrel(*p_roi) ) { // Barrel
875  ATH_MSG_DEBUG("Barrel");
876 
880 
881  // Data preparation
882  sc = m_dataPreparator->prepareData(*p_roi,
883  *p_roids,
884  m_insideOut,
885  rpcHits,
886  muonRoad,
887  mdtRegion,
888  rpcFitResult,
889  mdtHits_normal,
890  mdtHits_overlap,
891  dynamicDeltaRpc);
892  if (!sc.isSuccess()) {
893  ATH_MSG_WARNING("Data preparation failed");
894  TrigL2MuonSA::TrackPattern trackPattern;
895  trackPatterns.push_back(trackPattern);
896  // Update output trigger element
897  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
898  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
899  stgcHits, mmHits,
900  trackPatterns, outputTracks, outputID, outputMS, ctx);
901  continue;
902  }
903  prepTimer.stop();
904 
905  // Pattern finding
906  patternTimer.start();
907  sc = m_patternFinder->findPatterns(muonRoad,
908  mdtHits_normal,
909  trackPatterns);
910  if (!sc.isSuccess()) {
911  ATH_MSG_WARNING("Pattern finder failed");
912  // Update output trigger element
913  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
914  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
915  stgcHits, mmHits,
916  trackPatterns, outputTracks, outputID, outputMS, ctx);
917  continue;
918  }
919  patternTimer.stop();
920 
921  // Superpoint fit
922  stationFitterTimer.start();
923  sc = m_stationFitter->findSuperPoints(*p_roids,
924  muonRoad,
925  rpcFitResult,
926  trackPatterns);
927  if (!sc.isSuccess()) {
928  ATH_MSG_WARNING("Super point fitter failed");
929  // Update output trigger element
930  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
931  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
932  stgcHits, mmHits,
933  trackPatterns, outputTracks, outputID, outputMS, ctx);
934  continue;
935  }
936  stationFitterTimer.stop();
937 
938  // Track fitting
939  trackFitterTimer.start();
940  sc = m_trackFitter->findTracks(*p_roids,
941  rpcFitResult,
942  trackPatterns);
943 
944  if (!sc.isSuccess()) {
945  ATH_MSG_WARNING("Track fitter failed");
946  // Update output trigger element
947  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
948  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
949  stgcHits, mmHits,
950  trackPatterns, outputTracks, outputID, outputMS, ctx);
951  continue;
952  }
953  trackFitterTimer.stop();
954 
955  } else { // Endcap
956  ATH_MSG_DEBUG("Endcap");
957 
958  prepTimer.start();
959  // Data preparation
960  sc = m_dataPreparator->prepareData(*p_roi,
961  *p_roids,
962  m_insideOut,
963  tgcHits,
964  muonRoad,
965  mdtRegion,
966  tgcFitResult,
967  mdtHits_normal,
968  mdtHits_overlap,
969  cscHits,
970  stgcHits,
971  mmHits);
972  if (!sc.isSuccess()) {
973  ATH_MSG_WARNING("Data preparation failed");
974  TrigL2MuonSA::TrackPattern trackPattern;
975  trackPatterns.push_back(trackPattern);
976  // Update output trigger element
977  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
978  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
979  stgcHits, mmHits,
980  trackPatterns, outputTracks, outputID, outputMS, ctx);
981  continue;
982  }
983  prepTimer.stop();
984 
985  // Pattern finding
986  patternTimer.start();
987  sc = m_patternFinder->findPatterns(muonRoad,
988  mdtHits_normal,
989  stgcHits,
990  mmHits,
991  trackPatterns);
992 
993 
994 
995  if (!sc.isSuccess()) {
996  ATH_MSG_WARNING("Pattern finder failed");
997  // Update output trigger element
998  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
999  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1000  stgcHits, mmHits,
1001  trackPatterns, outputTracks, outputID, outputMS, ctx);
1002  continue;
1003  }
1004  patternTimer.stop();
1005 
1006  // Superpoint fit
1007  stationFitterTimer.start();
1008  if(!m_use_new_segmentfit){
1009  sc = m_stationFitter->findSuperPointsSimple(*p_roids,
1010  muonRoad,
1011  tgcFitResult,
1012  trackPatterns,
1013  stgcHits,
1014  mmHits);
1015  }else{
1016  sc = m_stationFitter->findSuperPoints(*p_roids,
1017  muonRoad,
1018  tgcFitResult,
1019  trackPatterns,
1020  stgcHits,
1021  mmHits);
1022  }
1024  m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
1025 
1026  if (!sc.isSuccess()) {
1027  ATH_MSG_WARNING("Super point fitter failed");
1028  // Update output trigger element
1029  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1030  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1031  stgcHits, mmHits,
1032  trackPatterns, outputTracks, outputID, outputMS, ctx);
1033  continue;
1034  }
1035 
1036  stationFitterTimer.stop();
1037 
1038  // Track fittingh
1039  trackFitterTimer.start();
1040  sc = m_trackFitter->findTracks(*p_roids,
1041  tgcFitResult,
1042  trackPatterns,
1043  muonRoad);
1044 
1045  if (!sc.isSuccess()) {
1046  ATH_MSG_WARNING("Track fitter failed");
1047  // Update output trigger element
1048  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1049  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1050  stgcHits, mmHits,
1051  trackPatterns, outputTracks, outputID, outputMS, ctx);
1052  continue;
1053  }
1054  trackFitterTimer.stop();
1055  }
1056 
1057  // fix if eta is strange
1058  const float ETA_LIMIT = 2.8;
1059  const float DELTA_ETA_LIMIT = 1.0;
1060  const float ZERO_LIMIT = 1.e-5;
1061  for (TrigL2MuonSA::TrackPattern& track : trackPatterns) {
1062  float roiEta = (*p_roi)->eta();
1063  if (std::abs(track.pt) > ZERO_LIMIT
1064  && ( std::abs(track.etaMap) > ETA_LIMIT || std::abs(track.etaMap-roiEta) > DELTA_ETA_LIMIT ) ) {
1065  track.etaMap = roiEta;
1066  }
1067  }
1068 
1069  // Track extrapolation for ID combined
1070  trackExtraTimer.start();
1071 
1072  sc = m_trackExtrapolator->extrapolateTrack(trackPatterns, m_winPt);
1073 
1074  if (sc != StatusCode::SUCCESS) {
1075  ATH_MSG_WARNING("Track extrapolator failed");
1076  // Update output trigger element
1077  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1078  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1079  stgcHits, mmHits,
1080  trackPatterns, outputTracks, outputID, outputMS, ctx);
1081  continue;
1082  }
1083  trackExtraTimer.stop();
1084 
1085  // Update monitoring variables
1086  sc = updateMonitor(*p_roi, mdtHits_normal, trackPatterns );
1087  if (sc != StatusCode::SUCCESS) {
1088  ATH_MSG_WARNING("Failed to update monitoring variables");
1089  // Update output trigger element
1090  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1091  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1092  stgcHits, mmHits,
1093  trackPatterns, outputTracks, outputID, outputMS, ctx);
1094  continue;
1095  }
1096 
1097  // Update output trigger element
1098  updateOutputObjects(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1099  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1100  stgcHits, mmHits,
1101  trackPatterns, outputTracks, outputID, outputMS, ctx);
1102 
1103 
1104  //-----------------------
1105  // call the calibration streamer
1106  //---------------------------
1107  if (m_doCalStream && trackPatterns.size()>0 ) {
1108  TrigL2MuonSA::TrackPattern tp = trackPatterns[0];
1109  bool updateTriggerElement = false;
1110  //int calBS = m_calBufferSize;
1111  bool calDS = m_calDataScouting;
1112  sc = m_calStreamer->createRoiFragment(*p_roi,tp,mdtHits_normal,
1113  rpcHits,
1114  tgcHits,
1115  //calBS,
1116  calDS,
1117  updateTriggerElement,ctx);
1118  if (sc != StatusCode::SUCCESS ) {
1119  ATH_MSG_WARNING("Calibration streamer: create Roi Fragment failed");
1120  }
1121  }
1122 
1123 
1124 
1125  ++p_roids;
1126  if (p_roids==roids.end()) break;
1127  }
1128 
1129  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMuonSignature success");
1130  return StatusCode::SUCCESS;
1131 }
1132 
1133 // --------------------------------------------------------------------------------
1134 // --------------------------------------------------------------------------------
1135 
1136 // findMuonSignature of L2 inside-out version
1137 // try to find MS tracks seeded by FTF tracks
1139  const std::vector<const TrigRoiDescriptor*>& roids,
1140  const std::vector<const LVL1::RecMuonRoI*>& muonRoIs,
1143  const bool dynamicDeltaRpc,
1144  const EventContext& ctx) const
1145 {
1146  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMuonSignatureIO start");
1147  StatusCode sc = StatusCode::SUCCESS;
1148  const float ZERO_LIMIT = 1.e-5;
1149 
1150  auto prepTimer = Monitored::Timer( "TIME_Data_Preparator" );
1151  auto patternTimer = Monitored::Timer( "TIME_Pattern_Finder" );
1152  auto stationFitterTimer = Monitored::Timer( "TIME_Station_Fitter" );
1153  auto trackFitterTimer = Monitored::Timer( "TIME_Track_Fitter" );
1154  auto trackExtraTimer = Monitored::Timer( "TIME_Track_Extrapolator" );
1155  auto calibrationTimer = Monitored::Timer( "TIME_Calibration_Streamer" );
1156 
1157  auto monitorIt = Monitored::Group(m_monTool, prepTimer, patternTimer, stationFitterTimer,
1158  trackFitterTimer, trackExtraTimer, calibrationTimer );
1159 
1160  TrigL2MuonSA::RpcHits rpcHits;
1161  TrigL2MuonSA::TgcHits tgcHits;
1162  TrigL2MuonSA::MdtRegion mdtRegion;
1163  TrigL2MuonSA::MuonRoad muonRoad;
1164  TrigL2MuonSA::RpcFitResult rpcFitResult;
1165  TrigL2MuonSA::TgcFitResult tgcFitResult;
1166  TrigL2MuonSA::MdtHits mdtHits_normal;
1167  TrigL2MuonSA::MdtHits mdtHits_overlap;
1168  TrigL2MuonSA::CscHits cscHits;
1169  TrigL2MuonSA::StgcHits stgcHits;
1170  TrigL2MuonSA::MmHits mmHits;
1171 
1173 
1174  p_roids = roids.begin();
1175  for (const auto p_roi : muonRoIs) {
1176  ATH_MSG_DEBUG("roi eta/phi: " << (*p_roi).eta() << "/" << (*p_roi).phi());
1177 
1178  // idtracks loop
1179  if ( (idtracks).empty() ) ATH_MSG_DEBUG("IO TEST: xAOD::TrackParticleContainer has 0 tracks --> Can not use FTF tracks...");
1180  else ATH_MSG_DEBUG("IO TEST: xAOD::TrackParticleContainer has " << (idtracks).size() << " tracks --> Start inside-out mode!");
1181 
1182  std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
1183  int idtrack_idx = -1;
1184  for (auto idtrack : idtracks) {
1185 
1186  idtrack_idx++;
1187  ATH_MSG_DEBUG("IO TEST: FTF track key:" << m_FTFtrackKey.key() << " pt = " << idtrack->pt()/1000 << " GeV");
1188  ATH_MSG_DEBUG("IO TEST: FTF track key:" << m_FTFtrackKey.key() << " eta/phi = " << idtrack->eta() << "/" << idtrack->phi());
1189 
1190  if(idtrack->pt() < m_ftfminPt) {
1191  ATH_MSG_DEBUG("IO TEST: skip FTF track due to pT threshold: " << m_ftfminPt << " MeV");
1192  continue;
1193  }
1194 
1195  prepTimer.start();
1196  rpcHits.clear();
1197  tgcHits.clear();
1198  mdtRegion.Clear();
1199  muonRoad.Clear();
1200  rpcFitResult.Clear();
1201  tgcFitResult.Clear();
1202  mdtHits_normal.clear();
1203  mdtHits_overlap.clear();
1204  cscHits.clear();
1205  stgcHits.clear();
1206  mmHits.clear();
1207  trackPatterns.clear();
1208 
1209  sc = m_ftfRoadDefiner->defineRoad(idtrack, muonRoad);
1210  if (!sc.isSuccess()) {
1211  ATH_MSG_WARNING("FtfRoadDefiner failed");
1212  continue;
1213  } else {
1214  ATH_MSG_DEBUG("FtfRoadDefiner::defineRoad success");
1215  }
1216 
1217  if ( std::abs(idtrack->eta()) < 1.05 ){
1218  ATH_MSG_DEBUG("FTF track at IP is in Barrel: " << idtrack->eta());
1219  } else {
1220  ATH_MSG_DEBUG("FTF track at IP is in Endcap: " << idtrack->eta());
1221  }
1222 
1223  if ( m_recMuonRoIUtils.isBarrel(p_roi) ) { // Barrel Inside-out
1224  ATH_MSG_DEBUG("muonRoad.extFtfMiddleEta Barrel: " << muonRoad.extFtfMiddleEta);
1225 
1226  ATH_MSG_DEBUG("Barrel algorithm of IOmode starts");
1227 
1231 
1232  // Data preparation
1233  sc = m_dataPreparator->prepareData(p_roi,
1234  *p_roids,
1235  m_insideOut,
1236  rpcHits,
1237  muonRoad,
1238  mdtRegion,
1239  rpcFitResult,
1240  mdtHits_normal,
1241  mdtHits_overlap,
1242  dynamicDeltaRpc);
1243  if (!sc.isSuccess()) {
1244  ATH_MSG_WARNING("Data preparation failed");
1245  continue;
1246  } else {
1247  ATH_MSG_DEBUG("Data preparation success");
1248  }
1249  prepTimer.stop();
1250 
1251  // Pattern finding
1252  patternTimer.start();
1253  sc = m_patternFinder->findPatterns(muonRoad,
1254  mdtHits_normal,
1255  trackPatterns);
1256  if (!sc.isSuccess()) {
1257  ATH_MSG_WARNING("Pattern finder failed");
1258  continue;
1259  }
1260  patternTimer.stop();
1261 
1262  // Superpoint fit
1263  stationFitterTimer.start();
1264  sc = m_stationFitter->findSuperPoints(*p_roids,
1265  muonRoad,
1266  rpcFitResult,
1267  trackPatterns);
1268  if (!sc.isSuccess()) {
1269  ATH_MSG_WARNING("Super point fitter failed");
1270  continue;
1271  }
1272  stationFitterTimer.stop();
1273 
1274  // Track fitting
1275  trackFitterTimer.start();
1276  sc = m_trackFitter->findTracks(*p_roids,
1277  rpcFitResult,
1278  trackPatterns);
1279  if (!sc.isSuccess()) {
1280  ATH_MSG_WARNING("Track fitter failed");
1281  continue;
1282  }
1283  trackFitterTimer.stop();
1284 
1285  } else { // Endcap Inside-out
1286  ATH_MSG_DEBUG("muonRoad.extFtfMiddleEta Endcap: " << muonRoad.extFtfMiddleEta);
1287  ATH_MSG_DEBUG("Endcap algorithm of IOmode starts");
1288 
1289  prepTimer.start();
1290  // Data preparation
1291  sc = m_dataPreparator->prepareData(p_roi,
1292  *p_roids,
1293  m_insideOut,
1294  tgcHits,
1295  muonRoad,
1296  mdtRegion,
1297  tgcFitResult,
1298  mdtHits_normal,
1299  mdtHits_overlap,
1300  cscHits,
1301  stgcHits,
1302  mmHits);
1303  if (!sc.isSuccess()) {
1304  ATH_MSG_WARNING("Data preparation failed");
1305  continue;
1306  } else{
1307  ATH_MSG_DEBUG("Data preparation success");
1308  }
1309  prepTimer.stop();
1310 
1311  // Pattern finding
1312  patternTimer.start();
1313  sc = m_patternFinder->findPatterns(muonRoad,
1314  mdtHits_normal,
1315  stgcHits,
1316  mmHits,
1317  trackPatterns);
1318  if (!sc.isSuccess()) {
1319  ATH_MSG_WARNING("Pattern finder failed");
1320  continue;
1321  }
1322  patternTimer.stop();
1323 
1324  // Superpoint fit
1325  stationFitterTimer.start();
1326  sc = m_stationFitter->findSuperPointsSimple(*p_roids,
1327  muonRoad,
1328  tgcFitResult,
1329  trackPatterns,
1330  stgcHits,
1331  mmHits);
1333  m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
1334  if (!sc.isSuccess()) {
1335  ATH_MSG_WARNING("Super point fitter failed");
1336  continue;
1337  }
1338  stationFitterTimer.stop();
1339 
1340  // Track fittingh
1341  trackFitterTimer.start();
1342  sc = m_trackFitter->findTracks(*p_roids,
1343  tgcFitResult,
1344  trackPatterns,
1345  muonRoad);
1346  if (!sc.isSuccess()) {
1347  ATH_MSG_WARNING("Track fitter failed");
1348  continue;
1349  }
1350  trackFitterTimer.stop();
1351 
1352  }
1353 
1354  // fix if eta is strange
1355  TrigL2MuonSA::TrackPattern track = trackPatterns.back();
1356  const float ETA_LIMIT = 2.8;
1357  const float DELTA_ETA_LIMIT = 1.0;
1358  float roiEta = (*p_roi).eta();
1359  if (std::abs(track.pt) > ZERO_LIMIT
1360  && ( std::abs(track.etaMap) > ETA_LIMIT || std::abs(track.etaMap-roiEta) > DELTA_ETA_LIMIT ) ) {
1361  trackPatterns.back().etaMap = roiEta;
1362  }
1363 
1364  // Update monitoring variables
1365  sc = updateMonitor(p_roi, mdtHits_normal, trackPatterns );
1366  if (sc != StatusCode::SUCCESS) {
1367  ATH_MSG_WARNING("Failed to update monitoring variables");
1368  }
1369 
1370  // Update output trigger element
1371  if ( std::abs(trackPatterns.back().pt) > ZERO_LIMIT ) {
1372  storeMuonSA(p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1373  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1374  stgcHits, mmHits,
1375  trackPatterns.back(), outputSAs, ctx);
1377  muonCB->makePrivateStore();
1378  muonCB->setStrategy(0);
1379  muonCB->setErrorFlag(-9);
1380  muonCB->setPt(idtrack->pt());
1381  muonCB->setEta(idtrack->eta());
1382  muonCB->setPhi(idtrack->phi());
1383  muonCB->setCharge(idtrack->charge());
1384  ElementLink<xAOD::L2StandAloneMuonContainer> muonSAEL(outputSAs, outputSAs.size()-1);
1385  muonCB->setMuSATrackLink(muonSAEL);
1386  ElementLink<xAOD::TrackParticleContainer> idtrkEL(idtracks, idtrack_idx);
1387  muonCB->setIdTrackLink(idtrkEL);
1388  outputCBs.push_back(muonCB);
1389  }
1390 
1391  }
1392 
1393  if(outputSAs.size()==0) {
1394  ATH_MSG_DEBUG("outputSAs size = 0 -> push_back dummy");
1395  muonRoad.Clear();
1396  mdtRegion.Clear();
1397  rpcHits.clear();
1398  tgcHits.clear();
1399  rpcFitResult.Clear();
1400  tgcFitResult.Clear();
1401  mdtHits_normal.clear();
1402  cscHits.clear();
1403  stgcHits.clear();
1404  mmHits.clear();
1405  trackPatterns.clear();
1406  TrigL2MuonSA::TrackPattern trackPattern;
1407  storeMuonSA(p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1408  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1409  stgcHits, mmHits,
1410  trackPattern, outputSAs, ctx);
1412  muonCB->makePrivateStore();
1413  muonCB->setStrategy(-9);
1414  muonCB->setErrorFlag(-9);
1415  muonCB->setPt(0);
1416  muonCB->setEta(99999.);
1417  muonCB->setPhi(99999.);
1418  ElementLink<xAOD::L2StandAloneMuonContainer> muonSAEL(outputSAs, outputSAs.size()-1);
1419  muonCB->setMuSATrackLink(muonSAEL);
1420  outputCBs.push_back(muonCB);
1421  }
1422 
1423 
1424  if (msgLvl(MSG::DEBUG)) {
1425  ATH_MSG_DEBUG("outputSAs size: " << outputSAs.size());
1426  ATH_MSG_DEBUG("idtracks size: " << idtracks.size());
1427  for (auto outputSA : outputSAs){
1428  ATH_MSG_DEBUG("outputSA pt/eta/phi: " << outputSA->pt() << "/" << outputSA->etaMS() << "/" << outputSA->phiMS());
1429  }
1430 
1431  ATH_MSG_DEBUG("outputCBs size: " << outputCBs.size());
1432  for (auto outputCB : outputCBs){
1433  ATH_MSG_DEBUG("outputCB pt/eta/phi: " << outputCB->pt() << "/" << outputCB->eta() << "/" << outputCB->phi());
1434  }
1435  }
1436 
1437  ++p_roids;
1438  if (p_roids==roids.end()) break;
1439  }
1440 
1441  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMuonSignatureIO success");
1442  return StatusCode::SUCCESS;
1443 }
1444 
1445 // --------------------------------------------------------------------------------
1446 // --------------------------------------------------------------------------------
1447 
1448 // findMuonSignature of L2 inside-out version
1449 // try to find MS tracks seeded by FTF tracks
1451  const std::vector<const TrigRoiDescriptor*>& roids,
1452  const std::vector<const xAOD::MuonRoI*>& muonRoIs,
1455  const bool dynamicDeltaRpc,
1456  const EventContext& ctx) const
1457 {
1458  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMuonSignatureIO start");
1459  StatusCode sc = StatusCode::SUCCESS;
1460  const float ZERO_LIMIT = 1.e-5;
1461 
1462  auto prepTimer = Monitored::Timer( "TIME_Data_Preparator" );
1463  auto patternTimer = Monitored::Timer( "TIME_Pattern_Finder" );
1464  auto stationFitterTimer = Monitored::Timer( "TIME_Station_Fitter" );
1465  auto trackFitterTimer = Monitored::Timer( "TIME_Track_Fitter" );
1466  auto trackExtraTimer = Monitored::Timer( "TIME_Track_Extrapolator" );
1467  auto calibrationTimer = Monitored::Timer( "TIME_Calibration_Streamer" );
1468 
1469  auto monitorIt = Monitored::Group(m_monTool, prepTimer, patternTimer, stationFitterTimer,
1470  trackFitterTimer, trackExtraTimer, calibrationTimer );
1471 
1472  TrigL2MuonSA::RpcHits rpcHits;
1473  TrigL2MuonSA::TgcHits tgcHits;
1474  TrigL2MuonSA::MdtRegion mdtRegion;
1475  TrigL2MuonSA::MuonRoad muonRoad;
1476  TrigL2MuonSA::RpcFitResult rpcFitResult;
1477  TrigL2MuonSA::TgcFitResult tgcFitResult;
1478  TrigL2MuonSA::MdtHits mdtHits_normal;
1479  TrigL2MuonSA::MdtHits mdtHits_overlap;
1480  TrigL2MuonSA::CscHits cscHits;
1481  TrigL2MuonSA::StgcHits stgcHits;
1482  TrigL2MuonSA::MmHits mmHits;
1483 
1485 
1486  p_roids = roids.begin();
1487  for (const auto p_roi : muonRoIs) {
1488  ATH_MSG_DEBUG("roi eta/phi: " << (*p_roi).eta() << "/" << (*p_roi).phi());
1489 
1490  // idtracks loop
1491  if ( (idtracks).empty() ) ATH_MSG_DEBUG("IO TEST: xAOD::TrackParticleContainer has 0 tracks --> Can not use FTF tracks...");
1492  else ATH_MSG_DEBUG("IO TEST: xAOD::TrackParticleContainer has " << (idtracks).size() << " tracks --> Start inside-out mode!");
1493 
1494  std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
1495  int idtrack_idx = -1;
1496  for (auto idtrack : idtracks) {
1497 
1498  idtrack_idx++;
1499  ATH_MSG_DEBUG("IO TEST: FTF track key:" << m_FTFtrackKey.key() << " pt = " << idtrack->pt()/1000 << " GeV");
1500  ATH_MSG_DEBUG("IO TEST: FTF track key:" << m_FTFtrackKey.key() << " eta/phi = " << idtrack->eta() << "/" << idtrack->phi());
1501 
1502  if(idtrack->pt() < m_ftfminPt) {
1503  ATH_MSG_DEBUG("IO TEST: skip FTF track due to pT threshold: " << m_ftfminPt << " MeV");
1504  continue;
1505  }
1506 
1507  prepTimer.start();
1508  rpcHits.clear();
1509  tgcHits.clear();
1510  mdtRegion.Clear();
1511  muonRoad.Clear();
1512  rpcFitResult.Clear();
1513  tgcFitResult.Clear();
1514  mdtHits_normal.clear();
1515  mdtHits_overlap.clear();
1516  cscHits.clear();
1517  stgcHits.clear();
1518  mmHits.clear();
1519  trackPatterns.clear();
1520 
1521  sc = m_ftfRoadDefiner->defineRoad(idtrack, muonRoad);
1522  if (!sc.isSuccess()) {
1523  ATH_MSG_WARNING("FtfRoadDefiner failed");
1524  continue;
1525  } else {
1526  ATH_MSG_DEBUG("FtfRoadDefiner::defineRoad success");
1527  }
1528 
1529  if ( std::abs(idtrack->eta()) < 1.05 ){
1530  ATH_MSG_DEBUG("FTF track at IP is in Barrel: " << idtrack->eta());
1531  } else {
1532  ATH_MSG_DEBUG("FTF track at IP is in Endcap: " << idtrack->eta());
1533  }
1534 
1535  if ( m_recMuonRoIUtils.isBarrel(p_roi) ) { // Barrel Inside-out
1536  ATH_MSG_DEBUG("muonRoad.extFtfMiddleEta Barrel: " << muonRoad.extFtfMiddleEta);
1537 
1538  ATH_MSG_DEBUG("Barrel algorithm of IOmode starts");
1539 
1543 
1544  // Data preparation
1545  sc = m_dataPreparator->prepareData(p_roi,
1546  *p_roids,
1547  m_insideOut,
1548  rpcHits,
1549  muonRoad,
1550  mdtRegion,
1551  rpcFitResult,
1552  mdtHits_normal,
1553  mdtHits_overlap,
1554  dynamicDeltaRpc);
1555  if (!sc.isSuccess()) {
1556  ATH_MSG_WARNING("Data preparation failed");
1557  continue;
1558  } else {
1559  ATH_MSG_DEBUG("Data preparation success");
1560  }
1561  prepTimer.stop();
1562 
1563  // Pattern finding
1564  patternTimer.start();
1565  sc = m_patternFinder->findPatterns(muonRoad,
1566  mdtHits_normal,
1567  trackPatterns);
1568  if (!sc.isSuccess()) {
1569  ATH_MSG_WARNING("Pattern finder failed");
1570  continue;
1571  }
1572  patternTimer.stop();
1573 
1574  // Superpoint fit
1575  stationFitterTimer.start();
1576  sc = m_stationFitter->findSuperPoints(*p_roids,
1577  muonRoad,
1578  rpcFitResult,
1579  trackPatterns);
1580  if (!sc.isSuccess()) {
1581  ATH_MSG_WARNING("Super point fitter failed");
1582  continue;
1583  }
1584  stationFitterTimer.stop();
1585 
1586  // Track fitting
1587  trackFitterTimer.start();
1588  sc = m_trackFitter->findTracks(*p_roids,
1589  rpcFitResult,
1590  trackPatterns);
1591  if (!sc.isSuccess()) {
1592  ATH_MSG_WARNING("Track fitter failed");
1593  continue;
1594  }
1595  trackFitterTimer.stop();
1596 
1597  } else { // Endcap Inside-out
1598  ATH_MSG_DEBUG("muonRoad.extFtfMiddleEta Endcap: " << muonRoad.extFtfMiddleEta);
1599  ATH_MSG_DEBUG("Endcap algorithm of IOmode starts");
1600 
1601  prepTimer.start();
1602  // Data preparation
1603  sc = m_dataPreparator->prepareData(p_roi,
1604  *p_roids,
1605  m_insideOut,
1606  tgcHits,
1607  muonRoad,
1608  mdtRegion,
1609  tgcFitResult,
1610  mdtHits_normal,
1611  mdtHits_overlap,
1612  cscHits,
1613  stgcHits,
1614  mmHits);
1615  if (!sc.isSuccess()) {
1616  ATH_MSG_WARNING("Data preparation failed");
1617  continue;
1618  } else{
1619  ATH_MSG_DEBUG("Data preparation success");
1620  }
1621  prepTimer.stop();
1622 
1623  // Pattern finding
1624  patternTimer.start();
1625  sc = m_patternFinder->findPatterns(muonRoad,
1626  mdtHits_normal,
1627  stgcHits,
1628  mmHits,
1629  trackPatterns);
1630  if (!sc.isSuccess()) {
1631  ATH_MSG_WARNING("Pattern finder failed");
1632  continue;
1633  }
1634  patternTimer.stop();
1635 
1636  // Superpoint fit
1637  stationFitterTimer.start();
1638  sc = m_stationFitter->findSuperPointsSimple(*p_roids,
1639  muonRoad,
1640  tgcFitResult,
1641  trackPatterns,
1642  stgcHits,
1643  mmHits);
1645  m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
1646  if (!sc.isSuccess()) {
1647  ATH_MSG_WARNING("Super point fitter failed");
1648  continue;
1649  }
1650  stationFitterTimer.stop();
1651 
1652  // Track fittingh
1653  trackFitterTimer.start();
1654  sc = m_trackFitter->findTracks(*p_roids,
1655  tgcFitResult,
1656  trackPatterns,
1657  muonRoad);
1658  if (!sc.isSuccess()) {
1659  ATH_MSG_WARNING("Track fitter failed");
1660  continue;
1661  }
1662  trackFitterTimer.stop();
1663 
1664  }
1665 
1666  // fix if eta is strange
1667  TrigL2MuonSA::TrackPattern track = trackPatterns.back();
1668  const float ETA_LIMIT = 2.8;
1669  const float DELTA_ETA_LIMIT = 1.0;
1670  float roiEta = (*p_roi).eta();
1671  if (std::abs(track.pt) > ZERO_LIMIT
1672  && ( std::abs(track.etaMap) > ETA_LIMIT || std::abs(track.etaMap-roiEta) > DELTA_ETA_LIMIT ) ) {
1673  trackPatterns.back().etaMap = roiEta;
1674  }
1675 
1676  // Update monitoring variables
1677  sc = updateMonitor(p_roi, mdtHits_normal, trackPatterns );
1678  if (sc != StatusCode::SUCCESS) {
1679  ATH_MSG_WARNING("Failed to update monitoring variables");
1680  }
1681 
1682  // Update output trigger element
1683  if ( std::abs(trackPatterns.back().pt) > ZERO_LIMIT ) {
1684  storeMuonSA(p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1685  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1686  stgcHits, mmHits,
1687  trackPatterns.back(), outputSAs, ctx);
1689  muonCB->makePrivateStore();
1690  muonCB->setStrategy(0);
1691  muonCB->setErrorFlag(-9);
1692  muonCB->setPt(idtrack->pt());
1693  muonCB->setEta(idtrack->eta());
1694  muonCB->setPhi(idtrack->phi());
1695  muonCB->setCharge(idtrack->charge());
1696  ElementLink<xAOD::L2StandAloneMuonContainer> muonSAEL(outputSAs, outputSAs.size()-1);
1697  muonCB->setMuSATrackLink(muonSAEL);
1698  ElementLink<xAOD::TrackParticleContainer> idtrkEL(idtracks, idtrack_idx);
1699  muonCB->setIdTrackLink(idtrkEL);
1700  outputCBs.push_back(muonCB);
1701  }
1702 
1703  }
1704 
1705  if(outputSAs.size()==0) {
1706  ATH_MSG_DEBUG("outputSAs size = 0 -> push_back dummy");
1707  muonRoad.Clear();
1708  mdtRegion.Clear();
1709  rpcHits.clear();
1710  tgcHits.clear();
1711  rpcFitResult.Clear();
1712  tgcFitResult.Clear();
1713  mdtHits_normal.clear();
1714  cscHits.clear();
1715  stgcHits.clear();
1716  mmHits.clear();
1717  trackPatterns.clear();
1718  TrigL2MuonSA::TrackPattern trackPattern;
1719  storeMuonSA(p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1720  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1721  stgcHits, mmHits,
1722  trackPattern, outputSAs, ctx);
1724  muonCB->makePrivateStore();
1725  muonCB->setStrategy(-9);
1726  muonCB->setErrorFlag(-9);
1727  muonCB->setPt(0);
1728  muonCB->setEta(99999.);
1729  muonCB->setPhi(99999.);
1730  ElementLink<xAOD::L2StandAloneMuonContainer> muonSAEL(outputSAs, outputSAs.size()-1);
1731  muonCB->setMuSATrackLink(muonSAEL);
1732  outputCBs.push_back(muonCB);
1733  }
1734 
1735 
1736  ATH_MSG_DEBUG("outputSAs size: " << outputSAs.size());
1737  ATH_MSG_DEBUG("idtracks size: " << idtracks.size());
1738  for (auto outputSA : outputSAs){
1739  ATH_MSG_DEBUG("outputSA pt/eta/phi: " << outputSA->pt() << "/" << outputSA->etaMS() << "/" << outputSA->phiMS());
1740  }
1741 
1742  ATH_MSG_DEBUG("outputCBs size: " << outputCBs.size());
1743  for (auto outputCB : outputCBs){
1744  ATH_MSG_DEBUG("outputCB pt/eta/phi: " << outputCB->pt() << "/" << outputCB->eta() << "/" << outputCB->phi());
1745  }
1746 
1747  ++p_roids;
1748  if (p_roids==roids.end()) break;
1749  }
1750 
1751  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMuonSignatureIO success");
1752  return StatusCode::SUCCESS;
1753 }
1754 
1755 // findMuonSignature of L2 multi-track SA version
1756 // --------------------------------------------------------------------------------
1757 // --------------------------------------------------------------------------------
1758 
1759 StatusCode MuFastSteering::findMultiTrackSignature(const std::vector<const TrigRoiDescriptor*>& roids,
1760  const std::vector<const LVL1::RecMuonRoI*>& muonRoIs,
1761  DataVector<xAOD::L2StandAloneMuon>& outputTracks,
1762  const bool dynamicDeltaRpc,
1763  const EventContext& ctx) const
1764 {
1765  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMultiTrackSignature start");
1766  StatusCode sc = StatusCode::SUCCESS;
1767  const float ZERO_LIMIT = 1.e-5;
1768 
1769  // for RPC clustering and clusterRoad
1770  std::vector<TrigL2MuonSA::RpcFitResult> clusterFitResults;
1771  std::vector< TrigL2MuonSA::MuonRoad > clusterRoad;
1772  std::vector<TrigL2MuonSA::MdtHits> mdtHits_cluster_normal;
1773 
1774 
1775  auto prepTimer = Monitored::Timer( "TIME_Data_Preparator" );
1776  auto patternTimer = Monitored::Timer( "TIME_Pattern_Finder" );
1777  auto stationFitterTimer = Monitored::Timer( "TIME_Station_Fitter" );
1778  auto trackFitterTimer = Monitored::Timer( "TIME_Track_Fitter" );
1779  auto trackExtraTimer = Monitored::Timer( "TIME_Track_Extrapolator" );
1780  auto calibrationTimer = Monitored::Timer( "TIME_Calibration_Streamer" );
1781 
1782  auto monitorIt = Monitored::Group(m_monTool, prepTimer, patternTimer, stationFitterTimer,
1783  trackFitterTimer, trackExtraTimer, calibrationTimer );
1784 
1785  TrigL2MuonSA::RpcHits rpcHits;
1786  TrigL2MuonSA::TgcHits tgcHits;
1787  TrigL2MuonSA::MdtRegion mdtRegion;
1788  TrigL2MuonSA::MuonRoad muonRoad;
1789  TrigL2MuonSA::RpcFitResult rpcFitResult;
1790  TrigL2MuonSA::TgcFitResult tgcFitResult;
1791  TrigL2MuonSA::MdtHits mdtHits_normal;
1792  TrigL2MuonSA::MdtHits mdtHits_overlap;
1793  TrigL2MuonSA::CscHits cscHits;
1794  TrigL2MuonSA::StgcHits stgcHits;
1795  TrigL2MuonSA::MmHits mmHits;
1796 
1799 
1800  // muonRoIs = RecMURoIs, roids = MURoIs
1801  p_roids = roids.begin();
1802  for (p_roi=(muonRoIs).begin(); p_roi!=(muonRoIs).end(); ++p_roi) {
1803 
1804  prepTimer.start();
1805  std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
1806  rpcHits.clear();
1807  tgcHits.clear();
1808  mdtRegion.Clear();
1809  muonRoad.Clear();
1810  rpcFitResult.Clear();
1811  tgcFitResult.Clear();
1812  mdtHits_normal.clear();
1813  mdtHits_overlap.clear();
1814  cscHits.clear();
1815  stgcHits.clear();
1816  mmHits.clear();
1817 
1818  clusterFitResults.clear();
1819  clusterRoad.clear();
1820  mdtHits_cluster_normal.clear();
1821 
1822  if ( m_recMuonRoIUtils.isBarrel(*p_roi) ) { // Barrel
1823  ATH_MSG_DEBUG("Barrel");
1824 
1828 
1829  // Data preparation
1830  sc = m_dataPreparator->prepareData(*p_roi,
1831  *p_roids,
1832  clusterRoad,
1833  clusterFitResults,
1834  mdtHits_normal,
1835  mdtHits_overlap,
1836  mdtHits_cluster_normal,
1837  dynamicDeltaRpc);
1838 
1839  if (!sc.isSuccess()) {
1840  ATH_MSG_WARNING("Data preparation failed");
1841  continue;
1842  }
1843  ATH_MSG_DEBUG("clusterRoad size = " << clusterRoad.size());
1844 
1845  prepTimer.stop();
1846 
1847  for(unsigned int i_road = 0; i_road < clusterRoad.size(); i_road++){
1848  // Pattern finding
1849  std::vector<TrigL2MuonSA::TrackPattern> tmp_trkPats; tmp_trkPats.clear();
1850 
1851  patternTimer.start();
1852  sc = m_patternFinder->findPatterns(clusterRoad.at(i_road),
1853  mdtHits_cluster_normal.at(i_road),
1854  tmp_trkPats);
1855  if (!sc.isSuccess()) {
1856  ATH_MSG_WARNING("Pattern finder failed");
1857  continue;
1858  }
1859  patternTimer.stop();
1860 
1861  // Superpoint fit
1862  stationFitterTimer.start();
1863  sc = m_stationFitter->findSuperPoints(*p_roids,
1864  clusterRoad.at(i_road),
1865  clusterFitResults.at(i_road),
1866  tmp_trkPats);
1867  if (!sc.isSuccess()) {
1868  ATH_MSG_WARNING("Super point fitter failed");
1869  // Update output trigger element
1870  continue;
1871  }
1872  stationFitterTimer.stop();
1873 
1874  // Track fitting
1875  trackFitterTimer.start();
1876  sc = m_trackFitter->findTracks(*p_roids,
1877  clusterFitResults.at(i_road),
1878  tmp_trkPats);
1879 
1880  if (!sc.isSuccess()) {
1881  ATH_MSG_WARNING("Track fitter failed");
1882  continue;
1883  }
1884  trackFitterTimer.stop();
1885 
1886  // fix if eta is strange
1887  const float ETA_LIMIT = 2.8;
1888  const float DELTA_ETA_LIMIT = 1.0;
1889  for (TrigL2MuonSA::TrackPattern& track : tmp_trkPats) {
1890  float roiEta = (*p_roi)->eta();
1891  if (std::abs(track.pt) > ZERO_LIMIT
1892  && ( std::abs(track.etaMap) > ETA_LIMIT || std::abs(track.etaMap-roiEta) > DELTA_ETA_LIMIT ) ) {
1893  track.etaMap = roiEta;
1894  }
1895  }
1896 
1897  // Track extrapolation for ID combined
1898  trackExtraTimer.start();
1899 
1900  sc = m_trackExtrapolator->extrapolateTrack(tmp_trkPats, m_winPt);
1901  ATH_MSG_DEBUG("test trackExtrapolator end");
1902 
1903  if (sc != StatusCode::SUCCESS) {
1904  ATH_MSG_WARNING("Track extrapolator failed");
1905  // Update output trigger element
1906  continue;
1907  }
1908  trackExtraTimer.stop();
1909 
1910  if(tmp_trkPats.size() > 0){
1911  ATH_MSG_DEBUG("temp pT calculated 2mu-in-1RoI alg = " << tmp_trkPats[0].pt << " GeV");
1912  if( (std::abs(tmp_trkPats[0].barrelSagitta) < ZERO_LIMIT &&
1913  std::abs(tmp_trkPats[0].barrelRadius) < ZERO_LIMIT) ||
1914  std::abs(tmp_trkPats[0].pt) < ZERO_LIMIT )
1915  continue;
1916  trackPatterns.push_back(tmp_trkPats[0]);
1917  }
1918 
1919  storeMuonSA(*p_roi, *p_roids, clusterRoad.at(i_road), mdtRegion, rpcHits, tgcHits,
1920  clusterFitResults.at(i_road), tgcFitResult, mdtHits_cluster_normal.at(i_road), cscHits,
1921  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
1922 
1923  } // end the clusterRoad loop
1924  if(trackPatterns.empty()){
1925  ATH_MSG_DEBUG("multi-track SA falied to reconstruct muons");
1926  TrigL2MuonSA::TrackPattern trackPattern;
1927  trackPatterns.push_back(trackPattern);
1928  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1929  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1930  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
1931 
1932  continue;
1933  }
1934  } else { // Endcap
1935  ATH_MSG_DEBUG("Endcap");
1936  if(!m_doEndcapForl2mt){
1937  ATH_MSG_DEBUG("multi-track SA does nothings and skips for EndcapRoI");
1938  } else {
1939  prepTimer.start();
1940  // Data preparation
1941  sc = m_dataPreparator->prepareData(*p_roi,
1942  *p_roids,
1943  m_insideOut,
1944  tgcHits,
1945  muonRoad,
1946  mdtRegion,
1947  tgcFitResult,
1948  mdtHits_normal,
1949  mdtHits_overlap,
1950  cscHits,
1951  stgcHits,
1952  mmHits);
1953  if (!sc.isSuccess()) {
1954  ATH_MSG_WARNING("Data preparation failed");
1955  TrigL2MuonSA::TrackPattern trackPattern;
1956  trackPatterns.push_back(trackPattern);
1957  // Update output trigger element
1958  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1959  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1960  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
1961  continue;
1962  }
1963  prepTimer.stop();
1964 
1965  // Pattern finding
1966  patternTimer.start();
1967  sc = m_patternFinder->findPatterns(muonRoad,
1968  mdtHits_normal,
1969  stgcHits,
1970  mmHits,
1971  trackPatterns);
1972 
1973 
1974 
1975  if (!sc.isSuccess()) {
1976  ATH_MSG_WARNING("Pattern finder failed");
1977  // Update output trigger element
1978  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1979  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1980  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
1981  continue;
1982  }
1983  patternTimer.stop();
1984 
1985  // Superpoint fit
1986  stationFitterTimer.start();
1987  if(!m_use_new_segmentfit){
1988  sc = m_stationFitter->findSuperPointsSimple(*p_roids,
1989  muonRoad,
1990  tgcFitResult,
1991  trackPatterns,
1992  stgcHits,
1993  mmHits);
1994  }else{
1995  sc = m_stationFitter->findSuperPoints(*p_roids,
1996  muonRoad,
1997  tgcFitResult,
1998  trackPatterns,
1999  stgcHits,
2000  mmHits);
2001  }
2003  m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
2004 
2005  if (!sc.isSuccess()) {
2006  ATH_MSG_WARNING("Super point fitter failed");
2007  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2008  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2009  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2010  continue;
2011  }
2012 
2013  stationFitterTimer.stop();
2014 
2015  // Track fittingh
2016  trackFitterTimer.start();
2017  sc = m_trackFitter->findTracks(*p_roids,
2018  tgcFitResult,
2019  trackPatterns,
2020  muonRoad);
2021 
2022  if (!sc.isSuccess()) {
2023  ATH_MSG_WARNING("Track fitter failed");
2024  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2025  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2026  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2027  continue;
2028  }
2029  trackFitterTimer.stop();
2030 
2031  // fix if eta is strange
2032  const float ETA_LIMIT = 2.8;
2033  const float DELTA_ETA_LIMIT = 1.0;
2034  for (TrigL2MuonSA::TrackPattern& track : trackPatterns) {
2035  float roiEta = (*p_roi)->eta();
2036  if (std::abs(track.pt) > ZERO_LIMIT
2037  && ( std::abs(track.etaMap) > ETA_LIMIT || std::abs(track.etaMap-roiEta) > DELTA_ETA_LIMIT ) ) {
2038  track.etaMap = roiEta;
2039  }
2040  }
2041 
2042  // Track extrapolation for ID combined
2043  trackExtraTimer.start();
2044 
2045  sc = m_trackExtrapolator->extrapolateTrack(trackPatterns, m_winPt);
2046 
2047  if (sc != StatusCode::SUCCESS) {
2048  ATH_MSG_WARNING("Track extrapolator failed");
2049  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2050  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2051  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2052  continue;
2053  }
2054  trackExtraTimer.stop();
2055 
2056  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2057  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2058  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2059  }
2060  }
2061  // Update monitoring variables
2062  sc = updateMonitor(*p_roi, mdtHits_normal, trackPatterns );
2063  if (sc != StatusCode::SUCCESS) {
2064  ATH_MSG_WARNING("Failed to update monitoring variables");
2065  }
2066 
2067  ++p_roids;
2068  if (p_roids==roids.end()) break;
2069  }
2070 
2071  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMultiTrackSignature success");
2072  return StatusCode::SUCCESS;
2073 }
2074 
2075 // findMuonSignature of L2 multi-track SA version
2076 // --------------------------------------------------------------------------------
2077 // --------------------------------------------------------------------------------
2078 
2079 StatusCode MuFastSteering::findMultiTrackSignature(const std::vector<const TrigRoiDescriptor*>& roids,
2080  const std::vector<const xAOD::MuonRoI*>& muonRoIs,
2081  DataVector<xAOD::L2StandAloneMuon>& outputTracks,
2082  const bool dynamicDeltaRpc,
2083  const EventContext& ctx) const
2084 {
2085  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMultiTrackSignature start");
2086  StatusCode sc = StatusCode::SUCCESS;
2087  const float ZERO_LIMIT = 1.e-5;
2088 
2089  // for RPC clustering and clusterRoad
2090  std::vector<TrigL2MuonSA::RpcFitResult> clusterFitResults;
2091  std::vector< TrigL2MuonSA::MuonRoad > clusterRoad;
2092  std::vector<TrigL2MuonSA::MdtHits> mdtHits_cluster_normal;
2093 
2094 
2095  auto prepTimer = Monitored::Timer( "TIME_Data_Preparator" );
2096  auto patternTimer = Monitored::Timer( "TIME_Pattern_Finder" );
2097  auto stationFitterTimer = Monitored::Timer( "TIME_Station_Fitter" );
2098  auto trackFitterTimer = Monitored::Timer( "TIME_Track_Fitter" );
2099  auto trackExtraTimer = Monitored::Timer( "TIME_Track_Extrapolator" );
2100  auto calibrationTimer = Monitored::Timer( "TIME_Calibration_Streamer" );
2101 
2102  auto monitorIt = Monitored::Group(m_monTool, prepTimer, patternTimer, stationFitterTimer,
2103  trackFitterTimer, trackExtraTimer, calibrationTimer );
2104 
2105  TrigL2MuonSA::RpcHits rpcHits;
2106  TrigL2MuonSA::TgcHits tgcHits;
2107  TrigL2MuonSA::MdtRegion mdtRegion;
2108  TrigL2MuonSA::MuonRoad muonRoad;
2109  TrigL2MuonSA::RpcFitResult rpcFitResult;
2110  TrigL2MuonSA::TgcFitResult tgcFitResult;
2111  TrigL2MuonSA::MdtHits mdtHits_normal;
2112  TrigL2MuonSA::MdtHits mdtHits_overlap;
2113  TrigL2MuonSA::CscHits cscHits;
2114  TrigL2MuonSA::StgcHits stgcHits;
2115  TrigL2MuonSA::MmHits mmHits;
2116 
2119 
2120  // muonRoIs = RecMURoIs, roids = MURoIs
2121  p_roids = roids.begin();
2122  for (p_roi=(muonRoIs).begin(); p_roi!=(muonRoIs).end(); ++p_roi) {
2123 
2124  prepTimer.start();
2125  std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
2126  rpcHits.clear();
2127  tgcHits.clear();
2128  mdtRegion.Clear();
2129  muonRoad.Clear();
2130  rpcFitResult.Clear();
2131  tgcFitResult.Clear();
2132  mdtHits_normal.clear();
2133  mdtHits_overlap.clear();
2134  cscHits.clear();
2135  stgcHits.clear();
2136  mmHits.clear();
2137 
2138  clusterFitResults.clear();
2139  clusterRoad.clear();
2140  mdtHits_cluster_normal.clear();
2141 
2142  if ( m_recMuonRoIUtils.isBarrel(*p_roi) ) { // Barrel
2143  ATH_MSG_DEBUG("Barrel");
2144 
2148 
2149  // Data preparation
2150  sc = m_dataPreparator->prepareData(*p_roi,
2151  *p_roids,
2152  clusterRoad,
2153  clusterFitResults,
2154  mdtHits_normal,
2155  mdtHits_overlap,
2156  mdtHits_cluster_normal,
2157  dynamicDeltaRpc);
2158 
2159  if (!sc.isSuccess()) {
2160  ATH_MSG_WARNING("Data preparation failed");
2161  continue;
2162  }
2163  ATH_MSG_DEBUG("clusterRoad size = " << clusterRoad.size());
2164 
2165  prepTimer.stop();
2166 
2167  for(unsigned int i_road = 0; i_road < clusterRoad.size(); i_road++){
2168  // Pattern finding
2169  std::vector<TrigL2MuonSA::TrackPattern> tmp_trkPats; tmp_trkPats.clear();
2170 
2171  patternTimer.start();
2172  sc = m_patternFinder->findPatterns(clusterRoad.at(i_road),
2173  mdtHits_cluster_normal.at(i_road),
2174  tmp_trkPats);
2175  if (!sc.isSuccess()) {
2176  ATH_MSG_WARNING("Pattern finder failed");
2177  continue;
2178  }
2179  patternTimer.stop();
2180 
2181  // Superpoint fit
2182  stationFitterTimer.start();
2183  sc = m_stationFitter->findSuperPoints(*p_roids,
2184  clusterRoad.at(i_road),
2185  clusterFitResults.at(i_road),
2186  tmp_trkPats);
2187  if (!sc.isSuccess()) {
2188  ATH_MSG_WARNING("Super point fitter failed");
2189  // Update output trigger element
2190  continue;
2191  }
2192  stationFitterTimer.stop();
2193 
2194  // Track fitting
2195  trackFitterTimer.start();
2196  sc = m_trackFitter->findTracks(*p_roids,
2197  clusterFitResults.at(i_road),
2198  tmp_trkPats);
2199 
2200  if (!sc.isSuccess()) {
2201  ATH_MSG_WARNING("Track fitter failed");
2202  continue;
2203  }
2204  trackFitterTimer.stop();
2205 
2206  // fix if eta is strange
2207  const float ETA_LIMIT = 2.8;
2208  const float DELTA_ETA_LIMIT = 1.0;
2209  for (TrigL2MuonSA::TrackPattern& track : tmp_trkPats) {
2210  float roiEta = (*p_roi)->eta();
2211  if (std::abs(track.pt) > ZERO_LIMIT
2212  && ( std::abs(track.etaMap) > ETA_LIMIT || std::abs(track.etaMap-roiEta) > DELTA_ETA_LIMIT ) ) {
2213  track.etaMap = roiEta;
2214  }
2215  }
2216 
2217  // Track extrapolation for ID combined
2218  trackExtraTimer.start();
2219 
2220  sc = m_trackExtrapolator->extrapolateTrack(tmp_trkPats, m_winPt);
2221  ATH_MSG_DEBUG("test trackExtrapolator end");
2222 
2223  if (sc != StatusCode::SUCCESS) {
2224  ATH_MSG_WARNING("Track extrapolator failed");
2225  // Update output trigger element
2226  continue;
2227  }
2228  trackExtraTimer.stop();
2229 
2230  if(tmp_trkPats.size() > 0){
2231  ATH_MSG_DEBUG("temp pT calculated 2mu-in-1RoI alg = " << tmp_trkPats[0].pt << " GeV");
2232  if( (std::abs(tmp_trkPats[0].barrelSagitta) < ZERO_LIMIT &&
2233  std::abs(tmp_trkPats[0].barrelRadius) < ZERO_LIMIT) ||
2234  std::abs(tmp_trkPats[0].pt) < ZERO_LIMIT )
2235  continue;
2236  trackPatterns.push_back(tmp_trkPats[0]);
2237  }
2238 
2239  storeMuonSA(*p_roi, *p_roids, clusterRoad.at(i_road), mdtRegion, rpcHits, tgcHits,
2240  clusterFitResults.at(i_road), tgcFitResult, mdtHits_cluster_normal.at(i_road), cscHits,
2241  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2242 
2243  } // end the clusterRoad loop
2244  if(trackPatterns.empty()){
2245  ATH_MSG_DEBUG("multi-track SA falied to reconstruct muons");
2246  TrigL2MuonSA::TrackPattern trackPattern;
2247  trackPatterns.push_back(trackPattern);
2248  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2249  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2250  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2251 
2252  continue;
2253  }
2254  } else { // Endcap
2255  ATH_MSG_DEBUG("Endcap");
2256  if(!m_doEndcapForl2mt){
2257  ATH_MSG_DEBUG("multi-track SA does nothings and skips for EndcapRoI");
2258  } else {
2259  prepTimer.start();
2260  // Data preparation
2261  sc = m_dataPreparator->prepareData(*p_roi,
2262  *p_roids,
2263  m_insideOut,
2264  tgcHits,
2265  muonRoad,
2266  mdtRegion,
2267  tgcFitResult,
2268  mdtHits_normal,
2269  mdtHits_overlap,
2270  cscHits,
2271  stgcHits,
2272  mmHits);
2273  if (!sc.isSuccess()) {
2274  ATH_MSG_WARNING("Data preparation failed");
2275  TrigL2MuonSA::TrackPattern trackPattern;
2276  trackPatterns.push_back(trackPattern);
2277  // Update output trigger element
2278  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2279  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2280  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2281  continue;
2282  }
2283  prepTimer.stop();
2284 
2285  // Pattern finding
2286  patternTimer.start();
2287  sc = m_patternFinder->findPatterns(muonRoad,
2288  mdtHits_normal,
2289  stgcHits,
2290  mmHits,
2291  trackPatterns);
2292 
2293 
2294 
2295  if (!sc.isSuccess()) {
2296  ATH_MSG_WARNING("Pattern finder failed");
2297  // Update output trigger element
2298  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2299  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2300  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2301  continue;
2302  }
2303  patternTimer.stop();
2304 
2305  // Superpoint fit
2306  stationFitterTimer.start();
2307  if(!m_use_new_segmentfit){
2308  sc = m_stationFitter->findSuperPointsSimple(*p_roids,
2309  muonRoad,
2310  tgcFitResult,
2311  trackPatterns,
2312  stgcHits,
2313  mmHits);
2314  }else{
2315  sc = m_stationFitter->findSuperPoints(*p_roids,
2316  muonRoad,
2317  tgcFitResult,
2318  trackPatterns,
2319  stgcHits,
2320  mmHits);
2321  }
2323  m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
2324 
2325  if (!sc.isSuccess()) {
2326  ATH_MSG_WARNING("Super point fitter failed");
2327  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2328  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2329  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2330  continue;
2331  }
2332 
2333  stationFitterTimer.stop();
2334 
2335  // Track fittingh
2336  trackFitterTimer.start();
2337  sc = m_trackFitter->findTracks(*p_roids,
2338  tgcFitResult,
2339  trackPatterns,
2340  muonRoad);
2341 
2342  if (!sc.isSuccess()) {
2343  ATH_MSG_WARNING("Track fitter failed");
2344  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2345  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2346  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2347  continue;
2348  }
2349  trackFitterTimer.stop();
2350 
2351  // fix if eta is strange
2352  const float ETA_LIMIT = 2.8;
2353  const float DELTA_ETA_LIMIT = 1.0;
2354  for (TrigL2MuonSA::TrackPattern& track : trackPatterns) {
2355  float roiEta = (*p_roi)->eta();
2356  if (std::abs(track.pt) > ZERO_LIMIT
2357  && ( std::abs(track.etaMap) > ETA_LIMIT || std::abs(track.etaMap-roiEta) > DELTA_ETA_LIMIT ) ) {
2358  track.etaMap = roiEta;
2359  }
2360  }
2361 
2362  // Track extrapolation for ID combined
2363  trackExtraTimer.start();
2364 
2365  sc = m_trackExtrapolator->extrapolateTrack(trackPatterns, m_winPt);
2366 
2367  if (sc != StatusCode::SUCCESS) {
2368  ATH_MSG_WARNING("Track extrapolator failed");
2369  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2370  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2371  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2372  continue;
2373  }
2374  trackExtraTimer.stop();
2375 
2376  storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2377  rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2378  stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2379  }
2380  }
2381  // Update monitoring variables
2382  sc = updateMonitor(*p_roi, mdtHits_normal, trackPatterns );
2383  if (sc != StatusCode::SUCCESS) {
2384  ATH_MSG_WARNING("Failed to update monitoring variables");
2385  }
2386 
2387  ++p_roids;
2388  if (p_roids==roids.end()) break;
2389  }
2390 
2391  ATH_MSG_DEBUG("StatusCode MuFastSteering::findMultiTrackSignature success");
2392  return StatusCode::SUCCESS;
2393 }
2394 
2395 // --------------------------------------------------------------------------------
2396 // --------------------------------------------------------------------------------
2397 
2399  const TrigRoiDescriptor* roids,
2400  const TrigL2MuonSA::MuonRoad& muonRoad,
2401  const TrigL2MuonSA::MdtRegion& mdtRegion,
2402  const TrigL2MuonSA::RpcHits& rpcHits,
2403  const TrigL2MuonSA::TgcHits& tgcHits,
2404  const TrigL2MuonSA::RpcFitResult& rpcFitResult,
2405  const TrigL2MuonSA::TgcFitResult& tgcFitResult,
2406  const TrigL2MuonSA::MdtHits& mdtHits,
2407  const TrigL2MuonSA::CscHits& cscHits,
2408  const TrigL2MuonSA::StgcHits& stgcHits,
2409  const TrigL2MuonSA::MmHits& mmHits,
2410  const std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns,
2411  DataVector<xAOD::L2StandAloneMuon>& outputTracks,
2412  TrigRoiDescriptorCollection& outputID,
2413  TrigRoiDescriptorCollection& outputMS,
2414  const EventContext& ctx) const
2415 {
2416 
2417  if( trackPatterns.size() > 0 ) {
2418 
2419  const TrigL2MuonSA::TrackPattern& pattern = trackPatterns.back();
2420 
2421  // Update output trigger element
2422  storeMuonSA(roi, roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2423  rpcFitResult, tgcFitResult, mdtHits, cscHits,
2424  stgcHits, mmHits,
2425  pattern, outputTracks, ctx);
2426  storeMSRoiDescriptor(roids, pattern, outputTracks, outputMS);
2427  storeIDRoiDescriptor(roids, pattern, outputTracks, outputID);
2428 
2429  } else {
2430  ATH_MSG_DEBUG("Not update output objects because trackPatterns has no object");
2431  }
2432 
2433  return true;
2434 }
2435 
2436 // --------------------------------------------------------------------------------
2437 // --------------------------------------------------------------------------------
2438 
2440  const TrigRoiDescriptor* roids,
2441  const TrigL2MuonSA::MuonRoad& muonRoad,
2442  const TrigL2MuonSA::MdtRegion& mdtRegion,
2443  const TrigL2MuonSA::RpcHits& rpcHits,
2444  const TrigL2MuonSA::TgcHits& tgcHits,
2445  const TrigL2MuonSA::RpcFitResult& rpcFitResult,
2446  const TrigL2MuonSA::TgcFitResult& tgcFitResult,
2447  const TrigL2MuonSA::MdtHits& mdtHits,
2448  const TrigL2MuonSA::CscHits& cscHits,
2449  const TrigL2MuonSA::StgcHits& stgcHits,
2450  const TrigL2MuonSA::MmHits& mmHits,
2451  const std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns,
2452  DataVector<xAOD::L2StandAloneMuon>& outputTracks,
2453  TrigRoiDescriptorCollection& outputID,
2454  TrigRoiDescriptorCollection& outputMS,
2455  const EventContext& ctx) const
2456 {
2457 
2458  if( trackPatterns.size() > 0 ) {
2459 
2460  const TrigL2MuonSA::TrackPattern& pattern = trackPatterns.back();
2461 
2462  // Update output trigger element
2463  storeMuonSA(roi, roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2464  rpcFitResult, tgcFitResult, mdtHits, cscHits,
2465  stgcHits, mmHits,
2466  pattern, outputTracks, ctx);
2467  storeMSRoiDescriptor(roids, pattern, outputTracks, outputMS);
2468  storeIDRoiDescriptor(roids, pattern, outputTracks, outputID);
2469 
2470  } else {
2471  ATH_MSG_DEBUG("Not update output objects because trackPatterns has no object");
2472  }
2473 
2474  return true;
2475 }
2476 
2477 
2479  const TrigRoiDescriptor* roids,
2480  const TrigL2MuonSA::MuonRoad& muonRoad,
2481  const TrigL2MuonSA::MdtRegion& mdtRegion,
2482  const TrigL2MuonSA::RpcHits& rpcHits,
2483  const TrigL2MuonSA::TgcHits& tgcHits,
2484  const TrigL2MuonSA::RpcFitResult& rpcFitResult,
2485  const TrigL2MuonSA::TgcFitResult& tgcFitResult,
2486  const TrigL2MuonSA::MdtHits& mdtHits,
2487  const TrigL2MuonSA::CscHits& cscHits,
2488  const TrigL2MuonSA::StgcHits& stgcHits,
2489  const TrigL2MuonSA::MmHits& mmHits,
2491  DataVector<xAOD::L2StandAloneMuon>& outputTracks,
2492  const EventContext& ctx ) const
2493 {
2494  const float ZERO_LIMIT = 1.e-5;
2495 
2496  const int currentRoIId = roids->roiId();
2497 
2498  const EventIDBase& eventID = ctx.eventID();
2499  auto eventInfo = SG::makeHandle(m_eventInfoKey, ctx);
2500  if (!eventInfo.isValid()) {
2501  ATH_MSG_ERROR("Failed to retrieve xAOD::EventInfo object");
2502  return false;
2503  }
2504 
2505  int inner = 0;
2506  int middle = 1;
2507  int outer = 2;
2508  int ee = 6;
2509  int csc = 7;
2510  int barrelinner = 0;
2511  int endcapinner = 3;
2512  int bee = 8;
2513  int bme = 9;
2514  // int bmg = 10;
2515 
2516  // define inner, middle, outer
2517  if (pattern.s_address==-1) {
2524  } else {
2530  }
2531 
2532  ATH_MSG_DEBUG("### Hit patterns at the Muon Spectrometer ###");
2533  ATH_MSG_DEBUG("pattern#0: # of hits at inner =" << pattern.mdtSegments[inner].size());
2534  ATH_MSG_DEBUG("pattern#0: # of hits at middle =" << pattern.mdtSegments[middle].size());
2535  ATH_MSG_DEBUG("pattern#0: # of hits at outer =" << pattern.mdtSegments[outer].size());
2536  if (pattern.s_address==-1){
2537  ATH_MSG_DEBUG("pattern#0: # of hits at ee =" << pattern.mdtSegments[ee].size());
2538  ATH_MSG_DEBUG("pattern#0: # of hits at endcap barrel inner =" << pattern.mdtSegments[barrelinner].size());
2539  ATH_MSG_DEBUG("pattern#0: # of hits at BEE =" << pattern.mdtSegments[bee].size());
2540  } else {
2541  ATH_MSG_DEBUG("pattern#0: # of hits at BME =" << pattern.mdtSegments[bme].size());
2542  ATH_MSG_DEBUG("pattern#0: # of hits at barrel endcap inner =" << pattern.mdtSegments[endcapinner].size());
2543  }
2544  ATH_MSG_DEBUG("### ************************************* ###");
2545  ATH_MSG_DEBUG("Estimated muon pt = " << pattern.pt << " GeV");
2546 
2547  // ---------
2548  // store xAOD
2549 
2551  muonSA->makePrivateStore();
2552 
2553  // add pT
2554  muonSA->setPt(pattern.pt*pattern.charge);
2555  muonSA->setPtEndcapAlpha(pattern.ptEndcapAlpha*pattern.charge);
2556  muonSA->setPtEndcapBeta(pattern.ptEndcapBeta*pattern.charge);
2557  muonSA->setPtEndcapRadius(pattern.ptEndcapRadius*pattern.charge);
2558  muonSA->setPtCSC(pattern.ptCSC*pattern.charge);
2559 
2560  muonSA->setEta(pattern.etaVtx);
2561  muonSA->setPhi(pattern.phiVtx);
2562  muonSA->setDeltaPt(pattern.deltaPt);
2563  muonSA->setDeltaEta(pattern.deltaEtaVtx);
2564  muonSA->setDeltaPhi(pattern.deltaPhiVtx);
2565 
2566  // add s_address
2567  muonSA->setSAddress(pattern.s_address);
2568 
2569  // add positions at MS
2570  muonSA->setEtaMS(pattern.etaMap);
2571  muonSA->setPhiMS(pattern.phiMS);
2572  muonSA->setDirPhiMS(pattern.phiMSDir);
2573  muonSA->setRMS(pattern.superPoints[inner].R);
2574  muonSA->setZMS(pattern.superPoints[inner].Z);
2575  muonSA->setDirZMS(pattern.superPoints[inner].Alin);
2576 
2577  // add pt variables
2578  // Endcap
2579  muonSA->setEndcapAlpha(pattern.endcapAlpha);
2580  muonSA->setEndcapBeta(pattern.endcapBeta);
2581  muonSA->setEndcapRadius(pattern.endcapRadius3P);
2582  // Barrel
2583  muonSA->setBarrelRadius(pattern.barrelRadius);
2584  muonSA->setBarrelSagitta(pattern.barrelSagitta);
2585 
2586  // store eta and phi used as argument to pT LUT
2587  muonSA->setEtaMap(pattern.etaMap);
2588  muonSA->setPhiMap(pattern.phiMap);
2589  muonSA->setEtaBin(pattern.etaBin);
2590  muonSA->setPhiBin(pattern.phiBin);
2591 
2592  // store TGC/RPC readout failure flags
2593  muonSA->setIsTgcFailure((int)pattern.isTgcFailure);
2594  muonSA->setIsRpcFailure((int)pattern.isRpcFailure);
2595 
2596  // add superpoints
2597  muonSA->setSuperPoint(inner, pattern.superPoints[inner].R, pattern.superPoints[inner].Z,
2598  pattern.superPoints[inner].Alin, pattern.superPoints[inner].Blin, pattern.superPoints[inner].Chi2);
2599  muonSA->setSuperPoint(middle, pattern.superPoints[middle].R, pattern.superPoints[middle].Z,
2600  pattern.superPoints[middle].Alin, pattern.superPoints[middle].Blin, pattern.superPoints[middle].Chi2);
2601  muonSA->setSuperPoint(outer, pattern.superPoints[outer].R, pattern.superPoints[outer].Z,
2602  pattern.superPoints[outer].Alin, pattern.superPoints[outer].Blin, pattern.superPoints[outer].Chi2);
2603  if (pattern.s_address==-1){
2604  muonSA->setSuperPoint(ee, pattern.superPoints[ee].R, pattern.superPoints[ee].Z,
2605  pattern.superPoints[ee].Alin, pattern.superPoints[ee].Blin, pattern.superPoints[ee].Chi2);
2606  muonSA->setSuperPoint(barrelinner, pattern.superPoints[barrelinner].R, pattern.superPoints[barrelinner].Z,
2607  pattern.superPoints[barrelinner].Alin, pattern.superPoints[barrelinner].Blin, pattern.superPoints[barrelinner].Chi2);
2608  muonSA->setSuperPoint(csc, pattern.superPoints[csc].R, pattern.superPoints[csc].Z,
2609  pattern.superPoints[csc].Alin, pattern.superPoints[csc].Blin, pattern.superPoints[csc].Chi2);
2610  } else {
2611  muonSA->setSuperPoint(endcapinner, pattern.superPoints[endcapinner].R, pattern.superPoints[endcapinner].Z,
2612  pattern.superPoints[endcapinner].Alin, pattern.superPoints[endcapinner].Blin, pattern.superPoints[endcapinner].Chi2);
2613  }
2614 
2616  // Below are detailed information
2617 
2618  uint32_t muondetmask = 0;
2619 
2621  muonSA->setAlgoId( L2MuonAlgoMap(name()) );
2623  //muonSA->setTeId( inputTE->getId() ); // move to hltExecute()
2625  muonSA->setLvl1Id( eventInfo->extendedLevel1ID() );
2627  muonSA->setLumiBlock( eventID.lumi_block() );
2629  muonSA->setMuonDetMask( muondetmask );
2631  muonSA->setRoiId( currentRoIId );
2633  muonSA->setRoiSystem( roi->sysID() );
2635  muonSA->setRoiSubsystem( roi->subsysID() );
2637  muonSA->setRoiSector( roi->sectorID() );
2639  muonSA->setRoiNumber( roi->getRoINumber() );
2641  muonSA->setRoiThreshold( roi->getThresholdNumber() );
2643  muonSA->setRoiEta( roi->eta() );
2645  muonSA->setRoiPhi( roi->phi() );
2647  muonSA->setRoIWord( roi->roiWord() );
2648 
2656 
2657  // MDT hits
2658  std::vector<std::string> mdtId;
2659  for (const TrigL2MuonSA::MdtHitData& mdtHit : mdtHits) {
2660  if ( mdtHit.isOutlier==0 || mdtHit.isOutlier==1 ) {
2661  muonSA->setMdtHit(mdtHit.OnlineId, mdtHit.isOutlier, mdtHit.Chamber,
2662  mdtHit.R, mdtHit.Z, mdtHit.cPhi0, mdtHit.Residual,
2663  mdtHit.DriftTime, mdtHit.DriftSpace, mdtHit.DriftSigma);
2664  mdtId.push_back(mdtHit.Id.getString());
2665  }
2666  }
2667  SG::AuxElement::Accessor< std::vector<std::string> > accessor_mdthitid( "mdtHitId" );
2668  accessor_mdthitid( *muonSA ) = mdtId;
2669 
2670  //CSC hits
2671  std::vector<float> cscResol;
2672  for (const TrigL2MuonSA::CscHitData& cscHit : cscHits) {
2673  if ( 1/*cscHit.MeasuresPhi==0*/ ){
2674  if ( cscHit.isOutlier==0 || cscHit.isOutlier==1 ) {
2675  muonSA->setCscHit(cscHit.isOutlier, cscHit.Chamber, cscHit.StationName,
2676  cscHit.StationEta, cscHit.StationPhi,
2677  cscHit.ChamberLayer, cscHit.WireLayer, cscHit.MeasuresPhi, cscHit.Strip,
2678  cscHit.eta, cscHit.phi, cscHit.r, cscHit.z,
2679  cscHit.charge, cscHit.time, cscHit.Residual);
2680  cscResol.push_back(cscHit.resolution);
2681  ATH_MSG_VERBOSE("CSC Hits stored in xAOD: "
2682  << "OL=" << cscHit.isOutlier << ","
2683  << "Ch=" << cscHit.Chamber << ","
2684  << "StationName=" << cscHit.StationName << ","
2685  << "StationEta=" << cscHit.StationEta << ","
2686  << "StationPhi=" << cscHit.StationPhi << ","
2687  << "ChamberLayer=" << cscHit.ChamberLayer << ","
2688  << "WireLayer=" << cscHit.WireLayer << ","
2689  << "MeasuresPhi=" << cscHit.MeasuresPhi << ","
2690  << "Strip=" << cscHit.Strip << ","
2691  << "eta=" << cscHit.eta << ","
2692  << "phi=" << cscHit.phi << ","
2693  << "r=" << cscHit.r << ","
2694  << "z=" << cscHit.z << ","
2695  << "charge=" << cscHit.charge << ","
2696  << "Rs=" << cscHit.Residual << ","
2697  << "t=" << cscHit.time);
2698  }
2699  }
2700  }
2701  SG::AuxElement::Accessor< std::vector<float> > accessor_cschitresol( "cscHitResolution" );
2702  accessor_cschitresol( *muonSA ) = cscResol;
2703 
2704  // RPC hits
2705  float sumbeta[8]={0};
2706  float nhit_layer[8]={0};
2707  for (const TrigL2MuonSA::RpcHitData& rpcHit : rpcHits) {
2708  muonSA->setRpcHit(rpcHit.layer, rpcHit.measuresPhi,
2709  rpcHit.x, rpcHit.y, rpcHit.z,
2710  rpcHit.time, rpcHit.distToEtaReadout, rpcHit.distToPhiReadout,
2711  rpcHit.stationName);
2712  ATH_MSG_VERBOSE("RPC hits stored in xAOD: "
2713  << "stationName=" << rpcHit.stationName << ","
2714  << "layer=" << rpcHit.layer << ","
2715  << "measuresPhi=" << rpcHit.measuresPhi << ","
2716  << "x=" << rpcHit.x << ","
2717  << "y=" << rpcHit.y << ","
2718  << "y=" << rpcHit.z);
2719 
2720  float dRMS = std::sqrt( std::abs(pattern.etaMap-rpcHit.eta)*std::abs(pattern.etaMap-rpcHit.eta) + std::acos(std::cos(pattern.phiMS-rpcHit.phi))*std::acos(std::cos(pattern.phiMS-rpcHit.phi)) );
2721  if(dRMS>0.05) continue;
2722  float muToF = rpcHit.l/1000/(CLHEP::c_light/1000);
2723  float Tprop = rpcHit.distToPhiReadout/1000*4.8;
2724  float beta = rpcHit.l/1000/(muToF+rpcHit.time-Tprop+3.125/2)/(CLHEP::c_light/1000);
2725  sumbeta[rpcHit.layer]=sumbeta[rpcHit.layer]+beta;
2726  nhit_layer[rpcHit.layer]=nhit_layer[rpcHit.layer]+1;
2727  }
2728 
2729  std::vector<float> Avebeta_layer;
2730  for(int i_layer=0;i_layer<8;i_layer++){
2731  if(nhit_layer[i_layer]!=0)Avebeta_layer.push_back( sumbeta[i_layer]/nhit_layer[i_layer] );
2732  }
2733  if(Avebeta_layer.size()>0) muonSA->setBeta( std::accumulate(Avebeta_layer.begin(),Avebeta_layer.end(),0.0)/Avebeta_layer.size() );
2734  else muonSA->setBeta( 9999 );
2735  Avebeta_layer.clear();
2736 
2737  // TGC hits
2738  for (const TrigL2MuonSA::TgcHitData& tgcHit : tgcHits) {
2739  muonSA->setTgcHit(tgcHit.eta, tgcHit.phi, tgcHit.r, tgcHit.z,
2740  tgcHit.width, tgcHit.sta, tgcHit.isStrip,
2741  tgcHit.bcTag, tgcHit.inRoad);
2742  ATH_MSG_VERBOSE("TGC hits stored in xAOD: "
2743  << "eta=" << tgcHit.eta << ","
2744  << "phi=" << tgcHit.phi << ","
2745  << "r=" << tgcHit.r << ","
2746  << "z=" << tgcHit.z << ","
2747  << "width=" << tgcHit.width << ","
2748  << "stationNum=" << tgcHit.sta << ","
2749  << "isStrip=" << tgcHit.isStrip << ","
2750  << "bcTag=" << tgcHit.bcTag << ","
2751  << "inRoad=" << tgcHit.inRoad);
2752  }
2753 
2754 
2755  // sTGC clusters
2756  for(unsigned int i_hit=0; i_hit<stgcHits.size(); i_hit++) {
2757  if ( stgcHits[i_hit].isOutlier==0 || stgcHits[i_hit].isOutlier==1 ) {
2758 
2759 
2760  muonSA->setStgcCluster(stgcHits[i_hit].layerNumber, stgcHits[i_hit].isOutlier, stgcHits[i_hit].channelType,
2761  stgcHits[i_hit].eta, stgcHits[i_hit].phi, stgcHits[i_hit].r, stgcHits[i_hit].z,
2762  stgcHits[i_hit].ResidualR, stgcHits[i_hit].ResidualPhi,
2763  stgcHits[i_hit].stationEta, stgcHits[i_hit].stationPhi, stgcHits[i_hit].stationName);
2764 
2765  ATH_MSG_VERBOSE("sTGC hits stored in xAOD: "
2766  << "eta=" << stgcHits[i_hit].eta << ","
2767  << "phi=" << stgcHits[i_hit].phi << ","
2768  << "r=" << stgcHits[i_hit].r << ","
2769  << "z=" << stgcHits[i_hit].z << ","
2770  << "z=" << stgcHits[i_hit].ResidualR << ","
2771  << "z=" << stgcHits[i_hit].ResidualPhi);
2772  }
2773  }
2774 
2775  // MM clusters
2776  for(unsigned int i_hit=0; i_hit<mmHits.size(); i_hit++) {
2777  if ( mmHits[i_hit].isOutlier==0 || mmHits[i_hit].isOutlier==1 ) {
2778 
2779 
2780  muonSA->setMmCluster(mmHits[i_hit].layerNumber, mmHits[i_hit].isOutlier,
2781  mmHits[i_hit].eta, mmHits[i_hit].phi, mmHits[i_hit].r, mmHits[i_hit].z,
2782  mmHits[i_hit].ResidualR, mmHits[i_hit].ResidualPhi,
2783  mmHits[i_hit].stationEta, mmHits[i_hit].stationPhi, mmHits[i_hit].stationName);
2784 
2785  ATH_MSG_VERBOSE("mm hits stored in xAOD: "
2786  << "eta=" << tgcHits[i_hit].eta << ","
2787  << "phi=" << tgcHits[i_hit].phi << ","
2788  << "r=" << tgcHits[i_hit].r << ","
2789  << "z=" << tgcHits[i_hit].z << ","
2790  << "width=" << tgcHits[i_hit].width << ","
2791  << "stationNum=" << tgcHits[i_hit].sta << ","
2792  << "isStrip=" << tgcHits[i_hit].isStrip << ","
2793  << "bcTag=" << tgcHits[i_hit].bcTag << ","
2794  << "inRoad=" << tgcHits[i_hit].inRoad);
2795  }
2796  }
2797 
2798 
2799 
2800 
2801  // Muon road
2802  for (int i_station=0; i_station<8; i_station++) {
2803  for (int i_sector=0; i_sector<2; i_sector++) {
2804  muonSA->setRoad(i_station, i_sector, muonRoad.aw[i_station][i_sector], muonRoad.bw[i_station][i_sector]);
2805  muonSA->setRegionZ(i_station, i_sector, mdtRegion.zMin[i_station][i_sector], mdtRegion.zMax[i_station][i_sector]);
2806  muonSA->setRegionR(i_station, i_sector, mdtRegion.rMin[i_station][i_sector], mdtRegion.rMax[i_station][i_sector]);
2807  muonSA->setRegionEta(i_station, i_sector, mdtRegion.etaMin[i_station][i_sector], mdtRegion.etaMax[i_station][i_sector]);
2808  muonSA->setChamberType1(i_station, i_sector, mdtRegion.chamberType[i_station][i_sector][0]);
2809  muonSA->setChamberType2(i_station, i_sector, mdtRegion.chamberType[i_station][i_sector][1]);
2810  }
2811  }
2812 
2813  if ( muonRoad.isEndcap ) {
2814  // TGC fit results
2815  if (tgcFitResult.isSuccess ) {
2816  muonSA->setTgcPt(tgcFitResult.tgcPT);
2817 
2818  muonSA->setTgcInn(tgcFitResult.tgcInn[0], tgcFitResult.tgcInn[1],
2819  tgcFitResult.tgcInn[2], tgcFitResult.tgcInn[3]);
2820  muonSA->setTgcInnF(tgcFitResult.tgcInnRhoStd, tgcFitResult.tgcInnRhoNin,
2821  tgcFitResult.tgcInnPhiStd, tgcFitResult.tgcInnPhiNin);
2822 
2823  muonSA->setTgcMid1(tgcFitResult.tgcMid1[0], tgcFitResult.tgcMid1[1],
2824  tgcFitResult.tgcMid1[2], tgcFitResult.tgcMid1[3]);
2825  muonSA->setTgcMid2(tgcFitResult.tgcMid2[0], tgcFitResult.tgcMid2[1],
2826  tgcFitResult.tgcMid2[2], tgcFitResult.tgcMid2[3]);
2827  muonSA->setTgcMidF(tgcFitResult.tgcMidRhoChi2, tgcFitResult.tgcMidRhoNin,
2828  tgcFitResult.tgcMidPhiChi2, tgcFitResult.tgcMidPhiNin);
2829  }
2830  } else {
2831  // RPC fit results
2832  if (rpcFitResult.isSuccess ) {
2833  // Fill middle fit results for the moment
2834 
2835  muonSA->setRpcFitInn(rpcFitResult.phi_inner, rpcFitResult.slope_inner, rpcFitResult.offset_inner);
2836  muonSA->setRpcFitMid(rpcFitResult.phi_middle, rpcFitResult.slope_middle, rpcFitResult.offset_middle);
2837  muonSA->setRpcFitOut(rpcFitResult.phi_outer, rpcFitResult.slope_outer, rpcFitResult.offset_outer);
2838  }
2839  }
2840 
2841  // Store track positions if set of (R, Z, eta, phi) are all available
2842  if (pattern.s_address==-1) { // endcap
2843 
2844  // Inner
2845  if ( std::abs(pattern.superPoints[inner].R) > ZERO_LIMIT && std::abs(pattern.superPoints[inner].Z) > ZERO_LIMIT ) { // if R and Z exist
2846  if ( tgcFitResult.isSuccess && std::abs(tgcFitResult.tgcInn[3]) > ZERO_LIMIT ) { // if phi exist
2847  float theta = std::atan(pattern.superPoints[inner].R/std::abs(pattern.superPoints[inner].Z));
2848  float eta = (std::tan(theta/2.)!=0.)? -std::log(std::tan(theta/2.))*pattern.superPoints[inner].Z/std::abs(pattern.superPoints[inner].Z): 0.;
2849  muonSA->setTrackPosition( pattern.superPoints[inner].R, pattern.superPoints[inner].Z, eta, tgcFitResult.tgcInn[1] );
2850  }
2851  }
2852 
2853  // Middle
2854  if ( std::abs(pattern.superPoints[middle].R) > ZERO_LIMIT && std::abs(pattern.superPoints[middle].Z) > ZERO_LIMIT ) { // if R and Z exist
2855  float phi = 0;
2856  if (tgcFitResult.isSuccess && ( std::abs(tgcFitResult.tgcMid1[3]) > ZERO_LIMIT || std::abs(tgcFitResult.tgcMid2[3]) > ZERO_LIMIT )) { // if phi exist
2857  double phi1 = tgcFitResult.tgcMid1[1];
2858  double phi2 = tgcFitResult.tgcMid2[1];
2859  if ( tgcFitResult.tgcMid1[3]==0. || tgcFitResult.tgcMid2[3]==0. ) {
2860  if ( std::abs(tgcFitResult.tgcMid1[3]) > ZERO_LIMIT ) phi = phi1;
2861  if ( std::abs(tgcFitResult.tgcMid2[3]) > ZERO_LIMIT ) phi = phi2;
2862  } else if( phi1*phi2 < 0 && std::abs(phi1)>(M_PI/2.) ) {
2863  double tmp1 = (phi1>0)? phi1 - M_PI : phi1 + M_PI;
2864  double tmp2 = (phi2>0)? phi2 - M_PI : phi2 + M_PI;
2865  double tmp = (tmp1+tmp2)/2.;
2866  phi = (tmp>0.)? tmp - M_PI : tmp + M_PI;
2867  } else {
2868  phi = (phi2+phi1)/2.;
2869  }
2870  } else {
2871  phi = roi->phi();
2872  }
2873  float theta = std::atan(pattern.superPoints[middle].R/std::abs(pattern.superPoints[middle].Z));
2874  float eta = (std::tan(theta/2.)!=0.)? -std::log(std::tan(theta/2.))*pattern.superPoints[middle].Z/std::abs(pattern.superPoints[middle].Z): 0.;
2875  muonSA->setTrackPosition( pattern.superPoints[middle].R, pattern.superPoints[middle].Z, eta, phi );
2876  }
2877 
2878  } else { // barrel
2879 
2880  // Middle
2881  if ( std::abs(pattern.superPoints[middle].R) > ZERO_LIMIT && std::abs(pattern.superPoints[middle].Z) > ZERO_LIMIT ) { // if R and Z exist
2882  float phi = 0;
2883  if (rpcFitResult.isSuccess) {
2884  phi = rpcFitResult.phi;
2885  } else {
2886  phi = roi->phi();
2887  }
2888  float theta = std::atan(pattern.superPoints[middle].R/std::abs(pattern.superPoints[middle].Z));
2889  float eta = (std::tan(theta/2.)!=0.)? -std::log(std::tan(theta/2.))*pattern.superPoints[middle].Z/std::abs(pattern.superPoints[middle].Z): 0.;
2890  muonSA->setTrackPosition( pattern.superPoints[middle].R, pattern.superPoints[middle].Z, eta, phi );
2891  }
2892 
2893  // Not stored outer position for the moment as the phi is not available
2894 
2895  }
2896  outputTracks.push_back(muonSA);
2897 
2898  return true;
2899 }
2900 
2902  const TrigRoiDescriptor* roids,
2903  const TrigL2MuonSA::MuonRoad& muonRoad,
2904  const TrigL2MuonSA::MdtRegion& mdtRegion,
2905  const TrigL2MuonSA::RpcHits& rpcHits,
2906  const TrigL2MuonSA::TgcHits& tgcHits,
2907  const TrigL2MuonSA::RpcFitResult& rpcFitResult,
2908  const TrigL2MuonSA::TgcFitResult& tgcFitResult,
2909  const TrigL2MuonSA::MdtHits& mdtHits,
2910  const TrigL2MuonSA::CscHits& cscHits,
2911  const TrigL2MuonSA::StgcHits& stgcHits,
2912  const TrigL2MuonSA::MmHits& mmHits,
2914  DataVector<xAOD::L2StandAloneMuon>& outputTracks,
2915  const EventContext& ctx ) const
2916 {
2917  const float ZERO_LIMIT = 1.e-5;
2918 
2919  const int currentRoIId = roids->roiId();
2920 
2921  const EventIDBase& eventID = ctx.eventID();
2922  auto eventInfo = SG::makeHandle(m_eventInfoKey, ctx);
2923  if (!eventInfo.isValid()) {
2924  ATH_MSG_ERROR("Failed to retrieve xAOD::EventInfo object");
2925  return false;
2926  }
2927 
2928  int inner = 0;
2929  int middle = 1;
2930  int outer = 2;
2931  int ee = 6;
2932  int csc = 7;
2933  int barrelinner = 0;
2934  int endcapinner = 3;
2935  int bee = 8;
2936  int bme = 9;
2937  // int bmg = 10;
2938 
2939  // define inner, middle, outer
2940  if (pattern.s_address==-1) {
2947  } else {
2953  }
2954 
2955  ATH_MSG_DEBUG("### Hit patterns at the Muon Spectrometer ###");
2956  ATH_MSG_DEBUG("pattern#0: # of hits at inner =" << pattern.mdtSegments[inner].size());
2957  ATH_MSG_DEBUG("pattern#0: # of hits at middle =" << pattern.mdtSegments[middle].size());
2958  ATH_MSG_DEBUG("pattern#0: # of hits at outer =" << pattern.mdtSegments[outer].size());
2959  if (pattern.s_address==-1){
2960  ATH_MSG_DEBUG("pattern#0: # of hits at ee =" << pattern.mdtSegments[ee].size());
2961  ATH_MSG_DEBUG("pattern#0: # of hits at endcap barrel inner =" << pattern.mdtSegments[barrelinner].size());
2962  ATH_MSG_DEBUG("pattern#0: # of hits at BEE =" << pattern.mdtSegments[bee].size());
2963  } else {
2964  ATH_MSG_DEBUG("pattern#0: # of hits at BME =" << pattern.mdtSegments[bme].size());
2965  ATH_MSG_DEBUG("pattern#0: # of hits at barrel endcap inner =" << pattern.mdtSegments[endcapinner].size());
2966  }
2967  ATH_MSG_DEBUG("### ************************************* ###");
2968  ATH_MSG_DEBUG("Estimated muon pt = " << pattern.pt << " GeV");
2969 
2970  // ---------
2971  // store xAOD
2972 
2974  muonSA->makePrivateStore();
2975 
2976  // add pT
2977  muonSA->setPt(pattern.pt*pattern.charge);
2978  muonSA->setPtEndcapAlpha(pattern.ptEndcapAlpha*pattern.charge);
2979  muonSA->setPtEndcapBeta(pattern.ptEndcapBeta*pattern.charge);
2980  muonSA->setPtEndcapRadius(pattern.ptEndcapRadius*pattern.charge);
2981  muonSA->setPtCSC(pattern.ptCSC*pattern.charge);
2982 
2983  muonSA->setEta(pattern.etaVtx);
2984  muonSA->setPhi(pattern.phiVtx);
2985  muonSA->setDeltaPt(pattern.deltaPt);
2986  muonSA->setDeltaEta(pattern.deltaEtaVtx);
2987  muonSA->setDeltaPhi(pattern.deltaPhiVtx);
2988 
2989  // add s_address
2990  muonSA->setSAddress(pattern.s_address);
2991 
2992  // add positions at MS
2993  muonSA->setEtaMS(pattern.etaMap);
2994  muonSA->setPhiMS(pattern.phiMS);
2995  muonSA->setDirPhiMS(pattern.phiMSDir);
2996  muonSA->setRMS(pattern.superPoints[inner].R);
2997  muonSA->setZMS(pattern.superPoints[inner].Z);
2998  muonSA->setDirZMS(pattern.superPoints[inner].Alin);
2999 
3000  // add pt variables
3001  // Endcap
3002  muonSA->setEndcapAlpha(pattern.endcapAlpha);
3003  muonSA->setEndcapBeta(pattern.endcapBeta);
3004  muonSA->setEndcapRadius(pattern.endcapRadius3P);
3005  // Barrel
3006  muonSA->setBarrelRadius(pattern.barrelRadius);
3007  muonSA->setBarrelSagitta(pattern.barrelSagitta);
3008 
3009  // store eta and phi used as argument to pT LUT
3010  muonSA->setEtaMap(pattern.etaMap);
3011  muonSA->setPhiMap(pattern.phiMap);
3012  muonSA->setEtaBin(pattern.etaBin);
3013  muonSA->setPhiBin(pattern.phiBin);
3014 
3015  // store TGC/RPC readout failure flags
3016  muonSA->setIsTgcFailure((int)pattern.isTgcFailure);
3017  muonSA->setIsRpcFailure((int)pattern.isRpcFailure);
3018 
3019  // add superpoints
3020  muonSA->setSuperPoint(inner, pattern.superPoints[inner].R, pattern.superPoints[inner].Z,
3021  pattern.superPoints[inner].Alin, pattern.superPoints[inner].Blin, pattern.superPoints[inner].Chi2);
3022  muonSA->setSuperPoint(middle, pattern.superPoints[middle].R, pattern.superPoints[middle].Z,
3023  pattern.superPoints[middle].Alin, pattern.superPoints[middle].Blin, pattern.superPoints[middle].Chi2);
3024  muonSA->setSuperPoint(outer, pattern.superPoints[outer].R, pattern.superPoints[outer].Z,
3025  pattern.superPoints[outer].Alin, pattern.superPoints[outer].Blin, pattern.superPoints[outer].Chi2);
3026  if (pattern.s_address==-1){
3027  muonSA->setSuperPoint(ee, pattern.superPoints[ee].R, pattern.superPoints[ee].Z,
3028  pattern.superPoints[ee].Alin, pattern.superPoints[ee].Blin, pattern.superPoints[ee].Chi2);
3029  muonSA->setSuperPoint(barrelinner, pattern.superPoints[barrelinner].R, pattern.superPoints[barrelinner].Z,
3030  pattern.superPoints[barrelinner].Alin, pattern.superPoints[barrelinner].Blin, pattern.superPoints[barrelinner].Chi2);
3031  muonSA->setSuperPoint(csc, pattern.superPoints[csc].R, pattern.superPoints[csc].Z,
3032  pattern.superPoints[csc].Alin, pattern.superPoints[csc].Blin, pattern.superPoints[csc].Chi2);
3033  } else {
3034  muonSA->setSuperPoint(endcapinner, pattern.superPoints[endcapinner].R, pattern.superPoints[endcapinner].Z,
3035  pattern.superPoints[endcapinner].Alin, pattern.superPoints[endcapinner].Blin, pattern.superPoints[endcapinner].Chi2);
3036  }
3037 
3039  // Below are detailed information
3040 
3041  uint32_t muondetmask = 0;
3042 
3044  muonSA->setAlgoId( L2MuonAlgoMap(name()) );
3046  //muonSA->setTeId( inputTE->getId() ); // move to hltExecute()
3048  muonSA->setLvl1Id( eventInfo->extendedLevel1ID() );
3050  muonSA->setLumiBlock( eventID.lumi_block() );
3052  muonSA->setMuonDetMask( muondetmask );
3054  muonSA->setRoiId( currentRoIId );
3056  muonSA->setRoiSystem( roi->getSource() );
3058  muonSA->setRoiSubsystem( 1 - roi->getHemisphere() );
3060  muonSA->setRoiSector( roi->getSectorID() );
3062  muonSA->setRoiNumber( roi->getRoI() );
3064  muonSA->setRoiThreshold( roi->getThrNumber() );
3066  muonSA->setRoiEta( roi->eta() );
3068  muonSA->setRoiPhi( roi->phi() );
3070  muonSA->setRoIWord( roi->roiWord() );
3071 
3079 
3080  // MDT hits
3081  std::vector<std::string> mdtId;
3082  for (const TrigL2MuonSA::MdtHitData& mdtHit : mdtHits) {
3083  if ( mdtHit.isOutlier==0 || mdtHit.isOutlier==1 ) {
3084  muonSA->setMdtHit(mdtHit.OnlineId, mdtHit.isOutlier, mdtHit.Chamber,
3085  mdtHit.R, mdtHit.Z, mdtHit.cPhi0, mdtHit.Residual,
3086  mdtHit.DriftTime, mdtHit.DriftSpace, mdtHit.DriftSigma);
3087  mdtId.push_back(mdtHit.Id.getString());
3088  }
3089  }
3090  SG::AuxElement::Accessor< std::vector<std::string> > accessor_mdthitid( "mdtHitId" );
3091  accessor_mdthitid( *muonSA ) = mdtId;
3092 
3093  //CSC hits
3094  std::vector<float> cscResol;
3095  for (const TrigL2MuonSA::CscHitData& cscHit : cscHits) {
3096  if ( 1/*cscHit.MeasuresPhi==0*/ ){
3097  if ( cscHit.isOutlier==0 || cscHit.isOutlier==1 ) {
3098  muonSA->setCscHit(cscHit.isOutlier, cscHit.Chamber, cscHit.StationName,
3099  cscHit.StationEta, cscHit.StationPhi,
3100  cscHit.ChamberLayer, cscHit.WireLayer, cscHit.MeasuresPhi, cscHit.Strip,
3101  cscHit.eta, cscHit.phi, cscHit.r, cscHit.z,
3102  cscHit.charge, cscHit.time, cscHit.Residual);
3103  cscResol.push_back(cscHit.resolution);
3104  ATH_MSG_VERBOSE("CSC Hits stored in xAOD: "
3105  << "OL=" << cscHit.isOutlier << ","
3106  << "Ch=" << cscHit.Chamber << ","
3107  << "StationName=" << cscHit.StationName << ","
3108  << "StationEta=" << cscHit.StationEta << ","
3109  << "StationPhi=" << cscHit.StationPhi << ","
3110  << "ChamberLayer=" << cscHit.ChamberLayer << ","
3111  << "WireLayer=" << cscHit.WireLayer << ","
3112  << "MeasuresPhi=" << cscHit.MeasuresPhi << ","
3113  << "Strip=" << cscHit.Strip << ","
3114  << "eta=" << cscHit.eta << ","
3115  << "phi=" << cscHit.phi << ","
3116  << "r=" << cscHit.r << ","
3117  << "z=" << cscHit.z << ","
3118  << "charge=" << cscHit.charge << ","
3119  << "Rs=" << cscHit.Residual << ","
3120  << "t=" << cscHit.time);
3121  }
3122  }
3123  }
3124  SG::AuxElement::Accessor< std::vector<float> > accessor_cschitresol( "cscHitResolution" );
3125  accessor_cschitresol( *muonSA ) = cscResol;
3126 
3127  // RPC hits
3128  float sumbeta[8]={0};
3129  float nhit_layer[8]={0};
3130  for (const TrigL2MuonSA::RpcHitData& rpcHit : rpcHits) {
3131  muonSA->setRpcHit(rpcHit.layer, rpcHit.measuresPhi,
3132  rpcHit.x, rpcHit.y, rpcHit.z,
3133  rpcHit.time, rpcHit.distToEtaReadout, rpcHit.distToPhiReadout,
3134  rpcHit.stationName);
3135  ATH_MSG_VERBOSE("RPC hits stored in xAOD: "
3136  << "stationName=" << rpcHit.stationName << ","
3137  << "layer=" << rpcHit.layer << ","
3138  << "measuresPhi=" << rpcHit.measuresPhi << ","
3139  << "x=" << rpcHit.x << ","
3140  << "y=" << rpcHit.y << ","
3141  << "y=" << rpcHit.z);
3142 
3143  float dRMS = std::sqrt( std::abs(pattern.etaMap-rpcHit.eta)*std::abs(pattern.etaMap-rpcHit.eta) + std::acos(std::cos(pattern.phiMS-rpcHit.phi))*std::acos(std::cos(pattern.phiMS-rpcHit.phi)) );
3144  if(dRMS>0.05) continue;
3145  float muToF = rpcHit.l/1000/(CLHEP::c_light/1000);
3146  float Tprop = rpcHit.distToPhiReadout/1000*4.8;
3147  float beta = rpcHit.l/1000/(muToF+rpcHit.time-Tprop+3.125/2)/(CLHEP::c_light/1000);
3148  sumbeta[rpcHit.layer]=sumbeta[rpcHit.layer]+beta;
3149  nhit_layer[rpcHit.layer]=nhit_layer[rpcHit.layer]+1;
3150  }
3151 
3152  std::vector<float> Avebeta_layer;
3153  for(int i_layer=0;i_layer<8;i_layer++){
3154  if(nhit_layer[i_layer]!=0)Avebeta_layer.push_back( sumbeta[i_layer]/nhit_layer[i_layer] );
3155  }
3156  if(Avebeta_layer.size()>0) muonSA->setBeta( std::accumulate(Avebeta_layer.begin(),Avebeta_layer.end(),0.0)/Avebeta_layer.size() );
3157  else muonSA->setBeta( 9999 );
3158  Avebeta_layer.clear();
3159 
3160  // TGC hits
3161  for (const TrigL2MuonSA::TgcHitData& tgcHit : tgcHits) {
3162  muonSA->setTgcHit(tgcHit.eta, tgcHit.phi, tgcHit.r, tgcHit.z,
3163  tgcHit.width, tgcHit.sta, tgcHit.isStrip,
3164  tgcHit.bcTag, tgcHit.inRoad);
3165  ATH_MSG_VERBOSE("TGC hits stored in xAOD: "
3166  << "eta=" << tgcHit.eta << ","
3167  << "phi=" << tgcHit.phi << ","
3168  << "r=" << tgcHit.r << ","
3169  << "z=" << tgcHit.z << ","
3170  << "width=" << tgcHit.width << ","
3171  << "stationNum=" << tgcHit.sta << ","
3172  << "isStrip=" << tgcHit.isStrip << ","
3173  << "bcTag=" << tgcHit.bcTag << ","
3174  << "inRoad=" << tgcHit.inRoad);
3175  }
3176 
3177 
3178  // sTGC clusters
3179  for(unsigned int i_hit=0; i_hit<stgcHits.size(); i_hit++) {
3180  if ( stgcHits[i_hit].isOutlier==0 || stgcHits[i_hit].isOutlier==1 ) {
3181 
3182 
3183  muonSA->setStgcCluster(stgcHits[i_hit].layerNumber, stgcHits[i_hit].isOutlier, stgcHits[i_hit].channelType,
3184  stgcHits[i_hit].eta, stgcHits[i_hit].phi, stgcHits[i_hit].r, stgcHits[i_hit].z,
3185  stgcHits[i_hit].ResidualR, stgcHits[i_hit].ResidualPhi,
3186  stgcHits[i_hit].stationEta, stgcHits[i_hit].stationPhi, stgcHits[i_hit].stationName);
3187 
3188  ATH_MSG_VERBOSE("sTGC hits stored in xAOD: "
3189  << "eta=" << stgcHits[i_hit].eta << ","
3190  << "phi=" << stgcHits[i_hit].phi << ","
3191  << "r=" << stgcHits[i_hit].r << ","
3192  << "z=" << stgcHits[i_hit].z << ","
3193  << "z=" << stgcHits[i_hit].ResidualR << ","
3194  << "z=" << stgcHits[i_hit].ResidualPhi);
3195  }
3196  }
3197 
3198  // MM clusters
3199  for(unsigned int i_hit=0; i_hit<mmHits.size(); i_hit++) {
3200  if ( mmHits[i_hit].isOutlier==0 || mmHits[i_hit].isOutlier==1 ) {
3201 
3202 
3203  muonSA->setMmCluster(mmHits[i_hit].layerNumber, mmHits[i_hit].isOutlier,
3204  mmHits[i_hit].eta, mmHits[i_hit].phi, mmHits[i_hit].r, mmHits[i_hit].z,
3205  mmHits[i_hit].ResidualR, mmHits[i_hit].ResidualPhi,
3206  mmHits[i_hit].stationEta, mmHits[i_hit].stationPhi, mmHits[i_hit].stationName);
3207 
3208  ATH_MSG_VERBOSE("mm hits stored in xAOD: "
3209  << "eta=" << tgcHits[i_hit].eta << ","
3210  << "phi=" << tgcHits[i_hit].phi << ","
3211  << "r=" << tgcHits[i_hit].r << ","
3212  << "z=" << tgcHits[i_hit].z << ","
3213  << "width=" << tgcHits[i_hit].width << ","
3214  << "stationNum=" << tgcHits[i_hit].sta << ","
3215  << "isStrip=" << tgcHits[i_hit].isStrip << ","
3216  << "bcTag=" << tgcHits[i_hit].bcTag << ","
3217  << "inRoad=" << tgcHits[i_hit].inRoad);
3218  }
3219  }
3220 
3221 
3222 
3223 
3224  // Muon road
3225  for (int i_station=0; i_station<8; i_station++) {
3226  for (int i_sector=0; i_sector<2; i_sector++) {
3227  muonSA->setRoad(i_station, i_sector, muonRoad.aw[i_station][i_sector], muonRoad.bw[i_station][i_sector]);
3228  muonSA->setRegionZ(i_station, i_sector, mdtRegion.zMin[i_station][i_sector], mdtRegion.zMax[i_station][i_sector]);
3229  muonSA->setRegionR(i_station, i_sector, mdtRegion.rMin[i_station][i_sector], mdtRegion.rMax[i_station][i_sector]);
3230  muonSA->setRegionEta(i_station, i_sector, mdtRegion.etaMin[i_station][i_sector], mdtRegion.etaMax[i_station][i_sector]);
3231  muonSA->setChamberType1(i_station, i_sector, mdtRegion.chamberType[i_station][i_sector][0]);
3232  muonSA->setChamberType2(i_station, i_sector, mdtRegion.chamberType[i_station][i_sector][1]);
3233  }
3234  }
3235 
3236  if ( muonRoad.isEndcap ) {
3237  // TGC fit results
3238  if (tgcFitResult.isSuccess ) {
3239  muonSA->setTgcPt(tgcFitResult.tgcPT);
3240 
3241  muonSA->setTgcInn(tgcFitResult.tgcInn[0], tgcFitResult.tgcInn[1],
3242  tgcFitResult.tgcInn[2], tgcFitResult.tgcInn[3]);
3243  muonSA->setTgcInnF(tgcFitResult.tgcInnRhoStd, tgcFitResult.tgcInnRhoNin,
3244  tgcFitResult.tgcInnPhiStd, tgcFitResult.tgcInnPhiNin);
3245 
3246  muonSA->setTgcMid1(tgcFitResult.tgcMid1[0], tgcFitResult.tgcMid1[1],
3247  tgcFitResult.tgcMid1[2], tgcFitResult.tgcMid1[3]);
3248  muonSA->setTgcMid2(tgcFitResult.tgcMid2[0], tgcFitResult.tgcMid2[1],
3249  tgcFitResult.tgcMid2[2], tgcFitResult.tgcMid2[3]);
3250  muonSA->setTgcMidF(tgcFitResult.tgcMidRhoChi2, tgcFitResult.tgcMidRhoNin,
3251  tgcFitResult.tgcMidPhiChi2, tgcFitResult.tgcMidPhiNin);
3252  }
3253  } else {
3254  // RPC fit results
3255  if (rpcFitResult.isSuccess ) {
3256  // Fill middle fit results for the moment
3257 
3258  muonSA->setRpcFitInn(rpcFitResult.phi_inner, rpcFitResult.slope_inner, rpcFitResult.offset_inner);
3259  muonSA->setRpcFitMid(rpcFitResult.phi_middle, rpcFitResult.slope_middle, rpcFitResult.offset_middle);
3260  muonSA->setRpcFitOut(rpcFitResult.phi_outer, rpcFitResult.slope_outer, rpcFitResult.offset_outer);
3261  }
3262  }
3263 
3264  // Store track positions if set of (R, Z, eta, phi) are all available
3265  if (pattern.s_address==-1) { // endcap
3266 
3267  // Inner
3268  if ( std::abs(pattern.superPoints[inner].R) > ZERO_LIMIT && std::abs(pattern.superPoints[inner].Z) > ZERO_LIMIT ) { // if R and Z exist
3269  if ( tgcFitResult.isSuccess && std::abs(tgcFitResult.tgcInn[3]) > ZERO_LIMIT ) { // if phi exist
3270  float theta = std::atan(pattern.superPoints[inner].R/std::abs(pattern.superPoints[inner].Z));
3271  float eta = (std::tan(theta/2.)!=0.)? -std::log(std::tan(theta/2.))*pattern.superPoints[inner].Z/std::abs(pattern.superPoints[inner].Z): 0.;
3272  muonSA->setTrackPosition( pattern.superPoints[inner].R, pattern.superPoints[inner].Z, eta, tgcFitResult.tgcInn[1] );
3273  }
3274  }
3275 
3276  // Middle
3277  if ( std::abs(pattern.superPoints[middle].R) > ZERO_LIMIT && std::abs(pattern.superPoints[middle].Z) > ZERO_LIMIT ) { // if R and Z exist
3278  float phi = 0;
3279  if (tgcFitResult.isSuccess && ( std::abs(tgcFitResult.tgcMid1[3]) > ZERO_LIMIT || std::abs(tgcFitResult.tgcMid2[3]) > ZERO_LIMIT )) { // if phi exist
3280  double phi1 = tgcFitResult.tgcMid1[1];
3281  double phi2 = tgcFitResult.tgcMid2[1];
3282  if ( tgcFitResult.tgcMid1[3]==0. || tgcFitResult.tgcMid2[3]==0. ) {
3283  if ( std::abs(tgcFitResult.tgcMid1[3]) > ZERO_LIMIT ) phi = phi1;
3284  if ( std::abs(tgcFitResult.tgcMid2[3]) > ZERO_LIMIT ) phi = phi2;
3285  } else if( phi1*phi2 < 0 && std::abs(phi1)>(M_PI/2.) ) {
3286  double tmp1 = (phi1>0)? phi1 - M_PI : phi1 + M_PI;
3287  double tmp2 = (phi2>0)? phi2 - M_PI : phi2 + M_PI;
3288  double tmp = (tmp1+tmp2)/2.;
3289  phi = (tmp>0.)? tmp - M_PI : tmp + M_PI;
3290  } else {
3291  phi = (phi2+phi1)/2.;
3292  }
3293  } else {
3294  phi = roi->phi();
3295  }
3296  float theta = std::atan(pattern.superPoints[middle].R/std::abs(pattern.superPoints[middle].Z));
3297  float eta = (std::tan(theta/2.)!=0.)? -std::log(std::tan(theta/2.))*pattern.superPoints[middle].Z/std::abs(pattern.superPoints[middle].Z): 0.;
3298  muonSA->setTrackPosition( pattern.superPoints[middle].R, pattern.superPoints[middle].Z, eta, phi );
3299  }
3300 
3301  } else { // barrel
3302 
3303  // Middle
3304  if ( std::abs(pattern.superPoints[middle].R) > ZERO_LIMIT && std::abs(pattern.superPoints[middle].Z) > ZERO_LIMIT ) { // if R and Z exist
3305  float phi = 0;
3306  if (rpcFitResult.isSuccess) {
3307  phi = rpcFitResult.phi;
3308  } else {
3309  phi = roi->phi();
3310  }
3311  float theta = std::atan(pattern.superPoints[middle].R/std::abs(pattern.superPoints[middle].Z));
3312  float eta = (std::tan(theta/2.)!=0.)? -std::log(std::tan(theta/2.))*pattern.superPoints[middle].Z/std::abs(pattern.superPoints[middle].Z): 0.;
3313  muonSA->setTrackPosition( pattern.superPoints[middle].R, pattern.superPoints[middle].Z, eta, phi );
3314  }
3315 
3316  // Not stored outer position for the moment as the phi is not available
3317 
3318  }
3319  outputTracks.push_back(muonSA);
3320 
3321  return true;
3322 }
3323 
3324 
3327  const DataVector<xAOD::L2StandAloneMuon>& outputTracks,
3328  TrigRoiDescriptorCollection& outputMS) const
3329 {
3330  const float ZERO_LIMIT = 1.e-5;
3331 
3332  const xAOD::L2StandAloneMuon* muonSA = outputTracks[0];
3333 
3334  float mseta = pattern.etaMap;
3335  float msphi = pattern.phiMS;
3336 
3337  // store TrigRoiDescriptor
3338  if (std::abs(muonSA->pt()) < ZERO_LIMIT ) {
3339  mseta = roids->eta();
3340  msphi = roids->phi();
3341  }
3342 
3343  // set width of 0.1 so that ID tracking monitoring works
3344  const float phiHalfWidth = 0.1;
3345  const float etaHalfWidth = 0.1;
3346 
3347  TrigRoiDescriptor* MSroiDescriptor = new TrigRoiDescriptor(roids->roiWord(),
3348  roids->l1Id(),
3349  roids->roiId(),
3350  mseta,
3351  mseta - etaHalfWidth,
3352  mseta + etaHalfWidth,
3353  msphi,
3354  msphi - phiHalfWidth,
3355  msphi + phiHalfWidth);
3356 
3357  ATH_MSG_VERBOSE("...TrigRoiDescriptor for MS "
3358  << "mseta/msphi="
3359  << mseta << "/" << msphi);
3360 
3361  ATH_MSG_VERBOSE("will Record an RoiDescriptor for TrigMoore:"
3362  << " phi=" << MSroiDescriptor->phi()
3363  << ", eta=" << MSroiDescriptor->eta());
3364 
3365  outputMS.push_back(MSroiDescriptor);
3366 
3367  return true;
3368 }
3369 
3370 
3373  const DataVector<xAOD::L2StandAloneMuon>& outputTracks,
3374  TrigRoiDescriptorCollection& outputID) const
3375 {
3376 
3377  if (m_fill_FSIDRoI) { // this mode will be used in cosmic run, if ID expert want to run full scan FTF.
3378  TrigRoiDescriptor* IDroiDescriptor = new TrigRoiDescriptor(true);
3379  outputID.push_back(IDroiDescriptor);
3380  return true;
3381  }
3382 
3383  const float ZERO_LIMIT = 1.e-5;
3384 
3385  const double scalePhiWidthForFailure = 2;
3386  const double scaleRoIforZeroPt = 2;
3387 
3388  const xAOD::L2StandAloneMuon* muonSA = outputTracks[0];
3389 
3390  // store TrigRoiDescriptor
3391  if (std::abs(muonSA->pt()) > ZERO_LIMIT ) {
3392 
3393  // patch for the ID RoI descriptor
3394  float phiHalfWidth = 0.1;
3395  float etaHalfWidth = 0.1;
3396 
3397  // 2010 runs
3398  // if ( std::abs(pattern.etaVtx)>1 && std::abs(pattern.etaVtx)<1.5 ) {
3399  // phiHalfWidth = 0.25;
3400  // etaHalfWidth = 0.4;
3401  // } else {
3402  // phiHalfWidth = 0.1;
3403  // etaHalfWidth = 0.15;
3404  // }
3405 
3406  // 2011a tuning
3407  phiHalfWidth = getRoiSizeForID(false,muonSA);
3408  etaHalfWidth = getRoiSizeForID(true, muonSA);
3409 
3410  if (pattern.isTgcFailure || pattern.isRpcFailure)
3411  phiHalfWidth *= scalePhiWidthForFailure;
3412 
3413  TrigRoiDescriptor* IDroiDescriptor = new TrigRoiDescriptor(roids->roiWord(),
3414  roids->l1Id(),
3415  roids->roiId(),
3416  pattern.etaVtx,
3417  pattern.etaVtx - etaHalfWidth,
3418  pattern.etaVtx + etaHalfWidth,
3419  pattern.phiVtx,
3420  pattern.phiVtx - phiHalfWidth,
3421  pattern.phiVtx + phiHalfWidth);
3422 
3423  ATH_MSG_VERBOSE("...TrigRoiDescriptor for ID "
3424  << "pattern.etaVtx/pattern.phiVtx="
3425  << pattern.etaVtx << "/" << pattern.phiVtx);
3426 
3427  ATH_MSG_VERBOSE("will Record an RoiDescriptor for Inner Detector:"
3428  << " phi=" << IDroiDescriptor->phi()
3429  << ", eta=" << IDroiDescriptor->eta());
3430 
3431  outputID.push_back(IDroiDescriptor);
3432 
3433  } else { // pt = 0.
3434 
3435  TrigRoiDescriptor* IDroiDescriptor = new TrigRoiDescriptor(roids->roiWord(),
3436  roids->l1Id(),
3437  roids->roiId(),
3438  roids->eta(),
3439  roids->eta() - (roids->eta() - roids->etaMinus()) * scaleRoIforZeroPt,
3440  roids->eta() + (roids->etaPlus() - roids->eta()) * scaleRoIforZeroPt,
3441  roids->phi(),
3442  CxxUtils::wrapToPi(roids->phi() - CxxUtils::wrapToPi(roids->phiPlus() - roids->phiMinus())/2. * scaleRoIforZeroPt),
3443  CxxUtils::wrapToPi(roids->phi() + CxxUtils::wrapToPi(roids->phiPlus() - roids->phiMinus())/2. * scaleRoIforZeroPt));
3444 
3445  ATH_MSG_VERBOSE("will Record an RoiDescriptor for Inner Detector in case with zero pT:"
3446  << " phi=" << IDroiDescriptor->phi()
3447  << ", phi min=" << IDroiDescriptor->phiMinus()
3448  << ", phi max=" << IDroiDescriptor->phiPlus()
3449  << ", eta=" << IDroiDescriptor->eta()
3450  << ", eta min=" << IDroiDescriptor->etaMinus()
3451  << ", eta max=" << IDroiDescriptor->etaPlus());
3452 
3453  outputID.push_back(IDroiDescriptor);
3454  }
3455 
3456  return true;
3457 }
3458 
3459 
3460 // --------------------------------------------------------------------------------
3461 // --------------------------------------------------------------------------------
3462 
3463 int MuFastSteering::L2MuonAlgoMap(const std::string& name) const
3464 {
3465  int algoId = 0;
3466  if (name == "MuFastSteering_Muon") {
3468  } else if (name == "MuFastSteering_900GeV") {
3470  } else {
3472  }
3473 
3474  return algoId;
3475 }
3476 
3477 // --------------------------------------------------------------------------------
3478 // --------------------------------------------------------------------------------
3479 
3480 float MuFastSteering::getRoiSizeForID(bool isEta, const xAOD::L2StandAloneMuon* muonSA) const
3481 {
3482  bool isBarrel = (muonSA->sAddress()==-1) ? true : false;
3483  float eta = muonSA->etaMS();
3484  float phi = muonSA->phiMS();
3485  float pt = muonSA->pt();
3486 
3487  //
3488  const int N_PARAMS = 2;
3489 
3490  //
3491  const float etaMinWin_brl = 0.10;
3492  const float etaMinWin_ec1 = 0.10;
3493  const float etaMinWin_ec2 = 0.10;
3494  const float etaMinWin_ec3 = 0.10;
3495  const float etaMinWin_ecA = 0.10;
3496  const float etaMinWin_ecB = 0.10;
3497 
3498  const float etaMaxWin_brl = 0.20;
3499  const float etaMaxWin_ec1 = 0.20;
3500  const float etaMaxWin_ec2 = 0.20;
3501  const float etaMaxWin_ec3 = 0.20;
3502  const float etaMaxWin_ecA = 0.20;
3503  const float etaMaxWin_ecB = 0.20;
3504 
3505  const float etaParams_brl[N_PARAMS] = { 0.038, 0.284};
3506  const float etaParams_ec1[N_PARAMS] = { 0.011, 0.519};
3507  const float etaParams_ec2[N_PARAMS] = { 0.023, 0.253};
3508  const float etaParams_ec3[N_PARAMS] = { 0.018, 0.519};
3509  const float etaParams_ecA[N_PARAMS] = { 0.010, 0.431};
3510  const float etaParams_ecB[N_PARAMS] = { 0.023, 0.236};
3511 
3512  //
3513  const float phiMinWin_brl = 0.125;
3514  const float phiMinWin_ec1 = 0.125;
3515  const float phiMinWin_ec2 = 0.125;
3516  const float phiMinWin_ec3 = 0.10;
3517  const float phiMinWin_ecA = 0.15;
3518  const float phiMinWin_ecB = 0.15;
3519 
3520  const float phiMaxWin_brl = 0.20;
3521  const float phiMaxWin_ec1 = 0.20;
3522  const float phiMaxWin_ec2 = 0.20;
3523  const float phiMaxWin_ec3 = 0.20;
3524  const float phiMaxWin_ecA = 0.25;
3525  const float phiMaxWin_ecB = 0.20;
3526 
3527  const float phiParams_brl[N_PARAMS] = { 0.000, 0.831};
3528  const float phiParams_ec1[N_PARAMS] = { 0.000, 0.885};
3529  const float phiParams_ec2[N_PARAMS] = { 0.015, 0.552};
3530  const float phiParams_ec3[N_PARAMS] = { 0.008, 0.576};
3531  const float phiParams_ecA[N_PARAMS] = { 0.000, 0.830};
3532  const float phiParams_ecB[N_PARAMS] = { 0.006, 1.331};
3533 
3534  //
3535  float minWin;
3536  float maxWin;
3537  float params[N_PARAMS];
3538  if( isBarrel ) {
3539  if( isEta ) {
3540  memcpy(params,etaParams_brl,sizeof(params));
3541  minWin = etaMinWin_brl;
3542  maxWin = etaMaxWin_brl;
3543  }
3544  else {
3545  memcpy(params,phiParams_brl,sizeof(params));
3546  minWin = phiMinWin_brl;
3547  maxWin = phiMaxWin_brl;
3548  }
3549  }
3550  else { // endcap
3553 
3554  if( isEta ) {
3555  memcpy(params,etaParams_ecA,sizeof(params));
3556  minWin = etaMinWin_ecA;
3557  maxWin = etaMaxWin_ecA;
3558  }
3559  else {
3560  memcpy(params,phiParams_ecA,sizeof(params));
3561  minWin = phiMinWin_ecA;
3562  maxWin = phiMaxWin_ecA;
3563  }
3564  }
3566  if( isEta ) {
3567  memcpy(params,etaParams_ecB,sizeof(params));
3568  minWin = etaMinWin_ecB;
3569  maxWin = etaMaxWin_ecB;
3570  }
3571  else {
3572  memcpy(params,phiParams_ecB,sizeof(params));
3573  minWin = phiMinWin_ecB;
3574  maxWin = phiMaxWin_ecB;
3575  }
3576  }
3577  else {
3578  if( std::abs(eta) < 1.5 ) {
3579  if( isEta ) {
3580  memcpy(params,etaParams_ec1,sizeof(params));
3581  minWin = etaMinWin_ec1;
3582  maxWin = etaMaxWin_ec1;
3583  }
3584  else {
3585  memcpy(params,phiParams_ec1,sizeof(params));
3586  minWin = phiMinWin_ec1;
3587  maxWin = phiMaxWin_ec1;
3588  }
3589  }
3590  else if( std::abs(eta) < 2.0 ) {
3591  if( isEta ) {
3592  memcpy(params,etaParams_ec2,sizeof(params));
3593  minWin = etaMinWin_ec2;
3594  maxWin = etaMaxWin_ec2;
3595  }
3596  else {
3597  memcpy(params,phiParams_ec2,sizeof(params));
3598  minWin = phiMinWin_ec2;
3599  maxWin = phiMaxWin_ec2;
3600  }
3601  }
3602  else {
3603  if( isEta ) {
3604  memcpy(params,etaParams_ec3,sizeof(params));
3605  minWin = etaMinWin_ec3;
3606  maxWin = etaMaxWin_ec3;
3607  }
3608  else {
3609  memcpy(params,phiParams_ec3,sizeof(params));
3610  minWin = phiMinWin_ec3;
3611  maxWin = phiMaxWin_ec3;
3612  }
3613  }
3614  }
3615  }
3616 
3617  //
3618  float x = params[0] + params[1] / pt;
3619  float retval = x;
3620  if( x < minWin ) retval = minWin;
3621  if( x > maxWin ) retval = maxWin;
3622 
3623  return retval;
3624 }
3625 
3626 // --------------------------------------------------------------------------------
3627 // --------------------------------------------------------------------------------
3628 
3630  const TrigL2MuonSA::MdtHits& mdtHits,
3631  std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns ) const
3632 {
3633  // initialize monitored variable
3634  auto inner_mdt_hits = Monitored::Scalar("InnMdtHits", -1);
3635  auto middle_mdt_hits = Monitored::Scalar("MidMdtHits", -1);
3636  auto outer_mdt_hits = Monitored::Scalar("OutMdtHits", -1);
3637  auto invalid_rpc_roi_number = Monitored::Scalar("InvalidRpcRoINumber", -1);
3638 
3639  auto efficiency = Monitored::Scalar("Efficiency", 0);
3640  auto sag_inverse = Monitored::Scalar("SagInv", 9999.);
3641  auto address = Monitored::Scalar("Address", 9999.);
3642  auto absolute_pt = Monitored::Scalar("AbsPt", 9999.);
3643  auto sagitta = Monitored::Scalar("Sagitta", 9999.);
3644  auto track_pt = Monitored::Scalar("TrackPt", 9999.);
3645 
3646  std::vector<float> t_eta, t_phi;
3647  std::vector<float> f_eta, f_phi;
3648  std::vector<float> r_inner, r_middle, r_outer;
3649  std::vector<float> f_residuals;
3650 
3651  t_eta.clear();
3652  t_phi.clear();
3653  f_eta.clear();
3654  f_phi.clear();
3655  r_inner.clear();
3656  r_middle.clear();
3657  r_outer.clear();
3658  f_residuals.clear();
3659 
3660  auto track_eta = Monitored::Collection("TrackEta", t_eta);
3661  auto track_phi = Monitored::Collection("TrackPhi", t_phi);
3662  auto failed_eta = Monitored::Collection("FailedRoIEta", f_eta);
3663  auto failed_phi = Monitored::Collection("FailedRoIPhi", f_phi);
3664  auto res_inner = Monitored::Collection("ResInner", r_inner);
3665  auto res_middle = Monitored::Collection("ResMiddle", r_middle);
3666  auto res_outer = Monitored::Collection("ResOuter", r_outer);
3667  auto fit_residuals = Monitored::Collection("FitResiduals", f_residuals);
3668 
3669  auto monitorIt = Monitored::Group(m_monTool, inner_mdt_hits, middle_mdt_hits, outer_mdt_hits,
3670  invalid_rpc_roi_number,
3671  efficiency, sag_inverse, address, absolute_pt, sagitta, track_pt,
3672  track_eta, track_phi, failed_eta, failed_phi,
3673  res_inner, res_middle, res_outer, fit_residuals );
3674 
3675  const float ZERO_LIMIT = 1e-5;
3676 
3677  if( trackPatterns.size() > 0 ) {
3678 
3679  efficiency = 1;
3680 
3681  const TrigL2MuonSA::TrackPattern& pattern = trackPatterns[0];
3682  float norm = 10.;
3683 
3684  float count_inner = 0;
3685  float count_middle = 0;
3686  float count_outer = 0;
3687 
3688  for (const TrigL2MuonSA::MdtHitData& mdtHit : mdtHits) {
3689 
3690  if (std::abs(mdtHit.DriftSpace) < ZERO_LIMIT) continue;
3691 
3692  char st = mdtHit.cType[1];
3693 
3694  if (st=='I') {
3695  count_inner++;
3696  r_inner.push_back(mdtHit.Residual/norm);
3697  if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/norm);
3698  }
3699 
3700  if (st=='M') {
3701  count_middle++;
3702  r_middle.push_back(mdtHit.Residual/norm);
3703  if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/norm);
3704  }
3705 
3706  if (st=='O') {
3707  count_outer++;
3708  r_outer.push_back(mdtHit.Residual/norm);
3709  if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/norm);
3710  }
3711  }
3712 
3713  inner_mdt_hits = count_inner;
3714  middle_mdt_hits = count_middle;
3715  outer_mdt_hits = count_outer;
3716 
3717  track_pt = (std::abs(pattern.pt ) > ZERO_LIMIT)? pattern.charge*pattern.pt: 9999.;
3718  absolute_pt = std::abs(track_pt);
3719 
3720  if ( std::abs(pattern.etaMap) > ZERO_LIMIT || std::abs(pattern.phiMS) > ZERO_LIMIT ) {
3721  t_eta.push_back(pattern.etaMap);
3722  t_phi.push_back(pattern.phiMS);
3723  }
3724  if ( std::abs(pattern.pt ) < ZERO_LIMIT){
3725  f_eta.push_back(roi->eta());
3726  f_phi.push_back(roi->phi());
3727  }
3728 
3729  sagitta = (std::abs(pattern.barrelSagitta) > ZERO_LIMIT)? pattern.barrelSagitta: 9999.;
3730  sag_inverse = (std::abs(pattern.barrelSagitta) > ZERO_LIMIT)? 1./pattern.barrelSagitta: 9999.;
3731  address = pattern.s_address;
3732  }
3733 
3734  return StatusCode::SUCCESS;
3735 }
3736 
3737 // --------------------------------------------------------------------------------
3738 // --------------------------------------------------------------------------------
3739 
3741  const TrigL2MuonSA::MdtHits& mdtHits,
3742  std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns ) const
3743 {
3744  // initialize monitored variable
3745  auto inner_mdt_hits = Monitored::Scalar("InnMdtHits", -1);
3746  auto middle_mdt_hits = Monitored::Scalar("MidMdtHits", -1);
3747  auto outer_mdt_hits = Monitored::Scalar("OutMdtHits", -1);
3748  auto invalid_rpc_roi_number = Monitored::Scalar("InvalidRpcRoINumber", -1);
3749 
3750  auto efficiency = Monitored::Scalar("Efficiency", 0);
3751  auto sag_inverse = Monitored::Scalar("SagInv", 9999.);
3752  auto address = Monitored::Scalar("Address", 9999.);
3753  auto absolute_pt = Monitored::Scalar("AbsPt", 9999.);
3754  auto sagitta = Monitored::Scalar("Sagitta", 9999.);
3755  auto track_pt = Monitored::Scalar("TrackPt", 9999.);
3756 
3757  std::vector<float> t_eta, t_phi;
3758  std::vector<float> f_eta, f_phi;
3759  std::vector<float> r_inner, r_middle, r_outer;
3760  std::vector<float> f_residuals;
3761 
3762  t_eta.clear();
3763  t_phi.clear();
3764  f_eta.clear();
3765  f_phi.clear();
3766  r_inner.clear();
3767  r_middle.clear();
3768  r_outer.clear();
3769  f_residuals.clear();
3770 
3771  auto track_eta = Monitored::Collection("TrackEta", t_eta);
3772  auto track_phi = Monitored::Collection("TrackPhi", t_phi);
3773  auto failed_eta = Monitored::Collection("FailedRoIEta", f_eta);
3774  auto failed_phi = Monitored::Collection("FailedRoIPhi", f_phi);
3775  auto res_inner = Monitored::Collection("ResInner", r_inner);
3776  auto res_middle = Monitored::Collection("ResMiddle", r_middle);
3777  auto res_outer = Monitored::Collection("ResOuter", r_outer);
3778  auto fit_residuals = Monitored::Collection("FitResiduals", f_residuals);
3779 
3780  auto monitorIt = Monitored::Group(m_monTool, inner_mdt_hits, middle_mdt_hits, outer_mdt_hits,
3781  invalid_rpc_roi_number,
3782  efficiency, sag_inverse, address, absolute_pt, sagitta, track_pt,
3783  track_eta, track_phi, failed_eta, failed_phi,
3784  res_inner, res_middle, res_outer, fit_residuals );
3785 
3786  const float ZERO_LIMIT = 1e-5;
3787 
3788  if( trackPatterns.size() > 0 ) {
3789 
3790  efficiency = 1;
3791 
3792  const TrigL2MuonSA::TrackPattern& pattern = trackPatterns[0];
3793  float norm = 10.;
3794 
3795  float count_inner = 0;
3796  float count_middle = 0;
3797  float count_outer = 0;
3798 
3799  for (const TrigL2MuonSA::MdtHitData& mdtHit : mdtHits) {
3800 
3801  if (std::abs(mdtHit.DriftSpace) < ZERO_LIMIT) continue;
3802 
3803  char st = mdtHit.cType[1];
3804 
3805  if (st=='I') {
3806  count_inner++;
3807  r_inner.push_back(mdtHit.Residual/norm);
3808  if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/norm);
3809  }
3810 
3811  if (st=='M') {
3812  count_middle++;
3813  r_middle.push_back(mdtHit.Residual/norm);
3814  if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/norm);
3815  }
3816 
3817  if (st=='O') {
3818  count_outer++;
3819  r_outer.push_back(mdtHit.Residual/norm);
3820  if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/norm);
3821  }
3822  }
3823 
3824  inner_mdt_hits = count_inner;
3825  middle_mdt_hits = count_middle;
3826  outer_mdt_hits = count_outer;
3827 
3828  track_pt = (std::abs(pattern.pt ) > ZERO_LIMIT)? pattern.charge*pattern.pt: 9999.;
3829  absolute_pt = std::abs(track_pt);
3830 
3831  if ( std::abs(pattern.etaMap) > ZERO_LIMIT || std::abs(pattern.phiMS) > ZERO_LIMIT ) {
3832  t_eta.push_back(pattern.etaMap);
3833  t_phi.push_back(pattern.phiMS);
3834  }
3835  if ( std::abs(pattern.pt ) < ZERO_LIMIT){
3836  f_eta.push_back(roi->eta());
3837  f_phi.push_back(roi->phi());
3838  }
3839 
3840  sagitta = (std::abs(pattern.barrelSagitta) > ZERO_LIMIT)? pattern.barrelSagitta: 9999.;
3841  sag_inverse = (std::abs(pattern.barrelSagitta) > ZERO_LIMIT)? 1./pattern.barrelSagitta: 9999.;
3842  address = pattern.s_address;
3843  }
3844 
3845  return StatusCode::SUCCESS;
3846 }
3847 
3848 
3849 
MuFastSteering::m_use_mm
Gaudi::Property< bool > m_use_mm
Definition: MuFastSteering.h:263
xAOD::L2MuonParameters::ECRegions
ECRegions
Definition: TrigMuonDefs.h:36
L2CombinedMuonAuxContainer.h
MuFastSteering::m_use_RoIBasedDataAccess_CSC
Gaudi::Property< bool > m_use_RoIBasedDataAccess_CSC
Definition: MuFastSteering.h:267
MuFastSteering::m_jobOptionsSvc
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_jobOptionsSvc
Definition: MuFastSteering.h:253
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
xAOD::L2StandAloneMuon_v2::setDeltaEta
void setDeltaEta(float value)
Set error of eta.
beamspotman.r
def r
Definition: beamspotman.py:676
MuFastSteering::m_cscsegmaker
ToolHandle< TrigL2MuonSA::CscSegmentMaker > m_cscsegmaker
Definition: MuFastSteering.h:246
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:161
MuFastSteering::updateMonitor
StatusCode updateMonitor(const LVL1::RecMuonRoI *roi, const TrigL2MuonSA::MdtHits &mdtHits, std::vector< TrigL2MuonSA::TrackPattern > &trackPatterns) const
Update monitoring variables.
Definition: MuFastSteering.cxx:3629
xAOD::L2StandAloneMuon_v2::setMmClustersCapacity
void setMmClustersCapacity(const int value)
Set size of storage for MM clusters.
Definition: L2StandAloneMuon_v2.cxx:1295
xAOD::L2CombinedMuon_v1::setStrategy
void setStrategy(int value)
set algorithm strategy flag
TrigL2MuonSA::CscHitData
Definition: CscData.h:14
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
MuFastSteering::storeIDRoiDescriptor
bool storeIDRoiDescriptor(const TrigRoiDescriptor *roids, const TrigL2MuonSA::TrackPattern &pattern, const DataVector< xAOD::L2StandAloneMuon > &outputTracks, TrigRoiDescriptorCollection &outputID) const
Definition: MuFastSteering.cxx:3371
MuFastSteering::m_dataPreparator
ToolHandle< TrigL2MuonSA::MuFastDataPreparator > m_dataPreparator
Definition: MuFastSteering.h:221
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TrigL2MuonSA::TgcFitResult::tgcMidRhoNin
int tgcMidRhoNin
Definition: TgcFitResult.h:48
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
xAOD::L2StandAloneMuon_v2::setTgcMidF
void setTgcMidF(float rhoChi2, long rhoN, float phiChi2, long phiN)
Definition: L2StandAloneMuon_v2.cxx:1018
LVL1::RecMuonRoI::subsysID
unsigned int subsysID() const
returns sub-system ID ROI (0=-z,1=+z)
Definition: RecMuonRoI.h:108
TrigL2MuonSA::MuonRoad::setScales
void setScales(double inner, double middle, double outer)
Definition: MuonRoad.h:67
DeMoUpdate.tmp2
string tmp2
Definition: DeMoUpdate.py:1168
TrigL2MuonSA::TgcFitResult::tgcMidPhiNin
int tgcMidPhiNin
Definition: TgcFitResult.h:51
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
xAOD::L2StandAloneMuon_v2::setEtaBin
void setEtaBin(int value)
Set eta bin of pT LUT.
xAOD::L2StandAloneMuon_v2::setEndcapAlpha
void setEndcapAlpha(float value)
Set the fitted value in the endcap.
xAOD::L2StandAloneMuon_v2::etaMS
float etaMS() const
Get the eta at muon spectrometer.
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
xAOD::L2StandAloneMuon_v2::setEtaMap
void setEtaMap(float value)
Set eta used to refer pT LUT.
TrigL2MuonSA::RpcFitResult::phi
double phi
Definition: RpcFitResult.h:44
TrigL2MuonSA::RpcHits
std::vector< RpcHitData > RpcHits
Definition: RpcData.h:57
xAOD::L2StandAloneMuon_v2::setRegionEta
void setRegionEta(int station, int sector, float min, float max)
Eta range.
Definition: L2StandAloneMuon_v2.cxx:883
MuFastSteering::m_dEtasurrRoI
Gaudi::Property< float > m_dEtasurrRoI
Definition: MuFastSteering.h:294
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
MuFastSteering::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: MuFastSteering.h:309
xAOD::L2CombinedMuon_v1::setPhi
void setPhi(float phi)
Set the azimuthal angle ( ) of the muon.
Definition: L2CombinedMuon_v1.cxx:89
MuFastSteering::m_trackExtrapolator
ToolHandle< TrigL2MuonSA::MuFastTrackExtrapolator > m_trackExtrapolator
Definition: MuFastSteering.h:229
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::L2MuonParameters::NULLID
@ NULLID
Definition: TrigMuonDefs.h:34
TrigL2MuonSA::RpcFitResult::phi_inner
double phi_inner
Definition: RpcFitResult.h:47
xAOD::L2StandAloneMuon_v2::setPhiBin
void setPhiBin(int value)
Set phi bin of pT LUT.
TrigL2MuonSA::RpcFitResult
Definition: RpcFitResult.h:14
xAOD::L2StandAloneMuon_v2
Class describing standalone muons reconstructed in the LVL2 trigger.
Definition: L2StandAloneMuon_v2.h:36
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
xAOD::L2StandAloneMuon_v2::setAlgoId
void setAlgoId(int value)
MuFastSteering::m_trackFitter
ToolHandle< TrigL2MuonSA::MuFastTrackFitter > m_trackFitter
Definition: MuFastSteering.h:227
TrigL2MuonSA::RpcFitResult::offset_middle
double offset_middle
Definition: RpcFitResult.h:53
MuFastSteering::m_calStreamer
ToolHandle< TrigL2MuonSA::MuCalStreamerTool > m_calStreamer
Definition: MuFastSteering.h:239
MuFastSteering::m_outputCBmuonCollKey
SG::WriteHandleKey< xAOD::L2CombinedMuonContainer > m_outputCBmuonCollKey
Definition: MuFastSteering.h:343
TrigL2MuonSA::RpcFitResult::Clear
void Clear()
Definition: RpcFitResult.h:19
MuFastSteering::m_calBufferName
Gaudi::Property< std::string > m_calBufferName
Definition: MuFastSteering.h:299
MuFastSteering::MuFastSteering
MuFastSteering(const std::string &name, ISvcLocator *svc)
Constructor.
Definition: MuFastSteering.cxx:22
MuFastSteering::m_recMuonRoIUtils
TrigL2MuonSA::RecMuonRoIUtils m_recMuonRoIUtils
Definition: MuFastSteering.h:243
AthenaInterprocess::UpdateAfterFork
Definition: Incidents.h:22
CxxUtils::wrapToPi
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition: phihelper.h:24
xAOD::L2StandAloneMuon_v2::setIsRpcFailure
void setIsRpcFailure(int value)
Set flag to record if RPC is properly read.
xAOD::L2MuonParameters::BEE
@ BEE
BEE measurement point.
Definition: TrigMuonDefs.h:24
xAOD::L2MuonParameters::EndcapExtra
@ EndcapExtra
Extra station in the endcap spectrometer.
Definition: TrigMuonDefs.h:22
TrigL2MuonSA::TgcFitResult
Definition: TgcFitResult.h:11
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
xAOD::L2StandAloneMuon_v2::setRoiSubsystem
void setRoiSubsystem(uint32_t value)
TrigL2MuonSA::MdtRegion::rMin
double rMin[11][2]
Definition: MdtRegion.h:38
MuFastSteering::m_backExtrapolatorTool
ToolHandle< ITrigMuonBackExtrapolator > m_backExtrapolatorTool
Handle to MuonBackExtrapolator tool.
Definition: MuFastSteering.h:235
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
MuFastSteering::m_patternFinder
ToolHandle< TrigL2MuonSA::MuFastPatternFinder > m_patternFinder
Definition: MuFastSteering.h:223
TrigL2MuonSA::MdtHits
std::vector< MdtHitData > MdtHits
Definition: MdtData.h:57
TrigL2MuonSA::TgcHits
std::vector< TgcHitData > TgcHits
Definition: TgcData.h:43
MuFastSteering::storeMSRoiDescriptor
bool storeMSRoiDescriptor(const TrigRoiDescriptor *roids, const TrigL2MuonSA::TrackPattern &pattern, const DataVector< xAOD::L2StandAloneMuon > &outputTracks, TrigRoiDescriptorCollection &outputMS) const
Definition: MuFastSteering.cxx:3325
TrigL2MuonSA::MdtHitData
Definition: MdtData.h:18
TrigL2MuonSA::MdtRegion::zMin
double zMin[11][2]
Definition: MdtRegion.h:33
TrigL2MuonSA::MuonRoad::bw
double bw[N_STATION][N_SECTOR]
Definition: MuonRoad.h:82
xAOD::L2StandAloneMuon_v2::setTgcInn
void setTgcInn(float eta, float phi, float r, float z)
Set the results of TGC fit.
Definition: L2StandAloneMuon_v2.cxx:958
MuFastSteering::m_topoRoad
Gaudi::Property< bool > m_topoRoad
Definition: MuFastSteering.h:292
test_pyathena.pt
pt
Definition: test_pyathena.py:11
xAOD::L2StandAloneMuon_v2::setMdtHit
void setMdtHit(uint32_t onlineId, int isOutier, int chamber, float r, float z, float phi, float residual, float time, float space, float sigma)
Set the properties of each MDT tube.
Definition: L2StandAloneMuon_v2.cxx:1492
xAOD::L2StandAloneMuon_v2::setPt
void setPt(float pt)
Set the transverse momentum ( ) of the muon.
xAOD::L2MuonParameters::BME
@ BME
BME measurement point.
Definition: TrigMuonDefs.h:25
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TrigRoiDescriptor::roiWord
virtual unsigned int roiWord() const override final
Definition: TrigRoiDescriptor.h:135
MuFastSteering::m_scaleRoadBarrelInner
Gaudi::Property< float > m_scaleRoadBarrelInner
Definition: MuFastSteering.h:255
TrigL2MuonSA::MuonRoad::isEndcap
bool isEndcap
Definition: MuonRoad.h:72
xAOD::L2MuonParameters::BarrelInner
@ BarrelInner
Inner station in the barrel spectrometer.
Definition: TrigMuonDefs.h:16
xAOD::MuonRoI_v1::eta
float eta() const
The pseudorapidity ( ) of the muon candidate.
MuFastSteering::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Definition: MuFastSteering.h:252
ParticleTest.tp
tp
Definition: ParticleTest.py:25
TrigL2MuonSA::MdtRegion::zMax
double zMax[11][2]
Definition: MdtRegion.h:37
MuFastSteering::m_doEndcapForl2mt
Gaudi::Property< bool > m_doEndcapForl2mt
Definition: MuFastSteering.h:290
xAOD::L2StandAloneMuon_v2::setRoiSector
void setRoiSector(uint32_t value)
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
RecMuonRoI.h
MuFastSteering::m_stationFitter
ToolHandle< TrigL2MuonSA::MuFastStationFitter > m_stationFitter
Definition: MuFastSteering.h:225
TrigL2MuonSA::RpcFitResult::offset_inner
double offset_inner
Definition: RpcFitResult.h:49
xAOD::L2StandAloneMuon_v2::setDeltaPhi
void setDeltaPhi(float value)
Set error of phi.
xAOD::L2StandAloneMuon_v2::setSuperPoint
void setSuperPoint(int chamber, float r, float z, float slope, float intercept=0., float chi2=0.)
Set the properties of one particular super point measurement.
Definition: L2StandAloneMuon_v2.cxx:220
xAOD::L2StandAloneMuon_v2::setPhiMS
void setPhiMS(float value)
Set the phi at muon spectrometer.
TrigL2MuonSA::MdtRegion::Clear
void Clear()
Definition: MdtRegion.h:18
xAOD::L2StandAloneMuon_v2::setEtaMS
void setEtaMS(float value)
Set the eta at muon spectrometer.
xAOD::L2StandAloneMuon_v2::setRpcFitInn
void setRpcFitInn(float phi, float slope, float offset)
Set the results of RPC fit.
Definition: L2StandAloneMuon_v2.cxx:1050
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
xAOD::L2StandAloneMuon_v2::phiMS
float phiMS() const
Get the phi at muon spectrometer.
xAOD::roiEta
setTeId setLumiBlock setRoiId setRoiSubsystem setRoiNumber roiEta
Definition: L2StandAloneMuon_v2.cxx:343
MuFastSteering::m_muMsContainerKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_muMsContainerKey
Definition: MuFastSteering.h:339
xAOD::barrelRadius
setSAddress setEtaMS setDirPhiMS setDirZMS barrelRadius
Definition: L2StandAloneMuon_v1.cxx:128
xAOD::L2CombinedMuon_v1::setCharge
void setCharge(float value)
set seeding muon charge
MuFastSteering::m_esd_csc_size
Gaudi::Property< int > m_esd_csc_size
Definition: MuFastSteering.h:279
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MuFastSteering::m_FTFtrackKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_FTFtrackKey
Definition: MuFastSteering.h:323
xAOD::MuonRoI_v1::getHemisphere
Hemisphere getHemisphere() const
Returns the hemisphere that detected the muon candidate.
Definition: MuonRoI_v1.cxx:220
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
MuFastSteering::m_use_rpc
Gaudi::Property< bool > m_use_rpc
Definition: MuFastSteering.h:261
TrigL2MuonSA::RpcFitResult::offset_outer
double offset_outer
Definition: RpcFitResult.h:57
LVL1::RecMuonRoI::eta
virtual double eta() const
returns eta coord of ROI
Definition: RecMuonRoI.h:117
AthenaInterprocess::UpdateAfterFork::workerID
int workerID() const
assigned worker ID from processing unit
Definition: Incidents.h:40
TrigL2MuonSA::CscHits
std::vector< CscHitData > CscHits
Definition: CscData.h:40
x
#define x
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
xAOD::L2StandAloneMuon_v2::setRMS
void setRMS(float value)
Set the R at muon spectrometer.
TrigL2MuonSA::MdtRegion::chamberType
int chamberType[11][2][2]
Definition: MdtRegion.h:44
xAOD::L2MuonParameters::MUONID
@ MUONID
Definition: TrigMuonDefs.h:31
LVL1::RecMuonRoI::getThresholdNumber
unsigned int getThresholdNumber() const
returns the Threshold Number (1 to 6) associated with this RecRoI
Definition: RecMuonRoI.h:120
TrigL2MuonSA::MuonRoad::aw
double aw[N_STATION][N_SECTOR]
Definition: MuonRoad.h:81
TrigL2MuonSA::MdtRegion
Definition: MdtRegion.h:14
LVL1::RecMuonRoI::roiWord
virtual unsigned int roiWord() const
returns roi word
Definition: RecMuonRoI.h:102
xAOD::L2CombinedMuon_v1::setEta
void setEta(float eta)
Set the pseudorapidity ( ) of the muon.
Definition: L2CombinedMuon_v1.cxx:82
MuFastSteering::getRoiSizeForID
float getRoiSizeForID(bool isEta, const xAOD::L2StandAloneMuon *muonSA) const
Definition: MuFastSteering.cxx:3480
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
xAOD::L2StandAloneMuon_v2::setTgcHitsCapacity
void setTgcHitsCapacity(int value)
Set size of storage for TGC hits.
Definition: L2StandAloneMuon_v2.cxx:1204
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
xAOD::L2StandAloneMuon_v2::setTgcInnF
void setTgcInnF(float rhoStd, long rhoN, float phiStd, long phiN)
Definition: L2StandAloneMuon_v2.cxx:973
MuFastSteering::m_fill_FSIDRoI
Gaudi::Property< bool > m_fill_FSIDRoI
Definition: MuFastSteering.h:303
xAOD::L2CombinedMuon_v1
Class describing combined muon reconstructed in the LVL2 trigger.
Definition: L2CombinedMuon_v1.h:41
MuFastSteering::m_doCalStream
Gaudi::Property< bool > m_doCalStream
Definition: MuFastSteering.h:270
TrigL2MuonSA::TrackPattern
Definition: TrackData.h:16
xAOD::L2StandAloneMuon_v2::setPtEndcapBeta
void setPtEndcapBeta(float value)
LArCellBinning_test.retval
def retval
Definition: LArCellBinning_test.py:112
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
MuFastSteering::m_use_RoIBasedDataAccess_RPC
Gaudi::Property< bool > m_use_RoIBasedDataAccess_RPC
Definition: MuFastSteering.h:265
xAOD::L2StandAloneMuon_v2::setBeta
void setBeta(float value)
Set beta.
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MuFastSteering::m_calDataScouting
Gaudi::Property< bool > m_calDataScouting
Definition: MuFastSteering.h:271
MuFastSteering::m_recRoiCollectionKey
SG::ReadHandleKey< xAOD::MuonRoIContainer > m_recRoiCollectionKey
Definition: MuFastSteering.h:319
xAOD::L2StandAloneMuon_v2::setEta
void setEta(float eta)
Set the pseudorapidity ( ) of the muon.
Definition: L2StandAloneMuon_v2.cxx:82
efficiency
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:128
MuFastSteering::m_useRun3Config
Gaudi::Property< bool > m_useRun3Config
Definition: MuFastSteering.h:305
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::L2StandAloneMuon_v2::setRoad
void setRoad(int station, int sector, float aw, float bw)
Road.
Definition: L2StandAloneMuon_v2.cxx:751
TrigL2MuonSA::TgcFitResult::tgcMid2
float tgcMid2[4]
Definition: TgcFitResult.h:46
LVL1::RecMuonRoI
This class defines the reconstructed Muon ROI.
Definition: RecMuonRoI.h:60
MuFastSteering::handle
virtual void handle(const Incident &incident) override
Definition: MuFastSteering.cxx:168
TrigL2MuonSA::TgcFitResult::isSuccess
bool isSuccess
Definition: TgcFitResult.h:39
TrigL2MuonSA::RpcFitResult::slope_inner
double slope_inner
Definition: RpcFitResult.h:48
MuFastSteering::m_use_stgc
Gaudi::Property< bool > m_use_stgc
Definition: MuFastSteering.h:262
MuFastSteering::m_multiTrack
Gaudi::Property< bool > m_multiTrack
Definition: MuFastSteering.h:289
MuFastSteering.h
xAOD::L2StandAloneMuon_v2::setPhi
void setPhi(float phi)
Set the azimuthal angle ( ) of the muon.
Definition: L2StandAloneMuon_v2.cxx:89
xAOD::L2StandAloneMuon_v2::setBarrelSagitta
void setBarrelSagitta(float value)
Set the fitted sagitta of the muon in the barrel.
xAOD::L2StandAloneMuon_v2::sAddress
int sAddress() const
Get the station address of the muon.
MuFastSteering::m_scaleRoadBarrelMiddle
Gaudi::Property< float > m_scaleRoadBarrelMiddle
Definition: MuFastSteering.h:256
xAOD::L2StandAloneMuon_v2::setMmCluster
void setMmCluster(const unsigned int layer, const int isOutlier, const float eta, const float phi, const float r, const float z, const float residualR, const float residualPhi, const int stationEta, const int stationPhi, const int stationName)
Set MM hits.
Definition: L2StandAloneMuon_v2.cxx:1736
MuFastSteering::m_use_new_segmentfit
Gaudi::Property< bool > m_use_new_segmentfit
Definition: MuFastSteering.h:260
xAOD::L2StandAloneMuon_v2::setSAddress
void setSAddress(int value)
Set the station address of the muon.
TrigL2MuonSA::MuonRoad
Definition: MuonRoad.h:20
z
#define z
MuFastSteering::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: MuFastSteering.h:347
xAOD::L2StandAloneMuon_v2::setRoiSystem
void setRoiSystem(uint32_t value)
MuFastSteering::m_ftfminPt
Gaudi::Property< float > m_ftfminPt
Definition: MuFastSteering.h:291
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigL2MuonSA::TgcFitResult::Clear
void Clear()
Definition: TgcFitResult.h:16
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Incidents.h
TrigL2MuonSA::TgcFitResult::tgcInnRhoNin
int tgcInnRhoNin
Definition: TgcFitResult.h:57
xAOD::L2StandAloneMuon_v2::setRoiId
void setRoiId(uint32_t value)
xAOD::L2StandAloneMuon_v2::setChamberType2
void setChamberType2(int station, int sector, int chamberType)
Definition: L2StandAloneMuon_v2.cxx:723
xAOD::L2StandAloneMuon_v2::setPtEndcapAlpha
void setPtEndcapAlpha(float value)
MuFastSteering::storeMuonSA
bool storeMuonSA(const LVL1::RecMuonRoI *roi, const TrigRoiDescriptor *roids, const TrigL2MuonSA::MuonRoad &muonRoad, const TrigL2MuonSA::MdtRegion &mdtRegion, const TrigL2MuonSA::RpcHits &rpcHits, const TrigL2MuonSA::TgcHits &tgcHits, const TrigL2MuonSA::RpcFitResult &rpcFitResult, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MdtHits &mdtHits, const TrigL2MuonSA::CscHits &cscHits, const TrigL2MuonSA::StgcHits &stgcHits, const TrigL2MuonSA::MmHits &mmHits, const TrigL2MuonSA::TrackPattern &pattern, DataVector< xAOD::L2StandAloneMuon > &outputTracks, const EventContext &ctx) const
Definition: MuFastSteering.cxx:2478
TrigL2MuonSA::RecMuonRoIUtils::isBarrel
bool isBarrel(const LVL1::RecMuonRoI *p_roi) const
Definition: RecMuonRoIUtils.h:19
MuFastSteering::findMultiTrackSignature
StatusCode findMultiTrackSignature(const std::vector< const TrigRoiDescriptor * > &roi, const std::vector< const LVL1::RecMuonRoI * > &muonRoIs, DataVector< xAOD::L2StandAloneMuon > &outputTracks, const bool dynamicDeltaRpc, const EventContext &ctx) const
findMultiTrackSignature(), includes reconstract algorithms for multi-track mode
Definition: MuFastSteering.cxx:1759
TrigL2MuonSA::RpcFitResult::slope_middle
double slope_middle
Definition: RpcFitResult.h:52
xAOD::MuonRoI_v1
Class describing a LVL1 muon region of interest.
Definition: MuonRoI_v1.h:29
WeakBFieldA
@ WeakBFieldA
Definition: MuFastSteering.h:42
xAOD::MuonRoI_v1::getSource
RoISource getSource() const
Returns the system that detected the muon candidate.
Definition: MuonRoI_v1.cxx:202
MuFastSteering::findMuonSignature
StatusCode findMuonSignature(const std::vector< const TrigRoiDescriptor * > &roi, const std::vector< const LVL1::RecMuonRoI * > &muonRoIs, DataVector< xAOD::L2StandAloneMuon > &outputTracks, TrigRoiDescriptorCollection &outputID, TrigRoiDescriptorCollection &outputMS, const bool dynamicDeltaRpc, const EventContext &ctx) const
findMuonSignature(), includes reconstract algorithms
Definition: MuFastSteering.cxx:525
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigRoiDescriptor::l1Id
virtual unsigned int l1Id() const override final
Definition: TrigRoiDescriptor.h:134
LVL1::RecMuonRoI::sectorID
unsigned int sectorID() const
returns sector ID ROI
Definition: RecMuonRoI.h:111
MuFastSteering::m_roiCollectionKey
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
Definition: MuFastSteering.h:313
TrigL2MuonSA::TgcFitResult::tgcMid1
float tgcMid1[4]
Definition: TgcFitResult.h:45
TrigL2MuonSA::TgcHitData
Definition: TgcData.h:14
TrigL2MuonSA::RpcFitResult::phi_middle
double phi_middle
Definition: RpcFitResult.h:51
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MuFastSteering::m_use_endcapInnerFromBarrel
Gaudi::Property< bool > m_use_endcapInnerFromBarrel
Definition: MuFastSteering.h:273
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
MuFastSteering::m_muIdContainerKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_muIdContainerKey
Definition: MuFastSteering.h:335
MuFastSteering::L2MuonAlgoMap
int L2MuonAlgoMap(const std::string &name) const
Definition: MuFastSteering.cxx:3463
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
MuFastSteering::updateOutputObjects
bool updateOutputObjects(const LVL1::RecMuonRoI *roi, const TrigRoiDescriptor *roids, const TrigL2MuonSA::MuonRoad &muonRoad, const TrigL2MuonSA::MdtRegion &mdtRegion, const TrigL2MuonSA::RpcHits &rpcHits, const TrigL2MuonSA::TgcHits &tgcHits, const TrigL2MuonSA::RpcFitResult &rpcFitResult, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MdtHits &mdtHits, const TrigL2MuonSA::CscHits &cscHits, const TrigL2MuonSA::StgcHits &stgcHits, const TrigL2MuonSA::MmHits &mmHits, const std::vector< TrigL2MuonSA::TrackPattern > &trackPatterns, DataVector< xAOD::L2StandAloneMuon > &outputTracks, TrigRoiDescriptorCollection &outputID, TrigRoiDescriptorCollection &outputMS, const EventContext &ctx) const
Called at the end of the algorithm processing to set the steering navigation properly.
Definition: MuFastSteering.cxx:2398
xAOD::MuonRoI_v1::getRoI
int getRoI() const
Get the "RoI number" (position inside the sector)
Definition: MuonRoI_v1.cxx:89
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
TrigL2MuonSA::TgcFitResult::tgcInnRhoStd
float tgcInnRhoStd
Definition: TgcFitResult.h:56
xAOD::L2StandAloneMuon_v2::setCscHit
void setCscHit(int isOutlier, int chamber, uint32_t stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip, float eta, float phi, float r, float z, int charge, float time, float residual)
Set the properties of each CSC tube.
Definition: L2StandAloneMuon_v2.cxx:1650
TrigL2MuonSA::RpcHitData
Definition: RpcData.h:14
xAOD::L2StandAloneMuon_v2::setRegionZ
void setRegionZ(int station, int sector, float min, float max)
Z range.
Definition: L2StandAloneMuon_v2.cxx:795
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
xAOD::L2StandAloneMuon_v2::setRpcFitOut
void setRpcFitOut(float phi, float slope, float offset)
Definition: L2StandAloneMuon_v2.cxx:1076
xAOD::L2StandAloneMuon_v2::setMuonDetMask
void setMuonDetMask(uint32_t value)
TrigL2MuonSA::MdtRegion::etaMin
double etaMin[11][2]
Definition: MdtRegion.h:40
ZERO_LIMIT
const float ZERO_LIMIT
Definition: VP1TriggerHandleL2.cxx:37
TrigL2MuonSA::RpcFitResult::phi_outer
double phi_outer
Definition: RpcFitResult.h:55
xAOD::L2StandAloneMuon_v2::setChamberType1
void setChamberType1(int station, int sector, int chamberType)
Set the muon road information.
Definition: L2StandAloneMuon_v2.cxx:696
MuFastSteering::m_esd_rpc_size
Gaudi::Property< int > m_esd_rpc_size
Definition: MuFastSteering.h:276
xAOD::L2StandAloneMuon_v2::setStgcCluster
void setStgcCluster(const unsigned int layer, const int isOutlier, const int type, const float eta, const float phi, const float r, const float z, const float residualR, const float residualPhi, const int stationEta, const int stationPhi, const int stationName)
Set sTGC hits.
Definition: L2StandAloneMuon_v2.cxx:1697
xAOD::L2MuonParameters::GEV900ID
@ GEV900ID
Definition: TrigMuonDefs.h:31
LVL1::RecMuonRoI::phi
virtual double phi() const
returns phi coord of ROI
Definition: RecMuonRoI.h:114
MuFastSteering::m_insideOut
Gaudi::Property< bool > m_insideOut
Definition: MuFastSteering.h:288
TrigL2MuonSA::TgcFitResult::tgcMidRhoChi2
float tgcMidRhoChi2
Definition: TgcFitResult.h:47
xAOD::L2StandAloneMuon_v2::setIsTgcFailure
void setIsTgcFailure(int value)
Set flag to record if TGC is properly read.
xAOD::L2MuonParameters::EndcapMiddle
@ EndcapMiddle
Middle station in the endcap spectrometer.
Definition: TrigMuonDefs.h:20
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
MuFastSteering::m_use_RoIBasedDataAccess_MM
Gaudi::Property< bool > m_use_RoIBasedDataAccess_MM
Definition: MuFastSteering.h:269
xAOD::L2StandAloneMuon_v2::setEndcapBeta
void setEndcapBeta(float value)
Set the fitted value in the endcap.
xAOD::L2CombinedMuon_v1::setIdTrackLink
void setIdTrackLink(const ElementLink< xAOD::TrackParticleContainer > &link)
set ID track used to make the CB muon
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
LVL1::RecMuonRoI::sysID
unsigned int sysID() const
returns system ID ROI (Barrel=0, Endcap=1, Forward=2)
Definition: RecMuonRoI.h:105
MuFastSteering::m_esd_tgc_size
Gaudi::Property< int > m_esd_tgc_size
Definition: MuFastSteering.h:277
xAOD::L2StandAloneMuon_v2::setDirPhiMS
void setDirPhiMS(float value)
Set tan phi at muon spectrometer.
xAOD::L2StandAloneMuon_v2::setRpcHitsCapacity
void setRpcHitsCapacity(int value)
Size of storage to be reserved.
Definition: L2StandAloneMuon_v2.cxx:1183
phihelper.h
Helper for azimuthal angle calculations.
xAOD::L2StandAloneMuon_v2::setBarrelRadius
void setBarrelRadius(float value)
Set the fitted radius of the muon in the barrel.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:192
xAOD::L2StandAloneMuon_v2::setRpcHit
void setRpcHit(uint32_t layer, uint32_t measuresPhi, float x, float y, float z, float time, float distEta, float distPhi, const std::string &stationName)
Set RPC hits.
Definition: L2StandAloneMuon_v2.cxx:1340
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
xAOD::L2StandAloneMuon_v2::setMdtHitsCapacity
void setMdtHitsCapacity(int value)
Set size of storage for MDT hits.
Definition: L2StandAloneMuon_v2.cxx:1225
MuFastSteering::m_ftfRoadDefiner
ToolHandle< TrigL2MuonSA::FtfRoadDefiner > m_ftfRoadDefiner
Definition: MuFastSteering.h:231
xAOD::L2CombinedMuon
L2CombinedMuon_v1 L2CombinedMuon
Define the latest version of the muon CB class.
Definition: L2CombinedMuon.h:15
TrigL2MuonSA::TgcFitResult::tgcInn
float tgcInn[4]
Definition: TgcFitResult.h:55
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
MuFastSteering::m_scaleRoadBarrelOuter
Gaudi::Property< float > m_scaleRoadBarrelOuter
Definition: MuFastSteering.h:257
AthenaInterprocess::UpdateAfterFork::type
static const std::string & type()
Incident type.
Definition: Incidents.h:49
MuFastSteering::m_rWidth_TGC_Failed
Gaudi::Property< double > m_rWidth_TGC_Failed
Definition: MuFastSteering.h:284
xAOD::L2CombinedMuon_v1::setMuSATrackLink
void setMuSATrackLink(const ElementLink< xAOD::L2StandAloneMuonContainer > &link)
set SA muon used to make the CB muon
MuFastSteering::m_winPt
Gaudi::Property< double > m_winPt
Definition: MuFastSteering.h:286
TrigRoiDescriptor::roiId
virtual unsigned int roiId() const override final
these quantities probably don't need to be used any more
Definition: TrigRoiDescriptor.h:133
xAOD::L2CombinedMuon_v1::setPt
void setPt(float pt)
Set the transverse momentum ( ) of the muon.
xAOD::L2StandAloneMuon_v2::setRoiEta
void setRoiEta(float value)
MuFastSteering::initialize
virtual StatusCode initialize() override
Definition: MuFastSteering.cxx:30
TrigMuonDefs.h
MuFastSteering::m_dPhisurrRoI
Gaudi::Property< float > m_dPhisurrRoI
Definition: MuFastSteering.h:293
xAOD::L2StandAloneMuon_v2::setZMS
void setZMS(float value)
Set the Z at muon spectrometer.
xAOD::L2StandAloneMuon_v2::setRoiThreshold
void setRoiThreshold(uint32_t value)
MuFastSteering::stop
virtual StatusCode stop() override
Definition: MuFastSteering.cxx:150
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
MuFastSteering::execute
virtual StatusCode execute(const EventContext &ctx) const override
execute(), main code of the algorithm for AthenaMT
Definition: MuFastSteering.cxx:232
xAOD::L2StandAloneMuon_v2::setRpcFitMid
void setRpcFitMid(float phi, float slope, float offset)
Definition: L2StandAloneMuon_v2.cxx:1063
TrigL2MuonSA::RpcFitResult::isSuccess
bool isSuccess
Definition: RpcFitResult.h:38
matchingRecRoI
const LVL1::RecMuonRoI * matchingRecRoI(uint32_t roiWord, const DataVector< LVL1::RecMuonRoI > &collection)
Definition: MuFastSteering.cxx:204
RoiDescriptor::etaPlus
virtual double etaPlus() const override final
gets eta at zedPlus
Definition: RoiDescriptor.h:115
TrigL2MuonSA::TgcFitResult::tgcPT
float tgcPT
Definition: TgcFitResult.h:63
xAOD::L2StandAloneMuon_v2::setTgcPt
void setTgcPt(float value)
TrigL2MuonSA::MmHits
std::vector< MmHitData > MmHits
Definition: MmData.h:47
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
RoiDescriptor::phi
virtual double phi() const override final
Methods to retrieve data members.
Definition: RoiDescriptor.h:100
xAOD::L2MuonParameters::EndcapInner
@ EndcapInner
Inner station in the endcap spectrometer.
Definition: TrigMuonDefs.h:19
TrigRoiDescriptorCollection
Definition: TrigRoiDescriptorCollection.h:21
xAOD::L2MuonParameters::BarrelOuter
@ BarrelOuter
Outer station in the barrel spectrometer.
Definition: TrigMuonDefs.h:18
TrigL2MuonSA::StgcHits
std::vector< StgcHitData > StgcHits
Definition: StgcData.h:49
MuonRoI.h
xAOD::L2StandAloneMuon_v2::setRegionR
void setRegionR(int station, int sector, float min, float max)
R range.
Definition: L2StandAloneMuon_v2.cxx:839
DEBUG
#define DEBUG
Definition: page_access.h:11
bcTag
unsigned bcTag(unsigned bcBitMap)
Definition: TgcByteStreamData.h:359
MuFastSteering::m_use_mcLUT
Gaudi::Property< bool > m_use_mcLUT
Definition: MuFastSteering.h:259
MuFastSteering::m_muFastContainerKey
SG::WriteHandleKey< xAOD::L2StandAloneMuonContainer > m_muFastContainerKey
Definition: MuFastSteering.h:327
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
xAOD::L2StandAloneMuon_v2::setRoiNumber
void setRoiNumber(uint32_t value)
MuFastSteering::m_run2recRoiCollectionKey
SG::ReadHandleKey< DataVector< LVL1::RecMuonRoI > > m_run2recRoiCollectionKey
Definition: MuFastSteering.h:317
python.LArCondContChannels.isBarrel
isBarrel
Definition: LArCondContChannels.py:659
xAOD::L2StandAloneMuon_v2::setLvl1Id
void setLvl1Id(uint32_t value)
MuFastSteering::findMuonSignatureIO
StatusCode findMuonSignatureIO(const xAOD::TrackParticleContainer &idtracks, const std::vector< const TrigRoiDescriptor * > &roids, const std::vector< const LVL1::RecMuonRoI * > &muonRoIs, DataVector< xAOD::L2CombinedMuon > &outputCBs, DataVector< xAOD::L2StandAloneMuon > &outputSAs, const bool dynamicDeltaRpc, const EventContext &ctx) const
findMuonSignatureIO(), includes reconstract algorithms for inside-out mode
Definition: MuFastSteering.cxx:1138
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
xAOD::L2StandAloneMuon_v2::setPtCSC
void setPtCSC(float value)
xAOD::L2StandAloneMuon_v2::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
LVL1::RecMuonRoI::getRoINumber
unsigned int getRoINumber() const
return RoI number in hardware numbering scheme
Definition: RecMuonRoI.h:126
WeakBFieldB
@ WeakBFieldB
Definition: MuFastSteering.h:42
TrigL2MuonSA::RpcFitResult::slope_outer
double slope_outer
Definition: RpcFitResult.h:56
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
TrigRoiDescriptor.h
xAOD::L2StandAloneMuon_v2::setRoIWord
void setRoIWord(uint32_t value)
Set the RoI ID of the seeding LVL1 muon.
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
MuFastSteering::m_rWidth_RPC_Failed
Gaudi::Property< double > m_rWidth_RPC_Failed
Definition: MuFastSteering.h:283
TrigL2MuonSA::MuonRoad::extFtfMiddleEta
double extFtfMiddleEta
Definition: MuonRoad.h:90
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
MuFastSteering::m_calBufferSize
Gaudi::Property< int > m_calBufferSize
Definition: MuFastSteering.h:300
xAOD::MuonRoI_v1::getSectorID
int getSectorID() const
Get the sector ID number.
Definition: MuonRoI_v1.cxx:133
TrigL2MuonSA::MdtRegion::etaMax
double etaMax[11][2]
Definition: MdtRegion.h:41
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
MuFastSteering::m_use_RoIBasedDataAccess_MDT
Gaudi::Property< bool > m_use_RoIBasedDataAccess_MDT
Definition: MuFastSteering.h:264
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
RoiDescriptor::phiPlus
virtual double phiPlus() const override final
gets phiPlus
Definition: RoiDescriptor.h:118
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:159
xAOD::L2StandAloneMuon_v2::setTgcHit
void setTgcHit(float eta, float phi, float r, float z, float width, int stationNum, bool isStrip, int bcTag, bool inRoad)
Set TGC hits.
Definition: L2StandAloneMuon_v2.cxx:1375
xAOD::L2StandAloneMuon_v2::setCscHitsCapacity
void setCscHitsCapacity(int value)
Set size of storage for CSC hits.
Definition: L2StandAloneMuon_v2.cxx:1246
xAOD::L2StandAloneMuon
L2StandAloneMuon_v2 L2StandAloneMuon
Define the latest version of the muon SA class.
Definition: L2StandAloneMuon.h:17
TrigL2MuonSA::TgcFitResult::tgcInnPhiNin
int tgcInnPhiNin
Definition: TgcFitResult.h:60
RoiDescriptor::etaMinus
virtual double etaMinus() const override final
gets eta at zMinus
Definition: RoiDescriptor.h:116
xAOD::L2StandAloneMuon_v2::setStgcClustersCapacity
void setStgcClustersCapacity(const int value)
Set size of storage for sTGC clusters.
Definition: L2StandAloneMuon_v2.cxx:1274
TrigL2MuonSA::TgcFitResult::tgcMidPhiChi2
float tgcMidPhiChi2
Definition: TgcFitResult.h:50
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
xAOD::L2StandAloneMuon_v2::setPtEndcapRadius
void setPtEndcapRadius(float value)
xAOD::L2StandAloneMuon_v2::setDirZMS
void setDirZMS(float value)
Set dRdZ at muon spectrometer.
TrigL2MuonSA::MuonRoad::Clear
void Clear()
Definition: MuonRoad.h:25
xAOD::MuonRoI_v1::getThrNumber
int getThrNumber() const
Get the logic number of the highest threshold this RoI passed.
Definition: MuonRoI_v1.cxx:76
xAOD::L2CombinedMuon_v1::setErrorFlag
void setErrorFlag(int value)
set algorithm error flag
xAOD::L2StandAloneMuon_v2::setPhiMap
void setPhiMap(float value)
Set phi used to refer pT LUT.
xAOD::L2StandAloneMuon_v2::setEndcapRadius
void setEndcapRadius(float value)
Set the fitted radius of the muon in the endcap.
MuFastSteering::m_esd_mdt_size
Gaudi::Property< int > m_esd_mdt_size
Definition: MuFastSteering.h:278
RoiDescriptor::phiMinus
virtual double phiMinus() const override final
gets phiMinus
Definition: RoiDescriptor.h:119
xAOD::L2StandAloneMuon_v2::setDeltaPt
void setDeltaPt(float value)
Set error of pT.
MuFastSteering::m_esd_mm_size
Gaudi::Property< int > m_esd_mm_size
Definition: MuFastSteering.h:281
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::L2MuonParameters::BarrelMiddle
@ BarrelMiddle
Middle station in the barrel spectrometer.
Definition: TrigMuonDefs.h:17
xAOD::L2StandAloneMuon_v2::setLumiBlock
void setLumiBlock(uint32_t value)
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
xAOD::L2MuonParameters::EndcapOuter
@ EndcapOuter
Outer station in the endcap spectrometer.
Definition: TrigMuonDefs.h:21
TrigL2MuonSA::TgcFitResult::tgcInnPhiStd
float tgcInnPhiStd
Definition: TgcFitResult.h:59
TrigL2MuonSA::MdtRegion::rMax
double rMax[11][2]
Definition: MdtRegion.h:39
MuFastSteering::m_esd_stgc_size
Gaudi::Property< int > m_esd_stgc_size
Definition: MuFastSteering.h:280
xAOD::MuonRoI_v1::roiWord
uint32_t roiWord() const
The "raw" RoI word describing the muon candidate.
MuFastSteering::m_use_RoIBasedDataAccess_TGC
Gaudi::Property< bool > m_use_RoIBasedDataAccess_TGC
Definition: MuFastSteering.h:266
xAOD::L2StandAloneMuon_v2::setTgcMid2
void setTgcMid2(float eta, float phi, float r, float z)
Definition: L2StandAloneMuon_v2.cxx:1003
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::L2StandAloneMuon_v2::setTgcMid1
void setTgcMid1(float eta, float phi, float r, float z)
Definition: L2StandAloneMuon_v2.cxx:988
xAOD::L2StandAloneMuon_v2::setTrackPosition
void setTrackPosition(float r, float z, float eta, float phi)
Set position of muon track.
Definition: L2StandAloneMuon_v2.cxx:301
xAOD::L2StandAloneMuon_v2::setRoiPhi
void setRoiPhi(float value)
L2StandAloneMuonAuxContainer.h
MuFastSteering::m_muCompositeContainerKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_muCompositeContainerKey
Definition: MuFastSteering.h:331
xAOD::L2MuonParameters::whichECRegion
ECRegions whichECRegion(const float eta, const float phi)
Definition: TrigMuonDefs.cxx:16
xAOD::MuonRoI_v1::phi
float phi() const
The azimuthal angle ( ) of the muon candidate.
MuFastSteering::m_use_RoIBasedDataAccess_STGC
Gaudi::Property< bool > m_use_RoIBasedDataAccess_STGC
Definition: MuFastSteering.h:268