Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas
athena
Commits
a2d30587
Commit
a2d30587
authored
Mar 08, 2017
by
Edward Moyse
Browse files
Muon MT migration
Many VarHandles added and a few other minor tweaks. Former-commit-id:
7e36282f
parent
e8d92d6c
Changes
18
Hide whitespace changes
Inline
Side-by-side
MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternFinderTool.h
View file @
a2d30587
...
...
@@ -87,7 +87,7 @@ namespace Muon {
private:
/** record patterncollection to storegate or deletes collection when m_recordAllOutput is false */
void
record
(
const
MuonPrdPatternCollection
*
patCol
,
std
::
string
location
)
const
;
void
record
(
const
MuonPrdPatternCollection
*
patCol
,
const
SG
::
WriteHandleKey
<
MuonPrdPatternCollection
>&
key
)
const
;
/** convert and add rpc preprawdata collection (1 chamber) */
...
...
@@ -207,6 +207,10 @@ namespace Muon {
TH1F
*
m_weighthistogramtgc
;
/** csc histogram */
TH1F
*
m_weighthistogramcsc
;
SG
::
WriteHandleKey
<
MuonPrdPatternCollection
>
m_CosmicPhiPatternsKey
;
SG
::
WriteHandleKey
<
MuonPrdPatternCollection
>
m_CosmicEtaPatternsKey
;
SG
::
WriteHandleKey
<
MuonPrdPatternCollection
>
m_COMBINED_PATTERNSKey
;
};
}
...
...
MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
View file @
a2d30587
...
...
@@ -32,7 +32,8 @@
#include "GaudiKernel/IIncidentListener.h"
#include "GeoPrimitives/GeoPrimitives.h"
#include "MuonDetDescrUtils/MuonSectorMapping.h"
#include "xAODTruth/TruthParticleContainer.h"
#include "xAODMuon/MuonSegmentContainer.h"
class
IIncidentSvc
;
...
...
@@ -51,6 +52,8 @@ namespace MuonHough {
class
HitDebugInfo
;
}
static
const
InterfaceID
IID_MuonLayerHoughTool
(
"Muon::MuonLayerHoughTool"
,
1
,
0
);
namespace
Muon
{
...
...
@@ -264,8 +267,9 @@ namespace Muon {
TTree
*
m_tree
;
mutable
MuonHough
::
HitNtuple
*
m_ntuple
;
std
::
vector
<
std
::
string
>
m_truthNames
;
mutable
std
::
vector
<
const
PRD_MultiTruthCollection
*
>
m_truthCollections
;
SG
::
ReadHandleKeyArray
<
PRD_MultiTruthCollection
>
m_truthNames
;
SG
::
ReadHandleKey
<
xAOD
::
TruthParticleContainer
>
m_MuonTruthParticlesKey
;
SG
::
ReadHandleKey
<
xAOD
::
MuonSegmentContainer
>
m_MuonTruthSegmentsKey
;
mutable
std
::
set
<
Identifier
>
m_truthHits
;
mutable
std
::
set
<
Identifier
>
m_foundTruthHits
;
...
...
MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternFinderTool.cxx
View file @
a2d30587
...
...
@@ -75,7 +75,10 @@ namespace Muon {
m_summary
(
false
),
m_recordAllOutput
(
false
),
m_cscAssoOutputLocation
(
"MuonPatCscSegAssMap"
),
m_phietahitassociation
(
0
)
m_phietahitassociation
(
0
),
m_CosmicPhiPatternsKey
(
"CosmicPhiPatterns"
),
m_CosmicEtaPatternsKey
(
"CosmicEtaPatterns"
),
m_COMBINED_PATTERNSKey
(
"COMBINED_PATTERNS"
)
{
declareInterface
<
IMuonHoughPatternFinderTool
>
(
this
);
...
...
@@ -96,10 +99,14 @@ namespace Muon {
declareProperty
(
"ShowerSkipping"
,
m_showerskip
);
declareProperty
(
"ShowerSkipPercentage"
,
m_showerskipperc
);
declareProperty
(
"PatCscSegAssMapOutputLocation"
,
m_cscAssoOutputLocation
);
declareProperty
(
"PatCscSegAssMapOutputLocation"
,
m_cscAssoOutputLocation
);
//Not used
declareProperty
(
"UseHistos"
,
m_use_histos
);
declareProperty
(
"DoSummary"
,
m_summary
);
declareProperty
(
"RecordAll"
,
m_recordAllOutput
);
declareProperty
(
"CosmicPhiKey"
,
m_CosmicPhiPatternsKey
);
declareProperty
(
"CosmicEtaPatterns"
,
m_CosmicEtaPatternsKey
);
declareProperty
(
"COMBINED_PATTERNS"
,
m_COMBINED_PATTERNSKey
);
}
MuonHoughPatternFinderTool
::~
MuonHoughPatternFinderTool
()
...
...
@@ -198,6 +205,15 @@ namespace Muon {
m_phietahitassociation
=
new
std
::
map
<
const
Trk
::
PrepRawData
*
,
std
::
set
<
const
Trk
::
PrepRawData
*
,
Muon
::
IdentifierPrdLess
>
>
;
if
(
!
m_recordAllOutput
){
//Nullify unused output
m_CosmicPhiPatternsKey
=
""
;
m_CosmicEtaPatternsKey
=
""
;
m_COMBINED_PATTERNSKey
=
""
;
}
ATH_CHECK
(
m_CosmicPhiPatternsKey
.
initialize
()
);
ATH_CHECK
(
m_CosmicEtaPatternsKey
.
initialize
()
);
ATH_CHECK
(
m_COMBINED_PATTERNSKey
.
initialize
()
);
ATH_MSG_VERBOSE
(
"End of Initializing"
);
return
StatusCode
::
SUCCESS
;
}
...
...
@@ -313,9 +329,9 @@ namespace Muon {
combinedpatterns
=
new
MuonPrdPatternCollection
();
}
record
(
phipatterns
,
"
CosmicPhiPatterns
"
);
record
(
etapatterns
,
"
CosmicEtaPatterns
"
);
record
(
combinedpatterns
,
"
COMBINED_PATTERNS
"
);
record
(
phipatterns
,
m_
CosmicPhiPatterns
Key
);
record
(
etapatterns
,
m_
CosmicEtaPatterns
Key
);
record
(
combinedpatterns
,
m_
COMBINED_PATTERNS
Key
);
if
(
patterncombinations
)
storeCscAssMap
(
patterncombinations
);
...
...
@@ -523,7 +539,7 @@ namespace Muon {
}
// getAllHits
void
MuonHoughPatternFinderTool
::
record
(
const
MuonPrdPatternCollection
*
patCol
,
std
::
string
location
)
const
{
void
MuonHoughPatternFinderTool
::
record
(
const
MuonPrdPatternCollection
*
patCol
,
const
SG
::
WriteHandleKey
<
MuonPrdPatternCollection
>
&
key
)
const
{
if
(
!
patCol
)
{
ATH_MSG_WARNING
(
"Zero pointer, could not save patterns!!! "
);
...
...
@@ -532,18 +548,19 @@ namespace Muon {
// check whether we are writing patterns to storegate, if not delete pattern
if
(
!
m_recordAllOutput
){
ATH_MSG_DEBUG
(
"Deleted patterns: "
<<
patCol
->
size
()
<<
" at "
<<
location
);
ATH_MSG_DEBUG
(
"Deleted patterns: "
<<
patCol
->
size
()
<<
" at "
<<
key
.
key
()
);
// since patCol Datavector, it owns (by defaults its elements)
delete
patCol
;
}
else
{
StatusCode
sc
=
evtStore
()
->
record
(
patCol
,
location
);
SG
::
WriteHandle
<
MuonPrdPatternCollection
>
handle
(
key
);
StatusCode
sc
=
handle
.
record
(
std
::
unique_ptr
<
MuonPrdPatternCollection
>
(
const_cast
<
MuonPrdPatternCollection
*>
(
patCol
)));
if
(
sc
.
isFailure
()
){
ATH_MSG_WARNING
(
"Could not save patterns at "
<<
location
);
ATH_MSG_WARNING
(
"Could not save patterns at "
<<
key
.
key
()
);
}
else
{
ATH_MSG_DEBUG
(
"Saved patterns: "
<<
patCol
->
size
()
<<
" at "
<<
location
);
ATH_MSG_DEBUG
(
"Saved patterns: "
<<
patCol
->
size
()
<<
" at "
<<
key
.
key
()
);
}
}
}
...
...
MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.cxx
View file @
a2d30587
...
...
@@ -15,20 +15,26 @@
MuonLayerHoughAlg
::
MuonLayerHoughAlg
(
const
std
::
string
&
name
,
ISvcLocator
*
pSvcLocator
)
:
AthAlgorithm
(
name
,
pSvcLocator
),
m_keyTgc
(
"TGC_Measurements"
),
m_keyRpc
(
"RPC_Measurements"
),
m_keyCsc
(
"CSC_Clusters"
),
m_keyMdt
(
"MDT_DriftCircles"
),
m_keysTgc
(
"STGC_Measurements"
),
m_keyMM
(
"MM_Measurements"
),
m_combis
(
"MuonLayerHoughCombis"
),
m_printer
(
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"
),
m_layerTool
(
"Muon::MuonLayerHoughTool/MuonLayerHoughTool"
)
{
declareProperty
(
"CscPrepDataContainer"
,
m_keyCsc
=
"CSC_Clusters"
);
declareProperty
(
"MdtPrepDataContainer"
,
m_keyMdt
=
"MDT_DriftCircles"
);
declareProperty
(
"RpcPrepDataContainer"
,
m_keyRpc
=
"RPC_Measurements"
);
declareProperty
(
"TgcPrepDataContainer"
,
m_keyTgc
=
"TGC_Measurements"
);
declareProperty
(
"TgcPrepDataContainerPriorBC"
,
m_keyTgcPriorBC
=
"TGC_MeasurementsPriorBC"
);
declareProperty
(
"TgcPrepDataContainerNextBC"
,
m_keyTgcNextBC
=
"TGC_MeasurementsNextBC"
);
declareProperty
(
"sTgcPrepDataContainer"
,
m_keysTgc
=
"STGC_Measurements"
);
declareProperty
(
"MMPrepDataContainer"
,
m_keyMM
=
"MM_Measurements"
);
declareProperty
(
"CscPrepDataContainer"
,
m_keyCsc
);
declareProperty
(
"MdtPrepDataContainer"
,
m_keyMdt
);
declareProperty
(
"RpcPrepDataContainer"
,
m_keyRpc
);
declareProperty
(
"TgcPrepDataContainer"
,
m_keyTgc
);
declareProperty
(
"TgcPrepDataContainerPriorBC"
,
m_keyTgcPriorBC
=
"TGC_MeasurementsPriorBC"
);
//unused
declareProperty
(
"TgcPrepDataContainerNextBC"
,
m_keyTgcNextBC
=
"TGC_MeasurementsNextBC"
);
//unused
declareProperty
(
"sTgcPrepDataContainer"
,
m_keysTgc
);
declareProperty
(
"MMPrepDataContainer"
,
m_keyMM
);
declareProperty
(
"PrintSummary"
,
m_printSummary
=
false
);
declareProperty
(
"MuonPatternCombinationCollection"
,
m_combis
);
declareProperty
(
"MuonLayerScanTool"
,
m_layerTool
);
}
...
...
@@ -41,42 +47,36 @@ StatusCode MuonLayerHoughAlg::initialize()
ATH_CHECK
(
m_layerTool
.
retrieve
()
);
ATH_CHECK
(
m_printer
.
retrieve
()
);
ATH_CHECK
(
m_keyRpc
.
initialize
()
);
ATH_CHECK
(
m_keyMdt
.
initialize
()
);
ATH_CHECK
(
m_keyTgc
.
initialize
()
);
ATH_CHECK
(
m_keyCsc
.
initialize
()
);
ATH_CHECK
(
m_keysTgc
.
initialize
());
ATH_CHECK
(
m_keyMM
.
initialize
()
);
ATH_CHECK
(
m_combis
.
initialize
()
);
return
StatusCode
::
SUCCESS
;
}
StatusCode
MuonLayerHoughAlg
::
execute
()
{
const
Muon
::
RpcPrepDataContainer
*
rpcPrds
=
0
;
if
(
evtStore
()
->
contains
<
Muon
::
RpcPrepDataContainer
>
(
m_keyRpc
)
&&
evtStore
()
->
retrieve
(
rpcPrds
,
m_keyRpc
).
isFailure
())
{
ATH_MSG_WARNING
(
"Cannot retrieve RpcPrepDataContainer "
<<
m_keyRpc
);
}
const
Muon
::
MdtPrepDataContainer
*
mdtPrds
=
0
;
if
(
evtStore
()
->
contains
<
Muon
::
MdtPrepDataContainer
>
(
m_keyMdt
)
&&
evtStore
()
->
retrieve
(
mdtPrds
,
m_keyMdt
).
isFailure
())
{
ATH_MSG_WARNING
(
"Cannot retrieve MdtPrepDataContainer "
<<
m_keyMdt
);
}
const
Muon
::
TgcPrepDataContainer
*
tgcPrds
=
0
;
if
(
evtStore
()
->
contains
<
Muon
::
TgcPrepDataContainer
>
(
m_keyTgc
)
&&
evtStore
()
->
retrieve
(
tgcPrds
,
m_keyTgc
).
isFailure
())
{
ATH_MSG_WARNING
(
"Cannot retrieve TgcPrepDataContainer "
<<
m_keyTgc
);
}
const
Muon
::
CscPrepDataContainer
*
cscPrds
=
0
;
if
(
evtStore
()
->
contains
<
Muon
::
CscPrepDataContainer
>
(
m_keyCsc
)
&&
evtStore
()
->
retrieve
(
cscPrds
,
m_keyCsc
).
isFailure
())
{
ATH_MSG_WARNING
(
"Cannot retrieve CscPrepDataContainer "
<<
m_keyCsc
);
}
const
Muon
::
sTgcPrepDataContainer
*
stgcPrds
=
0
;
if
(
evtStore
()
->
contains
<
Muon
::
sTgcPrepDataContainer
>
(
m_keysTgc
)
&&
evtStore
()
->
retrieve
(
stgcPrds
,
m_keysTgc
).
isFailure
())
{
ATH_MSG_WARNING
(
"Cannot retrieve sTgcPrepDataContainer "
<<
m_keysTgc
);
}
const
Muon
::
MMPrepDataContainer
*
mmPrds
=
0
;
if
(
evtStore
()
->
contains
<
Muon
::
MMPrepDataContainer
>
(
m_keyMM
)
&&
evtStore
()
->
retrieve
(
mmPrds
,
m_keyMM
).
isFailure
())
{
ATH_MSG_WARNING
(
"Cannot retrieve MmPrepDataContainer "
<<
m_keyMM
);
}
const
Muon
::
RpcPrepDataContainer
*
rpcPrds
=
GetObject
(
m_keyRpc
);
const
Muon
::
MdtPrepDataContainer
*
mdtPrds
=
GetObject
(
m_keyMdt
);
const
Muon
::
TgcPrepDataContainer
*
tgcPrds
=
GetObject
(
m_keyTgc
);
const
Muon
::
CscPrepDataContainer
*
cscPrds
=
GetObject
(
m_keyCsc
);
const
Muon
::
sTgcPrepDataContainer
*
stgcPrds
=
GetObject
(
m_keysTgc
);
const
Muon
::
MMPrepDataContainer
*
mmPrds
=
GetObject
(
m_keyMM
);;
ATH_MSG_VERBOSE
(
"calling layer tool "
);
MuonPatternCombinationCollection
*
combis
=
m_layerTool
->
analyse
(
mdtPrds
,
cscPrds
,
tgcPrds
,
rpcPrds
,
stgcPrds
,
mmPrds
);
std
::
unique_ptr
<
MuonPatternCombinationCollection
>
combis
(
m_layerTool
->
analyse
(
mdtPrds
,
cscPrds
,
tgcPrds
,
rpcPrds
,
stgcPrds
,
mmPrds
)
)
;
if
(
combis
){
if
(
evtStore
()
->
record
(
combis
,
"MuonLayerHoughCombis"
).
isFailure
())
{
SG
::
WriteHandle
<
MuonPatternCombinationCollection
>
Handle
(
m_combis
);
if
(
Handle
.
record
(
std
::
move
(
combis
)).
isFailure
())
{
ATH_MSG_WARNING
(
"Failed to record MuonPatternCombinationCollection at MuonLayerHoughCombis"
);
}
else
{
ATH_MSG_DEBUG
(
"Recorded MuonPatternCombinationCollection at MuonLayerHoughCombis: size "
<<
combis
->
size
());
...
...
@@ -98,3 +98,4 @@ StatusCode MuonLayerHoughAlg::finalize()
return
AthAlgorithm
::
finalize
();
}
MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.h
View file @
a2d30587
...
...
@@ -20,27 +20,41 @@ class MuonLayerHoughAlg : public AthAlgorithm
virtual
~
MuonLayerHoughAlg
();
virtual
StatusCode
initialize
();
virtual
StatusCode
execute
();
virtual
StatusCode
finalize
();
virtual
StatusCode
initialize
()
override
;
virtual
StatusCode
execute
()
override
;
virtual
StatusCode
finalize
()
override
;
private:
template
<
class
T
>
const
T
*
GetObject
(
SG
::
ReadHandleKey
<
T
>
&
key
);
/** storegate location of the MuonPrepDataContainer for all four technologies */
std
::
string
m_keyTgc
;
std
::
string
m_keyTgcPriorBC
;
std
::
string
m_keyTgcNextBC
;
std
::
string
m_keyRpc
;
std
::
string
m_keyCsc
;
std
::
string
m_keyMdt
;
std
::
string
m_keysTgc
;
std
::
string
m_keyMM
;
/** storegate location of the MuonPrepDataContainer for all four technologies */
SG
::
ReadHandleKey
<
Muon
::
TgcPrepDataContainer
>
m_keyTgc
;
std
::
string
m_keyTgcPriorBC
;
//unused
std
::
string
m_keyTgcNextBC
;
//unused
SG
::
ReadHandleKey
<
Muon
::
RpcPrepDataContainer
>
m_keyRpc
;
SG
::
ReadHandleKey
<
Muon
::
CscPrepDataContainer
>
m_keyCsc
;
SG
::
ReadHandleKey
<
Muon
::
MdtPrepDataContainer
>
m_keyMdt
;
SG
::
ReadHandleKey
<
Muon
::
sTgcPrepDataContainer
>
m_keysTgc
;
SG
::
ReadHandleKey
<
Muon
::
MMPrepDataContainer
>
m_keyMM
;
SG
::
WriteHandleKey
<
MuonPatternCombinationCollection
>
m_combis
;
ToolHandle
<
Muon
::
MuonEDMPrinterTool
>
m_printer
;
ToolHandle
<
Muon
::
MuonLayerHoughTool
>
m_layerTool
;
bool
m_printSummary
;
};
template
<
class
T
>
const
T
*
MuonLayerHoughAlg
::
GetObject
(
SG
::
ReadHandleKey
<
T
>
&
key
){
SG
::
ReadHandle
<
T
>
handle
(
key
);
if
(
handle
.
isPresent
()
&&
!
handle
.
isValid
())
{
ATH_MSG_WARNING
(
"MuonLayerHoughAlg Cannot retrieve "
<<
handle
.
key
()
);
return
nullptr
;
}
return
handle
.
cptr
();
}
#endif
MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
View file @
a2d30587
...
...
@@ -18,7 +18,6 @@
#include "CxxUtils/sincos.h"
#include "xAODTruth/TruthParticle.h"
#include "xAODTruth/TruthParticleContainer.h"
#include "xAODTruth/TruthParticleAuxContainer.h"
#include "xAODMuon/MuonSegmentContainer.h"
namespace
Muon
{
...
...
@@ -29,6 +28,9 @@ namespace Muon {
m_printer
(
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"
),
m_truthSummaryTool
(
"Muon::MuonTruthSummaryTool/MuonTruthSummaryTool"
),
m_detMgr
(
0
),
m_truthNames
{},
m_MuonTruthParticlesKey
(
"MuonTruthParticles"
),
m_MuonTruthSegmentsKey
(
"MuonTruthSegments"
),
m_ntechnologies
(
4
),
m_incidentSvc
(
"IncidentSvc"
,
name
)
{
...
...
@@ -49,7 +51,8 @@ namespace Muon {
declareProperty
(
"UseSeeds"
,
m_useSeeds
=
true
);
declareProperty
(
"DoParabolicExtrapolation"
,
m_doParabolicExtrapolation
=
true
);
declareProperty
(
"ExtrapolationDistance"
,
m_extrapolationDistance
=
1500.
);
declareProperty
(
"MuonTruthParticlesKey"
,
m_MuonTruthParticlesKey
);
declareProperty
(
"MuonTruthSegmentsKey"
,
m_MuonTruthSegmentsKey
);
}
MuonLayerHoughTool
::~
MuonLayerHoughTool
()
...
...
@@ -91,16 +94,20 @@ namespace Muon {
initializeSectorMapping
();
if
(
m_truthNames
.
empty
()
){
if
(
m_truthNames
.
empty
()
&&
!
m_doTruth
){
std
::
string
postfix
=
"_TruthMap"
;
std
::
string
allNames
(
""
);
for
(
unsigned
int
tech
=
0
;
tech
<
m_ntechnologies
;
++
tech
){
m_truthNames
.
push_back
(
std
::
string
(
m_idHelper
->
mdtIdHelper
().
technologyString
(
tech
))
+
postfix
);
std
::
string
thisname
=
std
::
string
(
m_idHelper
->
mdtIdHelper
().
technologyString
(
tech
))
+
postfix
;
m_truthNames
.
emplace_back
(
thisname
);
allNames
+=
" "
;
allNames
+=
m_truthNames
.
back
()
;
allNames
+=
thisname
;
}
ATH_MSG_DEBUG
(
"TruthMaps "
<<
allNames
);
}
if
(
!
m_doTruth
){
m_truthNames
.
clear
();
}
//Nullify if not using collections
ATH_CHECK
(
m_truthNames
.
initialize
()
);
// initialize cuts, if only one cut, use make_pair to avoid compiler issues, format is (position, cut)
m_selectors
.
resize
(
MuonStationIndex
::
ChIndexMax
);
...
...
@@ -179,22 +186,11 @@ namespace Muon {
}
void
MuonLayerHoughTool
::
getTruth
()
const
{
m_truthCollections
.
clear
();
m_truthCollections
.
resize
(
m_ntechnologies
,
0
);
for
(
unsigned
int
i
=
0
;
i
<
m_truthNames
.
size
();
++
i
){
const
std
::
string
name
=
m_truthNames
[
i
];
if
(
!
evtStore
()
->
contains
<
PRD_MultiTruthCollection
>
(
name
)
)
continue
;
if
(
evtStore
()
->
retrieve
(
m_truthCollections
[
i
],
name
).
isFailure
()
)
{
ATH_MSG_WARNING
(
"PRD_MultiTruthCollection "
<<
name
<<
" NOT found"
);
continue
;
}
ATH_MSG_DEBUG
(
"PRD_MultiTruthCollection "
<<
name
<<
" found "
<<
m_truthCollections
[
i
]
->
size
());
}
if
(
m_ntuple
){
const
xAOD
::
TruthParticleContainer
*
truthMuons
=
evtStore
()
->
tryConstRetrieve
<
xAOD
::
TruthParticleContainer
>
(
"
MuonTruthParticles
"
);
if
(
truthMuons
)
{
SG
::
ReadHandle
<
xAOD
::
TruthParticleContainer
>
truthMuons
(
m_
MuonTruthParticles
Key
);
if
(
truthMuons
.
isValid
()
)
{
ATH_MSG_DEBUG
(
"Retrieved truth muons "
<<
truthMuons
->
size
());
int
nmuons
=
0
;
for
(
const
auto
truthMu
:
*
truthMuons
){
...
...
@@ -215,9 +211,8 @@ namespace Muon {
++
nmuons
;
}
m_ntuple
->
nmuons
=
nmuons
;
const
xAOD
::
MuonSegmentContainer
*
truthSegments
=
evtStore
()
->
tryConstRetrieve
<
xAOD
::
MuonSegmentContainer
>
(
"MuonTruthSegments"
);
if
(
truthSegments
)
{
SG
::
ReadHandle
<
xAOD
::
MuonSegmentContainer
>
truthSegments
(
m_MuonTruthSegmentsKey
);
if
(
truthSegments
.
isValid
())
{
ATH_MSG_DEBUG
(
"Retrieved truth Segments "
<<
truthSegments
->
size
());
int
nsegs
=
0
;
for
(
const
auto
truthSeg
:
*
truthSegments
){
...
...
@@ -1859,7 +1854,7 @@ namespace Muon {
void
MuonLayerHoughTool
::
fill
(
const
MdtPrepDataCollection
&
mdts
,
MuonLayerHoughTool
::
HitVec
&
hits
)
const
{
if
(
mdts
.
empty
()
)
return
;
auto
truthCollections
=
m_truthNames
.
makeHandles
();
Identifier
chid
=
mdts
.
identify
();
MuonStationIndex
::
DetectorRegionIndex
region
=
m_idHelper
->
regionIndex
(
chid
);
MuonStationIndex
::
LayerIndex
layer
=
m_idHelper
->
layerIndex
(
chid
);
...
...
@@ -1890,7 +1885,7 @@ namespace Muon {
debug
->
time
=
prd
.
tdc
();
debug
->
r
=
prd
.
localPosition
()[
Trk
::
locR
];
if
(
technology
<
m_
truthCollections
.
size
()
)
matchTruth
(
*
m_
truthCollections
[
technology
],
id
,
*
debug
);
if
(
technology
<
truthCollections
.
size
()
)
matchTruth
(
*
truthCollections
[
technology
],
id
,
*
debug
);
MuonHough
::
Hit
*
hit
=
new
MuonHough
::
Hit
(
sublayer
,
x
,
ymin
,
ymax
,
1.
,
debug
,
&
prd
);
hits
.
push_back
(
hit
);
}
...
...
@@ -1906,7 +1901,7 @@ namespace Muon {
void
MuonLayerHoughTool
::
fill
(
const
RpcPrepDataCollection
&
rpcs
,
MuonLayerHoughTool
::
HitVec
&
hits
,
MuonLayerHoughTool
::
PhiHitVec
&
phiHits
)
const
{
if
(
rpcs
.
empty
()
)
return
;
auto
truthCollections
=
m_truthNames
.
makeHandles
();
Identifier
chid
=
rpcs
.
identify
();
unsigned
int
technology
=
m_idHelper
->
technologyIndex
(
chid
);
MuonStationIndex
::
LayerIndex
layer
=
m_idHelper
->
layerIndex
(
chid
);
...
...
@@ -1937,7 +1932,7 @@ namespace Muon {
debug
->
isEtaPhi
=
(
neta
&&
nphi
);
debug
->
trigConfirm
=
1
;
debug
->
time
=
prd
.
time
();
if
(
technology
<
m_
truthCollections
.
size
()
)
matchTruth
(
*
m_
truthCollections
[
technology
],
id
,
*
debug
);
if
(
technology
<
truthCollections
.
size
()
)
matchTruth
(
*
truthCollections
[
technology
],
id
,
*
debug
);
float
weight
=
(
neta
&&
nphi
)
?
2
:
1
;
if
(
m_idHelper
->
rpcIdHelper
().
measuresPhi
(
id
)
)
{
...
...
@@ -1964,7 +1959,7 @@ namespace Muon {
void
MuonLayerHoughTool
::
fill
(
const
MMPrepDataCollection
&
mms
,
MuonLayerHoughTool
::
HitVec
&
hits
)
const
{
if
(
mms
.
empty
()
)
return
;
auto
truthCollections
=
m_truthNames
.
makeHandles
();
Identifier
chid
=
mms
.
identify
();
MuonStationIndex
::
DetectorRegionIndex
region
=
m_idHelper
->
regionIndex
(
chid
);
MuonStationIndex
::
LayerIndex
layer
=
m_idHelper
->
layerIndex
(
chid
);
...
...
@@ -1987,7 +1982,7 @@ namespace Muon {
float
ymax
=
y
+
stripCor
;
MuonHough
::
HitDebugInfo
*
debug
=
new
MuonHough
::
HitDebugInfo
(
technology
,
sector
,
region
,
layer
,
sublayer
);
debug
->
r
=
stripCor
;
if
(
technology
<
m_
truthCollections
.
size
()
)
matchTruth
(
*
m_
truthCollections
[
technology
],
id
,
*
debug
);
if
(
technology
<
truthCollections
.
size
()
)
matchTruth
(
*
truthCollections
[
technology
],
id
,
*
debug
);
MuonHough
::
Hit
*
hit
=
new
MuonHough
::
Hit
(
sublayer
,
x
,
ymin
,
ymax
,
1.
,
debug
,
&
prd
);
hits
.
push_back
(
hit
);
...
...
@@ -1997,7 +1992,7 @@ namespace Muon {
void
MuonLayerHoughTool
::
fill
(
const
sTgcPrepDataCollection
&
stgcs
,
MuonLayerHoughTool
::
HitVec
&
hits
,
MuonLayerHoughTool
::
PhiHitVec
&
phiHits
,
int
selectedSector
)
const
{
if
(
stgcs
.
empty
()
)
return
;
auto
truthCollections
=
m_truthNames
.
makeHandles
();
Identifier
chid
=
stgcs
.
identify
();
MuonStationIndex
::
DetectorRegionIndex
region
=
m_idHelper
->
regionIndex
(
chid
);
MuonStationIndex
::
LayerIndex
layer
=
m_idHelper
->
layerIndex
(
chid
);
...
...
@@ -2024,7 +2019,7 @@ namespace Muon {
debug
->
isEtaPhi
=
1
;
debug
->
trigConfirm
=
(
prd
.
getBcBitMap
()
&
sTgcPrepData
::
BCBIT_CURRENT
)
==
sTgcPrepData
::
BCBIT_CURRENT
;
debug
->
time
=
prd
.
getBcBitMap
();
if
(
technology
<
m_
truthCollections
.
size
()
)
matchTruth
(
*
m_
truthCollections
[
technology
],
id
,
*
debug
);
if
(
technology
<
truthCollections
.
size
()
)
matchTruth
(
*
truthCollections
[
technology
],
id
,
*
debug
);
if
(
m_idHelper
->
stgcIdHelper
().
channelType
(
id
)
==
1
)
{
float
x
=
prd
.
globalPosition
().
z
();
...
...
@@ -2122,7 +2117,7 @@ namespace Muon {
}
return
;
}
auto
truthCollections
=
m_truthNames
.
makeHandles
();
std
::
vector
<
int
>
sectors
;
getSectors
(
clustering
.
clusters3D
.
front
(),
sectors
);
unsigned
int
technology
=
m_idHelper
->
technologyIndex
(
chid
);
...
...
@@ -2164,7 +2159,7 @@ namespace Muon {
debug
->
clusterLayers
=
cl
.
etaCluster
.
layers
();
debug
->
isEtaPhi
=
cl
.
phiCluster
.
layers
();
debug
->
time
=
cl
.
etaCluster
.
hitList
.
front
()
->
getBcBitMap
();
if
(
technology
<
m_
truthCollections
.
size
()
)
matchTruth
(
*
m_
truthCollections
[
technology
],
id
,
*
debug
);
if
(
technology
<
truthCollections
.
size
()
)
matchTruth
(
*
truthCollections
[
technology
],
id
,
*
debug
);
MuonHough
::
HitDebugInfo
*
phiDebug
=
new
MuonHough
::
HitDebugInfo
(
*
debug
);
phiDebug
->
clusterSize
=
cl
.
phiCluster
.
hitList
.
size
();
...
...
MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MooSegmentCombinationFinder.cxx
View file @
a2d30587
...
...
@@ -59,6 +59,10 @@ Muon::MooSegmentCombinationFinder::MooSegmentCombinationFinder(const std::string
m_segmentCombinationCleaner
(
"Muon::MuonSegmentCombinationCleanerTool/MuonSegmentCombinationCleanerTool"
),
m_overlapRemovalTool
(
"Muon::MuonSegmentOverlapRemovalTool/MuonSegmentOverlapRemovalTool"
),
m_segmentSelector
(
"Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool"
),
m_csc2dLocation
(
"Csc2dSegmentCombinations"
),
m_csc4dLocation
(
"Csc4dSegmentCombinations"
),
m_mdtSegmentCombinationLocation
(
"MdtSegmentCombinations"
),
m_curvedCombinationLocation
(
"CurvedSegmentCombinations"
),
m_nevents
(
0
),
m_ncsc2SegmentCombinations
(
0
),
m_ncsc4SegmentCombinations
(
0
),
...
...
@@ -71,6 +75,7 @@ Muon::MooSegmentCombinationFinder::MooSegmentCombinationFinder(const std::string
m_nsegmentsCurved
(
0
),
m_nremovedSegments
(
0
),
m_nremovedBadSegments
(
0
)
{
declareInterface
<
IMooSegmentCombinationFinder
>
(
this
);
...
...
@@ -91,10 +96,10 @@ Muon::MooSegmentCombinationFinder::MooSegmentCombinationFinder(const std::string
declareProperty
(
"DoSegmentCombinationCleaning"
,
m_doSegmentCombinationCleaning
=
true
);
declareProperty
(
"WriteIntermediateResults"
,
m_writeAll
=
false
);
declareProperty
(
"Csc2dSegmentCombinationLocation"
,
m_csc2dLocation
=
"Csc2dSegmentCombinations"
);
declareProperty
(
"Csc4dSegmentCombinationLocation"
,
m_csc4dLocation
=
"Csc4dSegmentCombinations"
);
declareProperty
(
"MdtSegmentCombinationLocation"
,
m_mdtSegmentCombinationLocation
=
"MdtSegmentCombinations"
);
declareProperty
(
"CurvedSegmentCombinationLocation"
,
m_curvedCombinationLocation
=
"CurvedSegmentCombinations"
);
declareProperty
(
"Csc2dSegmentCombinationLocation"
,
m_csc2dLocation
);
declareProperty
(
"Csc4dSegmentCombinationLocation"
,
m_csc4dLocation
);
declareProperty
(
"MdtSegmentCombinationLocation"
,
m_mdtSegmentCombinationLocation
);
declareProperty
(
"CurvedSegmentCombinationLocation"
,
m_curvedCombinationLocation
);
declareProperty
(
"CloneSegments"
,
m_cloneSegments
=
false
);
}
...
...
@@ -184,7 +189,12 @@ Muon::MooSegmentCombinationFinder::initialize()
}
}
}
ATH_CHECK
(
m_csc2dLocation
.
initialize
()
);
ATH_CHECK
(
m_csc4dLocation
.
initialize
()
);
ATH_CHECK
(
m_mdtSegmentCombinationLocation
.
initialize
()
);
ATH_CHECK
(
m_curvedCombinationLocation
.
initialize
()
);
return
StatusCode
::
SUCCESS
;
}
...
...
@@ -384,7 +394,7 @@ Muon::MooSegmentCombinationFinder::findSegments( const std::vector<const MdtPrep
}
void
Muon
::
MooSegmentCombinationFinder
::
postProcess
(
const
MuonSegmentCombinationCollection
*
col
,
bool
write
,
std
::
string
colLocation
)
{
Muon
::
MooSegmentCombinationFinder
::
postProcess
(
MuonSegmentCombinationCollection
*
col
,
bool
write
,
SG
::
WriteHandleKey
<
MuonSegmentCombinationCollection
>
&
colLocation
)
{
if
(
!
write
)
{
// hack to remove old combies before deleting them
const
IMuonPatternSegmentAssociationTool
::
AssociationMap
&
assMap
=
m_assocTool
->
map
();
...
...
@@ -401,12 +411,13 @@ Muon::MooSegmentCombinationFinder::postProcess( const MuonSegmentCombinationCol
}
if
(
!
col
)
col
=
new
MuonSegmentCombinationCollection
();