ATLAS Offline Software
Loading...
Searching...
No Matches
MdtVsTgcRawDataValAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6// Package : MdtVsTgcRawDataValAlg
7// Author: A.Ishikawa(Kobe), M.King(Kobe)
8// Jan. 2011
9//
10// DESCRIPTION:
11// Subject: MDT TGC Correlation-->Offline Muon Data Quality based on RPCLV1
12// TGC Efficiency -->TGC Efficiency plots including EIFI by comparing with MDT Segments
14
15#ifndef MdtVsTgcRawDataValAlg_H
16#define MdtVsTgcRawDataValAlg_H
17
19#include "GaudiKernel/ServiceHandle.h"
20
30
31#include "SegmTrack.h"
32
33#include <string>
34#include <vector>
35
36template <class ConcreteAlgorithm> class AlgFactory;
37
39public:
40
41 MdtVsTgcRawDataValAlg ( const std::string & type, const std::string & name, const IInterface* parent );
42 virtual ~MdtVsTgcRawDataValAlg();
43 StatusCode initialize();
44
45 virtual StatusCode bookHistogramsRecurrent();
46 virtual StatusCode fillHistograms();
47 virtual StatusCode procHistograms();
48
49 private:
50
51 // Functions declaration
52 void correlation(const Muon::MdtPrepDataContainer* mdt_hit_container, const Muon::TgcCoinDataContainer* tgc_trigger_container);
53 int numberOfSL(const Muon::TgcCoinDataContainer* tgctrgcontainer);
54
55 // private function to convert local roi numbering to global eta, phi numbering
56 void roi2etaphi(const Muon::TgcCoinData& cd, //input
57 int& eta, int& phi);//output
58 int phi2sector(int phi,int ef);
59 int roiphi2mdtSector(int roiphi,int ef);
61 int stationGasGap2layer(int station, int GasGap);
62
64
65 // MuonDetectorManager from the conditions store
67 "MuonDetectorManager",
68 "Key of input MuonDetectorManager condition data"};
69 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
70
71 //Declare Properties
74
75 std::string m_chamberName;
76 std::string m_StationSize;
78 int m_side;
81 SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_tgc_PrepDataContainerName{this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"};
82 SG::ReadHandleKey<Muon::TgcCoinDataContainer> m_tgc_CoinContainerName{this,"OutputCoinCollection","TrigT1CoinDataCollection","TGC coincidences"};
83 SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_mdt_PrepDataContainerName{this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"};
84 SG::ReadHandleKey<xAOD::MuonSegmentContainer> m_mdt_SegmentCollectionName{this,"MdtSegmentCollection","MuonSegments","muon segments"};
85
88
90 // Variables and Functions for TGC Efficiency Maps
91
92 // Array of all TREs, indexed by location. Used to find which sectors tracks pass through in tgceffcalc
93 void prepareTREarray(const MuonGM::MuonDetectorManager* MuonDetMgrDS);
94 const MuonGM::TgcReadoutElement* m_TREarray[8][2][9][49]{}; // [StationName][AC][StationEta][StationPhi]
95 // Functions used to standardize the way TGC stations are indexed by the program
96 int TGCgetlayer(int stationName, int g);
97 int TGClayer2stationindex(int l);
98 int TGCstationname2stationindex(int stationName);
99
101 // Functions to Map TGC & MDT data
102 StatusCode bookmaphists(MonGroup &mdtvstgclv1_expert_a, // Book Mapping histograms
103 MonGroup &mdtvstgclv1_expert_c);
104 void maphists(const xAOD::MuonSegmentContainer *m_newsegment, // Fills TGC&MDT data positions
105 const Muon::TgcPrepDataContainer *tgc_prepcontainer);
106
107 void maphistsfinalize(); // Finalize histograms used in maphists
108 // number of~ hists
109 TH1 *m_mvt_cutspassed[2]{}; // [AC]
110 // distributions
111 TH2 *m_mdt_segmmap[2][4]{}; // [AC][StationIndex]
112
114 // Functions to Calculate Efficiency
115 StatusCode bookeffhists(MonGroup &mdtvstgclv1_expert_a, // Book Efficiency histograms
116 MonGroup &mdtvstgclv1_expert_c);
117 void tgceffcalc(const xAOD::MuonSegmentContainer *m_newsegment, // Fills efficiency histograms using subsidiary functions
118 const Muon::TgcPrepDataContainer *tgc_prepcontainer);
119
120 void SortMDTSegments(const xAOD::MuonSegmentContainer *m_newsegment, // Sorts MDT segments into stations
121 std::vector<const Muon::MuonSegment*> (&sortedSegments)[2][4]);
122
123
124 void DQCheckMDTSegments(std::vector<const Muon::MuonSegment*> (&sortedSegments)[2][4], // Runs checks on DQ of segments
125 std::vector<const Muon::MuonSegment*> (&disqualifiedSegments)[2][4]);
126 void MatchMDTSegments(std::vector<const Muon::MuonSegment*> (&sortedSegments)[2][4], // Matches up segments in different stations into SegmTracks
127 std::vector<const Muon::MuonSegment*> (&disqualifiedSegments)[2][4],
128 std::vector<SegmTrack> (&matchedSegments)[2]);
129 void CheckTGConTrack(std::vector<SegmTrack> (&matchedSegments)[2], // Uses SegmTracks to look for TGC PRD
130 const Muon::TgcPrepDataContainer *tgc_prepcontainer);
131 void MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> (&sortedSegments)[2][4], // Matches up segments in different stations into SegmTracks
132 std::vector<const Muon::MuonSegment*> (&disqualifiedSegments)[2][4],
133 const Muon::TgcPrepDataContainer *tgc_prepcontainer);
134 void tgceffcalcfinalize(); // Finalize histograms used in tgceffcalc
135 // Subsidiary functions used for managing StationMap style histograms
136 int getStationMapIndex(int x, int l, int stationFE, int stationEta, int stationPhi);
137 void labelStationMap(TH2 *h2, int i=-1, int k=-1);
138 void putBox(TH2* h2, float x1, float y1, float x2, float y2);
139 void BlankPhi24(TH2 *h2, int binx);
140 void BlankStationMap(TH2 *h2, int ws);
141
142 // efficiencies
143 TH2* m_eff_stationmapbase[2][2][4]{}; // [AC][WireStrip][EffNumDenomError]
144 TH2* m_eff_stationmapmid[2][2][4]{}; // [AC][WireStrip][EffNumDenomError]
145 TH2* m_eff_stationmap[2][2][4]{}; // [AC][WireStrip][EffNumDenomError] //Filled in postprocessor
146 // sagittas
147 TH1* m_mvt_extrprdsag[2][4][2][2][4]{}; // [AC][TGCStation][FE][WireStrip][RhoEtaPhi]
148 TH1* m_mvt_extrprdsag2[2][4][2][2][4]{}; // [AC][TGCStation][FE][WireStrip][RhoEtaPhi]
149 TH1* m_tgc_prdcompsag[2][2][4]{}; // [AC][TGCStation][RhoEtaPhiZ]
150 TH1* m_mdt_segmmatchsag[2][4][4][4]{}; // [AC][MDTStation][MDTStation][RhoEtaPhiThe]
151 TH1* m_mdt_segmposdirsag[2][4][4]{}; // [AC][MDTStation][RhoEtaPhiThe]
152 TH1* m_mdt_trackdirdirsag[2][4][4][4]{}; // [AC][MDTStation][MDTStation][RhoEtaPhiThe]
153 TH1* m_mdt_trackchecksag[2][4][4][4][2]{};// [AC][MDTStation][MDTStation][RhoEtaPhiThe]
154};
155
156#endif
157
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Property holding a SG store/key/clid from which a ReadHandle is made.
#define x
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
void roi2etaphi(const Muon::TgcCoinData &cd, int &eta, int &phi)
int roiphi2mdtSector(int roiphi, int ef)
int stationGasGap2layer(int station, int GasGap)
MdtVsTgcRawDataValAlg(const std::string &type, const std::string &name, const IInterface *parent)
int TGCgetlayer(int stationName, int g)
void prepareTREarray(const MuonGM::MuonDetectorManager *MuonDetMgrDS)
void SortMDTSegments(const xAOD::MuonSegmentContainer *m_newsegment, std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4])
StatusCode bookmaphists(MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
void BlankStationMap(TH2 *h2, int ws)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
void BlankPhi24(TH2 *h2, int binx)
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_tgc_PrepDataContainerName
StatusCode bookeffhists(MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
void correlation(const Muon::MdtPrepDataContainer *mdt_hit_container, const Muon::TgcCoinDataContainer *tgc_trigger_container)
TH1 * m_mvt_extrprdsag[2][4][2][2][4]
virtual StatusCode procHistograms()
An inheriting class should either override this function or finalHists().
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_mdt_SegmentCollectionName
void MatchMDTSegments(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], std::vector< SegmTrack >(&matchedSegments)[2])
TH1 * m_mvt_extrprdsag2[2][4][2][2][4]
SG::ReadHandleKey< Muon::TgcCoinDataContainer > m_tgc_CoinContainerName
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
virtual StatusCode bookHistogramsRecurrent()
An inheriting class should either override this function, bookHists() or bookHistograms().
int roitotalphi2sectorphi(int phi)
TH1 * m_mdt_trackdirdirsag[2][4][4][4]
void putBox(TH2 *h2, float x1, float y1, float x2, float y2)
void tgceffcalc(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void CheckTGConTrack(std::vector< SegmTrack >(&matchedSegments)[2], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void MidstationOnlyCheck(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void DQCheckMDTSegments(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4])
TH1 * m_mdt_segmmatchsag[2][4][4][4]
void maphists(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
int numberOfSL(const Muon::TgcCoinDataContainer *tgctrgcontainer)
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdt_PrepDataContainerName
int getStationMapIndex(int x, int l, int stationFE, int stationEta, int stationPhi)
void labelStationMap(TH2 *h2, int i=-1, int k=-1)
const MuonGM::TgcReadoutElement * m_TREarray[8][2][9][49]
int TGCstationname2stationindex(int stationName)
TH1 * m_mdt_trackchecksag[2][4][4][4][2]
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonPrepDataContainerT< TgcPrepData > TgcPrepDataContainer
MuonCoinDataContainer< TgcCoinDataCollection > TgcCoinDataContainer
MuonPrepDataContainerT< MdtPrepData > MdtPrepDataContainer
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".