ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonDQA
MuonRawDataMonitoring
MdtVsTgcRawDataMonitoring
src
functions
MdtVsTgcRawData_SegmSorting.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// Package : MdtVsTgcRawDataValAlg
7
// Author: M.King(Kobe)
8
// Feb. 2011
9
//
10
// DESCRIPTION:
11
// Subject: TGC Efficiency -->TGC Efficiency plots including EIFI by comparing with MDT Segments
13
14
#include "
../MdtVsTgcRawDataValAlg.h
"
15
16
#include "
TrkEventPrimitives/TrkEventPrimitivesDict.h
"
17
#include "
TrkRIO_OnTrack/RIO_OnTrack.h
"
18
#include "
xAODMuon/MuonSegmentContainer.h
"
19
#include "
xAODMuon/MuonSegment.h
"
20
21
#include <inttypes.h>
22
#include <sstream>
23
#include <algorithm>
24
#include <fstream>
25
26
// New Sort Segments in the MDT Endcap into Sides and MDT Stations
27
void
28
MdtVsTgcRawDataValAlg::SortMDTSegments
(
const
xAOD::MuonSegmentContainer
*newsegment,
29
std::vector<const Muon::MuonSegment*> (&sortedSegments)[2][4]){
30
31
// Loop over all segments in event
32
xAOD::MuonSegmentContainer::const_iterator
mdtseg_itr = newsegment->
begin
();
33
xAOD::MuonSegmentContainer::const_iterator
mdtseg_end = newsegment->
end
();
34
for
(; mdtseg_itr!=mdtseg_end; ++mdtseg_itr){
35
if
(!(*mdtseg_itr)->muonSegment().isValid())
continue
;
36
// Get segm
37
const
Muon::MuonSegment
* segm =
dynamic_cast<
const
Muon::MuonSegment
*
>
(*(*mdtseg_itr)->muonSegment());
38
if
(segm ==
nullptr
) {
39
ATH_MSG_ERROR
(
"no pointer to segm!!!"
);
40
break
;
41
}
42
43
bool
isMdt=
false
, isEndcap=
false
;
// Flags for whether the Segment has hits from the MDT/Endcap
44
int
nMdtMeas[4]={0,0,0,0};
// int array to count number of MDT hits in different stations
45
46
// Loop through contained ROTs and identify used stations
47
for
(
unsigned
int
iROT=0; iROT<segm->
numberOfContainedROTs
(); ++iROT){
48
const
Trk::RIO_OnTrack
* rio = segm->
rioOnTrack
(iROT);
49
if
(!rio){
50
ATH_MSG_DEBUG
(
"No RIO"
);
51
continue
;
52
}
53
Identifier
id
= rio->
identify
();
54
55
// Identify MDT Endcap Segments
56
if
(
m_idHelperSvc
->isMdt(
id
))isMdt=
true
;
57
if
(
m_idHelperSvc
->isEndcap(
id
))isEndcap=
true
;
58
59
int
stationName = int(
m_idHelperSvc
->mdtIdHelper().stationName(
id
));
60
// Large (L) = odd, greater r, Small (S) = even, lower r
61
// 13=EIL 49=EIS 14=EEL 15=EES 17=EML 18=EMS 20=EOL 21=EOS
62
if
((stationName==13)||(stationName==49))nMdtMeas[0]++;
// MDT
63
if
((stationName==14)||(stationName==15))nMdtMeas[1]++;
// MDT
64
if
((stationName==17)||(stationName==18))nMdtMeas[2]++;
// MDT
65
if
((stationName==20)||(stationName==21))nMdtMeas[3]++;
// MDT
66
}
67
68
// If not Endcap and does not contain MDT hits
69
if
(!isMdt||!isEndcap)
continue
;
70
71
// Get Side
72
int
segmAC = (segm->
globalPosition
().
eta
()<0);
// a:0, c:1
73
74
// Check MDT Stations included in this Segment
75
int
nMDTStations=0;
int
MDTStationj=-1;
76
for
(
int
jMDT=0;jMDT<4;jMDT++){
77
if
(nMdtMeas[jMDT]!=0){
78
nMDTStations++;
79
MDTStationj=jMDT;
80
}
81
}
82
83
// MC data has an odd channel set always triggering segments, this cuts them
84
if
((segmAC==0)&&(MDTStationj==0)&&
85
(segm->
globalPosition
().eta()>1.815)&&(segm->
globalPosition
().eta()<1.82)&&
86
(segm->
globalPosition
().phi()>2.857)&&(segm->
globalPosition
().phi()<2.862))
continue
;
87
88
// If there is only one station pass the segment data on to the variables
89
if
(nMDTStations==1){
90
//HasStationSegm[segmAC][MDTStationj]=true;
91
sortedSegments[segmAC][MDTStationj].push_back(segm);
92
}
93
}
// Loop over segments
94
}
// End of function
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
MuonSegment.h
MdtVsTgcRawDataValAlg.h
MuonSegmentContainer.h
RIO_OnTrack.h
TrkEventPrimitivesDict.h
DataVector< xAOD::MuonSegment_v1 >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
MdtVsTgcRawDataValAlg::SortMDTSegments
void SortMDTSegments(const xAOD::MuonSegmentContainer *m_newsegment, std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4])
Definition
MdtVsTgcRawData_SegmSorting.cxx:28
MdtVsTgcRawDataValAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MdtVsTgcRawDataValAlg.h:69
Muon::MuonSegment
This is the common class for 3D segments used in the muon spectrometer.
Definition
MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
Muon::MuonSegment::rioOnTrack
const Trk::RIO_OnTrack * rioOnTrack(unsigned int) const
returns the RIO_OnTrack (also known as ROT) objects depending on the integer
Definition
MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:187
Muon::MuonSegment::numberOfContainedROTs
unsigned int numberOfContainedROTs() const
number of RIO_OnTracks
Definition
MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:199
Muon::MuonSegment::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
global position
Definition
MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:157
Trk::RIO_OnTrack
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition
RIO_OnTrack.h:70
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition
RIO_OnTrack.h:152
Identifier
Definition
IdentifierFieldParser.cxx:14
xAOD::MuonSegmentContainer
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
Definition
MuonSegmentContainer.h:14
Generated on
for ATLAS Offline Software by
1.17.0