diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/CscRegUtils.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/CscRegUtils.h index 2e00dcc9abd92ab7b081472b726906bcd7495adb..8acb98476dec5548277caf33cff5b1dff41c17cf 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/CscRegUtils.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/CscRegUtils.h @@ -15,7 +15,6 @@ #include <iostream> #include <vector> -//using namespace std; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcDataPreparator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcDataPreparator.h index 102ef3b85c01d1854acddf166f6115c3756b57bc..a8a0045a518f6866eda1c201ad52aabdee6040af 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcDataPreparator.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcDataPreparator.h @@ -114,6 +114,7 @@ class RpcDataPreparator: public AthAlgTool // Flag to decide whether or not to run BS decoding Gaudi::Property< bool > m_decodeBS { this, "DecodeBS", true, "Flag to decide whether or not to run BS->RDO decoding" }; + Gaudi::Property< bool > m_emulateNoRpcHit { this, "EmulateNoRpcHit", false, "Flag for emulation of no RPC hit events" }; }; } // namespace TrigL2MuonSA diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py index 3ab87e1b651f22b5d2be3eba8d9d16bb11d26712..7df5b551dda0ee0a77528acbd77abd9764e8bef8 100755 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py @@ -1,5 +1,6 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram @@ -29,14 +30,14 @@ class TrigL2MuonSAMonitoring(GenericMonitoringTool): defineHistogram('TIME_Station_Fitter', type='TH1F', title="Station fitter time (us)", xbins=100, xmin=0, xmax=5000 ), defineHistogram('TIME_Track_Fitter', type='TH1F', title="Track fitter time (us)", xbins=100, xmin=0, xmax=300 ), defineHistogram('TIME_Track_Extrapolator', type='TH1F', title="Track extrapolator time (us)", xbins=100, xmin=0, xmax=300 ), - defineHistogram('TIME_Calibration_Streamer', type='TH1F', title="Calibration streamer time (us)", xbins=100, xmin=0, xmax=50000 ) ] + defineHistogram('TIME_Calibration_Streamer', type='TH1F', title="Calibration streamer time (us)", xbins=100, xmin=0, xmax=50000 ), + defineHistogram('InvalidRpcRoINumber', type='TH1F', title="RoI Number of Invalid RPC RoI; RoI Number", xbins=150, xmin=-0.5, xmax=150.5) ] class TrigL2MuonSAValidationMonitoring(TrigGenericMonitoringToolConfig): def __init__ (self, name="TrigL2MuonSAValidationMonitoring"): super(TrigL2MuonSAValidationMonitoring, self).__init__(name) self.defineTarget("Validation") - self.Histograms = [ defineHistogram('InnMdtHits', type='TH1F', title="Hit multiplicity in the INNER road; MDT hits", xbins=50, xmin=-0.5, xmax=50.5) ] self.Histograms += [ defineHistogram('MidMdtHits', type='TH1F', title="Hit multiplicity in the MIDDLE road; MDT hits", @@ -67,7 +68,8 @@ class TrigL2MuonSAValidationMonitoring(TrigGenericMonitoringToolConfig): xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ] self.Histograms += [ defineHistogram('FailedRoIEta, FailedRoIPhi', type='TH2F', title="Location of LVL2 track failure; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ] - + self.Histograms += [ defineHistogram('InvalidRpcRoINumber', type='TH1F', title="RoI Number of Invalid RPC RoI; RoI Number", + xbins=150, xmin=-0.5, xmax=150.5) ] class TrigL2MuonSAOnlineMonitoring(TrigGenericMonitoringToolConfig): def __init__ (self, name="TrigL2MuonSAOnlineMonitoring"): @@ -104,6 +106,8 @@ class TrigL2MuonSAOnlineMonitoring(TrigGenericMonitoringToolConfig): xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ] self.Histograms += [ defineHistogram('FailedRoIEta, FailedRoIPhi', type='TH2F', title="Location of LVL2 track failure; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ] + self.Histograms += [ defineHistogram('InvalidRpcRoINumber', type='TH1F', title="RoI Number of Invalid RPC RoI ; RoI Number", + xbins=150, xmin=-0.5, xmax=150.5) ] class TrigL2MuonSACosmicMonitoring(TrigGenericMonitoringToolConfig): @@ -141,4 +145,6 @@ class TrigL2MuonSACosmicMonitoring(TrigGenericMonitoringToolConfig): xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ] self.Histograms += [ defineHistogram('FailedRoIEta, FailedRoIPhi', type='TH2F', title="Location of LVL2 track failure; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ] + self.Histograms += [ defineHistogram('InvalidRpcRoINumber', type='TH1F', title="RoI Number of Invalid RPC RoI; RoI Number", + xbins=150, xmin=-0.5, xmax=150.5) ] diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx index e2869139452210e7e403c3de79fffe4822af2f76..9aaf7db7b6cfef1a84d1a8a9451b0ee9f590c070 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx @@ -476,8 +476,8 @@ void TrigL2MuonSA::MdtRegionDefiner::find_phi_min_max(float phiMiddle, float& ph void TrigL2MuonSA::MdtRegionDefiner::find_eta_min_max(float zMin, float rMin, float zMax, float rMax, float& etaMin, float& etaMax) { - const bool doEmulateMuFast = true; - // const bool doEmulateMuFast = false; + // const bool doEmulateMuFast = true; + const bool doEmulateMuFast = false; etaMin = 0.; etaMax = 0.; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.cxx index 77dc52bf2117b9fc2b23165e93d4e89824468289..72dec918e8ae461a29ad1aa4c103f9d36e88b336 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.cxx @@ -245,7 +245,7 @@ StatusCode TrigL2MuonSA::MuFastDataPreparator::prepareData(const LVL1::RecMuonRo } } - //m_recRPCRoiSvc->reconstruct((*p_roi)->roiWord()); + m_recRPCRoiSvc->reconstruct(p_roi->roiWord()); double roiEtaMinLow = 0.; double roiEtaMaxLow = 0.; double roiEtaMinHigh = 0.; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx index bec221101de8eb3879ab644e37362b881e6ba692..1408a4556889555f018f417b02759621213d625c 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx @@ -93,7 +93,7 @@ HLT::ErrorCode MuFastSteering::hltInitialize() // if (m_patternFinder.retrieve().isFailure()) { - ATH_MSG_ERROR("Cannot retrieve Tool DataPreparator"); + ATH_MSG_ERROR("Cannot retrieve Tool DataPreparator"); return HLT::BAD_JOB_SETUP; } @@ -126,6 +126,7 @@ HLT::ErrorCode MuFastSteering::hltInitialize() ATH_MSG_ERROR("Could not retrieve " << m_cscsegmaker); return HLT::BAD_JOB_SETUP; } + // Set service tools m_trackExtrapolator->setExtrapolatorTool(&m_backExtrapolatorTool); m_dataPreparator->setExtrapolatorTool(&m_backExtrapolatorTool); @@ -610,7 +611,7 @@ StatusCode MuFastSteering::findMuonSignature(const DataVector<const TrigRoiDescr ATH_MSG_DEBUG("Start an algorithm of MuonSA"); if ( m_recMuonRoIUtils.isBarrel(*p_roi) ) { // Barrel ATH_MSG_DEBUG("Barrel"); - + m_muonRoad.setScales(m_scaleRoadBarrelInner, m_scaleRoadBarrelMiddle, m_scaleRoadBarrelOuter); @@ -739,6 +740,7 @@ StatusCode MuFastSteering::findMuonSignature(const DataVector<const TrigRoiDescr trackPatterns); + if (!sc.isSuccess()) { ATH_MSG_WARNING("Pattern finder failed"); // Update output trigger element @@ -1004,6 +1006,7 @@ bool MuFastSteering::storeMuonSA(const LVL1::RecMuonRoI* roi, int endcapinner = 3; int bee = 8; int bme = 9; + // int bmg = 10; // define inner, middle, outer if (pattern.s_address==-1) { @@ -1659,6 +1662,7 @@ StatusCode MuFastSteering::updateMonitor(const LVL1::RecMuonRoI* auto inner_mdt_hits = MonitoredScalar::declare("InnMdtHits", -1); auto middle_mdt_hits = MonitoredScalar::declare("MidMdtHits", -1); auto outer_mdt_hits = MonitoredScalar::declare("OutMdtHits", -1); + auto invalid_rpc_roi_number = MonitoredScalar::declare("InvalidRpcRoINumber", -1); auto efficiency = MonitoredScalar::declare("Efficiency", 0); auto sag_inverse = MonitoredScalar::declare("SagInv", 9999.); @@ -1691,6 +1695,7 @@ StatusCode MuFastSteering::updateMonitor(const LVL1::RecMuonRoI* auto fit_residuals = MonitoredCollection::declare("FitResiduals", f_residuals); auto monitorIt = MonitoredScope::declare(m_monTool, inner_mdt_hits, middle_mdt_hits, outer_mdt_hits, + invalid_rpc_roi_number, efficiency, sag_inverse, address, absolute_pt, sagitta, track_pt, track_eta, track_phi, failed_eta, failed_phi, res_inner, res_middle, res_outer, fit_residuals ); @@ -1736,6 +1741,9 @@ StatusCode MuFastSteering::updateMonitor(const LVL1::RecMuonRoI* inner_mdt_hits = count_inner; middle_mdt_hits = count_middle; outer_mdt_hits = count_outer; + + if ( m_dataPreparator->isRpcFakeRoi() ) + invalid_rpc_roi_number = roi->getRoINumber(); track_pt = (fabs(pattern.pt ) > ZERO_LIMIT)? pattern.charge*pattern.pt: 9999.; absolute_pt = fabs(track_pt); diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx index b9094dd52f12098fefd029f779dd156556a1f655..4fb61bd36a1d2c5964b7a0676b607b0cdee80361 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx @@ -147,6 +147,9 @@ StatusCode TrigL2MuonSA::RpcDataPreparator::prepareData(const TrigRoiDescriptor* // set to false the flag indicating whether the roi is a fake one. m_isFakeRoi = false; + if( m_emulateNoRpcHit ) + return StatusCode::SUCCESS; + // check the roi ID // decode roIWord diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx index bee95a470846b2ae48bd1e6ee4c01ecf8b5f479b..6f218f7b723638861bfafb72259d2218649a51ed 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx @@ -156,13 +156,24 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* for (int i_station=0; i_station<6; i_station++) { for (int i_layer=0; i_layer<8; i_layer++) { - if (i_station==0) muonRoad.rWidth[i_station][i_layer] = 400;//for inner - else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 200;//for middle - else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 400;//for outer - else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 400;//EndcapInner - else if (i_station==4) muonRoad.rWidth[9][i_layer] = m_rWidth_RPC_Failed;//BME - else if (i_station==5) muonRoad.rWidth[10][i_layer] = m_rWidth_RPC_Failed;//BMG - else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed; + if(!rpcFitResult.isSuccess) { + if (i_station==0) muonRoad.rWidth[i_station][i_layer] = 500;//for inner + else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 650;//for middle + else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 800;//for outer + else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 500;//EndcapInner + else if (i_station==4) muonRoad.rWidth[9][i_layer] = 650;//BME + else if (i_station==5) muonRoad.rWidth[10][i_layer] = 650;//BMG + else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed; + } + else { + if (i_station==0) muonRoad.rWidth[i_station][i_layer] = 400;//for inner + else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 200;//for middle + else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 400;//for outer + else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 400;//EndcapInner + else if (i_station==4) muonRoad.rWidth[9][i_layer] = m_rWidth_RPC_Failed;//BME + else if (i_station==5) muonRoad.rWidth[10][i_layer] = m_rWidth_RPC_Failed;//BMG + else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed; + } } } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcDataPreparator.cxx index decab7e4dd0f65aca8f2683997a713059806d54b..6c9b39b00a2d37286d5fcce50db6d1141985a759 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcDataPreparator.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcDataPreparator.cxx @@ -72,7 +72,7 @@ StatusCode TrigL2MuonSA::TgcDataPreparator::initialize() sc = AthAlgTool::initialize(); if (!sc.isSuccess()) { ATH_MSG_ERROR("Could not initialize the AthAlgTool base class."); - return sc; + return sc; } ATH_CHECK( m_storeGateSvc.retrieve() );