ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonDQA
MuonRawDataMonitoring
MdtVsTgcRawDataMonitoring
src
MdtVsTgcRawData_maptgchits.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 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 "
EventPrimitives/EventPrimitivesHelpers.h
"
18
#include "
GeoPrimitives/GeoPrimitives.h
"
19
#include "
GeoPrimitives/GeoPrimitivesHelpers.h
"
20
21
#include "
TrkRIO_OnTrack/RIO_OnTrack.h
"
22
#include "
xAODMuon/MuonSegmentContainer.h
"
23
#include "
xAODMuon/MuonSegment.h
"
24
25
#include <TH1F.h>
26
#include <TH2F.h>
27
#include <TH1.h>
28
#include <TH2.h>
29
#include <inttypes.h>
30
31
#include <sstream>
32
#include <algorithm>
33
#include <fstream>
34
35
void
36
MdtVsTgcRawDataValAlg::maphists
(
const
xAOD::MuonSegmentContainer
*newsegment,
37
const
Muon::TgcPrepDataContainer
*tgc_prepcontainer){
//use new mdt segment
38
ATH_MSG_DEBUG
(
"inside maptgchits"
);
39
41
// loop over MDT Segment Collection
42
xAOD::MuonSegmentContainer::const_iterator
mdtseg_itr = newsegment->
begin
();
43
xAOD::MuonSegmentContainer::const_iterator
mdtseg_end = newsegment->
end
();
44
for
(; mdtseg_itr!=mdtseg_end; ++mdtseg_itr){
45
if
(!(*mdtseg_itr)->muonSegment().isValid())
continue
;
46
// Get segm
47
const
Muon::MuonSegment
* segm =
dynamic_cast<
const
Muon::MuonSegment
*
>
(*(*mdtseg_itr)->muonSegment());
48
if
(segm ==
nullptr
) {
49
ATH_MSG_ERROR
(
"no pointer to segm!!!"
);
50
break
;
51
}
52
// Initialize variables
53
int
stationName=0;
54
int
nMdtMeas[4] = {0,0,0,0};
55
bool
isMdt=
false
, isEndcap=
false
;
56
57
// Loop through contained ROTs and count used MDT and TGC stations
58
for
(
unsigned
int
i=0;i<segm->
numberOfContainedROTs
();++i){
59
// Get station information
60
const
Trk::RIO_OnTrack
* rio = segm->
rioOnTrack
(i);
61
if
(!rio)
continue
;
62
Identifier
id
= rio->
identify
();
63
stationName = int(
m_idHelperSvc
->mdtIdHelper().stationName(
id
));
64
// Flag Segments with ROTs in the MDT & Endcap
65
if
(
m_idHelperSvc
->isMdt(
id
))isMdt=
true
;
66
if
(
m_idHelperSvc
->isEndcap(
id
))isEndcap=
true
;
67
// If ROT is MDT
68
if
((stationName==13)||(stationName==49)){nMdtMeas[0]++;}
69
if
((stationName==14)||(stationName==15)){nMdtMeas[1]++;}
70
if
((stationName==17)||(stationName==18)){nMdtMeas[2]++;}
71
if
((stationName==20)||(stationName==21)){nMdtMeas[3]++;}
72
}
73
if
(!isMdt)
continue
;
74
if
(!isEndcap)
continue
;
75
76
// Establish which MDT stations the Segment is in
77
int
nStations = 0;
78
for
(
int
jMDT=0;jMDT<4;jMDT++){
79
if
(nMdtMeas[jMDT]){
80
nStations++;
81
}
82
}
83
// Check that the Segment only occupies one Station
84
if
(nStations!=1)
continue
;
85
86
// Get Position pointer and segmAC index
87
const
Amg::Vector3D
segmGlobalPos = segm->
globalPosition
();
88
int
segmAC = (segmGlobalPos.z()<0);
// a:0, c:1
89
90
// Fill MDT data
91
for
(
int
jMDT=0;jMDT<4;jMDT++){
// jMDT
92
if
(nMdtMeas[jMDT]){
// If hits in this Station
93
// Get position variables
94
float
segmGlobalEta = std::abs(segmGlobalPos.eta());
95
float
segmGlobalPhi = segmGlobalPos.phi();
96
if
(segmGlobalPhi<0) segmGlobalPhi+=2*
M_PI
;
97
// Fill position histogram
98
m_mdt_segmmap
[segmAC][jMDT]->Fill(segmGlobalPhi, segmGlobalEta);
99
}
// If hits in Station
100
}
// jMDT
101
}
// MDT Segment Collection
102
104
//loop over TGC Prep Data container
105
Muon::TgcPrepDataContainer::const_iterator
tgc_it_end=tgc_prepcontainer->
end
();
106
for
(
Muon::TgcPrepDataContainer::const_iterator
tgc_it=tgc_prepcontainer->
begin
();
107
tgc_it!=tgc_it_end;
108
++tgc_it){
109
110
//loop over TGC Prep Data collection
111
Muon::TgcPrepDataCollection::const_iterator
tgc_itc_end=(*tgc_it)->end();
112
for
(
Muon::TgcPrepDataCollection::const_iterator
tgc_itc=(*tgc_it)->begin();
113
tgc_itc!= tgc_itc_end;
114
++tgc_itc){
115
const
Muon::TgcPrepData
* tpd=*tgc_itc;
116
117
// Get detector information
118
const
MuonGM::TgcReadoutElement
*tre = tpd->
detectorElement
();
119
const
std::string tgcStationType = tre->
getStationType
();
120
121
// Get detector variables
122
Identifier
tgcid=(*tgc_itc)->identify();
123
int
tgcStationName =
m_idHelperSvc
->tgcIdHelper().stationName(tgcid);
124
125
// Get position variables
126
const
Amg::Vector3D
tgcGlobalPos = tpd->
globalPosition
();
127
float
tgcGlobalPhi = tgcGlobalPos.phi();
128
if
(tgcGlobalPhi<0)tgcGlobalPhi+=2*
M_PI
;
129
130
// Cut non-TGC-Endcap
131
if
(tgcStationName<41 || tgcStationName>48)
continue
;
132
}
// TGC PRD Collection
133
}
// TGC PRD Container
134
135
return
;
136
}
// End of function
137
138
// Finalize histograms which need post processing
139
void
MdtVsTgcRawDataValAlg::maphistsfinalize
(){
140
141
}
// End of function
M_PI
#define M_PI
Definition
ActiveFraction.h:14
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
EventPrimitivesHelpers.h
MuonSegment.h
GeoPrimitivesHelpers.h
GeoPrimitives.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.
IdentifiableContainerMT::const_iterator
Definition
IdentifiableContainerMT.h:82
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition
IdentifiableContainerMT.h:248
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition
IdentifiableContainerMT.h:242
MdtVsTgcRawDataValAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MdtVsTgcRawDataValAlg.h:69
MdtVsTgcRawDataValAlg::maphistsfinalize
void maphistsfinalize()
Definition
MdtVsTgcRawData_maptgchits.cxx:139
MdtVsTgcRawDataValAlg::m_mdt_segmmap
TH2 * m_mdt_segmmap[2][4]
Definition
MdtVsTgcRawDataValAlg.h:111
MdtVsTgcRawDataValAlg::maphists
void maphists(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
Definition
MdtVsTgcRawData_maptgchits.cxx:36
MuonGM::MuonReadoutElement::getStationType
std::string getStationType() const
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:178
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
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
Muon::TgcPrepData
Class to represent TGC measurements.
Definition
TgcPrepData.h:32
Muon::TgcPrepData::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global position.
Definition
TgcPrepData.h:124
Muon::TgcPrepData::detectorElement
virtual const MuonGM::TgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD The pointer will be zero if the det el is not ...
Definition
TgcPrepData.h:119
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
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Identifier
Definition
IdentifierFieldParser.cxx:14
Muon::TgcPrepDataContainer
MuonPrepDataContainerT< TgcPrepData > TgcPrepDataContainer
Definition
MuonPrepDataContainer.h:96
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