ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonSimEvent
MuonSimEvent
sTgcSimIdToOfflineId.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef sTgcSIMIDTOOFFLINEID_H
6
#define sTgcSIMIDTOOFFLINEID_H
7
8
#include "
MuonSimEvent/sTgcHitIdHelper.h
"
9
#include "
MuonIdHelpers/sTgcIdHelper.h
"
10
#include "Identifier/Identifier.h"
11
12
struct
sTgcSimIdToOfflineId
{
13
14
sTgcSimIdToOfflineId
(
const
sTgcIdHelper
* idHelper ) :
m_idHelper
(idHelper),
m_simIdHelper
(
sTgcHitIdHelper
::GetHelper()) {}
15
16
inline
Identifier
convert
(
int
simId )
const
;
17
inline
int
convert
(
const
Identifier
&
id
)
const
;
18
19
const
sTgcIdHelper
*
m_idHelper
;
20
const
sTgcHitIdHelper
*
m_simIdHelper
;
21
};
22
23
24
Identifier
sTgcSimIdToOfflineId::convert
(
int
simId )
const
{
25
std::string stationName =
m_simIdHelper
->GetStationName(simId);
26
int
stationEta =
m_simIdHelper
->GetZSector(simId);
27
int
stationPhi =
m_simIdHelper
->GetPhiSector(simId);
28
int
multilayer =
m_simIdHelper
->GetMultiLayer(simId);
29
int
layer =
m_simIdHelper
->GetLayer(simId);
30
int
side =
m_simIdHelper
->GetSide(simId);
31
return
m_idHelper
->channelID( stationName[1] ==
'L'
?
"STL"
:
"STS"
,
32
side == 1 ? stationEta+1 : -stationEta-1,
33
(stationPhi-1)/2+1,multilayer,layer,
sTgcIdHelper::sTgcChannelTypes::Wire
,1 );
34
}
35
36
inline
int
sTgcSimIdToOfflineId::convert
(
const
Identifier
&
id
)
const
37
{
38
int
stationEta=
m_idHelper
->stationEta(
id
);
39
int
side(stationEta>0 ? 1 : -1);
40
stationEta = abs(stationEta) - 1;
41
bool
isSmall(
m_idHelper
->isSmall(
id
));
42
int
phi
=2*
m_idHelper
->stationPhi(
id
) -
static_cast<
int
>
(!isSmall);
43
int
ml=
m_idHelper
->multilayer(
id
);
44
std::string quadType =
"P"
;
// is either "P"=Pivot or "C"=Confirm
45
if
(isSmall && (ml == 1)) quadType =
"C"
;
46
if
(!isSmall && (ml == 2)) quadType =
"C"
;
47
int
ly=
m_idHelper
->gasGap(
id
);
48
std::ostringstream stationName;
49
stationName <<
"Q"
<< (isSmall ?
"S"
:
"L"
) << stationEta << quadType;
50
return
m_simIdHelper
->BuildsTgcHitId(stationName.str(),
phi
, stationEta, ml, ly, side);
51
}
52
53
#endif
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
sTgcHitIdHelper
Definition
sTgcHitIdHelper.h:13
sTgcIdHelper
Definition
sTgcIdHelper.h:55
sTgcIdHelper::Wire
@ Wire
Definition
sTgcIdHelper.h:190
Identifier
Definition
IdentifierFieldParser.cxx:14
sTgcHitIdHelper.h
sTgcIdHelper.h
sTgcSimIdToOfflineId::m_simIdHelper
const sTgcHitIdHelper * m_simIdHelper
Definition
sTgcSimIdToOfflineId.h:20
sTgcSimIdToOfflineId::sTgcSimIdToOfflineId
sTgcSimIdToOfflineId(const sTgcIdHelper *idHelper)
Definition
sTgcSimIdToOfflineId.h:14
sTgcSimIdToOfflineId::convert
Identifier convert(int simId) const
Definition
sTgcSimIdToOfflineId.h:24
sTgcSimIdToOfflineId::m_idHelper
const sTgcIdHelper * m_idHelper
Definition
sTgcSimIdToOfflineId.h:19
Generated on
for ATLAS Offline Software by
1.17.0