ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
EFTracking
FPGATrackSim
FPGATrackSimMaps
src
FPGATrackSimModuleRelabel.cxx
Go to the documentation of this file.
1
// Copyright (C) 2023-2025 CERN for the benefit of the ATLAS collaboration
2
3
4
#include "
FPGATrackSimMaps/FPGATrackSimModuleRelabel.h
"
5
#include "
FPGATrackSimObjects/FPGATrackSimHit.h
"
6
7
using namespace
std
;
8
using namespace
htt
;
9
10
FPGATrackSimModuleRelabel::FPGATrackSimModuleRelabel
(
const
std::string & geokey,
bool
remapModules) :
11
AthMessaging
(
"FPGATrackSimModuleRelabel"
),
12
m_geoKey
(geokey),
13
m_remapModules
(remapModules)
14
{
15
// Set up the ring index reference based on configured geokey.
16
if
(
htt::ringIndices
.
count
(
m_geoKey
) == 0) {
17
m_ringIndex
=
nullptr
;
18
ATH_MSG_ERROR
(
"Bad geometry version "
<<
m_geoKey
);
19
}
else
{
20
m_ringIndex
= &(
htt::ringIndices
.at(
m_geoKey
));
21
ATH_MSG_INFO
(
"Allocating map for geometry "
<<
m_geoKey
<<
" diskIndex size="
<<
m_ringIndex
->size());
22
}
23
}
24
25
bool
FPGATrackSimModuleRelabel::remap
(
FPGATrackSimHit
&
hit
)
const
{
26
27
if
(
hit
.isRemapped()){
28
return
false
;
29
}
30
// Quick sanity check, if we get here somehow without configuring a valid geokey.
31
if
(not
m_ringIndex
) {
32
ATH_MSG_ERROR
(
"No configured ring index relabel for geometry "
<<
m_geoKey
);
33
return
false
;
34
}
35
36
// Re-assign layers in the pixel endcap to be each individual disk
37
if
(
hit
.isPixel() && !
hit
.isBarrel()) {
38
if
(
hit
.getPhysLayer() <
m_ringIndex
->size()) {
39
unsigned
newlayer =
hit
.getEtaModule() + (*m_ringIndex)[
hit
.getPhysLayer()];
40
int
newmodule = 100*newlayer +
hit
.getEtaIndex() / 10;
41
42
hit
.setPhysLayer(newlayer);
43
if
(
m_remapModules
) {
44
hit
.setEtaModule(newmodule);
45
}
46
else
{
47
hit
.setEtaModule(
hit
.getEtaModule());
// allows us to save the old value
48
}
49
}
50
else
{
51
ATH_MSG_ERROR
(
"Error: requesting "
<<
hit
.getPhysLayer() <<
" element in m_ringIndex which is of size "
<<
m_ringIndex
->size());
52
return
false
;
53
}
54
}
55
else
{
// allows us to save the old value
56
hit
.setEtaModule(
hit
.getEtaModule());
57
hit
.setPhysLayer(
hit
.getPhysLayer());
58
}
59
60
hit
.setRemap();
61
return
true
;
62
}
63
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
FPGATrackSimHit.h
: FPGATrackSim-specific class to represent an hit in the detector.
FPGATrackSimModuleRelabel.h
hit
bool hit(const Container &ids, int pdgId)
Definition
JetIRCSafeLabelTool.cxx:64
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
FPGATrackSimHit
Definition
FPGATrackSimHit.h:42
FPGATrackSimModuleRelabel::remap
bool remap(FPGATrackSimHit &hit) const
Definition
FPGATrackSimModuleRelabel.cxx:25
FPGATrackSimModuleRelabel::m_remapModules
bool m_remapModules
Definition
FPGATrackSimModuleRelabel.h:45
FPGATrackSimModuleRelabel::m_ringIndex
const std::vector< uint > * m_ringIndex
Definition
FPGATrackSimModuleRelabel.h:49
FPGATrackSimModuleRelabel::FPGATrackSimModuleRelabel
FPGATrackSimModuleRelabel(const std::string &geokey, bool remapModules)
Definition
FPGATrackSimModuleRelabel.cxx:10
FPGATrackSimModuleRelabel::m_geoKey
std::string m_geoKey
Definition
FPGATrackSimModuleRelabel.h:42
count
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Definition
hcg.cxx:148
htt
Definition
FPGATrackSimModuleRelabel.h:22
htt::ringIndices
const std::map< const std::string, const std::vector< uint > > ringIndices
Definition
FPGATrackSimModuleRelabel.h:23
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0