ATLAS Offline Software
Loading...
Searching...
No Matches
MdtVsTgcRawDataValAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6// Package : MdtVsTgcRawDataValAlg
7// Authors: A. Ishikawa(Kobe), M.King(Kobe)
8// Jun. 2008`
9//
10// DESCRIPTION:
11// Subject: correlation btw MDT hits vs TGC RoI -->Offline Muon Data Quality
13
15
16#include "MuonRDO/TgcRdo.h"
25
26#include <inttypes.h>
27#include <sstream>
28#include <algorithm>
29#include <fstream>
30
32
33MdtVsTgcRawDataValAlg::MdtVsTgcRawDataValAlg( const std::string & type, const std::string & name, const IInterface* parent )
34 :ManagedMonitorToolBase( type, name, parent )
35{
36 // Declare the properties
37 declareProperty("CheckCabling", m_checkCabling=false);
38 declareProperty("TgcLv1File", m_tgclv1file=true);
39 declareProperty("ChamberName", m_chamberName="XXX");
40 declareProperty("StationSize", m_StationSize="XXX");
41 declareProperty("Sector", m_sector=0);
42 declareProperty("Side", m_side=0);
43 declareProperty("LastEvent", m_lastEvent=0);
44 declareProperty("CosmicStation", m_cosmicStation=0);
45 declareProperty("MdtAdcCut", m_MdtAdcCut=50);
46 declareProperty("MdtTdcCut", m_MdtTdcCut=1600);
47
48 // initialize class members
49
50 for(int ac=0; ac<2; ac++){
51 m_mvt_cutspassed[ac] = nullptr;
52 for(int jMDT=0; jMDT<4; jMDT++){
53 m_mdt_segmmap[ac][jMDT] = nullptr;
54 for(int sMDT=0; sMDT<4; sMDT++){
55 m_mdt_segmposdirsag[ac][jMDT][sMDT] = nullptr;
56 for(int iREPT=0; iREPT<4; iREPT++){
57 m_mdt_segmmatchsag[ac][jMDT][sMDT][iREPT] = nullptr;
58 m_mdt_trackdirdirsag[ac][jMDT][sMDT][iREPT] = nullptr;
59 m_mdt_trackchecksag[ac][jMDT][sMDT][iREPT][0] = nullptr;
60 m_mdt_trackchecksag[ac][jMDT][sMDT][iREPT][1] = nullptr;
61 }
62 }
63 }
64 for(int WS=0; WS<2; WS++){
65 for(int EffNDE=0; EffNDE<4; EffNDE++){
66 m_eff_stationmapbase[ac][WS][EffNDE] = nullptr;
67 m_eff_stationmapmid[ac][WS][EffNDE] = nullptr;
68 m_eff_stationmap[ac][WS][EffNDE] = nullptr;
69 }
70 }
71 }
72
73 // Initialize to zero
74 for(int i=0;i<2;i++)// AC
75 for(int jTGC=0;jTGC<4;jTGC++)// TGC Station
76 for(int f=0;f<2;f++)// FE
77 for(int k=0;k<2;k++)// WireStrip
78 for(int x=0;x<4;x++){
79 m_mvt_extrprdsag[i][jTGC][f][k][x]=nullptr;
80 m_mvt_extrprdsag2[i][jTGC][f][k][x]=nullptr;
81 }
82 for(int k=0;k<2;k++)
83 for(int i=0;i<2;i++)
84 for(int x=0;x<4;x++){
85 m_tgc_prdcompsag[i][k][x]=nullptr;
86 }
87
88}
89
91 ATH_MSG_INFO( " deleting MdtVsTgcRawDataValAlg " );
92}
93
94// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
95
96StatusCode
99 ATH_MSG_INFO( "in initializing MdtVsTgcRawDataValAlg" );
100 // MuonDetectorManager from the conditions store
101 ATH_CHECK(m_DetectorManagerKey.initialize());
102 ATH_CHECK(m_idHelperSvc.retrieve());
103
104 //MDT z position
105 //Name MultiLayer TubeLayer z
106 //17 1 1 14142.5
107 //17 1 2 14168.5
108 //17 1 3 14194.5
109 //17 2 1 14394.6
110 //17 2 2 14420.6
111 //17 2 3 14446.6
112 //18 1 1 13726.5
113 //18 1 2 13752.5
114 //18 1 3 13778.5
115 //18 2 1 13978.6
116 //18 2 2 14004.6
117 //18 2 3 14030.6
118
119 // Retrieve the MuonDetectorManager
120 const MuonGM::MuonDetectorManager* MuonDetMgrDS=nullptr;
121 ATH_CHECK( detStore()->retrieve(MuonDetMgrDS) );
122 ATH_MSG_DEBUG( " Found the MuonDetectorManager from detector store. " );
123 prepareTREarray(MuonDetMgrDS);
128 return StatusCode::SUCCESS;
129}
130
131
132/*----------------------------------------------------------------------------------*/
134/*----------------------------------------------------------------------------------*/
135 ATH_MSG_DEBUG( "TGC RawData Monitoring Histograms being booked" );
136
137 //declare a group of histograms
138 std::string generic_path_mdtvstgclv1 = "Muon/MuonRawDataMonitoring/MDTvsTGC";
139 //MonGroup mdtvstgclv1_expert( this, generic_path_mdtvstgclv1+"/Global", expert, run );
140 MonGroup mdtvstgclv1_expert_a( this, generic_path_mdtvstgclv1+"/TGCEA", run, ATTRIB_UNMANAGED );
141 MonGroup mdtvstgclv1_expert_c( this, generic_path_mdtvstgclv1+"/TGCEC", run, ATTRIB_UNMANAGED );
142
143 if(newRunFlag()){
144 ATH_MSG_INFO( "MdtVsTgc RawData Monitoring : begin of run" );
145
146 ATH_CHECK( bookmaphists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
147 ATH_CHECK( bookeffhists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
148 }//isNewRun
149 return StatusCode::SUCCESS;
150}
151
152
153/*----------------------------------------------------------------------------------*/
154StatusCode MdtVsTgcRawDataValAlg::fillHistograms(const EventContext& ctx){
155/*----------------------------------------------------------------------------------*/
156 ATH_MSG_DEBUG( "MdtVsTgcRawDataValAlg::TGC RawData Monitoring Histograms being filled" );
157
158 //TGC PRD
160
161 //TGC Coincidence
163
164 ATH_MSG_DEBUG( "size of tgc container is " << tgc_coin_container -> size() );
165
166 //MDT PRD
168
170 tgceffcalc(mdt_segment_collection.cptr(), tgc_prd_container.cptr());
171 maphists(mdt_segment_collection.cptr(), tgc_prd_container.cptr());
172
173 //only analyze nSL==1
174 int nSL = numberOfSL(tgc_coin_container.cptr());
175
176 if(nSL==1){
177 //fill MDT hit vs TGC RoI
178 correlation(mdt_prd_container.cptr(), tgc_coin_container.cptr());
179 }
180
181
182 return StatusCode::SUCCESS; // statuscode check
183}
184/*----------------------------------------------------------------------------------*/
186/*----------------------------------------------------------------------------------*/
187
188 ATH_MSG_DEBUG( "MdtVsTgcRawDataValAlg finalize()" );
189 if(endOfRunFlag()){
192 }
193 return StatusCode::SUCCESS;
194}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
size_t size() const
Number of registered mappings.
#define x
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
A container of information describing a monitoring object.
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
MdtVsTgcRawDataValAlg(const std::string &type, const std::string &name, const IInterface *parent)
void prepareTREarray(const MuonGM::MuonDetectorManager *MuonDetMgrDS)
StatusCode bookmaphists(MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_tgc_PrepDataContainerName
StatusCode bookeffhists(MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
virtual StatusCode fillHistograms(const EventContext &ctx)
An inheriting class should either override this function or fillHists().
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
TH1 * m_mvt_extrprdsag2[2][4][2][2][4]
SG::ReadHandleKey< Muon::TgcCoinDataContainer > m_tgc_CoinContainerName
virtual StatusCode bookHistogramsRecurrent()
An inheriting class should either override this function, bookHists() or bookHistograms().
TH1 * m_mdt_trackdirdirsag[2][4][4][4]
void tgceffcalc(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
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
TH1 * m_mdt_trackchecksag[2][4][4][4][2]
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const_pointer_type cptr()
Dereference the pointer.