ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSpectrometer
MuonSimEvent
MuonSimEvent
MM_SimIdToOfflineId.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 MM_SIMIDTOOFFLINEID_H
6
#define MM_SIMIDTOOFFLINEID_H
7
8
#include "
MuonSimEvent/MicromegasHitIdHelper.h
"
9
#include "
MuonIdHelpers/MmIdHelper.h
"
10
#include "Identifier/Identifier.h"
11
12
struct
MM_SimIdToOfflineId
{
13
14
MM_SimIdToOfflineId
(
const
MmIdHelper
* idHelper ) :
m_idHelper
(idHelper),
m_simIdHelper
(
MicromegasHitIdHelper
::GetHelper()) {}
15
16
inline
Identifier
convert
(
int
simId )
const
;
17
inline
int
convert
(
const
Identifier
&
id
)
const
;
18
19
const
MmIdHelper
*
m_idHelper
;
20
const
MicromegasHitIdHelper
*
m_simIdHelper
;
21
};
22
23
24
Identifier
MM_SimIdToOfflineId::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[2] ==
'L'
?
"MML"
:
"MMS"
,
32
side == 1 ? stationEta+1 : -stationEta-1,
33
(stationPhi-1)/2+1,multilayer,layer,1 );
34
}
35
36
37
inline
int
MM_SimIdToOfflineId::convert
(
const
Identifier
&
id
)
const
38
{
39
int
stationEta=
m_idHelper
->stationEta(
id
);
40
int
side(stationEta>0 ? 1 : -1);
41
stationEta = abs(stationEta) - 1;
42
bool
isSmall(
m_idHelper
->isSmall(
id
));
43
int
phi
=2*
m_idHelper
->stationPhi(
id
) -
static_cast<
int
>
(!isSmall);
44
int
ml=
m_idHelper
->multilayer(
id
);
45
int
ly=
m_idHelper
->gasGap(
id
);
46
std::ostringstream stationName;
47
stationName<<
"M"
<<stationEta<<(isSmall ?
"S"
:
"L"
)<<ml;
48
return
m_simIdHelper
->BuildMicromegasHitId(stationName.str(),
phi
, stationEta, ml, ly, side);
49
}
50
51
52
#endif
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
MicromegasHitIdHelper.h
MmIdHelper.h
MicromegasHitIdHelper
Definition
MicromegasHitIdHelper.h:13
MmIdHelper
Definition
MmIdHelper.h:54
Identifier
Definition
IdentifierFieldParser.cxx:14
MM_SimIdToOfflineId::m_simIdHelper
const MicromegasHitIdHelper * m_simIdHelper
Definition
MM_SimIdToOfflineId.h:20
MM_SimIdToOfflineId::convert
Identifier convert(int simId) const
Definition
MM_SimIdToOfflineId.h:24
MM_SimIdToOfflineId::MM_SimIdToOfflineId
MM_SimIdToOfflineId(const MmIdHelper *idHelper)
Definition
MM_SimIdToOfflineId.h:14
MM_SimIdToOfflineId::m_idHelper
const MmIdHelper * m_idHelper
Definition
MM_SimIdToOfflineId.h:19
Generated on
for ATLAS Offline Software by
1.14.0