ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
FPGATrackSimMappingSvc Class Reference

#include <FPGATrackSimMappingSvc.h>

Inheritance diagram for FPGATrackSimMappingSvc:
Collaboration diagram for FPGATrackSimMappingSvc:

Public Member Functions

 FPGATrackSimMappingSvc (const std::string &name, ISvcLocator *svc)
 
virtual ~FPGATrackSimMappingSvc ()=default
 
virtual StatusCode initialize () override
 
virtual const FPGATrackSimPlaneMapPlaneMap_1st () const override
 
virtual const FPGATrackSimPlaneMapPlaneMap_2nd () const override
 
virtual const FPGATrackSimRegionMapRegionMap_1st () const override
 
virtual const FPGATrackSimRegionMapRegionMap_2nd () const override
 
virtual const FPGATrackSimRegionMapSubRegionMap () const override
 
virtual const FPGATrackSimNNMapNNMap () const override
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvIf) override
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
 DeclareInterfaceID (IFPGATrackSimMappingSvc, 1, 0)
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Private Member Functions

StatusCode checkInputs ()
 
StatusCode checkAllocs ()
 

Private Attributes

ServiceHandle< IFPGATrackSimEventSelectionSvcm_EvtSel
 
Gaudi::Property< std::string > m_mappingType {this, "mappingType", "FILE", "for now should be FILE only, DB for the future"}
 
Gaudi::Property< std::string > m_rmap_path {this, "rmap", "", "path of the region-map file"}
 
Gaudi::Property< std::string > m_subrmap_path {this, "subrmap", "", "path of the region-map file for subregions"}
 
Gaudi::Property< std::string > m_pmap_path {this, "pmap", "", "path of the PMAP file"}
 
Gaudi::Property< std::string > m_modulelut_path {this, "modulemap", "", "path of the ModuleLUT file"}
 
Gaudi::Property< std::string > m_NNmap_path {this, "NNmap", "", "path of the NN weighting file"}
 
Gaudi::Property< std::string > m_radii_path {this, "radiiFile", "", "path of the average radius file" }
 
Gaudi::Property< std::vector< int > > m_layerOverrides {this, "layerOverride", {}, "Overrides the selection of the 1st stage logical layers in the plane map. Each entry declares a detector layer to use as a logical layer. Specify a detector layer with { SiliconTech * 1000 + DetectorZone * 100 + PhysicalLayer }"}
 
std::unique_ptr< FPGATrackSimPlaneMapm_pmap_1st = nullptr
 
std::unique_ptr< FPGATrackSimPlaneMapm_pmap_2nd = nullptr
 
std::unique_ptr< FPGATrackSimRegionMapm_rmap_1st = nullptr
 
std::unique_ptr< FPGATrackSimRegionMapm_rmap_2nd = nullptr
 
std::unique_ptr< FPGATrackSimRegionMapm_subrmap = nullptr
 
std::unique_ptr< FPGATrackSimNNMapm_NNmap = nullptr
 

Detailed Description

Definition at line 16 of file FPGATrackSimMappingSvc.h.

Constructor & Destructor Documentation

◆ FPGATrackSimMappingSvc()

FPGATrackSimMappingSvc::FPGATrackSimMappingSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Definition at line 7 of file FPGATrackSimMappingSvc.cxx.

7  :
9  m_EvtSel("FPGATrackSimEventSelectionSvc", name)
10 {
11 }

◆ ~FPGATrackSimMappingSvc()

virtual FPGATrackSimMappingSvc::~FPGATrackSimMappingSvc ( )
virtualdefault

Member Function Documentation

◆ checkAllocs()

StatusCode FPGATrackSimMappingSvc::checkAllocs ( )
private

Definition at line 43 of file FPGATrackSimMappingSvc.cxx.

44 {
45  if (!m_pmap_1st)
46  ATH_MSG_FATAL("Error using 1st stage plane map: " << m_pmap_path);
47  if (!m_pmap_2nd)
48  ATH_MSG_FATAL("Error using 2nd stage plane map: " << m_pmap_path);
49  if (!m_rmap_1st)
50  ATH_MSG_FATAL("Error creating region map for 1st stage from: " << m_rmap_path);
51  if (!m_rmap_2nd)
52  ATH_MSG_FATAL("Error creating region map for 2nd stage from: " << m_rmap_path);
53  if (!m_subrmap)
54  ATH_MSG_FATAL("Error creating sub-region map from: " << m_subrmap_path);
55 
56  return StatusCode::SUCCESS;
57 }

◆ checkInputs()

StatusCode FPGATrackSimMappingSvc::checkInputs ( )
private

Definition at line 28 of file FPGATrackSimMappingSvc.cxx.

29 {
30  if (m_pmap_path.value().empty())
31  ATH_MSG_FATAL("Main plane map definition missing");
32  else if (m_rmap_path.value().empty())
33  ATH_MSG_FATAL("Missing region map path");
34  else if (m_modulelut_path.value().empty())
35  ATH_MSG_FATAL("Module LUT file is missing");
36  else
37  return StatusCode::SUCCESS;
38 
39  return StatusCode::FAILURE;
40 }

◆ DeclareInterfaceID()

IFPGATrackSimMappingSvc::DeclareInterfaceID ( IFPGATrackSimMappingSvc  ,
,
 
)
inherited

◆ initialize()

StatusCode FPGATrackSimMappingSvc::initialize ( )
overridevirtual

Definition at line 60 of file FPGATrackSimMappingSvc.cxx.

61 {
62  ATH_CHECK(m_EvtSel.retrieve());
64 
65  if (m_mappingType.value() == "FILE")
66  {
67  ATH_MSG_DEBUG("Creating the 1st stage plane map");
68  m_pmap_1st = std::unique_ptr<FPGATrackSimPlaneMap>(new FPGATrackSimPlaneMap(PathResolverFindCalibFile(m_pmap_path.value()), m_EvtSel->getRegionID(), 1, m_layerOverrides));
69 
70  ATH_MSG_DEBUG("Creating the 2nd stage plane map");
71  m_pmap_2nd = std::unique_ptr<FPGATrackSimPlaneMap>(new FPGATrackSimPlaneMap(PathResolverFindCalibFile(m_pmap_path.value()), m_EvtSel->getRegionID(), 2));
72 
73  ATH_MSG_DEBUG("Creating the 1st stage region map");
74  m_rmap_1st = std::unique_ptr<FPGATrackSimRegionMap>(new FPGATrackSimRegionMap(m_pmap_1st.get(), PathResolverFindCalibFile(m_rmap_path.value())));
75 
76  ATH_MSG_DEBUG("Creating the 2nd stage region map");
77  m_rmap_2nd = std::unique_ptr<FPGATrackSimRegionMap>(new FPGATrackSimRegionMap(m_pmap_2nd.get(), PathResolverFindCalibFile(m_rmap_path.value())));
78 
79  ATH_MSG_DEBUG("Creating the sub-region map");
80  m_subrmap = std::unique_ptr<FPGATrackSimRegionMap>(new FPGATrackSimRegionMap(m_pmap_1st.get(), PathResolverFindCalibFile(m_subrmap_path.value())));
81 
82  ATH_MSG_DEBUG("Setting the Modules LUT for Region Maps");
83  m_rmap_1st->loadModuleIDLUT(PathResolverFindCalibFile(m_modulelut_path.value()));
84  m_rmap_2nd->loadModuleIDLUT(PathResolverFindCalibFile(m_modulelut_path.value()));
85 
86  // We probably need two versions of this path for the second stage.
87  ATH_MSG_DEBUG("Setting the average radius per logical layer for Region and Subregion Maps");
88  m_rmap_1st->loadRadiiFile(PathResolverFindCalibFile(m_radii_path.value()));
89  m_subrmap->loadRadiiFile(PathResolverFindCalibFile(m_radii_path.value()));
90 
91  ATH_MSG_DEBUG("Creating NN weighting map");
92  if ( ! m_NNmap_path.empty() ) {
93  m_NNmap = std::make_unique<FPGATrackSimNNMap>(PathResolverFindCalibFile(m_NNmap_path.value()));
94  } else {
95  m_NNmap = nullptr;
96  }
97  }
98 
100 
101  return StatusCode::SUCCESS;
102 }

◆ interfaceID()

const InterfaceID & FPGATrackSimMappingSvc::interfaceID ( )
inlinestatic

Definition at line 64 of file FPGATrackSimMappingSvc.h.

65 {
66  static const InterfaceID IID_FPGATrackSimMappingSvc("FPGATrackSimMappingSvc", 1, 0);
67  return IID_FPGATrackSimMappingSvc;
68 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ NNMap()

virtual const FPGATrackSimNNMap* FPGATrackSimMappingSvc::NNMap ( ) const
inlineoverridevirtual

Implements IFPGATrackSimMappingSvc.

Definition at line 30 of file FPGATrackSimMappingSvc.h.

30 { return m_NNmap.get(); }

◆ PlaneMap_1st()

virtual const FPGATrackSimPlaneMap* FPGATrackSimMappingSvc::PlaneMap_1st ( ) const
inlineoverridevirtual

Implements IFPGATrackSimMappingSvc.

Definition at line 25 of file FPGATrackSimMappingSvc.h.

25 { return m_pmap_1st.get(); }

◆ PlaneMap_2nd()

virtual const FPGATrackSimPlaneMap* FPGATrackSimMappingSvc::PlaneMap_2nd ( ) const
inlineoverridevirtual

Implements IFPGATrackSimMappingSvc.

Definition at line 26 of file FPGATrackSimMappingSvc.h.

26 { return m_pmap_2nd.get(); }

◆ queryInterface()

StatusCode FPGATrackSimMappingSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvIf 
)
overridevirtual

Definition at line 14 of file FPGATrackSimMappingSvc.cxx.

15 {
16  if (interfaceID() == riid)
17  *ppvIf = dynamic_cast< FPGATrackSimMappingSvc* > (this);
18  else if (IFPGATrackSimMappingSvc::interfaceID() == riid)
19  *ppvIf = dynamic_cast<IFPGATrackSimMappingSvc*> (this);
20  else
21  return AthService::queryInterface(riid, ppvIf);
22 
23  addRef();
24  return StatusCode::SUCCESS;
25 }

◆ RegionMap_1st()

virtual const FPGATrackSimRegionMap* FPGATrackSimMappingSvc::RegionMap_1st ( ) const
inlineoverridevirtual

Implements IFPGATrackSimMappingSvc.

Definition at line 27 of file FPGATrackSimMappingSvc.h.

27 { return m_rmap_1st.get(); }

◆ RegionMap_2nd()

virtual const FPGATrackSimRegionMap* FPGATrackSimMappingSvc::RegionMap_2nd ( ) const
inlineoverridevirtual

Implements IFPGATrackSimMappingSvc.

Definition at line 28 of file FPGATrackSimMappingSvc.h.

28 { return m_rmap_2nd.get(); }

◆ SubRegionMap()

virtual const FPGATrackSimRegionMap* FPGATrackSimMappingSvc::SubRegionMap ( ) const
inlineoverridevirtual

Implements IFPGATrackSimMappingSvc.

Definition at line 29 of file FPGATrackSimMappingSvc.h.

29 { return m_subrmap.get(); }

Member Data Documentation

◆ m_EvtSel

ServiceHandle<IFPGATrackSimEventSelectionSvc> FPGATrackSimMappingSvc::m_EvtSel
private

Definition at line 38 of file FPGATrackSimMappingSvc.h.

◆ m_layerOverrides

Gaudi::Property<std::vector <int> > FPGATrackSimMappingSvc::m_layerOverrides {this, "layerOverride", {}, "Overrides the selection of the 1st stage logical layers in the plane map. Each entry declares a detector layer to use as a logical layer. Specify a detector layer with { SiliconTech * 1000 + DetectorZone * 100 + PhysicalLayer }"}
private

Definition at line 49 of file FPGATrackSimMappingSvc.h.

◆ m_mappingType

Gaudi::Property<std::string> FPGATrackSimMappingSvc::m_mappingType {this, "mappingType", "FILE", "for now should be FILE only, DB for the future"}
private

Definition at line 42 of file FPGATrackSimMappingSvc.h.

◆ m_modulelut_path

Gaudi::Property<std::string> FPGATrackSimMappingSvc::m_modulelut_path {this, "modulemap", "", "path of the ModuleLUT file"}
private

Definition at line 46 of file FPGATrackSimMappingSvc.h.

◆ m_NNmap

std::unique_ptr<FPGATrackSimNNMap> FPGATrackSimMappingSvc::m_NNmap = nullptr
private

Definition at line 57 of file FPGATrackSimMappingSvc.h.

◆ m_NNmap_path

Gaudi::Property<std::string> FPGATrackSimMappingSvc::m_NNmap_path {this, "NNmap", "", "path of the NN weighting file"}
private

Definition at line 47 of file FPGATrackSimMappingSvc.h.

◆ m_pmap_1st

std::unique_ptr<FPGATrackSimPlaneMap> FPGATrackSimMappingSvc::m_pmap_1st = nullptr
private

Definition at line 52 of file FPGATrackSimMappingSvc.h.

◆ m_pmap_2nd

std::unique_ptr<FPGATrackSimPlaneMap> FPGATrackSimMappingSvc::m_pmap_2nd = nullptr
private

Definition at line 53 of file FPGATrackSimMappingSvc.h.

◆ m_pmap_path

Gaudi::Property<std::string> FPGATrackSimMappingSvc::m_pmap_path {this, "pmap", "", "path of the PMAP file"}
private

Definition at line 45 of file FPGATrackSimMappingSvc.h.

◆ m_radii_path

Gaudi::Property<std::string> FPGATrackSimMappingSvc::m_radii_path {this, "radiiFile", "", "path of the average radius file" }
private

Definition at line 48 of file FPGATrackSimMappingSvc.h.

◆ m_rmap_1st

std::unique_ptr<FPGATrackSimRegionMap> FPGATrackSimMappingSvc::m_rmap_1st = nullptr
private

Definition at line 54 of file FPGATrackSimMappingSvc.h.

◆ m_rmap_2nd

std::unique_ptr<FPGATrackSimRegionMap> FPGATrackSimMappingSvc::m_rmap_2nd = nullptr
private

Definition at line 55 of file FPGATrackSimMappingSvc.h.

◆ m_rmap_path

Gaudi::Property<std::string> FPGATrackSimMappingSvc::m_rmap_path {this, "rmap", "", "path of the region-map file"}
private

Definition at line 43 of file FPGATrackSimMappingSvc.h.

◆ m_subrmap

std::unique_ptr<FPGATrackSimRegionMap> FPGATrackSimMappingSvc::m_subrmap = nullptr
private

Definition at line 56 of file FPGATrackSimMappingSvc.h.

◆ m_subrmap_path

Gaudi::Property<std::string> FPGATrackSimMappingSvc::m_subrmap_path {this, "subrmap", "", "path of the region-map file for subregions"}
private

Definition at line 44 of file FPGATrackSimMappingSvc.h.


The documentation for this class was generated from the following files:
AthService::AthService
AthService()
FPGATrackSimMappingSvc::m_rmap_2nd
std::unique_ptr< FPGATrackSimRegionMap > m_rmap_2nd
Definition: FPGATrackSimMappingSvc.h:55
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
FPGATrackSimMappingSvc::m_pmap_1st
std::unique_ptr< FPGATrackSimPlaneMap > m_pmap_1st
Definition: FPGATrackSimMappingSvc.h:52
FPGATrackSimMappingSvc::m_pmap_2nd
std::unique_ptr< FPGATrackSimPlaneMap > m_pmap_2nd
Definition: FPGATrackSimMappingSvc.h:53
FPGATrackSimMappingSvc::m_NNmap
std::unique_ptr< FPGATrackSimNNMap > m_NNmap
Definition: FPGATrackSimMappingSvc.h:57
FPGATrackSimMappingSvc::m_radii_path
Gaudi::Property< std::string > m_radii_path
Definition: FPGATrackSimMappingSvc.h:48
FPGATrackSimMappingSvc::checkAllocs
StatusCode checkAllocs()
Definition: FPGATrackSimMappingSvc.cxx:43
FPGATrackSimMappingSvc::m_rmap_1st
std::unique_ptr< FPGATrackSimRegionMap > m_rmap_1st
Definition: FPGATrackSimMappingSvc.h:54
IFPGATrackSimMappingSvc
Definition: IFPGATrackSimMappingSvc.h:17
FPGATrackSimMappingSvc
Definition: FPGATrackSimMappingSvc.h:17
FPGATrackSimMappingSvc::m_layerOverrides
Gaudi::Property< std::vector< int > > m_layerOverrides
Definition: FPGATrackSimMappingSvc.h:49
FPGATrackSimMappingSvc::m_pmap_path
Gaudi::Property< std::string > m_pmap_path
Definition: FPGATrackSimMappingSvc.h:45
FPGATrackSimMappingSvc::m_EvtSel
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
Definition: FPGATrackSimMappingSvc.h:38
FPGATrackSimMappingSvc::m_modulelut_path
Gaudi::Property< std::string > m_modulelut_path
Definition: FPGATrackSimMappingSvc.h:46
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FPGATrackSimMappingSvc::m_NNmap_path
Gaudi::Property< std::string > m_NNmap_path
Definition: FPGATrackSimMappingSvc.h:47
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
FPGATrackSimPlaneMap
Definition: FPGATrackSimPlaneMap.h:62
FPGATrackSimMappingSvc::m_rmap_path
Gaudi::Property< std::string > m_rmap_path
Definition: FPGATrackSimMappingSvc.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
FPGATrackSimMappingSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: FPGATrackSimMappingSvc.h:64
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
FPGATrackSimMappingSvc::m_mappingType
Gaudi::Property< std::string > m_mappingType
Definition: FPGATrackSimMappingSvc.h:42
FPGATrackSimMappingSvc::m_subrmap_path
Gaudi::Property< std::string > m_subrmap_path
Definition: FPGATrackSimMappingSvc.h:44
FPGATrackSimMappingSvc::m_subrmap
std::unique_ptr< FPGATrackSimRegionMap > m_subrmap
Definition: FPGATrackSimMappingSvc.h:56
FPGATrackSimMappingSvc::checkInputs
StatusCode checkInputs()
Definition: FPGATrackSimMappingSvc.cxx:28
FPGATrackSimRegionMap
Definition: FPGATrackSimRegionMap.h:62