diff --git a/Trigger/TrigT1/TrigT1Muctpi/CMakeLists.txt b/Trigger/TrigT1/TrigT1Muctpi/CMakeLists.txt deleted file mode 100644 index 7d0f2f78350472f4f62d6b011a5c21bc02e652b0..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -# Declare the package name: -atlas_subdir( TrigT1Muctpi ) - -# External dependencies: -find_package( XercesC ) - -# Component(s) in the package: -atlas_add_component( TrigT1Muctpi - src/Algorithms/*.cxx - src/Common/*.cxx - src/Logging/*.cxx - src/Mibak/*.cxx - src/Mictp/*.cxx - src/Mioct/*.cxx - src/Mirod/*.cxx - src/components/*.cxx - INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} - LINK_LIBRARIES ${XERCESC_LIBRARIES} AnalysisTriggerEvent AthenaBaseComps AthenaKernel CxxUtils GaudiKernel PathResolver StoreGateLib TrigConfInterfaces TrigConfL1Data TrigConfMuctpi TrigT1Interfaces TrigT1Result ) - -# Install files from the package: -atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Trigger/TrigT1/TrigT1Muctpi/doc/packagedoc.h b/Trigger/TrigT1/TrigT1Muctpi/doc/packagedoc.h deleted file mode 100644 index ffc167cfba3483bfc0ddd3e2eefc76293e50d76b..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/doc/packagedoc.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -/** -@page TrigT1Muctpi_page TrigT1Muctpi Package - - @author Attila Kraznahorkay Jr. <Attila.Krasznahorkay@cern.ch> - @author Thorsten Wengler <Thorsten.Wengler@cern.ch> - -@section TrigT1Muctpi_TrigT1MuctpiIntro Introduction - - This package holds the simulation code of the Muon to CTP Interface (MuCTPI). - This hardware is responsible for collecting the muon candidates reconstructed by - the RPC and TGC sector logics, count their multiplicity in 6 different thresholds - considering overlaps between the trigger sectors, and send the multiplicity - result to the CTP. It also supplies information on the LVL1 muon candidates - to the RoI Builder and the DAQ system. - -@section TrigT1Muctpi_TrigT1MuctpiOverview Class Overview - - The package contains the following algorithms: - - - LVL1MUCTPI::L1Muctpi : The main MuCTPI simulation algorithm. - - CBNTAA_ReadMuCTPI_RDO : Algorithm that saves MuCTPI variables in a CBNTAA ntuple. - - CBNTAA_ReadMuCTPI_RIO : Algorithm that saves "extended" MuCTPI variables in a CBNTAA ntuple. - - CBNTAA_MuctpiRoI : Algorithm saving eta-phi coordinates for muon RoIs to CBNTAA ntuple. - - LVL1MUCTPI::L1MuctpiPatGen : Algorithm generating random input for the MuCTPI simulation. For testing only. - - LVL1MUCTPI::L1MuctpiTestReadResults : Algorithm "testing" the output of the MuCTPI simulation. - - The actual hardware simulation uses a lot of classes. Those can all be found in the "Classes" tab. - - */ diff --git a/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py b/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py deleted file mode 100644 index 28fb8b0c06e185862aa93c36a8d0935e977e6536..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py +++ /dev/null @@ -1,320 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - - -# Local (generated) configurable(s): -from TrigT1Muctpi.TrigT1MuctpiConf import LVL1MUCTPI__L1Muctpi -from TrigT1Muctpi.TrigT1MuctpiConf import LVL1MUCTPI__L1MuctpiTool - -class DefaultL1Muctpi( LVL1MUCTPI__L1Muctpi ): - - """ - Base configurable module for the L1Muctpi algorithm configurations - """ - - def __init__( self, name = "L1Muctpi" ): - - LVL1MUCTPI__L1Muctpi.__init__( self, name ) - - # Create a logger: - from AthenaCommon.Logging import logging - logger = logging.getLogger( "L1Muctpi" ) - - # Set properties of the LUT overlap handling: - self.OverlapStrategyName = "LUT" - self.DumpLUT = False - self.LUTXMLFile = "UNDEFINED" - self.RunPeriod = "UNDEFINED" - self.FlaggingMode = False - self.MultiplicityStrategyName = "INCLUSIVE" - - # Decide which LUT to use, based on which run we are simulating: - from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags - from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags - if ( commonGeoFlags.Run() == "RUN1" ) or ( ( commonGeoFlags.Run() == "UNDEFINED" ) and - ( geoFlags.isIBL() is False ) ): - self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml" - self.RunPeriod = "RUN1" - logger.info( "Configuring MuCTPI simulation with Run 1 configuration file:" ) - logger.info( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml" ) - logger.info( " with a RunPeriod=RUN1" ) - elif ( commonGeoFlags.Run() == "RUN2" ) or ( ( commonGeoFlags.Run() == "UNDEFINED" ) and - ( geoFlags.isIBL() is True ) ): - self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" - self.RunPeriod = "RUN2" - logger.info( "Configuring MuCTPI simulation with Run 2 configuration file:" ) - logger.info( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" ) - logger.info( " with a RunPeriod=RUN2" ) - else: - self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" - self.RunPeriod = "RUN2" - logger.warning( "Couldn't determine which run to simulate, using Run 2 configuration file:" ) - logger.warning( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" ) - logger.warning( " with a RunPeriod=RUN2" ) - - pass - - # Set properties for NIM outputs ot L1Topo conversion from RoI to eta/phi - self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml" - - # Turn on the NIM output creation by default: - self.DoNIMOutput = True - # The bit settings were extracted from here: - # https://savannah.cern.ch/bugs/?90300#comment14 - self.NIMBarrelBit = 29 - self.NIMEndcapBit = 30 - - ### this should not be done at all, since it instantiates a config svc without proper configuration!! - ### instead rely on the TriggerConfigGetter being setup in the top job properties - # Ensure that the LVL1ConfigSvc is loaded: - #from AthenaCommon.AppMgr import ServiceMgr # Has to be imported here for some reason... - #if not hasattr( ServiceMgr, "LVL1ConfigSvc" ): - # from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc - # lvl1ConfigSvc = LVL1ConfigSvc("LVL1ConfigSvc") -# # lvl1ConfigSvc.XMLFile = "LVL1config13.0.20.xml" - # ServiceMgr += lvl1ConfigSvc - # self.LVL1ConfigSvc = lvl1ConfigSvc - -class L1Muctpi( DefaultL1Muctpi ): - - """ - Module configuring the default MuCTPI simulation to be used as - part of the LVL1 simulation. - """ - - def __init__( self, name = "L1Muctpi" ): - - DefaultL1Muctpi.__init__( self, name ) - - self.InputSource = "DIGITIZATION" - -class L1Muctpi_on_RDO( DefaultL1Muctpi ): - - """ - Module configuring the MuCTPI simulation to be re-run on an RDO file - (that already has a result from a previous MuCTPI simulation running) - """ - - def __init__( self, name = "L1Muctpi_on_RDO" ): - - DefaultL1Muctpi.__init__( self, name ) - - self.InputSource = "RDO" - self.RDOLocID = "MUCTPI_RDO" - self.RDOOutputLocID = "MUCTPI_RDO+" - self.RoIOutputLocID = "not_used_1" - self.CTPOutputLocID = "not_used_2" - -class L1Muctpi_on_Data( DefaultL1Muctpi ): - - """ - Module configuring the MuCTPI simulation to be re-run on data BS file - (that already has a result from a previous MuCTPI simulation running) - """ - - def __init__( self, name = "L1Muctpi_on_Data" ): - - DefaultL1Muctpi.__init__( self, name ) - - self.InputSource = "RDO" - self.RDOLocID = "MUCTPI_RDO" - self.RDOOutputLocID = "MUCTPI_RDO+" - self.RoIOutputLocID = "not_used_1" - self.OverlapStrategyName = "LUT" - self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB_crc_3385316356.xml" - self.IsData=1 - self.FlaggingMode = False - -class L1Muctpi_on_AOD( DefaultL1Muctpi ): - - """ - Module configuring the MuCTPI simulation to be re-run on an AOD file - (that contains the LVL1_ROI object) - """ - - def __init__( self, name = "L1Muctpi_on_AOD" ): - - DefaultL1Muctpi.__init__( self, name ) - - self.InputSource = "AOD" - self.AODLocID = "LVL1_ROI" - self.RDOOutputLocID = "MUCTPI_RDO+" - self.RoIOutputLocID = "not_used_1" - self.CTPOutputLocID = "not_used_2" - - -# for now just duplicate the configuration for the L1MuctpiTool, to be consolidated -# ------------------------------------------------------------------------------------------------------ - - - -class DefaultL1MuctpiTool( LVL1MUCTPI__L1MuctpiTool ): - - """ - Base configurable module for the L1MuctpiTool algorithm configurations - """ - - def __init__( self, name = "L1MuctpiTool" ): - - LVL1MUCTPI__L1MuctpiTool.__init__( self, name ) - - # Create a logger: - from AthenaCommon.Logging import logging - logger = logging.getLogger( "L1MuctpiTool" ) - - # Set properties of the LUT overlap handling: - self.OverlapStrategyName = "LUT" - self.DumpLUT = False - self.LUTXMLFile = "UNDEFINED" - self.RunPeriod = "UNDEFINED" - self.FlaggingMode = False - self.MultiplicityStrategyName = "INCLUSIVE" - - # Decide which LUT to use, based on which run we are simulating: - from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags - from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags - if ( commonGeoFlags.Run() == "RUN1" ) or ( ( commonGeoFlags.Run() == "UNDEFINED" ) and - ( geoFlags.isIBL() is False ) ): - self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml" - self.RunPeriod = "RUN1" - logger.info( "Configuring MuCTPI simulation with Run 1 configuration file:" ) - logger.info( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml" ) - logger.info( " with a RunPeriod=RUN1" ) - elif ( commonGeoFlags.Run() == "RUN2" ) or ( ( commonGeoFlags.Run() == "UNDEFINED" ) and - ( geoFlags.isIBL() is True ) ): - self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" - self.RunPeriod = "RUN2" - logger.info( "Configuring MuCTPI simulation with Run 2 configuration file:" ) - logger.info( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" ) - logger.info( " with a RunPeriod=RUN2" ) - else: - self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" - self.RunPeriod = "RUN2" - logger.warning( "Couldn't determine which run to simulate, using Run 2 configuration file:" ) - logger.warning( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" ) - logger.warning( " with a RunPeriod=RUN2" ) - - pass - - # Set properties for NIM outputs ot L1Topo conversion from RoI to eta/phi - self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml" - - # Turn on the NIM output creation by default: - self.DoNIMOutput = True - # The bit settings were extracted from here: - # https://savannah.cern.ch/bugs/?90300#comment14 - self.NIMBarrelBit = 29 - self.NIMEndcapBit = 30 - - ### this should not be done at all, since it instantiates a config svc without proper configuration!! - ### instead rely on the TriggerConfigGetter being setup in the top job properties - # Ensure that the LVL1ConfigSvc is loaded: - #from AthenaCommon.AppMgr import ServiceMgr # Has to be imported here for some reason... - #if not hasattr( ServiceMgr, "LVL1ConfigSvc" ): - # from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc - # lvl1ConfigSvc = LVL1ConfigSvc("LVL1ConfigSvc") -# # lvl1ConfigSvc.XMLFile = "LVL1config13.0.20.xml" - # ServiceMgr += lvl1ConfigSvc - # self.LVL1ConfigSvc = lvl1ConfigSvc - -class L1MuctpiTool( DefaultL1MuctpiTool ): - - """ - Module configuring the default MuCTPI simulation to be used as - part of the LVL1 simulation. - """ - - def __init__( self, name = "L1MuctpiTool" ): - - DefaultL1MuctpiTool.__init__( self, name ) - - self.InputSource = "DIGITIZATION" - -class L1MuctpiTool_on_RDO( DefaultL1MuctpiTool ): - - """ - Module configuring the MuCTPI simulation to be re-run on an RDO file - (that already has a result from a previous MuCTPI simulation running) - """ - - def __init__( self, name = "L1MuctpiTool_on_RDO" ): - - DefaultL1MuctpiTool.__init__( self, name ) - - self.InputSource = "RDO" - self.RDOLocID = "MUCTPI_RDO" - self.RDOOutputLocID = "MUCTPI_RDO+" - self.RoIOutputLocID = "not_used_1" - self.CTPOutputLocID = "not_used_2" - -class L1MuctpiTool_on_Data( DefaultL1MuctpiTool ): - - """ - Module configuring the MuCTPI simulation to be re-run on data BS file - (that already has a result from a previous MuCTPI simulation running) - """ - - def __init__( self, name = "L1MuctpiTool_on_Data" ): - - DefaultL1MuctpiTool.__init__( self, name ) - - self.InputSource = "RDO" - self.RDOLocID = "MUCTPI_RDO" - self.RDOOutputLocID = "MUCTPI_RDO+" - self.RoIOutputLocID = "not_used_1" - self.OverlapStrategyName = "LUT" - self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB_crc_3385316356.xml" - self.IsData=1 - self.FlaggingMode = False - -class L1MuctpiTool_on_AOD( DefaultL1MuctpiTool ): - - """ - Module configuring the MuCTPI simulation to be re-run on an AOD file - (that contains the LVL1_ROI object) - """ - - def __init__( self, name = "L1MuctpiTool_on_AOD" ): - - DefaultL1MuctpiTool.__init__( self, name ) - - self.InputSource = "AOD" - self.AODLocID = "LVL1_ROI" - self.RDOOutputLocID = "MUCTPI_RDO+" - self.RoIOutputLocID = "not_used_1" - self.CTPOutputLocID = "not_used_2" - - -def L1MuctpiToolRDOCfg(flags, name = "L1Muctpi"): - """ - Configures L1MuctpiTool for running on MC - """ - lutFile = None - period = None - # TODO clarify IBL dependence - if flags.GeoModel.Run == "RUN2" or flags.GeoModel.Run == "UNDEFINED": - lutFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" - period = "RUN2" - from AthenaConfiguration.ComponentFactory import CompFactory - from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - acc = ComponentAccumulator() - from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg - acc.merge(L1ConfigSvcCfg(flags)) - tool = CompFactory.LVL1MUCTPI.L1MuctpiTool(name, - LVL1ConfigSvc=acc.getService("LVL1ConfigSvc"), - OverlapStrategyName = "LUT", - DumpLUT = False, - LUTXMLFile = lutFile, - RunPeriod = period, - FlaggingMode = False, - MultiplicityStrategyName = "INCLUSIVE", - InputSource = "RDO", - RDOLocID = "MUCTPI_RDO", - GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml", - DoNIMOutput = True, - # The bit settings were extracted from here: - # https://savannah.cern.ch/bugs/?90300#comment14 - NIMBarrelBit = 29, - NIMEndcapBit = 30, - ) - acc.addPublicTool(tool, primary=True) - return acc diff --git a/Trigger/TrigT1/TrigT1Muctpi/python/__init__.py b/Trigger/TrigT1/TrigT1Muctpi/python/__init__.py deleted file mode 100644 index 670f0c6952edc92e6936e070b3f4cfba4c7004c2..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/python/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration - -# File: TrigT1Muctpi/__init__.py -# Author: berge@cern.ch - -__version__ = '1.0.0' -__author__ = 'berge@cern.ch,Attila.Krasznahorkay@cern.ch' -__all__ = [ 'TrigT1MuctpiAlgorithmConfig', 'TrigT1MuctpiConfig' ] diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx deleted file mode 100644 index bb6480994ec3eb102bd5990b7e3769e713bc9655..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx +++ /dev/null @@ -1,758 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: L1Muctpi.cxx 794528 2017-01-30 12:36:33Z fwinkl $ - -// STL include(s): -#include <iostream> -#include <sstream> - -// Gaudi/Athena include(s): -#include "PathResolver/PathResolver.h" -#include "AthenaKernel/errorcheck.h" - -// The AOD object that we may want to read as input -#include "AnalysisTriggerEvent/LVL1_ROI.h" - -// The new trigger configuration -#include "TrigConfInterfaces/ILVL1ConfigSvc.h" -#include "TrigConfL1Data/Muctpi.h" -#include "TrigConfL1Data/ThresholdConfig.h" -#include "TrigConfL1Data/TriggerThreshold.h" - -// Interfaces used by the simulation -#include "TrigT1Interfaces/MuCTPICTP.h" -#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h" -#include "TrigT1Interfaces/TrigT1StoreGateKeys.h" - - -// Inlcudes for the MuCTPI simulation -#include "L1Muctpi.h" -#include "../Common/MuctpiSim.h" -#include "../Common/Configuration.h" -#include "../Logging/MsgWriter.h" -#include "../Mioct/StrategyName.h" -#include "../Common/Converter.h" - -// Set the default StoreGate locations of input and output objects: -const std::string LVL1MUCTPI::L1Muctpi::m_DEFAULT_L1MuctpiStoreLocationRPC = "L1MuctpiStoreRPC"; -const std::string LVL1MUCTPI::L1Muctpi::m_DEFAULT_L1MuctpiStoreLocationTGC = "L1MuctpiStoreTGC"; -const std::string LVL1MUCTPI::L1Muctpi::m_DEFAULT_AODLocID = "LVL1_ROI"; -const std::string LVL1MUCTPI::L1Muctpi::m_DEFAULT_RDOLocID = "MUCTPI_RDO"; - -//-------------- -// Constructor -//-------------- -LVL1MUCTPI::L1Muctpi::L1Muctpi( const std::string& name, ISvcLocator* pSvcLocator ) - : base_class( name, pSvcLocator ), - m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ), - m_theMuctpi( 0 ), m_executeFunction(nullptr) -{ - // Declare the service handles as properties: - declareProperty( "LVL1ConfigSvc", m_configSvc, "LVL1 Config Service" ); - - // Declare the properties of the overlap treatment: - declareProperty( "OverlapStrategyName", m_overlapStrategyName = "NULL" ); - declareProperty( "LUTXMLFile", m_lutXMLFile = "" ); - declareProperty( "RunPeriod", m_runPeriod = "RUN1" ); - declareProperty( "FlaggingMode", m_flagMode = false ); - - // Declare the properties of the output generation for L1Topo: - declareProperty( "GeometryXMLFile", m_geometryXMLFile = "" ); - - // Declare the properties for the multiplicity summation: - declareProperty( "MultiplicityStrategyName", m_multiplicityStrategyName = "INCLUSIVE" ); - declareProperty( "MultiplicityXMLFile", m_multiplicityXMLFile = "" ); - - // Declare the properties of the input selection: - declareProperty( "InputSource", m_inputSource = "DIGITIZATION" ); - declareProperty( "AODLocID", m_aodLocId = m_DEFAULT_AODLocID ); - declareProperty( "RDOLocID", m_rdoLocId = m_DEFAULT_RDOLocID ); - - // The LUTs can be huge, so the default is to turn their printing off: - declareProperty( "DumpLUT", m_dumpLut = false ); - - // Allow rerunning of simulation on data - declareProperty( "IsData", m_IsData = false, "Rerun simulation on data" ); - - // Declare the properties of the NIM output creation: - declareProperty( "DoNIMOutput", m_doNimOutput = false ); - declareProperty( "NIMBarrelBit", m_nimBarrelBit = 0, - "Bit on the NIM input of the CTP, showing that there was at least " - "one barrel candidate in the event" ); - declareProperty( "NIMEndcapBit", m_nimEndcapBit = 1, - "Bit on the NIM input of the CTP, showing that there was at least " - "one endcap candidate in the event" ); - -} - - -//-------------- -// Destructor -//-------------- -LVL1MUCTPI::L1Muctpi::~L1Muctpi() { - ATH_MSG_DEBUG( "L1Muctpi destructor called" ); - if( m_theMuctpi ) delete m_theMuctpi; -} - -/** - * Initialisation of the algorithm. This is where the MuCTPI simulation object gets created, - * the look up table is loaded for overlap handling between the muon sectors and the MuCTPI - * configuration is read from LVL1ConfigSvc. Also m_executeFunction gets set up to point to - * the execute function we have selected in the jobOptions. - */ -StatusCode -LVL1MUCTPI::L1Muctpi::initialize() -{ - // Init message - ATH_MSG_INFO( "initialize()" ); - - ServiceHandle<IIncidentSvc> incidentSvc("IncidentSvc", "L1Muctpi"); - CHECK(incidentSvc.retrieve()); - incidentSvc->addListener(this,"BeginRun", 100); - incidentSvc.release().ignore(); - - // initialize input handle keys - ATH_CHECK( m_rpcInputKey.initialize( SG::AllowEmpty ) ); - ATH_CHECK( m_tgcInputKey.initialize( SG::AllowEmpty ) ); - - // initialize output handle keys - ATH_CHECK( m_rdoOutputLocId.initialize( SG::AllowEmpty ) ); - ATH_CHECK( m_muctpi2CtpKey.initialize( SG::AllowEmpty ) ); - ATH_CHECK( m_muctpi2RoibKey.initialize( SG::AllowEmpty ) ); - ATH_CHECK( m_nimctpKey.initialize( SG::AllowEmpty ) ); - ATH_CHECK( m_topoOutputLocId.initialize( SG::AllowEmpty ) ); - ATH_CHECK( m_topoOutputOffsetLocId.initialize( SG::AllowEmpty ) ); - - - // Now this is a tricky part. We have to force the message logging of the - // MuCTPI simulation to display messages of the same level as this MsgStream. - MsgWriter::instance()->setMinType( msg().level() ); - MsgWriter::instance()->setSource( name() ); - - // Create the MuCTPI simulation: - m_theMuctpi = new MuctpiSim(); - - // - // Set up the overlap handling of the simulation: - // - if( m_overlapStrategyName == "NULL" ) { - - ATH_MSG_DEBUG( "Setting overlap strategy: \"NULL\"" ); - m_theMuctpi->setOverlapStrategy( NO_OVERLAP ); - - } else if( m_overlapStrategyName == "LUT" ) { - - ATH_MSG_DEBUG( "Setting overlap strategy: \"LUT\"" ); - m_theMuctpi->setOverlapStrategy( LUT_OVERLAP ); - - if( m_flagMode ) { - ATH_MSG_INFO( "Using 'flagging mode' in the overlap handling" ); - } - - ATH_MSG_INFO( "XML LUT file defined in jobO: " << m_lutXMLFile << " with a RunPeriod=" << m_runPeriod ); - const std::string fullFileName = PathResolverFindCalibFile( m_lutXMLFile ); - ATH_MSG_DEBUG( "Full path to XML LUT file: " << fullFileName ); - CHECK( m_theMuctpi->initializeLUTOverlapStrategy( fullFileName, m_flagMode, - m_dumpLut, m_runPeriod ) ); - - } else { - - REPORT_ERROR( StatusCode::FAILURE ) - << "Wrong overlap strategy name specified: \"" - << m_overlapStrategyName << "\""; - return StatusCode::FAILURE; - - } - - // - // Set up the handling of the outputs for L1Topo - // - - ATH_MSG_INFO( "Geometry XML file defined in jobO: " << m_geometryXMLFile ); - const std::string fullGeometryFileName = PathResolverFindCalibFile( m_geometryXMLFile ); - ATH_MSG_INFO( "Full path to Geometry XML file: " << fullGeometryFileName ); - - m_theMuctpi->setupL1TopoConverter(fullGeometryFileName); - - // - // Set the multiplicity summation style of the simulation: - // - if( m_multiplicityStrategyName == "INCLUSIVE" ) { - - ATH_MSG_DEBUG( "Setting INCLUSIVE multiplicity summation" ); - m_theMuctpi->setMultiplicityStrategy( INCLUSIVE ); - - } else if( m_multiplicityStrategyName == "EXCLUSIVE" ) { - - ATH_MSG_DEBUG( "Setting EXCLUSIVE multiplicity summation" ); - m_theMuctpi->setMultiplicityStrategy( EXCLUSIVE ); - - } else if( m_multiplicityStrategyName == "XML" ) { - - ATH_MSG_DEBUG( "Setting XML multiplicity summation" ); - m_theMuctpi->setMultiplicityStrategy( XML ); - - ATH_MSG_INFO( "XML multiplicity file defined in jobO: " - << m_multiplicityXMLFile ); - const std::string packagePrefix = "TrigT1Muctpi/"; - const std::string fullFileName = PathResolverFindCalibFile( packagePrefix + - m_multiplicityXMLFile ); - ATH_MSG_DEBUG( " Full path to XML file: " << fullFileName ); - m_theMuctpi->initializeXMLMultStrategy( fullFileName ); - - } else { - - REPORT_ERROR( StatusCode::FAILURE ) - << "Wring multiplicity summation type specified: \"" - << m_multiplicityStrategyName << "\""; - return StatusCode::FAILURE; - - } - - // - // Set up the input source, and running conditions: - // - if( m_inputSource == "DIGITIZATION" ) { - - ATH_MSG_INFO( "Setting input source to digitization" ); - m_executeFunction = &L1Muctpi::executeFromDigi; - - } else if( m_inputSource == "AOD" ) { - - ATH_MSG_INFO( "Setting input source to AOD" ); - m_executeFunction = &L1Muctpi::executeFromAOD; - - } else if( m_inputSource == "RDO" ) { - - ATH_MSG_INFO( "Setting input source to RDO" ); - m_executeFunction = &L1Muctpi::executeFromRDO; - - } else { - - REPORT_ERROR( StatusCode::FAILURE ) - << "Wrong input source specified: \"" << m_inputSource - << "\""; - return StatusCode::FAILURE; - - } - - // - // Give feedback about the NIM output creation: - // - if( m_doNimOutput ) { - ATH_MSG_INFO( "NIM output for CTP will be created" ); - ATH_MSG_DEBUG( "SG key for the NIM object will be: " - << m_nimctpKey.key() ); - // A small sanity check: - if( m_nimBarrelBit == m_nimEndcapBit ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "The barrel and endcap NIM output bits are set to end up on the " - << "same bit (" << m_nimBarrelBit << ")"; - return StatusCode::FAILURE; - } - ATH_MSG_DEBUG( "Position for the barrel NIM bit: " << m_nimBarrelBit ); - ATH_MSG_DEBUG( "Position for the endcap NIM bit: " << m_nimEndcapBit ); - } else { - ATH_MSG_INFO( "NIM output for CTP will *not* be created" ); - } - - ATH_MSG_INFO( "Retrieving trigger config service" << m_configSvc ); - CHECK(m_configSvc.retrieve()); - - return StatusCode::SUCCESS; -} - - -void -LVL1MUCTPI::L1Muctpi::handle(const Incident& incident) -{ - if (incident.type()!="BeginRun") return; - ATH_MSG_DEBUG( "In L1Muctpi BeginRun incident"); - - StatusCode sc = loadFixedConditions(); - if( sc.isFailure() ) { - ATH_MSG_ERROR( "ERROR in MuCTPI configuration"); - } -} - - -StatusCode -LVL1MUCTPI::L1Muctpi::loadFixedConditions( ) -{ - Configuration muctpiConfiguration; - // Connect to the LVL1 configuration service (create it if it doesn't exist): - if(!m_IsData){ - // convert MuCTPI config to Configuration - muctpiConfiguration.setThreshold1Candidate( m_configSvc->muctpiConfig()->lowptThreshold() ); - muctpiConfiguration.setThreshold2Candidate( m_configSvc->muctpiConfig()->highptThreshold() ); - muctpiConfiguration.setMaxCandSendToRoib( m_configSvc->muctpiConfig()->maxCand() ); - } - - //if running on data, hard code muctpi configuration - else{ - muctpiConfiguration.setThreshold1Candidate( 1 ); - muctpiConfiguration.setThreshold2Candidate( 1 ); - muctpiConfiguration.setMaxCandSendToRoib( 64 ); - } - - // set Configuration - m_theMuctpi->setConfiguration( muctpiConfiguration ); - - ATH_MSG_INFO( "The Muctpi has been configured ->" - << " 1stThr:" << muctpiConfiguration.getThreshold1Candidate() - << " 2ndThr:" << muctpiConfiguration.getThreshold2Candidate() - << " MaximalCandCount:" << muctpiConfiguration.getMaxCandSendToRoib() ); - - StatusCode sc = validate( m_configSvc->thresholdConfig()->getThresholdVector(TrigConf::L1DataDef::MUON) ); - - if( sc.isFailure() ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "LVL1 muon configuration failed sanity check"; - REPORT_ERROR( StatusCode::FAILURE ) - << "See previous messages for more information"; - REPORT_ERROR( StatusCode::FAILURE ) - << "The muon trigger results will not be reliable"; - return sc; - } else { - ATH_MSG_DEBUG( "LVL1 muon configuration passed sanity check" ); - } - - return StatusCode::SUCCESS; -} - -//--------------------------------- -// finalize() -//--------------------------------- -StatusCode -LVL1MUCTPI::L1Muctpi::finalize() -{ - // Now this is a tricky part. We have to force the message logging of the - // MuCTPI simulation to display messages of the same level as this MsgStream. - MsgWriter::instance()->setMinType( msg().level() ); - MsgWriter::instance()->setSource( name() ); - - ATH_MSG_INFO( "===============================" ); - ATH_MSG_INFO( "Finalizing L1Muctpi algorithm." ); - ATH_MSG_INFO( "===============================" ); - - delete m_theMuctpi; - m_theMuctpi = 0; - - return StatusCode::SUCCESS; -} - - -//---------------------------------------------- -// execute() method called once per event -//---------------------------------------------- -StatusCode -LVL1MUCTPI::L1Muctpi::execute() -{ - // Now this is a tricky part. We have to force the message logging of the - // MuCTPI simulation to display messages of the same level as this MsgStream. - MsgWriter::instance()->setMinType( msg().level() ); - MsgWriter::instance()->setSource( name() ); - - ATH_MSG_DEBUG( "===============================" ); - ATH_MSG_DEBUG( "Executing L1Muctpi algorithm." ); - ATH_MSG_DEBUG( "===============================" ); - - // Now this is a trictky one. I only had to make the decision of which function to call - // at execute once in initialize(). Now I can call the right function like this: - return ( this->*m_executeFunction )(); -} - -/** - * This is the default execute() function. It reads inputs from the RPC and TGC sector logics, - * and runs the MuCTPI simulation with their inputs. - */ -StatusCode -LVL1MUCTPI::L1Muctpi::executeFromDigi() -{ - ATH_MSG_DEBUG( "in executeFromDigi()" ); - - // Get the two inputs and merge them - LVL1MUONIF::Lvl1MuCTPIInput mergedInput; - - // First the RPC input - auto rpcInputHandle = SG::makeHandle(m_rpcInputKey); - if( rpcInputHandle.isValid() ) { - ATH_MSG_DEBUG( "Retrieved L1MuCTPI input from RPC" ); - mergedInput.merge( *rpcInputHandle ); - } else { - ATH_MSG_WARNING( "Cannot retrieve L1Muctpi input from RPC" ); - } - - - if( auto rh = SG::makeHandle(m_tgcInputKey); rh.isValid() ) { - ATH_MSG_DEBUG( "Retrieved L1MuCTPI input from TGC" ); - mergedInput.merge( *rh ); - } else { - ATH_MSG_WARNING( "Cannot retrieve L1Muctpi input from TGC" ); - } - - - // bool gotRPCInput( false ); - // const LVL1MUONIF::Lvl1MuCTPIInput* dHandleRPC = 0; - // if( evtStore()->retrieve( dHandleRPC, m_rpcLocId ).isFailure() ) { - // ATH_MSG_WARNING( "Cannot retrieve RPC L1Muctpi object from StoreGate!" ); - // } else { - // ATH_MSG_DEBUG( "Retrieved RPC Lvl1MuCTPIInput object from StoreGate" ); - // gotRPCInput = true; - // } - - // - // Get the TGC MUCTPI-input object from StoreGate. - // - // bool gotTGCInput( false ); - // const LVL1MUONIF::Lvl1MuCTPIInput* dHandleTGC = 0; - // if( evtStore()->retrieve( dHandleTGC, m_tgcLocId ).isFailure() ) { - // ATH_MSG_WARNING( "Cannot retrieve TGC L1Muctpi object from StoreGate!" ); - // } else { - // ATH_MSG_DEBUG( "Retrieved TGC Lvl1MuCTPIInput object from StoreGate" ); - // gotTGCInput = true; - // } - - // if( gotRPCInput ) mergedInput.merge( *dHandleRPC ); - // if( gotTGCInput ) mergedInput.merge( *dHandleTGC ); - - // if( ! ( gotRPCInput || gotTGCInput ) ) { // this should be an "&&" in final ver. - // ATH_MSG_WARNING( "No input received from the RPC or TGC sector logic simulation" ); - // return StatusCode::SUCCESS; - // } - - /// Need to check here if there are several BC slices in the input object, and run - /// the simulation for each one - - - //// TESTING ONLY ///// - /// mergedInput.duplicateToOtherBC(-1); - - //always process the central slice, which defaults to bcidOffset = 0 - // process the input in the MUCTPI simulation - m_theMuctpi->processData( &mergedInput ); - // Save the output of the simulation - CHECK( saveOutput() ); - - uint32_t can; - std::vector< uint32_t > dataWord; - CHECK( updateMuCTPI_RDO(can, dataWord) ); - - // check the other 4 possible BC offset values in case the input objects tells us there are - // out of time candidates - - - if (mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem()) || - mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem()) || - mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem()) ){ - - for (std::vector<int>::iterator it = m_bcidOffsetList.begin(); it != m_bcidOffsetList.end(); ++it){ - if (! mergedInput.isEmptyAll( (*it) ) ){ - // process the input in the MUCTPI simulation - m_theMuctpi->processData( &mergedInput, (*it)); - // Save the output of the simulation - CHECK( saveOutput( (*it) ) ); - uint32_t tmp_can; // this isn't used for anything! - CHECK( updateMuCTPI_RDO(tmp_can, dataWord) ); - } - } - } - CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) ); - - return StatusCode::SUCCESS; -} - - -/** - * This is a new execute() function. It reads the LVL1_ROI object from an AOD file, it converts - * the muon RoIs back into the input format of the MuCTPI, then runs the MuCTPI information - * with this transformed input. - */ -StatusCode -LVL1MUCTPI::L1Muctpi::executeFromAOD() -{ - - ATH_MSG_DEBUG( "in executeFromAOD()" ); - - // Retrieve the LVL1_ROI object from the AOD: - const LVL1_ROI* lvl1RoI = 0; - CHECK( evtStore()->retrieve( lvl1RoI, m_aodLocId ) ); - ATH_MSG_DEBUG( "Retrieved LVL1_ROI object from StoreGate" ); - - // Extract the RoIs into a vector: - std::vector< unsigned int > convertableRoIs; - LVL1_ROI::muons_type::const_iterator muonRoI_itr = lvl1RoI->getMuonROIs().begin(); - LVL1_ROI::muons_type::const_iterator muonRoI_end = lvl1RoI->getMuonROIs().end(); - for( ; muonRoI_itr != muonRoI_end; ++muonRoI_itr ) { - convertableRoIs.push_back( muonRoI_itr->getROIWord() ); - } - - // Create the input to the MuCTPI: - LVL1MUONIF::Lvl1MuCTPIInput convertedInput; - CHECK( Converter::convertRoIs( convertableRoIs, &convertedInput ) ); - - // process the input with the MuCTPI simulation - m_theMuctpi->processData( &convertedInput ); - - // Save the output of the simulation - CHECK( saveOutput() ); - - uint32_t can; - std::vector< uint32_t > dataWord; - CHECK( updateMuCTPI_RDO(can, dataWord) ); - CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) ); - - return StatusCode::SUCCESS; -} - -/** - * This is a new execute() function. It reads the MuCTPI_RDO object from an RDO file, it - * converts the muon data words back into the input format of the MuCTPI, then runs the - * MuCTPI information with this transformed input. - */ -StatusCode -LVL1MUCTPI::L1Muctpi::executeFromRDO() -{ - ATH_MSG_DEBUG( "in executeFromRDO()" ); - - // Retrieve the MuCTPI_RDO object from the digitized file: - const MuCTPI_RDO* old_RDO = 0; - CHECK( evtStore()->retrieve( old_RDO, m_rdoLocId ) ); - ATH_MSG_DEBUG( "Retrieved MuCTPI_RDO object from StoreGate" ); - - // Get the BCID of the collision: - const unsigned int bcid = ( ( old_RDO->candidateMultiplicity() >> 18 ) & 0x7 ); - - // Create the input to the MuCTPI: - LVL1MUONIF::Lvl1MuCTPIInput convertedInput; - CHECK( Converter::convertRDO( old_RDO->dataWord(), bcid, &convertedInput ) ); - - // process the input with the MuCTPI simulation - m_theMuctpi->processData( &convertedInput ); - - // Save the output of the simulation - CHECK( saveOutput() ); - - uint32_t can; - std::vector< uint32_t > dataWord; - CHECK( updateMuCTPI_RDO(can, dataWord) ); - CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) ); - - return StatusCode::SUCCESS; -} - - -StatusCode -LVL1MUCTPI::L1Muctpi::validate( const std::vector< TrigConf::TriggerThreshold* > & - thresholds ) const -{ - // - // Check that it's not a null-pointer: - // - // if( ! thresholds ) { - // REPORT_ERROR( StatusCode::FAILURE ) - // << "No muon threshold vector given for validation!"; - // return StatusCode::FAILURE; - // } - - // - // Check that there are 6 thresholds: - // - if( thresholds.size() != 6 ) { - REPORT_ERROR( StatusCode::FAILURE ) - << thresholds.size() << " muon thresholds defined"; - REPORT_ERROR( StatusCode::FAILURE ) - << "There have to be exactly 6 threshold defined!"; - return StatusCode::FAILURE; - } - - // - // Check that they are all muon thresholds: - // - for( TrigConf::TriggerThreshold* thr : thresholds ) { - if( ( thr->cableName() != "MU" && thr->cableName() != "MUCTPI" ) || ( thr->type() != "MUON" ) ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "There is a non-muon threshold in the LVL1 muon configuration!"; - return StatusCode::FAILURE; - } - } - - // - // Check that they're all on the same cable: - // - const std::string ctpin = thresholds.at( 0 )->cableCtpin(); - const std::string connector = thresholds.at( 0 )->cableConnector(); - for( const TrigConf::TriggerThreshold * thr : thresholds ) { - if( ( thr->cableCtpin() != ctpin ) || ( thr->cableConnector() != connector ) ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "The muon thresholds are not all configured on the same cable!"; - return StatusCode::FAILURE; - } - } - - // - // Check that they are configured on the correct wires: - // - unsigned int mask = 0; - for( TrigConf::TriggerThreshold* thr : thresholds ) { - if( ( thr->cableEnd() - thr->cableStart() ) != 2 ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "A muon threshold is not 3 bit wide in the configuration!"; - return StatusCode::FAILURE; - } - mask |= ( static_cast< unsigned int >( pow( 2, thr->cableEnd() - thr->cableStart() + 1 ) - 1 ) << thr->cableStart() ); - } - if( mask != 0x7fffe ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "The muon thresholds don't cover the correct bits on the cable"; - return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; -} - -/** - * In order to handle multiple BCID per event, the RDO object needs to be saved only after - * all BCID offsets have been processed. This function will update the data word that will - * go to the RDO, but won't save the RDO to storegate yet. - */ -StatusCode -LVL1MUCTPI::L1Muctpi::updateMuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord) -{ - const std::list< unsigned int >& daqData = m_theMuctpi->getDAQData(); - - const int HEADER_SIZE = 9; - const int STATUSandTAILER_SIZE = 2 + 3; - - // size check - // payload should contain at least 1 data (Candidate Multiplicity) - int payloadSize = daqData.size() - HEADER_SIZE - STATUSandTAILER_SIZE; - if( payloadSize < 1 ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "MIROD didn't provide correct DAQ data"; - return StatusCode::FAILURE; - } - - // skip header part - std::list< unsigned int >::const_iterator itDAQ = daqData.begin(); - for( int iHead = 0; iHead < HEADER_SIZE; ++iHead ) { - ++itDAQ; - } - - // candidate multiplicity - can = *itDAQ; - ++itDAQ; - - // data word - //std::vector< uint32_t > dataWord; - for( int iData = 1; iData < payloadSize; ++iData, ++itDAQ ) { - dataWord.push_back( *itDAQ ); - } - - return StatusCode::SUCCESS; -} - - -/** - * Here we save the actual RDO, after all BCID offsets have been processed - */ -StatusCode -LVL1MUCTPI::L1Muctpi::saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >&& dataWord) -{ - if(!m_rdoOutputLocId.empty()){ - MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, std::move(dataWord) ); - auto rdoHandle = SG::makeHandle(m_rdoOutputLocId); - ATH_CHECK(rdoHandle.record(std::unique_ptr<MuCTPI_RDO>(muCTPI_RDO))); - ATH_MSG_DEBUG( "MuCTPI_RDO object recorded with key: " - << m_rdoOutputLocId.key() ); - } - return StatusCode::SUCCESS; -} - - -/** - * This function is used by all the different execute functions to save the output - * of the MuCTPI simulation into various objects in StoreGate. - */ -StatusCode -LVL1MUCTPI::L1Muctpi::saveOutput(int bcidOffset) -{ - /// the standart processing is done for the central slice, with no Bcid offset - if (bcidOffset == 0 ) { - - // write the CTP result in interface object and put to StoreGate - auto obj = std::make_unique<LVL1::MuCTPICTP>( m_theMuctpi->getCTPData() ); - ATH_CHECK( SG::makeHandle( m_muctpi2CtpKey ).record( std::move(obj) ) ); - ATH_MSG_DEBUG( "CTP word recorded " << m_muctpi2CtpKey ); - - - // store RoIB result in interface object and put to StoreGate - std::list< unsigned int > resultForRoIB = m_theMuctpi->getRoIBData(); - std::vector< unsigned int > roibResultVector; - - std::list< unsigned int >::iterator roib_itr = resultForRoIB.begin(); - std::list< unsigned int >::iterator roib_end = resultForRoIB.end(); - for( ; roib_itr != roib_end; ++roib_itr ) { - roibResultVector.push_back( *roib_itr ); - } - - // L1MUINT::MuCTPIToRoIBSLink* theRoIBResult = - // new L1MUINT::MuCTPIToRoIBSLink( roibResultVector ); - - auto roibWriteHandle = SG::makeHandle( m_muctpi2RoibKey ); - ATH_CHECK( roibWriteHandle.record( std::make_unique<L1MUINT::MuCTPIToRoIBSLink>( roibResultVector ) ) ); - - // CHECK( evtStore()->record( theRoIBResult, m_roiOutputLocId ) ); - //ATH_MSG_DEBUG( "RoIB result recorded to StoreGate with key: " - // << m_muctpi2RoibKey ); - - //construct muctpi nim words (for MUE and MUB items) - unsigned int cw1=0; - if( m_doNimOutput ) { - if(m_theMuctpi->hasBarrelCandidate()){ - unsigned int nimBarrelBitMask = 1<<m_nimBarrelBit; - cw1|=nimBarrelBitMask; - } - if(m_theMuctpi->hasEndcapCandidate()){ - unsigned int nimEndcapBitMask = 1<<m_nimEndcapBit; - cw1|=nimEndcapBitMask; - } - - // Construct and save NimCTP object - auto nim = SG::makeHandle(m_nimctpKey); - CHECK(nim.record(std::make_unique<LVL1::NimCTP>(0, cw1, 0))); - } - - // get outputs for L1Topo and store into Storegate - ATH_MSG_DEBUG("Getting the output for L1Topo"); - LVL1::MuCTPIL1Topo l1topoCandidates = m_theMuctpi->getL1TopoData(); - auto l1topo = SG::makeHandle(m_topoOutputLocId); - CHECK(l1topo.record(std::make_unique<LVL1::MuCTPIL1Topo>(l1topoCandidates.getCandidates()))); - // std::cout << "TW: ALG central slice: offset: " << bcidOffset << " location: " << m_l1topoOutputLocId << std::endl; - // l1topo->print(); - } - - /// if we have a bcid offset, then just get the topo output and put it on storegate - if (bcidOffset != 0) { - auto getHandleKey = [this](const int bcidOffset) -> SG::WriteHandleKey<LVL1::MuCTPIL1Topo>* { - for (SG::VarHandleKey* key : m_topoOutputOffsetLocId.keys()) { - if (key->key() == m_topoOutputLocId.key()+std::to_string(bcidOffset)) { - return dynamic_cast<SG::WriteHandleKey<LVL1::MuCTPIL1Topo>*>(key); - } - } - return nullptr; - }; - ATH_MSG_DEBUG("Getting the output for L1Topo for BCID slice"); - LVL1::MuCTPIL1Topo l1topoCandidatesBC = m_theMuctpi->getL1TopoData(); - auto l1topoBC = SG::makeHandle(*getHandleKey(bcidOffset)); - CHECK(l1topoBC.record(std::make_unique<LVL1::MuCTPIL1Topo>(l1topoCandidatesBC.getCandidates()))); - l1topoBC->setBcidOffset(bcidOffset); - // std::cout << "TW: slice: offset: " << bcidOffset << " location: " - // << m_l1topoOutputLocId+std::to_string(bcidOffset) << std::endl; - // l1topoBC->print(); - } - return StatusCode::SUCCESS; -} - diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h deleted file mode 100644 index ac432a79f5e68f6624d456236030747f6721fc2d..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h +++ /dev/null @@ -1,176 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: L1Muctpi.h 681356 2015-07-08 12:17:52Z wengler $ -#ifndef TRIGT1MUCTPI_L1MUCTPI_H -#define TRIGT1MUCTPI_L1MUCTPI_H - -// STL include(s): -#include <string> - -// Athena/Gaudi include(s): -#include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/IIncidentListener.h" -#include "AthenaBaseComps/AthAlgorithm.h" -#include "TrigT1Interfaces/MuCTPICTP.h" -#include "TrigT1Interfaces/TrigT1StoreGateKeys.h" -#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h" -#include "StoreGate/ReadHandleKey.h" -#include "StoreGate/WriteHandleKey.h" -#include "TrigT1Result/MuCTPI_RDO.h" -#include "TrigT1Interfaces/Lvl1MuCTPIInput.h" -#include "TrigT1Interfaces/MuCTPIL1Topo.h" -#include "TrigT1Interfaces/NimCTP.h" - -// Forward declaration(s): -namespace TrigConf { - class ILVL1ConfigSvc; - class TriggerThreshold; -} - -/// Namespace for the MuCTPI simulation -/** -* This namespace should contain all classes, functions, enumerations, ... which are -* used in the MuCTPI simulation. -*/ -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MuctpiSim; - - /** - * $Date: 2015-07-08 14:17:52 +0200 (Wed, 08 Jul 2015) $ - * - * @short Main Athena algorithm of the MuCTPI simulation - * - * The algorithm reads the MuCTPI's configuration from the DetectorStore - * put there by TrigT1Config, and configures the MuCTPI simulation with it. - * For each event it reads the output of the RPC and TGC detector simulations, - * and uses them as an input to the MuCTPI simulation. It produces a readout - * object (MuCTPI_RDO), an RoI object (ROIB::MuCTPIResult) and the object - * sent to the CTP (LVL1::MuCTPICTP). - * - * @see MuctpiSim - * @see LVL1MUONIF::Lvl1MuCTPIInput - * @see MuCTPI_RDO - * @see ROIB::MuCTPIResult - * @see LVL1::MuCTPICTP - * - * @author $Author: krasznaa $ - * @version $Revision: 681356 $ - * - */ - class L1Muctpi : public extends<AthAlgorithm, IIncidentListener> { - - public: - /// Regular Gaudi algorithm constructor - L1Muctpi( const std::string& name, ISvcLocator* pSvcLocator ); - /// A destructor for actually cleaning up - virtual ~L1Muctpi(); - - /// Regular Gaudi algorithm initialization function - virtual StatusCode initialize() override; - /// Regular Gaudi algorithm finalization function - virtual StatusCode finalize() override; - /// Regular Gaudi algorithm execute function - virtual StatusCode execute() override; - virtual void handle(const Incident&) override; - - private: - /// handles beginRun - StatusCode loadFixedConditions(); - /// Event loop method for running as part of digitization - StatusCode executeFromDigi(); - /// Event loop method for running on an AOD file - StatusCode executeFromAOD(); - /// Event loop method for running on an RDO file - StatusCode executeFromRDO(); - /// Validate the muon threshold configuration - StatusCode validate( const std::vector< TrigConf::TriggerThreshold* >& thresholds ) const; - /// Update the data word for the RDO object - StatusCode updateMuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord); - /// Save the MuCTPI RDO object - StatusCode saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >&& dataWord); - /// Save the outputs of the simulation into StoreGate - StatusCode saveOutput(int bcidOffset = 0); - - /// The LVL1 configuration service - ServiceHandle< TrigConf::ILVL1ConfigSvc > m_configSvc; - - /// The simulation top level object - MuctpiSim* m_theMuctpi; - - /// The BCID slices to be checked in addition to the central one in the input objects from Digi - std::vector<int> m_bcidOffsetList = {-2,-1,1,2}; - - // Locations of the inputs and outputs of the simulation in StoreGate: - static const std::string m_DEFAULT_L1MuctpiStoreLocationRPC; - static const std::string m_DEFAULT_L1MuctpiStoreLocationTGC; - static const std::string m_DEFAULT_AODLocID; - static const std::string m_DEFAULT_RDOLocID; - - - SG::ReadHandleKey<LVL1MUONIF::Lvl1MuCTPIInput> m_rpcInputKey{ this, "RPCLocID", "L1MuctpiStoreRPC", "Input from RPC" }; - SG::ReadHandleKey<LVL1MUONIF::Lvl1MuCTPIInput> m_tgcInputKey{ this, "TGCLocID", "L1MuctpiStoreTGC", "Input from TGC" }; - - SG::WriteHandleKey<LVL1::MuCTPICTP> m_muctpi2CtpKey { this, "CTPOutputLocID", LVL1MUCTPI::DEFAULT_MuonCTPLocation, "Output to CTPO" }; - SG::WriteHandleKey<MuCTPI_RDO> m_rdoOutputLocId{this, "RDOOutputLocID", "MUCTPI_RDO", "Location of MUCTPI RDOs"}; - SG::WriteHandleKey<L1MUINT::MuCTPIToRoIBSLink> m_muctpi2RoibKey { this, "MuCTPISLinkLocation", LVL1MUCTPI::DEFAULT_MuonRoIBLocation, "StoreGate location for outpput to RoIBuilder" }; - SG::WriteHandleKey<LVL1::NimCTP> m_nimctpKey { this, "NIMOutputLocID", LVL1::DEFAULT_NimCTPLocation, "StoreGate location for output LVL1::NimCTP" }; - SG::WriteHandleKey<LVL1::MuCTPIL1Topo> m_topoOutputLocId{this, "L1TopoOutputLocID", LVL1MUCTPI::DEFAULT_MuonL1TopoLocation, "Output to L1Topo"}; - SG::WriteHandleKeyArray<LVL1::MuCTPIL1Topo> m_topoOutputOffsetLocId{this, "L1TopoOutputOffsetLocID", - { // Corresponds to m_bcidOffsetList - LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"-2", - LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"-1", - LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"1", - LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"2" - }, - "Output to L1Topo for offset BCIDs"}; - - - // These properties control the way the overlap handling functions: - std::string m_overlapStrategyName; - std::string m_lutXMLFile; - std::string m_runPeriod; - bool m_flagMode; - - // These properties control the way the outputs for the L1Topo are generated - std::string m_geometryXMLFile; - - // These properties control how the multiplicity summation happens: - std::string m_multiplicityStrategyName; - std::string m_multiplicityXMLFile; - - // Property for the input selection, and the locations of the various - // input and output objects: - std::string m_inputSource; - std::string m_aodLocId; - std::string m_rdoLocId; - // std::string m_roiOutputLocId; - // std::string m_tgcLocId; - // std::string m_rpcLocId; - - - - /// Property telling if the LUTs should be printed: - bool m_dumpLut; - - /// Property telling if input file is data or simulation - bool m_IsData; - - // Properties controlling the NIM outputs provided by the simulation - bool m_doNimOutput; - unsigned int m_nimBarrelBit; - unsigned int m_nimEndcapBit; - - /// Function pointer to the execute function we want to use: - StatusCode ( LVL1MUCTPI::L1Muctpi::*m_executeFunction )( void ); - - }; // class L1Muctpi - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_L1MUCTPI_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.cxx deleted file mode 100644 index 55d8bc366663e6c2ab29e51757b0722cf262ac76..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.cxx +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: L1MuctpiPatGen.cxx 441850 2011-06-06 14:50:52Z krasznaa $ - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// TrigT1 include(s): -#include "TrigT1Interfaces/Lvl1MuCTPIInput.h" - -// Local include(s): -#include "L1MuctpiPatGen.h" -#include "../Common/GenTestPattern.h" - -namespace LVL1MUCTPI { - - static const std::string DEFAULT_L1MuctpiStoreLocationRPC = "L1MuctpiStoreRPC"; - static const std::string DEFAULT_L1MuctpiStoreLocationTGC = "L1MuctpiStoreTGC"; - - //-------------- - // Constructor - //-------------- - L1MuctpiPatGen::L1MuctpiPatGen( const std::string& name, ISvcLocator* pSvcLocator ) - : AthAlgorithm( name, pSvcLocator ) { - - } - - //---------------------------------------------- - // execute() method called once per event - //---------------------------------------------- - StatusCode L1MuctpiPatGen::execute( ) { - - ATH_MSG_DEBUG( "===================================" ); - ATH_MSG_DEBUG( "Executing L1MuctpiPatGen algorithm." ); - ATH_MSG_DEBUG( "===================================" ); - - // Instantiate the Lvl1MuCTPIInput object which will serve - // as the event source - LVL1MUONIF::Lvl1MuCTPIInput* ctpiInRPC = new LVL1MUONIF::Lvl1MuCTPIInput; - LVL1MUONIF::Lvl1MuCTPIInput* ctpiInTGC = new LVL1MUONIF::Lvl1MuCTPIInput; - - // make 2 GenTestPattern objects (RPC and TGC), and pass a - // Lvl1MuCTPIInput object to their constructors and re-seed the - // generator to get different events - - - ctpiInRPC->setSectorLogicData( 0x01d80104, LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), 0 ); - ctpiInRPC->setSectorLogicData( 0x01d00104, LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), 1 ); - - /* - ctpiInTGC->setSectorLogicData( 0x01d00006, LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), 47 ); - ctpiInTGC->setSectorLogicData( 0x01d80006, LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), 0 ); - - ctpiInTGC->setSectorLogicData( 0x01d00008, LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), 6 ); - ctpiInTGC->setSectorLogicData( 0x01d80008, LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), 7 ); - - ctpiInRPC->setSectorLogicData( 0x01d0002e, LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), 30 ); - ctpiInTGC->setSectorLogicData( 0x01c80000, LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), 47 ); - */ - - /* - GenTestPattern genPatRPC( ctpiInRPC ); - GenTestPattern genPatTGC( ctpiInTGC ); - // seed = seed + 7; - // genPat.reSeedRandomNumbers(seed); - - // restrict generation to RPCs and TGCs respectively - genPatRPC.rndRange().allowSystems( 1 ); - genPatTGC.rndRange().allowSystems( 6 ); - - // fill the input objects from the test pattern generator - genPatRPC.generateEvent( 10, 20 ); - genPatRPC.printRandomEvent(); - - genPatTGC.generateEvent( 10, 20 ); - genPatTGC.printRandomEvent(); - */ - - // This puts the objects into StoreGate - need to give a pointer here - // the string is the tag to find it back in StoreGate - must be - // unique - CHECK( evtStore()->record( ctpiInRPC, DEFAULT_L1MuctpiStoreLocationRPC ) ); - ATH_MSG_DEBUG( "put RPC Lvl1MuCTPIInput into SG" ); - - CHECK( evtStore()->record( ctpiInTGC, DEFAULT_L1MuctpiStoreLocationTGC ) ); - ATH_MSG_DEBUG( "put TGC Lvl1MuCTPIInput into SG" ); - - return StatusCode::SUCCESS; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.h deleted file mode 100644 index 2ed6821a02a8559a9e9ad2d46325f49ee13696df..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.h +++ /dev/null @@ -1,40 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: L1MuctpiPatGen.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_L1MUCTPIPATGEN_H -#define TRIGT1MUCTPI_L1MUCTPIPATGEN_H - -// Athena/Gaudi include(s): -#include "AthenaBaseComps/AthAlgorithm.h" - -namespace LVL1MUCTPI { - - /** - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Pattern generator for the MuCTPI simulation - * - * This algorithm can be used to test the functioning of the MuCTPI simulation in - * a stand-alone mode. (By stand-alone I mean inside Athena of course.) - * - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - */ - class L1MuctpiPatGen : public AthAlgorithm { - - public: - /// Regular Gaudi algorithm constructor - L1MuctpiPatGen( const std::string& name, ISvcLocator* pSvcLocator ); - - /// Regular Gaudi execute function - virtual StatusCode execute(); - - }; // class L1MuctpiPatGen - -} // namespace LVL1MUCTPI - -#endif // end of TRIGT1MUCTPI_L1MUCTPIPATGEN_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.cxx deleted file mode 100644 index 14563d6919f06af2737a2de07f02b3ab11c4180a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.cxx +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: L1MuctpiTestReadResults.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// STL include(s): -#include <iomanip> - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// TrigT1 include(s): -#include "TrigT1Interfaces/MuCTPICTP.h" -#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h" - -// Local include(s): -#include "L1MuctpiTestReadResults.h" - -namespace LVL1MUCTPI { - - //-------------- - // Constructor - //-------------- - L1MuctpiTestReadResults::L1MuctpiTestReadResults( const std::string& name, - ISvcLocator* pSvcLocator ) - : AthAlgorithm( name, pSvcLocator ) { - - } - - - //---------------------------------------------- - // execute() method called once per event - //---------------------------------------------- - StatusCode L1MuctpiTestReadResults::execute() { - - ATH_MSG_DEBUG( "============================================" ); - ATH_MSG_DEBUG( "Executing L1MuctpiTestReadResults algorithm." ); - ATH_MSG_DEBUG( "============================================" ); - - // Get the CTP object from storegate and print - const LVL1::MuCTPICTP* dHandleCTPresult = 0; - CHECK( evtStore()->retrieve( dHandleCTPresult ) ); - ATH_MSG_DEBUG( "got CTP result Ptr from SG" ); - - ATH_MSG_INFO( "The CTP word is: " << std::ios::hex - << dHandleCTPresult->muCTPIWord() ); - - // Get the RoIB object from storegate and print - const L1MUINT::MuCTPIToRoIBSLink* dHandleRoIBresult = 0; - CHECK( evtStore()->retrieve( dHandleRoIBresult ) ); - ATH_MSG_DEBUG( "got RoIB result Ptr from SG" ); - - std::vector< unsigned int >::const_iterator roibRes_itr = - dHandleRoIBresult->getMuCTPIToRoIBWords().begin(); - std::vector< unsigned int >::const_iterator roibRes_end = - dHandleRoIBresult->getMuCTPIToRoIBWords().end(); - for( ; roibRes_itr != roibRes_end; ++roibRes_itr ) { - - ATH_MSG_INFO( "The RoIB result: " << std::ios::hex - << ( *roibRes_itr ) ); - - } - - return StatusCode::SUCCESS; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.h deleted file mode 100644 index 61e852a4d178dc324242bb0dcb631fe973370228..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.h +++ /dev/null @@ -1,42 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: L1MuctpiTestReadResults.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_L1MUCTPITESTREADRESULTS_H -#define TRIGT1MUCTPI_L1MUCTPITESTREADRESULTS_H - -// Gaudi/Athena include(s): -#include "AthenaBaseComps/AthAlgorithm.h" - -namespace LVL1MUCTPI { - - /** - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Tester for the MuCTPI simulation's output - * - * This algorithm has little importance now. It reads back the objects - * produced by the MuCTPI simulation from StoreGate, and confirms that - * they are in fact there. - * - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - */ - class L1MuctpiTestReadResults : public AthAlgorithm { - - public: - /// Regular Gaudi algorithm constructor - L1MuctpiTestReadResults( const std::string& name, - ISvcLocator* pSvcLocator ); - - /// Regular Gaudi execute function - virtual StatusCode execute(); - - }; // class L1MuctpiTestReadResults - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_L1MUCTPITESTREADRESULTS_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx deleted file mode 100644 index 2a6daa57d5cc82cd041a7ffc2c03752602522425..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx +++ /dev/null @@ -1,790 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - - -// STL include(s): -#include <iostream> -#include <sstream> - -// Gaudi/Athena include(s): -#include "PathResolver/PathResolver.h" -#include "AthenaKernel/errorcheck.h" - -// The AOD object that we may want to read as input -#include "AnalysisTriggerEvent/LVL1_ROI.h" - -// The new trigger configuration -#include "TrigConfInterfaces/ILVL1ConfigSvc.h" -#include "TrigConfL1Data/Muctpi.h" -#include "TrigConfL1Data/ThresholdConfig.h" -#include "TrigConfL1Data/TriggerThreshold.h" - -// Interfaces used by the simulation -#include "TrigT1Interfaces/Lvl1MuCTPIInput.h" -#include "TrigT1Interfaces/MuCTPICTP.h" -#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h" -#include "TrigT1Interfaces/TrigT1StoreGateKeys.h" -#include "TrigT1Interfaces/NimCTP.h" - -// The output object of the simulation -#include "TrigT1Result/MuCTPI_RDO.h" -#include "TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h" -#include "TrigT1Result/MuCTPI_DataWord_Decoder.h" - -// Inlcudes for the MuCTPI simulation -#include "../Algorithms/L1MuctpiTool.h" -#include "../Common/MuctpiSim.h" -#include "../Common/Configuration.h" -#include "../Logging/MsgWriter.h" -#include "../Mioct/StrategyName.h" -#include "../Common/Converter.h" - - -#include "TrigT1Result/MuCTPIRoI.h" -#include "TrigT1Result/RoIBResult.h" -#include "TrigT1Result/Header.h" -#include "TrigT1Result/Trailer.h" - - -namespace LVL1MUCTPI { - - // Set the default StoreGate locations of input and output objects: - const std::string L1MuctpiTool::m_DEFAULT_L1MuctpiStoreLocationRPC = "L1MuctpiStoreRPC"; - const std::string L1MuctpiTool::m_DEFAULT_L1MuctpiStoreLocationTGC = "L1MuctpiStoreTGC"; - const std::string L1MuctpiTool::m_DEFAULT_AODLocID = "LVL1_ROI"; - const std::string L1MuctpiTool::m_DEFAULT_RDOLocID = "MUCTPI_RDO"; - - //-------------- - // Constructor - //-------------- - L1MuctpiTool::L1MuctpiTool(const std::string& type, const std::string& name, - const IInterface* parent ): - base_class(type, name, parent), - m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ), - m_theMuctpi( 0 ), m_executeFunction(nullptr) { - - - // Init message - ATH_MSG_INFO( "=======================================" ); - ATH_MSG_INFO( "Constructor for L1MuctpiTool." ); - ATH_MSG_INFO( "=======================================" ); - - // Declare the service handles as properties: - declareProperty( "LVL1ConfigSvc", m_configSvc, "LVL1 Config Service" ); - - // Declare the properties of the overlap treatment: - declareProperty( "OverlapStrategyName", m_overlapStrategyName = "NULL" ); - declareProperty( "LUTXMLFile", m_lutXMLFile = "" ); - declareProperty( "RunPeriod", m_runPeriod = "RUN1" ); - declareProperty( "FlaggingMode", m_flagMode = false ); - - // Declare the properties of the output generation for L1Topo: - declareProperty( "GeometryXMLFile", m_geometryXMLFile = "" ); - - // Declare the properties for the multiplicity summation: - declareProperty( "MultiplicityStrategyName", m_multiplicityStrategyName = "INCLUSIVE" ); - declareProperty( "MultiplicityXMLFile", m_multiplicityXMLFile = "" ); - - // Declare the properties of the input selection: - declareProperty( "InputSource", m_inputSource = "DIGITIZATION" ); - declareProperty( "AODLocID", m_aodLocId = m_DEFAULT_AODLocID ); - declareProperty( "RDOLocID", m_rdoLocId = m_DEFAULT_RDOLocID ); - // declareProperty( "RDOOutputLocID", m_rdoOutputLocId = m_DEFAULT_RDOLocID ); - // declareProperty( "RoIOutputLocID", m_roiOutputLocId = m_DEFAULT_locationMuCTPItoRoIB ); - // declareProperty( "CTPOutputLocID", m_ctpOutputLocId = m_DEFAULT_locationMuCTPItoCTP ); - // declareProperty( "L1TopoOutputLocID", m_l1topoOutputLocId = m_DEFAULT_locationMuCTPItoL1Topo ); - // These are just here for flexibility, normally they should not be changed: - declareProperty( "TGCLocID", m_tgcLocId = m_DEFAULT_L1MuctpiStoreLocationTGC ); - declareProperty( "RPCLocID", m_rpcLocId = m_DEFAULT_L1MuctpiStoreLocationRPC ); - // The LUTs can be huge, so the default is to turn their printing off: - declareProperty( "DumpLUT", m_dumpLut = false ); - - // Allow rerunning of simulation on data - declareProperty( "IsData", m_IsData = false, "Rerun simulation on data" ); - - // Declare the properties of the NIM output creation: - declareProperty( "DoNIMOutput", m_doNimOutput = false ); - declareProperty( "NIMOutputLocID", m_nimOutputLocId = LVL1::DEFAULT_NimCTPLocation ); - declareProperty( "NIMBarrelBit", m_nimBarrelBit = 0, - "Bit on the NIM input of the CTP, showing that there was at least " - "one barrel candidate in the event" ); - declareProperty( "NIMEndcapBit", m_nimEndcapBit = 1, - "Bit on the NIM input of the CTP, showing that there was at least " - "one endcap candidate in the event" ); - - declareProperty( "ROIBResultLocation", m_roibLocation=ROIB::DEFAULT_RoIBRDOLocation, "Storegate key for the reading the ROIBResult" ); - - } - - //-------------- - // Destructor - //-------------- - L1MuctpiTool::~L1MuctpiTool() { - - ATH_MSG_DEBUG( "L1Muctpi destructor called" ); - if( m_theMuctpi ) delete m_theMuctpi; - } - - /** - * Initialisation of the algorithm. This is where the MuCTPI simulation object gets created, - * the look up table is loaded for overlap handling between the muon sectors and the MuCTPI - * configuration is read from LVL1ConfigSvc. Also m_executeFunction gets set up to point to - * the execute function we have selected in the jobOptions. - */ - StatusCode L1MuctpiTool::initialize() { - - // Now this is a tricky part. We have to force the message logging of the - // MuCTPI simulation to display messages of the same level as this MsgStream. - MsgWriter::instance()->setMinType( msg().level() ); - MsgWriter::instance()->setSource( name() ); - - // Create the MuCTPI simulation: - m_theMuctpi = new MuctpiSim(); - - // - // Set up the overlap handling of the simulation: - // - if( m_overlapStrategyName == "NULL" ) { - - ATH_MSG_DEBUG( "Setting overlap strategy: \"NULL\"" ); - m_theMuctpi->setOverlapStrategy( NO_OVERLAP ); - - } else if( m_overlapStrategyName == "LUT" ) { - - ATH_MSG_DEBUG( "Setting overlap strategy: \"LUT\"" ); - m_theMuctpi->setOverlapStrategy( LUT_OVERLAP ); - - if( m_flagMode ) { - ATH_MSG_INFO( "Using 'flagging mode' in the overlap handling" ); - } - - ATH_MSG_INFO( "XML LUT file defined in jobO: " << m_lutXMLFile << " with a RunPeriod=" << m_runPeriod ); - const std::string fullFileName = PathResolverFindCalibFile( m_lutXMLFile ); - ATH_MSG_DEBUG( "Full path to XML LUT file: " << fullFileName ); - CHECK( m_theMuctpi->initializeLUTOverlapStrategy( fullFileName, m_flagMode, - m_dumpLut, m_runPeriod ) ); - - } else { - - REPORT_ERROR( StatusCode::FAILURE ) - << "Wrong overlap strategy name specified: \"" - << m_overlapStrategyName << "\""; - return StatusCode::FAILURE; - - } - - // - // Set up the handling of the outputs for L1Topo - // - - ATH_MSG_INFO( "Geometry XML file defined in jobO: " << m_geometryXMLFile ); - const std::string fullGeometryFileName = PathResolverFindCalibFile( m_geometryXMLFile ); - ATH_MSG_INFO( "Full path to Geometry XML file: " << fullGeometryFileName ); - - m_theMuctpi->setupL1TopoConverter(fullGeometryFileName); - - // - // Set the multiplicity summation style of the simulation: - // - if( m_multiplicityStrategyName == "INCLUSIVE" ) { - - ATH_MSG_DEBUG( "Setting INCLUSIVE multiplicity summation" ); - m_theMuctpi->setMultiplicityStrategy( INCLUSIVE ); - - } else if( m_multiplicityStrategyName == "EXCLUSIVE" ) { - - ATH_MSG_DEBUG( "Setting EXCLUSIVE multiplicity summation" ); - m_theMuctpi->setMultiplicityStrategy( EXCLUSIVE ); - - } else if( m_multiplicityStrategyName == "XML" ) { - - ATH_MSG_DEBUG( "Setting XML multiplicity summation" ); - m_theMuctpi->setMultiplicityStrategy( XML ); - - ATH_MSG_INFO( "XML multiplicity file defined in jobO: " - << m_multiplicityXMLFile ); - const std::string packagePrefix = "TrigT1Muctpi/"; - const std::string fullFileName = PathResolverFindCalibFile( packagePrefix + - m_multiplicityXMLFile ); - ATH_MSG_DEBUG( " Full path to XML file: " << fullFileName ); - m_theMuctpi->initializeXMLMultStrategy( fullFileName ); - - } else { - - REPORT_ERROR( StatusCode::FAILURE ) - << "Wring multiplicity summation type specified: \"" - << m_multiplicityStrategyName << "\""; - return StatusCode::FAILURE; - - } - - // - // Set up the input source, and running conditions: - // - if( m_inputSource == "DIGITIZATION" ) { - - ATH_MSG_INFO( "Setting input source to digitization" ); - m_executeFunction = &L1MuctpiTool::executeFromDigi; - - } else if( m_inputSource == "AOD" ) { - - ATH_MSG_INFO( "Setting input source to AOD" ); - m_executeFunction = &L1MuctpiTool::executeFromAOD; - - } else if( m_inputSource == "RDO" ) { - - ATH_MSG_INFO( "Setting input source to RDO" ); - m_executeFunction = &L1MuctpiTool::executeFromRDO; - - } else { - - REPORT_ERROR( StatusCode::FAILURE ) - << "Wrong input source specified: \"" << m_inputSource - << "\""; - return StatusCode::FAILURE; - - } - - // - // Give feedback about the NIM output creation: - // - if( m_doNimOutput ) { - ATH_MSG_INFO( "NIM output for CTP will be created" ); - ATH_MSG_DEBUG( "SG key for the NIM object will be: " - << m_nimOutputLocId ); - // A small sanity check: - if( m_nimBarrelBit == m_nimEndcapBit ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "The barrel and endcap NIM output bits are set to end up on the " - << "same bit (" << m_nimBarrelBit << ")"; - return StatusCode::FAILURE; - } - ATH_MSG_DEBUG( "Position for the barrel NIM bit: " << m_nimBarrelBit ); - ATH_MSG_DEBUG( "Position for the endcap NIM bit: " << m_nimEndcapBit ); - } else { - ATH_MSG_INFO( "NIM output for CTP will *not* be created" ); - } - - ATH_MSG_INFO( "Retrieving trigger config service" << m_configSvc ); - CHECK(m_configSvc.retrieve()); - - return StatusCode::SUCCESS; - } - - StatusCode L1MuctpiTool::start( ) { - - // Init message - ATH_MSG_INFO( "=======================================" ); - ATH_MSG_INFO( "Start for L1MuctpiTool." ); - ATH_MSG_INFO( "=======================================" ); - - Configuration muctpiConfiguration; - // Connect to the LVL1 configuration service (create it if it doesn't exist): - if(!m_IsData){ - // convert MuCTPI config to Configuration - muctpiConfiguration.setThreshold1Candidate( m_configSvc->muctpiConfig()->lowptThreshold() ); - muctpiConfiguration.setThreshold2Candidate( m_configSvc->muctpiConfig()->highptThreshold() ); - muctpiConfiguration.setMaxCandSendToRoib( m_configSvc->muctpiConfig()->maxCand() ); - } - - //if running on data, hard code muctpi configuration - else{ - muctpiConfiguration.setThreshold1Candidate( 1 ); - muctpiConfiguration.setThreshold2Candidate( 1 ); - muctpiConfiguration.setMaxCandSendToRoib( 64 ); - } - - // set Configuration - m_theMuctpi->setConfiguration( muctpiConfiguration ); - - ATH_MSG_INFO( "The Muctpi has been configured ->" - << " 1stThr:" << muctpiConfiguration.getThreshold1Candidate() - << " 2ndThr:" << muctpiConfiguration.getThreshold2Candidate() - << " MaximalCandCount:" << muctpiConfiguration.getMaxCandSendToRoib() ); - - StatusCode sc = validate( m_configSvc->thresholdConfig()->getThresholdVector(TrigConf::L1DataDef::MUON) ); - - if( sc.isFailure() ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "LVL1 muon configuration failed sanity check"; - REPORT_ERROR( StatusCode::FAILURE ) - << "See previous messages for more information"; - REPORT_ERROR( StatusCode::FAILURE ) - << "The muon trigger results will not be reliable"; - return sc; - } else { - ATH_MSG_DEBUG( "LVL1 muon configuration passed sanity check" ); - } - - return StatusCode::SUCCESS; - } - - - //--------------------------------- - // finalize() - //--------------------------------- - StatusCode L1MuctpiTool::finalize() { - - // Now this is a tricky part. We have to force the message logging of the - // MuCTPI simulation to display messages of the same level as this MsgStream. - MsgWriter::instance()->setMinType( msg().level() ); - MsgWriter::instance()->setSource( name() ); - - ATH_MSG_INFO( "===============================" ); - ATH_MSG_INFO( "Finalizing L1Muctpi algorithm." ); - ATH_MSG_INFO( "===============================" ); - - delete m_theMuctpi; - m_theMuctpi = 0; - - return StatusCode::SUCCESS; - } - - - // this is the main execute function for the tool, it just picks form the original - // algorithm code what to execute. This is essetnially the execute from RDO variant - // below without the saveOutput call, since we only want part of that routine. - - StatusCode L1MuctpiTool::fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo& l1topoCandidates, int bcidOffset) const { - ATH_MSG_DEBUG( "in fillMuCTPIL1Topo()" ); - - // Retrieve the MuCTPIToRoIBSLink or RoIBResult object from storegate: - const ROIB::RoIBResult* roibResult {nullptr}; - const L1MUINT::MuCTPIToRoIBSLink* muctpi_slink {nullptr}; - const MuCTPI_RDO* muctpiRDO = {nullptr}; - - if(bcidOffset==0) { - if( evtStore()->contains<L1MUINT::MuCTPIToRoIBSLink>( m_roiOutputLocId) ) { - CHECK( evtStore()->retrieve( muctpi_slink, m_roiOutputLocId) ); - } else if( evtStore()->contains<ROIB::RoIBResult>(m_roibLocation) ) { - CHECK( evtStore()->retrieve(roibResult, m_roibLocation) ); - } else { - ATH_MSG_WARNING("Neither a MuCTPIToRoIBSLink with SG key '/Run/L1MuCTPItoRoIBLocation' nor a an RoIBResult were found in the event."); - return StatusCode::RECOVERABLE; - } - }else{ - CHECK( evtStore()->retrieve( muctpiRDO, m_rdoLocId ) ); - ATH_MSG_DEBUG( "Retrieved MuCTPI_RDO object from StoreGate" ); - } - - // Convert output of MUCTPi to input - LVL1MUONIF::Lvl1MuCTPIInput convertedInput; - - // if reading from ROS data - if(muctpiRDO) { - - //std::cout << "DataWord Decoding" << std::endl; - //for(auto dW : muctpiRDO->dataWord()) - //MuCTPI_DataWord_Decoder(dW).dumpData(msg()); - - // Get the BCID of the collision: - unsigned int bcid_next = ( ( muctpiRDO->candidateMultiplicity() >> 18 ) & 0x7 ) + bcidOffset; - if(bcid_next==8) bcid_next=0; - ATH_MSG_DEBUG("Filling the input event from MUCTPI_RDO for bcid = " << bcid_next); - - // Create the input to the MuCTPI for the +1 BC - CHECK( Converter::convertRDO( muctpiRDO->dataWord(), bcid_next, &convertedInput ) ); - ATH_MSG_DEBUG("Input converted"); - - } - // or from RoIB data - else{ - - // Extract the RoIs into a vector: - std::vector< unsigned int > convertableRoIs; - - if( roibResult ) { - - const std::vector< ROIB::MuCTPIRoI >& rois = roibResult->muCTPIResult().roIVec(); - ATH_MSG_DEBUG("Filling the input event from RoIBResult. Number of Muon ROIs: " << rois.size() ); - for( const ROIB::MuCTPIRoI & muonRoI : rois ) { - convertableRoIs.push_back( muonRoI.roIWord() ); - } - } else if( muctpi_slink ) { - - ATH_MSG_DEBUG("Filling the input event. Number of Muon ROIs: " << muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Header::wordsPerHeader - ROIB::Trailer::wordsPerTrailer - 1); - unsigned int icnt = 0; - for ( unsigned int roiword : muctpi_slink->getMuCTPIToRoIBWords() ) { - - ++icnt; - // skip header - if ( icnt <= ROIB::Header::wordsPerHeader + 1 ) - continue; - - // skip trailer - if ( icnt > ( muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Trailer::wordsPerTrailer ) ) - continue; - - // fill RoI into vector - convertableRoIs.push_back(roiword); - } - } - - // Create the input to the MuCTPI: - CHECK( Converter::convertRoIs( convertableRoIs, &convertedInput ) ); - } - - // process the input with the MuCTPI simulation - ATH_MSG_DEBUG("MUCTPI data processing..."); - m_theMuctpi->processData( &convertedInput ); - - // get outputs for L1Topo - ATH_MSG_DEBUG("Getting the output for L1Topo"); - l1topoCandidates = m_theMuctpi->getL1TopoData(); - - return StatusCode::SUCCESS; - } - - - //---------------------------------------------- - // execute() method called once per event - //---------------------------------------------- - StatusCode L1MuctpiTool::execute( ) const { - - // Now this is a tricky part. We have to force the message logging of the - // MuCTPI simulation to display messages of the same level as this MsgStream. - MsgWriter::instance()->setMinType( msg().level() ); - MsgWriter::instance()->setSource( name() ); - - ATH_MSG_DEBUG( "===============================" ); - ATH_MSG_DEBUG( "Executing L1Muctpi algorithm." ); - ATH_MSG_DEBUG( "===============================" ); - - // Now this is a trictky one. I only had to make the decision of which function to call - // at execute once in initialize(). Now I can call the right function like this: - return ( this->*m_executeFunction )(); - } - - /** - * This is the default execute() function. It reads inputs from the RPC and TGC sector logics, - * and runs the MuCTPI simulation with their inputs. - */ - StatusCode L1MuctpiTool::executeFromDigi() const { - - ATH_MSG_DEBUG( "in executeFromDigi()" ); - - // - // Get the RPC MUCTPI-input object from StoreGate. - // - bool gotRPCInput( false ); - const LVL1MUONIF::Lvl1MuCTPIInput* dHandleRPC = 0; - if( evtStore()->retrieve( dHandleRPC, m_rpcLocId ).isFailure() ) { - ATH_MSG_WARNING( "Cannot retrieve RPC L1Muctpi object from StoreGate!" ); - } else { - ATH_MSG_DEBUG( "Retrieved RPC Lvl1MuCTPIInput object from StoreGate" ); - gotRPCInput = true; - } - - // - // Get the TGC MUCTPI-input object from StoreGate. - // - bool gotTGCInput( false ); - const LVL1MUONIF::Lvl1MuCTPIInput* dHandleTGC = 0; - if( evtStore()->retrieve( dHandleTGC, m_tgcLocId ).isFailure() ) { - ATH_MSG_WARNING( "Cannot retrieve TGC L1Muctpi object from StoreGate!" ); - } else { - ATH_MSG_DEBUG( "Retrieved TGC Lvl1MuCTPIInput object from StoreGate" ); - gotTGCInput = true; - } - - // Merge the two inputs: - LVL1MUONIF::Lvl1MuCTPIInput mergedInput; - if( gotRPCInput ) mergedInput.merge( *dHandleRPC ); - if( gotTGCInput ) mergedInput.merge( *dHandleTGC ); - - if( ! ( gotRPCInput || gotTGCInput ) ) { // this should be an "&&" in final ver. - ATH_MSG_WARNING( "No input received from the RPC or TGC sector logic simulation" ); - return StatusCode::SUCCESS; - } - - /// Need to check here if there are several BC slices in the input object, and run - /// the simulation for each one - - - //// TESTING ONLY ///// - /// mergedInput.duplicateToOtherBC(-1); - - //always process the central slice, which defaults to bcidOffset = 0 - // process the input in the MUCTPI simulation - m_theMuctpi->processData( &mergedInput ); - // Save the output of the simulation - CHECK( saveOutput() ); - - // check the other 4 possible BC offset values in case the input objects tells us there are - // out of time candidates - - - if (mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem()) || - mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem()) || - mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem()) ){ - - for (std::vector<int>::const_iterator it = m_bcidOffsetList.begin(); it != m_bcidOffsetList.end(); ++it){ - if (! mergedInput.isEmptyAll( (*it) ) ){ - // process the input in the MUCTPI simulation - m_theMuctpi->processData( &mergedInput, (*it)); - // Save the output of the simulation - CHECK( saveOutput( (*it) ) ); - } - } - } - - return StatusCode::SUCCESS; - } - - /** - * This is a new execute() function. It reads the LVL1_ROI object from an AOD file, it converts - * the muon RoIs back into the input format of the MuCTPI, then runs the MuCTPI information - * with this transformed input. - */ - StatusCode L1MuctpiTool::executeFromAOD() const { - - ATH_MSG_DEBUG( "in executeFromAOD()" ); - - // Retrieve the LVL1_ROI object from the AOD: - const LVL1_ROI* lvl1RoI = 0; - CHECK( evtStore()->retrieve( lvl1RoI, m_aodLocId ) ); - ATH_MSG_DEBUG( "Retrieved LVL1_ROI object from StoreGate" ); - - // Extract the RoIs into a vector: - std::vector< unsigned int > convertableRoIs; - LVL1_ROI::muons_type::const_iterator muonRoI_itr = lvl1RoI->getMuonROIs().begin(); - LVL1_ROI::muons_type::const_iterator muonRoI_end = lvl1RoI->getMuonROIs().end(); - for( ; muonRoI_itr != muonRoI_end; ++muonRoI_itr ) { - convertableRoIs.push_back( muonRoI_itr->getROIWord() ); - } - - // Create the input to the MuCTPI: - LVL1MUONIF::Lvl1MuCTPIInput convertedInput; - CHECK( Converter::convertRoIs( convertableRoIs, &convertedInput ) ); - - // process the input with the MuCTPI simulation - m_theMuctpi->processData( &convertedInput ); - - // store CTP result in interface object and put to StoreGate - LVL1::MuCTPICTP* theCTPResult = new LVL1::MuCTPICTP( m_theMuctpi->getCTPData() ); - CHECK( evtStore()->record( theCTPResult, m_ctpOutputLocId ) ); - ATH_MSG_DEBUG( "CTP word recorded to StoreGate with key: " - << m_ctpOutputLocId ); - - // Save the output of the simulation - CHECK( saveOutput() ); - - return StatusCode::SUCCESS; - } - - /** - * This is a new execute() function. It reads the MuCTPI_RDO object from an RDO file, it - * converts the muon data words back into the input format of the MuCTPI, then runs the - * MuCTPI information with this transformed input. - */ - StatusCode L1MuctpiTool::executeFromRDO() const { - - ATH_MSG_DEBUG( "in executeFromRDO()" ); - - // Retrieve the MuCTPI_RDO object from the digitized file: - const MuCTPI_RDO* old_RDO = 0; - CHECK( evtStore()->retrieve( old_RDO, m_rdoLocId ) ); - ATH_MSG_DEBUG( "Retrieved MuCTPI_RDO object from StoreGate" ); - - // Get the BCID of the collision: - const unsigned int bcid = ( ( old_RDO->candidateMultiplicity() >> 18 ) & 0x7 ); - - // Create the input to the MuCTPI: - LVL1MUONIF::Lvl1MuCTPIInput convertedInput; - CHECK( Converter::convertRDO( old_RDO->dataWord(), bcid, &convertedInput ) ); - - // process the input with the MuCTPI simulation - m_theMuctpi->processData( &convertedInput ); - - // Save the output of the simulation - CHECK( saveOutput() ); - - return StatusCode::SUCCESS; - } - - StatusCode L1MuctpiTool::validate( const std::vector< TrigConf::TriggerThreshold* > & - thresholds ) const { - - // - // Check that it's not a null-pointer: - // - // if( ! thresholds ) { - // REPORT_ERROR( StatusCode::FAILURE ) - // << "No muon threshold vector given for validation!"; - // return StatusCode::FAILURE; - // } - - // - // Check that there are 6 thresholds: - // - if( thresholds.size() != 6 ) { - REPORT_ERROR( StatusCode::FAILURE ) - << thresholds.size() << " muon thresholds defined"; - REPORT_ERROR( StatusCode::FAILURE ) - << "There have to be exactly 6 threshold defined!"; - return StatusCode::FAILURE; - } - - // - // Check that they are all muon thresholds: - // - for( TrigConf::TriggerThreshold* thr : thresholds ) { - if( ( thr->cableName() != "MU" && thr->cableName() != "MUCTPI" ) || ( thr->type() != "MUON" ) ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "There is a non-muon threshold in the LVL1 muon configuration!"; - return StatusCode::FAILURE; - } - } - - // - // Check that they're all on the same cable: - // - const std::string ctpin = thresholds.at( 0 )->cableCtpin(); - const std::string connector = thresholds.at( 0 )->cableConnector(); - for( const TrigConf::TriggerThreshold * thr : thresholds ) { - if( ( thr->cableCtpin() != ctpin ) || ( thr->cableConnector() != connector ) ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "The muon thresholds are not all configured on the same cable!"; - return StatusCode::FAILURE; - } - } - - // - // Check that they are configured on the correct wires: - // - unsigned int mask = 0; - for( TrigConf::TriggerThreshold* thr : thresholds ) { - if( ( thr->cableEnd() - thr->cableStart() ) != 2 ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "A muon threshold is not 3 bit wide in the configuration!"; - return StatusCode::FAILURE; - } - mask |= ( static_cast< unsigned int >( pow( 2, thr->cableEnd() - thr->cableStart() + 1 ) - 1 ) << thr->cableStart() ); - } - if( mask != 0x7fffe ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "The muon thresholds don't cover the correct bits on the cable"; - return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; - } - - /** - * This function is used by all the different execute functions to save the output - * of the MuCTPI simulation into various objects in StoreGate. - */ - StatusCode L1MuctpiTool::saveOutput(int bcidOffset) const { - - /// the standart processing is done for the central slice, with no Bcid offset - if (bcidOffset == 0 ) { - // store CTP result in interface object and put to StoreGate - LVL1::MuCTPICTP* theCTPResult = new LVL1::MuCTPICTP( m_theMuctpi->getCTPData() ); - CHECK( evtStore()->record( theCTPResult, m_ctpOutputLocId ) ); - ATH_MSG_DEBUG( "CTP word recorded to StoreGate with key: " - << m_ctpOutputLocId ); - - // create MuCTPI RDO - const std::list< unsigned int >& daqData = m_theMuctpi->getDAQData(); - - const int HEADER_SIZE = 9; - const int STATUSandTAILER_SIZE = 2 + 3; - - // size check - // payload should contain at least 1 data (Candidate Multiplicity) - int payloadSize = daqData.size() - HEADER_SIZE - STATUSandTAILER_SIZE; - if( payloadSize < 1 ) { - REPORT_ERROR( StatusCode::FAILURE ) - << "MIROD didn't provide correct DAQ data"; - return StatusCode::FAILURE; - } - - // skip header part - std::list< unsigned int >::const_iterator itDAQ = daqData.begin(); - for( int iHead = 0; iHead < HEADER_SIZE; ++iHead ) { - ++itDAQ; - } - - // candidate multiplicity - const uint32_t can = *itDAQ; - ++itDAQ; - - // data word - std::vector< uint32_t > dataWord; - for( int iData = 1; iData < payloadSize; ++iData, ++itDAQ ) { - dataWord.push_back( *itDAQ ); - } - - // create MuCTPI RDO - MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, std::move(dataWord) ); - CHECK( evtStore()->record( muCTPI_RDO, m_rdoOutputLocId ) ); - ATH_MSG_DEBUG( "MuCTPI_RDO object recorded to StoreGate with key: " - << m_rdoOutputLocId ); - - // store RoIB result in interface object and put to StoreGate - std::list< unsigned int > resultForRoIB = m_theMuctpi->getRoIBData(); - std::vector< unsigned int > roibResultVector; - - std::list< unsigned int >::iterator roib_itr = resultForRoIB.begin(); - std::list< unsigned int >::iterator roib_end = resultForRoIB.end(); - for( ; roib_itr != roib_end; ++roib_itr ) { - roibResultVector.push_back( *roib_itr ); - } - - L1MUINT::MuCTPIToRoIBSLink* theRoIBResult = - new L1MUINT::MuCTPIToRoIBSLink( roibResultVector ); - - CHECK( evtStore()->record( theRoIBResult, m_roiOutputLocId ) ); - ATH_MSG_DEBUG( "RoIB result recorded to StoreGate with key: " - << m_roiOutputLocId ); - - //construct muctpi nim words (for MUE and MUB items) - unsigned int cw1=0; - if( m_doNimOutput ) { - if(m_theMuctpi->hasBarrelCandidate()){ - unsigned int nimBarrelBitMask = 1<<m_nimBarrelBit; - cw1|=nimBarrelBitMask; - } - if(m_theMuctpi->hasEndcapCandidate()){ - unsigned int nimEndcapBitMask = 1<<m_nimEndcapBit; - cw1|=nimEndcapBitMask; - } - - //constructing NimCTP object - LVL1::NimCTP* nim = new LVL1::NimCTP( 0, cw1, 0 ); - - // Save it into StoreGate: - if( evtStore()->contains< LVL1::NimCTP >( m_nimOutputLocId ) ) { - ATH_MSG_ERROR("NimCTP object already in store gate. This should not happen!"); - return StatusCode::FAILURE; - } - CHECK( evtStore()->record( nim, m_nimOutputLocId ) ); - } - - // get outputs for L1Topo and store into Storegate - ATH_MSG_DEBUG("Getting the output for L1Topo"); - LVL1::MuCTPIL1Topo l1topoCandidates = m_theMuctpi->getL1TopoData(); - LVL1::MuCTPIL1Topo* l1topo = new LVL1::MuCTPIL1Topo(l1topoCandidates.getCandidates()); - CHECK( evtStore()->record( l1topo, m_l1topoOutputLocId ) ); - // std::cout << "TW: central slice: offset: " << bcidOffset << " location: " << m_l1topoOutputLocId << std::endl; - //l1topo->print(); - } - - /// if we have a bcid offset, then just get the topo output and put it on storegate - if (bcidOffset != 0) { - ATH_MSG_DEBUG("Getting the output for L1Topo for BCID slice"); - LVL1::MuCTPIL1Topo l1topoCandidatesBC = m_theMuctpi->getL1TopoData(); - LVL1::MuCTPIL1Topo* l1topoBC = new LVL1::MuCTPIL1Topo(l1topoCandidatesBC.getCandidates()); - l1topoBC->setBcidOffset(bcidOffset); - CHECK( evtStore()->record( l1topoBC, m_l1topoOutputLocId+std::to_string(bcidOffset) ) ); - // std::cout << "TW: slice: offset: " << bcidOffset << " location: " - // << m_l1topoOutputLocId+std::to_string(bcidOffset) << std::endl; - // l1topoBC->print(); - } - - - return StatusCode::SUCCESS; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h deleted file mode 100644 index 5f8533ee62b0583f87b79d886b0058daec7d5851..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TRIGT1MUCTPI_L1MUCTPITOOL_H -#define TRIGT1MUCTPI_L1MUCTPITOOL_H - -#include "AthenaBaseComps/AthAlgTool.h" -#include "TrigT1Interfaces/IMuctpiSimTool.h" -#include <vector> -#include <string> - -#include "GaudiKernel/ToolHandle.h" - -namespace TrigConf { - class ILVL1ConfigSvc; - class TriggerThreshold; -} - - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MuctpiSim; - - class L1MuctpiTool : public extends<AthAlgTool, IMuctpiSimTool> { - public: - L1MuctpiTool(const std::string& type, const std::string& name, - const IInterface* parent); - - virtual ~L1MuctpiTool(); - - virtual StatusCode initialize() override; - - virtual StatusCode fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo&, int bcidOffset=0) const override; - - // left over from ALgorithm implementation ... can I just leave them in here - // and use them as normal funcitons? - /// Regular Gaudi algorithm finalization function - virtual StatusCode finalize() override; - /// Regular Gaudi algorithm execute function - virtual StatusCode execute() const override; - /// Regular Gaudi algorithm beginRun function - virtual StatusCode start() override; - - - private: - - /// Event loop method for running as part of digitization - StatusCode executeFromDigi() const; - /// Event loop method for running on an AOD file - StatusCode executeFromAOD() const; - /// Event loop method for running on an RDO file - StatusCode executeFromRDO() const; - /// Validate the muon threshold configuration - StatusCode validate( const std::vector< TrigConf::TriggerThreshold* >& thresholds ) const; - /// Save the outputs of the simulation into StoreGate - StatusCode saveOutput(int bcidOffset = 0) const; - - /// The LVL1 configuration service - ServiceHandle< TrigConf::ILVL1ConfigSvc > m_configSvc; - - /// The simulation top level object - MuctpiSim* m_theMuctpi; - - /// The BCID slices to be checked in addition to the central one in the input objects from Digi - std::vector<int> m_bcidOffsetList = {-2,-1,1,2}; - - // Locations of the inputs and outputs of the simulation in StoreGate: - static const std::string m_DEFAULT_L1MuctpiStoreLocationRPC; - static const std::string m_DEFAULT_L1MuctpiStoreLocationTGC; - static const std::string m_DEFAULT_AODLocID; - static const std::string m_DEFAULT_RDOLocID; - - // These properties control the way the overlap handling functions: - std::string m_overlapStrategyName; - std::string m_lutXMLFile; - std::string m_runPeriod; - bool m_flagMode; - - // These properties control the way the outputs for the L1Topo are generated - std::string m_geometryXMLFile; - - // These properties control how the multiplicity summation happens: - std::string m_multiplicityStrategyName; - std::string m_multiplicityXMLFile; - - // Property for the input selection, and the locations of the various - // input and output objects: - std::string m_inputSource; - std::string m_aodLocId; - std::string m_rdoLocId; - std::string m_rdoOutputLocId; - std::string m_roiOutputLocId; - std::string m_ctpOutputLocId; - std::string m_l1topoOutputLocId; - std::string m_tgcLocId; - std::string m_rpcLocId; - std::string m_roibLocation; - - /// Property telling if the LUTs should be printed: - bool m_dumpLut; - - /// Property telling if input file is data or simulation - bool m_IsData; - - // Properties controlling the NIM outputs provided by the simulation - bool m_doNimOutput; - std::string m_nimOutputLocId; - unsigned int m_nimBarrelBit; - unsigned int m_nimEndcapBit; - - /// Function pointer to the execute function we want to use: - StatusCode ( LVL1MUCTPI::L1MuctpiTool::*m_executeFunction )( void ) const; - - }; -} - -#endif diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.cxx deleted file mode 100644 index db2159ba5c68aeea517c0781f7abb42af3c631de..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: BitOp.cxx 796872 2017-02-13 15:03:25Z fwinkl $ - -// STL include(s): -#include <iostream> - -// Local include(s): -#include "BitOp.h" - -namespace LVL1MUCTPI { - - BitOp::BitOp() { - - } - - BitOp::~BitOp() { - - } - - void BitOp::printBinN( unsigned int uintValue, int nbits ) { - - for( int i = nbits; i >= 0; --i ) { - if( uintValue & ( 1 << i ) ) { - std::cout << "1"; - } else { - std::cout << "0"; - } - if( (i % 4) == 0 ) std::cout << " "; - } - - } - - void BitOp::printBinN( int intValue, int nbits ) { - - for( int i = nbits; i >= 0; --i ) { - if( intValue & ( 1 << i ) ) { - std::cout << "1"; - } else { - std::cout << "0"; - } - if( (i % 4) == 0 ) std::cout << " "; - } - - } - - void BitOp::printBinN( unsigned int uintValue, int nbits, std::string& destination ) { - - for( int i = nbits; i >= 0; --i ) { - if( uintValue & ( 1 << i ) ) { - destination += "1"; - } else { - destination += "0"; - } - if( (i % 4) == 0 ) destination += " "; - } - - } - - void BitOp::printBinN( int intValue, int nbits, std::string& destination ) { - - for( int i = nbits; i >= 0; --i ) { - if( intValue & ( 1 << i ) ) { - destination += "1"; - } else { - destination += "0"; - } - if( (i % 4) == 0 ) destination += " "; - } - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.h deleted file mode 100644 index dfbd3cad8cee938ff88c8e4bebff05f778abe254..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.h +++ /dev/null @@ -1,117 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: BitOp.h 796872 2017-02-13 15:03:25Z fwinkl $ -#ifndef TRIGT1MUCTPI_BITOP_H -#define TRIGT1MUCTPI_BITOP_H - -#include <string> -#include "CxxUtils/bitscan.h" - -namespace LVL1MUCTPI { - - /** - ******************************************************************* - * - * $Date: 2017-02-13 16:03:25 +0100 (Mon, 13 Feb 2017) $ - * - * @short Utility class for integer bit operations - * - * This is a utility class for integer bit operations - * Operations that set or unset bits are done using - * Pointers and are inline, as they need to be fast. - * The print methods are not time-critical. - * - * @see - * @author Author: Thorsten Wengler - * @version $Revision: 796872 $ - * - ******************************************************************* - */ - class BitOp { - - public: - BitOp(); - ~BitOp(); - - /** - * Utitlity function to print out the binary - * representation of an input int or unsigned int - * value. Does not need to be fast. - */ - static void printBin( unsigned int uintValue ) { printBinN( uintValue, 31 ); } - static void printBin( int intValue ) { printBinN( intValue, 31 ); } - static void printBin( unsigned int uintValue, std::string& destination ) { printBinN( uintValue, 31, destination ); } - static void printBin( int intValue, std::string& destination ) { printBinN( intValue, 31, destination ); } - static void printBinN( unsigned int uintValue, int nbits ); - static void printBinN( int intValue, int nbits ); - static void printBinN( unsigned int uintValue, int nbits, std::string& destination ); - static void printBinN( int intValue, int nbits, std::string& destination ); - - /** - * Check if a the given bit in the given unsigned int or - * int value is set. True if yes. Uses pointer to the obejct - * and is inline. Does not change the initial value given to - * the function. - */ - static inline bool isSet(const unsigned int *uintValue, int bit) - { return ( *uintValue == ( *uintValue | ( 1 << bit ) ) ); } - - static inline bool isSet(const int *intValue, int bit) - { return ( *intValue == ( *intValue | ( 1 << bit ) ) ); } - - /** - * Set the given bit in the given unsigned int - * or int value. Uses pointer to the object and is inline. - */ - static inline void setBit(unsigned int *uintValue, int bit) - { *uintValue |= ( 1 << bit ); } - - static inline void setBit(int *intValue, int bit) - { *intValue |= ( 1 << bit ); } - - /** - * Clear the given bit in the given integer. Uses pointer - * to the object and is inline. - */ - static inline void clearBit(unsigned int *uintValue, int bit) - { *uintValue |= ( 1 << bit ); *uintValue ^= ( 1 << bit ); } - - static inline void clearBit(int *intValue, int bit) - { *intValue |= ( 1 << bit ); *intValue ^= ( 1 << bit ); } - - /** - * Superimpose the given integer wrd starting at bit stbit - * onto integer or unsigned interger value. - * Uses pointer to the object and is inline. - * !! Bits already set in value are not reset !! - */ - static inline void sImposeNBits(unsigned int *uintValue, int stbit, int wrd) - { *uintValue |= ( wrd << stbit ); } - - static inline void sImposeNBits(int *intValue, int stbit, int wrd) - { *intValue |= ( wrd << stbit ); } - - static inline void sImposeNBits(unsigned int *uintValue, int stbit, unsigned int wrd) - { *uintValue |= ( wrd << stbit ); } - - static inline void sImposeNBits(int *intValue, int stbit, unsigned int wrd) - { *intValue |= ( wrd << stbit ); } - - /** - * get the value in the input word represented by a bit pattern - * given as a bitmask - */ - static inline unsigned int getValue(const unsigned int* uintValue, const unsigned int mask) - { - return (*uintValue & mask) >> CxxUtils::count_trailing_zeros(mask); - } - - }; // class BitOp - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_BITOP_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Configuration.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Configuration.h deleted file mode 100644 index f999a1fda99b757cb8d3ff07d278fd1ad3b4a9cb..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Configuration.h +++ /dev/null @@ -1,73 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Configuration.h 515239 2012-08-28 11:39:45Z krasznaa $ -#ifndef TRIGT1MUCTPI_CONFIGURATION_H -#define TRIGT1MUCTPI_CONFIGURATION_H - -namespace LVL1MUCTPI { - - /** - * @short Header files holding configuration items for the MUCTPI - * - * This header file groups all information describing - * the configuration of the MUCTPI. Eventually this should - * come out of a configuration data base. - * - * @author Thorsten Wengler - * - * $Revision: 515239 $ - * $Date: 2012-08-28 13:39:45 +0200 (Tue, 28 Aug 2012) $ - */ - class Configuration { - - public: - Configuration() - : m_doZeroSuppression( true ), - m_threshold1Candidate( 1 ), - m_threshold2Candidate( 1 ), - m_suppressionMode( 0 ), - m_maxCandPerPtvalue( 64 ), - m_maxCandSendToRoib( 14 ), - m_candBcidOffset( 0 ) - {} - - // Configuration items for the MIOCTS - void setDoZeroSuppression( bool flag ) { m_doZeroSuppression = flag; } - bool getDoZeroSuppression() const { return m_doZeroSuppression; } - - // Configuration Items for the MIROD Extractor - // pt-thresholds for the first and second candidate - void setThreshold1Candidate( unsigned int thr ) { m_threshold1Candidate = thr; } - unsigned int getThreshold1Candidate() const { return m_threshold1Candidate; } - void setThreshold2Candidate( unsigned int thr ) { m_threshold2Candidate = thr; } - unsigned int getThreshold2Candidate() const { return m_threshold2Candidate; } - - // Extractor suppression mode flag - void setSuppressionMode( int flag ) { m_suppressionMode = flag; } - int getSuppressionMode() const { return m_suppressionMode; } - - // Lvl2 processor configuration - unsigned int getMaxCandPerPtvalue() const { return m_maxCandPerPtvalue; } //nonprogrammable - void setMaxCandSendToRoib( unsigned int count ) { m_maxCandSendToRoib = count; } - unsigned int getMaxCandSendToRoib() const { return m_maxCandSendToRoib; } - void setCandBcidOffset( unsigned int count ) { m_candBcidOffset = count; } - unsigned int getCandBcidOffset() const { return m_candBcidOffset; } - - private: - bool m_doZeroSuppression; - unsigned int m_threshold1Candidate; - unsigned int m_threshold2Candidate; - int m_suppressionMode; - unsigned int m_maxCandPerPtvalue; - unsigned int m_maxCandSendToRoib; - unsigned int m_candBcidOffset; - - }; // class Configuration - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_CONFIGURATION_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.cxx deleted file mode 100644 index 0b61e6ffb5a84360e2adade8c1e8b5dfe2f30295..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.cxx +++ /dev/null @@ -1,592 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Converter.cxx 707664 2015-11-13 05:36:00Z ssnyder $ - -// STL include(s): -#include <map> -#include <iomanip> -#include <sstream> - -// TrigT1 include(s): -#include "TrigT1Interfaces/Lvl1MuCTPIInput.h" - -// Local include(s): -#include "Converter.h" -#include "BitOp.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Declaration of the constants: - const unsigned int Converter::RoIandOverlapMask = 0x000007fc; - const unsigned int Converter::PtMask = 0x00003800; - const unsigned int Converter::RoI_SectorAddressMask = 0x003fc000; - const unsigned int Converter::RDO_SectorAddressMask = 0x01fe0000; - const unsigned int Converter::RoI_FirstCandMask = 0x00400000; - const unsigned int Converter::RDO_FirstCandMask = 0x02000000; - const unsigned int Converter::MoreCandInRoI = 0x00000002; - const unsigned int Converter::MoreCandInSec = 0x00000001; - const unsigned int Converter::Cand1InverseMask = 0xfdc7fc00; - const unsigned int Converter::Cand2InverseMask = 0xfa3803fe; - - StatusCode Converter::convertRoIs( const std::vector< unsigned int >& roi_vector, - LVL1MUONIF::Lvl1MuCTPIInput* muctpi_input ) { - - MsgLogger logger( "Converter::convertRoIs()" ); - - // Maps needed for the translation: - std::map< unsigned int, HelperRoIBarrelSector > barrel_map; - std::map< unsigned int, HelperRoIEndcapSector > endcap_map; - std::map< unsigned int, HelperRoIForwardSector > forward_map; - - //////////////////////////////////////////////////////////////////////////////// - // // - // Iterate through all the RoI words, and fill the maps with data extracted // - // from them. // - // // - //////////////////////////////////////////////////////////////////////////////// - - std::vector< unsigned int >::const_iterator it_roi_vector = roi_vector.begin(); - std::vector< unsigned int >::const_iterator end_roi_vector = roi_vector.end(); - for( ; it_roi_vector != end_roi_vector; ++it_roi_vector ) { - - SectorType type = getSectorType( getRoISectorAddress( *it_roi_vector ) ); - - if( type == Barrel ) { - REPORT_VERBOSE_MSG2( "Barrel sector candidate found : 0x" << std::hex - << std::setw( 8 ) << std::setfill( '0' ) - << *it_roi_vector, - logger); - - if( isRoIFirstCand( *it_roi_vector ) ) { - barrel_map[ getRoISectorAddress( *it_roi_vector ) ].addFirst( *it_roi_vector ); - } else { - barrel_map[ getRoISectorAddress( *it_roi_vector ) ].addSecond( *it_roi_vector ); - } - - } else if( type == Endcap ) { - - REPORT_VERBOSE_MSG2( "Endcap sector candidate found : 0x" << std::hex - << std::setw( 8 ) << std::setfill( '0' ) - << *it_roi_vector, - logger); - - if( isRoIFirstCand( *it_roi_vector ) ) { - endcap_map[ getRoISectorAddress( *it_roi_vector ) ].addFirst( *it_roi_vector ); - } else { - endcap_map[ getRoISectorAddress( *it_roi_vector ) ].addSecond( *it_roi_vector ); - } - - } else if( type == Forward ) { - - REPORT_VERBOSE_MSG2( "Forward sector candidate found : 0x" << std::hex - << std::setw( 8 ) << std::setfill( '0' ) - << *it_roi_vector, - logger); - - if( isRoIFirstCand( *it_roi_vector ) ) { - forward_map[ getRoISectorAddress( *it_roi_vector ) ].addFirst( *it_roi_vector ); - } else { - forward_map[ getRoISectorAddress( *it_roi_vector ) ].addSecond( *it_roi_vector ); - } - - } else { - - REPORT_FATAL_MSG2( "Coding error found. System of candidate not recognized.", - logger); - return StatusCode::FAILURE; - } - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Now iterate through the maps and fill the MuCTPI input object. // - // // - //////////////////////////////////////////////////////////////////////////////// - - std::map< unsigned int, HelperRoIBarrelSector >::const_iterator it_barrel_map = - barrel_map.begin(); - std::map< unsigned int, HelperRoIBarrelSector >::const_iterator end_barrel_map = - barrel_map.end(); - for( ; it_barrel_map != end_barrel_map; ++it_barrel_map ) { - - REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_barrel_map->second.toString(), logger); - - if( it_barrel_map->second.subSystem() == HelperRoISector::A_side ) { - - muctpi_input->setSectorLogicData( it_barrel_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), - it_barrel_map->second.sectorID() ); - - } else if( it_barrel_map->second.subSystem() == HelperRoISector::C_side ) { - - muctpi_input->setSectorLogicData( it_barrel_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), - it_barrel_map->second.sectorID() ); - - } else { - - REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger ); - return StatusCode::FAILURE; - } - } - - std::map< unsigned int, HelperRoIEndcapSector >::const_iterator it_endcap_map = - endcap_map.begin(); - std::map< unsigned int, HelperRoIEndcapSector >::const_iterator end_endcap_map = - endcap_map.end(); - for( ; it_endcap_map != end_endcap_map; ++it_endcap_map ) { - - REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_endcap_map->second.toString(), logger); - - if( it_endcap_map->second.subSystem() == HelperRoISector::A_side ) { - - muctpi_input->setSectorLogicData( it_endcap_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), - it_endcap_map->second.sectorID() ); - - } else if( it_endcap_map->second.subSystem() == HelperRoISector::C_side ) { - - muctpi_input->setSectorLogicData( it_endcap_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), - it_endcap_map->second.sectorID() ); - - } else { - - REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger ); - return StatusCode::FAILURE; - } - } - - std::map< unsigned int, HelperRoIForwardSector >::const_iterator it_forward_map = - forward_map.begin(); - std::map< unsigned int, HelperRoIForwardSector >::const_iterator end_forward_map = - forward_map.end(); - for( ; it_forward_map != end_forward_map; ++it_forward_map ) { - - REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_forward_map->second.toString(), logger); - - if( it_forward_map->second.subSystem() == HelperRoISector::A_side ) { - - muctpi_input->setSectorLogicData( it_forward_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), - it_forward_map->second.sectorID() ); - - } else if( it_forward_map->second.subSystem() == HelperRoISector::C_side ) { - - muctpi_input->setSectorLogicData( it_forward_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), - it_forward_map->second.sectorID() ); - - } else { - - REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger ); - return StatusCode::FAILURE; - } - } - - return StatusCode::SUCCESS; - } - - StatusCode Converter::convertRDO( const std::vector< unsigned int >& rdo_vector, - unsigned int bcid, - LVL1MUONIF::Lvl1MuCTPIInput* muctpi_input ) { - - MsgLogger logger( "Converter::convertRDO()" ); - - // Maps needed for the translation: - std::map< unsigned int, HelperRDOBarrelSector > barrel_map; - std::map< unsigned int, HelperRDOEndcapSector > endcap_map; - std::map< unsigned int, HelperRDOForwardSector > forward_map; - - //////////////////////////////////////////////////////////////////////////////// - // // - // Iterate through all the RDO words, and fill the maps with data extracted // - // from them. // - // // - //////////////////////////////////////////////////////////////////////////////// - - std::vector< unsigned int >::const_iterator it_rdo_vector = rdo_vector.begin(); - std::vector< unsigned int >::const_iterator end_rdo_vector = rdo_vector.end(); - for( ; it_rdo_vector != end_rdo_vector; ++it_rdo_vector ) { - - // Only consider the candidates with the correct BCID: - if( getRDOBCID( *it_rdo_vector ) != bcid ) { - REPORT_VERBOSE_MSG2( "Discarding candidate with wrong BCID", logger ); - continue; - } - - SectorType type = getSectorType( getRDOSectorAddress( *it_rdo_vector ) ); - - if( type == Barrel ) { - - REPORT_VERBOSE_MSG2( "Barrel sector candidate found : 0x" << std::hex - << std::setw( 8 ) << std::setfill( '0' ) - << *it_rdo_vector, - logger); - - if( isRDOFirstCand( *it_rdo_vector ) ) { - barrel_map[ getRDOSectorAddress( *it_rdo_vector ) ].addFirst( *it_rdo_vector ); - } else { - barrel_map[ getRDOSectorAddress( *it_rdo_vector ) ].addSecond( *it_rdo_vector ); - } - - } else if( type == Endcap ) { - - REPORT_VERBOSE_MSG2( "Endcap sector candidate found : 0x" << std::hex - << std::setw( 8 ) << std::setfill( '0' ) - << *it_rdo_vector, - logger); - - if( isRDOFirstCand( *it_rdo_vector ) ) { - endcap_map[ getRDOSectorAddress( *it_rdo_vector ) ].addFirst( *it_rdo_vector ); - } else { - endcap_map[ getRDOSectorAddress( *it_rdo_vector ) ].addSecond( *it_rdo_vector ); - } - - } else if( type == Forward ) { - - REPORT_VERBOSE_MSG2( "Forward sector candidate found : 0x" << std::hex - << std::setw( 8 ) << std::setfill( '0' ) - << *it_rdo_vector, - logger); - - if( isRDOFirstCand( *it_rdo_vector ) ) { - forward_map[ getRDOSectorAddress( *it_rdo_vector ) ].addFirst( *it_rdo_vector ); - } else { - forward_map[ getRDOSectorAddress( *it_rdo_vector ) ].addSecond( *it_rdo_vector ); - } - - } else { - - REPORT_FATAL_MSG2( "Coding error found. System of candidate not recognized.", logger); - return StatusCode::FAILURE; - } - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Now iterate through the maps and fill the MuCTPI input object. // - // // - //////////////////////////////////////////////////////////////////////////////// - - std::map< unsigned int, HelperRDOBarrelSector >::const_iterator it_barrel_map = - barrel_map.begin(); - std::map< unsigned int, HelperRDOBarrelSector >::const_iterator end_barrel_map = - barrel_map.end(); - for( ; it_barrel_map != end_barrel_map; ++it_barrel_map ) { - - REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_barrel_map->second.toString(), logger); - - if( it_barrel_map->second.subSystem() == HelperRDOSector::A_side ) { - - muctpi_input->setSectorLogicData( it_barrel_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), - it_barrel_map->second.sectorID() ); - - } else if( it_barrel_map->second.subSystem() == HelperRDOSector::C_side ) { - - muctpi_input->setSectorLogicData( it_barrel_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), - it_barrel_map->second.sectorID() ); - - } else { - - REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger ); - return StatusCode::FAILURE; - } - } - - std::map< unsigned int, HelperRDOEndcapSector >::const_iterator it_endcap_map = - endcap_map.begin(); - std::map< unsigned int, HelperRDOEndcapSector >::const_iterator end_endcap_map = - endcap_map.end(); - for( ; it_endcap_map != end_endcap_map; ++it_endcap_map ) { - - REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_endcap_map->second.toString(), logger); - - if( it_endcap_map->second.subSystem() == HelperRDOSector::A_side ) { - - muctpi_input->setSectorLogicData( it_endcap_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), - it_endcap_map->second.sectorID() ); - - } else if( it_endcap_map->second.subSystem() == HelperRDOSector::C_side ) { - - muctpi_input->setSectorLogicData( it_endcap_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), - it_endcap_map->second.sectorID() ); - - } else { - - REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger ); - return StatusCode::FAILURE; - } - } - - std::map< unsigned int, HelperRDOForwardSector >::const_iterator it_forward_map = - forward_map.begin(); - std::map< unsigned int, HelperRDOForwardSector >::const_iterator end_forward_map = - forward_map.end(); - for( ; it_forward_map != end_forward_map; ++it_forward_map ) { - - REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_forward_map->second.toString(), logger); - - if( it_forward_map->second.subSystem() == HelperRDOSector::A_side ) { - - muctpi_input->setSectorLogicData( it_forward_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), - it_forward_map->second.sectorID() ); - - } else if( it_forward_map->second.subSystem() == HelperRDOSector::C_side ) { - - muctpi_input->setSectorLogicData( it_forward_map->second.sectorWord(), - LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(), - LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), - it_forward_map->second.sectorID() ); - - } else { - - REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger ); - return StatusCode::FAILURE; - } - } - - return StatusCode::SUCCESS; - } - - Converter::SectorType Converter::getSectorType( unsigned int sector_address ) { - - if( sector_address & 0x80 ) { - return Endcap; - } else if( sector_address & 0x40 ) { - return Forward; - } else { - return Barrel; - } - } - - unsigned int Converter::getRoISectorAddress( unsigned int roi_word ) { - - return BitOp::getValue( &roi_word, RoI_SectorAddressMask ); - } - - bool Converter::isRoIFirstCand( unsigned int roi_word ) { - - return ( roi_word & RoI_FirstCandMask ); - } - - unsigned int Converter::getRDOSectorAddress( unsigned int rdo_word ) { - - return BitOp::getValue( &rdo_word, RDO_SectorAddressMask ); - } - - unsigned int Converter::getRDOBCID( unsigned int rdo_word ) { - - return ( ( rdo_word >> 14 ) & 0x7 ); - } - - bool Converter::isRDOFirstCand( unsigned int rdo_word ) { - - return ( rdo_word & RDO_FirstCandMask ); - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperSector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - Converter::HelperSector& - Converter::HelperSector::operator= ( const Converter::HelperSector& right ) { - - if (this != &right) { - - this->m_word = right.m_word; - this->m_sector = right.m_sector; - } - return ( *this ); - } - - Converter::HelperSector::MuonSubSystem Converter::HelperSector::subSystem() const { - - if( BitOp::isSet( &m_sector, 0 ) ) return A_side; - else return C_side; - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperRoISector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - void Converter::HelperRoISector::addFirst( unsigned int roi_word ) { - - m_word &= Cand1InverseMask; // Zero out all quantities of the first candidate - - BitOp::sImposeNBits( &m_word, 1, BitOp::getValue( &roi_word, Converter::RoIandOverlapMask ) ); // RoI and overlap bits - BitOp::sImposeNBits( &m_word, 19, BitOp::getValue( &roi_word, Converter::PtMask ) ); // Pt - if( roi_word & Converter::MoreCandInSec ) BitOp::setBit( &m_word, 0 ); // More than two cand. in sec. - if( roi_word & Converter::MoreCandInRoI ) BitOp::setBit( &m_word, 25 ); // More than two cand. in RoI - - BitOp::sImposeNBits( &m_sector, 0, BitOp::getValue( &roi_word, Converter::RoI_SectorAddressMask ) ); - - return; - } - - void Converter::HelperRoISector::addSecond( unsigned int roi_word ) { - - m_word &= Cand2InverseMask; // Zero out all quantities of the second candidate - - BitOp::sImposeNBits( &m_word, 10, BitOp::getValue( &roi_word, Converter::RoIandOverlapMask ) ); // RoI and overlap bits - BitOp::sImposeNBits( &m_word, 22, BitOp::getValue( &roi_word, Converter::PtMask ) ); // Pt - if( roi_word & Converter::MoreCandInSec ) BitOp::setBit( &m_word, 0 ); // More than two cand. in sec. - if( roi_word & Converter::MoreCandInRoI ) BitOp::setBit( &m_word, 26 ); // More than two cand. in RoI - - BitOp::sImposeNBits( &m_sector, 0, BitOp::getValue( &roi_word, Converter::RoI_SectorAddressMask ) ); - - return; - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperRoIBarrelSector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - unsigned int Converter::HelperRoIBarrelSector::sectorID() const { - - return BitOp::getValue( &m_sector, 0x3e ); - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperRoIEndcapSector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - unsigned int Converter::HelperRoIEndcapSector::sectorID() const { - - return BitOp::getValue( &m_sector, 0x7e ); - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperRoIForwardSector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - unsigned int Converter::HelperRoIForwardSector::sectorID() const { - - return BitOp::getValue( &m_sector, 0x3e ); - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperRDOSector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - void Converter::HelperRDOSector::addFirst( unsigned int rdo_word ) { - - m_word &= Cand1InverseMask; // Zero out all quantities of the first candidate - - BitOp::sImposeNBits( &m_word, 1, BitOp::getValue( &rdo_word, Converter::RoIandOverlapMask ) ); // RoI and overlap bits - BitOp::sImposeNBits( &m_word, 19, BitOp::getValue( &rdo_word, Converter::PtMask ) ); // Pt - if( rdo_word & Converter::MoreCandInSec ) BitOp::setBit( &m_word, 0 ); // More than two cand. in sec. - if( rdo_word & Converter::MoreCandInRoI ) BitOp::setBit( &m_word, 25 ); // More than two cand. in RoI - - BitOp::sImposeNBits( &m_sector, 0, BitOp::getValue( &rdo_word, Converter::RDO_SectorAddressMask ) ); - - return; - } - - void Converter::HelperRDOSector::addSecond( unsigned int rdo_word ) { - - m_word &= Cand2InverseMask; // Zero out all quantities of the second candidate - - BitOp::sImposeNBits( &m_word, 10, BitOp::getValue( &rdo_word, Converter::RoIandOverlapMask ) ); // RoI and overlap bits - BitOp::sImposeNBits( &m_word, 22, BitOp::getValue( &rdo_word, Converter::PtMask ) ); // Pt - if( rdo_word & Converter::MoreCandInSec ) BitOp::setBit( &m_word, 0 ); // More than two cand. in sec. - if( rdo_word & Converter::MoreCandInRoI ) BitOp::setBit( &m_word, 26 ); // More than two cand. in RoI - - BitOp::sImposeNBits( &m_sector, 0, BitOp::getValue( &rdo_word, Converter::RDO_SectorAddressMask ) ); - - return; - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperRDOBarrelSector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - unsigned int Converter::HelperRDOBarrelSector::sectorID() const { - - return BitOp::getValue( &m_sector, 0x3e ); - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperRDOEndcapSector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - unsigned int Converter::HelperRDOEndcapSector::sectorID() const { - - return BitOp::getValue( &m_sector, 0x7e ); - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Functions of the Converter::HelperRDOForwardSector class // - // // - //////////////////////////////////////////////////////////////////////////////// - - unsigned int Converter::HelperRDOForwardSector::sectorID() const { - - return BitOp::getValue( &m_sector, 0x3e ); - } - - //////////////////////////////////////////////////////////////////////////////// - // // - // Output operator for helper classes // - // // - //////////////////////////////////////////////////////////////////////////////// - -std::string -Converter::HelperSector::toString() const { - - std::ostringstream output; - output << " ------ sector word ------" << std::endl; - output << " system = " << system() << std::endl; - output << " m_word = 0x" << std::hex << std::setw(8) << std::setfill('0') - << m_word << std::endl; - output << " m_sector = 0x" << std::hex << std::setw(2) << std::setfill('0') - << m_sector << std::endl; - output << " sectorID = " << std::dec << sectorID() << std::endl; - output << " sub-system = "; - if( subSystem() == Converter::HelperRoISector::A_side ) { - output << "A side" << std::endl; - } else if( subSystem() == Converter::HelperRoISector::C_side ) { - output << "C side" << std::endl; - } - output << " -------------------------"; - - return output.str(); - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.h deleted file mode 100644 index 3083a78b63ebd7895c03c2bd6dd34059d0968550..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.h +++ /dev/null @@ -1,183 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Converter.h 707664 2015-11-13 05:36:00Z ssnyder $ -#ifndef TRIGT1MUCTPI_CONVERTER_H -#define TRIGT1MUCTPI_CONVERTER_H - -// STL include(s): -#include <vector> -#include <iostream> - -// Gaudi/Athena include(s): -#include "GaudiKernel/StatusCode.h" - -// Forward declaration(s): -namespace LVL1MUONIF { - class Lvl1MuCTPIInput; -} - -namespace LVL1MUCTPI { - - /** - * @short Class that can be used to convert a Muon_ROI and MuCTPI_RDO objects into Lvl1MuCTPIInput - * - * When converting RoIs: - * First the muon RoIs should be extracted from the LVL1_ROI object into - * a vector of 'unsigned int'-s. The Converter::convertRoIs() function is - * then able to fill a Lvl1MuCTPIInput object with the data extracted from - * the RoIs. - * - * When converting the data words from MuCTPI_RDO: - * The data words can be passed to the Converter::converRDO() function - * difectly with MuCTPI_RDO::dataWord(). - * - * I've tried making it as light-weight as possible, so that it wouldn't - * depend on the rest of the actual MuCTPI simulation. - * - * @see LVL1MUONIF::Lvl1MuCTPIInput - * @see MuCTPI_RDO - * @see LVL1_ROI - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 707664 $ - * $Date: 2015-11-13 06:36:00 +0100 (Fri, 13 Nov 2015) $ - */ - class Converter { - - public: - /// This function converts the RoIs in the RoIBResult back to the input format - static StatusCode convertRoIs( const std::vector< unsigned int >& roi_vector, - LVL1MUONIF::Lvl1MuCTPIInput* muctpi_input ); - /// This function converts the data words in the RDO back to the input format - static StatusCode convertRDO( const std::vector< unsigned int >& rdo_vector, - unsigned int bcid, - LVL1MUONIF::Lvl1MuCTPIInput* muctpi_input ); - - private: - enum SectorType { Barrel, Endcap, Forward }; - static SectorType getSectorType( unsigned int sector_address ); - static unsigned int getRoISectorAddress( unsigned int roi_word ); - static bool isRoIFirstCand( unsigned int roi_word ); - - static unsigned int getRDOSectorAddress( unsigned int rdo_word ); - static unsigned int getRDOBCID( unsigned int rdo_word ); - static bool isRDOFirstCand( unsigned int rdo_word ); - - // - // The following are private, helper classes to ease the conversion: - // - - class HelperSector { - - public: - HelperSector() { m_word = 0xc7ffffff; m_sector = 0; } - HelperSector& operator= ( const HelperSector& right ); - virtual ~HelperSector() { } - - virtual void addFirst( unsigned int roi_word ) = 0; - virtual void addSecond( unsigned int roi_word ) = 0; - unsigned int sectorWord() const { return m_word; } - unsigned int sectorAddress() const { return m_sector; } - enum MuonSubSystem { A_side = 1, C_side = 0 }; - MuonSubSystem subSystem() const; - - virtual unsigned int sectorID() const = 0; - virtual std::string system() const = 0; - - std::string toString() const; - - protected: - unsigned int m_word; - unsigned int m_sector; - - }; // class HelperSector - - class HelperRoISector : public HelperSector { - - public: - virtual void addFirst( unsigned int roi_word ); - virtual void addSecond( unsigned int roi_word ); - - }; // class HelperRoISector - - class HelperRoIBarrelSector : public HelperRoISector { - - public: - virtual unsigned int sectorID() const; - virtual std::string system() const { return "Barrel"; } - - }; // class HelperRoIBarrelSector - - class HelperRoIEndcapSector : public HelperRoISector { - - public: - virtual unsigned int sectorID() const; - virtual std::string system() const { return "Endcap"; } - - }; // class HelperRoIEndcapSector - - class HelperRoIForwardSector : public HelperRoISector { - - public: - virtual unsigned int sectorID() const; - virtual std::string system() const { return "Forward"; } - - }; // class HelperRoIForwardSector - - class HelperRDOSector : public HelperSector { - - public: - virtual void addFirst( unsigned int roi_word ); - virtual void addSecond( unsigned int roi_word ); - - }; // class HelperRDOSector - - class HelperRDOBarrelSector : public HelperRDOSector { - - public: - virtual unsigned int sectorID() const; - virtual std::string system() const { return "Barrel"; } - - }; // class HelperRDOBarrelSector - - class HelperRDOEndcapSector : public HelperRDOSector { - - public: - virtual unsigned int sectorID() const; - virtual std::string system() const { return "Endcap"; } - - }; // class HelperRDOEndcapSector - - class HelperRDOForwardSector : public HelperRDOSector { - - public: - virtual unsigned int sectorID() const; - virtual std::string system() const { return "Forward"; } - - }; // class HelperRDOForwardSector - - - // - // Constants: - // - static const unsigned int RoIandOverlapMask; - static const unsigned int PtMask; - static const unsigned int RoI_SectorAddressMask; - static const unsigned int RDO_SectorAddressMask; - static const unsigned int RoI_FirstCandMask; - static const unsigned int RDO_FirstCandMask; - static const unsigned int MoreCandInRoI; - static const unsigned int MoreCandInSec; - static const unsigned int Cand1InverseMask; - static const unsigned int Cand2InverseMask; - - }; // class Converter - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_CONVERTER_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Detector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Detector.h deleted file mode 100644 index a5db3ded440a2d118d36d1dbd5341edd3e4af83f..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Detector.h +++ /dev/null @@ -1,47 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Detector.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_DETECTOR_H -#define TRIGT1MUCTPI_DETECTOR_H - -namespace LVL1MUCTPI { - - /** - ******************************************************************* - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Definition of the detector types and Hemispheres - * - * This Header file defines the different detetcor types - * and Hemispheres which exists in the Muon Trigger system - * of ATLAS - * - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - * - ******************************************************************* - */ - - /// Detector type enumeration - /** - * This enumeration is used to identify the detector type of a given muon - * candidate. The ATLAS muon system is divided into 3 parts: barrel, - * endcap and forward. - */ - enum Detector { BARREL = 0, ENDCAP = 1, FORWARD = 2 }; - /// Detector hemisphere enumeration - /** - * This enumeration is used to identify which half of the detector a given - * muon candidate is coming from. The values POSITIVE and NEGATIVE state - * the sign of eta in the given part of the detector. - */ - enum Hemisphere { POSITIVE = 1, NEGATIVE = 0 }; - -} - -#endif // TRIGT1MUCTPI_DETECTOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.cxx deleted file mode 100644 index 1054f11d4ff7e575dcc1dcbe759639305cf5ca56..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.cxx +++ /dev/null @@ -1,139 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventID.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// STL include(s): -#include <cassert> -#include <iostream> - -// Local include(s): -#include "EventID.h" -#include "EventIDSingleton.h" - -/******************************************************************* - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * Implementation of class EventID - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - EventID::EventID() { - - // get the pointer to the EventID Singleton - m_eventIDKeeper = EventIDSingleton::instance(); - if( !m_eventIDKeeper ) { - std::cout << "EventIDSingleton.Instance did not return a pointer" << std::endl; - assert( 0 ) ; - } - - } - - EventID::~EventID() { - - } - - void EventID::resetBCID() { - - m_eventIDKeeper->resetBCID(); - return; - - } - - void EventID::BCID( unsigned int newBCID ) { - - m_eventIDKeeper->BCID( newBCID ); - return; - - } - - unsigned int EventID::BCID() { - - return m_eventIDKeeper->BCID(); - - } - - void EventID::resetEvID() { - - m_eventIDKeeper->resetEvID(); - return; - - } - - void EventID::setEvID( unsigned int newID ) { - - m_eventIDKeeper->setEvID( newID ); - return; - - } - - void EventID::incrementEvID() { - - m_eventIDKeeper->incrementEvID(); - return; - - } - - unsigned int EventID::getEvID() { - - return m_eventIDKeeper->getEvID(); - - } - - unsigned int EventID::getTriggerType() { - - return m_eventIDKeeper->getTriggerType(); - - } - - void EventID::setTriggerType( unsigned int theType ) { - - m_eventIDKeeper->setTriggerType( theType ); - return; - - } - - bool EventID::getMonitorEvent() { - - return m_eventIDKeeper->getMonitorEvent(); - - } - - void EventID::setMonitorEvent( bool doMonitor ) { - - m_eventIDKeeper->setMonitorEvent( doMonitor ); - return; - - } - - unsigned int EventID::getRunNumber() { - - return m_eventIDKeeper->getRunNumber(); - - } - - void EventID::setRunNumber( unsigned int runNumber ) { - - m_eventIDKeeper->setRunNumber( runNumber ); - return; - - } - - unsigned int EventID::getECRC() { - - return m_eventIDKeeper->getECRC(); - - } - - void EventID::setECRC( unsigned int ECRC ) { - - m_eventIDKeeper->setECRC( ECRC ); - return; - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.h deleted file mode 100644 index 8cda8df3548b81bd663b42431d5801a0180a650a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.h +++ /dev/null @@ -1,109 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventID.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_EVENTID_H -#define TRIGT1MUCTPI_EVENTID_H - -namespace LVL1MUCTPI { - - class EventIDSingleton; - - /** - ************************************************************************ - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short A class which handels the EventID - * - * The EventID class can be instantiated in any object that - * needs access to the EventID. The actual EventID is kept - * in the EventIDSingleton, as their should be only one - * - * @see EventIDSingleton - * @author Thorsten Wengler - * @version $Revision: 362102 $ - * - ************************************************************************ - */ - class EventID { - - public: - /** - * The constructor - */ - EventID(); - /** - * The destructor - */ - ~EventID(); - /** - * reset the BCID to ZERO - */ - void resetBCID(); - /** - * set the BCID to newBCID - * @param newBCID the new BCID - */ - void BCID( unsigned int newBCID ); - /** - * get the BCID - * @return the BCID - */ - unsigned int BCID(); - /** - * reset the EventID to ZERO - */ - void resetEvID(); - /** - * set the EventID to newID - * @param newID the new Event ID - */ - void setEvID( unsigned int newID ); - /** - * Increment the EventID by one - */ - void incrementEvID(); - /** - * Get the current EventID - * @return the current EventID - */ - unsigned int getEvID(); - /** - * Get the trigger Type word - * @return the trigger type word - */ - unsigned int getTriggerType(); - /** - * Set the trigger Type word - * @param theType the new trigger type word - */ - void setTriggerType( unsigned int theType ); - /** - * Get the monitor Event bit - * @return if true event will be monitored, if false not - */ - bool getMonitorEvent(); - /** - * Set the monitor Event bit - * @param doMonitor if true event will be monitored, if false not - */ - void setMonitorEvent( bool doMonitor ); - - unsigned int getRunNumber(); - void setRunNumber( unsigned int runNumber ); - - unsigned int getECRC(); - void setECRC( unsigned int ECRC ); - - private: - EventIDSingleton* m_eventIDKeeper; - - }; // class EventID - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_EVENTID_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.cxx deleted file mode 100644 index 9f9755d1e1ed018979923c34f6679518180a96f4..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.cxx +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventIDSingleton.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// Local include(s): -#include "EventIDSingleton.h" - -/******************************************************************* - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * Implementation of class EventIDSingleton - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - EventIDSingleton* EventIDSingleton::m_theOnlyEventID = 0; - - EventIDSingleton::EventIDSingleton() - : m_eventID( 0 ), m_ECRC( 0 ), m_triggerType( 0 ), m_BCID( 0 ), - m_runNumber( 0 ), m_monitorEventBit( false ) { - - } - - EventIDSingleton::~EventIDSingleton() { - - } - - EventIDSingleton* EventIDSingleton::instance() { - - if ( m_theOnlyEventID == 0 ) { - m_theOnlyEventID = new EventIDSingleton(); - } - return m_theOnlyEventID; - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.h deleted file mode 100644 index a6c0b783aa4c948ccce2552a18d31f7b4ffbf535..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.h +++ /dev/null @@ -1,117 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventIDSingleton.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_EVENTIDSINGLETON_H -#define TRIGT1MUCTPI_EVENTIDSINGLETON_H - -namespace LVL1MUCTPI { - - /** - ************************************************************************ - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Keeps track of the EventID - * - * The EventIDSingleton keeps track of the EventID. It is - * implemented as a singleton, as the EventID is used in - * several places, but should only exist once. - * - * @see EventID - * @author Author: Thorsten Wengler $ - * @version $Revision: 362102 $ - * - * - ************************************************************************ - */ - class EventIDSingleton { - - public: - /** - * This is the static memember function of the Singleton, which - * instantiates the only object of EventIDSingleton. - * @return Pointer to the only instantiation of the EventIDSingleton. - */ - static EventIDSingleton* instance(); - ~EventIDSingleton(); - /** - * reset the BCID to ZERO - */ - void resetBCID() { m_BCID = 0; } - /** - * set the EventID to newBCID - * @param newBCID the new Event ID - */ - void BCID( unsigned int newBCID ) { m_BCID = newBCID; } - /** - * get the EventID to newBCID - * @return the new Event ID - */ - unsigned int BCID() { return m_BCID; } - /** - * reset the EventID to ZERO - */ - void resetEvID() { m_eventID = 0; } - /** - * set the EventID to newID - * @param newID the new Event ID - */ - void setEvID( unsigned int newID ) { m_eventID = newID; } - /** - * Increment the EventID by one - */ - void incrementEvID() { ++m_eventID; } - /** - * Get the current EventID - * @return the current EventID - */ - unsigned int getEvID() { return m_eventID; } - /** - * Get the trigger Type word - * @return the trigger type word - */ - unsigned int getTriggerType() { return m_triggerType; } - /** - * Set the trigger Type word - * @param theType the new trigger type word - */ - void setTriggerType( unsigned int theType ) { m_triggerType = theType; } - /** - * Get the monitor Event bit - * @return if true event will be monitored, if false not - */ - bool getMonitorEvent() { return m_monitorEventBit; } - /** - * Set the monitor Event bit - * @param doMonitor if true event will be monitored, if false not - */ - void setMonitorEvent( bool doMonitor ) { m_monitorEventBit = doMonitor; } - - unsigned int getRunNumber() { return m_runNumber; } - void setRunNumber( unsigned int runNumber ) { m_runNumber = runNumber; } - - unsigned int getECRC() { return m_ECRC; } - void setECRC( unsigned int ECRC ) { m_ECRC = ECRC; } - - private: - - static EventIDSingleton *m_theOnlyEventID; - - /// it's a Singleton: so the constructor is private - EventIDSingleton(); - unsigned int m_eventID; // the actual EventID - unsigned int m_ECRC; // the event counter reset counter - unsigned int m_triggerType; // the trigger type word - unsigned int m_BCID; // the BCID - unsigned int m_runNumber; // the run number - bool m_monitorEventBit; // the Monitor selector - - }; // class EventIDSingleton - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_EVENTIDSINGLETON_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.cxx deleted file mode 100644 index 1a0a0e6d0434c5ffb198e8207f90c4f31acba5e4..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.cxx +++ /dev/null @@ -1,405 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: GenTestPattern.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// STL include(s): -#include <cstdlib> -#include <ctime> -#include <iostream> -#include <fstream> - -// TrigT1 include(s): -#include "TrigT1Interfaces/Lvl1MuCTPIInput.h" - -// Local include(s): -#include "GenTestPattern.h" -#include "../Mioct/SectorID.h" -#include "MuonCandidate.h" -#include "EventID.h" - -/******************************************************************* - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * Implementation of class GenTestPattern - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // Constructor of the GenTestPattern class - GenTestPattern::GenTestPattern( LVL1MUONIF::Lvl1MuCTPIInput* theLvl1Input ) { - - m_input = theLvl1Input; - // initialize random number generator - srand( static_cast< unsigned int >( time( 0 ) ) ); - - } - - // method to directly fill sectors - void GenTestPattern::fillSectorDirect( const MuonCandidate& muonCand ) { - - // just call the fill function with all the separat arguments - this->fillSectorDirect( muonCand.secID(), muonCand.bcid(), muonCand.roi1(), muonCand.roi2(), - muonCand.ovl1(), muonCand.ovl2(), muonCand.pt1(), muonCand.pt2(), - muonCand.twoCand1(), muonCand.twoCand2(), muonCand.gtTwoCandInSec() ); - return; - - } - - - // method to directly fill sectors with candidates read from a file - void GenTestPattern::fillEventFromFile( std::string fileName ) { - - std::ifstream fileStream( fileName.c_str() ); - if ( ! fileStream ) { - std::cout << "Could not open : " << fileName << std::endl; - std::cout << "==> no candidates ! " << std::endl; - exit( -1 ); - } - - unsigned int sysID; - unsigned int subSysID; - unsigned int SectorNo; - SectorID id; - unsigned int bcid; - unsigned int roi1; - unsigned int roi2; - unsigned int ovl1; - unsigned int ovl2; - unsigned int pt1; - unsigned int pt2; - bool twoCand1; - bool twoCand2; - bool twoCandinSector; - - while ( ! fileStream.eof() ) { - - fileStream >> sysID; - fileStream >> subSysID >> SectorNo >> bcid >> roi1 >> roi2 >> ovl1 >> ovl2 - >> pt1 >> pt2 >> twoCand1 >> twoCand2 >> twoCandinSector; - - if( fileStream.eof() ) break; - this->fillSectorDirect( id.ret( sysID, subSysID, SectorNo), bcid, roi1, roi2, - ovl1, ovl2, pt1, pt2, twoCand1, twoCand2, twoCandinSector ); - - std::cout << sysID << " " << subSysID << " " << SectorNo << " " - << bcid << " " << roi1 << " " << roi2 << " " - << ovl1 << " " << ovl2 << " " << pt1 << " " << pt2 << " " - << twoCand1 << " " << twoCand2 << " " << twoCandinSector << std::endl; - - } - - return; - - } - - // method to directly fill sectors - void GenTestPattern::fillSectorDirect( SectorID theSectorID, unsigned int bcid, unsigned int roi1, unsigned int roi2, - unsigned int ovl1, unsigned int ovl2, unsigned int pt1, unsigned int pt2, - bool twoCand1, bool twoCand2, bool twoCandInSec ) { - - unsigned int systemAddress = theSectorID.getDetectorType(); - unsigned int subSystemAddress = theSectorID.getRapidityRegion(); - unsigned int id = theSectorID.getSectorNumber(); - - LVL1MUONIF::Lvl1MuSectorLogicData *secIn = 0; - if( systemAddress == 0 ) { - secIn = new LVL1MUONIF::Lvl1MuBarrelSectorLogicData(); - } else if( systemAddress == 1 ) { - secIn = new LVL1MUONIF::Lvl1MuEndcapSectorLogicData(); - } else if( systemAddress == 2 ) { - secIn = new LVL1MUONIF::Lvl1MuForwardSectorLogicData(); - } else { - std::cerr << "\"systemAddress\" is in non-defined state." << std::endl; - std::cerr << "There is very serious error with the code." << std::endl; - exit( -1 ); - } - - secIn->bcid( bcid ); - secIn->roi( 0, roi1 ); - secIn->roi( 1, roi2 ); - secIn->ovl( 0, ovl1 ); - secIn->ovl( 1, ovl2 ); - secIn->pt( 0, pt1 ); - secIn->pt( 1, pt2 ); - - if( twoCand1 ) secIn->set2candidates( 0 ); - else secIn->clear2candidates( 0 ); - - if( twoCand2 ) secIn->set2candidates( 1 ); - else secIn->clear2candidates( 1 ); - - if( twoCandInSec ) secIn->set2candidatesInSector(); - else secIn->clear2candidatesInSector(); - - m_input->setSectorLogicData( *secIn, systemAddress, subSystemAddress, id ); - - delete secIn; - return; - - } - - // Generate a random number - unsigned int GenTestPattern::randomNumber( unsigned int lower, unsigned int upper ) { - - if( lower > upper ) std::swap( lower, upper ); - double range = upper - lower + 1; - - // I already had a lot of trouble with this peace of code, - // so now I write out everything explicitly. - return ( lower + static_cast< unsigned int >( static_cast< double >( range * rand() ) / static_cast< double >( RAND_MAX + 1.0 ) ) ); - - } - - // Generate candidates randomly - MuonCandidate GenTestPattern::randomCandidate() { - - MuonCandidate rndCandidate; - - // first figure out which of Barrel, Endcap, Forward is allowed, - // choose one randomly - unsigned int systemID = 0; - unsigned int sysAllowed = this->rndRange().allowSystems(); - if( ( sysAllowed > 7 ) || ( sysAllowed < 1 ) ) sysAllowed = 7; - if( sysAllowed >= 7 ) { // all three subsystems allowed - systemID = this->randomNumber( 0, 2 ); - } else if ( ( sysAllowed > 2 ) && ( sysAllowed != 4 ) ) { // 2 out of three - systemID = this->randomNumber( 0, 1 ); // Barrel or Endcap - if( sysAllowed == 5 ) systemID = systemID * 2; // Barrel or Forward - if( sysAllowed == 6 ) ++systemID; // Endcap or Forward - } else { // only one Subsystem - if( sysAllowed == 1 ) systemID = 0; // Barrel - if( sysAllowed == 2 ) systemID = 1; // Endcap - if( sysAllowed == 4 ) systemID = 2; // Forward - } - - // Now choose the Hemisphere - unsigned int theHem; - unsigned int hemAllowed = this->rndRange().allowHemispheres(); - if( ( hemAllowed < 1 ) || ( hemAllowed > 3 ) ) hemAllowed = 3; - if( hemAllowed == 3 ) { - theHem = this->randomNumber( 0, 1 ); // both Hemispheres - } else { - theHem = hemAllowed - 1; - } - - // Now we can make all choices that depend on the system - unsigned int minRoI = 0; - unsigned int maxRoI = 0; - unsigned int minSecNumber = 0; - unsigned int maxSecNumber = 0; - if( systemID == 0 ) { - minSecNumber = this->rndRange().minBarrelSectorID(); - maxSecNumber = this->rndRange().maxBarrelSectorID(); - minRoI = this->rndRange().minBarrelRoI(); - maxRoI = this->rndRange().maxBarrelRoI(); - } else if( systemID == 1 ) { - minSecNumber = this->rndRange().minEndcapSectorID(); - maxSecNumber = this->rndRange().maxEndcapSectorID(); - minRoI = this->rndRange().minEndcapRoI(); - maxRoI = this->rndRange().maxEndcapRoI(); - } else if( systemID == 2 ) { - minSecNumber = this->rndRange().minForwardSectorID(); - maxSecNumber = this->rndRange().maxForwardSectorID(); - minRoI = this->rndRange().minForwardRoI(); - maxRoI = this->rndRange().maxForwardRoI(); - } - - - // Dial the sector number - unsigned int theSecNumber = 0; - theSecNumber = this->randomNumber( minSecNumber, maxSecNumber ); - - // now set the ID in the Muon candidate - SectorID id; - rndCandidate.secID( id.ret( systemID,theHem,theSecNumber ) ); - - // Choose Pt for both candidates (need to order them) - unsigned int firstPt = this->randomNumber( this->rndRange().minPt(), this->rndRange().maxPt() ); - unsigned int secondPt = this->randomNumber( this->rndRange().minPt(), this->rndRange().maxPt() ); - // order candidates - first is >= second - if( firstPt < secondPt ) std::swap( firstPt, secondPt ); - - // The first candidate ----------------------------------- - rndCandidate.pt1( firstPt ); //Pt value - unsigned int firstRoI = this->randomNumber( minRoI, maxRoI ); - rndCandidate.roi1( firstRoI ); // RoI value - // The Overlap flag - unsigned int firstOvl = 0; - if( systemID == 0 ) { // Barrel - // the Barrel-Barrel Overlap and Barrel-Endcap Overlap - if( firstRoI <= 2 || ( firstRoI % 2 != theSecNumber % 2 ) ) firstOvl |= 1; - if( firstRoI >= 20 ) firstOvl |= 2; - } else if( systemID == 1 ) { // Endcap - if( firstRoI <= 7 ) firstOvl |= 1; // Barrel-Endcap Overlap - } else if( systemID == 2 ) { // Forward - // no overlap in forward sectors possible - } - rndCandidate.ovl1( firstOvl ); - // is it allowed to pretend that there were > 1 candiates in one pad? - bool twoInPad1 = false; - if( this->rndRange().allowForceGT1InPad1Flag() == 1 ) { // random - if( this->randomNumber( 0, 1 ) == 1 ) twoInPad1 = true; - } else if( this->rndRange().allowForceGT1InPad1Flag() == 2 ) { // always set - twoInPad1 = true; - } - rndCandidate.twoCand1( twoInPad1 ); - // end choosing first candidate - - // Now decide if there will be a second candidate - bool iWantTwo = false; - if( this->rndRange().allowForce2Cand() == 1 ) { // one or two randomly - if( this->randomNumber(0,1) == 1 ) iWantTwo = true; - } else if( this->rndRange().allowForce2Cand() == 2 ) { // always 2 - iWantTwo = true; - } - - if( iWantTwo ) { - - // The second candidate ----------------------------------- - rndCandidate.pt2( secondPt ); //Pt value - unsigned int secondRoI; // second RoI (should be diff. from first) - while( ( secondRoI = this->randomNumber( minRoI, maxRoI ) ) == firstRoI ) - ; - rndCandidate.roi2( secondRoI ); // RoI value - // The Overlap flag - unsigned int secondOvl = 0; - if( systemID == 0 ) { // Barrel - // the Barrel-Barrel Overlap and Barrel-Endcap Overlap - if( secondRoI <= 2 || ( secondRoI % 2 != theSecNumber % 2 ) ) secondOvl |= 1; - if( secondRoI >= 20 ) secondOvl |= 2; - } else if( systemID == 1 ) { // Endcap - if( secondRoI <= 7 ) secondOvl |= 1; // Barrel-Endcap Overlap - } else if( systemID == 2 ) { // Forward - // no overlap in forward sectors possible - } - rndCandidate.ovl2( secondOvl ); - // is it allowed to pretend that there were > 1 candiates in one pad? - bool twoInPad2 = false; - if( this->rndRange().allowForceGT1InPad2Flag() == 1 ) { // random - if( this->randomNumber( 0, 1 ) == 1) twoInPad2 = true ; - } else if( this->rndRange().allowForceGT1InPad2Flag() == 2 ) { // always - twoInPad2 = true; - } - rndCandidate.twoCand2( twoInPad2 ); - - // since we have two candidates, we can decide if we want to pretend - // there were more than 2 in this sector - bool gtTwoInSec = false; - if( this->rndRange().allowForceGT2InSecFlag() == 1 ) { // random - if( this->randomNumber( 0, 1 ) == 1 ) gtTwoInSec = true; - } else if( this->rndRange().allowForceGT2InSecFlag() == 2 ) { // always - gtTwoInSec = true; - } - rndCandidate.gtTwoCandInSec( gtTwoInSec ); - - } // end second candidate - - // set the BCID - EventID theEventID; // get access to the EventID singleton - rndCandidate.bcid( theEventID.BCID() ); - - return rndCandidate; - - } - - // check if a generated candidate already exists in the list - bool GenTestPattern::notUniqueCandidate( MuonCandidate& muonCand ) { - - bool isNotUnique = false; - - // iterate over the list and check the sector ID's - if( ! m_candidateList.empty() ){ // is the list still empty? - std::list< MuonCandidate >::const_iterator it; - for( it = m_candidateList.begin(); it != m_candidateList.end(); ++it ) { - if( it->secID() == muonCand.secID() ) isNotUnique = true; - } - } - - return isNotUnique; - - } - - // Generate a random event - void GenTestPattern::randomEvent( unsigned int lowCand, unsigned int highCand ) { - - // get access to the EventID singleton - EventID theEventID; - - // reset the event holders - this->clearEvent(); - - // get the BCID for this event - theEventID.BCID( this->randomNumber( this->rndRange().minBCID(), this->rndRange().maxBCID() ) ); - - unsigned int numberOfCand = this->randomNumber( lowCand, highCand ); - - for( unsigned int i = 0; i < numberOfCand; ++i ) { - MuonCandidate muonCand; - do { // need to check that cand. is unique in this event - muonCand = this->randomCandidate(); - } while( this->notUniqueCandidate( muonCand ) ); - m_candidateList.push_back( muonCand ); - } - - return; - - } - - // Generate one complete event and fill it into the input class(es) - void GenTestPattern::generateEvent( unsigned int lowCand, unsigned int highCand ) { - - // generate the Event - this->randomEvent( lowCand, highCand ); - - // fill the event into the Sector logic input class - if( m_candidateList.empty() ) { // is the list still empty? - std::cout << " --- TRIED TO FILL EMPTY EVENT --- " << std::endl; - } else { - std::list< MuonCandidate >::iterator it ; - for( it = m_candidateList.begin(); it != m_candidateList.end(); ++it ) { - this->fillSectorDirect( (*it) ) ; - } - } - - return; - - } - - // print the random event - void GenTestPattern::printRandomEvent() { - - // iterate over the list and check the sector ID's - if( m_candidateList.empty() ){ // is the list still empty? - std::cout << " --- TRIED TO PRINT EMPTY EVENT --- GENERATE ONE FIRST --- " << std::endl; - } else { - std::list< MuonCandidate >::const_iterator it; - for( it = m_candidateList.begin(); it != m_candidateList.end(); ++it ) { - std::cout << ( *it ); - } - } - - return; - - } - - // Clear the list of sectors - void GenTestPattern::clearEvent() { - - m_input->clearAll(); - m_candidateList.clear(); - - return; - - } - - - // Destructor of the GenTestPattern class - nothing to destruct - GenTestPattern::~GenTestPattern() { - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.h deleted file mode 100644 index aa8ed7bff7441272529fd33bde3563c6cfb2f94d..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.h +++ /dev/null @@ -1,180 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: GenTestPattern.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_GENTESTPATTERN_H -#define TRIGT1MUCTPI_GENTESTPATTERN_H - -// STL include(s): -#include <string> -#include <list> - -// Local include(s): -#include "MuonCandidate.h" -#include "RandomCandidateRange.h" - -// Forward declaration(s): -namespace LVL1MUONIF { - class Lvl1MuCTPIInput; -} - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class SectorID; - - /** - ******************************************************************* - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Generate Sector Logic test input - * - * This class is used to generate test input data using - * the Lvl1MuCTPIInput interface class from the - * Sector Logic simulation. The constructor receives - * a reference to a Lvl1MuCTPIInput object, which is - * then filled using the Lvl1MuCTPIInput member - * functions. - * - * @see Lvl1MuCTPIInput - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - * - ******************************************************************* - */ - class GenTestPattern { - - public: - /** - * The only constructor of the GenTestPattern class takes a - * reference to an Lvl1MuCTPIInput object, which is to be filled - * by the test pattern - * @param theLvl1Input The Sector Logic input object to be filled with a test pattern - * @see Lvl1MuCTPIInput - */ - GenTestPattern( LVL1MUONIF::Lvl1MuCTPIInput* theLvl1Input ); - /** - * Set the sector by hand. The internal sector list is not used here - * but the sector is written to the Lvl1MuCTPIInput directly. There - * is no need to call putEvent after this. - * - * @param theSectorID The ID of the sector to be filled - * @param bcid The BC ID - * @param roi1 Id of RoI candidate 1 - * @param roi2 Id of RoI candidate 1 - * @param ovl11 Overlay candidate 1 - * @param ovl12 Overlay candidate 2 - * @param pt1 momentum candidate 1 - * @param pt2 momentum candidate 2 - * @param twoCand1 more than one cand in pad candidate 1 - * @param twoCand2 more than one cand in pad candidate 2 - * @param twoCandInSec more than two candiates in sector - * - * @see GenTestPattern::putEvent() - */ - void fillSectorDirect( SectorID theSectorID, - unsigned int bcid, - unsigned int roi1, - unsigned int roi2, - unsigned int ovl11, - unsigned int ovl12, - unsigned int pt1, - unsigned int pt2, - bool twoCand1, - bool twoCand2, - bool twoCandInSec ); - /** - * Set the event by reading a list of single muon candidates from a - * file. This is usefule for tests which require frequent changes in - * candidate settings, as one does not need to recompile. The - * internal sector list is not used here but the sector is written - * to the Lvl1MuCTPIInput directly. There is no need to call - * putEvent after this. The file has the following format for each - * candidate (one line per candidate): - * sys-ID subSys-ID Sector-No bcid roi1 roi2 ovl1 ovl2 pt1 pt2 - * twoCand1 twoCand2 twoCandinSector - * - * @param fileName name of the file holding the candidates - */ - void fillEventFromFile( std::string fileName ); - /** - * second version of direct filler with a MuonCandidate Object - * as input - * @param muonCand the input candidate - */ - void fillSectorDirect( const MuonCandidate& muonCand ); - /** - * method to return the object holding the Range definitions - * for the random generation of muon candidates - * @return m_RandomMuonCandidateRange; - */ - RandomCandidateRange& rndRange() { return m_RandomMuonCandidateRange; } - /** - * Reinitialize the random number generator with a new seed - * @param newSeed The new random number seed - */ - static void reSeedRandomNumbers( unsigned int newSeed ){ srand( newSeed ); } - /** - * method to randomly generate a muon candidate. - */ - MuonCandidate randomCandidate(); - /** - * Check if a given Muon candidate already exists in the list - * of candidates data memeber - * @param muonCand the candidate to be checked - * @return true if the candidate already exists - */ - bool notUniqueCandidate( MuonCandidate & muonCand ); - /** - * Generate one random Event and fill it into the candidate list - * data memeber - * @param lowCand at least this many candidates - * @param highCand at most this many candidates - */ - void randomEvent( unsigned int lowCand, unsigned int highCand ); - /** - * this is the main event generation method - */ - void generateEvent( unsigned int lowCand, unsigned int highCand ); - /** - * print the event generated by randomEvent - */ - void printRandomEvent(); - /** - * Clear the input object of the sector logic of all - * entries - */ - void clearEvent(); - /** - * The destructor of the GenTestPattern class - - * nothing to destruct - */ - ~GenTestPattern(); - - protected: - - /** - * method to generate a random integer number between the lower and - * the upper bound - * @param lower Lower bound of Random number range - * @param upper Upper bound of Random number range - * @return random number - */ - static unsigned int randomNumber( unsigned int lower, unsigned int upper ); - - private: - - LVL1MUONIF::Lvl1MuCTPIInput* m_input; - std::list< MuonCandidate > m_candidateList; - - RandomCandidateRange m_RandomMuonCandidateRange; - - }; // class GenTestPattern - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_GENTESTPATTERN_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.cxx deleted file mode 100644 index ccf0b3abd72072b8b12b47be76cf73157463059b..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.cxx +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - - -#include "MioctL1TopoConverter.h" - -namespace LVL1MUCTPI { - - MioctL1TopoConverter::MioctL1TopoConverter( ): m_logger( "MioctL1TopoConverter" ){ - - } - - MioctL1TopoConverter::~MioctL1TopoConverter() { - - } - - - - void MioctL1TopoConverter::setupParser(const std::string & inputfile) { - m_xmlParser.readConfiguration(inputfile); - m_xmlParser.parseConfiguration(); - } - - LVL1::MuCTPIL1TopoCandidate MioctL1TopoConverter::convertToL1Topo(const MioctID& mioctModuleID, const Sector& sector, bool isFirstCandidate) { - LVL1::MuCTPIL1TopoCandidate l1topoCand; - - //check variable to make sure a match was found, otherwise issue warning - bool foundRoiMatch = false; - - // check varialble to make sure the TopoCell info is found for the RoI - bool foundTopoCellMatch = false; - - - // get access to the MuCTPI geometry and Pt encoding from Parser - MuCTPiGeometry muctpiGeo = m_xmlParser.getMuCTPiGeometry(); - L1MuonPtEncoding ptEnc = muctpiGeo.ptEncoding(); - - //Note in MioctModule terms we have: neg hemisphere / mod ID 0-7 and pos hemisphere / mod ID 0-7 - //While from the parser we have mod ID 0-15, with 0-7 in neg hemisphere, and 8-15 in pos hemisphere - unsigned int mioctModNumber=0; - - if (mioctModuleID.getRapidityRegion() == NEGATIVE){ - mioctModNumber = mioctModuleID.getNumber(); - } else if (mioctModuleID.getRapidityRegion() == POSITIVE){ - mioctModNumber = mioctModuleID.getNumber() + 8; - } else { - REPORT_ERROR_MSG("Unknown Hemisphere description"); - } - - //Loop over Miocts to get the right one - std::vector<MioctGeometry> mioctVec = muctpiGeo.octants(); - MioctGeometry thisMioctGeo; - - for ( std::vector<MioctGeometry>::iterator it = mioctVec.begin(); it != mioctVec.end(); ++it){ - if (it->mioctId() == mioctModNumber){ - thisMioctGeo=(*it); - break; - } - } - - // Loop over the sectors in this Mioct to get the right one - std::vector<MioctSectorGeometry> mioctSecVec = thisMioctGeo.sectors(); - std::vector<MioctTopoCellGeometry> topCellVec = thisMioctGeo.topoCells(); - MioctSectorGeometry thisMioctSecGeo; - - for (std::vector<MioctSectorGeometry>::iterator it = mioctSecVec.begin(); it != mioctSecVec.end(); ++it){ - if (it->name() == sector.getIDString()) { - thisMioctSecGeo = (*it); - break; - } - } - - // pick candidate one or two from input sector - unsigned int inputPt; - unsigned int inputRoi; - if (isFirstCandidate) { - inputPt = sector.getPtCand1(); - inputRoi = sector.getROI1(); - } else { - inputPt = sector.getPtCand2(); - inputRoi = sector.getROI2(); - } - // Find the right ROI in the Geometry - std::vector<MioctROIGeometry> mioctRoiGeo = thisMioctSecGeo.ROIs(); - MioctROIGeometry thisRoi; - // Loop over the RoIs in this sector to find the right one and get the equivalent eta/phi etc - for ( std::vector<MioctROIGeometry>::iterator it = mioctRoiGeo.begin(); it != mioctRoiGeo.end(); ++it) { - if (it->roiid() == inputRoi){ - foundRoiMatch =true; - thisRoi = (*it); - break; - } - } - - int thisieta = 0; - int thisiphi = 0; - - if (!foundRoiMatch) { - REPORT_MSG(LVL1MUCTPI::WARNING,"No RoI match found for Sector: " << sector.getIDString() << " RoI: " << inputRoi << " in MioctL1TopoConverter, returning 0 for eta/phi" << std::endl) - } - else { - // now loop over the topocell info and find the ieta and iphi values for this RoI - - for ( std::vector<MioctTopoCellGeometry>::iterator it = topCellVec.begin(); it != topCellVec.end(); ++it) { - if (it->etacode() == thisRoi.etacode() && it->phicode() == thisRoi.phicode() ){ - thisieta = it->ieta(); - thisiphi = it->iphi(); - foundTopoCellMatch = true; - break; - } - } - } - - if (!foundTopoCellMatch) { - REPORT_MSG(LVL1MUCTPI::WARNING,"No TopoCell match found for Sector: " << sector.getIDString() << " RoI: " << inputRoi << " in MioctL1TopoConverter, returning 0 for ieta/iphi" << std::endl) - } - - - // get the Pt encoding - unsigned int ptCode = 0; - unsigned int thresholdValue = 0; - ptEnc.getCodingInfo( inputPt-1, ptCode, thresholdValue ); - - // Now fill all the information into the output object - l1topoCand.setCandidateData(sector.getIDString(), inputRoi, sector.getBCID(), inputPt, ptCode, thresholdValue, - thisRoi.eta(), thisRoi.phi(), thisRoi.etacode(), thisRoi.phicode(), - thisRoi.etamin(), thisRoi.etamax(), thisRoi.phimin(), thisRoi.phimax(), mioctModNumber, - thisieta, thisiphi ); - - return l1topoCand; - } - - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.h deleted file mode 100644 index 216888744e61549f7190a6c37ca930c4c8006489..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.h +++ /dev/null @@ -1,50 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TRIGT1MUCTPI_MIOCTL1TOPOCONVERTER_H -#define TRIGT1MUCTPI_MIOCTL1TOPOCONVERTER_H - - -// Local include(s): -#include "../Mioct/Sector.h" -#include "../Mioct/MioctID.h" -#include "../Logging/MsgLogger.h" -#include "TrigT1Interfaces/MuCTPIL1TopoCandidate.h" -#include "TrigConfMuctpi/MuctpiXMLParser.h" - -namespace LVL1MUCTPI { - - /** - * @short Convert candidates of a Mioct to L1Topo output via NIM - * - * This is a converter class that takes the candidates within - * a Mioct and creates the outputs plus decoding for L1Topo - * - * $author Thorsten Wengler - * - */ - class MioctL1TopoConverter { - - public: - //constructor - MioctL1TopoConverter(); - ~MioctL1TopoConverter(); - - void setupParser(const std::string & inputfile); - - //Aquire the muon candidates of this mioct after overlap handling and vetos - LVL1::MuCTPIL1TopoCandidate convertToL1Topo(const MioctID& mioctModuleID, const Sector& sector, bool isFirstCandidate); - - - private: - mutable MsgLogger m_logger; - MuctpiXMLParser m_xmlParser; - - }; // class MioctL1TopoConverter - -} // namespace LVL1MUCTPI - - #endif // TRIGT1MUCTPI_MIOCTL1TOPOCONVERTER_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiBitMasks.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiBitMasks.h deleted file mode 100644 index 165cd397ad17e00e39c22bc236bdcef6d01f52a0..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiBitMasks.h +++ /dev/null @@ -1,173 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MuctpiBitMasks.h 700318 2015-10-13 14:13:15Z wengler $ -#ifndef TRIGT1MUCTPI_MUCTPISECTORBITMASKS_H -#define TRIGT1MUCTPI_MUCTPISECTORBITMASKS_H - -namespace LVL1MUCTPI { - - enum BitMask { - // masks equal for all input data words - SectorOverflowMask = 0x00000001, - Pt1Mask = 0x00380000, - Pt2Mask = 0x01c00000, - Pt1and2Mask = 0x01f80000, - ROI1OverflowMask = 0x02000000, - ROI2OverflowMask = 0x04000000, - BCIDMask = 0x38000000, - Candidate1Sign = 0x40000000, - Candidate2Sign = 0x80000000, - // Barrel specific constants - BarrelROI1Mask = 0x0000003e, - BarrelBarrelOverlap1Mask = 0x00000100, - BarrelEndcapOverlap1Mask = 0x00000200, - BarrelROI2Mask = 0x00007c00, - BarrelBarrelOverlap2Mask = 0x00020000, - BarrelEndcapOverlap2Mask = 0x00040000, - BarrelReservedMask = 0xC00180C0, - // Endcap specific masks - EndcapROI1Mask = 0x000001fe, - EndcapBarrelOverlap1Mask = 0x00000200, - EndcapROI2Mask = 0x0003fc00, - EndcapBarrelOverlap2Mask = 0x00040000, - EndcapReservedMask = 0x06000000, - // Forward specific masks - ForwardROI1Mask = 0x0000007e, - ForwardROI2Mask = 0x0000fc00, - ForwardReservedMask = 0x06070380, - // MIOCT --------------------------------------------------------- - // Data flow marker on the MIBAK - MioctStartMask = 0x0000000e, - MioctEndMask = 0x0000000f, - // MICTP --------------------------------------------------------- - // The ID of the MICTP - MictpIDMask = 0x0000000f, - MictpIDPositionMask = 0xf0000000, - // The position of the event ID in the MICTP start word - MictpEvIDMask = 0x00ffffff, - // The position of the bunch ID, trigger type, monitr bit - // in the MICTP second word - MictpECRCMask = 0x000ff000, - MictpBcIDMask = 0x00000fff, - MictpECRCBcIDMask = 0x000fffff, - MictpTrTypeMask = 0x0ff00000, - MictpMonitorMask = 0x10000000, - // position of values in the MICTP data word - MictpSum1Mask = 0x00000007, - MictpSum2Mask = 0x00000038, - MictpSum3Mask = 0x000001c0, - MictpSum4Mask = 0x00000e00, - MictpSum5Mask = 0x00007000, - MictpSum6Mask = 0x00038000, - MictpTrailerSum1Mask = 0x00001c00, - MictpTrailerSum2Mask = 0x0000e000, - MictpTrailerSum3Mask = 0x00070000, - MictpTrailerSum4Mask = 0x00380000, - MictpTrailerSum5Mask = 0x01c00000, - MictpTrailerSum6Mask = 0x0e000000, - MictpTrailerFlagsMask = 0x00000380, - MictpTrailerWordsMask = 0x0000007f, - // The position of module number, eventID, BCID in MIOCT start word - MioctMNBRMask = 0xf0000000, - MioctEvIDMask = 0x0ffff000, - MioctBcIDMask = 0x00000fff, - // The Event Reader ----------------------------------------------- - // position of values in EventFifo - EvReEvIDMask = 0x00ffffff, - EvReBcIDMask = 0x00000fff, - EvReNoWordsMask = 0x00ffe000, - EvReMonitorMask = 0x00001000, - EvReTrTypeMask = 0x00000ff0, - EvReStatusMask = 0x0000000f, - // Sector Address coding in EventReader Format - EvReSecAddressSystemMask = 0x000000c0, - EvReSecAddressSubSysMask = 0x00000001, - EvReSecNumberBarrelMask = 0x0000003e, - EvReSecNumberEndcapMask = 0x0000007e, - EvReSecNumberForwardMask = 0x0000003e, - // RoI and Overlap coding in Barrel, Endcap and Forward - EvReBarrelRoIMask = 0x0000001f, - EvReBarrelOvlMask = 0x00000180, - EvReEndcapRoIMask = 0x000000ff, - EvReEndcapOvlMask = 0x00000100, - EvReForwardRoIMask = 0x0000003f, - // The Extractor -------------------------------------------------- - // position of values in the Extractor header - ExtrHeaderEvID = 0x00ffffff, - ExtrHeaderBcID = 0x00000fff, - ExtrHeaderECRC = 0x000ff000, - ExtrMonitorMask = 0x00001000, - ExtrTrTypeMask = 0x00000ff0, - ExtrStatusMask = 0x0000000f, - // position of values in MICTP word in Extractor format - ExtrSum1Mask = 0x00000007, - ExtrSum2Mask = 0x00000038, - ExtrSum3Mask = 0x000001c0, - ExtrSum4Mask = 0x00000e00, - ExtrSum5Mask = 0x00007000, - ExtrSum6Mask = 0x00038000, - ExtrMictpBCIDMask = 0x001c0000, - // position of values in Extrotor Trailer word - ExtrCandCountMask = 0x000ffe00, - ExtrThresh1Mask = 0x000001c0, - ExtrThresh2Mask = 0x00000038, - Extr1stCandSupprMask = 0x00000004, - Extr2ndCandSupprMask = 0x00000002, - ExtrEitherCandSupprMask = 0x00000001, - // position of all the single values in the Extractor data format - ExtrPassedMask = 0x04000000, - ExtrFirstCandMask = 0x02000000, - ExtrSectorAddressMask = 0x01fe0000, - ExtrBCIDMask = 0x0001c000, - ExtrPtValueMask = 0x00003800, - ExtrRoIOvlMask = 0x000007fc, - ExtrPadOverflowMask = 0x00000002, - ExtrSectorOverflowMask = 0x00000001, - // position of RoI + Overlap candidate 1 and 2 - RoIOvl1Mask = 0x000003fe, - RoIOvl2Mask = 0x0007fc00, - // position of thresholds, reject bits in trailer of Extractor - ExtrThresholdOneMask = 0x000001c0, - ExtrThresholdSecondMask = 0x00000038, - ExtrSuppressedFirstMask = 0x00000004, - ExtrSuppressedSecondMask = 0x00000002, - ExtrSuppressedEitherMask = 0x00000001, - // Charge: - ExtrCandidateSign = 0x08000000, - // MirodDaqProcessor --------------------------------------------- - DaqHeaderStartMask = 0xee1234ee, - DaqHeaderSizeMask = 0x00000009, - DaqHeaderFormatMask = 0x03000000, - DaqHeaderDetIDMask = 0x00760000, - DaqHeaderLvl1IDMask = 0x00ffffff, - DaqHeaderBcIDMask = 0x00000fff, - DaqHeaderTrTypeMask = 0x000000ff, - DaqTrailerCandMask = 0x0000000f, - // MirodLvl2Processor -------------------------------------------- - Lvl2HeaderStartMask = 0xee1234ee, - Lvl2HeaderSizeMask = 0x00000009, - Lvl2HeaderFormatMask = 0x03000000, - Lvl2HeaderDetIDMask = 0x00760001, - Lvl2FirstCandMask = 0x00400000, - Lvl2SectorAddressMask = 0x003fc000, - Lvl2PtValueMask = 0x00003800, - Lvl2RoIOvlMask = 0x000007fc, - Lvl2PadOverflowMask = 0x00000002, - Lvl2SectorOverflowMask = 0x00000001, - Lvl2SecAddressStartBit = 14, - Lvl2BarrelRoIMask = 0x0000001f, - Lvl2BarrelOvlMask = 0x00000180, - Lvl2EndcapRoIMask = 0x000000ff, - Lvl2EndcapOvlMask = 0x00000100, - Lvl2ForwardRoIMask = 0x0000003f, - Lvl2CandidateSign = 0x00800000 - - }; // enum BitMask - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MUCTPISECTORBITMASKS_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.cxx deleted file mode 100644 index 966f410bb0fe3c4b10154aef1f6427daf94ef92c..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.cxx +++ /dev/null @@ -1,318 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MuctpiSim.cxx 726107 2016-02-25 11:04:42Z wengler $ - -// STL include(s): -#include <cassert> -#include <iomanip> -#include <sstream> -#include <ostream> - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// TrigT1 include(s): -#include "TrigT1Interfaces/Lvl1MuCTPIInput.h" - -// Local include(s): -#include "MuctpiSim.h" -#include "Configuration.h" -#include "BitOp.h" -#include "../Mioct/EventReader.h" -#include "../Mioct/EventReaderFactory.h" -#include "../Mioct/SectorLogicSource.h" -#include "../Mioct/SectorLogicReader.h" -#include "MuctpiBitMasks.h" - -/******************************************************************* - * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $ - * - * Implementation of class MuctpiSim - * @author $Author: krasznaa $ - * @version $Revision: 726107 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor of class MuctpiSim - MuctpiSim::MuctpiSim() - : m_logger( "MuctpiSim" ) { - - // make a dummy input object used to initialise - m_muctpiInput = new LVL1MUONIF::Lvl1MuCTPIInput(); - - // install the SectorLogic Reader as EventReader (it is the - // default one - otherwise controlled via environment variable - m_theReader = EventReaderFactory::getEventReader(); - if( ! m_theReader ) { - REPORT_FATAL_MSG( "no valid Reader -> can't continue" ); - assert( 0 ); - } - - // Now take take the Lvl1MuCTPIInput object and declare it to - // be the EventSource - m_theSource = new SectorLogicSource(); - m_theSource->setSectorLogicSource( m_muctpiInput ); - - // Now give this source to the Event Reader, so it knows where to - // read the events from - m_theReader->setEventSource( *m_theSource ); - REPORT_MSG(DEBUG, m_theReader->getInfoString() ); - // now create the Lvl1Mibak object, which in turn will create - // the Octant modules and sectors, which will register themselves - // with the Reader - m_mibak = new Lvl1Mibak( m_theReader ); - m_mibak->setZeroSuppression( true ); - REPORT_MSG(DEBUG, m_theReader->getInfoString() ); - } - - // process method of class MuctpiSim - void MuctpiSim::processData( const LVL1MUONIF::Lvl1MuCTPIInput* currentInput, int bcidOffset ) { - - // Print the input to the simulation: - REPORT_VERBOSE_MSG( "Start processing event with input from sector logics:\n" ); - REPORT_VERBOSE_MSG( *currentInput ); - - // set the input source to the current input object passed - // as an argument - first get the EventSource, then change - // what it is pointing to - SectorLogicReader* sl_Reader = dynamic_cast< SectorLogicReader* >( m_theReader ); - if( ! sl_Reader ) { - REPORT_FATAL_MSG( "The EventReader is apparently not a SectorLogicReader. How come?" ); - assert( 0 ); - } - sl_Reader->getSource().setSectorLogicSource( currentInput ); - sl_Reader->getSource().setBcidOffset( bcidOffset ); - - // read the event currently held in the input object - m_theReader->putNextEvent(); - - // set the MICTP data - has to be done first - m_mibak->setMictpData(); - - // do the processing in the Mirod - m_mibak->mirodProcessData(); - - return; - } - - - LVL1::MuCTPIL1Topo MuctpiSim::getL1TopoData() { - - // get the L1Topo candidates - LVL1::MuCTPIL1Topo l1topo = m_mibak->getL1TopoCandidates(m_L1TopoConv); - std::vector<LVL1::MuCTPIL1TopoCandidate> l1topoCandVec = l1topo.getCandidates(); - - // now get the output formatted for LVL2 - std::list<unsigned int> lvl2OutCand = getRoIBCandidates(); - - // loop and match - for (std::list< unsigned int >::iterator it_l2Cand = lvl2OutCand.begin(); - it_l2Cand != lvl2OutCand.end(); ++it_l2Cand) { - - - std::string system; - std::string hemisphere = "-"; - unsigned int sectorNumber = 0; - unsigned int regionOfInterest = 0; - //offset for differnt counting scheme in MuCTPI geometry file for L1Topo - unsigned int offset =0; - unsigned int sectorWord = ( * it_l2Cand); - - // get the address values out of the bit mask - const unsigned int sectorAddress = - BitOp::getValue( §orWord, Lvl2SectorAddressMask ); - const unsigned int sectorRoIOvl = BitOp::getValue( §orWord, Lvl2RoIOvlMask ); - - // get the Hemisphere - if ( BitOp::getValue( §orAddress, EvReSecAddressSubSysMask ) == 1 ) { - hemisphere = "+"; - } - - - // sector address and RoI and Overlap must be taken apart agin - // to extract the readable information - // first find out if this is Barrel, endcap, forward, get sector - // number, RoI and Overlap information - if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) == 0 ) { - system = "B"; // Barrel - if (hemisphere == "+") { - offset = 32; - } - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberBarrelMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, Lvl2BarrelRoIMask ); - } else if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) == 1 ) { - if (hemisphere == "+") { - system = "FA"; - } else { - system = "FC"; - } - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberForwardMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, Lvl2ForwardRoIMask ); - } else if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) > 1 ) { - if (hemisphere == "+") { - system = "EA"; - } else { - system = "EC"; - } - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberEndcapMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, Lvl2EndcapRoIMask ); - } - - std::string secNumString = ""; - if (sectorNumber+offset < 10) { - secNumString = "0" + std::to_string(sectorNumber + offset); - } else { - secNumString = std::to_string(sectorNumber + offset); - } - - system = system + secNumString ; - - for (std::vector<LVL1::MuCTPIL1TopoCandidate>::iterator it_topoCand = l1topoCandVec.begin(); - it_topoCand != l1topoCandVec.end(); ++it_topoCand) { - - - // std::cout << "TW:" << system << " | " << it_topoCand->getSectorName() << " | " << regionOfInterest << " | " << it_topoCand->getRoiID() << std::endl; - - if (system == it_topoCand->getSectorName() && regionOfInterest == it_topoCand->getRoiID() ) { - // match has been made, fill the roiWord into the candidate object - it_topoCand->setRoiWord(sectorWord); - // std::cout << "TW match: Addr: " << system << " : " << hemisphere << system << " " - // << std::setw( 2 ) << std::dec << sectorNumber - // << " Pt/RoI: " << ptValue - // << " " << std::setw( 2 ) << regionOfInterest - // << " Ovl: " << overlap - // << " pad/secOF: " << std::setw( 2 ) << padOverflow - // << std::setw( 2 ) << sectorOverflow - // << " First: " << candFirst - // << " veto: " << veto << std::endl; - - // it_topoCand->print(); - break; - } - - } - } - - l1topo.setCandidates(l1topoCandVec); - return l1topo; - -} - - - /** - * The call is just forwarded to the MIBAK object, even though that's not the - * hardware that implements this logic in real life... - * - * @returns <code>true</code> if any of the octant boards saw a barrel candidate, - * <code>false</code> otherwise - */ - bool MuctpiSim::hasBarrelCandidate() const { - - return m_mibak->hasBarrelCandidate(); - } - - /** - * The call is just forwarded to the MIBAK object, even though that's not the - * hardware that implements this logic in real life... - * - * @returns <code>true</code> if any of the octant boards saw an endcap candidate, - * <code>false</code> otherwise - */ - bool MuctpiSim::hasEndcapCandidate() const { - - return m_mibak->hasEndcapCandidate(); - } - - // print method for the CTP output word - void MuctpiSim::printCTPOut( std::string format ) { - - unsigned int CTPword = this->getCTPData(); - std::ostringstream message; - - if( format == "hex" ) { - message << std::hex << std::setw( 8 ) << CTPword; - } else if ( format == "bin" ) { - std::string ctpWordString; - BitOp::printBin( CTPword, ctpWordString ); - message << ctpWordString; - } else if ( format == "human" ) { - message << " =============================== CTP word =========" - << "=========================" << std::endl; - message << " PtSum6: " << BitOp::getValue( &CTPword, MictpSum6Mask ) - << " PtSum5: " << BitOp::getValue( &CTPword, MictpSum5Mask ) - << " PtSum4: " << BitOp::getValue( &CTPword, MictpSum4Mask ) - << " PtSum3: " << BitOp::getValue( &CTPword, MictpSum3Mask ) - << " PtSum2: " << BitOp::getValue( &CTPword, MictpSum2Mask ) - << " PtSum1: " << BitOp::getValue( &CTPword, MictpSum1Mask ) - << std::endl; - message << " ==================================================" - << "========================="; - } - - REPORT_MSG(DEBUG, message.str() ); - - return; - } - - // print method for the Lvl2 Output list - void MuctpiSim::printLvl2Out( std::string format ) { - - MirodLvl2Processor serviceLvl2( this->getRoIBData() ); - serviceLvl2.printEvent( format ); - return; - } - - // print method for the DAQ output list - void MuctpiSim::printDAQOut( std::string format ) { - - MirodDaqProcessor serviceDaq( this->getDAQData() ); - serviceDaq.printEvent( format ); - return; - } - - //get the content of the MirodFiFos as an object - MirodFiFoContent MuctpiSim::getMirodFiFoContent() { - - MirodFiFoContent mirodFiFos; - - mirodFiFos.monFiFo( *( this->getMirodModule()->getMirodExtractor()->getExtractorData() ) ); - mirodFiFos.lvl2FiFo( this->getRoIBData() ); - mirodFiFos.daqFiFo( this->getDAQData() ); - - return mirodFiFos; - } - - // set Configuration - void MuctpiSim::setConfiguration ( const Configuration &conf ) { - - // set MIROD via MIBAK - m_mibak->setConfiguration( conf ); - return; - } - - StatusCode MuctpiSim::initializeLUTOverlapStrategy( const std::string& lutXMLFile, - bool flagMode, bool dumpLut, - const std::string& runPeriod ) { - - CHECK( m_mibak->initializeLUTOverlapStrategy( lutXMLFile, flagMode, - dumpLut, runPeriod ) ); - return StatusCode::SUCCESS; - } - - //destructor of class MuctpiSim - MuctpiSim::~MuctpiSim() { - - // the order of destruction matters, as the sectors destructing - // themselves as part of the Lvl1Mibak destructor contact the - // EventReader to unregister themselves first - for this the - // EventReader must still be present - delete m_mibak; - delete m_theSource; - delete m_theReader; - delete m_muctpiInput; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.h deleted file mode 100644 index 88e16ec110c7e87e13d0fbf9f849084885ac9cf7..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.h +++ /dev/null @@ -1,205 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MuctpiSim.h 726107 2016-02-25 11:04:42Z wengler $ -#ifndef TRIGT1MUCTPI_MUCTPISIM_H -#define TRIGT1MUCTPI_MUCTPISIM_H - -// STL include(s): -#include <list> -#include <string> - -// Gaudi/Athena include(s): -#include "GaudiKernel/StatusCode.h" - -// Local include(s): -#include "../Logging/MsgLogger.h" -#include "../Mibak/Lvl1Mibak.h" -#include "../Mirod/MirodFiFoContent.h" -#include "../Mirod/MirodModule.h" -#include "../Mirod/MirodTestRamIn.h" -#include "../Mioct/StrategyName.h" -#include "../Mioct/MioctID.h" -#include "../Mictp/MictpModule.h" -#include "../Common/MioctL1TopoConverter.h" - -namespace LVL1MUONIF { - class Lvl1MuCTPIInput; -} -namespace LVL1MUCTPI { - - // Forward declaration(s): - class Configuration; - class EventReader; - class SectorLogicSource; - - /********************************************************************* - * - * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $ - * - * @short Top level class of the MUCTPI simulation - * - * Top level class: The constructor sets up the simulation - * and defines the input source and output destination - * depending on its argument(s). The processData method - * performs the actual simulation in reading the input - * data, simulation the result and providing the output. - * Additional debugging and diagnostics interfaces - * provide access to all the modules of the MUCTPI - * - * @see MirodModule - * @see MioctModule - * @see MictpModule - * @see Lvl1Mibak - * @see MibakStreamEvent - * @see MirodModule - * @author $Author: ssnyder $ - * @version $Revision: 726107 $ - * - ******************************************************************* - */ - class MuctpiSim { - - public: - - // Constructor - /** - * The constructor of MuctpiSim - */ - MuctpiSim(); - - // disable copy/assignment operator as not used/implemented - MuctpiSim( const MuctpiSim & ) = delete; - MuctpiSim & operator = ( const MuctpiSim & ) = delete; - - - /// sets Configuration - void setConfiguration( const Configuration& conf ); - - /** - * The processData method does the data processing in the Muctpi - * It needs to be called before any of the output data is accessed, - * which otherwise will be empty or still hold the last event. - */ - void processData( const LVL1MUONIF::Lvl1MuCTPIInput* currentInput, int bcidOffset = 0 ); - /** - * method to access the data send to the CTP. - */ - unsigned int getCTPData() - { return this->getMictpModule()->getMictpCTPWord(); } - /** - * method to access the candidates sent to the RoIB (Level 2 Trigger) - * without the header or trailer words. - */ - const std::list<unsigned int>& getRoIBCandidates() - { return this->getMirodModule()->getLvl2Candidates(); } - /** - * method to access the data send to the RoIB (Level 2 Trigger). - */ - const std::list<unsigned int>& getRoIBData() - { return this->getMirodModule()->getLvl2Output(); } - /** - * method to access the data send to the DAQ system. - */ - const std::list<unsigned int>& getDAQData() - { return this->getMirodModule()->getDaqOutput(); } - /** - * setup the Muon to L1Topo converter - */ - void setupL1TopoConverter(const std::string & inputfile){ - m_L1TopoConv.setupParser(inputfile); - } - /** - * access the output for the L1Topo, and add the LVL2 style 32 bit word to it. - */ - LVL1::MuCTPIL1Topo getL1TopoData(); - - - /// Is there at least one barrel candidate in the event? - bool hasBarrelCandidate() const; - /// Is there at least one endcap candidate in the event? - bool hasEndcapCandidate() const; - - /** - * method to access a MioctModule specified by its ID - */ - const MioctModule* getMioct( MioctID id ) const - { return m_mibak->getMioctModule( id ); } - /** - * method to access the MirodModule - */ - const MirodModule* getMirodModule() { return m_mibak->getMirod(); } - /** - * method to access the MictpModule - */ - const MictpModule* getMictpModule() { return m_mibak->getMictp(); } - /** - * method to access the data stream on the Mibak to the Mirod - */ - const MibakStreamEvent* getMibakStreamData() - { return m_mibak->getMibakStreamEvent(); } - /** - * get the input needed to load the MirodTestRam - * @return object holding the input to the testram - */ - MirodTestRamIn getMirodTestRamInput() - { return this->getMibakStreamData()->getMirodTestRamInput(); } - /** - * method to get the content of the MirodFiFos as an object for - * comparisons to the hardware - */ - MirodFiFoContent getMirodFiFoContent(); - /** - * print methods for the output of the MUCTPI. The parameter determines - * if the output is in "bin"-binary, "hex"-hexadecimal, or - * "human"-interpreted format - * @param format - determines the output format (bin,hex,human) - */ - void printCTPOut( std::string format ); - void printLvl2Out( std::string format ); - void printDAQOut( std::string format ); - - /** - * These methods are used to set up the simulation's overlap handling scheme. - * Currently 2 strategies are supported: NO_OVERLAP and LUT_OVERLAP - */ - void setOverlapStrategy( StrategyName strategy ) { - m_mibak->setOverlapStrategy( strategy ); - } - StatusCode initializeLUTOverlapStrategy( const std::string& lutXMLFile, - bool flagMode, bool dumpLut, - const std::string& runPeriod = "RUN1" ); - - /** - * These methods are used to set up the simulation's multiplicity calculation - * scheme. Currently 3 strategies are supported: INCLUSIVE, EXCLUSIVE, XML - */ - void setMultiplicityStrategy( MultiplicityCalcType type ) { - m_mibak->setMultiplicityStrategy( type ); - } - void initializeXMLMultStrategy( const std::string& xmlFile ) { - m_mibak->initializeXMLMultStrategy( xmlFile ); - } - - /** - * The destructor of MuctpiSim - */ - ~MuctpiSim(); - - private: - MsgLogger m_logger; - EventID m_theEventID; - EventReader* m_theReader; - SectorLogicSource* m_theSource; - Lvl1Mibak* m_mibak; - LVL1MUONIF::Lvl1MuCTPIInput* m_muctpiInput; - MioctL1TopoConverter m_L1TopoConv; - - }; // class MuctpiSim - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MUCTPISIM_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MultiplicityCalcType.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MultiplicityCalcType.h deleted file mode 100644 index ffd3e5b1ba28f9b70f49f76ff448c00a7df756dd..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MultiplicityCalcType.h +++ /dev/null @@ -1,23 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MultiplicityCalcType.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_COMMON_MULTIPLICITYCALCTYPE_H -#define TRIGT1MUCTPI_COMMON_MULTIPLICITYCALCTYPE_H - -namespace LVL1MUCTPI { - - enum MultiplicityCalcType { - - INCLUSIVE, - EXCLUSIVE, - XML - - }; // enum MultiplicityCalcType - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_COMMON_MULTIPLICITYCALCTYPE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.cxx deleted file mode 100644 index f15f5269e497987b044ea0559cb124c9a3dde994..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.cxx +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MuonCandidate.cxx 364083 2011-05-06 09:09:55Z krasznaa $ - -// STL include(s): -#include <iostream> - -// Local include(s): -#include "MuonCandidate.h" - -/******************************************************************* - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - * - * Implementation of class MuonCandidate - * @author Author: Thorsten Wengler - * @version $Revision: 364083 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor of class MuonCandidate - MuonCandidate::MuonCandidate() - : m_bcid( 1 ), m_roi1( 0 ), m_roi2( 0 ), m_ovl1( 0 ), m_ovl2( 0 ), m_pt1( 7 ), - m_pt2( 7 ), m_twoCand1( false ), m_twoCand2( false ), m_gtTwoCandInSec( false ) { - - } - - // overload for << - std::ostream& operator<<( std::ostream& out, const MuonCandidate& right ) { - - out << right.m_theSectorID; - out << " Pt1: " << right.m_pt1; - out << " RoI1: " << right.m_roi1; - out << " Ovl1: " << right.m_ovl1; - out << " More1inPad1: " << right.m_twoCand1 << std::endl; - if( right.m_pt2 < 7 ) { - out << " Pt2: " << right.m_pt2; - out << " RoI2: " << right.m_roi2; - out << " Ovl2: " << right.m_ovl2; - out << " More1InPad2: " << right.m_twoCand2 << std::endl; - } - out << " BCID: " << right.m_bcid; - out << " More2inSec: " << right.m_gtTwoCandInSec << std::endl; - - return out; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.h deleted file mode 100644 index b0bdad703711928f92b487e3a921b743338ff0de..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.h +++ /dev/null @@ -1,112 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MuonCandidate.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_MUONCANDIDATE_H -#define TRIGT1MUCTPI_MUONCANDIDATE_H - -// Local include(s): -#include "../Mioct/SectorID.h" - -namespace LVL1MUCTPI { - - /** - * @short Information for one sector logic muon candidate word - * - * This class combines the information to form one word - * as delivered by the muon sector logic. It may - * contain 2 actual muon candidates - * - * @author Thorsten Wengler - * - * $Revision: 364083 $ - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - */ - class MuonCandidate { - - public: - /** - * The constructor of MuonCandidate - */ - MuonCandidate(); - /** - * set or get the SectorID - */ - SectorID secID() const { return m_theSectorID; } - void secID( SectorID theID ) { m_theSectorID = theID; } - /** - * set or get the BCID - */ - unsigned int bcid() const { return m_bcid; } - void bcid( unsigned int theBCID ) { m_bcid = theBCID; } - /** - * set or get RoI for candidate 1 - */ - unsigned int roi1() const { return m_roi1; } - void roi1( unsigned int theRoI1 ) { m_roi1 = theRoI1; } - /** - * set or get RoI for candidate 2 - */ - unsigned int roi2() const { return m_roi2; } - void roi2( unsigned int theRoI2 ) { m_roi2 = theRoI2; } - /** - * set or get Overlap for candidate 1 - */ - unsigned int ovl1() const { return m_ovl1; } - void ovl1( unsigned int theOvl1 ) { m_ovl1 = theOvl1; } - /** - * set or get Overlap for candidate 2 - */ - unsigned int ovl2() const { return m_ovl2; } - void ovl2( unsigned int theOvl2 ) { m_ovl2 = theOvl2; } - /** - * set or get pt for candidate 1 - */ - unsigned int pt1() const { return m_pt1; } - void pt1( unsigned int thePt1 ) { m_pt1 = thePt1; } - /** - * set or get pt for candidate 2 - */ - unsigned int pt2() const { return m_pt2; } - void pt2( unsigned int thePt2 ) { m_pt2 = thePt2; } - /** - * set or get two cand. in pad flag candidate 1 - */ - bool twoCand1() const { return m_twoCand1; } - void twoCand1( bool theTwoCand1 ) { m_twoCand1 = theTwoCand1; } - /** - * set or get two cand. in pad flag candidate 2 - */ - bool twoCand2() const { return m_twoCand2; } - void twoCand2( bool theTwoCand2 ) { m_twoCand2 = theTwoCand2; } - /** - * set or get two cand. in sector flag - */ - bool gtTwoCandInSec() const { return m_gtTwoCandInSec; } - void gtTwoCandInSec( bool theGtTwoCandInSec ) { m_gtTwoCandInSec = theGtTwoCandInSec; } - /** - * overload the << operator to have easy printout - */ - friend std::ostream& operator<<( std::ostream&, const MuonCandidate& ); - - private: - SectorID m_theSectorID; - unsigned int m_bcid; - unsigned int m_roi1; - unsigned int m_roi2; - unsigned int m_ovl1; - unsigned int m_ovl2; - unsigned int m_pt1; - unsigned int m_pt2; - bool m_twoCand1; - bool m_twoCand2; - bool m_gtTwoCandInSec; - - }; // class MuonCandidate - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MUONCANDIDATE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.cxx deleted file mode 100644 index 0b703b13043348502d63e4f7fc4727d5dcac4f21..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.cxx +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: PtMultiplicitySet.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// STL include(s): -#include <iostream> -#include <sstream> -#include <cassert> - -// Local include(s): -#include "PtMultiplicitySet.h" - -//*********************************************************************** -// -// Version : $Revision: 700318 $ -// -// Description : -// -// Author : $Author: krasznaa $ -// Date : $Date: 2015-10-13 16:13:15 +0200 (Tue, 13 Oct 2015) $ -// -// -// -//*********************************************************************** - -namespace LVL1MUCTPI { - - PtMultiplicitySet::PtMultiplicitySet( unsigned int ptarr[ MAX_NUMBER_OF_THRESHOLDS ] ) { - - // - // Initialise the internal array to zero: - // - for( unsigned int ix = 0; ix < MAX_NUMBER_OF_THRESHOLDS; ++ix ) { - m_multiplicity_pt[ ix ] = 0; - } - - // - // If an array was given in the constructor, copy its contents: - // - if( ptarr ) { - for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) { - m_multiplicity_pt[ i ] = ptarr[ i ]; - } - } - - } - - PtMultiplicitySet& PtMultiplicitySet::operator+=( const PtMultiplicitySet& a) { - - // No check is performed for the "correctness" of the input PtMultiplicitySet, - // since there should be no way in which it can be created in an "incorrect" - // way... - for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) { - m_multiplicity_pt[ i ] += a.m_multiplicity_pt[ i ]; - // the multiplicities are clipped at MAX_MULTIPLICITY - if( m_multiplicity_pt[ i ] > MAX_MULTIPLICITY ) { - m_multiplicity_pt[ i ] = MAX_MULTIPLICITY; - } - } - return *this; - - } - - // the definition of the + operator is based on that of the += operator - // the multiplicities are clipped at MAX_MULTIPLICITY - - PtMultiplicitySet PtMultiplicitySet::operator+( const PtMultiplicitySet& a ) { - - PtMultiplicitySet result = *this; - result += a; - return result; - - } - - // Access to multiplicity of a particluar threshold - int PtMultiplicitySet::getMultiplicity( const unsigned int threshold ) const { - - // check if threshold argument is valid - if( threshold > MAX_NUMBER_OF_THRESHOLDS || threshold < 1 ) { - std::cerr << "Invalid Threshold given" << std::endl; - assert( 0 ); - return( 0 ); // added to silence the coverty complaints - } - return m_multiplicity_pt[ threshold - 1 ]; - - } - - void PtMultiplicitySet::clear() { - - for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) { - m_multiplicity_pt[ i ] = 0; - } - - return; - } - - void PtMultiplicitySet::print( std::string& result ) const { - - std::ostringstream outStream; - outStream << "\n Multiplicity Set : \n" << "--------------------\n\n"; - for( unsigned int ix = 0; ix < MAX_NUMBER_OF_THRESHOLDS; ++ix ) { - outStream << " " << ix + 1 << " " << m_multiplicity_pt[ ix ] << "\n"; - } - result = outStream.str(); - - return; - - } - - void PtMultiplicitySet::addMuon( const unsigned int pt ) { - - // a muon is added if it is in the correct pt range and if the - // maximal multiplicity for the correspnding pt thresholds has not been - // reached yet. - if( pt >= 1 && pt <= MAX_NUMBER_OF_THRESHOLDS ) { - if( m_multiplicity_pt[ pt - 1 ] < MAX_MULTIPLICITY ) { - m_multiplicity_pt[ pt - 1 ]++; - } - } - return; - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.h deleted file mode 100644 index aafeb84d02001a639a695945f9d8a95ebc83a01a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.h +++ /dev/null @@ -1,96 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: PtMultiplicitySet.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_PTMULTIPLICITYSET_H -#define TRIGT1MUCTPI_PTMULTIPLICITYSET_H - -// STL include(s): -#include <string> - -// Local include(s): -#include "SectorConstants.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class InclusiveMultStrategy; - class ExclusiveMultStrategy; - class XMLMultCalculator; - - /** - * @short A set of pt-multiplicities corresponding to the six different pt-thresholds - * - * This class contains a set of 6 muon multiplicities - * corresponding to the six different pt-thresholds in the - * system. The multiplicities saturate at a count of seven - * like it is implemented in the hardware (3 bits). Operators - * for adding multiplicities are defined. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 364083 $ - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - */ - class PtMultiplicitySet { - - // All the concrete multiplicity strategies have to be listed as friends, - // because only they should be allowed to freely modify such objects. - // I really don't like having to do it like this, but unfortunately - // friendship is not inherited. Even though it would be elegant to just - // write "friend class MultiplicityStrategy;"... - friend class InclusiveMultStrategy; - friend class ExclusiveMultStrategy; - friend class XMLMultCalculator; - - public: - /** - * The constructor without any argument creates an empty multiplicty - * set (all multiplicities set to 0). It might take an array with - * initial values as an argument. Currently no check is performed if - * the inital values do not exceed the maximal number of seven!!) - */ - PtMultiplicitySet( unsigned int ptarr[ MAX_NUMBER_OF_THRESHOLDS ] = 0 ); - /** - * Method to access the multiplicity of a particular threshold - * @param threshold for which multiplicity is requested - * @return multiplicity for requested threshold - */ - int getMultiplicity( const unsigned int threshold ) const; - - /// This operator clips the multiplicities at a count of sevenn - PtMultiplicitySet& operator+=( const PtMultiplicitySet& ); - /// This operator clips the multiplicities at a count of seven. - PtMultiplicitySet operator+( const PtMultiplicitySet& ); - - /// Reset the object to 0 multiplicity - void clear(); - - /** - * For debugging and to look at results. - * @param result is a reference on a string which after the call - * to the function contains the formatted result (six multiplicities for - * the six different pt-thresholds). - */ - void print( std::string& result ) const; - - private: - /** - * With this member function a multiplicity of a specified threshold - * can be incremented by one. - * @param pt This is the threshold which is incremented. It must be - * a number between one and six. If this condition is not met, nothing - * will be done. - */ - void addMuon( const unsigned int pt ); - - unsigned int m_multiplicity_pt[ MAX_NUMBER_OF_THRESHOLDS ]; - - }; // class PtMultiplicitySet - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_PTMULTIPLICITYSET_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.cxx deleted file mode 100644 index 242600bd9c05152561f269be6fcc2325d24da738..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.cxx +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RandomCandidateRange.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// Local include(s): -#include "RandomCandidateRange.h" -#include "SectorConstants.h" - -/******************************************************************* - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * Implementation of class RandomCandidateRange - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor of class RandomCandidateRange - RandomCandidateRange::RandomCandidateRange() - : m_allowSystems( 7 ), m_allowHemispheres( 3 ), m_minBarrelSectorID( MIN_BARREL_SECTOR ), m_maxBarrelSectorID( MAX_BARREL_SECTOR ), - m_minEndcapSectorID( MIN_ENDCAP_SECTOR ), m_maxEndcapSectorID( MAX_ENDCAP_SECTOR ), m_minForwardSectorID( MIN_FORWARD_SECTOR ), - m_maxForwardSectorID( MAX_FORWARD_SECTOR ), m_allowForce2Cand( 1 ), m_minBCID( 0 ), m_maxBCID( 0 ), - m_minBarrelRoI( MIN_BARREL_ROI ), m_maxBarrelRoI( MAX_BARREL_ROI ), m_minEndcapRoI( MIN_ENDCAP_ROI ), m_maxEndcapRoI( MAX_ENDCAP_ROI ), - m_minForwardRoI( MIN_FORWARD_ROI ), m_maxForwardRoI( MAX_FORWARD_ROI ), - m_minPt( 1 ), m_maxPt( MAX_NUMBER_OF_THRESHOLDS ), m_allowForceGT1InPad1Flag( 1 ), m_allowForceGT1InPad2Flag( 1 ), - m_allowForceGT2InSecFlag( 1 ) { - - } - - //destructor of class RandomCandidateRange - RandomCandidateRange::~RandomCandidateRange(){ - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.h deleted file mode 100644 index ccd80838cecb6082207b0b34047cc8e8ad9ccb51..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.h +++ /dev/null @@ -1,181 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RandomCandidateRange.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_RANDOMCANDIDATERANGE_H -#define TRIGT1MUCTPI_RANDOMCANDIDATERANGE_H - -namespace LVL1MUCTPI { - - /** - ******************************************************************* - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Short description of RandomCandidateRange - * - * Long description of RandomCandidateRange - * - * @see - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - * - ******************************************************************* - */ - class RandomCandidateRange { - - public: - /** - * The constructor of RandomCandidateRange - */ - RandomCandidateRange(); - /** - * methods to get/set m_allowSubsystems Barrel (bin 001), - * Endcap (bin 010), Forward (bin 100), or any combination - */ - unsigned int allowSystems(){ return m_allowSystems; } - void allowSystems( unsigned int allowSys ){ m_allowSystems = allowSys; } - /** - * methods to get/set m_allowHemispheres: Pos (bin 01), Neg (bin 10) - * or both - */ - unsigned int allowHemispheres(){ return m_allowHemispheres; } - void allowHemispheres( unsigned int allowHem ){ m_allowHemispheres = allowHem; } - /** - * methods to get/set m_minBarrelSectorID - */ - unsigned int minBarrelSectorID(){ return m_minBarrelSectorID; } - void minBarrelSectorID( unsigned int minBarrelID ){ m_minBarrelSectorID = minBarrelID; } - /** - * methods to get/set m_maxBarrelSectorID - */ - unsigned int maxBarrelSectorID(){ return m_maxBarrelSectorID; } - void maxBarrelSectorID( unsigned int maxBarrelID ){ m_maxBarrelSectorID = maxBarrelID; } - /** - * methods to get/set m_minEndcapSectorID - */ - unsigned int minEndcapSectorID(){ return m_minEndcapSectorID; } - void minEndcapSectorID( unsigned int minEndcapID ){ m_minEndcapSectorID = minEndcapID; } - /** - * methods to get/set m_maxEndcapSectorID - */ - unsigned int maxEndcapSectorID(){ return m_maxEndcapSectorID; } - void maxEndcapSectorID( unsigned int maxEndcapID ){ m_maxEndcapSectorID = maxEndcapID; } - /** - * methods to get/set m_minForwardSectorID - */ - unsigned int minForwardSectorID(){ return m_minForwardSectorID; } - void minForwardSectorID( unsigned int minForwardID ){ m_minForwardSectorID = minForwardID; } - /** - * methods to get/set m_maxForwardSectorID - */ - unsigned int maxForwardSectorID(){ return m_maxForwardSectorID; } - void maxForwardSectorID( unsigned int maxForwardID ){ m_maxForwardSectorID = maxForwardID; } - /** - * method to get/set m_allow2Candidates - */ - unsigned int allowForce2Cand(){ return m_allowForce2Cand; } - void allowForce2Cand( unsigned int allowFor2Cand ){ m_allowForce2Cand = allowFor2Cand; } - /** - * methods to get/set m_minBCID - */ - unsigned int minBCID(){ return m_minBCID; } - void minBCID( unsigned int theMinBCID ){ m_minBCID = theMinBCID; } - /** - * methods to get/set m_maxBCID - */ - unsigned int maxBCID(){ return m_maxBCID; } - void maxBCID( unsigned int theMaxBCID ){ m_maxBCID = theMaxBCID; } - /** - * methods to get/set m_minBarrelRoI - */ - unsigned int minBarrelRoI(){ return m_minBarrelRoI; } - void minBarrelRoI( unsigned int theMinBarrelRoI ){ m_minBarrelRoI = theMinBarrelRoI; } - /** - * methods to get/set m_maxBarrelRoI - */ - unsigned int maxBarrelRoI(){ return m_maxBarrelRoI; } - void maxBarrelRoI( unsigned int theMaxBarrelRoI ){ m_maxBarrelRoI = theMaxBarrelRoI; } - /** - * methods to get/set m_minEndcapRoI - */ - unsigned int minEndcapRoI(){ return m_minEndcapRoI; } - void minEndcapRoI( unsigned int theMinEndcapRoI ){ m_minEndcapRoI = theMinEndcapRoI; } - /** - * methods to get/set m_maxEndcapRoI - */ - unsigned int maxEndcapRoI(){ return m_maxEndcapRoI; } - void maxEndcapRoI( unsigned int theMaxEndcapRoI ){ m_maxEndcapRoI = theMaxEndcapRoI; } - /** - * methods to get/set m_minForwardRoI - */ - unsigned int minForwardRoI(){ return m_minForwardRoI; } - void minForwardRoI( unsigned int theMinForwardRoI ){ m_minForwardRoI = theMinForwardRoI; } - /** - * methods to get/set m_maxForwardRoI - */ - unsigned int maxForwardRoI(){ return m_maxForwardRoI; } - void maxForwardRoI( unsigned int theMaxForwardRoI ){ m_maxForwardRoI = theMaxForwardRoI; } - /** - * methods to get/set m_minPt - */ - unsigned int minPt(){ return m_minPt; } - void minPt( unsigned int theMinPt ){ m_minPt = theMinPt; } - /** - * methods to get/set m_maxPt - */ - unsigned int maxPt(){ return m_maxPt; } - void maxPt( unsigned int theMaxPt ){ m_maxPt = theMaxPt; } - /** - * methods to get/set m_allowForceGT1InPad1Flag - */ - unsigned int allowForceGT1InPad1Flag(){ return m_allowForceGT1InPad1Flag; } - void allowForceGT1InPad1Flag( unsigned int allowForceGT1Pad1 ){ m_allowForceGT1InPad1Flag = allowForceGT1Pad1; } - /** - * methods to get/set m_allowForceGT1InPad2Flag - */ - unsigned int allowForceGT1InPad2Flag(){ return m_allowForceGT1InPad2Flag; } - void allowForceGT1InPad2Flag( unsigned int allowForceGT1Pad2 ){ m_allowForceGT1InPad2Flag = allowForceGT1Pad2; } - /** - * methods to get/set m_allowForce2CandidatesInSec - */ - unsigned int allowForceGT2InSecFlag(){ return m_allowForceGT2InSecFlag; } - void allowForceGT2InSecFlag( unsigned int allowForceGT2Sec ){ m_allowForceGT2InSecFlag = allowForceGT2Sec; } - /** - * The destructor of RandomCandidateRange - */ - ~RandomCandidateRange(); - - private: - - unsigned int m_allowSystems; - unsigned int m_allowHemispheres; - unsigned int m_minBarrelSectorID; - unsigned int m_maxBarrelSectorID; - unsigned int m_minEndcapSectorID; - unsigned int m_maxEndcapSectorID; - unsigned int m_minForwardSectorID; - unsigned int m_maxForwardSectorID; - unsigned int m_allowForce2Cand; - unsigned int m_minBCID; - unsigned int m_maxBCID; - unsigned int m_minBarrelRoI; - unsigned int m_maxBarrelRoI; - unsigned int m_minEndcapRoI; - unsigned int m_maxEndcapRoI; - unsigned int m_minForwardRoI; - unsigned int m_maxForwardRoI; - unsigned int m_minPt; - unsigned int m_maxPt; - unsigned int m_allowForceGT1InPad1Flag; - unsigned int m_allowForceGT1InPad2Flag; - unsigned int m_allowForceGT2InSecFlag; - - }; // class RandomCandidateRange - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_RANDOMCANDIDATERANGE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/SectorConstants.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/SectorConstants.h deleted file mode 100644 index 69ad93a2861f90c32566eeeba7410af9c8e66340..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/SectorConstants.h +++ /dev/null @@ -1,35 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: SectorConstants.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_SECTORCONSTANTS_H -#define TRIGT1MUCTPI_SECTORCONSTANTS_H - -namespace LVL1MUCTPI { - - static const unsigned int MIN_BARREL_SECTOR = 0; - static const unsigned int MAX_BARREL_SECTOR = 31; - static const unsigned int MIN_BARREL_ROI = 1; - static const unsigned int MAX_BARREL_ROI = 26; - - static const unsigned int MIN_ENDCAP_SECTOR = 0; - static const unsigned int MAX_ENDCAP_SECTOR = 47; - static const unsigned int MIN_ENDCAP_ROI = 0; - static const unsigned int MAX_ENDCAP_ROI = 147; - - static const unsigned int MIN_FORWARD_SECTOR = 0; - static const unsigned int MAX_FORWARD_SECTOR = 23; - static const unsigned int MIN_FORWARD_ROI = 0; - static const unsigned int MAX_FORWARD_ROI = 63; - - static const unsigned int MAX_NUMBER_OF_THRESHOLDS = 6; - static const unsigned int MAX_MULTIPLICITY = 7; - - static const unsigned int SECTORS_IN_MIOCT = 13; - -} - -#endif // TRIGT1MUCTPI_SECTORCONSTANTS_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.cxx deleted file mode 100644 index bfa2f91f9f5117472a0e57d8ec8249b3a6b52f5d..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.cxx +++ /dev/null @@ -1,193 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Verifyer.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// STL include(s): -#include <iostream> - -// Local include(s): -#include "Verifyer.h" - -/* - ******************************************************************* - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * Implementation of class Verifyer - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor of class Verifyer - Verifyer::Verifyer() - : m_lvl2CandidateMask( 0 ), m_daqMictpMask( 0 ), m_daqCandidateMask( 0 ) { - - for( int i = 0 ; i < 8 ; ++i ) { - m_lvl2HeaderMask.push_back( 0 ); - m_daqHeaderMask.push_back( 0 ); - if ( i < 5 ) { - m_lvl2TrailerMask.push_back( 0 ); - m_daqTrailerMask.push_back( 0 ); - } - } - - } - - // Compare Daq Out simulation/hardware - unsigned int Verifyer::daqOutIsEqual( const std::list< unsigned int >& simOut, const std::list< unsigned int >& hardwareOut, - bool printToScreen ) const { - - unsigned int areEqual = 0; - - // bit 0 of return code = same buffer length - if( simOut.size() != hardwareOut.size() ) areEqual |= 1; - unsigned int bufferSize = simOut.size(); - - // iterate over the list and check the sector ID's - std::list<unsigned int>::const_iterator it_sim; - std::list<unsigned int>::const_iterator it_hard; - it_hard = hardwareOut.begin(); - - unsigned int wordCount = 0 ; - unsigned int headerCount = 0 ; - unsigned int trailerCount = 0 ; - unsigned int candidateCount = 0 ; - for( it_sim = simOut.begin(); it_sim != simOut.end(); ++it_sim ) { - - ++wordCount; - - if( headerCount < 8 ) { - ++headerCount; - // bit number 2-9: differences in the header words - unsigned int bitTest = 0; - if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) { - if ( ( bitTest & ( bitTest ^ this->daqHeaderMask( headerCount - 1 ) ) ) != 0 ) { - areEqual |= ( 1 << ( headerCount ) ); - } - } - } else if ( wordCount == 9 ) { - // bit number 19: differences in the MICTP word - unsigned int bitTest = 0; - if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) { - if ( ( bitTest & ( bitTest ^ this->daqMictpMask() ) ) != 0 ) { - areEqual |= ( 1 << ( 19 ) ); - } - } - } else if ( wordCount >= ( bufferSize - 4 ) ) { - trailerCount++; - // bit number 10-14: differences in the trailer words - unsigned int bitTest = 0; - if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) { - if ( ( bitTest & ( bitTest ^ - this->daqTrailerMask( trailerCount - 1 ) ) ) != 0 ) { - areEqual |= ( 1 << ( trailerCount ) ); - } - } - } else { - candidateCount++; - // bit number 15: differences in a candidate word - unsigned int bitTest = 0; - if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) { - if ( ( bitTest & ( bitTest ^ this->daqCandidateMask() ) ) != 0 ) { - areEqual |= ( 1 << ( 20 ) ); - } - } - } - if ( printToScreen ) { - std::cout << std::hex << ( *it_sim ) << std::endl; - std::cout << std::hex << ( *it_hard ) << std::endl << std::endl; - } - - ++it_hard; - } - - return areEqual; - - } - - // Compare Lvl2 Out simulation/hardware - unsigned int Verifyer::lvl2OutIsEqual( const std::list< unsigned int >& simOut, const std::list< unsigned int >& hardwareOut, - bool printToScreen ) const { - - unsigned int areEqual = 0; - - // bit 0 of return code = same buffer length - if( simOut.size() != hardwareOut.size() ) areEqual |= 1; - unsigned int bufferSize = simOut.size(); - - // iterate over the list and check the sector ID's - std::list< unsigned int >::const_iterator it_sim; - std::list< unsigned int >::const_iterator it_hard; - it_hard = hardwareOut.begin(); - - unsigned int wordCount = 0; - unsigned int headerCount = 0; - unsigned int trailerCount = 0; - unsigned int candidateCount = 0; - for ( it_sim = simOut.begin(); it_sim != simOut.end(); ++it_sim ) { - - ++wordCount; - - if( headerCount < 8 ) { - ++headerCount; - // bit number 2-9: differences in the header words - unsigned int bitTest = 0; - if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) { - if ( ( bitTest & ( bitTest ^ - this->lvl2HeaderMask( headerCount - 1 ) ) ) != 0 ) { - areEqual |= ( 1 << ( headerCount ) ); - } - } - } else if ( wordCount >= ( bufferSize - 4 ) ) { - trailerCount++; - // bit number 10-14: differences in the trailer words - unsigned int bitTest = 0; - if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) { - if ( ( bitTest & ( bitTest ^ - this->lvl2TrailerMask( trailerCount - 1 ) ) ) != 0 ) { - areEqual |= ( 1 << ( trailerCount ) ); - } - } - } else { - candidateCount++; - // bit number 15: differences in a candidate word - unsigned int bitTest = 0; - if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) { - if ( ( bitTest & ( bitTest ^ this->lvl2CandidateMask() ) ) != 0 ) { - areEqual |= ( 1 << ( 20 ) ); - } - } - } - if ( printToScreen ) { - std::cout << std::hex << ( *it_sim ) << std::endl; - std::cout << std::hex << ( *it_hard ) << std::endl << std::endl; - } - - ++it_hard; - } - - return areEqual; - - } - - // compare the MirodFiFos - bool Verifyer::mirodFiFosAreEqual( MirodFiFoContent & mirodFiFos, MirodFiFoContent & simMirodFiFos ) const { - - if( lvl2OutIsEqual( simMirodFiFos.lvl2FiFo(), mirodFiFos.lvl2FiFo(), false ) == 0 && - daqOutIsEqual( simMirodFiFos.daqFiFo(), mirodFiFos.daqFiFo(), false ) == 0 ) { - return true; - } - - return false; - } - - - //destructor of class Verifyer - Verifyer::~Verifyer() { - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.h deleted file mode 100644 index bdee2657b0dada13dd19ea71a720894647b5702a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.h +++ /dev/null @@ -1,133 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Verifyer.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_VERIFYER_H -#define TRIGT1MUCTPI_VERIFYER_H - -// STL include(s): -#include <list> -#include <vector> - -// Local include(s): -#include "../Mirod/MirodFiFoContent.h" - -namespace LVL1MUCTPI { - - /** - ******************************************************************* - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Utility class to verify simulation/hardware results - * - * This class offers methods to compare the output of - * of hardware and simulation - * - * @see - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - * - ******************************************************************* - */ - class Verifyer { - - public: - /** - * The constructor of Verifyer - */ - Verifyer(); - /** - * The destructor of Verifyer - */ - ~Verifyer(); - - /** - * Compare the output intended for the RoI Builder as produced - * by the simulation and the hardware - * @param simOut Output of the simulation - * @param hardwareOut Output of the hardware - * @param printToScreen if true does printout line by line - */ - unsigned int lvl2OutIsEqual( const std::list<unsigned int> & simOut, - const std::list<unsigned int> & hardwareOut, - bool printToScreen ) const; - /** - * set/get lvl2Header masks - * @param headerWord which of the 0 ... 7 header words - * @param maskValue value to which the mask is set - */ - void lvl2HeaderMask( unsigned int headerWord, unsigned int maskValue ) { m_lvl2HeaderMask[ headerWord ] = maskValue; } - unsigned int lvl2HeaderMask( unsigned int headerWord ) const { return m_lvl2HeaderMask[ headerWord ]; } - /** - * set/get lvl2Trailo masks - * @param trailerWord which of the 0 ... 4 trailor words - * @param maskValue value to which the mask is set - */ - void lvl2TrailerMask( unsigned int trailerWord, unsigned int maskValue ) { m_lvl2TrailerMask[ trailerWord ] = maskValue; } - unsigned int lvl2TrailerMask( unsigned int trailerWord ) const { return m_lvl2TrailerMask[ trailerWord ]; } - /** - * set/get lvl2Candidate mask - * @param maskValue value to which the mask is set - */ - void lvl2CandidateMask( unsigned int maskValue ) { m_lvl2CandidateMask = maskValue; } - unsigned int lvl2CandidateMask() const { return m_lvl2CandidateMask; } - /** - * set/get lvl2Header masks - * @param headerWord which of the 0 ... 7 header words - * @param maskValue value to which the mask is set - */ - void daqHeaderMask( unsigned int headerWord, unsigned int maskValue ) { m_daqHeaderMask[ headerWord ] = maskValue; } - unsigned int daqHeaderMask( unsigned int headerWord ) const { return m_daqHeaderMask[ headerWord ]; } - /** - * set/get daqTrailo masks - * @param trailerWord which of the 0 ... 4 trailor words - * @param maskValue value to which the mask is set - */ - void daqTrailerMask( unsigned int trailerWord, unsigned int maskValue ) { m_daqTrailerMask[ trailerWord ] = maskValue; } - unsigned int daqTrailerMask( unsigned int trailerWord ) const { return m_daqTrailerMask[ trailerWord ]; } - /** - * set/get daqMictp mask - * @param maskValue value to which the mask is set - */ - void daqMictpMask( unsigned int maskValue ) { m_daqMictpMask = maskValue; } - unsigned int daqMictpMask() const { return m_daqMictpMask; } - /** - * set/get daqCandidate mask - * @param maskValue value to which the mask is set - */ - void daqCandidateMask( unsigned int maskValue ) { m_daqCandidateMask = maskValue; } - unsigned int daqCandidateMask() const { return m_daqCandidateMask; } - - /** - * Compare the output intended for the DAQ as produced - * by the simulation and the hardware - * @param simOut Output of the simulation - * @param hardwareOut Output of the hardware - * @param printToScreen if true does printout line by line - */ - unsigned int daqOutIsEqual( const std::list<unsigned int> & simOut, - const std::list<unsigned int> & hardwareOut, - bool printToScreen ) const; - - bool mirodFiFosAreEqual( MirodFiFoContent & mirodFiFos, - MirodFiFoContent & simMirodFiFos ) const; - - private: - std::vector< unsigned int > m_lvl2HeaderMask; - unsigned int m_lvl2CandidateMask; - std::vector< unsigned int > m_lvl2TrailerMask; - - std::vector< unsigned int > m_daqHeaderMask; - unsigned int m_daqMictpMask; - unsigned int m_daqCandidateMask; - std::vector< unsigned int > m_daqTrailerMask; - - }; // class Verifyer - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_VERIFYER_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.cxx deleted file mode 100644 index 470acc9c9308a2058c8b6dca86b468f4e2fc06ff..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.cxx +++ /dev/null @@ -1,147 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MsgLogger.cxx 706709 2015-11-09 12:10:23Z wengler $ - -// STL include(s): -#include <iomanip> -#include <cstdlib> - -// Local include(s): -#include "MsgLogger.h" -#include "MsgWriter.h" - -//*********************************************************************** -// -// Version : $Revision: 706709 $ -// -// Description : Implementation of the MsgLogger class -// -// Author : $Author: krasznaa $ -// Date : $Date: 2015-11-09 13:10:23 +0100 (Mon, 09 Nov 2015) $ -// -//*********************************************************************** - -namespace LVL1MUCTPI { - - // - // This is the hard-coded maximum length of the source names: - // - static const std::string::size_type MAXIMUM_SOURCE_NAME_LENGTH = 20; - - MsgLogger::MsgLogger( const std::string& source ) - : m_source( source ), m_activeType( INFO ) { - - m_msgWriter = MsgWriter::instance(); - } - - MsgLogger::MsgLogger( const MsgLogger& parent ) - : std::basic_ios< MsgLogger::char_type, MsgLogger::traits_type >(), - std::ostringstream(),m_msgWriter(nullptr) { - - *this = parent; - } - - MsgLogger& MsgLogger::operator= ( const MsgLogger& parent ) { - - if (this != &parent){ - m_source = parent.m_source; - m_msgWriter = MsgWriter::instance(); - m_activeType = parent.m_activeType; - } - return *this; - } - - MsgLogger& MsgLogger::endmsg( MsgLogger& logger ) { - - logger.send(); - return logger; - } - - std::string MsgLogger::getFormattedSource() const { - - // make sure the source name is no longer than fMaxSourceSize: - std::string source_name = m_source; - if( source_name.size() > MAXIMUM_SOURCE_NAME_LENGTH ) { - source_name = source_name.substr( 0, MAXIMUM_SOURCE_NAME_LENGTH - 3 ); - source_name += "..."; - } - - return source_name; - } - - std::string MsgLogger::getPrintedSource() const { - - // the full logger prefix - std::string source_name = getFormattedSource(); - if( source_name.size() < MAXIMUM_SOURCE_NAME_LENGTH ) { - for( std::string::size_type i = source_name.size(); - i < MAXIMUM_SOURCE_NAME_LENGTH; ++i ) { - source_name.push_back( ' ' ); - } - } - - return source_name + " : "; - } - - /** - * This is the function that actually writes to the output, using MsgWriterSingleton. - * You can even give multi-line strings to it, it will nicely give each line - * the appropriate header. - */ - void MsgLogger::send( MsgType type, const std::string& message ) const { - - std::string::size_type previous_pos = 0, current_pos = 0; - - // - // Make sure the source name is no longer than MAXIMUM_SOURCE_NAME_LENGTH: - // - std::string source_name = getFormattedSource(); - - // - // Slice the recieved message into lines: - // - for( ; ; ) { - - current_pos = message.find( '\n', previous_pos ); - std::string line = message.substr( previous_pos, current_pos - previous_pos ); - - std::ostringstream message_to_send; - // I have to call the modifiers like this, otherwise g++ get's confused - // with the operators... - message_to_send.setf( std::ios::adjustfield, std::ios::left ); - message_to_send.width( MAXIMUM_SOURCE_NAME_LENGTH ); - message_to_send << source_name << " : " << line; - m_msgWriter->write( type, message_to_send.str() ); - - if( current_pos == message.npos ) break; - previous_pos = current_pos + 1; - - } - - return; - } - - void MsgLogger::send() { - - this->send( m_activeType, this->str() ); - - // - // Reset the stream buffer: - // - this->str( "" ); - - return; - } - - bool MsgLogger::msgLvl( MsgType type ) const { - return m_msgWriter->msgLvl((unsigned int)type); - } -#ifndef STANDALONE - bool MsgLogger::msgLvl( MSG::Level type ) const { - return m_msgWriter->msgLvl((unsigned int) type); - } -#endif - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.h b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.h deleted file mode 100644 index 14f5926ef88d6aa8137ed1d4d6b3c437a96b5bc0..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.h +++ /dev/null @@ -1,210 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MsgLogger.h 472835 2011-12-06 21:05:16Z stelzer $ -#ifndef TRIGT1MUCTPI_MSGLOGGER_H -#define TRIGT1MUCTPI_MSGLOGGER_H - -// STL include(s): -#include <string> -#include <sstream> - -#ifndef STANDALONE -// Gaudi/Athena include(s): -#include "GaudiKernel/IMessageSvc.h" -#endif - -// Local include(s): -#include "MsgType.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MsgWriter; - - /** - * @short This class should be used to do all printouts in the simulation. - * - * One shouldn't use the standard output in the simulation, - * altough it's still used in some places. Instead this class - * should be used, as it will automatically redirect the - * messages to the correct output. - * - * @see MsgWriter - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 472835 $ - * $Date: 2011-12-06 22:05:16 +0100 (Tue, 06 Dec 2011) $ - */ - class MsgLogger : public std::ostringstream { - - public: - /// Constructor with the message source defined by 'source'. - MsgLogger( const std::string& source ); - /// Copy constructor - MsgLogger( const MsgLogger& parent ); - - MsgLogger& operator= ( const MsgLogger& parent ); - - /// The message source truncated to the maximum length - std::string getFormattedSource() const; - /// The message source in the format that it is printed - std::string getPrintedSource() const; - - // Stream modifier(s): - static MsgLogger& endmsg( MsgLogger& logger ); - - // Accept stream modifiers: - MsgLogger& operator<< ( MsgLogger& ( *_f )( MsgLogger& ) ); - MsgLogger& operator<< ( std::ostream& ( *_f )( std::ostream& ) ); - MsgLogger& operator<< ( std::ios& ( *_f )( std::ios& ) ); - - // Accept message type specification: - MsgLogger& operator<< ( MsgType type ); - - // For all the "conventional" inputs: - template < class T > MsgLogger& operator<< ( T arg ) { - ( * ( std::ostringstream* ) this ) << arg; - return *this; - } - - /// Send a message of type 'type' to the output. - void send( MsgType type, const std::string& message ) const; - - bool msgLvl( MsgType type ) const; -#ifndef STANDALONE - bool msgLvl( MSG::Level type ) const; -#endif - - private: - void send(); - - std::string m_source; - MsgWriter* m_msgWriter; - MsgType m_activeType; - - }; // class MsgLogger - - ////////////////////////////////////////////////////////////////////// - // // - // To speed up the code a bit, the following operators are // - // declared 'inline'. // - // // - ////////////////////////////////////////////////////////////////////// - - inline MsgLogger& MsgLogger::operator<< ( MsgLogger& ( *f )( MsgLogger& ) ) { - - return ( f )( *this ); - } - - inline MsgLogger& MsgLogger::operator<< ( std::ostream& ( *f )( std::ostream& ) ) { - - ( f )( *this ); - return *this; - } - - inline MsgLogger& MsgLogger::operator<< ( std::ios& ( *f )( std::ios& ) ) { - - ( f )( *this ); - return *this; - } - - inline MsgLogger& MsgLogger::operator<< ( MsgType type ) { - - m_activeType = type; - return *this; - } - -} // namespace LVL1MUCTPI - -// This is a GCC extension for getting the name of the current function. -#if defined( __GNUC__ ) -# define MSGLOGGER_FNAME __PRETTY_FUNCTION__ -#else -# define MSGLOGGER_FNAME "" -#endif - -/// Common prefix for the non-usual messages -/** - * The idea is that a regular user usually only wants to see DEBUG, INFO - * and some WARNING messages. So those should be reasonably short. On the other - * hand serious warnings (ERROR, FATAL) or VERBOSE messages should be as precise - * as possible. - * - * So I stole the idea from Athena (what a surprise...) to have a few macros which - * produce messages with a common formatting. This macro provides the prefix for - * all the messages. - */ -#define MSGLOGGER_REPORT_PREFIX \ - __FILE__ << ":" << __LINE__ << " (" << MSGLOGGER_FNAME << "): " - -/// Generic macro for reporting messages in the code -/** - * This macro can be used to conveniently print messages with information on - * where the message is coming from in the code. The rest of the macros use this - * macro internally. But you can also use it directly like this: - * - * <code> - * REPORT_MSG( LVL1MUCTPI::INFO, "Some information message" ); - * </code> - */ -#define REPORT_MSG2( LEVEL, MESSAGE, LOGGER ) \ - if( LOGGER.msgLvl(LEVEL) ) { \ - LOGGER << LEVEL << MSGLOGGER_REPORT_PREFIX << MESSAGE \ - << LVL1MUCTPI::MsgLogger::endmsg; \ - } -#define REPORT_MSG( LEVEL, MESSAGE ) REPORT_MSG2(LEVEL, MESSAGE, m_logger) - -/// Convenience macro for reporting VERBOSE messages in the code -/** - * This macro is very similar to the REPORT_MESSAGE macros of Athena. It prints - * a nicely formatted output that specifies both the exact function name where - * the message was printed, and also the filename:line combination. It can be used - * like a regular function inside cycles: - * - * <code> - * REPORT_VERBOSE_MSG( "This is a verbose message with a number: " << number ); - * </code> - */ -#define REPORT_VERBOSE_MSG2( MESSAGE, LOGGER ) \ - if( LOGGER.msgLvl(LVL1MUCTPI::VERBOSE) ) { \ - LOGGER << LVL1MUCTPI::VERBOSE << MESSAGE << LVL1MUCTPI::MsgLogger::endmsg; \ - } -#define REPORT_VERBOSE_MSG(MESSAGE ) REPORT_VERBOSE_MSG2(MESSAGE, m_logger) - -/// Convenience macro for reporting ERROR messages in the code -/** - * This macro is very similar to the REPORT_MESSAGE macros of Athena. It prints - * a nicely formatted output that specifies both the exact function name where - * the message was printed, and also the filename:line combination. It can be used - * like a regular function inside cycles: - * - * <code> - * REPORT_ERROR_MSG( "A serious error message" ); - * </code> - */ -#define REPORT_ERROR_MSG2( MESSAGE, LOGGER ) \ - REPORT_MSG2( LVL1MUCTPI::ERROR, MESSAGE, LOGGER ) -#define REPORT_ERROR_MSG( MESSAGE ) \ - REPORT_MSG( LVL1MUCTPI::ERROR, MESSAGE ) - -/// Convenience macro for reporting FATAL messages in the code -/** - * This macro is very similar to the REPORT_MESSAGE macros of Athena. It prints - * a nicely formatted output that specifies both the exact function name where - * the message was printed, and also the filename:line combination. It can be used - * like a regular function inside cycles: - * - * <code> - * REPORT_FATAL_MSG( "A very serious error message" ); - * </code> - */ -#define REPORT_FATAL_MSG( MESSAGE ) \ - REPORT_MSG( LVL1MUCTPI::FATAL, MESSAGE ) -#define REPORT_FATAL_MSG2( MESSAGE, LOGGER ) \ - REPORT_MSG2( LVL1MUCTPI::FATAL, MESSAGE, LOGGER ) - -#endif // TRIGT1MUCTPI_MSGLOGGER_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgType.h b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgType.h deleted file mode 100644 index 35d0d8944884cc21f7dddfe9fac3a9ff8a15a1f7..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgType.h +++ /dev/null @@ -1,18 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MsgType.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_MSGTYPE_H -#define TRIGT1MUCTPI_MSGTYPE_H - -namespace LVL1MUCTPI { - - enum MsgType { VERBOSE = 1, DEBUG = 2, INFO = 3, WARNING = 4, - ERROR = 5, FATAL = 6, ALWAYS = 7 }; - -} - -#endif // TRIGT1MUCTPI_MSGTYPE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.cxx deleted file mode 100644 index 0827d4359aa94f4e16666ad504370f28908e5dd7..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.cxx +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MsgWriter.cxx 796122 2017-02-08 03:23:15Z ssnyder $ - -#ifdef STANDALONE -#include <iostream> -#else -#include "AthenaKernel/getMessageSvc.h" -#endif // STANDALONE - -// Local include(s): -#include "MsgWriter.h" - -//*********************************************************************** -// -// Version : $Revision: 796122 $ -// -// Description : Implementation of the MsgWriterSingleton class -// -// Author : $Author: krasznaa $ -// Date : $Date: 2017-02-08 04:23:15 +0100 (Wed, 08 Feb 2017) $ -// -//*********************************************************************** - -namespace LVL1MUCTPI { - - MsgWriter* MsgWriter::m_instance = 0; - - MsgWriter* MsgWriter::instance() { - - if( ! m_instance ) { - - m_instance = new MsgWriter(); - - } - - return m_instance; - - } - - MsgWriter::~MsgWriter() { - -#ifndef STANDALONE - delete m_stream; -#endif // STANDALONE - - } - - void MsgWriter::write( MsgType type, std::string line ) { - -#ifdef STANDALONE - if( type < m_min_type ) return; - std::cout << " (" << m_type_map[ type ] << ") " << line << std::endl; -#else - *m_stream << m_type_map[ type ] << line << endmsg; -#endif // STANDALONE - - } - -#ifdef STANDALONE - void MsgWriter::setMinType( MsgType type ) { - m_min_type = type; - } - bool MsgWriter::msgLvl(MsgType type) const { - return type >= m_min_type; - } - bool MsgWriter::msgLvl( unsigned int type ) const { - return msgLvl(MsgType(type)); - } -#else - void MsgWriter::setMinType( MSG::Level type ) { - m_stream->setLevel( type ); - } - bool MsgWriter::msgLvl( MSG::Level type ) const { - return type >= m_stream->level(); - } - bool MsgWriter::msgLvl( unsigned int type ) const { - return msgLvl(MSG::Level(type)); - } - void MsgWriter::setSource( const std::string& source ) { - delete m_stream; - m_stream = new MsgStream( Athena::getMessageSvc(), source ); - } -#endif // STANDALONE - - MsgWriter::MsgWriter() { - -#ifdef STANDALONE - m_type_map[ VERBOSE ] = "VERBOSE"; - m_type_map[ DEBUG ] = " DEBUG "; - m_type_map[ INFO ] = " INFO "; - m_type_map[ WARNING ] = "WARNING"; - m_type_map[ ERROR ] = " ERROR "; - m_type_map[ FATAL ] = " FATAL "; - m_type_map[ ALWAYS ] = "ALWAYS "; - - m_min_type = INFO; -#else - m_stream = new MsgStream( Athena::getMessageSvc(), "L1Muctpi" ); - m_type_map[ VERBOSE ] = MSG::VERBOSE; - m_type_map[ DEBUG ] = MSG::DEBUG; - m_type_map[ INFO ] = MSG::INFO; - m_type_map[ WARNING ] = MSG::WARNING; - m_type_map[ ERROR ] = MSG::ERROR; - m_type_map[ FATAL ] = MSG::FATAL; - m_type_map[ ALWAYS ] = MSG::ALWAYS; -#endif // STANDALONE - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.h b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.h deleted file mode 100644 index 85633c10bd5c620d72728c313bf3deed7252d605..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.h +++ /dev/null @@ -1,83 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MsgWriter.h 472835 2011-12-06 21:05:16Z stelzer $ -#ifndef TRIGT1MUCTPI_MSGWRITER_H -#define TRIGT1MUCTPI_MSGWRITER_H - -// STL include(s): -#include <string> -#include <map> - -#ifndef STANDALONE -// Gaudi/Athena include(s): -#include "GaudiKernel/MsgStream.h" -#endif // STANDALONE - -// Local include(s): -#include "MsgType.h" - -namespace LVL1MUCTPI { - - /** - * @short Singleton class responsible for showing messages - * - * The MuCTPI simulation has to work in two environments at - * this time. As part of the ATLAS digitization in Athena, - * and in a stand-alone mode in the MuCTPI DVS tests. In - * Athena all message logging should be done via the MsgStream - * class, while in the tests the standard output is used. - * - * This class is used to make sure the output is redirected to - * the correct place. - * - * @see MsgLogger - * @author $Author: krasznaa $ - * @version $Revision: 472835 $ - */ - class MsgWriter { - - public: - /// Singleton method for requesting the one and only object. - static MsgWriter* instance(); - ~MsgWriter(); - - /// Write the message given in 'line' having a priority defined by 'type'. - void write( MsgType type, std::string line ); - - /// Set the minimal type of the messages to display. -#ifdef STANDALONE - void setMinType( MsgType type ); - bool msgLvl(MsgType type) const; -#else - void setMinType( MSG::Level type ); - void setSource( const std::string& source ); - bool msgLvl( MSG::Level type ) const; -#endif // STANDALONE - - bool msgLvl( unsigned int type ) const; - - protected: - /// Singleton design, the constructor is protected. - MsgWriter(); - - private: - /// The pointer to the only instance of the object. - static MsgWriter* m_instance; - // The two different environments need different variables: -#ifdef STANDALONE - std::map< MsgType, std::string > m_type_map; - MsgType m_min_type; -#else - MsgStream* m_stream; - std::map< MsgType, MSG::Level > m_type_map; -#endif // STANDALONE - - }; // class MsgWriter - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MSGWRITERSINGLETON_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.cxx deleted file mode 100644 index c2059c03865ddc8ab10c129b268074e59689f1cd..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.cxx +++ /dev/null @@ -1,340 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Lvl1Mibak.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// STL include(s): -#include <cassert> -#include <sstream> - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// Local include(s): -#include "Lvl1Mibak.h" -#include "../Mioct/MioctModule.h" -#include "../Mictp/MictpModule.h" -#include "../Mirod/MirodModule.h" -#include "../Common/Configuration.h" -#include "../Common/PtMultiplicitySet.h" -#include "../Mioct/EventReader.h" -#include "../Mioct/EventReaderFactory.h" -#include "../Mioct/OverlapLogic.h" -#include "../Mioct/MultiplicityLogic.h" - - -namespace LVL1MUCTPI { - - Lvl1Mibak::Lvl1Mibak( EventReader* reader ) - : m_logger( "Lvl1Mibak" ), m_lvl1MioctList(), m_lvl1OverlapLogic( 0 ), - m_multiplicityLogic( 0 ), m_eventReader( reader ) { - - // Create the "logic objects". Note that the overlap logic uses the multiplicity - // logic itself. - m_multiplicityLogic = new MultiplicityLogic(); - m_lvl1OverlapLogic = new OverlapLogic( m_multiplicityLogic ); - - // create a list of 16 MIOCT modules - MioctModule* newMioct; - REPORT_VERBOSE_MSG( "Constructor called" ); - - for( unsigned int id = 0; id <= 7; ++id ) { - // id mioct module for the negative rapidiy region... - MioctID newID( id, Hemisphere( NEGATIVE ) ); - newMioct = new MioctModule( newID, m_lvl1OverlapLogic, m_eventReader ); - m_lvl1MioctList.push_back( newMioct ); - REPORT_VERBOSE_MSG( "MIOCT module with id " << id - << " in the NEGATIVE rapidity region created" ); - } - for( unsigned int id = 0; id <= 7; ++id ) { - // one mioct module for the positive rapidiy region... - MioctID newID( id, Hemisphere( POSITIVE ) ); - newMioct = new MioctModule( newID, m_lvl1OverlapLogic, m_eventReader ); - m_lvl1MioctList.push_back( newMioct ); - REPORT_VERBOSE_MSG( "MIOCT module with id " << id - << " in the POSITIVE rapidity region created" ); - } - - // create the MICTP Module - m_mictpModule = new MictpModule(); - REPORT_VERBOSE_MSG( "MICTP module created" ); - - // create the MIROD Module - m_mirodModule = new MirodModule(); - REPORT_VERBOSE_MSG( "MIROD module created" ); - - // check if a valid Event reader is installed, If not, exit - // with a fatal error here. - if( ! m_eventReader->isValid() ) { - REPORT_FATAL_MSG( "No valid EventReader installed!" ); - REPORT_FATAL_MSG( "The reason is : " << reader->getInfoString() ); - assert( 0 ); - } - - //initialise the zero suppression flag to true, which is the more common - will be set from the configuration - m_doZeroSuppression = true; - - } - - Lvl1Mibak::~Lvl1Mibak() { - - REPORT_VERBOSE_MSG( "Destructor called" ); - std::list< MioctModule* >::iterator it; - for( it = m_lvl1MioctList.begin(); it != m_lvl1MioctList.end(); it++ ) { - delete *it; - } - delete m_mictpModule; - delete m_mirodModule; - delete m_lvl1OverlapLogic; - delete m_multiplicityLogic; - } - - MioctModule* Lvl1Mibak::getMioctModule( MioctID findId ) const { - - std::list< MioctModule* >::const_iterator it; - for( it = m_lvl1MioctList.begin(); it != m_lvl1MioctList.end(); ++it ) { - MioctID mioctID = (*it)->getMioctID(); - if( mioctID.getNumber() == findId.getNumber() && - mioctID.getRapidityRegion() == findId.getRapidityRegion() ) { - return *it; - } - } - - m_logger << WARNING << "MioctID " << findId << " not known!" - << MsgLogger::endmsg; - return 0; - } - - PtMultiplicitySet Lvl1Mibak::getPtMultiplicity() const { - - std::string preliminaryResult; - std::list< MioctModule* >::const_iterator it; - PtMultiplicitySet result; - REPORT_VERBOSE_MSG( "getPtMultiplicity() called" ); - - for( it = m_lvl1MioctList.begin(); it != m_lvl1MioctList.end(); ++it ) { - result += ( ( *it )->calculateMultiplicity() ); - result.print( preliminaryResult ); - REPORT_VERBOSE_MSG( "Preliminary result : \n" << preliminaryResult ); - } - - return result; - } - - void Lvl1Mibak::setMictpData() { - - // get access to the EventID singleton - EventID eventID; - // get the BCID and ECRC from the EventID singleton - unsigned int BCID = eventID.BCID(); - unsigned int ECRC = eventID.getECRC(); - // get the PtSums - PtMultiplicitySet ptSet = this->getPtMultiplicity(); - - // fill the summed Pt information and the BCID into the MICTP - m_mictpModule->setPtSums( &ptSet, BCID, ECRC ); - - return; - } - - LVL1::MuCTPIL1Topo Lvl1Mibak::getL1TopoCandidates(MioctL1TopoConverter & l1TopoConv) const { - - std::list< MioctModule* >::const_iterator it; - LVL1::MuCTPIL1Topo result; - REPORT_VERBOSE_MSG( "getL1TopoCandidates() called" ); - - for( it = m_lvl1MioctList.begin(); it != m_lvl1MioctList.end(); ++it ) { - result += ( ( *it )->getL1TopoCandidates(l1TopoConv) ); - } - - return result; - } - - - - void Lvl1Mibak::mirodProcessData() { - - const MibakStreamEvent* theStream = this->getMibakData(); - m_mirodModule->processData( theStream ); - - return; - } - - - const MibakStreamEvent* Lvl1Mibak::getMibakData() { - - // make sure the cointainers of the StreamEvent are empty -------- - m_mibakStream.highBits.clear(); - m_mibakStream.dataWords.clear(); - - // fill in the MICTP data - const MictpData* mictpData = m_mictpModule->getMictpOnMibak(); - const std::list<unsigned int>* mictpHighBits = mictpData->getHighBits(); - const std::list<unsigned int>* mictpDataWords = mictpData->getDataWords(); - std::list<unsigned int>::const_iterator it_mictpHighBits = mictpHighBits->begin(); - std::list<unsigned int>::const_iterator it_mictpDataWords = mictpDataWords->begin(); - for( ; it_mictpHighBits != mictpHighBits->end(); ++it_mictpHighBits ) { - - m_mibakStream.highBits.push_back( *it_mictpHighBits ); - m_mibakStream.dataWords.push_back( *it_mictpDataWords ); - - ++it_mictpDataWords; // increase also the data word iterator - } - - // Loop over the MIOCT Modules ------------------------------------ - std::list<MioctModule*>::const_iterator it_mioctModule; - for( it_mioctModule = m_lvl1MioctList.begin(); - it_mioctModule != m_lvl1MioctList.end(); ++it_mioctModule ) { - - // get pointer to the data of this MIOCT - MioctData* mioctData = ( (*it_mioctModule)->getMioctOnMibak() ); - - // the Header of this MIOCT - m_mibakStream.highBits.push_back( mioctData->getStartMarker() ); - m_mibakStream.dataWords.push_back( mioctData->getHeader() ); - - // loop over the sectors of this MIOCT and do zero - // suppression if requested - const std::vector< unsigned int >* mioctSectorWords = mioctData->getSectorWords(); - const std::vector< unsigned int >* mioctSectorHighBits = - mioctData->getSectorHighBits(); - if( mioctSectorWords->size() > SECTORS_IN_MIOCT ) { - REPORT_FATAL_MSG( "Too many sectors transmitted by MIOCT!!!" ); - assert( 0 ); - } - if( mioctSectorWords->size() != mioctSectorHighBits->size() ) { - REPORT_FATAL_MSG( "Size of vectors in MioctData differ!!!" ); - assert( 0 ); - } - std::vector< unsigned int >::const_iterator it_sectorWords = - mioctSectorWords->begin(); - std::vector< unsigned int >::const_iterator it_sectorHighBits = - mioctSectorHighBits->begin(); - unsigned int secCount = 0; // sector counter reset - for( ; it_sectorWords != mioctSectorWords->end(); ++it_sectorWords ) { - // The bit sequence 111 signalls that there is no candidate. - // This variable is ony true, if at least one candidate's pt - // value is different from 111 - bool notEmpty = ( ( *it_sectorWords ) & Pt1and2Mask ) ^ Pt1and2Mask; - - if ( notEmpty || !m_doZeroSuppression ) { - ++secCount; - m_mibakStream.highBits.push_back( *it_sectorHighBits ); - m_mibakStream.dataWords.push_back( *it_sectorWords ); - } - - ++it_sectorHighBits; - } // end of sector loop - - // the Trailer of this MIOCT - m_mibakStream.highBits.push_back( mioctData->getEndMarker() ); - // First fill the word count into the trailer word if zero - // suppression was applied, than get the trailer pointer - if ( m_doZeroSuppression ) { - mioctData->setTrailerWordCount( secCount + 2 ); - } - m_mibakStream.dataWords.push_back( mioctData->getTrailer() ); - - } // end of MIOCT loop ------------------------------------------- - - return &m_mibakStream; - } - - void Lvl1Mibak::setOverlapStrategy( StrategyName newStrategy ) { - - REPORT_VERBOSE_MSG( "setOverlapStrategy() called" ); - m_lvl1OverlapLogic->changeStrategy( newStrategy ); - return; - } - - std::string Lvl1Mibak::getOverlapStrategyName() const { - - REPORT_VERBOSE_MSG( "getOverlapStrategy() called" ); - return m_lvl1OverlapLogic->getCurrentStrategyName(); - } - - void Lvl1Mibak::setConfiguration( const Configuration &conf ) { - - // Zero Suppression Flag - m_doZeroSuppression = conf.getDoZeroSuppression(); - - // configure MIROD - m_mirodModule->setConfiguration(conf); - return; - } - - StatusCode Lvl1Mibak::initializeLUTOverlapStrategy( const std::string& lutXMLFile, - bool flagMode, bool dumpLut, - const std::string& runPeriod ) { - - CHECK( m_lvl1OverlapLogic->initializeLUT( lutXMLFile, flagMode, dumpLut, runPeriod ) ); - return StatusCode::SUCCESS; - } - - void Lvl1Mibak::setMultiplicityStrategy( MultiplicityCalcType type ) { - - REPORT_VERBOSE_MSG( "setMultiplicityStrategy() called" ); - m_multiplicityLogic->changeStrategy( type ); - return; - } - - void Lvl1Mibak::initializeXMLMultStrategy( const std::string& xmlFile ) { - - m_multiplicityLogic->initializeXML( xmlFile ); - return; - } - - /** - * This function should actually not be here. Teh logic implemented here is - * not happening in the MIBAK in the real hardware, but in a simple NIM logic. - * However programatically it was much easier to put this code here... - * - * The function just checks if any of the octant boards received a barrel - * candidate. - * - * @returns <code>true</code> if any of the octant boards saw a barrel candidate, - * <code>false</code> otherwise - */ - bool Lvl1Mibak::hasBarrelCandidate() const { - - // Return true if any of the boards saw such a candidate: - std::list< MioctModule* >::const_iterator itr = m_lvl1MioctList.begin(); - std::list< MioctModule* >::const_iterator end = m_lvl1MioctList.end(); - for( ; itr != end; ++itr ) { - if( ( *itr )->hasBarrelCandidate() ) { - return true; - } - } - - // If no board saw such a candidate, return false: - return false; - } - - /** - * This function should actually not be here. Teh logic implemented here is - * not happening in the MIBAK in the real hardware, but in a simple NIM logic. - * However programatically it was much easier to put this code here... - * - * The function just checks if any of the octant boards received an endcap - * candidate. - * - * @returns <code>true</code> if any of the octant boards saw an endcap candidate, - * <code>false</code> otherwise - */ - bool Lvl1Mibak::hasEndcapCandidate() const { - - // Return true if any of the boards saw such a candidate: - std::list< MioctModule* >::const_iterator itr = m_lvl1MioctList.begin(); - std::list< MioctModule* >::const_iterator end = m_lvl1MioctList.end(); - for( ; itr != end; ++itr ) { - if( ( *itr )->hasEndcapCandidate() ) { - return true; - } - } - - // If no board saw such a candidate, return false: - return false; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.h deleted file mode 100644 index 1d6d4e5956ae80cf63e4f407fc68c196605ec7f6..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.h +++ /dev/null @@ -1,201 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Lvl1Mibak.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_LVL1MIBAK_H -#define TRIGT1MUCTPI_LVL1MIBAK_H - -// STL include(s): -#include <list> -#include <string> - -// Gaudi/Athena include(s): -#include "GaudiKernel/StatusCode.h" - -// Local include(s): -#include "../Common/SectorConstants.h" -#include "../Common/MultiplicityCalcType.h" -#include "../Logging/MsgLogger.h" -#include "../Common/EventID.h" -#include "../Common/MioctL1TopoConverter.h" -#include "MibakStreamEvent.h" -#include "../Mioct/StrategyName.h" - -// include interface class to L1Topo -#include "TrigT1Interfaces/MuCTPIL1Topo.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class Configuration; - class MioctModule; - class MioctID; - class PtMultiplicitySet; - class MictpModule; - class MirodModule; - class OverlapLogic; - class MultiplicityLogic; - class EventReader; - - /** - * @short This class represents the MIBAK backplane of the MUCTPI Interface. - * - * This class is a model of the Lvl1 part of the MIBAK - * backplane. It contains the 16 MIOCT modules which have - * corresponding representations in software and - * hardware. Differently from the hardware implementation it - * is the Lvl1Mibak which contains the OverlapLogic used by - * all MioctBoards in order to resolve the overlap between - * neighbouring sectors. This choice has been made because - * there is no need to instantiate an overlap Logic for every - * octant board since all octant boards use the same strategy - * to resolve overlapping muon candidates. Different - * Strategies can be chosen via a member function. The - * possible strategies are listed in StrategyName.h - * - * @see MioctModule - * @see OverlapLogic - * @see OverlapStrategy - * @see StrategyName.h - * @see PtMultiplicitySet - * - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class Lvl1Mibak { - - public: - /** - * In the constructor the NullStrategy (no consideration of Overlap) - * will be installed as a default for the OverlapLogic. The user has - * to change the Strategy via a call to setOverlapStrategy() if he - * wants differnt strategies to be applied. - * @see OverlapLogic - * @see OverlapStrategy - * @see NullStrategy - * @see StrategyName.h - */ - Lvl1Mibak( EventReader* reader ); - - // disable copy/assignment operator as not used/implemented - Lvl1Mibak( const Lvl1Mibak & ) = delete; - Lvl1Mibak & operator = ( const Lvl1Mibak & ) = delete; - - ~Lvl1Mibak(); - - /// set Configuration - void setConfiguration( const Configuration &conf ); - - /** - * Read back a point to MioctModule specified by MioctID in the - * Argument - * @see MioctModule - * @see MioctID - */ - MioctModule* getMioctModule( MioctID id ) const; - /** - * This function determines the Pt multiplicity of the muon candidates - * for each pt-threshold independently. Like in the hardware the - * multiplicities satureate at a count of 7. - * @return PtMultiplicitySet The pt-multiplicities for six different - * pt-thresholds calculated over all muon trigger chambers. - * @see PtMultiplicitySet - * @see OverlapLogic - * @see OverlapStrategy - */ - PtMultiplicitySet getPtMultiplicity() const; - /** - * This method fills the information obtained from the MIOCT Modules into - * the MICTP - */ - void setMictpData(); - /** - * Get access to the MictpModule - * @return Pointer to the MictpModule - */ - MictpModule* getMictp() { return m_mictpModule; } - /** - * Get access to the MirodModule - * @return Pointer to the MirodModule - */ - MirodModule* getMirod() { return m_mirodModule; } - /** - * This method fills the information obtained from the MIOCT - * the MICTP boards into the MIROD - */ - void mirodProcessData(); - /** - * This function return a pointer to an object allowing access to - * the data of this event in Mibak format. - * @return Pointer to MibakData object allowing access - * to the data of this event in Mibak format - */ - const MibakStreamEvent* getMibakData(); - /** - * This method just returns the pointer to the MibakStreamEvent, without - * doing any processing - * @return Pointer to MibakStreamEvent - */ - const MibakStreamEvent* getMibakStreamEvent() { return &m_mibakStream; } - - LVL1::MuCTPIL1Topo getL1TopoCandidates(MioctL1TopoConverter & l1TopoConv ) const; - - /** - * This function changes the current OverlapStrategy for the - * OverlapLogic of the Lvl1Mibak. - * @param newStrategy As listed in StrategyName.h - * @see OverlapLogic - * @see OverlapStrategy - * @see StrategyName.h - */ - void setOverlapStrategy( StrategyName newStrategy ); - /** - * Return the name of the currently selected OverlapStrategy in - * the Overlap Logic. - * @see OverlapLogic - * @see OverlapStrategy - */ - std::string getOverlapStrategyName() const; - /** - * Initialize the LUT strategy from the given file. - * @see LUTStrategy - * @see LUTStructure - */ - StatusCode initializeLUTOverlapStrategy( const std::string& lutXMLFile, - bool flagMode, bool dumpLut, - const std::string& runPeriod ); - - void setMultiplicityStrategy( MultiplicityCalcType type ); - void initializeXMLMultStrategy( const std::string& xmlFile ); - - bool getZeroSuppression() const { return m_doZeroSuppression; } - void setZeroSuppression( bool value ) { m_doZeroSuppression = value; } - - /// Is there at least one barrel candidate in the event? - bool hasBarrelCandidate() const; - /// Is there at least one endcap candidate in the event? - bool hasEndcapCandidate() const; - - private: - mutable MsgLogger m_logger; - std::list<MioctModule*> m_lvl1MioctList; - MictpModule* m_mictpModule; - MirodModule* m_mirodModule; - OverlapLogic* m_lvl1OverlapLogic; - MultiplicityLogic* m_multiplicityLogic; - EventID m_eventID; - MibakStreamEvent m_mibakStream; - bool m_doZeroSuppression; - EventReader* m_eventReader; - - }; // class Lvl1Mibak - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LVL1MIBAK_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.cxx deleted file mode 100644 index 20b03642433d7f6b3472fa21e833f6e8ef3462bb..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.cxx +++ /dev/null @@ -1,357 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MibakStreamEvent.cxx 364083 2011-05-06 09:09:55Z krasznaa $ - -// STL include(s): -#include <cassert> -#include <iomanip> -#include <fstream> -#include <sstream> - -// Local include(s): -#include "MibakStreamEvent.h" -#include "../Mirod/MirodExtractor.h" -#include "../Common/BitOp.h" -#include "../Common/MuctpiBitMasks.h" -#include "../Mirod/MirodTestRamIn.h" - -/******************************************************************* - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - * - * Implementation of class MibakStreamEvent - * @author Author: Thorsten Wengler - * @version $Revision: 364083 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // the constructor - MibakStreamEvent::MibakStreamEvent() - : m_logger( "MibakStreamEvent" ) { - - } - - // method to print the event - void MibakStreamEvent::printEvent( const std::string& format ) const { - - unsigned int wordCount = 0; - unsigned int moduleCount = 0; - std::list< unsigned int >::const_iterator it_high = highBits.begin(); - std::list< unsigned int >::const_iterator it_data = dataWords.begin(); - for( ; it_data != dataWords.end(); ++it_data ) { - - std::ostringstream message; - - if( format == "hex" ) { - message << std::hex << ( *it_high ) << std::setw( 8 ) << ( *it_data ); - } else if( format == "bin" ) { - - std::string printout; - BitOp::printBinN( ( *it_high ), 3, printout ); - BitOp::printBin( ( *it_data ), printout ) ; - message << printout; - - } else if( format == "human" ) { - - if( ( *it_high ) == MioctStartMask ) { // Module start - - ++moduleCount; - wordCount = 0; - if( moduleCount == 1 ) { // MICTP header - message << " ==================================================" - << "=========================" << std::endl; - message << " MiBaK | MICTP Header -> ID: " - << BitOp::getValue( &( *it_data ), MictpIDPositionMask ); - message << " EvID: " << std::dec << std::setw( 8 ) - << BitOp::getValue( &( *it_data ), MictpEvIDMask ); - } else { // MIOCT header - message << " --------------------------------------------------" - << "-------------------------" << std::endl; - message << " MIOCT Header -> MNBR: " << std::setw( 2 ) - << BitOp::getValue( &( *it_data ), MioctMNBRMask ); - message << " EvID: " << std::dec << std::setw( 8 ) - << BitOp::getValue( &( *it_data ), MioctEvIDMask ); - message << " BcID: " << std::dec << std::setw( 4 ) - << BitOp::getValue( &( *it_data ), MioctBcIDMask ); - message << std::endl; - } - - } else if( ( *it_high ) == MioctEndMask ) { // Module End - - if( moduleCount == 1 ) { // MICTP trailer - message << " MICTP Trailer -> "; - message << " Sum6: " << BitOp::getValue( &( *it_data ), MictpTrailerSum6Mask ); - message << " Sum5: " << BitOp::getValue( &( *it_data ), MictpTrailerSum5Mask ); - message << " Sum4: " << BitOp::getValue( &( *it_data ), MictpTrailerSum4Mask ); - message << " Sum3: " << BitOp::getValue( &( *it_data ), MictpTrailerSum3Mask ); - message << " Sum2: " << BitOp::getValue( &( *it_data ), MictpTrailerSum2Mask ); - message << " Sum1: " << BitOp::getValue( &( *it_data ), MictpTrailerSum1Mask ); - message << std::endl; - message << " MICTP Trailer -> Status: "; - std::string messageString; - BitOp::printBinN( BitOp::getValue( &( *it_data ), MictpTrailerFlagsMask ), 3, messageString ); - message << messageString; - message << " WordCount: " << BitOp::getValue( &( *it_data ), MictpTrailerWordsMask ); - message << std::endl; - } else { // MIOCT trailer - message << " MIOCT Trailer -> "; - message << " Sum6: " << BitOp::getValue( &( *it_data ), MictpTrailerSum6Mask ); - message << " Sum5: " << BitOp::getValue( &( *it_data ), MictpTrailerSum5Mask ); - message << " Sum4: " << BitOp::getValue( &( *it_data ), MictpTrailerSum4Mask ); - message << " Sum3: " << BitOp::getValue( &( *it_data ), MictpTrailerSum3Mask ); - message << " Sum2: " << BitOp::getValue( &( *it_data ), MictpTrailerSum2Mask ); - message << " Sum1: " << BitOp::getValue( &( *it_data ), MictpTrailerSum1Mask ); - message << std::endl; - message << " MIOCT Trailer -> Status: "; - std::string messageString; - BitOp::printBinN( BitOp::getValue( &( *it_data ), MictpTrailerFlagsMask ), 3, messageString ); - message << messageString; - message << " WordCount: " << BitOp::getValue( &( *it_data ), MictpTrailerWordsMask ); - message << std::endl; - } - - } else { // Module data - - ++wordCount; - if( moduleCount == 1 ) { // MICTP data - - if( wordCount == 1 ) { // second MICTP header word - - message << " BcID: " << std::dec << std::setw( 4 ) - << BitOp::getValue( &( *it_data ), MictpBcIDMask ); - message << " ECRC: " << std::dec << std::setw( 4 ) - << BitOp::getValue( &( *it_data ), MictpECRCMask ); - message << " Mon: " << std::dec << std::setw( 1 ) - << BitOp::getValue( &( *it_data ), MictpMonitorMask ); - message << " TrTy: " << std::dec << std::setw( 1 ) - << BitOp::getValue( &( *it_data ), MictpTrTypeMask ); - message << std::endl; - - } else { // MICTP data word - - message << " MICTP -> BcID: " << BitOp::getValue( &( *it_data ), BCIDMask ); - message << " Sum6: " << BitOp::getValue( &( *it_data ), MictpSum6Mask ); - message << " Sum5: " << BitOp::getValue( &( *it_data ), MictpSum5Mask ); - message << " Sum4: " << BitOp::getValue( &( *it_data ), MictpSum4Mask ); - message << " Sum3: " << BitOp::getValue( &( *it_data ), MictpSum3Mask ); - message << " Sum2: " << BitOp::getValue( &( *it_data ), MictpSum2Mask ); - message << " Sum1: " << BitOp::getValue( &( *it_data ), MictpSum1Mask ); - message << std::endl; - - } - - } else { // MIOCT data - - message << " SNBR: " << std::dec << ( *it_high ) << " data: "; - std::string messageString; - BitOp::printBin( *it_data, messageString ); - message << messageString << std::endl; - - } - - REPORT_VERBOSE_MSG( message.str() ); - - } - - } else { - REPORT_FATAL_MSG( "Non-existent print method choosen" ); - assert( 0 ); - } - ++it_high; // also increase counter for highBits list - } - if ( format == "human" ) { - REPORT_VERBOSE_MSG( " ===========================================================================" ); - } - - return; - } - - void MibakStreamEvent::setEvent( const std::list< unsigned int >& inputHighBits, - const std::list< unsigned int >& inputDataWords ) { - - highBits.clear(); - dataWords.clear(); - - highBits = inputHighBits; - dataWords = inputDataWords; - - prepareMirodTestRamInput(); - - return; - } - - void MibakStreamEvent::readFromFile( const std::string& fileName ) { - - unsigned int long long inputWord = 0; - unsigned int dataWordLow; - unsigned int dataWordHigh; - std::ifstream inFile( fileName.c_str() ); - - // clear the lists holding the event information - // m_internalDataWords.clear(); - highBits.clear(); - dataWords.clear(); - - // read the file and fill the lists - inFile >> std::hex >> inputWord; - while( ! inFile.eof() ) { - - dataWordLow = inputWord & 0xffffffff; - dataWordHigh = ( inputWord >> 32 ) & 0x0000000f; - - // m_internalDataWords.push_back( dataWordLow ); - highBits.push_back( dataWordHigh ); - dataWords.push_back( dataWordLow ); - inFile >> std::hex >> inputWord; - } - - /* - list<unsigned int>::const_iterator it_intDaWo ; - for ( it_intDaWo = m_internalDataWords.begin(); - it_intDaWo != m_internalDataWords.end(); - ++it_intDaWo ) { - dataWords.push_back( &( *it_intDaWo ) ) ; - } - */ - - return; - } - - // get the input for the Mirod test ram - MirodTestRamIn MibakStreamEvent::getMirodTestRamInput() const { - - MirodTestRamIn testRamInput; - this->prepareMirodTestRamInput(); - testRamInput.dataLow( m_mirodTestDataLow ); - testRamInput.dataHigh( m_mirodTestDataHigh ); - testRamInput.dataControl( m_mirodTestControl ); - - return testRamInput; - } - - // method to print lists that can be used as input for the MIROD testram - void MibakStreamEvent::printMirodTestRamInput( const std::string& fileName ) { - - std::list< unsigned int >::const_iterator it_TeDaHi; - std::list< unsigned int >::const_iterator it_TeDaLo; - std::list< unsigned int >::const_iterator it_TeCtrl; - - if( fileName == "screen" ) { - - it_TeDaHi = m_mirodTestDataHigh.begin(); - it_TeCtrl = m_mirodTestControl.begin(); - for( it_TeDaLo = m_mirodTestDataLow.begin(); it_TeDaLo != m_mirodTestDataLow.end(); ++it_TeDaLo ) { - - m_logger << INFO << std::hex << std::setw( 3 ) << ( *it_TeDaHi ) << " " - << std::setw( 6 ) << ( *it_TeDaLo ) - << " " << ( *it_TeCtrl ) << MsgLogger::endmsg; - - ++it_TeDaHi; - ++it_TeCtrl; - - } - - } else { - - const std::string dataFile = fileName + "_data.dat"; - const std::string ctrlFile = fileName + "_ctrl.dat"; - std::ofstream outDataFile( dataFile.c_str() ); - std::ofstream outCtrlFile( ctrlFile.c_str() ); - - if( outDataFile.fail() || outCtrlFile.fail() ) { - REPORT_FATAL_MSG( "Could not open files for MIROD testram" ); - assert( 0 ); - } - it_TeDaHi = m_mirodTestDataHigh.begin(); - it_TeCtrl = m_mirodTestControl.begin(); - for( it_TeDaLo = m_mirodTestDataLow.begin(); it_TeDaLo != m_mirodTestDataLow.end(); ++it_TeDaLo ) { - - outDataFile << std::hex << std::setw( 3 ) << ( *it_TeDaHi ) << std::setw( 6 ) - << ( *it_TeDaLo ) << std::endl; - outCtrlFile << std::hex << std::setw( 2 ) << ( *it_TeCtrl ) << std::endl; - ++it_TeDaHi; - ++it_TeCtrl; - } - } - - return; - } - - // method to prepare lists that can be used as input for the MIROD testram - void MibakStreamEvent::prepareMirodTestRamInput() const { - - m_mirodTestDataLow.clear(); - m_mirodTestDataHigh.clear(); - m_mirodTestControl.clear(); - - unsigned int inputDataLow = 0; - unsigned int inputDataHigh = 0; - unsigned int controlWord = 0; - unsigned int wordCount = 0; - // fill the testData lists from the Mibak Event lists - // first an empty data word and XDTRDY on - controlWord = 0x0000000e; // enable XDTRDY - m_mirodTestDataLow.push_back( 0x00000000 ); - m_mirodTestDataHigh.push_back( 0x00000000 ); - m_mirodTestControl.push_back( controlWord ); - - // now loop over data words and fill lists - std::list< unsigned int >::const_iterator it_HiBi = highBits.begin(); - std::list< unsigned int >::const_iterator it_DaWo = dataWords.begin(); - for ( ; it_DaWo != dataWords.end(); ++it_DaWo ) { - - ++wordCount; - // inputDataHigh consits of bits 0-3 from highBits shifted to - // 8-11, and 24-31 from dataWords shifted to 0-7 - inputDataHigh = 0; - inputDataHigh = ( ( *it_HiBi ) << 8 ); - inputDataHigh |= ( ( ( *it_DaWo ) & 0xff000000 ) >> 24 ); - m_mirodTestDataHigh.push_back( inputDataHigh ); - - // inputDataLow are bits 0-23 from the dataWords list - inputDataLow = 0; - inputDataLow = ( ( *it_DaWo ) & 0x00ffffff ); - m_mirodTestDataLow.push_back( inputDataLow ); - - // handle the control word - // begin module - enable data valid - if ( ( *it_HiBi ) == 0x0000000e ) { - BitOp::clearBit( &controlWord, 2 ); - } - - // at third word XDTRDY is disabled - if( wordCount == 3 ) { - BitOp::clearBit( &controlWord, 1 ); - } - - // for last word token back must be enabled and disabled again - if( ( ( *it_HiBi ) == 0x0000000f ) && ( it_DaWo == --( dataWords.end() ) ) ) { - BitOp::setBit( &controlWord, 0 ); // enable token back - } - - m_mirodTestControl.push_back( controlWord ); - - // end module - add additional empty word with data valid disabled - if( ( *it_HiBi ) == 0x0000000f ) { - m_mirodTestDataLow.push_back( 0x00000000 ); - m_mirodTestDataHigh.push_back( 0x00000000 ); - BitOp::clearBit( &controlWord, 0 ); // disable token back - BitOp::setBit( &controlWord, 2 ); - m_mirodTestControl.push_back( controlWord ); - } - - ++it_HiBi; // also increase iterator for high bits - } - - // add one more empty word in the end - controlWord = 0x0000000c; // data valid off - m_mirodTestDataLow.push_back( 0x00000000 ); - m_mirodTestDataHigh.push_back( 0x00000000 ); - m_mirodTestControl.push_back( controlWord ); - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.h deleted file mode 100644 index 123a57d2ad967d5d6df5cd3e1fa0bc7c48ce8446..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.h +++ /dev/null @@ -1,130 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MibakStreamEvent.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIBAKSTREAMEVENT_H -#define TRIGT1MUCTPI_MIBAKSTREAMEVENT_H - -// STL include(s): -#include <list> -#include <string> - -// Local include(s): -#include "../Logging/MsgLogger.h" - -// Forward declaration(s): -class MirodTestRamIn; - -namespace LVL1MUCTPI { - - /** - * @short Class containing one event in MIBAK format - * - * This class constitutes the interface in the software - * to the MIORD read out driver. It contains all - * information of the event in the format found on the - * the MIBAK. It is filled by method getMibakData() in - * class Lvl1Mibak, which takes as an argument whether - * or not there should be zero suppression. - * - * @see Lvl1Mibak - * @author Thorsten Wengler - * - * $Revision: 364083 $ - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - */ - class MibakStreamEvent { - - public: - /** - * since this is just a data container the data members of this - * class are exceptionally public - */ - std::list< unsigned int > highBits; - std::list< unsigned int > dataWords; - /** - * The constructor of MibakStreamEvent - */ - MibakStreamEvent(); - /** - * This method prints the event to the screen. The parameter - * determines if the printout will be in binary, hexadecimal - * or human readable format. Consequently the choices are - * "hex", "bin" or "human" - * @param format Determines if the printout will be in - * binary or hexadecimal format. Choices are "hex", "bin", "human" - */ - void printEvent( const std::string& format ) const; - /** - * Service which allows to set the data in this class directly, i.e. - * feed the datastream into the system at this point. Since in normal - * operation part of the data consists of pointers to previous - * processing, another list is needed to store the data words in this - * case. - * @param inputHighBits list of the data words - * @param inputDataWords list of the data words - */ - void setEvent( const std::list< unsigned int >& inputHighBits, - const std::list< unsigned int >& inputDataWords ); - /** - * method to read event from file. The format of the file is identical - * to the one expected by the MIROD testram controller, since the - * main use of this function is to read such files - * @param fileName name of the file to read - */ - void readFromFile( const std::string& fileName ); - /** - * Get the test ram input for the Mirod in object format for - * easier handling - some data copying out of lazyness, but - * speed is unimportant for this use case. - */ - MirodTestRamIn getMirodTestRamInput() const; - /** - * This method returns a pointer to the list MirodTestDataLow - */ - const std::list< unsigned int >* getMirodTestDataLow() const { return &m_mirodTestDataLow; } - /** - * This method returns a pointer to the list MirodTestDataLow - */ - const std::list< unsigned int >* getMirodTestDataHigh() const { return &m_mirodTestDataHigh; } - /** - * This method returns a pointer to the list MirodTestDataLow - */ - const std::list< unsigned int >* getMirodTestControl() const { return &m_mirodTestControl; } - /** - * this method prints the data prepared in the prepareMiordTestRamInput - * method to either the screen or two files - * @param fileName either "screen" for terminal output or filename root, - * which is used to for the two files root_data.dat and root_ctrl.dat - */ - void printMirodTestRamInput( const std::string& fileName ); - - private: - mutable MsgLogger m_logger; - // - // The mirod test memory data members are declared mutable, as it should be allowed to - // synchronize them to the "highBits" and "dataWords" data members even when only having - // a constant reference to the object. - // - mutable std::list< unsigned int > m_mirodTestDataLow; - mutable std::list< unsigned int > m_mirodTestDataHigh; - mutable std::list< unsigned int > m_mirodTestControl; - - /** - * This method fills two lists in a format suitable for loading the - * event into the MIROD testram. The hardware test library expects - * the lower bits to be 0-23 , and the higher bits above that , so - * the lists are constructed accordingly. Another list holds the - * corresponding control words emulating the MIBAK controls in the - * the testram - */ - void prepareMirodTestRamInput() const; - - }; // class MibakStreamEvent - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIBAKSTREAMEVENT_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.cxx deleted file mode 100644 index 3b0ea7e07a695eda8f15eef6fa54a6e51ab3aa1c..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.cxx +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MictpData.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// Local include(s): -#include "MictpData.h" - -/******************************************************************* - * $Date: 2015-10-13 16:13:15 +0200 (Tue, 13 Oct 2015) $ - * - * Implementation of class MictpData - * @author Author: Thorsten Wengler - * @version $Revision: 700318 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - MictpData::MictpData(): m_highBits(nullptr),m_dataWords(nullptr) { - - } - - MictpData::~MictpData() { - - } - -} diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.h deleted file mode 100644 index 33226b261796e6c8d9843141b76f52df4312e583..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.h +++ /dev/null @@ -1,85 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MictpData.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_MICTPDATA_H -#define TRIGT1MUCTPI_MICTPDATA_H - -// STL include(s): -#include <list> - -namespace LVL1MUCTPI { - - /** - ******************************************************************* - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Helper class for access of MICTP data in MIBAK format - * - * MictpData is a helper class to provide easy access - * of the data of the MICTP module in the format as seen - * on the MIBAK backplane by the Read Out Driver MIROD. - * - * @see MictpModule - * @author Thorsten Wengler - * @version $Revision: 362102 $ - * - ******************************************************************* - */ - class MictpData { - - public: - /** - * The constructor of MictpData - */ - MictpData(); - /** - * This method sets the pointer to the highBits list in the - * MictpModule - * @see MictpModule - * @param thehighBits Pointer to the list of highBits - * in the MictpModule - */ - void setHighBits( const std::list< unsigned int >* thehighBits ) { m_highBits = thehighBits; } - /** - * This method sets the pointer to the dataWords list in the - * MictpModule - * @see MictpModule - * @param theDataWords Pointer to the list of dataWords - * in the MictpModule - */ - void setDataWords( const std::list< unsigned int >* theDataWords ) { m_dataWords = theDataWords; } - /** - * This method gets the pointer to the highBits list in the - * MictpModule - * @see MictpModule - * @return Pointer to the list of highBits - * in the MictpModule - */ - const std::list< unsigned int >* getHighBits() const { return m_highBits; } - /** - * This method gets the pointer to the dataWords list in the - * MictpModule - * @see MictpModule - * @return Pointer to the list of dataWords - * in the MictpModule - */ - const std::list< unsigned int >* getDataWords() const { return m_dataWords; } - /** - * The destructor of MictpData - */ - ~MictpData(); - - private: - const std::list< unsigned int >* m_highBits; - const std::list< unsigned int >* m_dataWords; - - }; // class MictpData - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MICTPDATA_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.cxx deleted file mode 100644 index 72e02e14c35e165957b16a0dcc4e5f43c40f1eca..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MictpModule.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// Local include(s): -#include "MictpModule.h" -#include "../Common/BitOp.h" -#include "../Common/PtMultiplicitySet.h" -#include "../Common/MuctpiBitMasks.h" - -/******************************************************************* - * $Date: 2015-10-13 16:13:15 +0200 (Tue, 13 Oct 2015) $ - * - * Implementation of class MictpModule - * @author Author: Thorsten Wengler - * @version $Revision: 700318 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor of class MictpModule - MictpModule::MictpModule() - : m_CTPDataWord(0), m_logger("MictpModule") { - - REPORT_VERBOSE_MSG( "Constructor called" ); - - m_mictpData.setHighBits( &m_highBits ); - m_mictpData.setDataWords( &m_dataWords ); - } - - void MictpModule::setPtSums( PtMultiplicitySet* ptSums, unsigned int BCID, unsigned int ECRC ) { - - unsigned int inputWord = 0; - - // clear the data - m_highBits.clear(); - m_dataWords.clear(); - - // the first header word: MICTP ID and EventID and add to list - BitOp::sImposeNBits( &inputWord, 28, MictpIDMask ); - BitOp::sImposeNBits( &inputWord, 0, m_eventID.getEvID() ); - m_highBits.push_back( MioctStartMask ); - m_dataWords.push_back( inputWord ); - inputWord = 0; - - // the second headerword; monitor bit, trigger type and BCID - BitOp::sImposeNBits( &inputWord, 28, m_eventID.getMonitorEvent() ); - BitOp::sImposeNBits( &inputWord, 20, m_eventID.getTriggerType() ); - BitOp::sImposeNBits( &inputWord, 12, ( ECRC & 0xff ) ); - BitOp::sImposeNBits( &inputWord, 0, ( BCID & 0xfff ) ); - m_highBits.push_back( 0x0 ); - m_dataWords.push_back( inputWord ); - inputWord = 0; - - // the data word: BCID and Ptsums - BitOp::sImposeNBits( &inputWord, 0, ptSums->getMultiplicity( 1 ) ); - BitOp::sImposeNBits( &inputWord, 3, ptSums->getMultiplicity( 2 ) ); - BitOp::sImposeNBits( &inputWord, 6, ptSums->getMultiplicity( 3 ) ); - BitOp::sImposeNBits( &inputWord, 9, ptSums->getMultiplicity( 4 ) ); - BitOp::sImposeNBits( &inputWord, 12, ptSums->getMultiplicity( 5 ) ); - BitOp::sImposeNBits( &inputWord, 15, ptSums->getMultiplicity( 6 ) ); - - // this is the word sent to the CTP (no BCID) - // It's important to observe that the first bit in the word is not used. - // This is just how the hardware works... - m_CTPDataWord = inputWord; - m_CTPDataWord <<= 1; - - BitOp::sImposeNBits( &inputWord, 27, ( BCID & 0x7 ) ); // only 3 lowest bits - m_highBits.push_back( 0x0 ); - m_dataWords.push_back( inputWord ); - inputWord = 0; - - // The trailer word: Ptsums, flags (dummy so far), word count - BitOp::sImposeNBits( &inputWord, 10, ptSums->getMultiplicity( 1 ) ); - BitOp::sImposeNBits( &inputWord, 13, ptSums->getMultiplicity( 2 ) ); - BitOp::sImposeNBits( &inputWord, 16, ptSums->getMultiplicity( 3 ) ); - BitOp::sImposeNBits( &inputWord, 19, ptSums->getMultiplicity( 4 ) ); - BitOp::sImposeNBits( &inputWord, 22, ptSums->getMultiplicity( 5 ) ); - BitOp::sImposeNBits( &inputWord, 25, ptSums->getMultiplicity( 6 ) ); - unsigned int flags = 0; - BitOp::sImposeNBits( &inputWord, 7, flags ); - unsigned int wordCount = m_dataWords.size() + 1; - BitOp::sImposeNBits( &inputWord, 0, wordCount ); - m_highBits.push_back( MioctEndMask ); - m_dataWords.push_back( inputWord ); - inputWord = 0; - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.h deleted file mode 100644 index 714c155411637a61b2e7d0decd50ced988c82b67..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.h +++ /dev/null @@ -1,93 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MictpModule.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_MICTPMODULE_H -#define TRIGT1MUCTPI_MICTPMODULE_H - -// STL include(s): -#include <list> - -// Local include(s): -#include "MictpData.h" -#include "../Common/EventID.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class PtMultiplicitySet; - - /** - * @short Contains all relevant entities of the MICTP board - * - * The MictpModule class groups together all relevant - * entities for the interface board MICTP of the MUCTPI - * to the Central Trigger Processor. It provides service - * to extract the data delivered to the CTP and to the - * Read Out Driver board MIROD. The MICTP gets its - * information from the MioctModule objects, via the - * MIBAK. Also in the software the MictpModule class is - * filled by a call to the method getPtMultiplicity in - * class Lvl1Mibak. There is only one MICTP board in the - * system. - * - * @see MiordModule - * @see MioctModule - * @see Lvl1Mibak - * - * @author Thorsten Wengler - * - * $Revision: 364083 $ - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - */ - class MictpModule { - - public: - /** - * The constructor of MictpModule - */ - MictpModule(); - /** - * This method sets the Pt sums for all thresholds in the data - * and the BCID that goes with it. The trailor word will hold - * the Pt sums of the middle word, as the BCIDs to be read - * out are opend up in symmetrical steps of 1 on either side - * @param thePtSums Pointer to the total sum of pt - * candidates per threshold calculated - * from all MIOCTS - * @param BCID corresponding Bunch Id - * @param ECRC corresponding to Event Counter - * Reset Counter - */ - void setPtSums( PtMultiplicitySet* thePtSums, unsigned int BCID, unsigned int ECRC ); - /** - * method to get the word sent by the Mictp to the CTP - * @return CTP Data Word - */ - unsigned int getMictpCTPWord() const { return m_CTPDataWord; } - /** - * This method return the data stored in the MictpModule as a - * MictpData object, which groups the data for easy access in the - * format found on the MIBAK backplane - * @return data stored in the MICTP for easy access in - * MIBAK format - */ - const MictpData* getMictpOnMibak() { return &m_mictpData; } - - private: - std::list< unsigned int > m_highBits; - std::list< unsigned int > m_dataWords; - MictpData m_mictpData; - unsigned int m_CTPDataWord; - EventID m_eventID; - mutable MsgLogger m_logger; - - }; // class MictpModule - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MICTPMODULE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.cxx deleted file mode 100644 index bd768d4f021f690e3466914e63df645b9a786fdb..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.cxx +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: BarrelSector.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// STL include(s): -#include <iomanip> -#include <sstream> - -// Local include(s): -#include "BarrelSector.h" -#include "../Common/SectorConstants.h" -#include "EventReader.h" - -namespace LVL1MUCTPI { - - const unsigned int BarrelSector::MIN_SECTOR = MIN_BARREL_SECTOR; - const unsigned int BarrelSector::MAX_SECTOR = MAX_BARREL_SECTOR; - - BarrelSector::BarrelSector( Hemisphere hemisphere, unsigned int sectorNumber, - EventReader* reader ) - : Sector( hemisphere, sectorNumber, reader ), m_logger( "BarrelSector" ) { - - if( m_sectorNumber > BarrelSector::MAX_SECTOR ) { - m_sectorNumber = (sectorNumber % BarrelSector::MAX_SECTOR) - 1; - } - m_reader->registerSector( this ); - m_registered = true; - } - - BarrelSector::BarrelSector( const BarrelSector& sector ) - : Sector( sector.m_rapidityRegion, sector.m_sectorNumber, sector.m_reader ), - m_logger( "BarrelSector" ) { - - m_bitField = sector.m_bitField; - m_registered = false; - } - - BarrelSector::~BarrelSector() { - - if( m_registered ) m_reader->unregisterSector( this ); - } - - void BarrelSector::set( const unsigned int bitfield ) { - - // check if any of the reservered bits is set. This should not - // be the case. If so, give a warning but set the bitfield anyway. - // these bits are not always respected by the simulation inputs, so skip this - // if( ( BarrelReservedMask & bitfield ) != 0 ) { - // m_logger << WARNING << "illegal bitfield : " << std::hex << bitfield - // << " (hex) --> Bitfield set anyway" << MsgLogger::endmsg; - // } - - m_bitField = bitfield; - return; - - } - - void BarrelSector::print( std::string& result ) const { - - int SecOf, ROI1Of, ROI2Of; - - SecOf = this->getValue( SectorOverflowMask ); - ROI1Of = this->getValue( ROI1OverflowMask ); - ROI2Of = this->getValue( ROI2OverflowMask ); - - std::string myId; - this->printID( myId ); - - std::ostringstream outStream; - outStream << " \n\n BARREL SECTOR DATA $Revision: 700318 $" << std::endl; - outStream << "==============================================" << std::endl; - outStream << myId << std::endl; - outStream << "BCID : " << getBCID() << std::endl; - outStream << "Sector Overflow : " << SecOf << std::endl; - outStream << std::endl; - outStream << " Candidate 1 Candidate 2 " << std::endl; - outStream << " ROI " << getROI1() - << " " << getROI2() << std::endl; - outStream << " Pt " << getPtCand1() - << " " << getPtCand2() << std::endl; - outStream << " ROIOF " << ROI1Of - << " " << ROI2Of << std::endl; - outStream << " Barrel Ov " << isCand1BarrelOverlap() - << " " << isCand2BarrelOverlap() << std::endl; - outStream << " Endcap Ov " << isCand1EndcapOverlap() - << " " << isCand2EndcapOverlap() << std::endl; - outStream << std::endl; - - result = outStream.str(); - - return; - } - - /////////////////////////////////////////////////////////////////////////// - // functions needed only to determine the overlap. They are - // only called by other Barrel Sectors. May be worth declaring - // friends... - /////////////////////////////////////////////////////////////////////////// - - bool BarrelSector::isCand1BarrelOverlap() const { - return static_cast< bool >( this->getValue( BarrelBarrelOverlap1Mask ) ); - } - - bool BarrelSector::isCand2BarrelOverlap() const { - return static_cast< bool >( this->getValue( BarrelBarrelOverlap2Mask ) ); - } - - bool BarrelSector::isCand1EndcapOverlap() const { - return static_cast< bool >( this->getValue( BarrelEndcapOverlap1Mask ) ); - } - - bool BarrelSector::isCand2EndcapOverlap() const { - return static_cast< bool >( this->getValue( BarrelEndcapOverlap2Mask ) ); - } - - unsigned int BarrelSector::getROI1() const { - return this->getValue( BarrelROI1Mask ); - } - unsigned int BarrelSector::getROI2() const { - return this->getValue( BarrelROI2Mask ); - } - - SectorID BarrelSector::getSectorID() const { - return SectorID( BARREL, m_rapidityRegion, m_sectorNumber ); - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.h deleted file mode 100644 index 0c4cc483361f4a906c99fb9bbf33d666732d78f5..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.h +++ /dev/null @@ -1,112 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: BarrelSector.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_BARRELSECTOR_H -#define TRIGT1MUCTPI_BARRELSECTOR_H - -// STL include(s): -#include <string> - -// Local include(s): -#include "../Common/Detector.h" -#include "Sector.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - /** - * @short This class handles an 32-bit Input word from the Barrel Front-End-Electronics. - * - * This class complies to the Sector Interface class. It - * specializes the base class with some decoding functions - * which are special for the Barrel Sector data-format. It - * provides a print facility to view the contents of the - * data-word in readable format. - * - * @see Sector - * @author Thirsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class BarrelSector : public Sector { - - public: - /** - * The only constructor of a Barrel sector, identified by its - * sector number and hemisphere - * @param hemisphere The Hemisphere the sector is in - * @param sectorNumber The sector number - */ - BarrelSector( Hemisphere hemisphere, unsigned int sectorNumber, - EventReader* reader ); - BarrelSector( const BarrelSector& sector ); - BarrelSector & operator = ( const BarrelSector & ) = delete; - ~BarrelSector(); - - /** - * Implementation of the corresponding abstract method in the - * baseclass Sector. - * @see Sector#set - * @param bitField This is the value to which the - * Barrel Sector 32-bit bitfield is set. - * It is checked that none of the reserved bits are set. - */ - void set( const unsigned int bitField ); - /** - * This access funtion retrieves the ROI-number of the first candidate. - */ - unsigned int getROI1() const; - /** - * This access funtion retrieves the ROI-number of the second candidate. - */ - unsigned int getROI2() const; - /** - * Acces function to the bit indicating overlap of the - * first candidate with the neigbouring Barrel Sector. - * @return boolean value of the flag - */ - bool isCand1BarrelOverlap() const; - /** - * Access function to the bit indicating overlap of the - * second candidate with the neigbouring Barrel Sector. - * @return boolean value of the flag - */ - bool isCand2BarrelOverlap() const; - /** - * Access function to the bit indicating overlap of the - * first candidate with a neigbouring Endcap Sector. - * @return boolean value of the flag - */ - bool isCand1EndcapOverlap() const; - /** - * Access function to the bit indicating overlap of the - * second candidate with a neigbouring Endcap Sector. - * @return boolean value of the flag - */ - bool isCand2EndcapOverlap() const; - - void print( std::string& barrelDescription ) const; - std::string getDetectorString() const { return "Barrel"; } - virtual SectorID getSectorID() const; - - private: - mutable MsgLogger m_logger; - - /** - * some constants important for checking the validity of - * the SectorID - */ - static const unsigned int MIN_SECTOR; - static const unsigned int MAX_SECTOR; - - }; // class BarrelSector - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_BARRELSECTOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.cxx deleted file mode 100644 index 67a213fbc70ed393048033368cfba0fdf79c837b..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.cxx +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EndcapSector.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// STL include(s): -#include <iomanip> -#include <sstream> - -// Local include(s): -#include "EndcapSector.h" -#include "EventReader.h" -#include "../Common/MuctpiBitMasks.h" -#include "../Common/SectorConstants.h" - -namespace LVL1MUCTPI { - - const unsigned int EndcapSector::MIN_SECTOR = MIN_ENDCAP_SECTOR; - const unsigned int EndcapSector::MAX_SECTOR = MAX_ENDCAP_SECTOR; - - EndcapSector::EndcapSector( Hemisphere hemisphere, unsigned int sectorNumber, - EventReader* reader ) - : Sector( hemisphere, sectorNumber, reader ), m_logger( "EndcapSector" ) { - - if ( m_sectorNumber > EndcapSector::MAX_SECTOR ) { - m_sectorNumber = ( sectorNumber % EndcapSector::MAX_SECTOR ) - 1; - } - - m_reader->registerSector( this ); - m_registered = true; - } - - EndcapSector::EndcapSector( const EndcapSector& sector ) - : Sector( sector.m_rapidityRegion, sector.m_sectorNumber, sector.m_reader ), - m_logger( "EndcapSector" ) { - - m_bitField = sector.m_bitField; - m_registered = false; - } - - EndcapSector::~EndcapSector() { - - if( m_registered ) m_reader->unregisterSector( this ); - } - - void EndcapSector::set( const unsigned int bitfield ) { - - // check if any of the reservered bits is set. This should not - // be the case. If so, give a warning but set the bitfield anyway. - // these fields are not respected by input simluations, skip - // if( ( EndcapReservedMask & bitfield ) != 0 ) { - // m_logger << WARNING << "illegal bitfield : " << std::hex << bitfield - // << " (hex) --> Bitfield set anyway" << MsgLogger::endmsg; - //} - - m_bitField = bitfield; - return; - } - - bool EndcapSector::isCand1BarrelOverlap() const { - return static_cast< bool >( getValue( EndcapBarrelOverlap1Mask ) ); - } - - bool EndcapSector::isCand2BarrelOverlap() const { - return static_cast< bool >( getValue( EndcapBarrelOverlap2Mask ) ); - } - - unsigned int EndcapSector::getROI1() const { - return getValue( EndcapROI1Mask ); - } - unsigned int EndcapSector::getROI2() const { - return getValue( EndcapROI2Mask ); - } - - void EndcapSector::print( std::string& result ) const { - - int BCID, SecOf, ROI1, ROI2, Pt1, Pt2, ROI1Of, ROI2Of, Ba1Ov, Ba2Ov; - - std::string myId; - this->printID( myId ); - - BCID = this->getValue( BCIDMask ); - SecOf = this->getValue( SectorOverflowMask ); - ROI1 = this->getROI1(); - ROI2 = this->getROI2(); - Pt1 = this->getValue( Pt1Mask ); - Pt2 = this->getValue( Pt2Mask ); - ROI1Of = this->getValue( ROI1OverflowMask ); - ROI2Of = this->getValue( ROI2OverflowMask ); - Ba1Ov = this->isCand1BarrelOverlap(); - Ba2Ov = this->isCand2BarrelOverlap(); - - std::ostringstream outStream; - outStream << " \n\n ENDCAP SECTOR DATA $Revision: 700318 $" << std::endl; - outStream << "==============================================" << std::endl; - outStream << myId << std::endl; - outStream << "BCID : " << BCID << std::endl; - outStream << "Sector Overflow : " << SecOf << std::endl; - outStream << std::endl; - outStream << " Candidate 1 Candidate 2 " << std::endl; - outStream << " ROI " << ROI1 - << " " << ROI2 << std::endl; - outStream << " Pt " << Pt1 - << " " << Pt2 << std::endl; - outStream << " ROIOF " << ROI1Of - << " " << ROI2Of << std::endl; - outStream << " Barrel Ov " << Ba1Ov - << " " << Ba2Ov << std::endl; - outStream << std::endl; - - result = outStream.str(); - return; - - } - - SectorID EndcapSector::getSectorID() const { - - return SectorID( ENDCAP, m_rapidityRegion, m_sectorNumber ); - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.h deleted file mode 100644 index ab132a812f9ace72748c8352056f5c7dfcba2ad4..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.h +++ /dev/null @@ -1,98 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EndcapSector.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_ENDCAPSECTOR_H -#define TRIGT1MUCTPI_ENDCAPSECTOR_H - -// STL include(s): -#include <string> - -// Local include(s): -#include "Sector.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - /** - * @short This class handles an 32-bit Input word from the Endcap Front-End-Electronics. - * - * This class complies to the Sector Interface class. It - * specializes the base class with some decoding functions - * which are special for the Endcap Sector data-format. It - * provides a print facility to view the contents of the - * data-word in readable format. - * - * @see Sector - * @see SectorID - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class EndcapSector : public Sector { - - public: - /** - * The only constructor of an Endcap sector, identified by its - * sector number and hemisphere - * @param hemisphere The Hemisphere the sector is in - * @param sectorNumber The sector number - */ - EndcapSector( Hemisphere hemisphere, unsigned int sectorNumber, - EventReader* reader ); - EndcapSector( const EndcapSector& sector ); - EndcapSector & operator = ( const EndcapSector & ) = delete; - ~EndcapSector(); - /** - * Implementation of the corresponding abstract method in the - * baseclass Sector. - * @see Sector::set() - * @param bitfield This is the value to which the - * Endcap Sector 32-bit bitfield is set. - * It is checked that none of the reserved bits are set. - */ - void set( const unsigned int bitfield ); - /** - * This access funtion retrieves the ROI-number of the first candidate. - */ - unsigned int getROI1() const; - /** - * This access funtion retrieves the ROI-number of the second candidate. - */ - unsigned int getROI2() const; - /** - * Acces function to the bit indicating overlap of the - * first candidate with the neigbouring Barrel Sector. - * @return boolean value of the flag - */ - bool isCand1BarrelOverlap() const; - /** - * Access function to the bit indicating overlap of the - * second candidate with the neigbouring Barrel Sector. - * @return boolean value of the flag - */ - bool isCand2BarrelOverlap() const; - void print( std::string& EndcapDescription ) const; - std::string getDetectorString() const { return "Endcap"; } - virtual SectorID getSectorID() const; - - private: - mutable MsgLogger m_logger; - - /** - * some constants important for checking the validity of - * the SectorID - */ - static const unsigned int MIN_SECTOR; - static const unsigned int MAX_SECTOR; - - }; // class EndcapSector - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_ENDCAPSECTOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.cxx deleted file mode 100644 index e1150cae32b80f3c9ca9b7ad9e423d2fc0c1734f..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.cxx +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventReader.cxx 364083 2011-05-06 09:09:55Z krasznaa $ - -// Local include(s): -#include "EventReader.h" - -namespace LVL1MUCTPI { - - EventReader::EventReader() - : m_logger( "EventReader" ), - m_infoString( "member function isValid() not yet called" ) { - - } - - EventReader::~EventReader() { - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.h deleted file mode 100644 index d658c26cda75162745bc941440a49b396b49b42c..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.h +++ /dev/null @@ -1,108 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventReader.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_EVENTREADER_H -#define TRIGT1MUCTPI_EVENTREADER_H - -// STL include(s): -#include <string> - -// Local include(s): -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class Sector; - class EventSource; - - /** - * @short Interface for classes reading in event data and passing it to the Sectors. - * - * The EventReader is a purely abstract class defining the - * interface for a concrete Event Reader. In addition to its - * two abstract mamber functions it contains a static pointer - * to itself since Event Readers are Singletons. - * - * @see EventReaderFactory - * @see MifFileReader - * @see SimMessageLogger - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 364083 $ - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - */ - class EventReader { - - public: - /** - * This routine checks if the installation of the EventReader - * has been successfull. If it does not return "true" the result - * of putNextEvent() might be useless. In case the method returns - * false getInfoString() can be called in order to find the reason. - * @return true if the EventReader has been correctly installed - * and can be used. - * @see EventReader::getInfoString() - */ - virtual bool isValid() const = 0; - /** - * After a call to isValid() this routine gives back a string which - * contains the reason why the EventReader is not valid. - * @return string contains some text indicating the reason why - * the EventReader is not vaild. - * @see EventReader::isValid() - */ - virtual std::string getInfoString() const = 0; - /** - * If a sector got a pointer to the concrete EventReader it has to - * register with this function so that the concrete EventReader can - * can update the data field of the sector after having read a new - * event. - * @see Sector::set() - */ - virtual void registerSector( Sector* ) = 0; - /** - * If a sector is destroyed it has to notify the EventReader about - * the fact that its existence is about to cease. Therefore a unregister - * method is needed. (The EventReader might live longer than a Sector) - */ - virtual void unregisterSector( Sector* ) = 0; - /** - * This function reads in the data of the next events and stores them - * in the correponding Sectors. - * @return false if the end of the input data is reached (after the - * last successfull event read) - * @see Sector::set() - */ - virtual bool putNextEvent() = 0; - /** - * This method is intended for EventReaders which read events from - * a sequential media. The default implementation does nothing. It - * has been decided to put this method in the EventReader interface - * in order to allow for polymorphism (i.e. in order to allow to - * invoke the method from an EventReader.). This might not be the - * best solution. Anyway, at the moment the method has only been - * implemented in order to play around with the CORBA MUCTPI - * implementation via a demo java application. In the real life - * this method is not expected to be of any use. - */ - virtual void rewind() { } - virtual void setEventSource( EventSource & ) = 0; - - EventReader(); - virtual ~EventReader(); - - protected: - mutable MsgLogger m_logger; - std::string m_infoString; - - }; // class EventReader - -} // namespace LVL1MUCTPI - -#endif // LVL1MUCTPITEST_EVENTREADER_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.cxx deleted file mode 100644 index 266bfc1602b040b8f5531593314e593e822b2500..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.cxx +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventReaderFactory.cxx 472835 2011-12-06 21:05:16Z stelzer $ - -// Local include(s): -#include "EventReaderFactory.h" -#include "EventReader.h" -#include "SectorLogicReader.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - EventReader* EventReaderFactory::getEventReader() { - - MsgLogger logger( "EventReaderFactory" ); - REPORT_MSG2(DEBUG, "Using a SectorLogicReader", logger); - return new SectorLogicReader(); - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.h deleted file mode 100644 index 3d3ee2c3f4e9b0315c9e42b4ffc8200f20627e87..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.h +++ /dev/null @@ -1,64 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventReaderFactory.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_EVENTREADERFACTORY_H -#define TRIGT1MUCTPI_EVENTREADERFACTORY_H - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class EventReader; - - /** - * @short Generates the Event Reader depending on Environment Variable MUCTPI_EVENT_READER. - * - * The EventReaderFactory is responsible for instantiating - * the Event Reader depending on the Environment Variable - * MUCTPI_EVENT_READER. The only allowed value is currently - * MIF_FILE_READER because there is no other concrete - * EventReader implemented at the moment. If the Variable is - * not set, a default Event Reader is instantiated (currently - * the MIF_FILE_READER). - * - * The EventReaderFactory is implemented as a Singleton. It - * is a concrete class but might be changed to an abstract - * class in future resleases. In that case it will correspond - * to the design pattern of an abstract factory of E.Gamma, - * R.Helm, R.Johnson, J.Vlissides "Design Patterns" - * (Addison-Wesley). - * - * @see muon_devil - * @see muon_cooker - * @see EventReader - * @see MifFileReader - * - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 364083 $ - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - */ - class EventReaderFactory { - - public: - /** - * The Event Reader Factory is implemented as a Singleton. This - * static member funtion instantiates the Factory in case it has - * not yet been instantiated. In addition it instantiates a - * concrete Event Reader depending on the value of the Environment - * Variable MUCTPI_EVENT_READER in case it has not been yet - * instantiated. - * - * @return A pointer to the instantiated concrete Event Reader. - */ - static EventReader* getEventReader(); - - }; // class EventReaderFactory - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_EVENTREADERFACTORY_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventSource.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventSource.h deleted file mode 100644 index 2af5226111776b09ead924edeab29770a74280a8..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventSource.h +++ /dev/null @@ -1,53 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: EventSource.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_EVENTSOURCE_H -#define TRIGT1MUCTPI_EVENTSOURCE_H - -namespace LVL1MUCTPI { - - /** - * @short Parent class of all EventSources - * - * This class only exists in order to be able to use - * polmorphy with EventSources. The EventReader has an - * abstract method setEventSource which needs an argument - * which is of a type EventSource. The idea is that the user - * only deals with abstract EventReaders. He does not need to - * know what concrete type of the EventReader which has been - * instantiated. This was once done by the EventReaderFactory. - * But he needs to give to the EventReader the correct type - * of EventSource of course. In the concrete EventReaders - * the EventSource is dynamic_casted to the concrete EventSource - * for the concrete EventReader. If the cast fails a error - * message is issued. Since dynamic_cast requires at least - * one abstract method in the base class, a dummy method has - * been introduced. - * - * The design is questionable in the sense that at the - * point when the user has to set the EventSource he also - * needs to know which concrete EventReader has been - * chosen. - * - * @see EventReader - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 364083 $ - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - */ - class EventSource { - - public: - virtual ~EventSource() = default; - virtual const char* printSource() const = 0; - - }; // class EventSource - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_EVENTSOURCE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.cxx deleted file mode 100644 index 59c06a3ac6f7f61e9768919a6d792cbff76fdadb..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.cxx +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: ExclusiveMultStrategy.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// Local include(s): -#include "ExclusiveMultStrategy.h" - -namespace LVL1MUCTPI { - - ExclusiveMultStrategy::ExclusiveMultStrategy() - : MultiplicityStrategy( "Exclusive-Multiplicity-Strategy" ) { - - } - - ExclusiveMultStrategy::~ExclusiveMultStrategy() { - - } - - /** - * This function takes care of creating the multiplicity word from a - * muon candidate in an exclusive way. - * - * @param pt The p<sub>T</sub> threshold of the candidate - * @param id The sector that produced the muon candidate (ignored) - * @returns The multiplicity word from one muon candidate - */ - PtMultiplicitySet - ExclusiveMultStrategy::calculateMultiplicity( unsigned int pt, - const SectorID&, - bool ) const { - - PtMultiplicitySet result; - - // - // Increment only this one threshold: - // - result.addMuon( pt ); - - return result; - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.h deleted file mode 100644 index 0e4121cc6774f86238ecbb1ee54b40e588022c46..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.h +++ /dev/null @@ -1,53 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: ExclusiveMultStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIOCT_EXCLUSIVEMULTSTRATEGY_H -#define TRIGT1MUCTPI_MIOCT_EXCLUSIVEMULTSTRATEGY_H - -// Local include(s): -#include "MultiplicityStrategy.h" - -namespace LVL1MUCTPI { - - /** - * @date $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Exclusive multiplicity handling strategy - * - * This strategy creates the multiplicity words by only incrementing - * the multiplicity of the highest passed threshold. So for a candidate - * passing threshold "3", it would create the multiplicity word: - * - * <verbatim> - * 000 000 000 001 000 000 - * </verbatim> - * - * It's mostly used when the muon thresholds are in no direct relation - * with each other. For instance threshold "1" could be an RPC-only - * threshold, while threshold "2" is TGC-only. - * - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - */ - class ExclusiveMultStrategy : public MultiplicityStrategy { - - public: - /// Constructor - ExclusiveMultStrategy(); - /// Destructor - ~ExclusiveMultStrategy(); - - /// Multiplicity handling function - virtual PtMultiplicitySet calculateMultiplicity( unsigned int pt, - const SectorID& id, - bool firstCandidate ) const; - - }; // class ExclusiveMultStrategy - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCT_EXCLUSIVEMULTSTRATEGY_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.cxx deleted file mode 100644 index 46212e6d72b75fb0e18134983e03d7409777d7da..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.cxx +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: ForwardSector.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// STL include(s): -#include <iomanip> -#include <sstream> - -// Local include(s): -#include "ForwardSector.h" -#include "EventReader.h" -#include "../Common/SectorConstants.h" - -namespace LVL1MUCTPI { - - const unsigned int ForwardSector::MIN_SECTOR = MIN_FORWARD_SECTOR; - const unsigned int ForwardSector::MAX_SECTOR = MAX_FORWARD_SECTOR; - - ForwardSector::ForwardSector( Hemisphere hemisphere, unsigned int sectorNumber, - EventReader* reader ) - : Sector( hemisphere, sectorNumber, reader ), m_logger( "ForwardSector" ) { - - if( m_sectorNumber > ForwardSector::MAX_SECTOR ) { - m_sectorNumber = ( sectorNumber % ForwardSector::MAX_SECTOR ) - 1; - } - - m_reader->registerSector( this ); - m_registered = true; - } - - ForwardSector::ForwardSector( const ForwardSector& sector ) - : Sector( sector.m_rapidityRegion, sector.m_sectorNumber, sector.m_reader ), - m_logger( "ForwardSector" ) { - - m_bitField = sector.m_bitField; - m_registered = false; - } - - ForwardSector::~ForwardSector() { - - if( m_registered ) m_reader->unregisterSector( this ); - } - - void ForwardSector::set( const unsigned int bitfield ) { - - // check if any of the reservered bits is set. This should not - // be the case. If so, give a warning but set the bitfield anyway. - // these fields are not respected by input simultion - skip - // if( ( ForwardReservedMask & bitfield ) != 0 ) { - // m_logger << WARNING << "illegal bitfield : " << std::hex << bitfield - // << " (hex) --> Bitfield set anyway" << MsgLogger::endmsg; - //} - - m_bitField = bitfield; - return; - } - - unsigned int ForwardSector::getROI1() const { - - return getValue( ForwardROI1Mask ); - } - - unsigned int ForwardSector::getROI2() const { - - return getValue( ForwardROI2Mask ); - } - - void ForwardSector::print( std::string& result ) const { - - int BCID, SecOf, ROI1, ROI2, Pt1, Pt2, ROI1Of, ROI2Of; - - std::string myId; - this->printID( myId ); - - BCID = this->getValue( BCIDMask ); - SecOf = this->getValue( SectorOverflowMask ); - ROI1 = this->getROI1(); - ROI2 = this->getROI2(); - Pt1 = this->getValue( Pt1Mask ); - Pt2 = this->getValue( Pt2Mask ); - ROI1Of = this->getValue( ROI1OverflowMask ); - ROI2Of = this->getValue( ROI2OverflowMask ); - - std::ostringstream outStream; - outStream << " \n\n FORWARD SECTOR DATA $Revision: 700318 $" << std::endl; - outStream << "==============================================" << std::endl; - outStream << myId << std::endl; - outStream << "BCID : " << BCID << std::endl; - outStream << "Sector Overflow : " << SecOf << std::endl; - outStream << std::endl; - outStream << " Candidate 1 Candidate 2 " << std::endl; - outStream << " ROI " << ROI1 - << " " << ROI2 << std::endl; - outStream << " Pt " << Pt1 - << " " << Pt2 << std::endl; - outStream << " ROIOF " << ROI1Of - << " " << ROI2Of << std::endl; - outStream << std::endl; - - result = outStream.str(); - return; - } - - SectorID ForwardSector::getSectorID() const { - - return SectorID( FORWARD, m_rapidityRegion, m_sectorNumber ); - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.h deleted file mode 100644 index 9b207807a667eaf64602a5c69fb362e30f41d7e2..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.h +++ /dev/null @@ -1,86 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: ForwardSector.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_FORWARDSECTOR_H -#define TRIGT1MUCTPI_FORWARDSECTOR_H - -// STL include(s): -#include <string> - -// Local include(s): -#include "Sector.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - /** - * @short This class handles an 32-bit Input word from the Forward Front-End-Electronics. - * - * This class complies to the Sector Interface class. It - * specializes the base class with some decoding functions - * which are special for the Forward Sector data-format. It - * provides a print facility to view the contents of the - * data-word in readable format. - * - * @see Sector - * @see SectorID - * @author $Author: krasznaa $ - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class ForwardSector : public Sector { - - public: - /** - * The only constructor of a Forward sector, identified by its - * sector number and hemisphere - * @param hemisphere The Hemisphere the sector is in - * @param sectorNumber The sector number - */ - ForwardSector( Hemisphere hemisphere, unsigned int sectorNumber, - EventReader* reader ); - ForwardSector( const ForwardSector& sector ); - ForwardSector & operator = ( const ForwardSector & ) = delete; - - ~ForwardSector(); - /** - * Implementation of the corresponding abstract method in the - * baseclass Sector. - * @see Sector::set() - * @param bitfield This is the value to which the - * Forward Sector 32-bit bitfield is set. - * It is checked that none of the reserved bits are set. - */ - void set( const unsigned int bitfield ); - /** - * This access funtion retrieves the ROI-number of the first candidate. - */ - unsigned int getROI1() const; - /** - * This access funtion retrieves the ROI-number of the second candidate. - */ - unsigned int getROI2() const; - void print( std::string& ForwardDescription ) const; - std::string getDetectorString() const { return "Forward"; } - virtual SectorID getSectorID() const; - - private: - mutable MsgLogger m_logger; - - /** - * some constants important for checking the validity of - * the SectorID - */ - static const unsigned int MIN_SECTOR; - static const unsigned int MAX_SECTOR; - - }; // class ForwardSector - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_FORWARDSECTOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.cxx deleted file mode 100644 index 7ec0237d80d6d32cddf06fc5bfb00cd5a0bc2bac..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.cxx +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: InclusiveMultStrategy.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// Local include(s): -#include "InclusiveMultStrategy.h" -#include "../Common/SectorConstants.h" - -namespace LVL1MUCTPI { - - InclusiveMultStrategy::InclusiveMultStrategy() - : MultiplicityStrategy( "Inclusive-Multiplicity-Strategy" ) { - - } - - InclusiveMultStrategy::~InclusiveMultStrategy() { - - } - - /** - * This function takes care of creating the multiplicity word from a - * muon candidate in an inclusive way. - * - * @param pt The p<sub>T</sub> threshold of the candidate - * @param id The sector that produced the muon candidate (ignored) - * @returns The multiplicity word from one muon candidate - */ - PtMultiplicitySet - InclusiveMultStrategy::calculateMultiplicity( unsigned int pt, - const SectorID&, - bool ) const { - - PtMultiplicitySet result; - - // - // If a candidate is not created, that's signalled by giving it the pt threshold 7. - // So the multiplicity should only be changed if the given threshold is in the - // correct range. - // - if( ( pt >= 1 ) && ( pt <= MAX_NUMBER_OF_THRESHOLDS ) ) { - for( unsigned int i = 1; i <= pt; ++i ) { - result.addMuon( i ); - } - } - - return result; - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.h deleted file mode 100644 index 03af50641a5925987d821654109104d3460bbd93..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.h +++ /dev/null @@ -1,50 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: InclusiveMultStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIOCT_INCLUSIVEMULTSTRATEGY_H -#define TRIGT1MUCTPI_MIOCT_INCLUSIVEMULTSTRATEGY_H - -// Local include(s): -#include "MultiplicityStrategy.h" - -namespace LVL1MUCTPI { - - /** - * @date $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Inclusive multiplicity handling strategy - * - * This strategy creates the multiplicity words by incrementing the - * multiplicity of the passed threshold, and those of the thresholds - * "below" the passed threshold. So for a candidate passing threshold - * "3", it would create a multiplicity word: - * - * <verbatim> - * 000 000 000 001 001 001 - * </verbatim> - * - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - */ - class InclusiveMultStrategy : public MultiplicityStrategy { - - public: - /// Constructor - InclusiveMultStrategy(); - /// Destructor - ~InclusiveMultStrategy(); - - /// Multiplicity handling function - virtual PtMultiplicitySet calculateMultiplicity( unsigned int pt, - const SectorID& id, - bool firstCandidate ) const; - - }; // class InclusiveMultStrategy - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCT_INCLUSIVEMULTSTRATEGY_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.cxx deleted file mode 100644 index 842763a65db7e6eab090015eb24e5d4370ed1e8b..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.cxx +++ /dev/null @@ -1,276 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTBBOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $ - -// STL include(s): -#include <string> -#include <iomanip> - -// XercesC include(s): -#include <xercesc/dom/DOMElement.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/util/XMLString.hpp> - -// Local include(s): -#include "LUTBBOverlapCalculator.h" -#include "BarrelSector.h" -#include "../Common/PtMultiplicitySet.h" - -namespace LVL1MUCTPI { - - LUTBBOverlapCalculator::LUTBBOverlapCalculator() - : LUTOverlapCalculatorBase( "LUTBBOverlapCalculator" ) { - - } - - LUTBBOverlapCalculator::LUTBBOverlapCalculator( const LUTBBOverlapCalculator& calc ) - : LUTOverlapCalculatorBase( calc ) { - - } - - /** - * @param node One of the BB nodes of the XML file - * @param dumpLut Print the LUT while reading it - */ - StatusCode LUTBBOverlapCalculator::initialize( const xercesc::DOMNode* bbnode, bool dumpLut,const std::string& runPeriod ) { - - if( runPeriod == "RUN2" ){ - setMaximumThreshold( 6 ); - REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 6" ); - } - - // Clear the internal LUT: - m_lut.clear(); - - // - // Check if the received node is of the right type: - // - if( bbnode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) { - REPORT_ERROR_MSG( "Received node is not a DOMElement" ); - return StatusCode::RECOVERABLE; - } - - REPORT_VERBOSE_MSG( "Looping over \"BBElement\"-s:" ); - - const xercesc::DOMNodeList* lut_def_list = bbnode->getChildNodes(); - for( XMLSize_t i = 0; i < lut_def_list->getLength(); ++i ) { - - const xercesc::DOMNode* lut_node = lut_def_list->item( i ); - char* cname = xercesc::XMLString::transcode( lut_node->getNodeName() ); - std::string sname( cname ); - xercesc::XMLString::release( &cname ); - - if( sname != "BBElement" ) continue; - - const xercesc::DOMElement* lut_element = - dynamic_cast< const xercesc::DOMElement* >( lut_node ); - if( ! lut_element ) { - REPORT_ERROR_MSG( "Unable to cast LUT node into DOMElement" ); - return StatusCode::RECOVERABLE; - } - - XMLCh* roi1_name = xercesc::XMLString::transcode( "RoI1" ); - XMLCh* roi2_name = xercesc::XMLString::transcode( "RoI2" ); - XMLCh* ovlp1_name = xercesc::XMLString::transcode( "Ovlp1" ); - XMLCh* ovlp2_name = xercesc::XMLString::transcode( "Ovlp2" ); - - const XMLCh* roi1 = lut_element->getAttribute( roi1_name ); - const XMLCh* roi2 = lut_element->getAttribute( roi2_name ); - const XMLCh* ovlp1 = lut_element->getAttribute( ovlp1_name ); - const XMLCh* ovlp2 = lut_element->getAttribute( ovlp2_name ); - - xercesc::XMLString::release( &roi1_name ); - xercesc::XMLString::release( &roi2_name ); - xercesc::XMLString::release( &ovlp1_name ); - xercesc::XMLString::release( &ovlp2_name ); - - const int roi1_n = xercesc::XMLString::parseInt( roi1 ); - const int roi2_n = xercesc::XMLString::parseInt( roi2 ); - const bool ovlp1_b = xercesc::XMLString::parseInt( ovlp1 ); - const bool ovlp2_b = xercesc::XMLString::parseInt( ovlp2 ); - - // - // Create the word to be put into the LUT: - // - const unsigned int element = ( roi1_n & 0x1f ) | ( ovlp1_b ? 0x20 : 0x0 ) | - ( ( roi2_n & 0x1f ) << 6 ) | ( ovlp2_b ? 0x800 : 0x0 ); - - m_lut[ element ] = true; - - if( dumpLut ) { - REPORT_VERBOSE_MSG( " --> RoI1: " << roi1_n << " RoI2: " << roi2_n << " Ovlp1: " - << ovlp1_b << " Ovlp2: " << ovlp2_b << " Element: 0x" - << std::hex << std::setw( 3 ) << std::setfill( '0' ) << element << std::dec ); - } - } - - REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() ); - - return StatusCode::SUCCESS; - } - - void LUTBBOverlapCalculator::calculate( const BarrelSector& sector1, - const BarrelSector& sector2 ) const { - - // - // Calculate some helper quantities: - // - bool sec1cand1present = false, sec1cand2present = false; - bool sec2cand1present = false, sec2cand2present = false; - int sec1cand1pt = -1, sec1cand2pt = -1; - int sec2cand1pt = -1, sec2cand2pt = -1; - if( sector1.getPtCand1() != 7 ) { - sec1cand1present = true; - sec1cand1pt = sector1.getPtCand1(); - } - if( sector1.getPtCand2() != 7 ) { - sec1cand2present = true; - sec1cand2pt = sector1.getPtCand2(); - } - if( sector2.getPtCand1() != 7 ) { - sec2cand1present = true; - sec2cand1pt = sector2.getPtCand1(); - } - if( sector2.getPtCand2() != 7 ) { - sec2cand2present = true; - sec2cand2pt = sector2.getPtCand2(); - } - - // - // Find if a rule exists for sec1 cand1 and sec2 cand1: - // - unsigned int element = ( sector1.getROI1() & 0x1f ) | - ( sector1.isCand1BarrelOverlap() ? 0x20 : 0x0 ) | - ( ( sector2.getROI1() & 0x1f ) << 6 ) | - ( sector2.isCand1BarrelOverlap() ? 0x800 : 0x0 ); - if( sec1cand1present && sec2cand1present && - ( sec1cand1pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand1pt < sec2cand1pt ) { - sector1.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector " - << sector1.getSectorNumber() << " in the " - << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector " - << sector2.getSectorNumber() << " in the " - << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand2 and sec2 cand1: - // - element = ( sector1.getROI2() & 0x1f ) | - ( sector1.isCand2BarrelOverlap() ? 0x20 : 0x0 ) | - ( ( sector2.getROI1() & 0x1f ) << 6 ) | - ( sector2.isCand1BarrelOverlap() ? 0x800 : 0x0 ); - if( sec1cand2present && sec2cand1present && - ( sec1cand2pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand2pt < sec2cand1pt ) { - sector1.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector " - << sector1.getSectorNumber() << " in the " - << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector " - << sector2.getSectorNumber() << " in the " - << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand1 and sec2 cand2: - // - element = ( sector1.getROI1() & 0x1f ) | - ( sector1.isCand1BarrelOverlap() ? 0x20 : 0x0 ) | - ( ( sector2.getROI2() & 0x1f ) << 6 ) | - ( sector2.isCand2BarrelOverlap() ? 0x800 : 0x0 ); - if( sec1cand1present && sec2cand2present && - ( sec1cand1pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand1pt < sec2cand2pt ) { - sector1.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector " - << sector1.getSectorNumber() << " in the " - << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector " - << sector2.getSectorNumber() << " in the " - << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand2 and sec2 cand2: - // - element = ( sector1.getROI2() & 0x1f ) | - ( sector1.isCand2BarrelOverlap() ? 0x20 : 0x0 ) | - ( ( sector2.getROI2() & 0x1f ) << 6 ) | - ( sector2.isCand2BarrelOverlap() ? 0x800 : 0x0 ); - if( sec1cand2present && sec2cand2present && - ( sec1cand2pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand2pt < sec2cand2pt ) { - sector1.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector " - << sector1.getSectorNumber() << " in the " - << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector " - << sector2.getSectorNumber() << " in the " - << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.h deleted file mode 100644 index 3e715c5c890ff02fafbce45d092280213159b41e..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.h +++ /dev/null @@ -1,58 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTBBOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_LUTBBOVERLAPCALCULATOR_H -#define TRIGT1MUCTPI_LUTBBOVERLAPCALCULATOR_H - -// Local include(s): -#include "LUTOverlapCalculatorBase.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class BarrelSector; - - /** - * @short Class flagging barrel candidates for barrel-barrel overlaps - * - * This is one of the end-classes of the new LUT overlap handling. It can be - * initialized by passing the correct DOMNode to it in it's initialize method. - * When two barrel candidates are given to it, it can flag one of them to be - * supressed in the multiplicity count. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class LUTBBOverlapCalculator : public LUTOverlapCalculatorBase { - - public: - /// Default constructor - LUTBBOverlapCalculator(); - /// Copy constructor - LUTBBOverlapCalculator( const LUTBBOverlapCalculator& calc ); - LUTBBOverlapCalculator & operator = ( const LUTBBOverlapCalculator & ) = delete; - - /// Function initializing the calculator object - virtual StatusCode initialize( const xercesc::DOMNode* bbnode, bool dumpLut, const std::string& runPeriod ); - - /// Calculate the overlap flags for two barrel sectors - void calculate( const BarrelSector& sector1, const BarrelSector& sector2 ) const; - - private: - // - // The LUT words take the form: - // - // variable |Ovl2| RoI2 |Ovl1| RoI1 | - // bit | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | - - }; // class LUTBBOverlapCalculator - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LUTBBOVERLAPCALCULATOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.cxx deleted file mode 100644 index be79f6bd3a88dd094bd4269647112f722ad7d3b6..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.cxx +++ /dev/null @@ -1,265 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTBEOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $ - -// STL include(s): -#include <sstream> -#include <iomanip> - -// XercesC include(s): -#include <xercesc/dom/DOMElement.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/util/XMLString.hpp> - -// Local include(s): -#include "LUTBEOverlapCalculator.h" -#include "BarrelSector.h" -#include "EndcapSector.h" -#include "../Common/PtMultiplicitySet.h" - -namespace LVL1MUCTPI { - - LUTBEOverlapCalculator::LUTBEOverlapCalculator() - : LUTOverlapCalculatorBase( "LUTBEOverlapCalculator" ) { - - } - - LUTBEOverlapCalculator::LUTBEOverlapCalculator( const LUTBEOverlapCalculator& calc ) - : LUTOverlapCalculatorBase( calc ) { - - } - - StatusCode LUTBEOverlapCalculator::initialize( const xercesc::DOMNode* benode, bool dumpLut, const std::string& runPeriod ) { - - if( runPeriod == "RUN2" ){ - setMaximumThreshold( 3 ); - REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 3" ); - } - - // Clear the internal LUT: - m_lut.clear(); - - // - // Check if the received node is of the right type: - // - if( benode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) { - REPORT_ERROR_MSG( "Received node is not a DOMElement" ); - return StatusCode::RECOVERABLE; - } - - REPORT_VERBOSE_MSG( "Looping over \"BEElement\"-s:" ); - - // - // Initialize the B-E LUT: - // - const xercesc::DOMNodeList* lut_lines = benode->getChildNodes(); - for( XMLSize_t i = 0; i < lut_lines->getLength(); ++i ) { - - const xercesc::DOMNode* lut_line = lut_lines->item( i ); - char* cname = xercesc::XMLString::transcode( lut_line->getNodeName() ); - std::string sname( cname ); - xercesc::XMLString::release( &cname ); - - if( sname != "BEElement" ) continue; - - const xercesc::DOMElement* lut_element = - dynamic_cast< const xercesc::DOMElement* >( lut_line ); - if( ! lut_element ) { - REPORT_ERROR_MSG( "Unable to cast LUT node into DOMElement" ); - return StatusCode::RECOVERABLE; - } - - XMLCh* broi_name = xercesc::XMLString::transcode( "BRoI" ); - XMLCh* bpt_name = xercesc::XMLString::transcode( "BPt" ); - XMLCh* eroi_name = xercesc::XMLString::transcode( "ERoI" ); - XMLCh* q_name = xercesc::XMLString::transcode( "EChrg" ); - - const XMLCh* broi = lut_element->getAttribute( broi_name ); - const XMLCh* bpt = lut_element->getAttribute( bpt_name ); - const XMLCh* eroi = lut_element->getAttribute( eroi_name ); - const XMLCh* q = lut_element->getAttribute( q_name ); - - xercesc::XMLString::release( &broi_name ); - xercesc::XMLString::release( &bpt_name ); - xercesc::XMLString::release( &eroi_name ); - xercesc::XMLString::release( &q_name ); - - const unsigned int broi_n = xercesc::XMLString::parseInt( broi ); - const unsigned int bpt_n = xercesc::XMLString::parseInt( bpt ); - const unsigned int eroi_n = xercesc::XMLString::parseInt( eroi ); - const unsigned int q_n = xercesc::XMLString::parseInt( q ); - - // - // Create the word to be put into the LUT: - // - const unsigned int element = ( broi_n & 0x1f ) | ( ( bpt_n & 0x7 ) << 5 ) | - ( ( eroi_n & 0xff ) << 8 ) | ( ( q_n & 0x1 ) << 16 ); - - m_lut[ element ] = true; - - if( dumpLut ) { - REPORT_VERBOSE_MSG( " --> BRoI: " << broi_n << " BPt: " << bpt_n - << " ERoI: " << eroi_n << " EChrg: " << q_n << " Element: 0x" - << std::hex << std::setw( 5 ) << std::setfill( '0' ) << element - << std::dec ); - } - } - - REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() ); - - return StatusCode::SUCCESS; - } - - void LUTBEOverlapCalculator::calculate( const BarrelSector& bsector, - const EndcapSector& esector ) const { - - // - // Calculate some helper quantities: - // - bool bseccand1present = false, bseccand2present = false; - bool eseccand1present = false, eseccand2present = false; - int bseccand1pt = -1, bseccand2pt = -1; - int eseccand1pt = -1, eseccand2pt = -1; - if( bsector.getPtCand1() != 7 ) { - bseccand1present = true; - bseccand1pt = bsector.getPtCand1(); - } - if( bsector.getPtCand2() != 7 ) { - bseccand2present = true; - bseccand2pt = bsector.getPtCand2(); - } - if( esector.getPtCand1() != 7 ) { - eseccand1present = true; - eseccand1pt = esector.getPtCand1(); - } - if( esector.getPtCand2() != 7 ) { - eseccand2present = true; - eseccand2pt = esector.getPtCand2(); - } - - // - // Find if a rule exists for bsec cand1 and esec cand1: - // - unsigned int element1 = ( bsector.getROI1() & 0x1f ) | ( ( bsector.getPtCand1() & 0x7 ) << 5 ) | - ( ( esector.getROI1() & 0xff ) << 8 ) | 0x10000; - unsigned int element2 = ( bsector.getROI1() & 0x1f ) | ( ( bsector.getPtCand1() & 0x7 ) << 5 ) | - ( ( esector.getROI1() & 0xff ) << 8 ); - if( bseccand1present && eseccand1present && - ( bseccand1pt <= m_thr ) && ( eseccand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it1, it2; - if( ( ( ( it1 = m_lut.find( element1 ) ) != m_lut.end() ) && ( it1->second ) ) || - ( ( ( it2 = m_lut.find( element2 ) ) != m_lut.end() ) && ( it2->second ) ) ) { - if( bseccand1pt < eseccand1pt ) { - bsector.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector " << bsector.getSectorNumber() - << " in the " << bsector.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - esector.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << esector.getSectorNumber() - << " in the " << esector.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - - // - // Find if a rule exists for bsec cand2 and esec cand1: - // - element1 = ( bsector.getROI2() & 0x1f ) | ( ( bsector.getPtCand2() & 0x7 ) << 5 ) | - ( ( esector.getROI1() & 0xff ) << 8 ) | 0x10000; - element2 = ( bsector.getROI2() & 0x1f ) | ( ( bsector.getPtCand2() & 0x7 ) << 5 ) | - ( ( esector.getROI1() & 0xff ) << 8 ); - if( bseccand2present && eseccand1present && - ( bseccand2pt <= m_thr ) && ( eseccand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it1, it2; - if( ( ( ( it1 = m_lut.find( element1 ) ) != m_lut.end() ) && ( it1->second ) ) || - ( ( ( it2 = m_lut.find( element2 ) ) != m_lut.end() ) && ( it2->second ) ) ) { - if( bseccand2pt < eseccand1pt ) { - bsector.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector " << bsector.getSectorNumber() - << " in the " << bsector.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - esector.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << esector.getSectorNumber() - << " in the " << esector.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - - // - // Find if a rule exists for bsec cand1 and esec cand2: - // - element1 = ( bsector.getROI1() & 0x1f ) | ( ( bsector.getPtCand1() & 0x7 ) << 5 ) | - ( ( esector.getROI2() & 0xff ) << 8 ) | 0x10000; - element2 = ( bsector.getROI1() & 0x1f ) | ( ( bsector.getPtCand1() & 0x7 ) << 5 ) | - ( ( esector.getROI2() & 0xff ) << 8 ); - if( bseccand1present && eseccand2present && - ( bseccand1pt <= m_thr ) && ( eseccand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it1, it2; - if( ( ( ( it1 = m_lut.find( element1 ) ) != m_lut.end() ) && ( it1->second ) ) || - ( ( ( it2 = m_lut.find( element2 ) ) != m_lut.end() ) && ( it2->second ) ) ) { - if( bseccand1pt < eseccand2pt ) { - bsector.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector " << bsector.getSectorNumber() - << " in the " << bsector.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - esector.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << esector.getSectorNumber() - << " in the " << esector.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - - // - // Find if a rule exists for bsec cand2 and esec cand2: - // - element1 = ( bsector.getROI2() & 0x1f ) | ( ( bsector.getPtCand2() & 0x7 ) << 5 ) | - ( ( esector.getROI2() & 0xff ) << 8 ) | 0x10000; - element2 = ( bsector.getROI2() & 0x1f ) | ( ( bsector.getPtCand2() & 0x7 ) << 5 ) | - ( ( esector.getROI2() & 0xff ) << 8 ); - if( bseccand2present && eseccand2present && - ( bseccand2pt <= m_thr ) && ( eseccand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it1, it2; - if( ( ( ( it1 = m_lut.find( element1 ) ) != m_lut.end() ) && ( it1->second ) ) || - ( ( ( it2 = m_lut.find( element2 ) ) != m_lut.end() ) && ( it2->second ) ) ) { - if( bseccand2pt < eseccand2pt ) { - bsector.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector " << bsector.getSectorNumber() - << " in the " << bsector.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - esector.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << esector.getSectorNumber() - << " in the " << esector.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.h deleted file mode 100644 index bbdabbf29c03eec2c72a0652d5331b6411bdf550..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.h +++ /dev/null @@ -1,59 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTBEOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_LUTBEOVERLAPCALCULATOR_H -#define TRIGT1MUCTPI_LUTBEOVERLAPCALCULATOR_H - -// Local include(s): -#include "LUTOverlapCalculatorBase.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class BarrelSector; - class EndcapSector; - - /** - * @short Class flagging barrel or endcap muon candidates for fake double-counts - * - * This class can be used to flag the one of the muon candidates in - * an overlapping barrel-endcap sector pair if they are believed - * to be coming from the same muon. The muon with the higher - * p<sub>T</sub> is left un-flagged. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class LUTBEOverlapCalculator : public LUTOverlapCalculatorBase { - - public: - /// Default constructor - LUTBEOverlapCalculator(); - /// Copy constructor - LUTBEOverlapCalculator( const LUTBEOverlapCalculator& calc ); - LUTBEOverlapCalculator & operator = ( const LUTBEOverlapCalculator & ) = delete; - - /// Function initializing the calculator object - virtual StatusCode initialize( const xercesc::DOMNode* benode, bool dumpLut,const std::string& runPeriod ); - - /// Calculate the overlap flags for two barrel sectors - void calculate( const BarrelSector& bsector, const EndcapSector& esector ) const; - - private: - // - // The LUT words take the form: - // - // variable | EQ | ERoI | BPt | BRoI | - // bit | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | - - }; // class LUTBEOverlapCalculator - -} // namespac LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LUTBEOVERLAPCALCULATOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.cxx deleted file mode 100644 index 812c668ee60a2e352913b3c8cbace372d0942f99..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.cxx +++ /dev/null @@ -1,252 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTEEOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $ - -// STL include(s): -#include <sstream> -#include <iomanip> - -// XercesC include(s): -#include <xercesc/dom/DOMElement.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/util/XMLString.hpp> - -// Local include(s): -#include "LUTEEOverlapCalculator.h" -#include "EndcapSector.h" -#include "../Common/PtMultiplicitySet.h" - -namespace LVL1MUCTPI { - - LUTEEOverlapCalculator::LUTEEOverlapCalculator() - : LUTOverlapCalculatorBase( "LUTEEOverlapCalculator" ) { - - } - - LUTEEOverlapCalculator::LUTEEOverlapCalculator( const LUTEEOverlapCalculator& calc ) - : LUTOverlapCalculatorBase( calc ) { - - } - - StatusCode LUTEEOverlapCalculator::initialize( const xercesc::DOMNode* eenode, - bool dumpLut, const std::string& runPeriod ) { - - if( runPeriod == "RUN2" ){ - setMaximumThreshold( 6 ); - REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 6" ); - } - - // Clear the internal LUT: - m_lut.clear(); - - // - // Check if the received node is of the right type: - // - if( eenode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) { - REPORT_ERROR_MSG( "Received node is not a DOMElement" ); - return StatusCode::RECOVERABLE; - } - - REPORT_VERBOSE_MSG( "Looping over \"EEElement\"-s:" ); - - // - // Initialize the E-E LUT: - // - const xercesc::DOMNodeList* lut_lines = eenode->getChildNodes(); - for( XMLSize_t i = 0; i < lut_lines->getLength(); ++i ) { - - const xercesc::DOMNode* lut_line = lut_lines->item( i ); - - char* cname = xercesc::XMLString::transcode( lut_line->getNodeName() ); - std::string sname( cname ); - xercesc::XMLString::release( &cname ); - - if( sname != "EEElement" ) continue; - - const xercesc::DOMElement* lut_element = - dynamic_cast< const xercesc::DOMElement* >( lut_line ); - if( ! lut_element ) { - REPORT_ERROR_MSG( "Unable to cast LUT node into DOMElement" ); - return StatusCode::RECOVERABLE; - } - - XMLCh* roi1_name = xercesc::XMLString::transcode( "RoI1" ); - XMLCh* roi2_name = xercesc::XMLString::transcode( "RoI2" ); - - const XMLCh* roi1 = lut_element->getAttribute( roi1_name ); - const XMLCh* roi2 = lut_element->getAttribute( roi2_name ); - - xercesc::XMLString::release( &roi1_name ); - xercesc::XMLString::release( &roi2_name ); - - const unsigned int roi1_n = xercesc::XMLString::parseInt( roi1 ); - const unsigned int roi2_n = xercesc::XMLString::parseInt( roi2 ); - - // - // Create the word to be put into the LUT: - // - const unsigned int element = ( roi1_n & 0xff ) | ( ( roi2_n & 0xff ) << 8 ); - - m_lut[ element ] = true; - - if( dumpLut ) { - REPORT_VERBOSE_MSG( " --> RoI1: " << roi1_n << " RoI2: " << roi2_n - << " Element: 0x" << std::hex << std::setw( 4 ) - << std::setfill( '0' ) << element << std::dec ); - } - } - - REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() ); - - return StatusCode::SUCCESS; - } - - void LUTEEOverlapCalculator::calculate( const EndcapSector& sector1, - const EndcapSector& sector2 ) const { - - // - // Calculate some helper quantities: - // - bool sec1cand1present = false, sec1cand2present = false; - bool sec2cand1present = false, sec2cand2present = false; - int sec1cand1pt = -1, sec1cand2pt = -1; - int sec2cand1pt = -1, sec2cand2pt = -1; - if( sector1.getPtCand1() != 7 ) { - sec1cand1present = true; - sec1cand1pt = sector1.getPtCand1(); - } - if( sector1.getPtCand2() != 7 ) { - sec1cand2present = true; - sec1cand2pt = sector1.getPtCand2(); - } - if( sector2.getPtCand1() != 7 ) { - sec2cand1present = true; - sec2cand1pt = sector2.getPtCand1(); - } - if( sector2.getPtCand2() != 7 ) { - sec2cand2present = true; - sec2cand2pt = sector2.getPtCand2(); - } - - // - // Find if a rule exists for sec1 cand1 and sec2 cand1: - // - unsigned int element = ( sector1.getROI1() & 0xff ) | - ( ( sector2.getROI1() & 0xff ) << 8 ); - if( sec1cand1present && sec2cand1present && - ( sec1cand1pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand1pt < sec2cand1pt ) { - sector1.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << sector1.getSectorNumber() - << " in the " << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << sector2.getSectorNumber() - << " in the " << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand2 and sec2 cand1: - // - element = ( sector1.getROI2() & 0xff ) | - ( ( sector2.getROI1() & 0xff ) << 8 ); - if( sec1cand2present && sec2cand1present && - ( sec1cand2pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand2pt < sec2cand1pt ) { - sector1.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << sector1.getSectorNumber() - << " in the " << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << sector2.getSectorNumber() - << " in the " << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand1 and sec2 cand2: - // - element = ( sector1.getROI1() & 0xff ) | - ( ( sector2.getROI2() & 0xff ) << 8 ); - if( sec1cand1present && sec2cand2present && - ( sec1cand1pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand1pt < sec2cand2pt ) { - sector1.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << sector1.getSectorNumber() - << " in the " << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << sector2.getSectorNumber() - << " in the " << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand2 and sec2 cand2: - // - element = ( sector1.getROI2() & 0xff ) | - ( ( sector2.getROI2() & 0xff ) << 8 ); - if( sec1cand2present && sec2cand2present && - ( sec1cand2pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand2pt < sec2cand2pt ) { - sector1.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << sector1.getSectorNumber() - << " in the " << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << sector2.getSectorNumber() - << " in the " << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.h deleted file mode 100644 index 246c7dc7961879837897c011d6d77929cfb3085a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.h +++ /dev/null @@ -1,58 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTEEOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_LUTEEOVERLAPCALCULATOR_H -#define TRIGT1MUCTPI_LUTEEOVERLAPCALCULATOR_H - -// Local include(s): -#include "LUTOverlapCalculatorBase.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class EndcapSector; - - /** - * @short Class flagging endcap muon candidates for fake double-counts - * - * This class can be used to flag the one of the muon candidates in - * an overlapping endcap sector pair if they are believed to be coming - * from the same muon. The muon with the higher p<sub>T</sub> is left - * un-flagged. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class LUTEEOverlapCalculator : public LUTOverlapCalculatorBase { - - public: - /// Default constructor - LUTEEOverlapCalculator(); - /// Copy constructor - LUTEEOverlapCalculator( const LUTEEOverlapCalculator& calc ); - LUTEEOverlapCalculator & operator = ( const LUTEEOverlapCalculator & ) = delete; - - /// Function initializing the calculator object - virtual StatusCode initialize( const xercesc::DOMNode* eenode, bool dumpLut,const std::string& runPeriod ); - - /// Calculate the overlap flags for two endcap sectors - void calculate( const EndcapSector& sector1, const EndcapSector& sector2 ) const; - - private: - // - // The LUT words take the form: - // - // variable | RoI2 | RoI1 | - // bit | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | - - }; // class LUTEEOverlapCalculator - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LUTEEOVERLAPCALCULATOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.cxx deleted file mode 100644 index 66a40c20b4d1147709ac619776417d962cecb3ee..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.cxx +++ /dev/null @@ -1,255 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTEFOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $ - -// STL include(s): -#include <string> -#include <iomanip> - -// XercesC include(s): -#include <xercesc/dom/DOMElement.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/util/XMLString.hpp> - -// Local include(s): -#include "LUTEFOverlapCalculator.h" -#include "EndcapSector.h" -#include "ForwardSector.h" - -namespace LVL1MUCTPI { - - LUTEFOverlapCalculator::LUTEFOverlapCalculator() - : LUTOverlapCalculatorBase( "LUTEFOverlapCalculator" ) { - - } - - LUTEFOverlapCalculator::LUTEFOverlapCalculator( const LUTEFOverlapCalculator& calc ) - : LUTOverlapCalculatorBase( calc ) { - - } - - /** - * @param node One of the EF nodes of the XML file - * @param dumpLut Print the LUT while reading it - */ - StatusCode LUTEFOverlapCalculator::initialize( const xercesc::DOMNode* bbnode, bool dumpLut, const std::string& runPeriod ) { - - if( runPeriod == "RUN2" ){ - setMaximumThreshold( 6 ); - REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 6" ); - } - - // Clear the internal LUT: - m_lut.clear(); - - // - // Check if the received node is of the right type: - // - if( bbnode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) { - REPORT_ERROR_MSG( "Received node is not a DOMElement" ); - return StatusCode::RECOVERABLE; - } - - REPORT_VERBOSE_MSG( "Looping over \"EFElement\"-s:" ); - - const xercesc::DOMNodeList* lut_def_list = bbnode->getChildNodes(); - for( XMLSize_t i = 0; i < lut_def_list->getLength(); ++i ) { - - const xercesc::DOMNode* lut_node = lut_def_list->item( i ); - char* cname = xercesc::XMLString::transcode( lut_node->getNodeName() ); - std::string sname( cname ); - xercesc::XMLString::release( &cname ); - - if( sname != "EFElement" ) continue; - - const xercesc::DOMElement* lut_element = - dynamic_cast< const xercesc::DOMElement* >( lut_node ); - if( ! lut_element ) { - REPORT_ERROR_MSG( "Unable to cast LUT node into DOMElement" ); - return StatusCode::RECOVERABLE; - } - - XMLCh* eroi_name = xercesc::XMLString::transcode( "ERoI" ); - XMLCh* froi_name = xercesc::XMLString::transcode( "FRoI" ); - - const XMLCh* eroi = lut_element->getAttribute( eroi_name ); - const XMLCh* froi = lut_element->getAttribute( froi_name ); - - xercesc::XMLString::release( &eroi_name ); - xercesc::XMLString::release( &froi_name ); - - const int eroi_n = xercesc::XMLString::parseInt( eroi ); - const int froi_n = xercesc::XMLString::parseInt( froi ); - - // - // Create the word to be put into the LUT: - // - const unsigned int element = ( eroi_n & 0xff ) | ( ( froi_n & 0x3f ) << 8 ); - - m_lut[ element ] = true; - - if( dumpLut ) { - REPORT_VERBOSE_MSG( " --> ERoI: " << eroi_n << " FRoI: " << froi_n - << " Element: 0x" << std::hex << std::setw( 4 ) - << std::setfill( '0' ) << element << std::dec ); - } - } - - REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() ); - - return StatusCode::SUCCESS; - } - - void LUTEFOverlapCalculator::calculate( const EndcapSector& esec, - const ForwardSector& fsec ) const { - - // - // Calculate some helper quantities: - // - bool eseccand1present = false, eseccand2present = false; - bool fseccand1present = false, fseccand2present = false; - int eseccand1pt = -1, eseccand2pt = -1; - int fseccand1pt = -1, fseccand2pt = -1; - if( esec.getPtCand1() != 7 ) { - eseccand1present = true; - eseccand1pt = esec.getPtCand1(); - } - if( esec.getPtCand2() != 7 ) { - eseccand2present = true; - eseccand2pt = esec.getPtCand2(); - } - if( fsec.getPtCand1() != 7 ) { - fseccand1present = true; - fseccand1pt = fsec.getPtCand1(); - } - if( fsec.getPtCand2() != 7 ) { - fseccand2present = true; - fseccand2pt = fsec.getPtCand2(); - } - - // - // Find if a rule exists for esec cand1 and fsec cand1: - // - unsigned int element = ( esec.getROI1() & 0xff ) | ( ( fsec.getROI1() & 0x3f ) << 8 ); - if( eseccand1present && fseccand1present && - ( eseccand1pt <= m_thr ) && ( fseccand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( eseccand1pt < fseccand1pt ) { - esec.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " - << esec.getSectorNumber() << " in the " - << esec.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - fsec.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " - << fsec.getSectorNumber() << " in the " - << fsec.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for esec cand2 and fsec cand1: - // - element = ( esec.getROI2() & 0xff ) | ( ( fsec.getROI1() & 0x3f ) << 8 ); - if( eseccand2present && fseccand1present && - ( eseccand2pt <= m_thr ) && ( fseccand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( eseccand2pt < fseccand1pt ) { - esec.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " - << esec.getSectorNumber() << " in the " - << esec.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - fsec.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " - << fsec.getSectorNumber() << " in the " - << fsec.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for esec cand1 and fsec cand2: - // - element = ( esec.getROI1() & 0xff ) | ( ( fsec.getROI2() & 0x3f ) << 8 ); - if( eseccand1present && fseccand2present && - ( eseccand1pt <= m_thr ) && ( fseccand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( eseccand1pt < fseccand2pt ) { - esec.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " - << esec.getSectorNumber() << " in the " - << esec.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - fsec.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " - << fsec.getSectorNumber() << " in the " - << fsec.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for esec cand2 and fsec cand2: - // - element = ( esec.getROI2() & 0xff ) | ( ( fsec.getROI2() & 0x3f ) << 8 ); - if( eseccand2present && fseccand2present && - ( eseccand2pt <= m_thr ) && ( fseccand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( eseccand2pt < fseccand2pt ) { - esec.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " - << esec.getSectorNumber() << " in the " - << esec.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - fsec.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " - << fsec.getSectorNumber() << " in the " - << fsec.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.h deleted file mode 100644 index 20fee67d586458c058a4b3677070a62d212f0ec3..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.h +++ /dev/null @@ -1,59 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTEFOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_LUTEFOVERLAPCALCULATOR_H -#define TRIGT1MUCTPI_LUTEFOVERLAPCALCULATOR_H - -// Local include(s): -#include "LUTOverlapCalculatorBase.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class EndcapSector; - class ForwardSector; - - /** - * @short Class flagging candidates for endcap-forward overlaps - * - * This is one of the end-classes of the new LUT overlap handling. It can be - * initialized by passing the correct DOMNode to it in it's initialize method. - * When two candidates are given to it, it can flag one of them to be - * supressed in the multiplicity count. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class LUTEFOverlapCalculator : public LUTOverlapCalculatorBase { - - public: - /// Default constructor - LUTEFOverlapCalculator(); - /// Copy constructor - LUTEFOverlapCalculator( const LUTEFOverlapCalculator& calc ); - LUTEFOverlapCalculator & operator = ( const LUTEFOverlapCalculator & ) = delete; - - /// Function initializing the calculator object - virtual StatusCode initialize( const xercesc::DOMNode* bbnode, bool dumpLut,const std::string& runPeriod ); - - /// Calculate the overlap flags for two barrel sectors - void calculate( const EndcapSector& esec, const ForwardSector& fsec ) const; - - private: - // - // The LUT words take the form: - // - // variable | FRoI | ERoI | - // bit | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | - - }; // class LUTEFOverlapCalculator - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LUTEFOVERLAPCALCULATOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.cxx deleted file mode 100644 index 049f710c0f42c658067d49710dc066f058c9e51a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.cxx +++ /dev/null @@ -1,249 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTFFOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $ - -// STL include(s): -#include <sstream> -#include <string> -#include <iomanip> - -// XercesC include(s): -#include <xercesc/dom/DOMElement.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/util/XMLString.hpp> - -// Local include(s): -#include "LUTFFOverlapCalculator.h" -#include "ForwardSector.h" -#include "../Common/PtMultiplicitySet.h" - -namespace LVL1MUCTPI { - - LUTFFOverlapCalculator::LUTFFOverlapCalculator() - : LUTOverlapCalculatorBase( "LUTFFOverlapCalculator" ) { - - } - - LUTFFOverlapCalculator::LUTFFOverlapCalculator( const LUTFFOverlapCalculator& calc ) - : LUTOverlapCalculatorBase( calc ) { - - } - - StatusCode LUTFFOverlapCalculator::initialize( const xercesc::DOMNode* ffnode, bool dumpLut, const std::string& runPeriod ) { - - if( runPeriod == "RUN2" ){ - setMaximumThreshold( 6 ); - REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 6" ); - } - - // Clear the internal LUT: - m_lut.clear(); - - // - // Check if the received node is of the right type: - // - if( ffnode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) { - REPORT_ERROR_MSG( "Received node is not a DOMElement" ); - return StatusCode::RECOVERABLE; - } - - REPORT_VERBOSE_MSG( "Looping over \"FFElement\"-s:" ); - - // - // Initialize the F-F LUT: - // - const xercesc::DOMNodeList* element_list = ffnode->getChildNodes(); - for( XMLSize_t i = 0; i < element_list->getLength(); ++i ) { - - const xercesc::DOMNode* lut_node = element_list->item( i ); - char* cname = xercesc::XMLString::transcode( lut_node->getNodeName() ); - std::string sname( cname ); - xercesc::XMLString::release( &cname ); - - if( sname != "FFElement" ) continue; - - const xercesc::DOMElement* lut_element = - dynamic_cast< const xercesc::DOMElement* >( lut_node ); - if( ! lut_element ) { - REPORT_ERROR_MSG( "Unable to cast FFElement node into DOMElement" ); - return StatusCode::RECOVERABLE; - } - - XMLCh* roi1_name = xercesc::XMLString::transcode( "RoI1" ); - XMLCh* roi2_name = xercesc::XMLString::transcode( "RoI2" ); - - const XMLCh* roi1 = lut_element->getAttribute( roi1_name ); - const XMLCh* roi2 = lut_element->getAttribute( roi2_name ); - - xercesc::XMLString::release( &roi1_name ); - xercesc::XMLString::release( &roi2_name ); - - const int roi1_n = xercesc::XMLString::parseInt( roi1 ); - const int roi2_n = xercesc::XMLString::parseInt( roi2 ); - - // - // Create the word to be put into the LUT: - // - const unsigned int element = ( roi1_n & 0x3f ) | ( ( roi2_n & 0x3f ) << 6 ); - - m_lut[ element ] = true; - - if( dumpLut ) { - REPORT_VERBOSE_MSG( " --> RoI1: " << roi1_n << " RoI2: " << roi2_n - << " Element: 0x" << std::hex << std::setw( 3 ) - << std::setfill( '0' ) << element << std::dec ); - } - - } - - REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() ); - - return StatusCode::SUCCESS; - } - - void LUTFFOverlapCalculator::calculate( const ForwardSector& sector1, - const ForwardSector& sector2 ) const { - - // - // Calculate some helper quantities: - // - bool sec1cand1present = false, sec1cand2present = false; - bool sec2cand1present = false, sec2cand2present = false; - int sec1cand1pt = -1, sec1cand2pt = -1; - int sec2cand1pt = -1, sec2cand2pt = -1; - if( sector1.getPtCand1() != 7 ) { - sec1cand1present = true; - sec1cand1pt = sector1.getPtCand1(); - } - if( sector1.getPtCand2() != 7 ) { - sec1cand2present = true; - sec1cand2pt = sector1.getPtCand2(); - } - if( sector2.getPtCand1() != 7 ) { - sec2cand1present = true; - sec2cand1pt = sector2.getPtCand1(); - } - if( sector2.getPtCand2() != 7 ) { - sec2cand2present = true; - sec2cand2pt = sector2.getPtCand2(); - } - - // - // Find if a rule exists for sec1 cand1 and sec2 cand1: - // - unsigned int element = ( sector1.getROI1() & 0x3f ) | - ( ( sector2.getROI1() & 0x3f ) << 6 ); - if( sec1cand1present && sec2cand1present && - ( sec1cand1pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand1pt < sec2cand1pt ) { - sector1.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " << sector1.getSectorNumber() - << " in the " << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " << sector2.getSectorNumber() - << " in the " << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand2 and sec2 cand1: - // - element = ( sector1.getROI2() & 0x3f ) | ( ( sector2.getROI1() & 0x3f ) << 6 ); - if( sec1cand2present && sec2cand1present && - ( sec1cand2pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand2pt < sec2cand1pt ) { - sector1.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " << sector1.getSectorNumber() - << " in the " << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " << sector2.getSectorNumber() - << " in the " << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand1 and sec2 cand2: - // - element = ( sector1.getROI1() & 0x3f ) | ( ( sector2.getROI2() & 0x3f ) << 6 ); - if( sec1cand1present && sec2cand2present && - ( sec1cand1pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand1pt < sec2cand2pt ) { - sector1.setCand1Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " << sector1.getSectorNumber() - << " in the " << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " << sector2.getSectorNumber() - << " in the " << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - // - // Find if a rule exists for sec1 cand2 and sec2 cand2: - // - element = ( sector1.getROI2() & 0x3f ) | ( ( sector2.getROI2() & 0x3f ) << 6 ); - if( sec1cand2present && sec2cand2present && - ( sec1cand2pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) { - std::map< unsigned int, bool >::const_iterator it; - if( ( it = m_lut.find( element ) ) != m_lut.end() ) { - if( it->second ) { - if( sec1cand2pt < sec2cand2pt ) { - sector1.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " << sector1.getSectorNumber() - << " in the " << sector1.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } else { - sector2.setCand2Supressed( true ); -#ifndef NDEBUG - REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " << sector2.getSectorNumber() - << " in the " << sector2.getRapidityString() - << " rapidity region supressed" ); -#endif // NDEBUG - } - } - } - } - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.h deleted file mode 100644 index e7a4f4730a5b3b509aaa8db557cf4a060f0f8ee3..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.h +++ /dev/null @@ -1,58 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTFFOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_LUTFFOVERLAPCALCULATOR_H -#define TRIGT1MUCTPI_LUTFFOVERLAPCALCULATOR_H - -// Local include(s): -#include "LUTOverlapCalculatorBase.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class ForwardSector; - - /** - * @short Class flagging forward muon candidates for fake double-counts - * - * This class can be used to flag the one of the muon candidates in - * an overlapping forward sector pair if they are believed to be coming - * from the same muon. The muon with the higher p<sub>T</sub> is left - * un-flagged. - * - * @author Attila Krasznahorkay Jr. - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class LUTFFOverlapCalculator : public LUTOverlapCalculatorBase { - - public: - /// Default constructor - LUTFFOverlapCalculator(); - /// Copy constructor - LUTFFOverlapCalculator( const LUTFFOverlapCalculator& calc ); - LUTFFOverlapCalculator & operator = ( const LUTFFOverlapCalculator & ) = delete; - - /// Function initializing the calculator object - virtual StatusCode initialize( const xercesc::DOMNode* ffnode, bool dumpLut,const std::string& runPeriod ); - - /// Calculate the overlap flags for two barrel sectors - void calculate( const ForwardSector& sector1, const ForwardSector& sector2 ) const; - - private: - // - // The LUT words take the form: - // - // variable | RoI2 | RoI1 | - // bit | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | - - }; // class LUTFFOverlapCalculator - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LUTFFOVERLAPCALCULATOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.cxx deleted file mode 100644 index 52ea42ae88dc42124f633871a58040d22d76755d..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.cxx +++ /dev/null @@ -1,319 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTMultiplicityCalculator.cxx 650693 2015-03-01 16:53:48Z masato $ - -// STL include(s): -#include <sstream> - -// XercesC include(s): -#include <xercesc/dom/DOMElement.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/util/XMLString.hpp> - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// Local include(s): -#include "LUTMultiplicityCalculator.h" -#include "MioctSectorSet.h" -#include "MultiplicityLogic.h" - -namespace LVL1MUCTPI { - - LUTMultiplicityCalculator::LUTMultiplicityCalculator( const MultiplicityLogic* logic ) - : m_logger( "LUTMultiplicityCalculator" ), m_multiplicityLogic( logic ), - m_flagMode( false ) { - - } - - LUTMultiplicityCalculator::LUTMultiplicityCalculator( const LUTMultiplicityCalculator& calc ) - : m_logger( calc.m_logger ), - m_multiplicityLogic( calc.m_multiplicityLogic ), m_flagMode( calc.m_flagMode ), - m_bb_calc_1( calc.m_bb_calc_1 ), - m_bb_calc_2( calc.m_bb_calc_2 ), m_ee_calc_1( calc.m_ee_calc_1 ), - m_ee_calc_2( calc.m_ee_calc_2 ), m_ee_calc_3( calc.m_ee_calc_3 ), - m_ee_calc_4( calc.m_ee_calc_4 ), m_ee_calc_5( calc.m_ee_calc_5 ), - m_ff_calc_1( calc.m_ff_calc_1 ), m_ff_calc_2( calc.m_ff_calc_2 ), - m_be_calc_11( calc.m_be_calc_11 ), m_be_calc_12( calc.m_be_calc_12 ), - m_be_calc_22( calc.m_be_calc_22 ), m_be_calc_23( calc.m_be_calc_23 ), - m_be_calc_34( calc.m_be_calc_34 ), m_be_calc_35( calc.m_be_calc_35 ), - m_be_calc_45( calc.m_be_calc_45 ), m_be_calc_46( calc.m_be_calc_46 ), - m_ef_calc_21( calc.m_ef_calc_21 ), m_ef_calc_31( calc.m_ef_calc_31 ), - m_ef_calc_42( calc.m_ef_calc_42 ), m_ef_calc_52( calc.m_ef_calc_52 ), - m_ef_calc_63( calc.m_ef_calc_63 ) { - - } - - StatusCode LUTMultiplicityCalculator::initialize( const xercesc::DOMNode* node, bool flagMode, - bool dumpLut,const std::string& runPeriod ) { - - // - // Remember which mode was requested: - // - m_flagMode = flagMode; - - // - // Check if the received node "makes sense": - // - if( node->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) { - REPORT_ERROR_MSG( "Received node is not a DOMElement" ); - return StatusCode::RECOVERABLE; - } - - // - // Loop over all the nodes in this XML node: - // - const xercesc::DOMNodeList* lut_node_list = node->getChildNodes(); - for( XMLSize_t i = 0; i < lut_node_list->getLength(); ++i ) { - - const xercesc::DOMNode* lut_node = lut_node_list->item( i ); - char* cname = xercesc::XMLString::transcode( lut_node->getNodeName() ); - std::string sname( cname ); - xercesc::XMLString::release( &cname ); - - if ( sname == "BB1LUT" ) CHECK( m_bb_calc_1.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BB2LUT" ) CHECK( m_bb_calc_2.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EE1LUT" ) CHECK( m_ee_calc_1.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EE2LUT" ) CHECK( m_ee_calc_2.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EE3LUT" ) CHECK( m_ee_calc_3.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EE4LUT" ) CHECK( m_ee_calc_4.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EE5LUT" ) CHECK( m_ee_calc_5.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "FF1LUT" ) CHECK( m_ff_calc_1.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "FF2LUT" ) CHECK( m_ff_calc_2.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BE11LUT" ) CHECK( m_be_calc_11.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BE12LUT" ) CHECK( m_be_calc_12.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BE22LUT" ) CHECK( m_be_calc_22.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BE23LUT" ) CHECK( m_be_calc_23.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BE34LUT" ) CHECK( m_be_calc_34.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BE35LUT" ) CHECK( m_be_calc_35.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BE45LUT" ) CHECK( m_be_calc_45.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "BE46LUT" ) CHECK( m_be_calc_46.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EF21LUT" ) CHECK( m_ef_calc_21.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EF31LUT" ) CHECK( m_ef_calc_31.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EF42LUT" ) CHECK( m_ef_calc_42.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EF52LUT" ) CHECK( m_ef_calc_52.initialize( lut_node, dumpLut, runPeriod ) ); - else if( sname == "EF63LUT" ) CHECK( m_ef_calc_63.initialize( lut_node, dumpLut, runPeriod ) ); - - } - - return StatusCode::SUCCESS; - } - - PtMultiplicitySet - LUTMultiplicityCalculator::calculateMultiplicity( const MioctSectorSet& data ) const { - - // - // Let's make sure that all the suppression flags are off as a start: - // - data.Barrel1.setCand1Supressed( false ); data.Barrel1.setCand2Supressed( false ); - data.Barrel2.setCand1Supressed( false ); data.Barrel2.setCand2Supressed( false ); - data.Barrel3.setCand1Supressed( false ); data.Barrel3.setCand2Supressed( false ); - data.Barrel4.setCand1Supressed( false ); data.Barrel4.setCand2Supressed( false ); - data.Endcap1.setCand1Supressed( false ); data.Endcap1.setCand2Supressed( false ); - data.Endcap2.setCand1Supressed( false ); data.Endcap2.setCand2Supressed( false ); - data.Endcap3.setCand1Supressed( false ); data.Endcap3.setCand2Supressed( false ); - data.Endcap4.setCand1Supressed( false ); data.Endcap4.setCand2Supressed( false ); - data.Endcap5.setCand1Supressed( false ); data.Endcap5.setCand2Supressed( false ); - data.Endcap6.setCand1Supressed( false ); data.Endcap6.setCand2Supressed( false ); - data.Forward1.setCand1Supressed( false ); data.Forward1.setCand2Supressed( false ); - data.Forward2.setCand1Supressed( false ); data.Forward2.setCand2Supressed( false ); - data.Forward3.setCand1Supressed( false ); data.Forward3.setCand2Supressed( false ); - - PtMultiplicitySet result; - - ////////////////////////////////////////////////////////////////////////////////////////// - // // - // Flag the candidates which should be suppressed in the multiplicity count // - // // - ////////////////////////////////////////////////////////////////////////////////////////// - - // - // Flag barrel-barrel overlaps: - // - m_bb_calc_1.calculate( data.Barrel1, data.Barrel2 ); - m_bb_calc_2.calculate( data.Barrel3, data.Barrel4 ); - - // - // Flag endcap-endcap overlaps: - // - m_ee_calc_1.calculate( data.Endcap1, data.Endcap2 ); - m_ee_calc_2.calculate( data.Endcap2, data.Endcap3 ); - m_ee_calc_3.calculate( data.Endcap3, data.Endcap4 ); - m_ee_calc_4.calculate( data.Endcap4, data.Endcap5 ); - m_ee_calc_5.calculate( data.Endcap5, data.Endcap6 ); - - // - // Flag forward-forward overlaps: - // - m_ff_calc_1.calculate( data.Forward1, data.Forward2 ); - m_ff_calc_2.calculate( data.Forward2, data.Forward3 ); - - // - // Flag barrel-endcap overlaps: - // - m_be_calc_11.calculate( data.Barrel1, data.Endcap1 ); - m_be_calc_12.calculate( data.Barrel1, data.Endcap2 ); - m_be_calc_22.calculate( data.Barrel2, data.Endcap2 ); - m_be_calc_23.calculate( data.Barrel2, data.Endcap3 ); - m_be_calc_34.calculate( data.Barrel3, data.Endcap4 ); - m_be_calc_35.calculate( data.Barrel3, data.Endcap5 ); - m_be_calc_45.calculate( data.Barrel4, data.Endcap5 ); - m_be_calc_46.calculate( data.Barrel4, data.Endcap6 ); - - // - // Flag endcap-forward overlaps: - // - m_ef_calc_21.calculate( data.Endcap2, data.Forward1 ); - m_ef_calc_31.calculate( data.Endcap3, data.Forward1 ); - m_ef_calc_42.calculate( data.Endcap4, data.Forward2 ); - m_ef_calc_52.calculate( data.Endcap5, data.Forward2 ); - m_ef_calc_63.calculate( data.Endcap6, data.Forward3 ); - - ////////////////////////////////////////////////////////////////////////////////////////// - // // - // Calculate candidate multiplicity after overlap removal // - // // - ////////////////////////////////////////////////////////////////////////////////////////// - - // - // Add the unsupressed barrel candidates: - // - if( ( ! data.Barrel1.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Barrel1.getPtCand1(), - data.Barrel1.getSectorID(), - true ); - if( ( ! data.Barrel1.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Barrel1.getPtCand2(), - data.Barrel1.getSectorID(), - false ); - if( ( ! data.Barrel2.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Barrel2.getPtCand1(), - data.Barrel2.getSectorID(), - true ); - if( ( ! data.Barrel2.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Barrel2.getPtCand2(), - data.Barrel2.getSectorID(), - false ); - if( ( ! data.Barrel3.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Barrel3.getPtCand1(), - data.Barrel3.getSectorID(), - true ); - if( ( ! data.Barrel3.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Barrel3.getPtCand2(), - data.Barrel3.getSectorID(), - false ); - if( ( ! data.Barrel4.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Barrel4.getPtCand1(), - data.Barrel4.getSectorID(), - true ); - if( ( ! data.Barrel4.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Barrel4.getPtCand2(), - data.Barrel4.getSectorID(), - false ); - - // - // Add the unsupressed endcap candidates: - // - if( ( ! data.Endcap1.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap1.getPtCand1(), - data.Endcap1.getSectorID(), - true ); - if( ( ! data.Endcap1.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap1.getPtCand2(), - data.Endcap1.getSectorID(), - false ); - if( ( ! data.Endcap2.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap2.getPtCand1(), - data.Endcap2.getSectorID(), - true ); - if( ( ! data.Endcap2.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap2.getPtCand2(), - data.Endcap2.getSectorID(), - false ); - if( ( ! data.Endcap3.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap3.getPtCand1(), - data.Endcap3.getSectorID(), - true ); - if( ( ! data.Endcap3.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap3.getPtCand2(), - data.Endcap3.getSectorID(), - false ); - if( ( ! data.Endcap4.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap4.getPtCand1(), - data.Endcap4.getSectorID(), - true ); - if( ( ! data.Endcap4.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap4.getPtCand2(), - data.Endcap4.getSectorID(), - false ); - if( ( ! data.Endcap5.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap5.getPtCand1(), - data.Endcap5.getSectorID(), - true ); - if( ( ! data.Endcap5.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap5.getPtCand2(), - data.Endcap5.getSectorID(), - false ); - if( ( ! data.Endcap6.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap6.getPtCand1(), - data.Endcap6.getSectorID(), - true ); - if( ( ! data.Endcap6.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Endcap6.getPtCand2(), - data.Endcap6.getSectorID(), - false ); - - // - // Add the unsupressed forward candidates: - // - if( ( ! data.Forward1.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Forward1.getPtCand1(), - data.Forward1.getSectorID(), - true ); - if( ( ! data.Forward1.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Forward1.getPtCand2(), - data.Forward1.getSectorID(), - false ); - if( ( ! data.Forward2.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Forward2.getPtCand1(), - data.Forward2.getSectorID(), - true ); - if( ( ! data.Forward2.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Forward2.getPtCand2(), - data.Forward2.getSectorID(), - false ); - if( ( ! data.Forward3.getCand1Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Forward3.getPtCand1(), - data.Forward3.getSectorID(), - true ); - if( ( ! data.Forward3.getCand2Supressed() ) || m_flagMode ) - result += m_multiplicityLogic->calculateMultiplicity( data.Forward3.getPtCand2(), - data.Forward3.getSectorID(), - false ); - - return result; - } - - bool operator== ( const LUTMultiplicityCalculator& calc1, - const LUTMultiplicityCalculator& calc2 ) { - - if( ( calc1.m_bb_calc_1 == calc2.m_bb_calc_1 ) && - ( calc1.m_bb_calc_2 == calc2.m_bb_calc_2 ) && - ( calc1.m_ee_calc_1 == calc2.m_ee_calc_1 ) && - ( calc1.m_ee_calc_2 == calc2.m_ee_calc_2 ) && - ( calc1.m_ee_calc_3 == calc2.m_ee_calc_3 ) && - ( calc1.m_ee_calc_4 == calc2.m_ee_calc_4 ) && - ( calc1.m_ee_calc_5 == calc2.m_ee_calc_5 ) && - ( calc1.m_ff_calc_1 == calc2.m_ff_calc_1 ) && - ( calc1.m_ff_calc_2 == calc2.m_ff_calc_2 ) ) { - - return true; - } else { - - return false; - } - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.h deleted file mode 100644 index 7a2b6cb84aa98b8ee7527f500f2e152433add44a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.h +++ /dev/null @@ -1,93 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTMultiplicityCalculator.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_LUTMULTIPLICITYCALCULATOR_H -#define TRIGT1MUCTPI_LUTMULTIPLICITYCALCULATOR_H - -// XercesC include(s): -#include <xercesc/dom/DOMNode.hpp> - -// Gaudi/Athena include(s): -#include "GaudiKernel/StatusCode.h" - -// Local include(s): -#include "LUTBBOverlapCalculator.h" -#include "LUTEEOverlapCalculator.h" -#include "LUTFFOverlapCalculator.h" -#include "LUTBEOverlapCalculator.h" -#include "LUTEFOverlapCalculator.h" -#include "../Common/PtMultiplicitySet.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MioctSectorSet; - class LUTMultiplicityCalculator; - class MultiplicityLogic; - - bool operator== ( const LUTMultiplicityCalculator& calc1, - const LUTMultiplicityCalculator& calc2 ); - - /** - * @short Class capable of calculating the multiplicity in one MIOCT - * - * Each MIOCT can calculate its multiplicity using such an object. - * It is handled separately from the MIOCTs, as multiple MIOCTs can - * possibly share the same configuration. (Although in real life they - * don't really because of the RPC pad numbering scheme...) - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class LUTMultiplicityCalculator { - - public: - /// Constructor only taking a multiplicity logic - LUTMultiplicityCalculator( const MultiplicityLogic* logic ); - /// Copy constructor - LUTMultiplicityCalculator( const LUTMultiplicityCalculator& calculator ); - LUTMultiplicityCalculator & operator = ( const LUTMultiplicityCalculator & ) = delete; - - /// Function initializing the object from an XML file - StatusCode initialize( const xercesc::DOMNode* node, bool flagMode, - bool dumpLut, const std::string& runPeriod ); - - /// Function calculating the multiplicity for one MIOCT - PtMultiplicitySet calculateMultiplicity( const MioctSectorSet& sectorData ) const; - - private: - /// The message logger object - mutable MsgLogger m_logger; - - /// Pointer to the multiplicity logic of this MIOCT - const MultiplicityLogic* m_multiplicityLogic; - - /// When set to true, the multiplicity calculation is in flagging mode - bool m_flagMode; - - // - // The different overlap calculator/flagger objects: - // - LUTBBOverlapCalculator m_bb_calc_1, m_bb_calc_2; - LUTEEOverlapCalculator m_ee_calc_1, m_ee_calc_2, m_ee_calc_3, m_ee_calc_4, m_ee_calc_5; - LUTFFOverlapCalculator m_ff_calc_1, m_ff_calc_2; - LUTBEOverlapCalculator m_be_calc_11, m_be_calc_12, m_be_calc_22, m_be_calc_23; - LUTBEOverlapCalculator m_be_calc_34, m_be_calc_35, m_be_calc_45, m_be_calc_46; - LUTEFOverlapCalculator m_ef_calc_21, m_ef_calc_31, m_ef_calc_42; - LUTEFOverlapCalculator m_ef_calc_52, m_ef_calc_63; - - friend bool LVL1MUCTPI::operator== ( const LUTMultiplicityCalculator& calc1, - const LUTMultiplicityCalculator& calc2 ); - - }; // class LUTMultiplicityCalculator - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LUTMULTIPLICITYCALCULATOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.cxx deleted file mode 100644 index a5bdad7bf840c3d49777771e981526c2a04a7c99..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.cxx +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTOverlapCalculatorBase.cxx 448474 2011-07-13 09:01:48Z krasznaa $ - -// Local include(s): -#include "LUTOverlapCalculatorBase.h" - -namespace LVL1MUCTPI { - - LUTOverlapCalculatorBase::LUTOverlapCalculatorBase( const std::string& name ) - : m_logger( name ), m_lut(), m_thr( 3 ) { - - } - - LUTOverlapCalculatorBase::LUTOverlapCalculatorBase( const LUTOverlapCalculatorBase& calc ) - : m_logger( calc.m_logger ), m_lut( calc.m_lut ), m_thr( calc.m_thr ) { - - } - - void LUTOverlapCalculatorBase::setMaximumThreshold( int thr ) { - - m_thr = thr; - return; - } - - bool operator== ( const LUTOverlapCalculatorBase& calc1, - const LUTOverlapCalculatorBase& calc2 ) { - - if( calc1.m_lut == calc2.m_lut ) return true; - else return false; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.h deleted file mode 100644 index 79b659be4733be8caacba68977bea0a08c0a1b92..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.h +++ /dev/null @@ -1,98 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTOverlapCalculatorBase.h 707664 2015-11-13 05:36:00Z ssnyder $ -#ifndef TRIGT1MUCTPI_LUTOVERLAPCALCULATORBASE_H -#define TRIGT1MUCTPI_LUTOVERLAPCALCULATORBASE_H - -// STL include(s): -#include <map> -#include <string> - -// XercesC include(s): -#include <xercesc/dom/DOMNode.hpp> - -// Gaudi/Athena include(s): -#include "GaudiKernel/StatusCode.h" - -// Local include(s): -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - class LUTOverlapCalculatorBase; - bool operator== ( const LUTOverlapCalculatorBase& calc1, - const LUTOverlapCalculatorBase& calc2 ); - - /** - * @short Base class for the LUT overlap calculators - * - * All overlap calculators share some common properties. This class - * tries to group them, to minimize code duplication. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 707664 $ - * $Date: 2015-11-13 06:36:00 +0100 (Fri, 13 Nov 2015) $ - */ - class LUTOverlapCalculatorBase { - - public: - /// "Regular" constructor - LUTOverlapCalculatorBase( const std::string& name ); - /// Copy constructor - LUTOverlapCalculatorBase( const LUTOverlapCalculatorBase& calc ); - LUTOverlapCalculatorBase & operator = ( const LUTOverlapCalculatorBase & ) = delete; - - /// Virtual destructor to make vtable happy - virtual ~LUTOverlapCalculatorBase() {} - - /// Common initialization function for all kinds of calculator types - /** - * Calculators are always initialized from XML files. The owner of the - * calculator object is responsible for giving the calculator the - * XML node that describes the configuration for the object. - * - * @param node The XML node that holds the configuration for the object - * @param dumpLut When set to <code>true</code> the calculator will print - * the contents of the read LUT. For debugging only. - */ - virtual StatusCode initialize( const xercesc::DOMNode* node, bool dumpLut, const std::string& runPeriod ) = 0; - - /// Set the maximal threshold for overlap removal - /** - * The hardware uses a small LUT that defines which threshold combinations - * can be taken into account when evaluating a fake double count. However in - * practice we always only use a very simple configuration. We take the lowest - * N thresholds into account and ignore the higher threshold candidates. This - * function defined the maximal threshold that should still be taken into - * account. - */ - void setMaximumThreshold( int thr ); - - protected: - /// For printing messages - mutable MsgLogger m_logger; - - /// Each overlap calculator should work with such a "look up table" - std::map< unsigned int, bool > m_lut; - - /// Maximal threshold to be taken into account in overlap removal - int m_thr; - - /// This operator helps to compare all "simple" overlap calculators - friend bool LVL1MUCTPI::operator== ( const LUTOverlapCalculatorBase& calc1, - const LUTOverlapCalculatorBase& calc2 ); - - }; // class LUTOverlapCalculatorBase - - /// Operator comparing overlap calculator objects - bool operator== ( const LUTOverlapCalculatorBase& calc1, - const LUTOverlapCalculatorBase& calc2 ); - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LUTOVERLAPCALCULATORBASE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.cxx deleted file mode 100644 index d46b6b9d1d8b0fafab9a2984c7307048f75313d3..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.cxx +++ /dev/null @@ -1,252 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTStrategy.cxx 650693 2015-03-01 16:53:48Z masato $ - -// STL include(s): -#include <sstream> -#include <algorithm> -#include <vector> - -// XercesC include(s): -#include <xercesc/util/PlatformUtils.hpp> -#include <xercesc/util/XMLString.hpp> -#include <xercesc/parsers/XercesDOMParser.hpp> -#include <xercesc/dom/DOMException.hpp> -#include <xercesc/dom/DOMDocument.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/dom/DOMElement.hpp> - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// Trigger include(s): -#include "TrigConfMuctpi/EntityResolver.h" -#include "TrigConfMuctpi/ErrorHandler.h" - -// Local include(s): -#include "LUTStrategy.h" - -namespace LVL1MUCTPI { - - LUTStrategy::LUTStrategy( const MultiplicityLogic* logic ) - : OverlapStrategy( "LUT-Based-Overlap-Strategy" ), m_logger( "LUTStrategy" ), - m_multiplicityLogic( logic ) { - - // - // Create a valid, but empty configuration as a start: - // - LUTMultiplicityCalculator calc( m_multiplicityLogic ); - m_calculator_list.push_back( calc ); - - for( unsigned int i = 0; i < 8; ++i ) { - MioctID id( i, NEGATIVE ); - m_calculator_map[ id ] = &m_calculator_list.back(); - } - for( unsigned int i = 0; i < 8; ++i ) { - MioctID id( i, POSITIVE ); - m_calculator_map[ id ] = &m_calculator_list.back(); - } - } - - LUTStrategy::LUTStrategy( const LUTStrategy& strategy ) - : OverlapStrategy( "LUT-Based-Overlap-Strategy" ), m_logger( "LUTStrategy" ), - m_multiplicityLogic( strategy.m_multiplicityLogic ) { - - // Replicate the list: - for( std::list< LUTMultiplicityCalculator >::const_iterator it = - strategy.m_calculator_list.begin(); it != strategy.m_calculator_list.end(); - ++it ) { - m_calculator_list.push_back( *it ); - } - - // Replicate the map: - for( std::map< MioctID, const LUTMultiplicityCalculator* >::const_iterator it = - strategy.m_calculator_map.begin(); it != strategy.m_calculator_map.end(); - ++it ) { - - for( std::list< LUTMultiplicityCalculator >::const_iterator calc = - m_calculator_list.begin(); calc != m_calculator_list.end(); ++calc ) { - if( ( *it->second ) == ( *calc ) ) { - m_calculator_map[ it->first ] = &( *calc ); - break; - } - } - } - } - - StatusCode LUTStrategy::initialize( const std::string& lutXMLFile, bool flagMode, - bool dumpLut, const std::string& runPeriod ) { - - m_calculator_list.clear(); - m_calculator_map.clear(); - - REPORT_MSG(DEBUG, "Initializing LUTStrategy from file: " << lutXMLFile << " with a RunPeriod setting " << runPeriod ); - - // - // Initialize XercesC: - // - try { - - xercesc::XMLPlatformUtils::Initialize(); - - } catch( const xercesc::XMLException& ex ) { - char* error_message = xercesc::XMLString::transcode( ex.getMessage() ); - REPORT_ERROR_MSG( "Failed to initialize XercesC because: " << error_message ); - xercesc::XMLString::release( &error_message ); - return StatusCode::RECOVERABLE; - } - - // - // Parse the LUT XML file: - // - xercesc::XercesDOMParser* lutParser = new xercesc::XercesDOMParser(); - - try { - - Muctpi::EntityResolver resolver; - lutParser->setEntityResolver( &resolver ); - Muctpi::ErrorHandler handler; - lutParser->setErrorHandler( &handler ); - - lutParser->parse( lutXMLFile.c_str() ); - - } catch( const xercesc::XMLException& ex ) { - char* error_message = xercesc::XMLString::transcode( ex.getMessage() ); - REPORT_ERROR_MSG( "XMLException received while parsing the LUT XML file." ); - REPORT_ERROR_MSG( "Message: " << error_message ); - xercesc::XMLString::release( &error_message ); - return StatusCode::RECOVERABLE; - } catch( const xercesc::DOMException& ex ) { - char* error_message = xercesc::XMLString::transcode( ex.getMessage() ); - REPORT_ERROR_MSG( "DOMException received while parsing the LUT XML file." ); - REPORT_ERROR_MSG( "Message: " << error_message ); - xercesc::XMLString::release( &error_message ); - return StatusCode::RECOVERABLE; - } catch(...) { - REPORT_ERROR_MSG( "LUT XML file parsing failed with unknown exception" ); - return StatusCode::RECOVERABLE; - } - - const xercesc::DOMDocument* lutDocument = lutParser->getDocument(); - const xercesc::DOMNodeList* lutNodes = lutDocument->getChildNodes(); - REPORT_VERBOSE_MSG( "Number of nodes in the LUT XML file: " - << lutNodes->getLength() ); - - const xercesc::DOMNode* lutNode = 0; - for( XMLSize_t i = 0; i < lutNodes->getLength(); ++i ) { - const xercesc::DOMNode* node = lutNodes->item( i ); - char* cnode_name = xercesc::XMLString::transcode( node->getNodeName() ); - std::string snode_name( cnode_name ); - xercesc::XMLString::release( &cnode_name ); - REPORT_VERBOSE_MSG( "Investigating node with name: " << snode_name ); - if( ( snode_name == "MUCTPI_LUT" ) && - ( node->getNodeType() == xercesc::DOMNode::ELEMENT_NODE ) ) { - lutNode = node; - break; - } - } - if( ! lutNode ) { - REPORT_ERROR_MSG( "Couldn't find 'MUCTPI_LUT' node in the LUT XML!" ); - return StatusCode::RECOVERABLE; - } - - const xercesc::DOMNodeList* mioctNodes = lutNode->getChildNodes(); - for( XMLSize_t i = 0; i < mioctNodes->getLength(); ++i ) { - - const xercesc::DOMNode* mioctNode = mioctNodes->item( i ); - char* cname = xercesc::XMLString::transcode( mioctNode->getNodeName() ); - std::string sname( cname ); - xercesc::XMLString::release( &cname ); - - if( sname != "Mioct" ) continue; - - const xercesc::DOMElement* mioctElement = - dynamic_cast< const xercesc::DOMElement* >( mioctNode ); - if( ! mioctElement ) { - REPORT_ERROR_MSG( "Unable to cast Mioct node into DOMElement" ); - return StatusCode::RECOVERABLE; - } - - REPORT_VERBOSE_MSG( ">>>>>>>>>>>>>>>> Starting to initialize calculator <<<<<<<<<<<<<<<<" ); - LUTMultiplicityCalculator calc( m_multiplicityLogic ); - CHECK( calc.initialize( mioctNode, flagMode, dumpLut, runPeriod ) ); - REPORT_VERBOSE_MSG( ">>>>>>>>>>>>>>>> Calculator initialization finished <<<<<<<<<<<<<<<<" ); - - // Check if this calculator is not defined yet: - std::list< LUTMultiplicityCalculator >::const_iterator it; - if( ( it = std::find( m_calculator_list.begin(), m_calculator_list.end(), calc ) ) == - m_calculator_list.end() ) { - m_calculator_list.push_back( calc ); - it = std::find( m_calculator_list.begin(), m_calculator_list.end(), calc ); - REPORT_VERBOSE_MSG( "This is a new calculator definition" ); - } else { - REPORT_VERBOSE_MSG( "This calculator definition already exists" ); - } - - // - // Extract the Mioct IDs that this calculator represents: - // - XMLCh* mioct_ids_name = xercesc::XMLString::transcode( "IDs" ); - const XMLCh* mioct_ids = mioctElement->getAttribute( mioct_ids_name ); - xercesc::XMLString::release( &mioct_ids_name ); - - char* cids = xercesc::XMLString::transcode( mioct_ids ); - std::string sids( cids ); - xercesc::XMLString::release( &cids ); - - std::vector< unsigned int > ids; - std::istringstream stream_ids( sids ); - while( ! stream_ids.eof() ) { - unsigned int id; - stream_ids >> id; - ids.push_back( id ); - } - - // - // Assign the correct Miocts to this calculator: - // - REPORT_VERBOSE_MSG( "This calculator represents Miocts:" ); - for( std::vector< unsigned int >::const_iterator id = ids.begin(); id != ids.end(); - ++id ) { - if( ( *id ) < 8 ) { - MioctID mid( ( *id ), NEGATIVE ); - m_calculator_map[ mid ] = &*it; - REPORT_VERBOSE_MSG( " --> Mioct " << ( *id ) - << " in the NEGATIVE rapidity region" ); - } else { - MioctID mid( ( *id ) - 8, POSITIVE ); - m_calculator_map[ mid ] = &*it; - REPORT_VERBOSE_MSG( " --> Mioct " << ( ( *id ) - 8 ) - << " in the POSITIVE rapidity region" ); - } - } - } - - REPORT_VERBOSE_MSG( "Number of different calculators created: " - << m_calculator_list.size() ); - - delete lutParser; - - // - // Terminate XercesC: - // - xercesc::XMLPlatformUtils::Terminate(); - - return StatusCode::SUCCESS; - } - - PtMultiplicitySet LUTStrategy::calculateMultiplicity( const MioctSectorSet& sectorData, - const MioctID& mioct ) const { - - if( m_calculator_map.find( mioct ) != m_calculator_map.end() ) { - return m_calculator_map.find( mioct )->second->calculateMultiplicity( sectorData ); - } - - REPORT_ERROR_MSG( "Multiplicity calculation asked for unknown Mioct!" ); - PtMultiplicitySet result; - return result; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.h deleted file mode 100644 index fa7a79800e0b9ab73f942069e546d98d443a267c..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.h +++ /dev/null @@ -1,70 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LUTStrategy.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_LUTSTRATEGY_H -#define TRIGT1MUCTPI_LUTSTRATEGY_H - -// STL include(s): -#include <map> -#include <list> -#include <string> - -// Gaudi/Athena include(s): -#include "GaudiKernel/StatusCode.h" - -// Local include(s): -#include "OverlapStrategy.h" -#include "MioctID.h" -#include "LUTMultiplicityCalculator.h" -#include "../Common/PtMultiplicitySet.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MultiplicityLogic; - - /** - * @brief Overlap strategy for the hardware's LUT based overlap removal - * - * This overlap strategy simulates the final hardware's overlap - * removal logic. It is initialized with the same XML files as the - * hardware is. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 701446 $ - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - */ - class LUTStrategy : public OverlapStrategy { - - public: - /// Standard constructor, specifying a multiplicity logic - LUTStrategy( const MultiplicityLogic* logic ); - /// Copy constructor - LUTStrategy( const LUTStrategy& strategy ); - LUTStrategy & operator = ( const LUTStrategy & ) = delete; - - /// Function initializing the strategy object - StatusCode initialize( const std::string& lutXMLFile, bool flagMode, - bool dumpLut, const std::string& runPeriod ); - - /// Function calculating the multiplicity for one MIOCT - virtual PtMultiplicitySet calculateMultiplicity( const MioctSectorSet& data, - const MioctID& mioct ) const; - - private: - mutable MsgLogger m_logger; - const MultiplicityLogic* m_multiplicityLogic; - std::map< MioctID, const LUTMultiplicityCalculator* > m_calculator_map; - std::list< LUTMultiplicityCalculator > m_calculator_list; - - }; // LUTStrategy - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_LUTSTRATEGY_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.cxx deleted file mode 100644 index 9cc79f67890b2cfc67ac53c427f09440fa7da1d2..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.cxx +++ /dev/null @@ -1,182 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MioctData.cxx 439423 2011-05-25 21:22:40Z krasznaa $ - -// Local include(s): -#include "MioctData.h" -#include "MioctSectorSet.h" -#include "OverlapLogic.h" -#include "MioctID.h" -#include "../Common/BitOp.h" -#include "../Common/PtMultiplicitySet.h" -#include "../Common/MuctpiBitMasks.h" -#include "../Logging/MsgLogger.h" - - -/******************************************************************* - * $Date: 2011-05-25 23:22:40 +0200 (Wed, 25 May 2011) $ - * - * Implementation of class MioctData - * @author Author: Thorsten Wengler - * @version $Revision: 439423 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - const unsigned int MioctData::m_startMioct = MioctStartMask; - const unsigned int MioctData::m_endMioct = MioctEndMask; - const unsigned int MioctData::m_sectorNumberMap[ SECTORS_IN_MIOCT ] = { - 0xa, 0xb, 0xc, 0x7, 0x8, 0x9, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 - }; - - // constructor - MioctData::MioctData() - : m_headerWord( 0 ), m_trailerWord( 0 ), m_flags( 0 ), - m_sectorWords(), m_sectorHighBits(), m_eventID() { - - } - - void MioctData::assignData( const MioctID& ID, const MioctSectorSet& mioctSectors, - const OverlapLogic* lvl1OverlapLogic ) { - - // Start with calculating the multiplicity. This flags the candidates that - // were suppressed in the multiplicity calculation. - PtMultiplicitySet ptSums = lvl1OverlapLogic->calculateMultiplicity( mioctSectors, ID ); - - // get the information needed for the Header word and fill it - m_headerWord = 0; - unsigned int MNBR = ID.getNumber(); // module number - Hemisphere theHem = ID.getRapidityRegion(); // Rapidity region - if( theHem == POSITIVE ) MNBR += 8; - unsigned int EVID = m_eventID.getEvID(); // Event ID - unsigned int BCID = m_eventID.BCID(); // Bunch ID - BitOp::sImposeNBits( &m_headerWord, 28, MNBR ); // impose Module Number - BitOp::sImposeNBits( &m_headerWord, 12, EVID ); // impose EVID - BitOp::sImposeNBits( &m_headerWord, 0, BCID ); // impose BCID - - // get the list of sector words from the set of sectors belonging to this MIOCT - m_sectorWords.clear(); - m_sectorHighBits.clear(); - for( unsigned int i = 0; i < mioctSectors.getBitFieldSet()->size(); ++i ) { - m_sectorWords.push_back( *mioctSectors.getBitFieldSet()->at( i ) ); - // Bit 36 is the suppression bit for the first candidate, and bit 37 is the - // suppression bit for the second candidate. - m_sectorHighBits.push_back( m_sectorNumberMap[ i ] ); - switch( i ) { - case 0: - m_sectorHighBits[ i ] |= ( mioctSectors.Forward1.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Forward1.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 1: - m_sectorHighBits[ i ] |= ( mioctSectors.Forward2.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Forward2.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 2: - m_sectorHighBits[ i ] |= ( mioctSectors.Forward3.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Forward3.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 3: - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap4.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap4.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 4: - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap5.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap5.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 5: - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap6.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap6.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 6: - m_sectorHighBits[ i ] |= ( mioctSectors.Barrel1.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Barrel1.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 7: - m_sectorHighBits[ i ] |= ( mioctSectors.Barrel2.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Barrel2.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 8: - m_sectorHighBits[ i ] |= ( mioctSectors.Barrel3.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Barrel3.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 9: - m_sectorHighBits[ i ] |= ( mioctSectors.Barrel4.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Barrel4.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 10: - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap1.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap1.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 11: - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap2.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap2.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - case 12: - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap3.getCand1Supressed() ? - 0x10 : 0x0 ); - m_sectorHighBits[ i ] |= ( mioctSectors.Endcap3.getCand2Supressed() ? - 0x20 : 0x0 ); - break; - default: - MsgLogger logger( "MioctData" ); - REPORT_ERROR_MSG2( "There's a coding mistake in the MIOCT simulation!", logger ); - break; - } - } - - // Fill the trailer word: - m_trailerWord = 0; - // Pt sums - BitOp::sImposeNBits( &m_trailerWord, 10, ptSums.getMultiplicity( 1 ) ); - BitOp::sImposeNBits( &m_trailerWord, 13, ptSums.getMultiplicity( 2 ) ); - BitOp::sImposeNBits( &m_trailerWord, 16, ptSums.getMultiplicity( 3 ) ); - BitOp::sImposeNBits( &m_trailerWord, 19, ptSums.getMultiplicity( 4 ) ); - BitOp::sImposeNBits( &m_trailerWord, 22, ptSums.getMultiplicity( 5 ) ); - BitOp::sImposeNBits( &m_trailerWord, 25, ptSums.getMultiplicity( 6 ) ); - // flags: nothing set for now - m_flags = 0; - BitOp::sImposeNBits( &m_trailerWord, 7, m_flags ); - // word count: number of sector words plus header and trailer - // overwritten later by method setTrailorWordCount in case - // zero suppression is switched on - BitOp::sImposeNBits( &m_trailerWord, 0, - static_cast< unsigned int >( m_sectorWords.size() + 2 ) ); - - return; - } - - void MioctData::setTrailerWordCount( unsigned int theWordCount ){ - - for( int i = 0; i < 7; ++i ) { BitOp::clearBit( &m_trailerWord, i ); } - BitOp::sImposeNBits( &m_trailerWord, 0, theWordCount ); - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.h deleted file mode 100644 index d015b7f930ce7c8c9a2e553cbeeb4bb7e5499844..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.h +++ /dev/null @@ -1,115 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MioctData.h 439303 2011-05-25 15:20:17Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIOCTDATA_H -#define TRIGT1MUCTPI_MIOCTDATA_H - -// STL include(s): -#include <vector> - -// Local include(s): -#include "../Common/EventID.h" -#include "../Common/SectorConstants.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MioctID; - class MioctSectorSet; - class OverlapLogic; - - /** - ******************************************************************* - * - * $Date: 2011-05-25 17:20:17 +0200 (Wed, 25 May 2011) $ - * - * @short Helper class for access of MIOCT data in MIBAK format - * - * MioctData is a helper class to provide easy access - * of the data of one MIOCT module in the format as seen - * on the MIBAK backplane by the Read Out Driver MIROD. - * - * @see MioctModule - * @author Author: Thorsten Wengler - * @version $Revision: 439303 $ - * - ******************************************************************* - */ - class MioctData { - - public: - /** - * The constructor of MioctData - */ - MioctData(); - - /** - * This method fills the pointer list and additional words - * with the necessary data from its MIOCT module - */ - void assignData( const MioctID&, const MioctSectorSet&, const OverlapLogic* ); - /** - * This method sets the word count in the trailor word - - * needs to be an extra method as this has to be set - * at a later stage ( not in assignData), when the number - * of sector words after zero suppression has been determined - * @param theWordCount word count for this MIOCT, including - * header and trailor word - * @see MioctData::assignData() - */ - void setTrailerWordCount( unsigned int theWordCount ); - /** - * This method returns the start marker, which on the MIBAK - * is contained in bit 32 - 35, and marks the beginning of - * a MIOCT module in the data stream - * @return the MIOCT start marker - */ - unsigned int getStartMarker () const { return m_startMioct; } - /** - * This method returns the end marker, which on the MIBAK - * is contained in bit 32 - 35, and marks the end of - * a MIOCT module in the data stream - * @return the MIOCT end marker - */ - unsigned int getEndMarker () const { return m_endMioct; } - /** - * This method returns the header word - * @return the header word with module number, - * event ID and BCID - */ - unsigned int getHeader () const { return m_headerWord; } - /** - * This method returns the trailor word - * @return the trailer word with Pt sums, - * flags and word count - */ - unsigned int getTrailer () const { return m_trailerWord; } - /** - * This method returns a reference to the list of sector - * data words of this MIOCT. Each sector gets a word, even - * if empty, such that the position is equal to the sector - * number - */ - const std::vector< unsigned int >* getSectorWords() const { return &m_sectorWords; } - const std::vector< unsigned int >* getSectorHighBits() const { return &m_sectorHighBits; } - - private: - unsigned int m_headerWord; - static const unsigned int m_startMioct; - unsigned int m_trailerWord; - static const unsigned int m_endMioct; - unsigned int m_flags; - std::vector< unsigned int > m_sectorWords; - std::vector< unsigned int > m_sectorHighBits; - EventID m_eventID; - static const unsigned int m_sectorNumberMap[ SECTORS_IN_MIOCT ]; - - }; // class MioctData - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCTDATA_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.cxx deleted file mode 100644 index cef6e357d8024b7f2c0a89c2c7a1267e93a49024..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.cxx +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MioctID.cxx 364083 2011-05-06 09:09:55Z krasznaa $ - -// Local include(s): -#include "MioctID.h" -#include "../Common/SectorConstants.h" -#include "../Common/BitOp.h" - -//*********************************************************************** -// -// Version : $Revision: 364083 $ -// -// Description : creates the Sectors because the Sector IDs are -// uniquely determined by the MioctID. -// -// Author : $Author: krasznaa $ -// Date : $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ -// -// -// -//*********************************************************************** - -namespace LVL1MUCTPI { - - MioctID::MioctID( const unsigned int aNumber, const Hemisphere aHemisphere ) - : m_rapidityRegion( aHemisphere ), m_number( aNumber ) { - - } - - // first MIOCT receives data from sectors 30,31,0,1, second - // from 2,3,4,5, third from 6,7,8,9, ... and so on - unsigned int MioctID::getFirstBarrelID() const { - - unsigned int result; - if( m_number == 0 ) { - result = 30; - } else { - result = m_number*4 - 2; - } - return result; - } - - // First MIOCT receives data from sectors 47,0,1,2,3,4 second from - // 5,6,7,8,9,10, ... and so on - unsigned int MioctID::getFirstEndcapID() const { - - unsigned int result; - if( m_number == 0 ) { - result = 47; - } else { - result = m_number*6 - 1; - } - return result ; - } - - // First MIOCT receives data from Sectors 0,1,2, second - // from 3,4,5 ... and so on - unsigned int MioctID::getFirstForwardID() const { - - return m_number*3; - } - - unsigned int MioctID::getMirodSecAddress(unsigned int mioctSectorID) { - - unsigned int sectorAddress = 0; - unsigned int sectorID = 0; - - // Determine if this is BARREL, ENDCAP, or FORWARD, and - // translate the mioctSectorID into the subsystem sectorID - // -> finally set the address word according to the MIORD - // Eventreader standart - if (mioctSectorID <= 3) { // Barrel - sectorID = mioctSectorID + (this)->getFirstBarrelID(); - if( sectorID > MAX_BARREL_SECTOR ) - sectorID = ( sectorID % MAX_BARREL_SECTOR ) - 1; - if(m_rapidityRegion == POSITIVE) BitOp::setBit( §orAddress, 0 ); - BitOp::sImposeNBits( §orAddress, 1, sectorID ); - } - else if (mioctSectorID > 3 && mioctSectorID <= 9) { // Endcap - sectorID = (mioctSectorID - 4) + (this)->getFirstEndcapID(); - if( sectorID > MAX_ENDCAP_SECTOR ) - sectorID = ( sectorID % MAX_ENDCAP_SECTOR ) - 1; - BitOp::setBit( §orAddress, 7 ); - if( m_rapidityRegion == POSITIVE ) BitOp::setBit( §orAddress, 0 ); - BitOp::sImposeNBits( §orAddress, 1, sectorID ); - } - else if (mioctSectorID > 9) { // Forward - sectorID = ( mioctSectorID - 10 ) + (this)->getFirstForwardID(); - if( sectorID > MAX_FORWARD_SECTOR) - sectorID = ( sectorID % MAX_FORWARD_SECTOR ) - 1; - BitOp::setBit( §orAddress, 6 ); - if( m_rapidityRegion == POSITIVE ) BitOp::setBit( §orAddress, 0 ); - BitOp::sImposeNBits( §orAddress, 1, sectorID ); - } - - return sectorAddress; - } - - bool operator< ( const MioctID& id1, const MioctID& id2 ) { - - if( id1.m_number != id2.m_number ) return ( id1.m_number < id2.m_number ); - else { - if( id1.m_rapidityRegion != id2.m_rapidityRegion ) { - if( id1.m_rapidityRegion == POSITIVE ) return false; - else return true; - } else { - return false; - } - } - - return true; - } - - MsgLogger& operator<<( MsgLogger& out, const MioctID& id ) { - - out << "MIOCT " << id.getNumber() << ", " - << ( id.getRapidityRegion() == POSITIVE ? "POSITIVE" : "NEGATIVE" ) - << " Hemisphere"; - - return out; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.h deleted file mode 100644 index 59352fb23fcc31673dcc8417bf261db6e8241fe7..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.h +++ /dev/null @@ -1,108 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MioctID.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIOCTID_H -#define TRIGT1MUCTPI_MIOCTID_H - -// Local include(s): -#include "../Common/Detector.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // I forward declare the MioctID class to be able to declare the comparison - // operator already... - class MioctID; - - /// The ability to compare Mioct IDs comes in handy, when MioctID objects are - /// used in std::map-s - bool operator< ( const MioctID& id1, const MioctID& id2 ); - - /// Printer operator - MsgLogger& operator<<( MsgLogger& out, const MioctID& id ); - - /** - ************************************************************************ - * - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - * - * @short Contains all data to define a MioctModule - * - * This class contains the identification of an Octant board - * and serves to generate the right Sectors for this board - * by providing a set of functions which return the lowest - * sector number for the Barrel-, Endcap-, and Forward - * sectors of the module. - * - * @see MioctSectorSet - * @see Detector.h - * @author $Author: krasznaa $ - * @version $Revision: 364083 $ - * - * - ************************************************************************ - */ - class MioctID { - - public: - /** - * An ID is defined by two parameters. - * @param aNumber the number of the octant board (1..8). - * @param aHemisphere can be POSITIVE or NEGATIVE - * @see Detector.h - */ - MioctID( const unsigned int aNumber, const Hemisphere aHemisphere ); - /** - * Access function to the MioctNumber of the MioctID. - * @return The Number of the octant board. - */ - unsigned int getNumber() const { return m_number; } - /** - * Access function to the Rapidity Region of the MioctID. - * @return The Hemisphere of the octant board. (POSITIVE - * or NEGATIVE as defined in Detector.h) - * @see Detector.h - */ - Hemisphere getRapidityRegion() const { return m_rapidityRegion; } - /** - * This method returns the sector ID as build by the MIROD from - * the MioctModuleID, the Hemisphere, and the sector ID in the - * MIOCT - * @see MirodModule - * @see MirodEventReader - * @param sectorID The ID of the sector in the MIOCT - * @return sector Address in MIROD Eventreader format - */ - unsigned int getMirodSecAddress( unsigned int sectorID ); - /** - * Get the first (lowest) Barrel-Sector number for the octant board. - * @return The Sector ID number (0-31) - */ - unsigned int getFirstBarrelID() const; - /** - * Get the first (lowest) Endcap-Sector number for the octant board. - * @return The Sector ID number (0-47) - */ - unsigned int getFirstEndcapID() const; - /** - * Get the first (lowest) Forward-Sector number for the octant board. - * @return The Sector ID number (0-23) - */ - unsigned int getFirstForwardID() const; - - private: - - Hemisphere m_rapidityRegion; - unsigned int m_number; - - friend bool LVL1MUCTPI::operator< ( const MioctID& id1, const MioctID& id2 ); - - }; // class MioctID - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCTID_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx deleted file mode 100644 index 5d3590dd0dfe29811f22727b8ac597f7720942f1..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx +++ /dev/null @@ -1,245 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MioctModule.cxx 795106 2017-02-02 11:21:27Z wengler $ - -// STL include(s): -#include <sstream> -#include <iostream> -#include<string> - -// Local include(s): -#include "MioctModule.h" -#include "OverlapLogic.h" -#include "EventReader.h" - -//*********************************************************************** -// -// Version : $Revision: 795106 $ -// -// Description : -// -// Author : $Author: krasznaa $ -// Date : $Date: 2017-02-02 12:21:27 +0100 (Thu, 02 Feb 2017) $ -// -// -// -//*********************************************************************** - -namespace LVL1MUCTPI { - - MioctModule::MioctModule( const MioctID& theID, const OverlapLogic* theOverlapLogic, - EventReader* reader ) - : m_logger( "MioctModule" ), m_ID( theID ), - m_mioctSectors( theID, reader ), m_lvl1OverlapLogic( theOverlapLogic ) { - - if( theID.getRapidityRegion() == POSITIVE ) { - REPORT_VERBOSE_MSG( "Printing sector information for MIOCT with number " - << theID.getNumber() - << " in the POSITIVE rapidity region" ); - } else { - REPORT_VERBOSE_MSG( "Printing sector information for MIOCT with number " - << theID.getNumber() - << " in the NEGATIVE rapidity region" ); - } - - m_mioctSectors.report(); - } - - PtMultiplicitySet MioctModule::calculateMultiplicity() const { - - if( m_logger.msgLvl(LVL1MUCTPI::VERBOSE) ) { - m_mioctSectors.print(); - } - - return m_lvl1OverlapLogic->calculateMultiplicity( m_mioctSectors, m_ID ) ; - } - - LVL1::MuCTPIL1Topo MioctModule::getL1TopoCandidates(MioctL1TopoConverter & l1TopoConv) const{ - LVL1::MuCTPIL1Topo result; - std::vector<LVL1::MuCTPIL1TopoCandidate> candList; - - // Add the unsupressed barrel candidates in the same order as in the hardware - - // this is important as the last ones added are taken after sorting if - // there are more than two candidates per Mioct - // BA31, BA32, BA01, BA02, EC47, EC00, EC01, EC02, EC03, EC04, FW00, FW01, FW02 - // equivalent to Barrel1-4, Endcap1-6, Forward1-3 - - if( ! m_mioctSectors.Barrel1.getCand1Supressed() && m_mioctSectors.Barrel1.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel1, true )); - - if( ! m_mioctSectors.Barrel1.getCand2Supressed() && m_mioctSectors.Barrel1.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel1, false )); - - if( ! m_mioctSectors.Barrel2.getCand1Supressed() && m_mioctSectors.Barrel2.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel2, true )); - - if( ! m_mioctSectors.Barrel2.getCand2Supressed() && m_mioctSectors.Barrel2.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel2, false )); - - if( ! m_mioctSectors.Barrel3.getCand1Supressed() && m_mioctSectors.Barrel3.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel3, true )); - - if( ! m_mioctSectors.Barrel3.getCand2Supressed() && m_mioctSectors.Barrel3.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel3, false )); - - if( ! m_mioctSectors.Barrel4.getCand1Supressed() && m_mioctSectors.Barrel4.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel4, true )); - - if( ! m_mioctSectors.Barrel4.getCand2Supressed() && m_mioctSectors.Barrel4.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel4, false )); - - - if( ! m_mioctSectors.Endcap1.getCand1Supressed() && m_mioctSectors.Endcap1.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap1, true )); - - if( ! m_mioctSectors.Endcap1.getCand2Supressed() && m_mioctSectors.Endcap1.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap1, false )); - - if( ! m_mioctSectors.Endcap2.getCand1Supressed() && m_mioctSectors.Endcap2.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap2, true )); - - if( ! m_mioctSectors.Endcap2.getCand2Supressed() && m_mioctSectors.Endcap2.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap2, false )); - - if( ! m_mioctSectors.Endcap3.getCand1Supressed() && m_mioctSectors.Endcap3.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap3, true )); - - if( ! m_mioctSectors.Endcap3.getCand2Supressed() && m_mioctSectors.Endcap3.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap3, false )); - - if( ! m_mioctSectors.Endcap4.getCand1Supressed() && m_mioctSectors.Endcap4.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap4, true )); - - if( ! m_mioctSectors.Endcap4.getCand2Supressed() && m_mioctSectors.Endcap4.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap4, false )); - - if( ! m_mioctSectors.Endcap5.getCand1Supressed() && m_mioctSectors.Endcap5.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap5, true )); - - if( ! m_mioctSectors.Endcap5.getCand2Supressed() && m_mioctSectors.Endcap5.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap5, false )); - - if( ! m_mioctSectors.Endcap6.getCand1Supressed() && m_mioctSectors.Endcap6.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap6, true )); - - if( ! m_mioctSectors.Endcap6.getCand2Supressed() && m_mioctSectors.Endcap6.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap6, false )); - - if( ! m_mioctSectors.Forward1.getCand1Supressed() && m_mioctSectors.Forward1.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward1, true )); - - if( ! m_mioctSectors.Forward1.getCand2Supressed() && m_mioctSectors.Forward1.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward1, false )); - - if( ! m_mioctSectors.Forward2.getCand1Supressed() && m_mioctSectors.Forward2.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward2, true )); - - if( ! m_mioctSectors.Forward2.getCand2Supressed() && m_mioctSectors.Forward2.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward2, false )); - - if( ! m_mioctSectors.Forward3.getCand1Supressed() && m_mioctSectors.Forward3.getPtCand1() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward3, true )); - - if( ! m_mioctSectors.Forward3.getCand2Supressed() && m_mioctSectors.Forward3.getPtCand2() !=7 ) - candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward3, false )); - - - // stable_sort on pt threshold ID (1-6) keeping the input order - std::stable_sort(candList.begin(), candList.end(), - [](const LVL1::MuCTPIL1TopoCandidate & cand1, const LVL1::MuCTPIL1TopoCandidate & cand2) - { - return cand1.getptThresholdID() < cand2.getptThresholdID(); - }); - - - // limit to 2 candidates per MIOCT as in the hardware - if (candList.size() > 2) { - candList.erase(candList.begin(), candList.end()-2); - // set second candidate pt to 3 (i.e. 11) to indicate overflow - note sorting is in ascending order, - // so last element in vector is highest pt, i.e. first element in vector of two after cutoff is - // second candidate - candList.at(0).setptL1TopoCodeToOvFl(); - } - - - result.setCandidates(candList); - return result; - - } - - // implementation of method to get the data of this MIOCT as an - // object MioctData, which allows easy access to the data in - // MIBAK format - MioctData* MioctModule::getMioctOnMibak() { - - m_mioctData.assignData( m_ID, m_mioctSectors, m_lvl1OverlapLogic ); - return &m_mioctData; - } - - /** - * This function simulates the behavior of one of the NIM outputs on the front - * of the MIOCT module, which can be programmed to tell us whether a barrel - * candidate was seen in the octant. - * - * @returns <code>true</code> if there was a barrel candidate in the octant, - * <code>false</code> if there was none - */ - bool MioctModule::hasBarrelCandidate() const { - - if( ( m_mioctSectors.Barrel1.getPtCand1() != 7 ) || - ( m_mioctSectors.Barrel1.getPtCand2() != 7 ) || - ( m_mioctSectors.Barrel2.getPtCand1() != 7 ) || - ( m_mioctSectors.Barrel2.getPtCand2() != 7 ) || - ( m_mioctSectors.Barrel3.getPtCand1() != 7 ) || - ( m_mioctSectors.Barrel3.getPtCand2() != 7 ) || - ( m_mioctSectors.Barrel4.getPtCand1() != 7 ) || - ( m_mioctSectors.Barrel4.getPtCand2() != 7 ) ) { - - return true; - - } else { - - return false; - } - } - - /** - * This function simulates the behavior of one of the NIM outputs on the front - * of the MIOCT module, which can be programmed to tell us whether an endcap - * candidate was seen in the octant. - * - * @returns <code>true</code> if there was an endcap candidate in the octant, - * <code>false</code> if there was none - */ - bool MioctModule::hasEndcapCandidate() const { - - if( ( m_mioctSectors.Endcap1.getPtCand1() != 7 ) || - ( m_mioctSectors.Endcap1.getPtCand2() != 7 ) || - ( m_mioctSectors.Endcap2.getPtCand1() != 7 ) || - ( m_mioctSectors.Endcap2.getPtCand2() != 7 ) || - ( m_mioctSectors.Endcap3.getPtCand1() != 7 ) || - ( m_mioctSectors.Endcap3.getPtCand2() != 7 ) || - ( m_mioctSectors.Endcap4.getPtCand1() != 7 ) || - ( m_mioctSectors.Endcap4.getPtCand2() != 7 ) || - ( m_mioctSectors.Endcap5.getPtCand1() != 7 ) || - ( m_mioctSectors.Endcap5.getPtCand2() != 7 ) || - ( m_mioctSectors.Endcap6.getPtCand1() != 7 ) || - ( m_mioctSectors.Endcap6.getPtCand2() != 7 ) || - ( m_mioctSectors.Forward1.getPtCand1() != 7 ) || - ( m_mioctSectors.Forward1.getPtCand2() != 7 ) || - ( m_mioctSectors.Forward2.getPtCand1() != 7 ) || - ( m_mioctSectors.Forward2.getPtCand2() != 7 ) || - ( m_mioctSectors.Forward3.getPtCand1() != 7 ) || - ( m_mioctSectors.Forward3.getPtCand2() != 7 ) ) { - - return true; - - } else { - - return false; - } - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.h deleted file mode 100644 index ae5eb2f4de4a09365e64b284b814f12808ed60e1..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.h +++ /dev/null @@ -1,131 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MioctModule.h 678659 2015-06-26 14:54:31Z wengler $ -#ifndef TRIGT1MUCTPI_MIOCTMODULE_H -#define TRIGT1MUCTPI_MIOCTMODULE_H - -// Local include(s): -#include "../Common/PtMultiplicitySet.h" -#include "MioctID.h" -#include "MioctData.h" -#include "MioctSectorSet.h" -#include "../Logging/MsgLogger.h" -#include "../Common/MioctL1TopoConverter.h" - -// include interface class to L1Topo -#include "TrigT1Interfaces/MuCTPIL1Topo.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class OverlapLogic; - class EventReader; - - /** - * @short Contains all relevant entities of an octant board MIOCT. - * - * The MioctModule groups together all entities relevant for - * an onctant board MIOCT. It's only service is to calculate - * the Pt-Multiplicity for the data which is currently stored - * in the Sectors of the MioctModule. - * - * @see MiocID - * @see OverlapLogic - * @see OverlapStrategy - * @see PtMultiplicitySet - * @see Detector.h - * - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 678659 $ - * $Date: 2015-06-26 16:54:31 +0200 (Fri, 26 Jun 2015) $ - */ - class MioctModule { - - public: - /** - * The constructor instantiates all entities relevant for an - * octant board. There is one major difference to the real - * world: There is only one Instantiation of the OverlapLogic - * in the Lvl1Mibak class. The octant boards only contain a - * pointer to that logic. This has been chosen because it does - * not make sense to simulate the system with different overlap - * logics implemented in different octant boards at the same - * time. There is of course still the possibility to use different - * strategies to resolve the overlap in the OverlapLogic. - * @param theID Identfieer of the Mioctodule - * @param theOverlapLogic Pointer to the OverlapLogic which is used - * to resolve overlapping muon candidates during forming the - * Pt-multiplicity over the octant board. - * @param reader The event reader isntance for this simulation - * @see MioctID - * @see OverlapLogic - * @see OverlapStrategy - */ - MioctModule( const MioctID& theID, const OverlapLogic* theOverlapLogic, - EventReader* reader ); - /** - * Return the MioctSectorSet object of this MioctModule - * @return The MioctSectorSet object of this octant board. - * @see MioctSectorSet - */ - const MioctSectorSet* getMioctSectorSet() const { return &m_mioctSectors; } - /** - * Return the MioctID object of this MioctModule - * @return The MioctID object of this octant board. - * @see MioctID - */ - MioctID getMioctID() const { return m_ID; } - /** - * This service determines the actual pt-multiplicity of the - * data contained in the Sectors of the MioctModule. It uses the - * OverlapLogic given to the constructor to resolve the overlap - * between neighbouring sectors. - * @return For the six different Pt-thresholds - * the multiplicity of muon candidates is returned. - * @see PtMultiplicitySet - */ - PtMultiplicitySet calculateMultiplicity() const; - /** - * Return the L1Topo outputs for this MIOCT - * This must be called after calculateMultiplicity() to make sure the - * flags are properly set in sector data - */ - LVL1::MuCTPIL1Topo getL1TopoCandidates(MioctL1TopoConverter & l1TopoConv) const; - /** - * This method returns a pointer to the SectorSet conatained - * in this MIOCT - * @return Pointer to the set of Sectors belonging to this MIOCT - */ - const MioctSectorSet* getSectorSet() const { return &m_mioctSectors; } - /** - * This service groups the data stored in this MIOCT into an object - * which allows easy access to the data in the format found on the - * MIBAK backplane. - * @return data of this MIOCT module with access - * function to retrive the data in MIBAK format - */ - MioctData* getMioctOnMibak(); - - /// Is there at least one barrel candidate in the octant? - bool hasBarrelCandidate() const; - /// Is there at least one endcap candidate in the octant? - bool hasEndcapCandidate() const; - - private: - mutable MsgLogger m_logger; - MioctID m_ID; - MioctSectorSet m_mioctSectors; - const OverlapLogic* m_lvl1OverlapLogic; - MioctData m_mioctData; - - }; // class MioctModule - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCTMODULE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.cxx deleted file mode 100644 index cbb00ae5840cb4790074d46ea6b165b5a8d7d520..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.cxx +++ /dev/null @@ -1,165 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MioctSectorSet.cxx 472835 2011-12-06 21:05:16Z stelzer $ - -// STL include(s): -#include <string> - -// Local include(s): -#include "MioctSectorSet.h" -#include "EventReader.h" - -//****************************************************************** -// -// Version : $Revision: 472835 $ -// -// Description : This is a helper class which groups the different -// Sectors of one Mioct Module. It only serves to -// guarantee that the Sectors in the Set have the -// right IDs so that they overlap. The class has -// been formed in order to give the Sectors in a -// compact form to the various OverlapStrategies. -// -// Author : $Author: krasznaa $ -// Date : $Date: 2011-12-06 22:05:16 +0100 (Tue, 06 Dec 2011) $ -// -// -// -//****************************************************************** - -namespace LVL1MUCTPI { - - MioctSectorSet::MioctSectorSet( const MioctID& theID, EventReader* reader ) - : Barrel1( theID.getRapidityRegion(), theID.getFirstBarrelID() + 0, reader ), - Barrel2( theID.getRapidityRegion(), theID.getFirstBarrelID() + 1, reader ), - Barrel3( theID.getRapidityRegion(), theID.getFirstBarrelID() + 2, reader ), - Barrel4( theID.getRapidityRegion(), theID.getFirstBarrelID() + 3, reader ), - Endcap1( theID.getRapidityRegion(), theID.getFirstEndcapID() + 0, reader ), - Endcap2( theID.getRapidityRegion(), theID.getFirstEndcapID() + 1, reader ), - Endcap3( theID.getRapidityRegion(), theID.getFirstEndcapID() + 2, reader ), - Endcap4( theID.getRapidityRegion(), theID.getFirstEndcapID() + 3, reader ), - Endcap5( theID.getRapidityRegion(), theID.getFirstEndcapID() + 4, reader ), - Endcap6( theID.getRapidityRegion(), theID.getFirstEndcapID() + 5, reader ), - Forward1( theID.getRapidityRegion(), theID.getFirstForwardID() + 0, reader ), - Forward2( theID.getRapidityRegion(), theID.getFirstForwardID() + 1, reader ), - Forward3( theID.getRapidityRegion(), theID.getFirstForwardID() + 2, reader ), - m_logger( "MioctSectorSet" ), m_id( theID ) { - - m_bitFieldList.push_back( Forward1.getBitFieldPtr() ); - m_bitFieldList.push_back( Forward2.getBitFieldPtr() ); - m_bitFieldList.push_back( Forward3.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap4.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap5.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap6.getBitFieldPtr() ); - m_bitFieldList.push_back( Barrel1.getBitFieldPtr() ); - m_bitFieldList.push_back( Barrel2.getBitFieldPtr() ); - m_bitFieldList.push_back( Barrel3.getBitFieldPtr() ); - m_bitFieldList.push_back( Barrel4.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap1.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap2.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap3.getBitFieldPtr() ); - } - - MioctSectorSet::MioctSectorSet( const MioctSectorSet& set ) - : Barrel1( set.Barrel1 ), Barrel2( set.Barrel2 ), Barrel3( set.Barrel3 ), - Barrel4( set.Barrel4 ), - Endcap1( set.Endcap1 ), Endcap2( set.Endcap2 ), Endcap3( set.Endcap3 ), - Endcap4( set.Endcap4 ), - Endcap5( set.Endcap5 ), Endcap6( set.Endcap6 ), Forward1( set.Forward1 ), - Forward2( set.Forward2 ), Forward3( set.Forward3 ), - m_logger( "MioctSectorSet" ), m_id( set.m_id ) { - - m_bitFieldList.push_back( Forward1.getBitFieldPtr() ); - m_bitFieldList.push_back( Forward2.getBitFieldPtr() ); - m_bitFieldList.push_back( Forward3.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap4.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap5.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap6.getBitFieldPtr() ); - m_bitFieldList.push_back( Barrel1.getBitFieldPtr() ); - m_bitFieldList.push_back( Barrel2.getBitFieldPtr() ); - m_bitFieldList.push_back( Barrel3.getBitFieldPtr() ); - m_bitFieldList.push_back( Barrel4.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap1.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap2.getBitFieldPtr() ); - m_bitFieldList.push_back( Endcap3.getBitFieldPtr() ); - } - - void MioctSectorSet::report() const { - - std::string sector_desc; - - REPORT_VERBOSE_MSG( "Printing sectors in MioctSectorSet:" ); - - Barrel1.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Barrel1: " + sector_desc ); - Barrel2.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Barrel2: " + sector_desc ); - Barrel3.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Barrel3: " + sector_desc ); - Barrel4.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Barrel4: " + sector_desc ); - - Endcap1.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Endcap1: " + sector_desc ); - Endcap2.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Endcap2: " + sector_desc ); - Endcap3.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Endcap3: " + sector_desc ); - Endcap4.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Endcap4: " + sector_desc ); - Endcap5.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Endcap5: " + sector_desc ); - Endcap6.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Endcap6: " + sector_desc ); - - Forward1.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Forward1: " + sector_desc ); - Forward2.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Forward2: " + sector_desc ); - Forward3.printID( sector_desc ); - REPORT_VERBOSE_MSG( " Forward3: " + sector_desc ); - - return; - } - - void MioctSectorSet::print() const { - - std::string sector_data; - - REPORT_VERBOSE_MSG( "Sector contents for " << m_id ); - - Barrel1.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Barrel1 --" << sector_data ); - Barrel2.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Barrel2 --" << sector_data ); - Barrel3.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Barrel3 --" << sector_data ); - Barrel4.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Barrel4 --" << sector_data ); - - Endcap1.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Endcap1 --" << sector_data ); - Endcap2.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Endcap2 --" << sector_data ); - Endcap3.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Endcap3 --" << sector_data ); - Endcap4.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Endcap4 --" << sector_data ); - Endcap5.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Endcap5 --" << sector_data ); - Endcap6.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Endcap6 --" << sector_data ); - - Forward1.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Forward1 --" << sector_data ); - Forward2.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Forward2 --" << sector_data ); - Forward3.print( sector_data ); - REPORT_VERBOSE_MSG( " -- Forward3 --" << sector_data ); - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.h deleted file mode 100644 index 023b9863d7beea12483ad5031eaf2c4ee2ca6463..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.h +++ /dev/null @@ -1,108 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MioctSectorSet.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_MIOCTSECTORSET_H -#define TRIGT1MUCTPI_MIOCTSECTORSET_H - -// STL include(s): -#include <vector> - -// Local include(s): -#include "../Logging/MsgLogger.h" -#include "BarrelSector.h" -#include "EndcapSector.h" -#include "ForwardSector.h" -#include "MioctID.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class EventReader; - - /** - ************************************************************************ - * - * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $ - * - * @short Helper class creating and containing the Sectors of one MIOCT module. - * - * The only function of this class is to create and to group - * together the Sectors belonging to one MIOCT board. - * Exceptionally all data members of this class are public! - * - * @see MioctID - * @see Sector - * @see BarrelSector - * @see EndcapSector - * @see ForwardSector - * @author $Author: krasznaa $ - * @version $Revision: 701446 $ - * - * - ************************************************************************ - */ - class MioctSectorSet { - - public: - /** - * The Constructor creates a set of Sectors which belong to one - * octant board MIOCT. - * @param id describes the Octant board for which the Sectors - * have to be created. - */ - MioctSectorSet( const MioctID& id, EventReader* reader ); - MioctSectorSet( const MioctSectorSet& set ); - MioctSectorSet & operator = ( const MioctSectorSet & ) = delete; - /** - * The four Barrel Sectors of the MIOCT module. - */ - BarrelSector Barrel1, Barrel2, Barrel3, Barrel4; - /** - * The six Endcap Sectors of the MIOCT module. - */ - EndcapSector Endcap1, Endcap2, Endcap3, Endcap4, Endcap5, Endcap6; - /** - * The three Forward Sectors of the MIOCT module. - */ - ForwardSector Forward1, Forward2, Forward3; - - /** - * method to get the number of Barrel Sectors - */ - static unsigned int numberOfBarrelSectors() { return 4; } - /** - * method to get the number of Endcap Sectors - */ - static unsigned int numberOfEndcapSectors() { return 6; } - /** - * method to get the number of Forward Sectors - */ - static unsigned int numberOfForwardSectors() { return 3; } - /** - * This method returns a list of references to the bitfields - * of all the sectors belonging to this set - * @return List of references to the bitfields - * of all sector in this set - */ - const std::vector< unsigned int* >* getBitFieldSet() const { return &m_bitFieldList; } - - /// Print which sectors belong to this set - void report() const; - - /// Print the contents of the sectors - void print() const; - - private: - std::vector< unsigned int* > m_bitFieldList; - mutable MsgLogger m_logger; - const MioctID m_id; - - }; // class MioctSectorSet - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCTSECTORSET_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.cxx deleted file mode 100644 index a1a752f6a4455ee754ad17fe2111ec34c57bf093..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.cxx +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MultiplicityLogic.cxx 472835 2011-12-06 21:05:16Z stelzer $ - -// Local include(s): -#include "MultiplicityLogic.h" -#include "SectorID.h" -#include "MultiplicityStrategy.h" -#include "InclusiveMultStrategy.h" -#include "ExclusiveMultStrategy.h" -#include "XMLMultStrategy.h" - -namespace LVL1MUCTPI { - - /** - * The constructor creates all the possible multiplicity handling - * strategies, and puts them in its central "catalogue". By default - * it assigns the INCLUSIVE strategy as active. - */ - MultiplicityLogic::MultiplicityLogic() - : m_logger( "MultiplicityLogic" ), m_currentStrategy( 0 ), - m_strategyMap() { - - // Create the strategies: - m_strategyMap[ INCLUSIVE ] = new InclusiveMultStrategy(); - m_strategyMap[ EXCLUSIVE ] = new ExclusiveMultStrategy(); - m_strategyMap[ XML ] = new XMLMultStrategy(); - - // "Activate" the inclusive strategy: - m_currentStrategy = m_strategyMap[ INCLUSIVE ]; - std::string infoString ; - infoString = "Multiplicity Logic with default strategy " + - m_currentStrategy->getName() + " installed."; - REPORT_MSG(DEBUG, infoString); - } - - /** - * The destructor has to be careful to delete all the strategies that were - * created in the constructor. - */ - MultiplicityLogic::~MultiplicityLogic() { - - for( std::map< MultiplicityCalcType, MultiplicityStrategy* >::iterator it = - m_strategyMap.begin(); it != m_strategyMap.end(); ++it ) { - delete it->second; - } - m_strategyMap.clear(); - - } - - /** - * The strategy can be any one of the strategies defined in the - * MultiplicityCalcType enumerator. - * - * @param type Type of the strategy that should be used - */ - void MultiplicityLogic::changeStrategy( MultiplicityCalcType type ) { - - m_currentStrategy = m_strategyMap[ type ]; - std::string infoString = "Current Strategy changed to " + - m_currentStrategy->getName(); - m_logger.send( INFO, infoString ); - - return; - - } - - void MultiplicityLogic::initializeXML( const std::string& xmlFile ) { - - XMLMultStrategy* xmlstrat = - dynamic_cast< XMLMultStrategy* >( m_strategyMap[ XML ] ); - if( ! xmlstrat ) { - m_logger.send( FATAL, "Couldn't cast XMLMultStrategy in initializeXML()!" ); - return; - } - - xmlstrat->initialize( xmlFile ); - return; - - } - - /** - * This function should be called by all parts of the simulation when - * creating a PtMultiplicitySet object. - * - * @param pt The p<sub>T</sub> threshold of the candidate - * @param id The sector that produced the muon candidate - * @param firstCandidate <code>true</code> if the candidate is the first one in - * the sector, <code>false</code> otherwise - * @returns The multiplicity word from one muon candidate - */ - PtMultiplicitySet - MultiplicityLogic::calculateMultiplicity( unsigned int pt, - const SectorID& id, - bool firstCandidate ) const { - - // - // Use the active strategy to create the multiplicity object: - // - PtMultiplicitySet result; - if ( m_currentStrategy ){ - result = m_currentStrategy->calculateMultiplicity( pt, id, firstCandidate ); - } else { - m_logger.send( ERROR, - "No overlap strategy set, cannot calculate multiplicity!" ); - } - - return result; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.h deleted file mode 100644 index a24172b8ca78907b28736fd10a177c3137a29bea..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.h +++ /dev/null @@ -1,71 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MultiplicityLogic.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIOCT_MULTIPLICITYLOGIC_H -#define TRIGT1MUCTPI_MIOCT_MULTIPLICITYLOGIC_H - -// STL include(s): -#include <map> - -// Local include(s): -#include "../Common/MultiplicityCalcType.h" -#include "../Common/PtMultiplicitySet.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class SectorID; - class MultiplicityStrategy; - - /** - * @date $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Top level class handling the multiplicity summation - * - * All the parts of the simulation that need to create - * PtMultiplicitySet objects, should create them using a - * correctly configured instance of such an object. It can - * be configured to use a variety of multiplicity handling - * strategies, so all the other parts of the code don't need - * to know how the multiplicities are handled at any given - * time. - * - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - */ - class MultiplicityLogic { - - public: - /// Constructor - MultiplicityLogic(); - /// Destructor - ~MultiplicityLogic(); - - /// Change the multiplicity strategy - void changeStrategy( MultiplicityCalcType type ); - /// Initialise the XML multiplicity strategy - void initializeXML( const std::string& xmlFile ); - - /// Create the multiplicity with the active strategy - PtMultiplicitySet calculateMultiplicity( unsigned int pt, - const SectorID& id, - bool firstCandidate ) const; - - private: - /// Message logging object - MsgLogger m_logger; - /// Pointer to the currently active multiplicity strategy - MultiplicityStrategy* m_currentStrategy; - /// A map holding all the available multiplicity strategies - std::map< MultiplicityCalcType, MultiplicityStrategy* > m_strategyMap; - - }; // class MultiplicityLogic - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCT_MULTIPLICITYLOGIC_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityStrategy.h deleted file mode 100644 index 47156b1fff56979cb205dc0673e25ded63a3c548..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityStrategy.h +++ /dev/null @@ -1,87 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MultiplicityStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIOCT_MULTIPLICITYSTRATEGY_H -#define TRIGT1MUCTPI_MIOCT_MULTIPLICITYSTRATEGY_H - -// STL include(s): -#include <string> - -// Local include(s): -#include "../Common/PtMultiplicitySet.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class SectorID; - - /** - * @date $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Base class for handling different kinds of multiplicity treatments - * - * The MIOCT boards calculate the multiplicities of muons in an - * octant of the detector. The resulting multiplicities are represented - * by a 6x3 bit multiplicity word. This multiplicity word can be - * incremented in a number of ways. If the MIOCT sees a muon candidate - * passing threshold "3", it can either just increment the corresponding - * multiplicity in the multiplicity word, it can increment the - * multiplicities corresponding to threshold "1", "2" and "3", or it can - * basically increment any of the multiplicities. - * - * This interface is used in the simulation to determine how the - * multiplicity words should be created. - * - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - */ - class MultiplicityStrategy { - - public: - /// Constructor specifying a strategy name - /** - * @param name The name of the derived strategy. Printed by the simulation code. - */ - MultiplicityStrategy( const std::string& name ) : m_name( name ) {} - /// Destructor - virtual ~MultiplicityStrategy() {} - - /// Multiplicity handling function - /** - * This function creates a PtMultiplicitySet object from one muon candidate - * coming from the specified sector. The MIOCTs are able to calculate the - * multiplicities from each sector differently. (For instance they can mask - * noisy sectors.) - * - * @param pt The p<sub>T</sub> threshold of the candidate - * @param id The sector that produced the muon candidate - * @param firstCandidate <code>true</code> if the candidate is the first one in - * the sector, <code>false</code> otherwise - * @returns The multiplicity word from one muon candidate - */ - virtual PtMultiplicitySet calculateMultiplicity( unsigned int pt, - const SectorID& id, - bool firstCandidate ) const = 0; - - /// Get the name of the strategy - /** - * The simulation uses this function to print what kind of strategy - * is being used to treat the muon multiplicities. - * - * @returns The name of the multiplicity strategy - */ - const std::string& getName() const { return m_name; } - - private: - /// Name of the multiplicity strategy - std::string m_name; - - }; // class MultiplicityStrategy - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCT_MULTIPLICITYSTRATEGY_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.cxx deleted file mode 100644 index ada773cdcb3d95a47dc1dfa778b8031fd46d6d25..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.cxx +++ /dev/null @@ -1,130 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: NullStrategy.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// Local include(s): -#include "NullStrategy.h" -#include "MioctSectorSet.h" -#include "MultiplicityLogic.h" - -//*********************************************************************** -// -// Version : $Revision: 362102 $ -// -// Description : -// -// Author : $Author: krasznaa $ -// Date : $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ -// -// -// -//*********************************************************************** - -namespace LVL1MUCTPI { - - NullStrategy::NullStrategy( const MultiplicityLogic* logic ) - : OverlapStrategy( "No-Overlap-Consideration" ), - m_errorLogger("NullStrategy"), m_multiplicityLogic( logic ) { - - } - - NullStrategy::~NullStrategy() { - - } - - PtMultiplicitySet - NullStrategy::calculateMultiplicity( const MioctSectorSet& sectorData, - const MioctID& ) const { - - // - // Blindly add the multiplicity of each candidate to the total multiplicity - // of this octant: - // - PtMultiplicitySet result; - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel1.getPtCand1(), - sectorData.Barrel1.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel1.getPtCand2(), - sectorData.Barrel1.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel2.getPtCand1(), - sectorData.Barrel2.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel2.getPtCand2(), - sectorData.Barrel2.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel3.getPtCand1(), - sectorData.Barrel3.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel3.getPtCand2(), - sectorData.Barrel3.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel4.getPtCand1(), - sectorData.Barrel4.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel4.getPtCand2(), - sectorData.Barrel4.getSectorID(), - false ); - - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap1.getPtCand1(), - sectorData.Endcap1.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap1.getPtCand2(), - sectorData.Endcap1.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap2.getPtCand1(), - sectorData.Endcap2.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap2.getPtCand2(), - sectorData.Endcap2.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap3.getPtCand1(), - sectorData.Endcap3.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap3.getPtCand2(), - sectorData.Endcap3.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap4.getPtCand1(), - sectorData.Endcap4.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap4.getPtCand2(), - sectorData.Endcap4.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap5.getPtCand1(), - sectorData.Endcap5.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap5.getPtCand2(), - sectorData.Endcap5.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap6.getPtCand1(), - sectorData.Endcap6.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap6.getPtCand2(), - sectorData.Endcap6.getSectorID(), - false ); - - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward1.getPtCand1(), - sectorData.Forward1.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward1.getPtCand2(), - sectorData.Forward1.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward2.getPtCand1(), - sectorData.Forward2.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward2.getPtCand2(), - sectorData.Forward2.getSectorID(), - false ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward3.getPtCand1(), - sectorData.Forward3.getSectorID(), - true ); - result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward3.getPtCand2(), - sectorData.Forward3.getSectorID(), - false ); - - return result; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.h deleted file mode 100644 index d65dc42492dd80b8abfce2f335d8cdccac88e102..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.h +++ /dev/null @@ -1,65 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: NullStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_NULLSTRATEGY_H -#define TRIGT1MUCTPI_NULLSTRATEGY_H - -// Local include(s): -#include "../Logging/MsgLogger.h" -#include "../Common/PtMultiplicitySet.h" -#include "OverlapStrategy.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MultiplicityLogic; - - /************************************************************************** - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short No Overlap is considered while forming muon multiplicities for octanat boards. - * - * When forming pt-multiplicies for octant boards with this - * strategy active, all muon candidates of all sectors are - * considered irrespectively wether or not they are in - * overlapping regions. - * - * @see OverlapStrategy - * @see PtMultiplicitySet - * @see MioctSectorSet - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - * - * - ************************************************************************ - */ - class NullStrategy : public OverlapStrategy { - - public: - NullStrategy( const MultiplicityLogic* logic ); - ~NullStrategy(); - /** - * The implentation of the function to calculate the muon - * multiplicities without consideration of overlapping muon - * candidates. - * @return PtMultipliciySet is the result of the calculation. - * @param sectorData references to the Sectors of one MioctModule. - * @param id Not used in this implementation of OverlapStrategy - */ - virtual PtMultiplicitySet calculateMultiplicity ( const MioctSectorSet& sectorData, - const MioctID& id ) const; - - private: - MsgLogger m_errorLogger; - const MultiplicityLogic* m_multiplicityLogic; - - }; // class NullStrategy - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_NULLSTRATEGY_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.cxx deleted file mode 100644 index 883915efe79536fd3edc7859edec799bdf852825..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.cxx +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: OverlapLogic.cxx 650693 2015-03-01 16:53:48Z masato $ - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// Local include(s): -#include "OverlapLogic.h" -#include "NullStrategy.h" -#include "LUTStrategy.h" -#include "../Common/PtMultiplicitySet.h" -#include "MioctSectorSet.h" -#include "MultiplicityLogic.h" - -//*********************************************************************** -// -// Version : $Revision: 650693 $ -// -// Description : -// -// Author : $Author: krasznaa $ -// Date : $Date: 2015-03-01 17:53:48 +0100 (Sun, 01 Mar 2015) $ -// -// -// -//*********************************************************************** - -namespace LVL1MUCTPI { - - OverlapLogic::OverlapLogic( MultiplicityLogic* logic ) - : m_logger( "OverlapLogic" ), m_multiplicityLogic( logic ), - m_overlapStrategyMap() { - - m_overlapStrategyMap[ NO_OVERLAP ] = - new NullStrategy( m_multiplicityLogic ); - m_overlapStrategyMap[ LUT_OVERLAP ] = - new LUTStrategy( m_multiplicityLogic ); - - // set a default Strategy: no overlap consideration - m_currentStrategy = m_overlapStrategyMap[ NO_OVERLAP ]; - REPORT_MSG(DEBUG, "Overlap Logic with default strategy " << m_currentStrategy->getName() << " installed."); - } - - OverlapLogic::~OverlapLogic() { - - std::map< StrategyName, OverlapStrategy* >::iterator itr = - m_overlapStrategyMap.begin(); - std::map< StrategyName, OverlapStrategy* >::iterator end = - m_overlapStrategyMap.end(); - for( ; itr != end; ++itr ) { - delete itr->second; - } - m_overlapStrategyMap.clear(); - } - - PtMultiplicitySet OverlapLogic::calculateMultiplicity( const MioctSectorSet& mioctData, - const MioctID& mioct ) const { - - PtMultiplicitySet result; - if ( m_currentStrategy ){ - result = m_currentStrategy->calculateMultiplicity( mioctData, mioct ); - } else { - REPORT_ERROR_MSG( "No overlap strategy set, cannot calculate multiplicity!" ); - } - - return result; - } - - void OverlapLogic::changeStrategy( StrategyName newStrategy ) { - - m_currentStrategy = m_overlapStrategyMap[ newStrategy ]; - m_logger << INFO << "Current Strategy changed to " << m_currentStrategy->getName() - << MsgLogger::endmsg; - - return; - } - - StatusCode OverlapLogic::initializeLUT( const std::string& lutXMLFile, bool flagMode, - bool dumpLut,const std::string& runPeriod ) { - - LUTStrategy* strat = - dynamic_cast< LUTStrategy* >( m_overlapStrategyMap[ LUT_OVERLAP ] ); - if( ! strat ) { - REPORT_FATAL_MSG( "Couldn't cast strategy to LUTStrategy. Coding error!" ); - return StatusCode::FAILURE; - } - - CHECK( strat->initialize( lutXMLFile, flagMode, dumpLut, runPeriod ) ); - return StatusCode::SUCCESS; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.h deleted file mode 100644 index a3dbdb4649d6b188fa560e7c5ab24a8ed1a72a39..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.h +++ /dev/null @@ -1,110 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: OverlapLogic.h 650693 2015-03-01 16:53:48Z masato $ -#ifndef TRIGT1MUCTPI_OVERLAPLOGIC_H -#define TRIGT1MUCTPI_OVERLAPLOGIC_H - -// STL include(s): -#include <map> -#include <string> - -// Gaudi/Athena include(s): -#include "GaudiKernel/StatusCode.h" - -// Local include(s): -#include "../Logging/MsgLogger.h" -#include "StrategyName.h" -#include "OverlapStrategy.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MioctSectorSet; - class PtMultiplicitySet; - class MultiplicityLogic; - - /** - * @short Contains the logic to resolve overlapping muon candidates during multiplicity formation. - * - * The OverlapLogic is responsible for installing various - * strategies to resolve the overlap of different sectors. - * It contains a map which associates all possible strategies - * to a StrategyName like it is defined in StrategyName.h. - * - * @see OverlapStrategy - * @see NullStrategy - * @see MioctSectorSet - * @see PtMultiplicitySet - * - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 650693 $ - * $Date: 2015-03-01 17:53:48 +0100 (Sun, 01 Mar 2015) $ - */ - class OverlapLogic { - - public: - /** - * The construcor builds up a map containing an instance of all - * possible overlap strategies mapped to their corresponding names. - * The constructor by defaults sets the current strategy to the - * NullStrategy. - * @see OverlapStrategy - * @see NullStrategy - * @see StrategyName.h - */ - OverlapLogic( MultiplicityLogic* logic ); - /** - * Simple destructor. - */ - ~OverlapLogic(); - /** - * This function lets the user change the Overlap Strategy used to - * resolve overlapping muon candidates. - * @param newStrategy is a StrategyName as defined in StrategyName.h - * @see StrategyName.h - */ - void changeStrategy( StrategyName newStrategy ); - /** - * This functions returns the name of the currently selected - * strategy to resolve overlap. - */ - std::string getCurrentStrategyName() const { return m_currentStrategy->getName(); } - /** - * This member function calculates the pt multiplicity of an octant board - * under consideration of the current OverlapStrategy. - * @param mioctData is a reference to a set of Sectors belonging - * to one MIOCT board. - * @param mioct Defines which MIOCT the data is coming from - * @see MioctSectorSet - */ - PtMultiplicitySet calculateMultiplicity( const MioctSectorSet& mioctData, - const MioctID& mioct ) const; - /** - * This function breaks the model a bit in that it provides a direct connection - * between one of the OverlapStrategy implementations and the user. - * - * @param lutXMLFile Full path name to the XML file to load - * @param flagMode Controls the flagging mode of the LUT strategy - * @param dumpLut When set to true, detailed information is printed about the - * loaded LUT - */ - StatusCode initializeLUT( const std::string& lutXMLFile, bool flagMode, - bool dumpLut, const std::string& runPeriod ); - - private: - mutable MsgLogger m_logger; - MultiplicityLogic* m_multiplicityLogic; - OverlapStrategy* m_currentStrategy; - std::map< StrategyName, OverlapStrategy* > m_overlapStrategyMap; - - }; // class OverlapLogic - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_OVERLAPLOGIC_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.cxx deleted file mode 100644 index 8004f54e887bc12f15ef5a471c30d28c75751091..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: OverlapStrategy.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// Local include(s): -#include "OverlapStrategy.h" - -//*********************************************************************** -// -// Version : $Revision: 362102 $ -// -// Description : -// -// Author : $Author: krasznaa $ -// Date : $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ -// -//*********************************************************************** - -namespace LVL1MUCTPI { - - OverlapStrategy::OverlapStrategy( std::string theName ) - : m_name( theName ) { - - } - - OverlapStrategy::~OverlapStrategy() { - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.h deleted file mode 100644 index f446acce491f0ff17406ba74f0abd8dafa25cb9a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.h +++ /dev/null @@ -1,91 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: OverlapStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_OVERLAPSTRATEGY_H -#define TRIGT1MUCTPI_OVERLAPSTRATEGY_H - -// STL include(s): -#include <string> - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MioctSectorSet; - class PtMultiplicitySet; - class MioctID; - - /** - ************************************************************************ - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Interface for a strategy to resolve overlap between muon candidates. - * - * The interface to the various strategies to resolve - * overlapping muon candidates is very simple because the - * strategies just have to calculate the pt-multiplicities. - * Anyway the abstract class is usefull in order to support - * polymorphism for the strategies. - * - * The OverlapStrategy class follows the Strategy-Pattern in - * E.Gamma, R.Helm, R.Johnson, J.Vlissides "Design Patterns". - * (It is very simple though, I admit...) - * - * @see OverlapLogic - * @see MioctModule - * @see MioctSectorSet - * @see PtMultiplicitySet - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - * - * - ************************************************************************ - */ - class OverlapStrategy { - - public: - /** - * The constructor of a Strategy takes a string argument which is - * the name of the strategy. Since standard strings have a copy - * constructor and this name string is the only data member of a - * strategy, all strategies automatically have a copy constructor. - * (Of course, if in a derived class more data members are needed, - * for those also a copy constructor must exist, in order to have - * one for the whole strategy.) This fact is important because in - * the OverlapLogic the strategies are put into a STL map for which - * a copy constructor is needed. - * @see OverlapLogic - */ - OverlapStrategy( std::string theName ); - virtual ~OverlapStrategy(); - /** - * Here the calculcation of the multiplicity for the six different - * pt thresholds is performed. - * @see MioctSectorSet - * @see PtMultiplicitySet - * @see MioctModule - * @param data is the words corresponding to the sectors of a MioctModule. - * @param mioct defines which MIOCT the data is coming from - * @return PtMultiplicitySet is the result of the calculation. - */ - virtual PtMultiplicitySet calculateMultiplicity( const MioctSectorSet& data, const MioctID& mioct ) const = 0; - /** - * The OverlapLogic needs to acces the name of the strategy. - * @see OverlapLogic - * @return the name of the strategy. - */ - std::string getName() const { return m_name; } - - private: - - std::string m_name; - - }; // class OverlapStrategy - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_OVERLAPSTRATEGY_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.cxx deleted file mode 100644 index 83faf51fbf07be143931dfafbf098ce483d63216..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.cxx +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Sector.cxx 796872 2017-02-13 15:03:25Z fwinkl $ - -// STL include(s): -#include <sstream> - -// Local include(s): -#include "Sector.h" -#include "../Common/PtMultiplicitySet.h" -#include "../Common/SectorConstants.h" - -namespace LVL1MUCTPI { - - Sector::Sector( const Hemisphere theHemisphere, const unsigned int theSectorNumber, - EventReader* reader ) - : m_bitField(0), m_registered( false ), m_rapidityRegion( theHemisphere ), - m_sectorNumber( theSectorNumber ), m_reader( reader ), - m_cand1Supressed( false ), m_cand2Supressed( false ) { - - } - - Sector::~Sector() { - } - - std::string Sector::getRapidityString() const { - - std::string result; - if( m_rapidityRegion == POSITIVE ) result = "+"; - if( m_rapidityRegion == NEGATIVE ) result = "-"; - return result; - - } - std::string Sector::getIDString() const { - std::string result = ""; - //offset for differnt counting scheme in MuCTPI geometry file for L1Topo - unsigned int offset =0; - - if (this->getDetectorString() == "Barrel") { - result = "B"; - if (this->getRapidityString() == "+") { - offset = 32; - } - } else if (this->getDetectorString() == "Endcap") { - if (this->getRapidityString() == "+") { - result = "EA"; - }else if (this->getRapidityString() == "-") { - result = "EC"; - } - } else if (this->getDetectorString() == "Forward") { - if (this->getRapidityString() == "+") { - result = "FA"; - }else if (this->getRapidityString() == "-") { - result = "FC"; - } - } - std::string secNumString = ""; - if (m_sectorNumber+offset < 10) { - secNumString = "0" + std::to_string(m_sectorNumber + offset); - } else { - secNumString = std::to_string(m_sectorNumber + offset); - } - - result = result + secNumString ; - - return result; - } - - void Sector::printID( std::string& IDString ) const { - - std::ostringstream outStream ; - outStream << "Sector : " << m_sectorNumber - << " Detector : " << this->getDetectorString() - << " Rapidity region : " << this->getRapidityString(); - IDString = outStream.str(); - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.h deleted file mode 100644 index abd95b4c0abf58465d8cd0c5c00449b74e929cd7..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.h +++ /dev/null @@ -1,169 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: Sector.h 796872 2017-02-13 15:03:25Z fwinkl $ -#ifndef TRIGT1MUCTPI_SECTOR_H -#define TRIGT1MUCTPI_SECTOR_H - -#include <string> -#include "CxxUtils/bitscan.h" - -// Local include(s): -#include "../Common/Detector.h" -#include "../Common/MuctpiBitMasks.h" -#include "SectorID.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class PtMultiplicitySet; - class EventReader; - - /************************************************************************ - * - * $Date: 2017-02-13 16:03:25 +0100 (Mon, 13 Feb 2017) $ - * - * @short Base class for a Sector of the Muon Trigger chambers. - * - * This is the abstract base class for a sector in the - * MUCTPI system. It contains the acutal data of the sector - * and an identifier. For the information which can be - * retrieved equally for all kinds of Sectors, access - * functions are provided. - * - * @see SectorID - * @see PtMultiplicitySet - * @see BarrelSector - * @see EndcapSector - * @see ForwardSector - * @see MuctpiBitMasks.h - * @see SectorConstants.h - * @see Detector.h - * @author $Author: krasznaa $ - * @version $Revision: 796872 $ - * - **////////////////////////////////////////////////////////////////////// - class Sector { - - public: - /** - * The only constructor of a Sector, identified by its - * sector number and hemisphere - * @param theHemisphere The Hemisphere the sector is in - * @param theSectorNumber The sector number - * @param reader Helper class for reading the MuCTPI input - */ - Sector( const Hemisphere theHemisphere, - const unsigned int theSectorNumber, - EventReader* reader ); - virtual ~Sector(); - /** - * This function is abstract because when setting the bitfield - * a check is performed that none of the reserved bits is set. - * Since these bits are at different positions in the different - * sector species, the implementation of this function has to - * be done in the corresponding subclasses. - */ - virtual void set( const unsigned int bitfield ) = 0; - /** - * The get function returns a const reference to the bitfield - - * dont want to copy it for performance reasons - * @return Reference to the BitFIeld - */ - unsigned int* getBitFieldPtr() { return &m_bitField; } - /** - * Extract the threshold of Candidate 1. - */ - unsigned int getPtCand1() const { return getValue(Pt1Mask); } - /** - * Extract the threshold of Candidate 2. - */ - unsigned int getPtCand2() const { return getValue(Pt2Mask); } - virtual unsigned int getROI1() const = 0; - virtual unsigned int getROI2() const = 0; - /** - * Determined if candidate 1 of the Sector overlaps with a barrel - * sector. The default implementation returns false so that there - * is no implementation needed for the forward sector which is not - * overlapping. - * @return true if there is overlap. - */ - virtual bool isCand1BarrelOverlap() const { return false; } - /** - * Determined if candidate 2 of the Sector overlaps with a barrel - * sector. The default implementation returns false so that there - * is no implementation needed for the forward sector which is not - * overlapping. - * @return true if there is overlap. - */ - virtual bool isCand2BarrelOverlap() const { return false; } - /** - * Determined if candidate 1 of the Sector overlaps with an endcap - * sector. The default implementation returns false so that there - * is no implementation needed for the forward sector which is not - * overlapping. - * @return true if there is overlap. - */ - virtual bool isCand1EndcapOverlap() const { return false; } - /** - * Determined if candidate 2 of the Sector overlaps with an endcap - * sector. The default implementation returns false so that there - * is no implementation needed for the forward sector which is not - * overlapping. - * @return true if there is overlap. - */ - virtual bool isCand2EndcapOverlap() const { return false; } - /** - * This function prints the identification of the Sector into - * the string it returns. - * @return string which contains the identification of the Sector. - */ - void printID( std::string& IDString ) const; - /** - * get the ID of the sector as a string of type B30, FA12 ... - */ - std::string getIDString() const; - virtual void print( std::string& TextDescription ) const = 0; - virtual std::string getDetectorString() const = 0; - std::string getRapidityString() const; - unsigned int getSectorNumber() const { return m_sectorNumber; } - unsigned int getBCID() const { return getValue( BCIDMask ); } - virtual SectorID getSectorID() const = 0; - - void setCand1Supressed( bool flag ) const { m_cand1Supressed = flag; } - bool getCand1Supressed() const { return m_cand1Supressed; } - void setCand2Supressed( bool flag ) const { m_cand2Supressed = flag; } - bool getCand2Supressed() const { return m_cand2Supressed; } - - protected: - /** - * Contains the data of the current event. - */ - unsigned int m_bitField; - bool m_registered; - /** - * This function retrieves information from the bitfield of a sector. - * - * @param mask the bitmask as defined in MuctpiBitMasks.h. - * @return the value of the bitfield defined by the mask. - * @see MuctpiBitMasks.h - */ - unsigned int getValue( const BitMask mask ) const { - return (m_bitField & mask) >> CxxUtils::count_trailing_zeros(mask); - } - - Hemisphere m_rapidityRegion; - unsigned int m_sectorNumber; - EventReader* m_reader; - - mutable bool m_cand1Supressed; - mutable bool m_cand2Supressed; - - }; // class Sector - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_SECTOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.cxx deleted file mode 100644 index 1b6c4d5ac53886fbc4fee5eca02df9599e9bf038..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.cxx +++ /dev/null @@ -1,179 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: SectorID.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// STL include(s): -#include "SectorID.h" -#include "../Common/SectorConstants.h" - -/******************************************************************* - * $Date: 2015-10-13 16:13:15 +0200 (Tue, 13 Oct 2015) $ - * - * Implementation of class SectorID - * @author Author: Thorsten Wengler - * @version $Revision: 700318 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - /** - * This comparison operator should implement a monotone ordering - * between the SectorID objects. - * - * @param id1 First SectorID object - * @param id2 Second SectorID object - * @returns <code>true</code> if id1 is "smaller" than id2, - * <code>false</code> otherwise - */ - bool operator< ( const SectorID& id1, const SectorID& id2 ) { - - if( id1.m_detectorType != id2.m_detectorType ) { - return ( id1.m_detectorType < id2.m_detectorType ); - } else if( id1.m_rapidityRegion != id2.m_rapidityRegion ) { - return ( id1.m_rapidityRegion < id2.m_rapidityRegion ); - } else { - return ( id1.m_sectorNumber < id2.m_sectorNumber ); - } - - } - - // constructor of class SectorID with no initialisation - SectorID::SectorID() - : m_detectorType( BARREL ), m_rapidityRegion( NEGATIVE ), - m_sectorNumber( 0 ) { - - } - - SectorID::SectorID( int code ) { - - const int rapidity_border = ( MAX_BARREL_SECTOR + 1 ) + - ( MAX_ENDCAP_SECTOR + 1 ) + ( MAX_FORWARD_SECTOR + 1 ); - - if( code >= rapidity_border ) { - code -= rapidity_border; - m_rapidityRegion = POSITIVE; - } else { - m_rapidityRegion = NEGATIVE; - } - - const int forward_border = ( MAX_BARREL_SECTOR + 1 ) + - ( MAX_ENDCAP_SECTOR + 1 ); - const int endcap_border = MAX_BARREL_SECTOR + 1; - - if( code >= forward_border ) { - code -= forward_border; - m_detectorType = FORWARD; - } else if( code >= endcap_border ) { - code -= endcap_border; - m_detectorType = ENDCAP; - } else { - m_detectorType = BARREL; - } - - m_sectorNumber = code; - - } - - // constructor of class SectorID - SectorID::SectorID( Detector theDetector, Hemisphere theRegion, - unsigned int theNumber ) - : m_detectorType( theDetector ), m_rapidityRegion( theRegion ), - m_sectorNumber( theNumber ) { - - } - - // constructor of class SectorID taking numerical input values - // as used in Lvl1MuCTPIInput - SectorID::SectorID( unsigned int theDetector, unsigned int theRegion, - unsigned int theNumber ) { - - this->setVal( theDetector, theRegion, theNumber ); - } - - // set method taking numerical input values - // as used in Lvl1MuCTPIInput - void SectorID::setVal( unsigned int theDetector, unsigned int theRegion, - unsigned int theNumber ) { - - if( theDetector == 0 ) m_detectorType = BARREL; - if( theDetector == 1 ) m_detectorType = ENDCAP; - if( theDetector == 2 ) m_detectorType = FORWARD; - - if( theRegion == 0 ) m_rapidityRegion = NEGATIVE; - if( theRegion == 1 ) m_rapidityRegion = POSITIVE; - - m_sectorNumber = theNumber; - return; - - } - - // set method taking numerical input values - // as used in Lvl1MuCTPIInput - SectorID SectorID::ret( unsigned int theDetector, unsigned int theRegion, - unsigned int theNumber ){ - - this->setVal( theDetector, theRegion, theNumber ); - return *this; - - } - - // implementation of method getDetectorType - unsigned int SectorID::getDetectorType() const { - - if( m_detectorType == BARREL ) return 0; - if( m_detectorType == ENDCAP ) return 1; - if( m_detectorType == FORWARD ) return 2; - - return 0; - } - - // implementation of method getRapidityRegion - unsigned int SectorID::getRapidityRegion() const { - - if( m_rapidityRegion == NEGATIVE ) return 0; - if( m_rapidityRegion == POSITIVE ) return 1; - - return 0; - } - - // comparison operator - bool SectorID::operator==( const SectorID& original ) const { - - if ( ( this->m_detectorType == original.m_detectorType ) && - ( this->m_rapidityRegion == original.m_rapidityRegion ) && - ( this->m_sectorNumber == original.m_sectorNumber ) ) { - return true; - } - return false; - - } - - SectorID::operator int() const { - - int retval = 0; - - if( m_rapidityRegion == POSITIVE ) retval += ( MAX_BARREL_SECTOR + 1 ) + - ( MAX_ENDCAP_SECTOR + 1 ) + - ( MAX_FORWARD_SECTOR + 1 ); - - if( m_detectorType == ENDCAP ) retval += MAX_BARREL_SECTOR + 1; - else if( m_detectorType == FORWARD ) retval += ( MAX_BARREL_SECTOR + 1 ) + - ( MAX_ENDCAP_SECTOR + 1 ); - - retval += m_sectorNumber; - - return retval; - - } - - // overload for << - std::ostream & operator<<( std::ostream& out, const SectorID& right ) { - - return out << "System: " << right.m_detectorType << " Hemisphere: " - << right.m_rapidityRegion << " SectorNo: " << right.m_sectorNumber; - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.h deleted file mode 100644 index 0e7b1e3cd5f6e59de2d294ab6f05f8b9ccc02f1c..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.h +++ /dev/null @@ -1,168 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: SectorID.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_SECTORID_H -#define TRIGT1MUCTPI_SECTORID_H - -// STL include(s): -#include <iostream> - -// Local include(s): -#include "../Common/Detector.h" - -namespace LVL1MUCTPI { - - // - // Declare a comparison operator. This is needed to be able to index - // an std::map with SectorID objects... - // - class SectorID; - bool operator< ( const SectorID& id1, const SectorID& id2 ); - - /********************************************************************** - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short The Identifier of a Sector. - * - * The SectorID contains all data to unambigously identify - * a sector. This data contains the detector Type, the - * sector number, and the rapidity region. Several access - * functions allow to read back these data. SectorIDs can - * be set only in their constructor. Two constructors are - * available. The first takes values as defined in - * Detector.h, the secondtakes numerical values as used - * in the Lvl1MuCTPIInput class. It is not possible to - * change the values after construction. - * - * @see Detector.h - * @see SectorConstants.h - * @see Lvl1MuCTPIInput - * @author $Author: krasznaa $ - * @version $Revision: 362102 $ - * - ******************************************************************** - */ - class SectorID { - - // Declare the comparison operator as a friend of the class: - friend bool operator< ( const SectorID&, const SectorID& ); - - public: - /** - * The default constructor - no values are set - they are expected - * to be set by the set method instead - * @see SectorID::set() - */ - SectorID(); - /** - * This constructor should only be used by the XML multiplicity calculator. - * The sectors are identified by a single integer number in the XML files - * with the following encoding: - * - * 0 -- 31 : BARREL sectors, NEGATIVE side - * 32 -- 79 : ENDCAP sectors, NEGAVIVE side - * 80 -- 103 : FORWARD sectors, NEGATIVE side - * 104 -- 135 : BARREL sectors, POSITIVE side - * 136 -- 183 : ENDCAP sectors, POSITIVE side - * 184 -- 207 : FORWARD sectors, POSITIVE side - */ - SectorID( int code ); - /** - * This constructor takes the information to initialize the - * SectorID from three different arguments - * @param theDetector as defined in Detector.h - * @param theRegion as defined in Detector.h - * @param theNumber the sector number. Valid ranges depend - * on the Detector Type and are defined in SectorConstants.h - */ - SectorID( Detector theDetector, Hemisphere theRegion, unsigned int theNumber ); - /** - * This constructor takes the information to initialize the - * SectorID from three different numerical arguments - * @param theDetector system ID as used in Lvl1MuCTPIInput - * @param theRegion subsystem ID as used in Lvl1MuCTPIInput - * @param theNumber is the sector number. Valid ranges depend - * on the Detector Type and are defined in SectorConstants.h - * @see Lvl1MuCTPIInput - */ - SectorID( unsigned int theDetector, unsigned int theRegion, - unsigned int theNumber ); - /** - * This method takes the information to initialize the - * SectorID from three different numerical arguments - * and sets the data members - * @param theDetector system ID as used in Lvl1MuCTPIInput - * @param theRegion subsystem ID as used in Lvl1MuCTPIInput - * @param theNumber is the sector number. Valid ranges depend - * on the Detector Type and are defined in SectorConstants.h - * @see Lvl1MuCTPIInput - */ - void setVal( unsigned int theDetector, unsigned int theRegion, - unsigned int theNumber ); - /** - * This method takes the information to initialize the - * SectorID from three different numerical arguments - * and returns this object by value, e.g. for use as an - * argument in fuction calls - * @param theDetector system ID as used in Lvl1MuCTPIInput - * @param theRegion subsystem ID as used in Lvl1MuCTPIInput - * @param theNumber is the sector number. Valid ranges depend - * on the Detector Type and are defined in SectorConstants.h - * @return this SectorID object by value - * @see Lvl1MuCTPIInput - */ - SectorID ret( unsigned int theDetector, unsigned int theRegion, - unsigned int theNumber ); - /** - * This method returns the Detector type as a number, as used by - * the Lvl1MuCTPIInput class - * @return the detector type - * @see Lvl1MuCTPIInput - */ - unsigned int getDetectorType() const; - /** - * This method returns the Rapidity region as a number, as used by - * the Lvl1MuCTPIInput class - * @return the rapiduty region - * @see Lvl1MuCTPIInput - */ - unsigned int getRapidityRegion() const; - /** - * This method returns the Sector number - * @return the sector number - */ - unsigned int getSectorNumber() const { return m_sectorNumber; } - /** - * Provide a comparison operator - */ - bool operator== ( const SectorID& ) const; - /** - * This operator is used when the sector ID has to be stored as a single - * integer number. (When reading the multiplicity handling from an XML - * file.) Compare this with the constructor accepting a single integer. - */ - operator int() const; - /** - * overload the << operator to have easy printout - */ - friend std::ostream& operator<< ( std::ostream&, const SectorID& ); - /** - * The destructor of class SectorID - nothing to destruct - */ - ~SectorID() = default; - - private: - Detector m_detectorType; - Hemisphere m_rapidityRegion; - unsigned int m_sectorNumber; - - }; // class SectorID - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_SECTORID_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.cxx deleted file mode 100644 index 333d333786c579c27d9686406c7f85bf6bd4d373..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.cxx +++ /dev/null @@ -1,158 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: SectorLogicReader.cxx 364083 2011-05-06 09:09:55Z krasznaa $ - -// STL include(s): -#include <cassert> -#include <stdexcept> -#include <typeinfo> -#include <algorithm> - -// TrigT1 include(s): -#include "TrigT1Interfaces/Lvl1MuSectorLogicData.h" - -// Local include(s): -#include "SectorLogicReader.h" -#include "Sector.h" - -namespace LVL1MUCTPI { - - // constructor of the SectorLogicReader - SectorLogicReader::SectorLogicReader() : EventReader() { - - m_validReader = false; - m_eventSourceFlag = false; - m_registerFlag = false; - m_infoString = "No Source set yet; no Sectors registered yet." ; - m_logger.send( INFO, "SectorLogicReader installed as Event Reader" ); - } - - SectorLogicSource& SectorLogicReader::getSource() { - - return m_source; - } - - void SectorLogicReader::setEventSource( EventSource& source ) { - - try { - - SectorLogicSource& theSectorLogicSource = - dynamic_cast< SectorLogicSource& >( source ); - - if( ! m_eventSourceFlag ) { - - m_source = theSectorLogicSource; - m_eventSourceFlag = true; - - if( m_registerFlag ) { - m_infoString = "valid Sector Logic Reader installed"; - m_validReader = true; - } else { - m_infoString = "no Sectors registered yet"; - } - - } else { - REPORT_ERROR_MSG( "changing the EventSource of SectorLogicReader is " - "not supported" ); - m_logger << INFO << "continuing with previously installed " - << "EventSource" << MsgLogger::endmsg; - } - - } catch ( const std::bad_cast& ) { - REPORT_ERROR_MSG( "The SectorLogicReader needs a SectorLogicSource as " - "EventSource !" ); - return; - } - - return; - } - - void SectorLogicReader::registerSector( Sector* newSector ) { - - InputSector* newInputSector = new InputSector( newSector, m_source ); - m_inputSectorList.push_back( newInputSector ); - m_registerFlag = true; - if( m_eventSourceFlag ) { - m_infoString = "valid SectorLogicReader installed"; - m_validReader = true; - } else { - m_infoString = "No Source set yet"; - } - return; - } - - void SectorLogicReader::unregisterSector( Sector* obsoleteSector ) { - - std::list< SectorLogicReader::InputSector* >::iterator it; - it = std::find_if( m_inputSectorList.begin(), m_inputSectorList.end(), - SectorLogicReader::InputSector::Sector_eq( obsoleteSector ) ); - if( it != m_inputSectorList.end() ) { - delete *it; - m_inputSectorList.erase( it ); - } else { - m_logger.send( WARNING, - "Trying to unregister a non-existent Sector. \n" - "Continue without having done anything..."); - } - return; - } - - bool SectorLogicReader::putNextEvent() { - - std::list< SectorLogicReader::InputSector* >::iterator it; - for( it = m_inputSectorList.begin(); it != m_inputSectorList.end(); ++it ) { - - // I have to cope with getting a new object each event here from - // StoreGate - so need to re-get the address of the SectorLogicWord - ( *it )->getDataSource(); - - // put the event data - ( *it )->putEventData(); - } - - // increase the Event ID by one - m_eventID.incrementEvID(); - - // there is no reason why this could go wrong --> return always true - return true; - } - - SectorLogicReader::~SectorLogicReader() { - - std::list< SectorLogicReader::InputSector* >::iterator it; - for( it = m_inputSectorList.begin(); it != m_inputSectorList.end(); ++it ) { - delete ( *it ); - } - } - - // contructor of the input sector helper class - SectorLogicReader::InputSector::InputSector( Sector* theSector, - SectorLogicSource& theSource ) { - - m_sectorPointer = theSector; - m_rememberTheSource = &theSource; - m_sectorLogicPointer = &theSource.getSectorLogicAddress(theSector); - } - - // re-get data source since there might be a new object each event - void SectorLogicReader::InputSector::getDataSource() { - - m_sectorLogicPointer = &m_rememberTheSource->getSectorLogicAddress( m_sectorPointer ); - return; - } - - // get new data word for this sector from the input - void SectorLogicReader::InputSector::putEventData() { - - m_sectorPointer->set( m_sectorLogicPointer->getWordFormat() ); - return; - } - - // destructor of the input sector helper class - SectorLogicReader::InputSector::~InputSector() { - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.h deleted file mode 100644 index 99bc5f3d8bd83fc86331e4f8a00c3c0c1b190017..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.h +++ /dev/null @@ -1,153 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: SectorLogicReader.h 364083 2011-05-06 09:09:55Z krasznaa $ -#ifndef TRIGT1MUCTPI_SECTORLOGICREADER_H -#define TRIGT1MUCTPI_SECTORLOGICREADER_H - -// STL include(s): -#include <list> -#include <string> - -// Local include(s): -#include "EventReader.h" -#include "../Common/EventID.h" -#include "SectorLogicSource.h" - -namespace LVL1MUCTPI { - - /** - * @short EventReader to read from the Sector Logic interface. - * - * The SectorLogicReader Singleton tries to read an input - * word for each registered sector from the interface class - * of the Muon Sector Logic simulation. If no input word is - * found for a sector, the program terminates with a fatal - * error, as all inputs should always be present. - * - * @see EventReaderFactory - * @see EventReader - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 364083 $ - * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ - */ - class SectorLogicReader : public EventReader { - - public: - SectorLogicReader(); - virtual ~SectorLogicReader(); - /** - * This routine returns true if all registered sectors are available - * as input from the SectorLogic interface - * @return true if the SectorLogicReader has been correctly installed - * and can be used. - */ - virtual bool isValid() const { return m_validReader; } - /** - * After a call to isValid() this routine gives back a string which - * contains the reason why the MifFileReader is not valid. - * This can be for example the case if a sector has been registered - * for which no corresponding input could be found. - * @return string contains some text indicating the reason why - * the EventReader is not vaild. - * @see EventReader::isValid() - */ - virtual std::string getInfoString() const { return m_infoString; } - void setEventSource ( EventSource & source ); - SectorLogicSource& getSource(); - /** - * This functions stores the pointer to the sector which it needs to - * update the sectors data field after an event-read. - * @param newSector Pointer to a Sector which wants to be updated after - * a new event has been read in. - */ - virtual void registerSector( Sector* newSector ); - /** - * This function is called in order to erase the pointer to a Sector - * which is hold in the list of currently available sectors. - * @param obsoleteSector is the pointer to the Sector to be erased from the - * sector-list - */ - virtual void unregisterSector( Sector* obsoleteSector ); - /** - * The next event is read in for all Sectors. - * @return If the read process fails to read data for a sector which - * is registered, false is returned. - */ - virtual bool putNextEvent(); - - private: - /// a helper class for internal Sector administration - class InputSector { - - public: - /** - * This functon is used by the unregister method of the sectors. - * It is the predicate used to find an InputSector if the corresponding - * pointer to the Sector is given. - */ - class Sector_eq { - - public: - Sector_eq( Sector* sectorToSearch) : - m_searchSector( sectorToSearch ) {} - bool operator () ( const SectorLogicReader::InputSector* argumentSector ) { - return ( argumentSector->getSectorPointer() == m_searchSector ); - } - - private: - Sector* m_searchSector; - }; // class Sector_eq - - /** - * This inline function returns the Sector* pointer of this - * InputSector - */ - inline Sector* getSectorPointer() const { return m_sectorPointer; } - /** - * The constructor of the InputSector helper class gets the - * Sector pointer of the Sector in question and a pointer - * to the event source. This information is used to resolve - * where in the EventSource data for this Sector should be read - */ - InputSector( Sector* theSector, SectorLogicSource & theSource ); - /** - * method to refresh the data source for this sector in case - * there is a new input object in each event - */ - void getDataSource(); - /** - * method to get the data for this sector from the event source - */ - void putEventData(); - /** - * destructor of the InputSector Helper class - */ - ~InputSector(); - - private: - // private data members of the InputSector helper class - Sector* m_sectorPointer; - const LVL1MUONIF::Lvl1MuSectorLogicData* m_sectorLogicPointer; - SectorLogicSource * m_rememberTheSource; - - }; // class InputSector - - // private data members of the SectorLogicReader - EventID m_eventID; - bool m_validReader; - bool m_registerFlag; - bool m_eventSourceFlag; - std::list< InputSector* > m_inputSectorList; - SectorLogicSource m_source; - - }; // class SectorLogicReader - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_SECTORLOGICREADER_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.cxx deleted file mode 100644 index 239159444577101c348c62c2927b49739e6c8ad0..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.cxx +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: SectorLogicSource.cxx 700318 2015-10-13 14:13:15Z wengler $ - -// TrigT1 include(s): -#include "TrigT1Interfaces/Lvl1MuCTPIInput.h" - -// Local include(s): -#include "SectorLogicSource.h" -#include "Sector.h" - -namespace LVL1MUCTPI { - - // constructor of SectorLogicSource - SectorLogicSource::SectorLogicSource(): m_lvl1MuCTPIInput(nullptr),m_bcidOffset(0) { - - } - - // implementation of method to set the pointer to the Lvl1MuCTPIInput - // object holding the input data - void SectorLogicSource:: - setSectorLogicSource( const LVL1MUONIF::Lvl1MuCTPIInput* theInput ) { - - m_lvl1MuCTPIInput = theInput; - return; - } - - // implementation of method to get the pointer to the Lvl1MuCTPIInput - // object holding the input data - const LVL1MUONIF::Lvl1MuCTPIInput* - SectorLogicSource::getSectorLogicSource() const { - - return m_lvl1MuCTPIInput; - } - - const LVL1MUONIF::Lvl1MuSectorLogicData& - SectorLogicSource::getSectorLogicAddress( const Sector* theSector ) { - - unsigned int systemAddress = 0; - unsigned int subSystemAddress = 0; - unsigned int sectorAddress = 0; - - if( theSector->getDetectorString() == "Barrel" ) { - systemAddress = m_lvl1MuCTPIInput->idBarrelSystem(); - sectorAddress = (theSector->getSectorNumber()); - } - if( theSector->getDetectorString() == "Endcap" ) { - systemAddress = m_lvl1MuCTPIInput->idEndcapSystem(); - sectorAddress = theSector->getSectorNumber(); - } - if( theSector->getDetectorString() == "Forward" ) { - systemAddress = m_lvl1MuCTPIInput->idForwardSystem(); - sectorAddress = theSector->getSectorNumber(); - } - if( theSector->getRapidityString() == "+" ) - subSystemAddress = m_lvl1MuCTPIInput->idSideA(); - if( theSector->getRapidityString() == "-" ) - subSystemAddress = m_lvl1MuCTPIInput->idSideC(); - - const LVL1MUONIF::Lvl1MuSectorLogicData& dataOut = - m_lvl1MuCTPIInput->getSectorLogicData( systemAddress, subSystemAddress, - sectorAddress, m_bcidOffset ); - - return dataOut; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.h deleted file mode 100644 index dc471a399a05722a780b210aa88ef045a3ba1e3e..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.h +++ /dev/null @@ -1,84 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: SectorLogicSource.h 681356 2015-07-08 12:17:52Z wengler $ -#ifndef TRIGT1MUCTPI_SECTORLOGICSOURCE_H -#define TRIGT1MUCTPI_SECTORLOGICSOURCE_H - -// STL include(s): -#include <string> - -// Local include(s): -#include "EventSource.h" - -// Forward declaration(s): -namespace LVL1MUONIF { - class Lvl1MuCTPIInput; - class Lvl1MuSectorLogicData; -} - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class Sector; - - /** - * @short The EventSource for the SectorLogicReader - * - * This EventSource consists of an Lvl1MuCTPIInput object - * as provided by the simulation of the Muon Trigger - * system simulation. The pointer to the input object is - * set with the setSectorLogicSource method. A pointer - * to the sector in the input object which hold the data - * word for the sector to be filled is retrieved using the - * getSectorLogicPointer method. - * - * @see SectorLogicReader - * @see Lvl1MuCTPIInput - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 681356 $ - * $Date: 2015-07-08 14:17:52 +0200 (Wed, 08 Jul 2015) $ - */ - class SectorLogicSource : public EventSource { - - public: - SectorLogicSource(); - /** - * Sets the pointers to the Lvl1MuCTPIInput which holds the input - * data from the Sector Logic - */ - void setBcidOffset( int bcidOffset) { m_bcidOffset= bcidOffset; } - int getBcidOffset() { return m_bcidOffset; } - void setSectorLogicSource( const LVL1MUONIF::Lvl1MuCTPIInput* ); - /** - * Gets the pointer to the Lvl1MuCTPIInput which holds the input - * data from the - */ - const LVL1MUONIF::Lvl1MuCTPIInput* getSectorLogicSource() const; - /** - * Retrieves the pointer of the Lvl1MuSectorLogicData object in - * which the dataword of the argument Sector can be found. - */ - const LVL1MUONIF::Lvl1MuSectorLogicData& getSectorLogicAddress( const Sector* Sector ); - /** - * This function is dummy. It only exists in order to be able - * to use the dynamic_cast for the EventSource objects. (At least - * one abstract method needs to be defined in the base class in - * order to be able to use the dynamic_cast). - */ - virtual const char* printSource() const { return "printSource is a dummy"; } - - private: - const LVL1MUONIF::Lvl1MuCTPIInput* m_lvl1MuCTPIInput; - int m_bcidOffset; - - }; // class SectorLogicSource - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_SECTORLOGICSOURCE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/StrategyName.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/StrategyName.h deleted file mode 100644 index 1ed3d56804a9680daec33500e9a3a7329ea44423..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/StrategyName.h +++ /dev/null @@ -1,17 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: StrategyName.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_STRATEGYNAME_H -#define TRIGT1MUCTPI_STRATEGYNAME_H - -namespace LVL1MUCTPI { - - enum StrategyName { NO_OVERLAP, DEMONSTRATOR_OVERLAP, LEGACY_LUT_OVERLAP, LUT_OVERLAP }; - -} - -#endif // TRIGT1MUCTPI_STRATEGYNAME_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.cxx deleted file mode 100644 index d44416c6952753d64678ec8f892397a09006772f..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.cxx +++ /dev/null @@ -1,156 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: XMLMultCalculator.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// STL include(s): -#include <string> -#include <sstream> - -// XercesC include(s): -#include <xercesc/dom/DOMElement.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/util/XMLString.hpp> - -// Local include(s): -#include "XMLMultCalculator.h" -#include "../Common/SectorConstants.h" - -using namespace std; -using namespace xercesc; - -namespace LVL1MUCTPI { - - bool operator== ( const XMLMultCalculator& calc1, - const XMLMultCalculator& calc2 ) { - - return ( calc1.m_lut == calc2.m_lut ); - - } - - XMLMultCalculator::XMLMultCalculator( const xercesc::DOMNode* node ) - : m_lut( MAX_NUMBER_OF_THRESHOLDS, - vector< bool >( MAX_NUMBER_OF_THRESHOLDS, false ) ), - m_logger( "XMLMultCalculator" ) { - - if( node ) initialize( node ); - - } - - XMLMultCalculator::XMLMultCalculator( const XMLMultCalculator& parent ) - : m_lut( parent.m_lut ), m_logger( "XMLMultCalculator" ) { - - } - - XMLMultCalculator::~XMLMultCalculator() { - - } - - void XMLMultCalculator::initialize( const xercesc::DOMNode* node ) { - - // - // Re-initialise the LUT: - // - m_lut.clear(); - m_lut.insert( m_lut.begin(), MAX_NUMBER_OF_THRESHOLDS, - vector< bool >( MAX_NUMBER_OF_THRESHOLDS, false ) ); - - if( node->getNodeType() != DOMNode::ELEMENT_NODE ) { - m_logger.send( ERROR, "initialize() : Received node is not a DOMElement" ); - return; - } - - const DOMElement* top_element = dynamic_cast< const DOMElement* >( node ); - if( ! top_element ) { - m_logger.send( ERROR, "initialize() : dynamic cast to DOMElement failed" ); - return; - } - - const DOMNodeList* lut_list = top_element->getChildNodes(); - - m_logger.send( VERBOSE, "initialize() : Looping over thresholds" ); - - for( XMLSize_t i = 0; i < lut_list->getLength(); ++i ) { - - const DOMNode* lut_node = lut_list->item( i ); - char* cname = XMLString::transcode( lut_node->getNodeName() ); - string sname( cname ); - XMLString::release( &cname ); - - if( sname != "Threshold" ) continue; - - const DOMElement* lut_element = dynamic_cast< const DOMElement* >( lut_node ); - if( ! lut_element ) { - m_logger.send( ERROR, "initialize() : Unable to cast LUT node into DOMElement" ); - return; - } - - XMLCh* id_name = XMLString::transcode( "ID" ); - XMLCh* thr1_name = XMLString::transcode( "thr1" ); - XMLCh* thr2_name = XMLString::transcode( "thr2" ); - XMLCh* thr3_name = XMLString::transcode( "thr3" ); - XMLCh* thr4_name = XMLString::transcode( "thr4" ); - XMLCh* thr5_name = XMLString::transcode( "thr5" ); - XMLCh* thr6_name = XMLString::transcode( "thr6" ); - - const XMLCh* id = lut_element->getAttribute( id_name ); - const XMLCh* thr1 = lut_element->getAttribute( thr1_name ); - const XMLCh* thr2 = lut_element->getAttribute( thr2_name ); - const XMLCh* thr3 = lut_element->getAttribute( thr3_name ); - const XMLCh* thr4 = lut_element->getAttribute( thr4_name ); - const XMLCh* thr5 = lut_element->getAttribute( thr5_name ); - const XMLCh* thr6 = lut_element->getAttribute( thr6_name ); - - XMLString::release( &id_name ); - XMLString::release( &thr1_name ); - XMLString::release( &thr2_name ); - XMLString::release( &thr3_name ); - XMLString::release( &thr4_name ); - XMLString::release( &thr5_name ); - XMLString::release( &thr6_name ); - - const int id_n = XMLString::parseInt( id ); - const int thr1_n = XMLString::parseInt( thr1 ); - const int thr2_n = XMLString::parseInt( thr2 ); - const int thr3_n = XMLString::parseInt( thr3 ); - const int thr4_n = XMLString::parseInt( thr4 ); - const int thr5_n = XMLString::parseInt( thr5 ); - const int thr6_n = XMLString::parseInt( thr6 ); - - m_lut[ id_n - 1 ][ 0 ] = ( thr1_n != 0 ) ? true : false; - m_lut[ id_n - 1 ][ 1 ] = ( thr2_n != 0 ) ? true : false; - m_lut[ id_n - 1 ][ 2 ] = ( thr3_n != 0 ) ? true : false; - m_lut[ id_n - 1 ][ 3 ] = ( thr4_n != 0 ) ? true : false; - m_lut[ id_n - 1 ][ 4 ] = ( thr5_n != 0 ) ? true : false; - m_lut[ id_n - 1 ][ 5 ] = ( thr6_n != 0 ) ? true : false; - - ostringstream message; - message << " threshold " << id_n << ": th1=" << m_lut[ id_n - 1 ][ 0 ] - << "; th2=" << m_lut[ id_n - 1 ][ 1 ] << "; th3=" << m_lut[ id_n - 1 ][ 2 ] - << "; th4=" << m_lut[ id_n - 1 ][ 3 ] << "; th5=" << m_lut[ id_n - 1 ][ 4 ] - << "; th6=" << m_lut[ id_n - 1 ][ 5 ]; - m_logger.send( VERBOSE, message.str() ); - - } - - return; - - } - - PtMultiplicitySet - XMLMultCalculator::calculateMultiplicity( unsigned int pt ) const { - - PtMultiplicitySet result; - - if( ( pt >= 1 ) && ( pt <= MAX_NUMBER_OF_THRESHOLDS ) ) { - for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) { - if( m_lut[ pt - 1 ][ i ] ) result.addMuon( i + 1 ); - } - } - - return result; - - } - -} // LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.h deleted file mode 100644 index 4ee974ae1430427071779131188763f81a7787c7..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.h +++ /dev/null @@ -1,51 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: XMLMultCalculator.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_MIOCT_XMLMULTCALCULATOR_H -#define TRIGT1MUCTPI_MIOCT_XMLMULTCALCULATOR_H - -// STL include(s): -#include <vector> - -// XercesC include(s): -#include <xercesc/dom/DOMNode.hpp> - -// Local include(s): -#include "../Common/PtMultiplicitySet.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - class XMLMultCalculator; - bool operator== ( const XMLMultCalculator& calc1, - const XMLMultCalculator& calc2 ); - - class XMLMultCalculator { - - friend bool operator== ( const XMLMultCalculator& calc1, - const XMLMultCalculator& calc2 ); - - public: - XMLMultCalculator( const xercesc::DOMNode* node = 0 ); - XMLMultCalculator( const XMLMultCalculator& parent ); - XMLMultCalculator & operator = ( const XMLMultCalculator & ) = delete; - ~XMLMultCalculator(); - - void initialize( const xercesc::DOMNode* node ); - - PtMultiplicitySet calculateMultiplicity( unsigned int pt ) const; - - private: - std::vector< std::vector< bool > > m_lut; - - MsgLogger m_logger; - - }; // class XMLMultCalculator - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCT_XMLMULTCALCULATOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.cxx deleted file mode 100644 index c2f614c3f33826fdfe11f6653db6a7ecf08df9fa..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.cxx +++ /dev/null @@ -1,276 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: XMLMultStrategy.cxx 472835 2011-12-06 21:05:16Z stelzer $ - -// STL include(s): -#include <sstream> -#include <algorithm> -#include <vector> - -// XercesC include(s): -#include <xercesc/util/PlatformUtils.hpp> -#include <xercesc/util/XMLString.hpp> -#include <xercesc/parsers/XercesDOMParser.hpp> -#include <xercesc/dom/DOMException.hpp> -#include <xercesc/dom/DOMDocument.hpp> -#include <xercesc/dom/DOMNodeList.hpp> -#include <xercesc/dom/DOMElement.hpp> - -// Local include(s): -#include "XMLMultStrategy.h" - -using namespace std; -using namespace xercesc; - -namespace LVL1MUCTPI { - - bool operator< ( const std::pair< SectorID, bool >& id1, - const std::pair< SectorID, bool >& id2 ) { - - if( id1.second != id2.second ) { - return ( id1.second < id2.second ); - } else { - return ( id1.first < id2.first ); - } - - } - - XMLMultStrategy::XMLMultStrategy() - : MultiplicityStrategy( "XML-Based-Multiplicity-Strategy" ), - m_exStrategy(), m_calculatorMap(), m_calculatorList(), - m_logger( "XMLMultStrategy" ) { - - } - - XMLMultStrategy::XMLMultStrategy( const std::string& xmlMultFile ) - : MultiplicityStrategy( "XML-Based-Multiplicity-Strategy" ), - m_exStrategy(), m_calculatorMap(), m_calculatorList(), - m_logger( "XMLMultStrategy" ) { - - initialize( xmlMultFile ); - - } - - XMLMultStrategy::XMLMultStrategy( const XMLMultStrategy& strategy ) - : MultiplicityStrategy( "XML-Based-Multiplicity-Strategy" ), - m_logger( "XMLMultStrategy" ) { - - // Replicate the list: - for( std::list< XMLMultCalculator >::const_iterator it = - strategy.m_calculatorList.begin(); - it != strategy.m_calculatorList.end(); ++it ) { - m_calculatorList.push_back( *it ); - } - - // Replicate the map: - for( std::map< std::pair< SectorID, bool >, - const XMLMultCalculator* >::const_iterator it = - strategy.m_calculatorMap.begin(); - it != strategy.m_calculatorMap.end(); ++it ) { - - for( std::list< XMLMultCalculator >::const_iterator calc = - m_calculatorList.begin(); - calc != m_calculatorList.end(); ++calc ) { - if( ( *it->second ) == ( *calc ) ) { - m_calculatorMap[ it->first ] = &( *calc ); - break; - } - } - - } - - } - - XMLMultStrategy::~XMLMultStrategy() { - - } - - void XMLMultStrategy::initialize( const std::string& xmlMultFile ) { - - // - // Reset the object: - // - m_calculatorList.clear(); - m_calculatorMap.clear(); - - REPORT_MSG(DEBUG, "initialize() : Reading configuration from file: " << xmlMultFile ); - // - // Initialize XercesC: - // - try { - - XMLPlatformUtils::Initialize(); - - } catch( const XMLException& ex ) { - - ostringstream message; - char* error_message = XMLString::transcode( ex.getMessage() ); - message << "initialize() : Failed to initialize XercesC because: " - << error_message; - XMLString::release( &error_message ); - m_logger.send( ERROR, message.str() ); - return; - - } - - // - // Parse the LUT XML file: - // - XercesDOMParser* xmlParser = new XercesDOMParser(); - - try { - - xmlParser->parse( xmlMultFile.c_str() ); - - } catch( const XMLException& ex ) { - - ostringstream message; - message << "initialize() : XMLException received while parsing the XML file." - << endl; - message << "initialize() : Message: " << XMLString::transcode( ex.getMessage() ); - m_logger.send( ERROR, message.str() ); - return; - - } catch( const DOMException& ex ) { - - ostringstream message; - message << "initialize() : DOMException received while parsing the XML file." - << endl; - message << "initialize() : Message: " << XMLString::transcode( ex.getMessage() ); - m_logger.send( ERROR, message.str() ); - return; - - } catch(...) { - - m_logger.send( ERROR, - "initialize() : XML file parsing failed with unknown exception" ); - return; - - } - - const DOMDocument* xmlDocument = xmlParser->getDocument(); - - { - ostringstream message; - message << "initialize() : Document has " - << xmlDocument->getChildNodes()->getLength() << " child nodes" << endl; - message << "initialize() : Their names are:"; - m_logger.send( VERBOSE, message.str() ); - for( XMLSize_t i = 0; i < xmlDocument->getChildNodes()->getLength(); ++i ) { - const XMLCh* name = xmlDocument->getChildNodes()->item( i )->getNodeName(); - char* cname = XMLString::transcode( name ); - ostringstream message; - message << "initialize() : --> " << cname; - m_logger.send( VERBOSE, message.str() ); - XMLString::release( &cname ); - } - } - - const DOMNode* sectorsNode = xmlDocument->getFirstChild(); - const DOMNodeList* sectorNodes = sectorsNode->getChildNodes(); - - for( XMLSize_t i = 0; i < sectorNodes->getLength(); ++i ) { - - const DOMNode* sectorNode = sectorNodes->item( i ); - - char* cname = XMLString::transcode( sectorNode->getNodeName() ); - string sname( cname ); - XMLString::release( &cname ); - - if( sname != "Sector" ) continue; - - const DOMElement* sectorElement = dynamic_cast< const DOMElement* >( sectorNode ); - if( ! sectorElement ) { - m_logger.send( ERROR, - "initialize() : Unable to cast Sector node into DOMElement" ); - return; - } - - m_logger.send( VERBOSE, - ">>>>>>>>>>>>>> Starting to initialize calculator <<<<<<<<<<<<<<" ); - XMLMultCalculator calc( sectorNode ); - m_logger.send( VERBOSE, - ">>>>>>>>>>>>>> Calculator initialization finished <<<<<<<<<<<<<<" ); - - // Check if this calculator is not defined yet: - list< XMLMultCalculator >::const_iterator calc_it; - if( ( calc_it = find( m_calculatorList.begin(), m_calculatorList.end(), - calc ) ) == m_calculatorList.end() ) { - m_calculatorList.push_back( calc ); - calc_it = find( m_calculatorList.begin(), m_calculatorList.end(), calc ); - m_logger.send( VERBOSE, "initialize() : This is a new calculator definition" ); - } else { - m_logger.send( VERBOSE, - "initialize() : This calculator definition already exists" ); - } - - // - // Extract the Sector IDs that this calculator represents: - // - XMLCh* sector_ids_name = XMLString::transcode( "IDs" ); - const XMLCh* sector_ids = sectorElement->getAttribute( sector_ids_name ); - XMLString::release( §or_ids_name ); - - char* cids = XMLString::transcode( sector_ids ); - string sids( cids ); - XMLString::release( &cids ); - - vector< int > ids; - istringstream stream_ids( sids ); - while( ! stream_ids.eof() ) { - int id; - stream_ids >> id; - ids.push_back( id ); - } - - // - // Assing the correct sectors to this calculator: - // - const int candidate_border = ( ( MAX_BARREL_SECTOR + 1 ) + - ( MAX_ENDCAP_SECTOR + 1 ) + - ( MAX_FORWARD_SECTOR + 1 ) ) * 2; - m_logger.send( VERBOSE, "initialize() : This calculator represents sectors:" ); - for( vector< int >::const_iterator id = ids.begin(); id != ids.end(); ++id ) { - bool firstCand = ( *id >= candidate_border ) ? false : true; - int lid = ( *id >= candidate_border ) ? ( *id - candidate_border ) : ( *id ); - SectorID sid( lid ); - m_calculatorMap[ std::make_pair( sid, firstCand ) ] = &*calc_it; - - ostringstream message; - message << "initialize() : --> " << sid << ( firstCand ? " fist candidate" : - " second candidate" ); - m_logger.send( VERBOSE, message.str() ); - } - - } - - ostringstream message; - message << "Number of different calculators created: " << m_calculatorList.size(); - m_logger.send( VERBOSE, message.str() ); - - return; - - } - - PtMultiplicitySet - XMLMultStrategy::calculateMultiplicity( unsigned int pt, - const SectorID& id, - bool firstCandidate ) const { - - PtMultiplicitySet result; - - if( m_calculatorMap.find( std::make_pair( id, firstCandidate ) ) != - m_calculatorMap.end() ) { - result = m_calculatorMap.find( std::make_pair( id, firstCandidate ) )->second->calculateMultiplicity( pt ); - } else { - m_logger.send( ERROR, "Multiplicity calculation asked for unknown sector!" ); - result = m_exStrategy.calculateMultiplicity( pt, id, firstCandidate ); - } - - return result; - - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.h deleted file mode 100644 index 1284cfbd411ea6c24fdd70d4f0184913470a060a..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.h +++ /dev/null @@ -1,56 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: XMLMultStrategy.h 701446 2015-10-19 15:19:09Z wengler $ -#ifndef TRIGT1MUCTPI_MIOCT_XMLMULTSTRATEGY_H -#define TRIGT1MUCTPI_MIOCT_XMLMULTSTRATEGY_H - -// STL include(s): -#include <string> -#include <map> -#include <list> - -// Local include(s): -#include "MultiplicityStrategy.h" -#include "ExclusiveMultStrategy.h" -#include "SectorID.h" -#include "XMLMultCalculator.h" -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - bool operator< ( const std::pair< SectorID, bool >& id1, - const std::pair< SectorID, bool >& id2 ); - - class XMLMultStrategy : public MultiplicityStrategy { - - public: - /// Constructor - XMLMultStrategy(); - XMLMultStrategy( const std::string& xmlMultFile ); - XMLMultStrategy( const XMLMultStrategy& strategy ); - XMLMultStrategy & operator = ( const XMLMultStrategy & ) = delete; - /// Destructor - ~XMLMultStrategy(); - - void initialize( const std::string& xmlMultFile ); - - /// Multiplicity handling function - virtual PtMultiplicitySet calculateMultiplicity( unsigned int pt, - const SectorID& id, - bool firstCandidate ) const; - - private: - ExclusiveMultStrategy m_exStrategy; - std::map< std::pair< SectorID, bool>, const XMLMultCalculator* > m_calculatorMap; - std::list< XMLMultCalculator > m_calculatorList; - MsgLogger m_logger; - - }; // class XMLMultStrategy - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIOCT_XMLMULTSTRATEGY_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.cxx deleted file mode 100644 index 6df2a9920e23488640c44e1bb3c04dc4abb5a114..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.cxx +++ /dev/null @@ -1,351 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodDaqProcessor.cxx 624535 2014-10-28 10:02:49Z stelzer $ - -// STL include(s): -#include <iomanip> -#include <sstream> -#include <cassert> -#include <string> - -// Local include(s): -#include "MirodDaqProcessor.h" -#include "MirodExtractor.h" -#include "../Common/BitOp.h" -#include "../Common/MuctpiBitMasks.h" -#include "../Common/EventID.h" - -/******************************************************************* - * $Date: 2014-10-28 11:02:49 +0100 (Tue, 28 Oct 2014) $ - * - * Implementation of class MirodDaqProcessor - * @author Author: Thorsten Wengler - * @version $Revision: 624535 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor of class MirodDaqProcessor - MirodDaqProcessor::MirodDaqProcessor() - : m_logger( "MirodDaqProcessor" ) { - - REPORT_VERBOSE_MSG( "constructor called" ); - } - - // constructor of class MirodDaqProcessor with unsigned int list - // as argument used to set the TheDaqOutputData data member - MirodDaqProcessor::MirodDaqProcessor( std::list<unsigned int> daqOut ) - : m_logger( "MirodDaqProcessor" ) { - - m_daqOutputData = std::move(daqOut); - } - - // implementation of main action method - void MirodDaqProcessor::processData( const MirodExtractor* theExtractorData ) { - - REPORT_VERBOSE_MSG( "reading event from Extractor" ); - - unsigned int inputWord = 0; - unsigned int extractorStatus = 0; - unsigned int monitorFlag = 0; -// unsigned int thresholdFirst = 0; -// unsigned int thresholdSecond = 0; - unsigned int suppressedFirst = 0; - unsigned int suppressedSecond = 0; -// unsigned int suppressedEither = 0; - unsigned int headerBCID = 0; - m_daqOutputData.clear(); - - // Get the run number: - EventID eventID; - unsigned int runNumber = eventID.getRunNumber(); - - //get pointer to Extractor data - const std::list<unsigned int>* extractorData = theExtractorData->getExtractorData(); - - // the fixed parts of the header to be send to the ROB - m_daqOutputData.push_back( DaqHeaderStartMask ); // Header marker - m_daqOutputData.push_back( DaqHeaderSizeMask ); // Header size bytes - m_daqOutputData.push_back( DaqHeaderFormatMask ); // format version - m_daqOutputData.push_back( DaqHeaderDetIDMask ); // Det. ID - m_daqOutputData.push_back( runNumber ); // Run number - - // now loop over the Extractor data, except last word - std::list<unsigned int>::const_iterator it_Extr; - - // I now handle the first 3 data words (coming originally from - // the event FIFO) separately. This is mainly because of the - // use of the Extended L1A ID. - it_Extr = extractorData->begin(); - - // The first word is the "plain" L1A (aka. EVID): - unsigned int l1a = ( *it_Extr ); - BitOp::clearBit( &l1a, 31 ); - ++it_Extr; - - // this is the reference BCID - the candidates have to have - // the same or a BCID at a fixed offset - headerBCID = ( ( *it_Extr ) & ExtrHeaderBcID ); - unsigned int ECRC = ( ( ( *it_Extr ) & ExtrHeaderECRC ) >> 12 ); - ++it_Extr; - - inputWord = ( *it_Extr ); - monitorFlag = BitOp::getValue( &inputWord, ExtrMonitorMask ) ; - extractorStatus = BitOp::getValue( &inputWord, ExtrStatusMask ) ; - // BitOp::clearBit(&inputWord,12) ; - // BitOp::clearBit(&inputWord,31); - unsigned int trType = ( ( inputWord & ExtrTrTypeMask ) >> 4 ) ; - ++it_Extr; - - // Now add the acumulated information to the Lvl2 output: - unsigned int extendedL1A = ECRC; - extendedL1A = extendedL1A << 24; - extendedL1A |= l1a; - m_daqOutputData.push_back( extendedL1A ); - m_daqOutputData.push_back( headerBCID ); - m_daqOutputData.push_back( trType ); - m_daqOutputData.push_back( 0x0 ); // this is the event type - - for( ; it_Extr != ( --extractorData->end() ) ; ++it_Extr ) { - - inputWord = 0; - inputWord = ( *it_Extr ); - - // put it to data stream - m_daqOutputData.push_back( inputWord ); - } // end of loop over Extractor data - - // retrieve information from last word in extractor data - inputWord = 0 ; - inputWord = extractorData->back() ; -// thresholdFirst = BitOp::getValue( &inputWord, ExtrThresholdOneMask ); -// thresholdSecond = BitOp::getValue( &inputWord, ExtrThresholdSecondMask ); - suppressedFirst = BitOp::getValue( &inputWord, ExtrSuppressedFirstMask ); - suppressedSecond = BitOp::getValue( &inputWord, ExtrSuppressedSecondMask ); -// suppressedEither = BitOp::getValue( &inputWord, ExtrSuppressedEitherMask ); - - // build up error status word and add to data stream - inputWord = 0 ; - if ( BitOp::isSet( &extractorStatus, 0 ) ) { - BitOp::setBit( &inputWord, 1 ); // EvIDMM - } - if ( BitOp::isSet( &extractorStatus, 1 ) ) { - BitOp::setBit( &inputWord, 0 ); // BcIDMM - } - m_daqOutputData.push_back( inputWord ); - - // build up status word and add to data stream - inputWord = 0 ; - if ( monitorFlag != 0 ) {BitOp::setBit( &inputWord, 20 );} - if ( suppressedFirst != 0 ) {BitOp::setBit( &inputWord, 16 );} - if ( suppressedSecond != 0 ) {BitOp::setBit( &inputWord, 17 );} - m_daqOutputData.push_back( inputWord ); - - // add number of status elements - m_daqOutputData.push_back( 0x00000002 ); - - // fill in number of data words - inputWord = 0 ; - inputWord = m_daqOutputData.size() - 12; // 12 comes from the 9 header words - // and the 3 status words already added - // to the list. - m_daqOutputData.push_back( inputWord ); - - // fill in status block position - m_daqOutputData.push_back( 0x00000001 ); - - return; - } - - // method to print the event - void MirodDaqProcessor::printEvent( std::string format ) const { - - REPORT_VERBOSE_MSG( "printing output of DaqProcessor" ); - - bool mioctWord = false ; - bool trailerWord = false ; - unsigned int wordCount = 0 ; - unsigned int trailerWordCount = 0 ; - std::list<unsigned int>::const_iterator it_DaqPr = m_daqOutputData.begin(); - std::list<unsigned int>::const_iterator it_DaqPrMioctStart = m_daqOutputData.begin(); - std::list<unsigned int>::const_iterator it_DaqPrMioctEnd = m_daqOutputData.end(); - for( int i = 0; i < 10; ++i ) { - ++it_DaqPrMioctStart; - } - for( int i = 0; i < 5; ++i ) { - --it_DaqPrMioctEnd; - } - - for( ; it_DaqPr != m_daqOutputData.end(); ++it_DaqPr ) { - - std::ostringstream message; - - if ( format == "hex" ) { - message << std::hex << std::setw( 8 ) << ( *it_DaqPr ); - } else if ( format == "bin" ) { - std::string binaryString; - BitOp::printBin( ( *it_DaqPr ), binaryString ); - message << binaryString; - } else if ( format == "human" ) { - wordCount++; - if ( wordCount == 1 ) { // Header 1 - message << " ==================================================" - << "=========================" << std::endl; - message << " DaqOut: 0x" << std::hex << ( *it_DaqPr ); - } - if ( wordCount == 2 ) { // Header 2 - message << " HeaderBytes: " << ( *it_DaqPr ); - } - if ( wordCount == 3 ) { // Header 3 - message << " Format: 0x" << std::hex << ( *it_DaqPr ); - } - if ( wordCount == 4 ) { // Header 4 - message << " DetID: 0x" << std::hex << ( *it_DaqPr ); - } - if ( wordCount == 5 ) { // Header 5 - message << " Run Number: " << ( *it_DaqPr ); - } - if ( wordCount == 6 ) { // Header 6 - message << " EvID: " << ( *it_DaqPr ); - } - if ( wordCount == 7 ) { // Header 7 - message << " BcID: " << ( ( *it_DaqPr ) & DaqHeaderBcIDMask ); - } - if ( wordCount == 8 ) { // Header 8 - message << " TrType: " << ( ( *it_DaqPr ) & DaqHeaderTrTypeMask ); - } - if ( wordCount == 9 ) { // Header 9 - message << " EvType: " << ( *it_DaqPr ) << std::endl ; - message << " --------------------------------------------------" - << "-------------------------"; - } - if ( wordCount == 10 ) { // MICTP word - message << " MICTP -> BcID: " << BitOp::getValue( &( *it_DaqPr ), - ExtrMictpBCIDMask ); - message << " Sum6: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum6Mask ); - message << " Sum5: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum5Mask ); - message << " Sum4: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum4Mask ); - message << " Sum3: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum3Mask ); - message << " Sum2: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum2Mask ); - message << " Sum1: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum1Mask ); - message << std::endl; - message << " --------------------------------------------------" - << "-------------------------"; - } - if ( ( it_DaqPr == it_DaqPrMioctStart ) || mioctWord ) { // MIOCT's - mioctWord = true; - if ( it_DaqPr == it_DaqPrMioctEnd ) { - mioctWord = false; - trailerWord = true; - } else { - message << this->printSector( *it_DaqPr ); - } - } - if ( trailerWord ) { //Trailer - trailerWordCount++; - if ( trailerWordCount == 1 ) { - message << " --------------------------------------------------" - << "-------------------------" << std::endl; - message << " Errors: "; - std::string errorString; - BitOp::printBin( ( *it_DaqPr ), errorString ); - message << errorString; - } - if ( trailerWordCount == 2 ) { - message << " Status: "; - std::string statusString; - BitOp::printBin( ( *it_DaqPr ), statusString ); - message << statusString; - } - if ( trailerWordCount == 3 ) { - message << " Status Elements: " << ( *it_DaqPr ); - } - if ( trailerWordCount == 4 ) { - message << " Data Elements: " << ( ( *it_DaqPr ) & DaqTrailerCandMask ); - } - if ( trailerWordCount == 5 ) { - message << " StatusBlockPos: " << ( *it_DaqPr ) << std::endl; - message << " ==================================================" - << "========================="; - } - } - } else { - REPORT_FATAL_MSG( "Non-existent print method choosen" ); - assert( 0 ); - } - - REPORT_VERBOSE_MSG( message.str() ); - - } - - return; - } - - // method to print one sector in human readable format - std::string MirodDaqProcessor::printSector( const unsigned int & sectorWord ) const { - - std::ostringstream outStream; - std::string system; - std::string hemisphere = "-"; - unsigned int sectorNumber = 0; - unsigned int regionOfInterest = 0; - unsigned int overlap = 0; - - // get the values out of the bit mask - const unsigned int candPassed = BitOp::getValue( §orWord, ExtrPassedMask ); - const unsigned int candFirst = BitOp::getValue( §orWord, ExtrFirstCandMask ); - const unsigned int sectorAddress = - BitOp::getValue( §orWord, ExtrSectorAddressMask ); - const unsigned int sectorBCID = BitOp::getValue( §orWord, ExtrBCIDMask ); - const unsigned int ptValue = BitOp::getValue( §orWord, ExtrPtValueMask ); - const unsigned int sectorRoIOvl = BitOp::getValue( §orWord, ExtrRoIOvlMask ); - const unsigned int padOverflow = - BitOp::getValue( §orWord, ExtrPadOverflowMask ); - const unsigned int sectorOverflow = - BitOp::getValue( §orWord, ExtrSectorOverflowMask ); - const bool veto = sectorWord & 0x10000000; - - // sector address and RoI and Overlap must be taken apart agin - // to extract the readable information - // first find out if this is Barrel, endcap, forward, get sector - // number, RoI and Overlap information - if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) == 0 ) { - system = "B"; // Barrel - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberBarrelMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, EvReBarrelRoIMask ); - overlap = BitOp::getValue( §orRoIOvl, EvReBarrelOvlMask ); - } else if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) == 1 ) { - system = "F"; // Forward - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberForwardMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, EvReForwardRoIMask ); - overlap = 0; - } else if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) > 1 ) { - system = "E"; // Endcap - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberEndcapMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, EvReEndcapRoIMask ); - overlap = BitOp::getValue( §orRoIOvl, EvReEndcapOvlMask ); - } - // get the Hemisphere - if ( BitOp::getValue( §orAddress, EvReSecAddressSubSysMask ) == 1 ) { - hemisphere = "+"; - } - - outStream << " Addr: " << hemisphere << system << " " - << std::setw( 2 ) << std::dec << sectorNumber - << " Pt/RoI: " << ptValue - << " " << std::setw( 2 ) << regionOfInterest - << " BcID: " << std::dec << std::setw( 4 ) - << std::dec << sectorBCID - << " Ovl: " << overlap - << " pad/secOF: " << std::setw( 2 ) << padOverflow - << std::setw( 2 ) << sectorOverflow - << " pass: " << candPassed - << " First: " << candFirst - << " veto: " << veto; - - return outStream.str(); - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.h deleted file mode 100644 index f37a76da1f7afa6c8b986803d31ef1b45ff560ff..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.h +++ /dev/null @@ -1,106 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodDaqProcessor.h 439423 2011-05-25 21:22:40Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIRODDAQPROCESSOR_H -#define TRIGT1MUCTPI_MIRODDAQPROCESSOR_H - -// STL include(s): -#include <list> -#include <string> - -// Local include(s): -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MirodExtractor; - - /** - * @short funtionality of the MIROD DAQ Processor - * - * Class MirodDaqProcessor implements the functionality - * of the MIROD DAQ Processor, which reads the data - * provided by the Extractor and formats them to the - * format used for driving out data to the Read Out - * system. This is the final step of the processing in - * the MIROD for the DAQ branch of the data flow. The - * data is provided as pointer to a list of 0-31 bit wide - * unsigned int. The SLINK control bits are of course not - * necessary here (would by bit 32). Otherwise the data - * format is exactly as for the hardware SLINK - * - * @see MirodModule - * @see MirodLvl2Processor - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 439423 $ - * $Date: 2011-05-25 23:22:40 +0200 (Wed, 25 May 2011) $ - */ - class MirodDaqProcessor { - - public: - /** - * The constructor of MirodDaqProcessor - */ - MirodDaqProcessor(); - /** - * Alternative constructor of MirodDaqProcessor which has - * the purpose of creating an object with setting the Daq - * out data to an existing list of unsigned ints - e.g. - * using the output of the hardware - to then utilize the - * analysis methods of this class - */ - MirodDaqProcessor( std::list< unsigned int > daqOut ); - /** - * access to the output result - * return The Daq Output Data Output to the ROS - */ - const std::list< unsigned int >& getDaqOutputData() const { return m_daqOutputData; } - /** - * This is the main action interface of the MirodDaqProcessor, - * gets a link to the data output of the MirodExtractor. Calling - * this method fills the STL list which holds the output of the - * DaqProcessor in the format used in the hardware, e.g. a stream - * of 32-bit words - * @see MirodModule - * @see MirodExtractor - * @see MirodLvl2Processor - * @param theExtractor Poniter to the data output of the - * Mirod Extractor - */ - void processData( const MirodExtractor* theExtractor ); - /** - * This method prints the Event in DaqOutput format to the - * screen. The parameter determines if the printout will be in - * binary, hexadecimal or human readable format. Consequently - * the choices are "hex", "bin" or "human" - * @param format Determines if the printout will be in - * binary or hexadecimal format. Choices are "hex", "bin", "human" - */ - void printEvent( std::string format ) const; - /** - * function to return a string representing the information - * contained in one sector word of the Extractor format - * in human readable form - * @param sectorWord reference to a sector word represented by - * 32 - bit Extractor format - * @return A string to be used for output the information of - * this sector - */ - std::string printSector( const unsigned int& sectorWord ) const; - - private: - mutable MsgLogger m_logger; - std::list< unsigned int > m_daqOutputData; - - }; // class MirodDaqProcessor - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIRODDAQPROCESSOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.cxx deleted file mode 100644 index 6763f5c3a9e98c6e930ee682291041fd756560e7..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.cxx +++ /dev/null @@ -1,259 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodEventReader.cxx 441850 2011-06-06 14:50:52Z krasznaa $ - -// STL include(s): -#include <cassert> -#include <string> -#include <sstream> -#include <iomanip> - -// Local include(s): -#include "MirodEventReader.h" -#include "MirodExtractor.h" -#include "../Mibak/MibakStreamEvent.h" -#include "../Common/BitOp.h" -#include "../Mioct/MioctID.h" -#include "../Common/MuctpiBitMasks.h" - -/******************************************************************* - * implementation of class MirodEventReader - * @author Author: Thorsten Wengler - * @version $Revision: 441850 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor - MirodEventReader::MirodEventReader() - : m_logger( "MirodEventReader" ) { - - REPORT_VERBOSE_MSG( "constructor called" ); - } - - void MirodEventReader::readData( const MibakStreamEvent* theStream ) { - - REPORT_VERBOSE_MSG( "reading event from MIBAK" ); - - unsigned int theMioctMNBRMask = 0; - Hemisphere theMioctHem = NEGATIVE; - unsigned int eventID = 0; - unsigned int bunchID = 0; - unsigned int bunchIDandECRC = 0; - bool eventIDmismatch = false; - bool bunchIDmismatch = false; - unsigned int triggerType = 0; - unsigned int monitorBit = 0; - bool isMictp = false; - unsigned int moduleCounter = 0; - unsigned int sectorAddress = 0; - - // make sure the FiFo's are empty - m_eventFiFo.clear(); - m_candidateFiFo.clear(); - m_candidateFiFoHighBits.clear(); - - std::list<unsigned int>::const_iterator it_high = theStream->highBits.begin(); - std::list<unsigned int>::const_iterator it_data = theStream->dataWords.begin(); - // start loop over input data stream - bool mictpFirstDataWord = true; - for( ; it_high != theStream->highBits.end(); ++it_high ) { - - // ----------------------------------------------------------- - if ( ( *it_high & 0xf ) == 0x0000000e ) { // module start word - - if ( moduleCounter == 0 ) { //MICTP is first - isMictp = true; - eventID = BitOp::getValue( &( *it_data ), MictpEvIDMask ); - } else { //the others are the MIOCTs - isMictp = false; - if ( BitOp::getValue( &( *it_data ), MioctEvIDMask ) != eventID ) { - eventIDmismatch = true; - } - if ( BitOp::getValue( &( *it_data ), MioctBcIDMask ) != bunchID ) { - bunchIDmismatch = true; - } - theMioctMNBRMask = BitOp::getValue( &( *it_data ), MioctMNBRMask ); - theMioctHem = NEGATIVE; - if ( theMioctMNBRMask > 7 ) { - theMioctMNBRMask = theMioctMNBRMask - 8; - theMioctHem = POSITIVE; - } - } - ++moduleCounter; // increase module counter - } // --------------------------------------------------------- - else if ( ( *it_high & 0xf ) == 0x0000000f ) { // module end word - - } // --------------------------------------------------------- - else { // data words - - if ( isMictp ) { // MICTP - if ( mictpFirstDataWord ) { // MICTP first data word - mictpFirstDataWord = false; - bunchID = BitOp::getValue( &( *it_data ), MictpBcIDMask ); - bunchIDandECRC = BitOp::getValue( &( *it_data ), MictpECRCBcIDMask ); - triggerType = BitOp::getValue( &( *it_data ), MictpTrTypeMask ); - monitorBit = BitOp::getValue( &( *it_data ), MictpMonitorMask ); - } else { // MICTP further data words - m_candidateFiFo.push_back( *it_data ); - sectorAddress = 0x00000100; - m_candidateFiFoHighBits.push_back( sectorAddress ); - } - } else { // The MIOCT data words - m_candidateFiFo.push_back( *it_data ); - MioctID theMioctID( theMioctMNBRMask, theMioctHem ); - sectorAddress = theMioctID.getMirodSecAddress( *it_high & 0xf ); - // The candidate suppressions bits are now sitting on bits 41 and 42: - m_candidateFiFoHighBits.push_back( sectorAddress | - ( ( *it_high & 0x30 ) << 5 ) ); - } - - } // ----------------------------------------------------------- - - ++it_data; // increase also the data word iterator - } // end loop over input data stream - - // Now fill the EventFifo with the information obtained from the - // MICTP, the internally determined status flag and the word count - - m_eventFiFo.push_back( eventID - 1 ); // The EventReader is the one that - // decreases the EvID (L1A) by one, - // as the official counting starts - // with 0. - m_eventFiFo.push_back( bunchIDandECRC ); - - unsigned int thirdWord = 0 ; - BitOp::sImposeNBits( &thirdWord, 13, - static_cast< unsigned int >( m_candidateFiFoHighBits.size() ) ) ; - if ( monitorBit != 0 ) { BitOp::setBit( &thirdWord, 12 ); } - BitOp::sImposeNBits( &thirdWord, 4, triggerType ) ; - if ( bunchIDmismatch ) { BitOp::setBit( &thirdWord, 1 ); } - if ( eventIDmismatch ) { BitOp::setBit( &thirdWord, 0 ); } - - m_eventFiFo.push_back( thirdWord ); - - return; - } - - // method to print the event - void MirodEventReader::printEvent( std::string format ) const { - - MirodExtractor serviceExtractor; // not the real Extractor, just here - // to use some of its services - unsigned int wordCount = 0; - - // first print the Event Fifo - std::list<unsigned int>::const_iterator it_EvFifo = m_eventFiFo.begin(); - for( ; it_EvFifo != m_eventFiFo.end(); ++it_EvFifo ) { - - std::ostringstream message; - - if ( format == "hex" ) { - message << std::hex << std::setw( 6 ) << ( *it_EvFifo ); - } else if ( format == "bin" ) { - std::string binaryString; - BitOp::printBinN( ( *it_EvFifo ), 23, binaryString ); - message << binaryString; - } else if ( format == "human" ) { - wordCount++; - if ( wordCount == 1 ) { // EvID - message << " ==================================================" - << "=========================" << std::endl; - message << " EvCaFiFo EvID: " << std::dec << std::setw( 8 ) - << ( ( *it_EvFifo ) & EvReEvIDMask ); - } - if ( wordCount == 2 ) { // BcID - message << " BcID: " << std::setw( 4 ) - << ( ( *it_EvFifo ) & EvReBcIDMask ); - } - if ( wordCount == 3 ) { - message << " NoWords: " << std::setw( 4 ) // #data words - << BitOp::getValue( &( *it_EvFifo ), EvReNoWordsMask ); - message << " Monitor: " // Monitor bit - << BitOp::getValue( &( *it_EvFifo ), EvReMonitorMask ); - message << " TrType: " // Trigger Type - << BitOp::getValue( &( *it_EvFifo ), EvReTrTypeMask ); - message << " Status: "; // Status bits - std::string statusString; - BitOp::printBinN( ( *it_EvFifo ), 3, statusString ); - message << statusString << std::endl; - message << " --------------------------------------------------" - << "-------------------------"; - } - } else { - REPORT_FATAL_MSG( "Non-existent print method choosen" ); - assert( 0 ); - } - - REPORT_VERBOSE_MSG( message.str() ); - - } - - // and now the candidate FiFo - std::list<unsigned int>::const_iterator it_Canhigh = m_candidateFiFoHighBits.begin(); - std::list<unsigned int>::const_iterator it_CanData = m_candidateFiFo.begin(); - for( ; it_CanData != m_candidateFiFo.end(); ++it_CanData ) { - - std::ostringstream message; - - if ( format == "hex" ) { - message << std::hex << std::setw( 3 ) << ( *it_Canhigh ); - message << std::hex << std::setw( 8 ) << ( *it_CanData ); - } else if ( format == "bin" ) { - std::string binaryString; - BitOp::printBinN( ( *it_Canhigh ), 8, binaryString ) ; - message << binaryString << " -- "; - binaryString = ""; - BitOp::printBin( ( *it_CanData ), binaryString ) ; - message << binaryString; - } else if ( format == "human" ) { - if ( ( ( *it_Canhigh ) & 0x00000100 ) != 0 ) { // MICTP word - message << " MICTP -> BcID: " << BitOp::getValue( &( *it_CanData ), BCIDMask ); - message << " Sum6: " << BitOp::getValue( &( *it_CanData ), ExtrSum6Mask ); - message << " Sum5: " << BitOp::getValue( &( *it_CanData ), ExtrSum5Mask ); - message << " Sum4: " << BitOp::getValue( &( *it_CanData ), ExtrSum4Mask ); - message << " Sum3: " << BitOp::getValue( &( *it_CanData ), ExtrSum3Mask ); - message << " Sum2: " << BitOp::getValue( &( *it_CanData ), ExtrSum2Mask ); - message << " Sum1: " << BitOp::getValue( &( *it_CanData ), ExtrSum1Mask ); - message << std::endl; - message << " --------------------------------------------------" - << "-------------------------"; - } else { // MIOCT word - message << " 0x" << std::hex << std::setw( 3 ) << std::setfill( '0' ) - << *it_Canhigh << std::hex << std::setw( 8 ) << std::setfill( '0' ) - << *it_CanData; - unsigned int firstCand = serviceExtractor.extractFirstCandidate( ( *it_CanData ), - ( *it_Canhigh ) ); - unsigned int secondCand = serviceExtractor.extractSecondCandidate( ( *it_CanData ), - ( *it_Canhigh ) ); - if ( firstCand != 0 ) { - message << MirodExtractor::printSector( firstCand ); - } else { - message << " ... no first candidate ... "; - } - if ( secondCand != 0 ) { - message << MirodExtractor::printSector( secondCand ); - } else { - message << " ... no second candidate ..."; - } - } - } else { - REPORT_FATAL_MSG( "Non-existent print method choosen" ); - assert( 0 ); - } - - REPORT_VERBOSE_MSG( message.str() ); - - ++it_Canhigh ; // also increase counter for highBits list - } - if ( format == "human" ) { - REPORT_VERBOSE_MSG( " ====================================================" - "=======================" ); - } - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.h deleted file mode 100644 index 660ba10410f854ce6ef2a3e90f7681f2337b4404..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.h +++ /dev/null @@ -1,94 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodEventReader.h 439423 2011-05-25 21:22:40Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIRODEVENTREADER_H -#define TRIGT1MUCTPI_MIRODEVENTREADER_H - -// STL include(s): -#include <list> -#include <string> - -// Local include(s): -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MibakStreamEvent; - - /** - * @short This class implements the MIROD Event Reader - * - * This class implements the functionality of the - * Event Reader of the MIROD Readout Driver. The data - * arrives in form of a pointer to a MibakStreamEvent - * and is checked and separated into candidate and - * event stream as on the actual board. - * - * @see MirodModule - * @see MibakStreamEvent - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 439423 $ - * $Date: 2011-05-25 23:22:40 +0200 (Wed, 25 May 2011) $ - */ - class MirodEventReader { - - public: - /** - * constructor of MirodEventReader - */ - MirodEventReader(); - /** - * This method returns a pointer to the EventFiFo list. - * @return Pointer to the list representing the - * EventFifo - */ - const std::list< unsigned int >* getEventFifo() const { return &m_eventFiFo; } - /** - * This method returns a pointer to the CandidateFiFo lower bits. - * @return Pointer to the list representing the - * Candidate Fifo's lower 32 bits - */ - const std::list< unsigned int >* getCandidateFifo() const { return &m_candidateFiFo; } - /** - * This method returns a pointer to the CandidateFiFo higher bits. - * @return Pointer to the list representing the - * Candidate Fifo's higher 9 bits - */ - const std::list< unsigned int >* getCandidateFifoHighBits() const { - return &m_candidateFiFoHighBits; - } - /** - * This method reads the data from the input MibakDataStream and - * splits it into an Event and a Candidate Stream in the format - * used by the EventReader FPGA on the MIROD Board. - */ - void readData( const MibakStreamEvent* theStream ); - /** - * This method prints the EventFiFo and the Candidate FiFo to the - * screen. The parameter determines if the printout will be in - * binary, hexadecimal or human radable format. Consequently the - * choices are "hex", "bin" or "human" - * @param format Determines if the printout will be in - * binary or hexadecimal format. Choices are "hex", "bin", "human" - */ - void printEvent( std::string format ) const; - - private: - mutable MsgLogger m_logger; - - std::list< unsigned int > m_eventFiFo; - std::list< unsigned int > m_candidateFiFo; - std::list< unsigned int > m_candidateFiFoHighBits; - - }; // class MirodEventReader - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIRODEVENTREADER_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.cxx deleted file mode 100644 index 674765d4575afb803deab6dff2c6761022be2e4c..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.cxx +++ /dev/null @@ -1,423 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodExtractor.cxx 441850 2011-06-06 14:50:52Z krasznaa $ - -// STL include(s): -#include <cassert> -#include <sstream> -#include <iostream> -#include <iomanip> - -// Local include(s): -#include "MirodExtractor.h" -#include "MirodEventReader.h" -#include "../Common/MuctpiBitMasks.h" -#include "../Common/SectorConstants.h" -#include "../Common/Configuration.h" -#include "../Common/BitOp.h" - -/******************************************************************* - * $Date: 2011-06-06 16:50:52 +0200 (Mon, 06 Jun 2011) $ - * - * Implementation of class MirodExtractor - * @author Author: Thorsten Wengler - * @version $Revision: 441850 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor of class MirodExtractor - MirodExtractor::MirodExtractor() - : m_logger( "MirodExtractor" ), - m_threshold1Candidate( 0 ), m_threshold2Candidate( 0 ), m_suppressionMode( 0 ) { - - } - - // alternative constructor of class MirodExtractor with setting - // the output by hand - to use analysis methods - MirodExtractor::MirodExtractor( std::list< unsigned int > extractorOut ) - : m_logger( "MirodExtractor" ), m_extractorData( std::move(extractorOut) ), - m_threshold1Candidate( 0 ), m_threshold2Candidate( 0 ), m_suppressionMode( 0 ) { - - } - - // set Configuration - void MirodExtractor::setConfiguration( const Configuration &conf ) { - - m_threshold1Candidate = conf.getThreshold1Candidate(); - m_threshold2Candidate = conf.getThreshold2Candidate(); - m_suppressionMode = conf.getSuppressionMode(); - - return; - } - - void MirodExtractor::processData( const MirodEventReader* theReader ) { - - REPORT_VERBOSE_MSG( "reading event from EventReader" ); - - unsigned int inputWord = 0; - m_extractorData.clear(); - bool thresholdFirstFailed = false; - bool thresholdSecondFailed = false; - unsigned int candidateCount = 0; - - // get Pointer to the MirodEventReader output data - const std::list<unsigned int>* theEventFiFo = - theReader->getEventFifo(); - const std::list<unsigned int>* theCandidateHighBits = - theReader->getCandidateFifoHighBits(); - const std::list<unsigned int>* theCandidateFiFo = - theReader->getCandidateFifo(); - - // first three words of the extractor format are filled from the - // EventFiFo - if ( theEventFiFo->size() != 3 ) { - REPORT_FATAL_MSG( " <> 3 words in EventFiFo" ); - assert( 0 ); - } - std::list<unsigned int>::const_iterator it_EvFiFo ; - it_EvFiFo = theEventFiFo->begin(); - - inputWord = ( *it_EvFiFo ); // first word from EventFiFo - BitOp::setBit( &inputWord, 31 ); - m_extractorData.push_back( inputWord ); - - ++it_EvFiFo; - inputWord = 0; - inputWord = ( *it_EvFiFo ); // second word from EventFiFo - BitOp::setBit( &inputWord, 31 ); - m_extractorData.push_back( inputWord ); - - ++it_EvFiFo; - inputWord = 0; - inputWord = ( *it_EvFiFo ); // third word from EventFiFo - BitOp::setBit( &inputWord, 31 ); - for( int i = 13;i <= 23;++i ) { BitOp::clearBit( &inputWord, i ); } - m_extractorData.push_back( inputWord ); - - // Now loop over the Candidate Fifo and process the data words - std::list<unsigned int>::const_iterator it_CaFiFo = theCandidateFiFo->begin(); - std::list<unsigned int>::const_iterator it_CaFiFoHiBi = theCandidateHighBits->begin(); - for( ; it_CaFiFo != theCandidateFiFo->end(); ++it_CaFiFo ) { - - inputWord = 0 ; - if ( ( *it_CaFiFoHiBi ) == 0x00000100 ) { // this is a MICTP word - - inputWord = ( *it_CaFiFo ); - unsigned int tmpBits = ( inputWord & BCIDMask ) >> 9; //shift BCID - for ( int i = 27; i <= 29; ++i ) { BitOp::clearBit( &inputWord, i ); } - inputWord |= tmpBits; - BitOp::setBit( &inputWord, 29 ); - m_extractorData.push_back( inputWord ); - - } else { // MIOCT word - - //second candidate - inputWord = 0 ; - inputWord = ( this )->extractSecondCandidate( ( *it_CaFiFo ), ( *it_CaFiFoHiBi ) ); - if ( inputWord != 0 ) { - candidateCount++; - m_extractorData.push_back( inputWord ); - // ... if the candidate failed its threshold, set the - // corresponding global bit - if ( !( BitOp::isSet( &inputWord, 26 ) ) ) { - thresholdSecondFailed = true; - } - } - // first candidate - inputWord = ( this )->extractFirstCandidate( ( *it_CaFiFo ), ( *it_CaFiFoHiBi ) ); - if ( inputWord != 0 ) { - candidateCount++; - m_extractorData.push_back( inputWord ); - // ... if the candidate failed its threshold, set the - // corresponding global bit - if ( !( BitOp::isSet( &inputWord, 26 ) ) ) { - thresholdFirstFailed = true; - } - } - } - - ++it_CaFiFoHiBi; // also increment the HighBits list - } - - // Finally construct the trailer word of the Extractor format - inputWord = 0 ; - if ( ( m_suppressionMode == 0 ) && - ( thresholdFirstFailed || thresholdSecondFailed ) ) { - BitOp::setBit( &inputWord, 0 ) ; - } else if ( ( m_suppressionMode != 0 ) && thresholdFirstFailed ) { - BitOp::setBit( &inputWord, 0 ) ; - } - if ( thresholdFirstFailed ) { BitOp::setBit( &inputWord, 2 ) ; } - if ( thresholdSecondFailed ) { BitOp::setBit( &inputWord, 1 ) ; } - - BitOp::sImposeNBits( &inputWord, 3, m_threshold1Candidate ); - BitOp::sImposeNBits( &inputWord, 6, m_threshold2Candidate ); - BitOp::sImposeNBits( &inputWord, 9, candidateCount ); - BitOp::setBit( &inputWord, 30 ); - - m_extractorData.push_back( inputWord ); - - return; - } - - // implementation of method to extract first candidate from sector word - unsigned int - MirodExtractor::extractFirstCandidate( const unsigned int candidateFiFo, - const unsigned int candidateFiFoHighBits ) { - - unsigned int result = 0; - unsigned int ptValue = 0; - - // first get the candiates Pt value and jump out if it is 0 or 7 - // e.g. no candidate - ptValue = ( BitOp::getValue( &candidateFiFo, Pt1Mask ) ); - if ( ( ptValue < 1 ) || ( ptValue > MAX_NUMBER_OF_THRESHOLDS ) ) { return result; } - - // check and set the bit telling if there where more than 2 - // candidates in the sector - if ( ( candidateFiFo & SectorOverflowMask ) != 0 ) { BitOp::setBit( &result, 0 ); } - - // check and set the bit telling if the candiate is from - // a pad with more than 1 candidates in pad - if ( ( candidateFiFo & ROI1OverflowMask ) != 0 ) { BitOp::setBit( &result, 1 ); } - - // get RoI and Overlap in one go and superimpose it, as it is - // not otherwise used in this context - result |= ( ( BitOp::getValue( &candidateFiFo, RoIOvl1Mask ) ) << 2 ); - - // now superimpose the Pt value - BitOp::sImposeNBits( &result, 11, ptValue ); - - // superimpose the BCID - result |= ( ( candidateFiFo & BCIDMask ) >> 13 ) ; - - // superimpose the sector address - bit 8 in the address is always - // zero for a word from the MIOCT - so I can just stick it on - BitOp::sImposeNBits( &result, 17, candidateFiFoHighBits ) ; - - // this is the first (most energetic) candidate in this sector - so - // set the corresponding bit - BitOp::setBit( &result, 25 ); - - // Set the sign of the candidate: - if( candidateFiFo & Candidate1Sign ) result |= ExtrCandidateSign; - - // Set the suppression flag of the candidate on bit 28: - if( candidateFiFoHighBits & 0x200 ) BitOp::setBit( &result, 28 ); - - // finally compare the ptValue to the threshold for the highest - // candidate in the sector and set the pass bit - if ( ptValue >= m_threshold1Candidate ) { - BitOp::setBit( &result, 26 ); - } - - return result; - } - - // implementation of method to extract second candidate from sector word - unsigned int - MirodExtractor::extractSecondCandidate( const unsigned int candidateFiFo, - const unsigned int candidateFiFoHighBits ) { - - unsigned int result = 0; - unsigned int ptValue = 0; - - // first get the candiates Pt value and jump out if it is 0 or 7 - // e.g. no candidate - ptValue = ( BitOp::getValue( &candidateFiFo, Pt2Mask ) ); - if ( ( ptValue < 1 ) || ( ptValue > MAX_NUMBER_OF_THRESHOLDS ) ) { return result; } - - // check and set the bit telling if there where more than 2 - // candidates in the sector - if ( ( candidateFiFo & SectorOverflowMask ) != 0 ) { BitOp::setBit( &result, 0 ); } - - // check and set the bit telling if the candiate is from - // a pad with more than 1 candidates in pad - if ( ( candidateFiFo & ROI2OverflowMask ) != 0 ) { BitOp::setBit( &result, 1 ); } - - // get RoI and Overlap in one go and superimpose it, as it is - // not otherwise used in this context - result |= ( ( BitOp::getValue( &candidateFiFo, RoIOvl2Mask ) ) << 2 ); - - // now superimpose the Pt value - BitOp::sImposeNBits( &result, 11, ptValue ); - - // superimpose the BCID - result |= ( ( candidateFiFo & BCIDMask ) >> 13 ); - - // superimpose the sector address - bit 8 in the address is always - // zero for a word from the MIOCT - so I can just stick it on - BitOp::sImposeNBits( &result, 17, candidateFiFoHighBits ); - - // this is the second (second energetic) candidate in this sector - // - so make sure the corresponding bit is not set - BitOp::clearBit( &result, 25 ); - - // Set the sign of the candidate: - if( candidateFiFo & Candidate2Sign ) result |= ExtrCandidateSign; - - // Set the suppression flag of the candidate on bit 28: - if( candidateFiFoHighBits & 0x400 ) BitOp::setBit( &result, 28 ); - - // finally compare the ptValue to the threshold for the second - // candidate in the sector and set the pass bit - if ( ptValue >= m_threshold2Candidate ) { - BitOp::setBit( &result, 26 ); - } - - return result; - } - - // method to print the event - void MirodExtractor::printEvent( std::string format ) const { - - unsigned int wordCount = 0; - std::list<unsigned int>::const_iterator it_Extr = m_extractorData.begin(); - for( ; it_Extr != m_extractorData.end(); ++it_Extr ) { - - std::ostringstream message; - - if ( format == "hex" ) { - message << std::hex << std::setw( 8 ) << ( *it_Extr ); - } else if ( format == "bin" ) { - std::string binaryString; - BitOp::printBin( ( *it_Extr ), binaryString ); - message << binaryString; - } else if ( format == "human" ) { - wordCount++; - if ( wordCount == 1 ) { - message << " ==================================================" - << "=========================" << std::endl; - message << " Extr EvID: " << std::dec << std::setw( 8 ) - << ( ( *it_Extr ) & ExtrHeaderEvID ); - } - if ( wordCount == 2 ) { - message << " BcID: " << std::setw( 4 ) << ( ( *it_Extr ) & ExtrHeaderBcID ); - } - if ( wordCount == 3 ) { - message << " Monitor: " << BitOp::getValue( &( *it_Extr ), ExtrMonitorMask ); - message << " Trigger_Type: " << BitOp::getValue( &( *it_Extr ), ExtrTrTypeMask ); - message << " Status: "; - std::string statusString; - BitOp::printBinN( ( *it_Extr ), 3, statusString ); - message << statusString << std::endl; - message << " --------------------------------------------------" - << "-------------------------"; - } - if ( ( *it_Extr ) & 0x20000000 ) { // Mictp - message << " MICTP -> BcID: " << BitOp::getValue( &( *it_Extr ), - ExtrMictpBCIDMask ); - message << " Sum6: " << BitOp::getValue( &( *it_Extr ), ExtrSum6Mask ); - message << " Sum5: " << BitOp::getValue( &( *it_Extr ), ExtrSum5Mask ); - message << " Sum4: " << BitOp::getValue( &( *it_Extr ), ExtrSum4Mask ); - message << " Sum3: " << BitOp::getValue( &( *it_Extr ), ExtrSum3Mask ); - message << " Sum2: " << BitOp::getValue( &( *it_Extr ), ExtrSum2Mask ); - message << " Sum1: " << BitOp::getValue( &( *it_Extr ), ExtrSum1Mask ); - message << std::endl; - message << " --------------------------------------------------" - << "-------------------------"; - } - if ( ( ( *it_Extr ) & 0xe0000000 ) == 0 ) { - message << printSector( *it_Extr ); } // print Sector info - if ( ( *it_Extr ) & 0x40000000 ) { // Trailer - message << " --------------------------------------------------" - << "-------------------------" << std::endl; - message << " CandCount: " << BitOp::getValue( &( *it_Extr ), - ExtrCandCountMask ); - message << " Thresh_1: " << BitOp::getValue( &( *it_Extr ), - ExtrThresh1Mask ); - message << " Thresh_2: " << BitOp::getValue( &( *it_Extr ), - ExtrThresh2Mask ); - message << " S1: " << BitOp::getValue( &( *it_Extr ), - Extr1stCandSupprMask ); - message << " S2: " << BitOp::getValue( &( *it_Extr ), - Extr2ndCandSupprMask ); - message << " S: " << BitOp::getValue( &( *it_Extr ), - ExtrEitherCandSupprMask ); - message << std::endl; - message << " ==================================================" - << "========================="; - } - } else { - REPORT_FATAL_MSG( "Non-existent print method choosen" ); - assert( 0 ); - } - - REPORT_VERBOSE_MSG( message.str() ); - - } - - return; - } - - // method to print one sector in human readable format - std::string MirodExtractor::printSector( const unsigned int & sectorWord ) { - - std::string sectorString = ""; - std::ostringstream outStream; - std::string system; - std::string hemisphere = "-"; - unsigned int sectorNumber = 0; - unsigned int regionOfInterest = 0; - unsigned int overlap = 0; - - // get the values out of the bit mask - const unsigned int candPassed = BitOp::getValue( §orWord, ExtrPassedMask ); - const unsigned int candFirst = BitOp::getValue( §orWord, ExtrFirstCandMask ); - const unsigned int sectorAddress = - BitOp::getValue( §orWord, ExtrSectorAddressMask ); - const unsigned int sectorBCID = BitOp::getValue( §orWord, ExtrBCIDMask ); - const unsigned int ptValue = BitOp::getValue( §orWord, ExtrPtValueMask ); - const unsigned int sectorRoIOvl = BitOp::getValue( §orWord, ExtrRoIOvlMask ); - const unsigned int padOverflow = - BitOp::getValue( §orWord, ExtrPadOverflowMask ); - const unsigned int sectorOverflow = - BitOp::getValue( §orWord, ExtrSectorOverflowMask ); - const bool veto = sectorWord & 0x10000000; - - // sector address and RoI and Overlap must be taken apart agin - // to extract the readable information - // first find out if this is Barrel, endcap, forward, get sector - // number, RoI and Overlap information - if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) == 0 ) { - system = "B"; // Barrel - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberBarrelMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, EvReBarrelRoIMask ); - overlap = BitOp::getValue( §orRoIOvl, EvReBarrelOvlMask ); - } else if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) == 1 ) { - system = "F"; // Forward - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberForwardMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, EvReForwardRoIMask ); - overlap = 0; - } else if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) > 1 ) { - system = "E"; // Endcap - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberEndcapMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, EvReEndcapRoIMask ); - overlap = BitOp::getValue( §orRoIOvl, EvReEndcapOvlMask ); - } - // get the Hemisphere - if ( BitOp::getValue( §orAddress, EvReSecAddressSubSysMask ) == 1 ) { - hemisphere = "+"; } - - outStream << " Addr: " << hemisphere << system << " " - << std::setw( 2 ) << std::dec << sectorNumber - << " Pt/RoI: " << ptValue - << " " << std::setw( 2 ) << regionOfInterest - << " BcID: " << std::dec << std::setw( 4 ) - << std::dec << sectorBCID - << " Ovl: " << overlap - << " pad/secOF: " << std::setw( 2 ) << padOverflow - << std::setw( 2 ) << sectorOverflow - << " pass: " << candPassed - << " First: " << candFirst - << " veto: " << veto; - - sectorString = outStream.str(); - - return sectorString; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.h deleted file mode 100644 index c41c426852751008c21f7b6441796b0b09864b3f..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.h +++ /dev/null @@ -1,143 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodExtractor.h 439423 2011-05-25 21:22:40Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIRODEXTRACTOR_H -#define TRIGT1MUCTPI_MIRODEXTRACTOR_H - -// STL include(s): -#include <list> -#include <string> - -// Local include(s): -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class Configuration; - class MirodEventReader; - - /** - * @short This class implements the Mirod Extractor - * - * This class implements the fuunctionality of the MIROD - * Extractor. Its receives the data from the MIROD - * Event Reader, which in turn has read them from the - * Lvl1 Mibak backplane. The data are handed over in form - * of pointers to the Event and Candidate Fifo's, which - * are implemented as STL lists. The result of the - * processing done in the Extractor is stored again in - * an STL list of unsigned int words, which in format - * corrspond to the Extractor format of the actual MIROD. - * - * The Extractor compares each Muon candidates to - * programmable thresholds. - * - * @see MiordModule - * @see MirodEventReader - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 439423 $ - * $Date: 2011-05-25 23:22:40 +0200 (Wed, 25 May 2011) $ - */ - class MirodExtractor { - - public: - /** - * The constructor of MirodExtractor - */ - MirodExtractor(); - /** - * Alternative constructor of MirodExtractor which has - * the purpose of creating an object with setting the Extractor - * out data to an existing list of unsigned ints - e.g. - * using the output of the hardware - to then utilize the - * analysis methods of this class - */ - MirodExtractor( std::list<unsigned int> extractorOut ); - - // set Configuration - void setConfiguration( const Configuration &conf ); - - /** - * This is the main action interface of the MirodExtractor, which - * gets links from the MirodEventReader and processes the data - * the Extractor format which is used on the actual board and - * is expected by the Lvl2Processor and the DaqProcessor. The - * result is again stored in an STL list - * @see MirodEventReader - * @see MirodLvl2Processor - * @see MirodDaqProcessor - */ - void processData( const MirodEventReader* theReader ); - /** - * This method takes one input word from the candidate buffer - * (data word and high bits holding the sector ID) and - * extracts the first candidate if any. The return is a candiate - * word in Extractor format - * @return First candidate in Extractor format - * @param candidateFiFo candidate word bit 0-31 - * @param candidateFiFoHighBits candidate word high bits 32-40 - */ - unsigned int extractFirstCandidate( const unsigned int candidateFiFo, - const unsigned int candidateFiFoHighBits ); - /** - * This method takes one input word from the candidate buffer - * (data word and high bits holding the sector ID) and - * extracts the second candidate if any. The return is a candiate - * word in Extractor format - * @return Second candidate in Extractor format - * @param candidateFiFo candidate word bit 0-31 - * @param candidateFiFoHighBits candidate word high bits 32-40 - */ - unsigned int extractSecondCandidate( const unsigned int candidateFiFo, - const unsigned int candidateFiFoHighBits ); - /** - * This method hands back a Pointer to the list holding the - * output data of the Extractor - * @return Pointer to the list of output data - * in Mirod Extractor format - */ - const std::list< unsigned int >* getExtractorData() const { return & m_extractorData; } - /** - * This method prints the Event in Extractor format to the - * screen. The parameter determines if the printout will be in - * binary, hexadecimal or human readable format. - * Consequently the choices are "hex", "bin" or "human" - * @param format Determines if the printout will be in - * binary or hexadecimal format. Choices are "hex", "bin", "human" - */ - void printEvent( std::string format ) const; - /** - * function to return a string representing the information - * contained in one sector word of the Extractor format - * in human readable form - * @param sectorWord reference to a sector word represented by - * 32 - bit Extractor format - * @return A string to be used for output the information of - * this sector - */ - static std::string printSector( const unsigned int & sectorWord ); - - private: - mutable MsgLogger m_logger; - - std::list< unsigned int > m_extractorData; - - // threshold parameters - unsigned int m_threshold1Candidate; - unsigned int m_threshold2Candidate; - - /// suppression mode - int m_suppressionMode; - - }; // class MirodExtractor - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIRODEXTRACTOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.cxx deleted file mode 100644 index a877e760ea6ec64728a720ee308904f01125bb97..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.cxx +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodFiFoContent.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// Local include(s): -#include "MirodFiFoContent.h" -#include "MirodExtractor.h" -#include "MirodLvl2Processor.h" -#include "MirodDaqProcessor.h" - -/******************************************************************* - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * Implementation of class MirodFiFoContent - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - ******************************************************************/ - -// constructor of class MirodFiFoContent -MirodFiFoContent::MirodFiFoContent() { - -} - -// print content of Monitoring Fifo in "human" , "hex" or "bin" -void MirodFiFoContent::printMonFiFo( std::string format ) { - - LVL1MUCTPI::MirodExtractor hardwareExtrOut( m_monFiFo ); - - if( format == "human" ) hardwareExtrOut.printEvent( "human" ); - else if( format == "hex" ) hardwareExtrOut.printEvent( "hex" ); - else if( format == "bin" ) hardwareExtrOut.printEvent("bin"); - - return; - -} - -// print content of Lvl2 Fifo in "human" , "hex" or "bin" -void MirodFiFoContent::printLvl2FiFo( std::string format ) { - - LVL1MUCTPI::MirodLvl2Processor hardwareLvl2Output( m_lvl2FiFo ); - - if( format == "human" ) hardwareLvl2Output.printEvent( "human" ); - else if( format == "hex" ) hardwareLvl2Output.printEvent( "hex" ); - else if( format == "bin" ) hardwareLvl2Output.printEvent( "bin" ); - - return; - -} - -// print content of Daq Fifo in "human" , "hex" or "bin" -void MirodFiFoContent::printDaqFiFo(std::string format) { - - LVL1MUCTPI::MirodDaqProcessor hardwareDaqOutput( m_daqFiFo ); - - if( format == "human" ) hardwareDaqOutput.printEvent( "human" ); - else if( format == "hex" ) hardwareDaqOutput.printEvent( "hex" ); - else if( format == "bin" ) hardwareDaqOutput.printEvent( "bin" ); - - return; - -} diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.h deleted file mode 100644 index 7d80383a3d2ee8df5b890bb1be3b2fc7658652b3..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.h +++ /dev/null @@ -1,82 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodFiFoContent.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIRODFIFOCONTENT_H -#define TRIGT1MUCTPI_MIRODFIFOCONTENT_H - -// STL include(s): -#include <list> -#include <string> - -/** -******************************************************************* -* -* $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ -* -* @short Helper class to hold the output of the Mirod FiFo readout -* -* This is a helper class to group the output from reading -* out the Mirod FiFos. -* -* @author Thorsten Wengler -* @version $Revision: 362102 $ -* -******************************************************************* -*/ -class MirodFiFoContent { - - public: - /** - * The constructor of MirodFiFoContent - */ - MirodFiFoContent(); - /** - * set and get the DaqFiFo content - */ - void daqFiFo( std::list< unsigned int > daqFiFoContent ) { m_daqFiFo = daqFiFoContent; } - const std::list< unsigned int >& daqFiFo() { return m_daqFiFo; } - /** - * set and get the Lvl2FiFo content - */ - void lvl2FiFo( std::list< unsigned int > lvl2FiFoContent ) { m_lvl2FiFo = lvl2FiFoContent; } - const std::list< unsigned int >& lvl2FiFo() { return m_lvl2FiFo; } - /** - * set and get the MonFiFo content - */ - void monFiFo( std::list< unsigned int > monFiFoContent ) { m_monFiFo = monFiFoContent; } - const std::list< unsigned int >& monFiFo() { return m_monFiFo; } - - /** - * print content of Monitoring Fifo in "human" , "hex" or "bin" - * format depending on the format string - */ - void printMonFiFo( std::string format ); - /** - * print content of Lvl2 Fifo in "human" , "hex" or "bin" - * format depending on the format string - */ - void printLvl2FiFo( std::string fromat ); - /** - * print content of Daq Fifo in "human" , "hex" or "bin" - * format depending on the format string - */ - void printDaqFiFo( std::string format ); - - /** - * The destructor of MirodFiFoContent - */ - ~MirodFiFoContent() = default; - - private: - - std::list< unsigned int > m_daqFiFo; - std::list< unsigned int > m_lvl2FiFo; - std::list< unsigned int > m_monFiFo; - -}; // class MirodFiFoContent - -#endif // TRIGT1MUCTPI_MIRODFIFOCONTENT_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.cxx deleted file mode 100644 index 83c10c92ea5cac37bd182c707b60b4c1de80e99f..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.cxx +++ /dev/null @@ -1,447 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodLvl2Processor.cxx 726107 2016-02-25 11:04:42Z wengler $ - -// STL include(s): -#include <cassert> -#include <iomanip> -#include <iostream> -#include <sstream> -#include <algorithm> - -// Local include(s): -#include "MirodLvl2Processor.h" -#include "MirodExtractor.h" -#include "../Common/Configuration.h" -#include "../Common/BitOp.h" -#include "../Common/MuctpiBitMasks.h" -#include "../Common/EventID.h" -#include "../Common/SectorConstants.h" - -/******************************************************************* - * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $ - * - * Implementation of class MirodLvl2Processor - * @author Author: Thorsten Wengler - * @version $Revision: 726107 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // default constructor of class MirodLvl2Processor - MirodLvl2Processor::MirodLvl2Processor() - : m_logger( "MirodLvl2Processor" ), - m_ptSorterBuckets( MAX_NUMBER_OF_THRESHOLDS ), - m_maxCandPerPtvalue(0), m_maxCandSendToRoib(0), m_candBcidOffset(0) { - - REPORT_VERBOSE_MSG( "constructor called" ); - } - - // constructor of class MirodLvl2Processor with unsigned int list - // as argument used to set the TheLvl2OutputData data member - MirodLvl2Processor::MirodLvl2Processor( std::list<unsigned int> lvl2Out ) - : m_logger( "MirodLvl2Processor" ), - m_ptSorterBuckets( MAX_NUMBER_OF_THRESHOLDS ), - m_maxCandPerPtvalue(0), m_maxCandSendToRoib(0), m_candBcidOffset(0) { - - REPORT_VERBOSE_MSG( "in constructor" ); - m_lvl2OutputData = lvl2Out; - } - - // set Configuration - void MirodLvl2Processor::setConfiguration( const Configuration& conf ) { - - m_maxCandPerPtvalue = conf.getMaxCandPerPtvalue(); - m_maxCandSendToRoib = conf.getMaxCandSendToRoib(); - m_candBcidOffset = conf.getCandBcidOffset(); - for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) { - m_ptSorterBuckets[ i ].reserve( m_maxCandPerPtvalue ); - } - - return; - } - - // implementation of main action method - void MirodLvl2Processor::processData( const MirodExtractor* theExtractorData ) { - - REPORT_VERBOSE_MSG( "reading event from Extractor" ); - - unsigned int inputWord = 0; - unsigned int extractorStatus = 0; - unsigned int monitorFlag = 0; -// unsigned int thresholdFirst = 0; -// unsigned int thresholdSecond = 0; - unsigned int suppressedFirst = 0; - unsigned int suppressedSecond = 0; - unsigned int suppressedEither = 0; - unsigned int candidateCounterOverflow = 0; - unsigned int candidateSorterOverflow = 0; - - unsigned int headerBCID = 0; - - // Get the run number: - EventID eventID; - unsigned int runNumber = eventID.getRunNumber(); - - m_lvl2OutputData.clear(); - for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) { - m_ptSorterBuckets[ i ].clear(); - } - m_ptCombinedFiFo.clear(); - - //get pointer to Extractor data - const std::list< unsigned int >* extractorData = theExtractorData->getExtractorData(); - - // the fixed parts of the header to be send to the ROB - m_lvl2OutputData.push_back( Lvl2HeaderStartMask ); // Header marker - m_lvl2OutputData.push_back( Lvl2HeaderSizeMask ); // Header size bytes - m_lvl2OutputData.push_back( Lvl2HeaderFormatMask ); // format version - m_lvl2OutputData.push_back( Lvl2HeaderDetIDMask ); // Det. ID - m_lvl2OutputData.push_back( runNumber ); // Run number - - // now loop over the Extractor data, except last word - std::list< unsigned int >::const_iterator it_Extr; - - // I now handle the first 3 data words (coming originally from - // the event FIFO) separately. This is mainly because of the - // use of the Extended L1A ID. - it_Extr = extractorData->begin(); - - // The first word is the "plain" L1A (aka. EVID): - unsigned int l1a = ( *it_Extr ); - BitOp::clearBit( &l1a, 31 ); - ++it_Extr; - - // this is the reference BCID - the candidates have to have - // the same or a BCID at a fixed offset - headerBCID = ( ( *it_Extr ) & ExtrHeaderBcID ); - unsigned int ECRC = ( ( ( *it_Extr ) & ExtrHeaderECRC ) >> 12 ); - ++it_Extr; - - inputWord = ( *it_Extr ); - monitorFlag = BitOp::getValue( &inputWord, ExtrMonitorMask ) ; - extractorStatus = BitOp::getValue( &inputWord, ExtrStatusMask ) ; - // BitOp::clearBit(&inputWord,12) ; - // BitOp::clearBit(&inputWord,31); - unsigned int trType = ( ( inputWord & ExtrTrTypeMask ) >> 4 ) ; - ++it_Extr; - - // Now add the acumulated information to the Lvl2 output: - unsigned int extendedL1A = ECRC; - extendedL1A <<= 24; - extendedL1A |= l1a; - m_lvl2OutputData.push_back( extendedL1A ); - m_lvl2OutputData.push_back( headerBCID ); - m_lvl2OutputData.push_back( trType ); - m_lvl2OutputData.push_back( 0x0 ); // this is the event type - - for ( ; it_Extr != ( --extractorData->end() ) ; ++it_Extr ) { - inputWord = 0 ; - inputWord = ( *it_Extr ) ; - - // now here the rest of the data is not just copied to the - // output stream as in the DaqProcessor, but the MICTP word - // is not used at all, and the sector candidates are only - // taken if they passed the threshold in the Extractor , checked - // to see if the have the expected BCID and - // are sorted for their pt values - if ( ( !BitOp::isSet( &inputWord, 29 ) ) && // not the MICTP word - ( ( inputWord & ExtrPassedMask ) != 0 ) && // passed Thresh.? - ( BitOp::getValue( &inputWord, ExtrBCIDMask ) == - ( ( headerBCID + m_candBcidOffset ) & 0x7 ) ) ) { // cand. w/ correct BCID ? - // for the Level 2 output, the BCID is not part anymore of the - // sector word, and also the bit saying that it passed the - // threshold is gone (it would not be here otherwise) - // so the sector address gets shifted by three bits and the pass - // bit is reset - - const bool candSign = inputWord & ExtrCandidateSign; - - const unsigned int tmpSectAddFirst = - BitOp::getValue( &inputWord, - ( ExtrFirstCandMask | // get first cand - ExtrSectorAddressMask ) ); // get sector address - const unsigned int clearombMask = ( ExtrPassedMask | - ExtrFirstCandMask | - ExtrSectorAddressMask | - ExtrBCIDMask ); - ( inputWord |= clearombMask ) ^= clearombMask; - - BitOp::sImposeNBits( &inputWord, Lvl2SecAddressStartBit, tmpSectAddFirst ); - - if( candSign ) inputWord |= Lvl2CandidateSign; - - const unsigned int ptValue = BitOp::getValue( &inputWord, Lvl2PtValueMask ); - if( ( ptValue < 1 ) || ( ptValue > 6 ) ) { - REPORT_ERROR_MSG( "Unknown pT value (" << ptValue << ") for candidate: 0x" - << std::hex << inputWord ); - continue; - } - // Add the candidate to one of the sorter buckets: - if( m_ptSorterBuckets[ ptValue - 1 ].size() >= m_maxCandPerPtvalue ) { - candidateSorterOverflow = 1; - // Overwrite the first candidate: (make sure it exisits - it might not if there was - // a configurtion error - if ( m_ptSorterBuckets[ ptValue - 1 ].size() >= 1 ) { - m_ptSorterBuckets[ ptValue - 1 ][ 0 ] = inputWord; - } else { - REPORT_ERROR_MSG( "Sorter bucket size 0 - config error?" ); - } - } else { - m_ptSorterBuckets[ ptValue - 1 ].push_back( inputWord ); - } - } - } // end of loop over Extractor data - - // retrieve information from last word in extractor data - inputWord = 0 ; - inputWord = extractorData->back() ; -// thresholdFirst = BitOp::getValue( &inputWord, ExtrThresholdOneMask ); -// thresholdSecond = BitOp::getValue( &inputWord, ExtrThresholdSecondMask ); - suppressedFirst = BitOp::getValue( &inputWord, ExtrSuppressedFirstMask ); - suppressedSecond = BitOp::getValue( &inputWord, ExtrSuppressedSecondMask ); - suppressedEither = BitOp::getValue( &inputWord, ExtrSuppressedEitherMask ); - - // Create a "master list" of all the candidates, with the right sorting: - std::vector< std::vector< unsigned int > >::const_reverse_iterator pt_itr = - m_ptSorterBuckets.rbegin(); - std::vector< std::vector< unsigned int > >::const_reverse_iterator pt_end = - m_ptSorterBuckets.rend(); - for( ; pt_itr != pt_end; ++pt_itr ) { - std::vector< unsigned int >::const_reverse_iterator itr = - pt_itr->rbegin(); - std::vector< unsigned int >::const_reverse_iterator end = - pt_itr->rend(); - for( ; itr != end; ++itr ) { - m_ptCombinedFiFo.push_back( *itr ); - } - } - - // add the selected and sorted candidates to the data stream - // up to a maximum number of candidates - unsigned int candidates = 0; - std::list< unsigned int >::const_iterator itr = m_ptCombinedFiFo.begin(); - std::list< unsigned int >::const_iterator end = m_ptCombinedFiFo.end(); - for( ; itr != end; ++itr, ++candidates ) { - // Make sure that we're not adding too many candidates to the output: - if( candidates >= m_maxCandSendToRoib ) { - candidateCounterOverflow = 1; - break; - } - m_lvl2OutputData.push_back( *itr ); - } - - // build up error status word and add to data stream - inputWord = 0 ; - if ( BitOp::isSet( &extractorStatus, 0 ) ) { - BitOp::setBit( &inputWord, 1 ); // EvIDMM - } - if ( BitOp::isSet( &extractorStatus, 1 ) ) { - BitOp::setBit( &inputWord, 0 ); // BcIDMM - } - m_lvl2OutputData.push_back( inputWord ); - - // build up status word and add to data stream - inputWord = 0 ; - if ( monitorFlag != 0 ) {BitOp::setBit( &inputWord, 20 );} - if ( suppressedFirst != 0 ) {BitOp::setBit( &inputWord, 16 );} - if ( suppressedSecond != 0 ) {BitOp::setBit( &inputWord, 17 );} - if ( candidateCounterOverflow != 0 ) {BitOp::setBit( &inputWord, 18 );} - if ( candidateSorterOverflow != 0 ) {BitOp::setBit( &inputWord, 19 );} - if ( suppressedEither != 0 || - candidateCounterOverflow != 0 || - candidateSorterOverflow != 0 ) {BitOp::setBit( &inputWord, 1 );} - m_lvl2OutputData.push_back( inputWord ); - - // add number of status elements - m_lvl2OutputData.push_back( 0x00000002 ); - - // fill in number of data words - inputWord = 0 ; - inputWord = m_lvl2OutputData.size() - 12; // 12 comes from the 9 header words - // and the 3 status words already added - // to the list. - m_lvl2OutputData.push_back( inputWord ); - - // fill in status block position - m_lvl2OutputData.push_back( 0x00000001 ); - - return; - } - - // method to print the event - void MirodLvl2Processor::printEvent( std::string format ) const { - - REPORT_VERBOSE_MSG( "printing output of Lvl2Processor" ); - - bool mioctWord = false; - bool trailerWord = false; - unsigned int wordCount = 0; - unsigned int trailerWordCount = 0; - std::list<unsigned int>::const_iterator it_Lvl2Pr = m_lvl2OutputData.begin(); - std::list<unsigned int>::const_iterator it_Lvl2PrMioctStart = m_lvl2OutputData.begin(); - std::list<unsigned int>::const_iterator it_Lvl2PrMioctEnd = m_lvl2OutputData.end(); - for( int i = 0; i < 9; ++i ) { - ++it_Lvl2PrMioctStart; - } - for( int i = 0; i < 5; ++i ) { - --it_Lvl2PrMioctEnd; - } - - for( ; it_Lvl2Pr != m_lvl2OutputData.end(); ++it_Lvl2Pr ) { - - std::ostringstream message; - - if ( format == "hex" ) { - message << std::hex << std::setw( 8 ) << ( *it_Lvl2Pr ); - } else if ( format == "bin" ) { - std::string binaryString; - BitOp::printBin( ( *it_Lvl2Pr ), binaryString ); - message << binaryString; - } else if ( format == "human" ) { - - wordCount++; - if ( wordCount == 1 ) { // Header 1 - message << " ==================================================" - << "=========================" << std::endl; - message << " Lvl2Out: 0x" << std::hex << ( *it_Lvl2Pr ); - } - if ( wordCount == 2 ) { // Header 2 - message << " HeaderBytes: " << ( *it_Lvl2Pr ); - } - if ( wordCount == 3 ) { // Header 3 - message << " Format: 0x" << std::hex << ( *it_Lvl2Pr ); - } - if ( wordCount == 4 ) { // Header 4 - message << " DetID: 0x" << std::hex << ( *it_Lvl2Pr ); - } - if ( wordCount == 5 ) { // Header 5 - message << " Run Number: " << ( *it_Lvl2Pr ); - } - if ( wordCount == 6 ) { // Header 6 - message << " EvID: " << ( *it_Lvl2Pr ); - } - if ( wordCount == 7 ) { // Header 7 - message << " BcID: " << ( ( *it_Lvl2Pr ) & DaqHeaderBcIDMask ); - } - if ( wordCount == 8 ) { // Header 8 - message << " TrType: " << ( ( *it_Lvl2Pr ) & DaqHeaderTrTypeMask ); - } - if ( wordCount == 9 ) { // Header 9 - message << " EvType: " << ( *it_Lvl2Pr ) << std::endl; - message << " --------------------------------------------------" - << "-------------------------"; - } - if ( ( it_Lvl2Pr == it_Lvl2PrMioctStart ) || mioctWord ) { // MIOCT's - mioctWord = true; - if ( ( it_Lvl2Pr ) == it_Lvl2PrMioctEnd ) { - mioctWord = false; - trailerWord = true; - } else { - message << printSector( *it_Lvl2Pr ); - } - } - if ( trailerWord ) { //Trailer - trailerWordCount++; - if ( trailerWordCount == 1 ) { - message << " --------------------------------------------------" - << "-------------------------" << std::endl; - message << " Errors: "; - std::string errorString; - BitOp::printBin( ( *it_Lvl2Pr ), errorString ); - message << errorString; - } - if ( trailerWordCount == 2 ) { - message << " Status: "; - std::string statusString; - BitOp::printBin( ( *it_Lvl2Pr ), statusString ); - message << statusString; - } - if ( trailerWordCount == 3 ) { - message << " Status Elements: " << ( *it_Lvl2Pr ); - } - if ( trailerWordCount == 4 ) { - message << " Data Elements: " - << ( ( *it_Lvl2Pr ) & DaqTrailerCandMask ); - } - if ( trailerWordCount == 5 ) { - message << " StatusBlockPos: " << ( *it_Lvl2Pr ) << std::endl; - message << " ==================================================" - << "========================="; - } - } - } else { - REPORT_FATAL_MSG( "Non-existent print method choosen" ); - assert( 0 ); - } - - REPORT_VERBOSE_MSG( message.str() ); - - } - - return; - } - - // method to print one sector in human readable format - std::string MirodLvl2Processor::printSector( const unsigned int & sectorWord ) const { - - std::ostringstream outStream; - std::string system; - std::string hemisphere = "-"; - unsigned int sectorNumber = 0; - unsigned int regionOfInterest = 0; - unsigned int overlap = 0; - - // get the values out of the bit mask - const unsigned int candFirst = BitOp::getValue( §orWord, Lvl2FirstCandMask ); - const unsigned int sectorAddress = - BitOp::getValue( §orWord, Lvl2SectorAddressMask ); - const unsigned int ptValue = BitOp::getValue( §orWord, Lvl2PtValueMask ); - const unsigned int sectorRoIOvl = BitOp::getValue( §orWord, Lvl2RoIOvlMask ); - const unsigned int padOverflow = - BitOp::getValue( §orWord, Lvl2PadOverflowMask ); - const unsigned int sectorOverflow = - BitOp::getValue( §orWord, Lvl2SectorOverflowMask ); - const bool veto = sectorWord & 0x10000000; - - // sector address and RoI and Overlap must be taken apart agin - // to extract the readable information - // first find out if this is Barrel, endcap, forward, get sector - // number, RoI and Overlap information - if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) == 0 ) { - system = "B"; // Barrel - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberBarrelMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, Lvl2BarrelRoIMask ); - overlap = BitOp::getValue( §orRoIOvl, Lvl2BarrelOvlMask ); - } else if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) == 1 ) { - system = "F"; // Forward - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberForwardMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, Lvl2ForwardRoIMask ); - overlap = 0; - } else if ( BitOp::getValue( §orAddress, EvReSecAddressSystemMask ) > 1 ) { - system = "E"; // Endcap - sectorNumber = BitOp::getValue( §orAddress, EvReSecNumberEndcapMask ); - regionOfInterest = BitOp::getValue( §orRoIOvl, Lvl2EndcapRoIMask ); - overlap = BitOp::getValue( §orRoIOvl, Lvl2EndcapOvlMask ); - } - // get the Hemisphere - if ( BitOp::getValue( §orAddress, EvReSecAddressSubSysMask ) == 1 ) { - hemisphere = "+"; - } - - outStream << " Addr: " << hemisphere << system << " " - << std::setw( 2 ) << std::dec << sectorNumber - << " Pt/RoI: " << ptValue - << " " << std::setw( 2 ) << regionOfInterest - << " Ovl: " << overlap - << " pad/secOF: " << std::setw( 2 ) << padOverflow - << std::setw( 2 ) << sectorOverflow - << " First: " << candFirst - << " veto: " << veto; - - return outStream.str(); - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.h deleted file mode 100644 index b1ac367d6b2e223343268a2aa9ed24e7483376d8..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.h +++ /dev/null @@ -1,125 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodLvl2Processor.h 726107 2016-02-25 11:04:42Z wengler $ -#ifndef TRIGT1MUCTPI_MIRODLVL2PROCESSOR_H -#define TRIGT1MUCTPI_MIRODLVL2PROCESSOR_H - -// STL include(s): -#include <string> -#include <list> -#include <vector> - -// Local include(s): -#include "../Logging/MsgLogger.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class MirodExtractor; - class Configuration; - - /** - * @short implements the MIROD Lvl2 processor - * - * This class implements the functionality of the MIROD - * Lvl2 processor. It receives its data from the - * MIROD extractor and chooses the ones that have passed - * the programmable thresholds for candiates in the - * Extractor. The candidates or sorted and the total - * number of candidates and the number of candidates per - * pt value is limited - * - * @see MirodModule - * @see MirodDaqProcessor - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 726107 $ - * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $ - */ - class MirodLvl2Processor { - - public: - /** - * The default constructor of MirodLvl2Processor - */ - MirodLvl2Processor(); - /** - * Alternative constructor of MirodLvl2Processor which has - * the purpose of creating an object with setting the Lvl2 - * out data to an existing std::list of unsigned ints - e.g. - * using the output of the hardware - to then utilize the - * analysis methods of this class - */ - MirodLvl2Processor( std::list< unsigned int > lvl2Out ); - - // set Configuration - void setConfiguration( const Configuration& conf ); - - /** - * access to the output result - candidates only - * without the header or trailer words - */ - const std::list< unsigned int >& getLvl2OutputCandidates() const { return m_ptCombinedFiFo; } - /** - * access to the output result - * return The Lvl2 Output Data to the RoIB - */ - const std::list< unsigned int >& getLvl2OutputData() const { return m_lvl2OutputData; } - /** - * This is the main action interface of the MirodLvl2Processor, - * gets a link to the data output of the MirodExtractor. Calling - * this method fills the STL list which holds the output of the - * Lvl2Processor in the format used in the hardware, e.g. a - * stream of 32-bit words - * @see MirodModule - * @see MirodExtractor - * @see MirodLvl2Processor - * @param theExtractorData Pointer to the data output of the - * Mirod Extractor - */ - void processData( const MirodExtractor* theExtractorData ); - /** - * This method prints the Event in DaqOutput format to the - * screen. The parameter determines if the printout will be in - * binary, hexadecimal or human readable format. Consequently the - * choices are "hex", "bin", or "human" - * @param format Determines if the printout will be in - * binary or hexadecimal format. Choices are "hex", "bin", "human" - */ - void printEvent( std::string format ) const; - /** - * function to return a string representing the information - * contained in one sector word of the Extractor format - * in human readable form - * @param sectorWord reference to a sector word represented by - * 32 - bit Extractor format - * @return A string to be used for output the information of - * this sector - */ - std::string printSector( const unsigned int& sectorWord ) const; - - private: - mutable MsgLogger m_logger; - - std::list< unsigned int > m_lvl2OutputData; - - /// Buckets used for sorting the candidates by pT - std::vector< std::vector< unsigned int > > m_ptSorterBuckets; - - std::list< unsigned int > m_ptCombinedFiFo; - - // configuration parameters - unsigned int m_maxCandPerPtvalue; - unsigned int m_maxCandSendToRoib; - unsigned int m_candBcidOffset; - - }; // class MirodLvl2Processor - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIRODLVL2PROCESSOR_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.cxx deleted file mode 100644 index d057a81aeb2284d08c2f071eef3a67767c124fc8..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.cxx +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodModule.cxx 439303 2011-05-25 15:20:17Z krasznaa $ - -// Local include(s): -#include "MirodModule.h" -#include "../Mibak/MibakStreamEvent.h" -#include "../Common/Configuration.h" - -/******************************************************************* - * $Date: 2011-05-25 17:20:17 +0200 (Wed, 25 May 2011) $ - * - * Implementation of class MirodModule - * @author $Author: krasznaa $ - * @version $Revision: 439303 $ - ******************************************************************/ - -namespace LVL1MUCTPI { - - // constructor - MirodModule::MirodModule() - : m_logger( "MirodModule" ) { - - REPORT_VERBOSE_MSG( "constuctor called" ); - } - - void MirodModule::processData( const MibakStreamEvent* theStream ) { - - REPORT_VERBOSE_MSG( "Mirod module processing data" ); - - m_mirodReader.readData( theStream ); - m_mirodReader.printEvent( "human" ); - m_mirodExtractor.processData( this->getMirodEventReader() ); - m_mirodExtractor.printEvent( "human" ); - m_mirodDaqProcessor.processData( this->getMirodExtractor() ); - m_mirodDaqProcessor.printEvent( "human" ); - m_mirodLvl2Processor.processData( this->getMirodExtractor() ); - m_mirodLvl2Processor.printEvent( "human" ); - - return; - } - - void MirodModule::setConfiguration( const Configuration& conf ) { - - REPORT_VERBOSE_MSG( "Configuring Extractor and LVL2 processor" ); - - // configure Extractor - m_mirodExtractor.setConfiguration( conf ); - - // configure L2Processor - m_mirodLvl2Processor.setConfiguration( conf ); - - return; - } - -} // namespace LVL1MUCTPI diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.h deleted file mode 100644 index 7c236c2022227d2d35e968ea903c3f96544bdd64..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.h +++ /dev/null @@ -1,123 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodModule.h 726107 2016-02-25 11:04:42Z wengler $ -#ifndef TRIGT1MUCTPI_MIRODMODULE_H -#define TRIGT1MUCTPI_MIRODMODULE_H - -// STL include(s): -#include <list> - -// Local include(s): -#include "../Logging/MsgLogger.h" -#include "MirodEventReader.h" -#include "MirodExtractor.h" -#include "MirodDaqProcessor.h" -#include "MirodLvl2Processor.h" - -namespace LVL1MUCTPI { - - // Forward declaration(s): - class Configuration; - class MibakStreamEvent; - - /** - * @short Contains all relevant entities of the MIROD board - * - * The MirodModule class groups together all relevant - * entities for the Read Out Driver board of the - * MUCTPI (MIROD). It provides services to extract data - * at several stages of the processing in the board, - * corresponding to equivalent access point on the - * the actual hardware. Only one board exists in the - * system. As for the MioctModules, this Module is - * instantiated in the constructor of the Lvl1Mibak - * class - * - * @see Lvl1Mibak - * @see MioctModule - * @see MictpModule - * - * @author Thorsten Wengler - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 726107 $ - * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $ - */ - class MirodModule { - - public: - /** - * The constructor of MirodModule - */ - MirodModule(); - - /// set Configuration - void setConfiguration( const Configuration &conf ); - - /** - * Method to set the source of data for the input stream coming - * from the MIBAK - * @see MibakStreamEvent - * @param theStream Pointer to the input data stream - * object holding the data to be read by the MIROD - */ - void processData( const MibakStreamEvent* theStream ); - /** - * This method returns a pointer to the MirodEventReader - * @return Pointer to the MirodEventReader - * which is part of the MirodModule - */ - const MirodEventReader* getMirodEventReader() const { return &m_mirodReader; } - /** - * This method returns a pointer to the MirodExtractor - * @return Pointer to the MirodExtractor - * which is part of the MirodModule - */ - const MirodExtractor* getMirodExtractor() const { return &m_mirodExtractor; } - /** - * This method returns a pointer to the MirodLvl2Processor - * @return Pointer to the MirodLvl2Processor - * which is part of the MirodModule - */ - const MirodLvl2Processor* getMirodLvl2Processor() const { return &m_mirodLvl2Processor; } - /** - * This method returns a reference to the list of unsigned ints holding - * the output of the Mirod to the RoIB (Level2), candidates only, wihtout header or trailer words - * @return The LVL2 output candidates - */ - const std::list< unsigned int >& getLvl2Candidates() const { return m_mirodLvl2Processor.getLvl2OutputCandidates(); } - /** - * This method returns a reference to the list of unsigned ints holding - * the output of the Mirod to the RoIB (Level2) - * @return The LVL2 output - */ - const std::list< unsigned int >& getLvl2Output() const { return m_mirodLvl2Processor.getLvl2OutputData(); } - /** - * This method returns a pointer to the MirodDaqProcessor - * @return Pointer to the MirodDaqProcessor - * which is part of the MirodModule - */ - const MirodDaqProcessor* getMirodDaqProcessor() const { return &m_mirodDaqProcessor; } - /** - * This method reyrn a reference to the list of unsigned ints holding - * the output of the Mirod to the ROB (DAQ) - * @return The DAQ output - */ - const std::list< unsigned int >& getDaqOutput() const { return m_mirodDaqProcessor.getDaqOutputData(); } - - private: - mutable MsgLogger m_logger; - MirodEventReader m_mirodReader; - MirodExtractor m_mirodExtractor; - MirodDaqProcessor m_mirodDaqProcessor; - MirodLvl2Processor m_mirodLvl2Processor; - - }; // class MirodModule - -} // namespace LVL1MUCTPI - -#endif // TRIGT1MUCTPI_MIRODMODULE_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.cxx deleted file mode 100644 index d3a6c952bf5acf6e3793527b243753c6bb16c019..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.cxx +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodTestRamIn.cxx 362102 2011-04-28 13:17:28Z krasznaa $ - -// Local include(s): -#include "MirodTestRamIn.h" - -/******************************************************************* - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * Implementation of class MirodTestRamIn - * @author Author: Thorsten Wengler - * @version $Revision: 362102 $ - ******************************************************************/ - -// constructor of class MirodTestRamIn -MirodTestRamIn::MirodTestRamIn() { - -} - diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.h deleted file mode 100644 index d0750a2fb299235faf78ed8670e8e3e298767990..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.h +++ /dev/null @@ -1,65 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: MirodTestRamIn.h 362102 2011-04-28 13:17:28Z krasznaa $ -#ifndef TRIGT1MUCTPI_MIRODTESTRAMIN_H -#define TRIGT1MUCTPI_MIRODTESTRAMIN_H - -// STL include(s): -#include <list> - -/** - ******************************************************************* - * - * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ - * - * @short Input for the Mirod Test Ram - * - * MirodTestRamIn is a helper class holding the - * needed to load the Mirod test ram - * - * @author Thorsten Wengler - * @version $Revision: 362102 $ - * - ******************************************************************* - */ -class MirodTestRamIn { - - public: - /** - * The constructor of MirodTestRamIn - */ - MirodTestRamIn(); - /** - * get or set the DataLow list - */ - void dataLow( std::list< unsigned int > dataLow ) { m_mirodTestDataLow = dataLow; } - const std::list< unsigned int >& dataLow() { return m_mirodTestDataLow; } - /** - * get or set the DataHigh list - */ - void dataHigh( std::list< unsigned int > dataHigh ) { m_mirodTestDataHigh = dataHigh; } - const std::list< unsigned int >& dataHigh() { return m_mirodTestDataHigh; } - /** - * get or set the DataControl list - */ - void dataControl (std::list< unsigned int > dataControl ) { m_mirodTestControl = dataControl; } - const std::list< unsigned int >& dataControl() { return m_mirodTestControl; } - - /** - * The destructor of MirodTestRamIn - */ - ~MirodTestRamIn() = default; - - private: - - std::list< unsigned int > m_mirodTestDataLow; - std::list< unsigned int > m_mirodTestDataHigh; - std::list< unsigned int > m_mirodTestControl; - -}; // class MirodTestRamIn - -#endif // TRIGT1MUCTPI_MIRODTESTRAMIN_H diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/components/TrigT1Muctpi_entries.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/components/TrigT1Muctpi_entries.cxx deleted file mode 100644 index 2b2ef208179289354303bcff5537e0b2c7751e35..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/src/components/TrigT1Muctpi_entries.cxx +++ /dev/null @@ -1,11 +0,0 @@ -#include "../Algorithms/L1Muctpi.h" -#include "../Algorithms/L1MuctpiPatGen.h" -#include "../Algorithms/L1MuctpiTestReadResults.h" -#include "../Algorithms/L1MuctpiTool.h" - -DECLARE_COMPONENT( LVL1MUCTPI::L1Muctpi ) -DECLARE_COMPONENT( LVL1MUCTPI::L1MuctpiPatGen ) -DECLARE_COMPONENT( LVL1MUCTPI::L1MuctpiTestReadResults ) - -DECLARE_COMPONENT( LVL1MUCTPI::L1MuctpiTool ) -