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"
26
27#include <inttypes.h>
28#include <sstream>
29#include <algorithm>
30#include <fstream>
31
33
34MdtVsTgcRawDataValAlg::MdtVsTgcRawDataValAlg( const std::string & type, const std::string & name, const IInterface* parent )
35 :ManagedMonitorToolBase( type, name, parent )
36{
37 // Declare the properties
38 declareProperty("CheckCabling", m_checkCabling=false);
39 declareProperty("TgcLv1File", m_tgclv1file=true);
40 declareProperty("ChamberName", m_chamberName="XXX");
41 declareProperty("StationSize", m_StationSize="XXX");
42 declareProperty("Sector", m_sector=0);
43 declareProperty("Side", m_side=0);
44 declareProperty("LastEvent", m_lastEvent=0);
45 declareProperty("CosmicStation", m_cosmicStation=0);
46 declareProperty("MdtAdcCut", m_MdtAdcCut=50);
47 declareProperty("MdtTdcCut", m_MdtTdcCut=1600);
48
49 // initialize class members
50
51 for(int ac=0; ac<2; ac++){
52 m_mvt_cutspassed[ac] = nullptr;
53 for(int jMDT=0; jMDT<4; jMDT++){
54 m_mdt_segmmap[ac][jMDT] = nullptr;
55 for(int sMDT=0; sMDT<4; sMDT++){
56 m_mdt_segmposdirsag[ac][jMDT][sMDT] = nullptr;
57 for(int iREPT=0; iREPT<4; iREPT++){
58 m_mdt_segmmatchsag[ac][jMDT][sMDT][iREPT] = nullptr;
59 m_mdt_trackdirdirsag[ac][jMDT][sMDT][iREPT] = nullptr;
60 m_mdt_trackchecksag[ac][jMDT][sMDT][iREPT][0] = nullptr;
61 m_mdt_trackchecksag[ac][jMDT][sMDT][iREPT][1] = nullptr;
62 }
63 }
64 }
65 for(int WS=0; WS<2; WS++){
66 for(int EffNDE=0; EffNDE<4; EffNDE++){
67 m_eff_stationmapbase[ac][WS][EffNDE] = nullptr;
68 m_eff_stationmapmid[ac][WS][EffNDE] = nullptr;
69 m_eff_stationmap[ac][WS][EffNDE] = nullptr;
70 }
71 }
72 }
73
74 // Initialize to zero
75 for(int i=0;i<2;i++)// AC
76 for(int jTGC=0;jTGC<4;jTGC++)// TGC Station
77 for(int f=0;f<2;f++)// FE
78 for(int k=0;k<2;k++)// WireStrip
79 for(int x=0;x<4;x++){
80 m_mvt_extrprdsag[i][jTGC][f][k][x]=nullptr;
81 m_mvt_extrprdsag2[i][jTGC][f][k][x]=nullptr;
82 }
83 for(int k=0;k<2;k++)
84 for(int i=0;i<2;i++)
85 for(int x=0;x<4;x++){
86 m_tgc_prdcompsag[i][k][x]=nullptr;
87 }
88
89}
90
92 ATH_MSG_INFO( " deleting MdtVsTgcRawDataValAlg " );
93}
94
95// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
96
97StatusCode
100 ATH_MSG_INFO( "in initializing MdtVsTgcRawDataValAlg" );
101 // MuonDetectorManager from the conditions store
102 ATH_CHECK(m_DetectorManagerKey.initialize());
103 ATH_CHECK(m_idHelperSvc.retrieve());
104
105 //MDT z position
106 //Name MultiLayer TubeLayer z
107 //17 1 1 14142.5
108 //17 1 2 14168.5
109 //17 1 3 14194.5
110 //17 2 1 14394.6
111 //17 2 2 14420.6
112 //17 2 3 14446.6
113 //18 1 1 13726.5
114 //18 1 2 13752.5
115 //18 1 3 13778.5
116 //18 2 1 13978.6
117 //18 2 2 14004.6
118 //18 2 3 14030.6
119
120 // Retrieve the MuonDetectorManager
121 const MuonGM::MuonDetectorManager* MuonDetMgrDS=nullptr;
122 ATH_CHECK( detStore()->retrieve(MuonDetMgrDS) );
123 ATH_MSG_DEBUG( " Found the MuonDetectorManager from detector store. " );
124 prepareTREarray(MuonDetMgrDS);
129 return StatusCode::SUCCESS;
130}
131
132
133/*----------------------------------------------------------------------------------*/
135/*----------------------------------------------------------------------------------*/
136 ATH_MSG_DEBUG( "TGC RawData Monitoring Histograms being booked" );
137
138 //declare a group of histograms
139 std::string generic_path_mdtvstgclv1 = "Muon/MuonRawDataMonitoring/MDTvsTGC";
140 //MonGroup mdtvstgclv1_expert( this, generic_path_mdtvstgclv1+"/Global", expert, run );
141 MonGroup mdtvstgclv1_expert_a( this, generic_path_mdtvstgclv1+"/TGCEA", run, ATTRIB_UNMANAGED );
142 MonGroup mdtvstgclv1_expert_c( this, generic_path_mdtvstgclv1+"/TGCEC", run, ATTRIB_UNMANAGED );
143
144 if(newRunFlag()){
145 ATH_MSG_INFO( "MdtVsTgc RawData Monitoring : begin of run" );
146
147 ATH_CHECK( bookmaphists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
148 ATH_CHECK( bookeffhists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
149 }//isNewRun
150 return StatusCode::SUCCESS;
151}
152
153
154/*----------------------------------------------------------------------------------*/
156/*----------------------------------------------------------------------------------*/
157 ATH_MSG_DEBUG( "MdtVsTgcRawDataValAlg::TGC RawData Monitoring Histograms being filled" );
158
159 //TGC PRD
161
162 //TGC Coincidence
164
165 ATH_MSG_DEBUG( "size of tgc container is " << tgc_coin_container -> size() );
166
167 //MDT PRD
169
171 tgceffcalc(mdt_segment_collection.cptr(), tgc_prd_container.cptr());
172 maphists(mdt_segment_collection.cptr(), tgc_prd_container.cptr());
173
174 //only analyze nSL==1
175 int nSL = numberOfSL(tgc_coin_container.cptr());
176
177 if(nSL==1){
178 //fill MDT hit vs TGC RoI
179 correlation(mdt_prd_container.cptr(), tgc_coin_container.cptr());
180 }
181
182
183 return StatusCode::SUCCESS; // statuscode check
184}
185/*----------------------------------------------------------------------------------*/
187/*----------------------------------------------------------------------------------*/
188
189 ATH_MSG_DEBUG( "MdtVsTgcRawDataValAlg finalize()" );
190 if(endOfRunFlag()){
193 }
194 return StatusCode::SUCCESS;
195}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#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
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 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().
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.
Definition run.py:1