ATLAS Offline Software
MdtVsRpcRawDataValAlg.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 : MdtVsRpcRawDataValAlg
7 // Authors: N. Benekos(Illinois) - G. Chiodini(INFN-Lecce)
8 // Aug. 2007
9 //
10 // DESCRIPTION:
11 // Subject: MDTvsRPC-->Offline Muon Data Quality
13 
14 #include "MdtVsRpcRawDataValAlg.h"
15 
16 #include <sstream>
17 
19 #include "GaudiKernel/MsgStream.h"
24 #include "MuonRDO/RpcCoinMatrix.h"
26 #include "MuonRDO/RpcPad.h"
28 namespace {
29 static constexpr int maxPRD = 50000;
30 
31 // mdt stuff
32 static constexpr int maxPrd = 50000;
33 static constexpr int ncutadc = 50;
34 
35 static constexpr int TDCminrange = 0;
36 static constexpr int TDCmaxrange = 2000;
37 static constexpr int TDCNbin = 200;
38 } // namespace
39 
41 // *********************************************************************
42 // Public Methods
43 // *********************************************************************
44 
46  const std::string& name,
47  const IInterface* parent)
49  // Declare the properties
50  declareProperty("DoMdtvsRpcEsd", m_doMdtvsRpcESD = true);
51  declareProperty("MdtvsRpcChamberHist", m_mdtvsrpcchamberhist = false);
52  declareProperty("MdtvsRpcSectorHist", m_mdtvsrpcsectorhist = false);
53  declareProperty("MdtvsRpcReduceRpcNbins", m_mdtvsrpcreducerpcnbins = 8);
54  declareProperty("MdtvsRpcReduceMdtNbins", m_mdtvsrpcreducemdtnbins = 8);
55  declareProperty("MdtvsRpcReduceMdtTDCNbins",
57  declareProperty("ChamberName", m_chamberName = "XXX");
58  declareProperty("StationSize", m_StationSize = "XXX");
59  declareProperty("StationEta", m_StationEta = -100);
60  declareProperty("StationPhi", m_StationPhi = -100);
61  declareProperty("LastEvent", m_lastEvent = 0);
62  declareProperty("Sector", m_sector = 0);
63  declareProperty("CosmicStation", m_cosmicStation = 0);
64  declareProperty("Side", m_side = 0);
65  declareProperty("Clusters", m_doClusters = false);
66  declareProperty("ClusterContainer", m_clusterContainerName = "rpcClusters");
67 }
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
72  ATH_MSG_INFO("in initializing MdtVsRpcRawDataValAlg");
73  // MuonDetectorManager from the conditions store
75  ATH_CHECK(m_idHelperSvc.retrieve());
76  ATH_CHECK(m_key_mdt.initialize());
77  ATH_CHECK(m_key_rpc.initialize());
78 
79  const MdtIdHelper& mdtIdHelper{m_idHelperSvc->mdtIdHelper()};
80  m_BISid = mdtIdHelper.stationNameIndex("BIS");
81  m_BMLid = mdtIdHelper.stationNameIndex("BML");
82  m_BOLid = mdtIdHelper.stationNameIndex("BOL");
83  m_BMFid = mdtIdHelper.stationNameIndex("BMF");
84 
85  return StatusCode::SUCCESS;
86 }
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
90  StatusCode sc = StatusCode::SUCCESS;
92  "MdtVsRpcRawDataValAlg::MDT-RPC correlation RawData Monitoring "
93  "Histograms being filled");
94 
95  if (!m_doMdtvsRpcESD)
96  return StatusCode::SUCCESS;
97 
100  return StatusCode::SUCCESS;
101 
102  std::string layer_name{}, sector_name{}, layerSector_name{};
103 
104  // declare a group of histograms
105  std::string generic_path_mdtvsrpcmonitoring =
106  "Muon/MuonRawDataMonitoring/MDTvsRPC";
107  MonGroup mdtrpc_shift_dqmf(this, generic_path_mdtvsrpcmonitoring + "/Dqmf",
109 
110  sc = mdtrpc_shift_dqmf.getHist(m_MdtRpcZdiff, "MdtRpcZdifference");
111  if (sc.isFailure())
112  ATH_MSG_WARNING("couldn't register MdtRpcZdifference hist to MonGroup");
113 
114  sc = mdtrpc_shift_dqmf.getHist(m_MdtNHitsvsRpcNHits, "MdtNHitsvsRpcNHits");
115  if (sc.isFailure())
117  "couldn't register MdtNHitsvsRpcNHits hist to MonGroup");
118 
119  // mdt stuff begin
120  int nPrdmdt = 0;
121  Identifier dig_idmdt;
122 
124  ATH_MSG_DEBUG("****** mdt->size() : " << mdt_container->size());
125 
127  // mdt stuff end
128 
130 
131  // MuonDetectorManager from the conditions store
134  if (!MuonDetMgr.isValid()) {
136  "Null pointer to the read MuonDetectorManager conditions object");
137  return StatusCode::FAILURE;
138  }
139  ATH_MSG_DEBUG("****** rpc->size() : " << rpc_container->size());
140 
141  int nPrd = 0;
142 
143  std::string type = "RPC";
144 
145  float Nhitsrpc{0.f}, Nhitsmdt{0.f};
146  for (const Muon::RpcPrepDataCollection* rpc_coll : *rpc_container) {
147  Nhitsrpc += rpc_coll->size();
148  }
149  for (const Muon::MdtPrepDataCollection* mdt_coll : *mdt_container) {
150  Nhitsmdt +=
151  mdt_coll->size() * !m_idHelperSvc->isEndcap(mdt_coll->identify());
152  }
153 
154  Nhitsrpc = Nhitsrpc > 0 ? std::log10(Nhitsrpc) : -0.5;
155  Nhitsmdt = Nhitsmdt > 0 ? std::log10(Nhitsmdt) : -0.5;
156 
157  m_MdtNHitsvsRpcNHits->Fill(Nhitsrpc, Nhitsmdt);
158 
159  int N_RpcHitdblPhi1{0}, N_RpcHitdblPhi2{0};
160 
161  const RpcIdHelper& rpcIdHelper{m_idHelperSvc->rpcIdHelper()};
162  const MdtIdHelper& mdtIdHelper{m_idHelperSvc->mdtIdHelper()};
163 
164  for (const Muon::RpcPrepDataCollection* rpc_coll : *rpc_container) {
165  for (const Muon::RpcPrepData* rpcPrd : *rpc_coll) {
166  if (nPrd > maxPRD) {
167  ATH_MSG_WARNING("More than " << maxPRD << " RPC PrepRawData");
168  break;
169  }
170  Identifier prd_id = rpcPrd->identify();
171 
172  int irpcstationPhi = rpcIdHelper.stationPhi(prd_id);
173  int irpcstationName = rpcIdHelper.stationName(prd_id);
174  int irpcstationEta = rpcIdHelper.stationEta(prd_id);
175  int irpcdoubletR = rpcIdHelper.doubletR(prd_id);
176  int irpcmeasuresPhi = rpcIdHelper.measuresPhi(prd_id);
177  // only take eta hits
178  if (irpcmeasuresPhi != 0)
179  continue;
180  int irpcdoubletPhi = rpcIdHelper.doubletPhi(prd_id);
181  int irpcdoubletZ = rpcIdHelper.doubletZ(prd_id);
182  int irpcstrip = rpcIdHelper.strip(prd_id);
183 
184  std::string hardware_name = convertChamberName(
185  irpcstationName, irpcstationEta, irpcstationPhi, type);
186 
187  if (!selectChambersRange(
188  hardware_name, m_chamberName, irpcstationEta, m_StationEta,
189  irpcstationPhi, m_StationPhi, m_StationSize) ||
190  !chambersCosmicSetup(hardware_name, m_cosmicStation))
191  continue;
192  // define layer
193  int imdt_multi_near = 0;
194  if ((irpcstationName > m_BISid) &&
195  (irpcstationName < m_BOLid || irpcstationName == m_BMFid)) {
196  if (irpcdoubletR == 1) {
197  layer_name = "LowPt";
198  imdt_multi_near = 1;
199  } else {
200  layer_name = "Pivot";
201  imdt_multi_near = 2;
202  }
203  } else {
204  layer_name = "HighPt";
205  imdt_multi_near = 2;
206  if (irpcstationName != 4)
207  imdt_multi_near = 1;
208  }
209 
210  // define sector
211  int side = 'A';
212  if (irpcstationEta < 0) {
213  side = 'C';
214  }
215  int sector = 2 * irpcstationPhi;
216  if (irpcstationName == m_BMLid || irpcstationName == m_BOLid)
217  sector--;
218  char sector_char[1000];
219  sprintf(sector_char, "Sector%.2d", sector);
220  sector_name = sector_char;
221 
222  layerSector_name = sector_name + layer_name;
223 
224  int NetaStrips = 0;
225  std::array<int, 4> ShiftEtaStripsDoubletZ{};
226  for (int idbz = 0; idbz != 3; idbz++) {
227  ShiftEtaStripsDoubletZ[idbz] = NetaStrips;
228  Identifier id = rpcIdHelper.channelID(
229  irpcstationName, irpcstationEta, irpcstationPhi,
230  irpcdoubletR, idbz + 1, 1, 1, 1,
231  1); // last 4 arguments are: int doubletPhi, int gasGap,
232  // int measuresPhi, int strip
233 
234  const MuonGM::RpcReadoutElement* rpc =
235  MuonDetMgr->getRpcReadoutElement(id);
236  if (rpc) {
237  NetaStrips += rpc->NetaStrips();
238  }
239  }
240 
241  bool histo_flag = true;
242  for (const std::string& iter : m_layerSector_name_list) {
243  if ((sector_name + layerSector_name) == iter) {
244  histo_flag = false;
245  }
246  }
247 
248  if (histo_flag) {
249  // Get the RPC axis range
250 
252  // the eta strip number increases going far away from IP
253  // the phi strip numeber increases going from HV side to RO side
254  float stripzmin{0}, stripzmax{-10000};
255  // the RpcIdHelper stationEta ranges from -8 to 8
256  for (int ieta = rpcIdHelper.stationEtaMin();
257  ieta < rpcIdHelper.stationEtaMax(); ieta++) {
258  for (int idbz = 0; idbz != 3; idbz++) {
259  Identifier id = rpcIdHelper.channelID(
260  irpcstationName, ieta, irpcstationPhi, irpcdoubletR,
261  idbz + 1, 1, 1, 1,
262  1); // last 4 arguments are: int doubletPhi, int
263  // gasGap, int measuresPhi, int strip
264 
265  const MuonGM::RpcReadoutElement* rpc =
266  MuonDetMgr->getRpcReadoutElement(id);
267  if (rpc) {
268  const Amg::Vector3D r1 = rpc->globalPosition();
269  float pitch = rpc->StripPitch(0);
270 
271  float z1 = r1.z() - (rpc->NetaStrips()) * pitch / 2;
272  if (z1 < stripzmin) {
273  stripzmin = z1;
274  }
275  float z2 = r1.z() + (rpc->NetaStrips()) * pitch / 2;
276  if (z2 > stripzmax) {
277  stripzmax = z2;
278  }
279 
280  } // check for nullptr
281  } // for loop in idbz
282 
283  } // for loop in etastation
284 
285  // get the MDT axis range
286  float wirezmax{-10000.}, wirezmin{+10000.}, foundmin{0};
287 
288  const int mdtStatName = irpcstationName;
289 
290  for (int stEta = mdtIdHelper.stationEtaMin(true);
291  stEta <= mdtIdHelper.stationEtaMax(true); ++stEta) {
292  const Identifier mdt_id = mdtIdHelper.channelID(
293  mdtStatName, stEta, irpcstationPhi, imdt_multi_near, 1,
294  1);
295  const MuonGM::MdtReadoutElement* lastdescr =
296  MuonDetMgr->getMdtReadoutElement(mdt_id);
297  if (!lastdescr)
298  continue;
299 
300  const Amg::Vector3D lastelc = lastdescr->globalPosition();
301  int NtubesPerLayerlast = lastdescr->getNtubesperlayer();
302  constexpr float conv_fac = 0.5 / 29.9;
303  float z = lastelc.z() + NtubesPerLayerlast * conv_fac;
304 
305  if (foundmin == 0) {
306  wirezmin = z;
307  }
308  foundmin = 1;
309  if (z > wirezmax)
310  wirezmax = z;
311 
312  } // loop over eta
313 
314  m_layerSector_name_list.push_back(sector_name +
315  layerSector_name);
316  ATH_MSG_DEBUG(" strip zmin and zmax" << stripzmin << " "
317  << stripzmax);
318 
320  bookMDTvsRPCsectorHistograms(sector_name, layer_name,
321  stripzmin, stripzmax, wirezmin,
322  wirezmax);
323 
324  } // if histo_flag
325 
326  // Per Sector
327  const MuonDQAHistList& hists1 = m_stationHists.getList(sector_name);
328  TH2* mdttubevsrpcetastripsector;
329 
330  // get information from geomodel to book and fill rpc histos with
331  // the right max strip number
332  const MuonGM::RpcReadoutElement* descriptor =
333  MuonDetMgr->getRpcReadoutElement(prd_id);
334  const Amg::Vector3D stripPos = descriptor->stripPos(prd_id);
335  ATH_MSG_DEBUG("rpc coord" << stripPos.z() << stripPos.perp());
336  float irpcstripz = float(stripPos.z());
337 
338  int ShiftPhiStrips =
339  descriptor->NphiStrips() * (irpcdoubletPhi - 1);
340 
341  int ShiftEtaStrips = ShiftEtaStripsDoubletZ[irpcdoubletZ - 1];
342 
343  int ShiftStrips = ShiftEtaStrips;
344 
345  // re-define for phi view
346  if (irpcmeasuresPhi == 1) {
347  ShiftStrips = ShiftPhiStrips;
348  }
349 
350  // define sectorlogic
351  int sectorlogic = (sector - 1) * 2;
352  if (irpcdoubletPhi == 1)
353  sectorlogic -= 1;
354  if (sectorlogic < 0)
355  sectorlogic += 32;
356  if (side == 'A')
357  sectorlogic += 32;
358 
359  ++nPrd;
360  ATH_MSG_DEBUG(" PRD number " << nPrd);
361 
363 
365  // to fix IConversionSvc ptr not set DataProxy\ufffd: appearing in
366  // every event loop in MdtPrepDataContainer
367  for (const Muon::MdtPrepDataCollection* mdt_coll : *mdt_container) {
368  // check size of the MdtPrepDataContainer
369 
370  dig_idmdt = mdt_coll->identify();
371  int imdt_station = mdtIdHelper.stationName(dig_idmdt);
372  if (imdt_station != irpcstationName)
373  continue;
374  int imdt_eta = mdtIdHelper.stationEta(dig_idmdt);
375  if (imdt_eta != irpcstationEta)
376  continue;
377  int imdt_phi = mdtIdHelper.stationPhi(dig_idmdt);
378  if (imdt_phi != irpcstationPhi)
379  continue;
380 
381  // loop over hits
382  for (const Muon::MdtPrepData* mdtPrd : *mdt_coll) {
383  dig_idmdt = mdtPrd->identify();
384  int imdt_multi = mdtIdHelper.multilayer(dig_idmdt);
385  // only look at near multilayer
386  if (imdt_multi != imdt_multi_near)
387  continue;
388  int imdt_adc = mdtPrd->adc();
389  // cut on noise
390  if (imdt_adc < ncutadc)
391  continue;
392  int imdt_tdc = mdtPrd->tdc();
393  int imdt_wire = mdtIdHelper.tube(dig_idmdt);
394 
395  // get mdt information from geomodel to book and fill
396  // mdtvsrpc histos with the right min and max range
397  const MuonGM::MdtReadoutElement* mdt =
398  mdtPrd->detectorElement();
399  int NetaTubes = mdt->getNtubesperlayer();
400  const Amg::Vector3D elc = mdt->globalPosition();
401  float imdt_wirez = elc.z();
402  float tubeRadius = mdt->innerTubeRadius();
403  if (imdt_wirez >= 0) {
404  imdt_wirez +=
405  (float(imdt_wire) - 0.5 - float(NetaTubes) / 2) *
406  tubeRadius;
407  } else {
408  imdt_wirez = imdt_wirez - (float(imdt_wire) - 0.5 -
409  float(NetaTubes) / 2) *
410  tubeRadius;
411  }
412 
413  // fill histos
414  if (m_mdtvsrpcchamberhist) {
415  bool histo_flag = true;
416  for (const std::string& iter : m_layer_name_list) {
417  if ((hardware_name + layer_name) == iter) {
418  histo_flag = false;
419  }
420  }
421  if (histo_flag) {
422  bool is_valid{false};
423  const Identifier mdt_id = mdtIdHelper.channelID(
424  irpcstationName, irpcstationEta, irpcstationPhi,
425  imdt_multi_near, 1, 1, is_valid);
426  if (!is_valid) continue;
427  imdt_eta = irpcstationEta;
428  imdt_phi = irpcstationPhi;
429  NetaTubes = 0;
430  const MuonGM::MdtReadoutElement* mdt =
431  MuonDetMgr->getMdtReadoutElement(mdt_id);
432  if (!mdt)
433  continue; // protection
434  NetaTubes = mdt->getNtubesperlayer();
435  m_layer_name_list.push_back(hardware_name +
436  layer_name);
437  if (NetaTubes != 0)
439  hardware_name, layer_name, NetaStrips, 0,
440  NetaStrips, NetaTubes, 0, NetaTubes);
441  }
442  // Per chamber
443  const MuonDQAHistList& hists =
444  m_stationHists.getList(hardware_name);
445  // tube vs strip - doublephi separated
446  TH2* mdttubevsrpcetastrip_doublphi1 =
447  hists.getH2(hardware_name + "_" + layer_name +
448  "_MDTtube_vs_RPCstrip_doublPhi1");
449  TH2* mdttubevsrpcetastrip_doublphi2 =
450  hists.getH2(hardware_name + "_" + layer_name +
451  "_MDTtube_vs_RPCstrip_doublPhi2");
452  // tdc of mdt - doublephi separated
453  TH1* mdttdcdoublphi1 =
454  hists.getH1(hardware_name + "_" + layer_name +
455  "_MDTtdc_doublPhi1");
456  TH1* mdttdcdoublphi2 =
457  hists.getH1(hardware_name + "_" + layer_name +
458  "_MDTtdc_doublPhi2");
459 
460  // tdc of mdt
461  // tube vs strip doublephi separated
462  constexpr float tdc_adc_conv = 25.0 / 32.0;
463  if (irpcdoubletPhi == 1) {
464  if (N_RpcHitdblPhi1 == 0) {
465  if (mdttdcdoublphi1) {
466  mdttdcdoublphi1->Fill(float(imdt_tdc) *
467  tdc_adc_conv);
468  }
469  }
470  if (mdttubevsrpcetastrip_doublphi1) {
471  mdttubevsrpcetastrip_doublphi1->Fill(
472  (irpcstrip + ShiftStrips), imdt_wire);
473  }
474  } else {
475  if (N_RpcHitdblPhi2 == 0) {
476  if (mdttdcdoublphi2) {
477  mdttdcdoublphi2->Fill(float(imdt_tdc) *
478  tdc_adc_conv);
479  }
480  }
481  if (mdttubevsrpcetastrip_doublphi2) {
482  mdttubevsrpcetastrip_doublphi2->Fill(
483  (irpcstrip + ShiftStrips), imdt_wire);
484  }
485  }
486 
487  } // end if on mdtvsrpcchamberhist
488  if (m_mdtvsrpcsectorhist) {
489  mdttubevsrpcetastripsector =
490  hists1.getH2(sector_name + "_" + layer_name +
491  "_MDTtube_vs_RPCstrip");
492  if (mdttubevsrpcetastripsector) {
493  mdttubevsrpcetastripsector->Fill((float)irpcstripz,
494  (float)imdt_wirez);
495  } else {
497  "mdttubevsrpcetastripsector not in hist list!");
498  }
499  }
500  // shifter histogram
501  double mdt_rpc_dz = imdt_wirez - irpcstripz;
502  m_MdtRpcZdiff->Fill(mdt_rpc_dz);
503 
504  ++nPrdmdt;
505  ATH_MSG_DEBUG(" MdtPrepData number: " << nPrdmdt);
506 
507  if (nPrdmdt > maxPrd - 1) {
509  "Maximum number of MdtPrepData in the ntuple "
510  "reached: "
511  << maxPrd);
512  return StatusCode::SUCCESS;
513  }
514 
515  } // loop on MDT Collection
516 
517  } // loop on MDT Container
519  if (irpcdoubletPhi == 1) {
520  N_RpcHitdblPhi1++;
521  } else {
522  N_RpcHitdblPhi2++;
523  }
524 
525  ATH_MSG_DEBUG(" RpcPrepData number: " << nPrd);
526 
527  }
528  }
529 
530  return StatusCode::SUCCESS; // statuscode check
531 }
532 
533 /*----------------------------------------------------------------------------------*/
535 /*----------------------------------------------------------------------------------*/
536 {
537  ATH_MSG_DEBUG("MdtVsRpcRawDataValAlg Monitoring Histograms being booked");
538 
539  if (!m_doMdtvsRpcESD) {
540  return StatusCode::SUCCESS;
541  }
544  return StatusCode::SUCCESS;
545 
546  if (!newRunFlag())
547  return StatusCode::SUCCESS;
548  // declare a group of histograms
549  std::string generic_path_mdtvsrpcmonitoring =
550  "Muon/MuonRawDataMonitoring/MDTvsRPC";
551  MonGroup mdtrpc_shift_dqmf(this, generic_path_mdtvsrpcmonitoring + "/Dqmf",
553 
554  ATH_MSG_DEBUG("MdtVsRpcRawDataValAlg : isNewRun");
555  // Book RAW or ESD capable histos
556 
557  // SHIFTer histograms
558  // distribution of difference Zmdt - Zrpc
559  float maxdz = 1500; // mm
560  std::string MdtRpcZdiff_title = "MdtRpcZdifference";
561  const char* MdtRpcZdiff_title_char = MdtRpcZdiff_title.c_str();
562 
563  TH1* MdtRpcZdiff = new TH1I(MdtRpcZdiff_title_char, MdtRpcZdiff_title_char,
564  100, -maxdz, maxdz);
565  ATH_CHECK(mdtrpc_shift_dqmf.regHist(MdtRpcZdiff));
566  MdtRpcZdiff->GetXaxis()->SetTitle("Z mdt tube - Z rpc strip [mm]");
567  MdtRpcZdiff->GetYaxis()->SetTitle("Counts");
568  MdtRpcZdiff->SetFillColor(42);
569 
570  ATH_MSG_DEBUG("INSIDE bookHistograms : " << MdtRpcZdiff
571  << MdtRpcZdiff_title.c_str());
572  ATH_MSG_DEBUG("RUN : " << run);
573  ATH_MSG_DEBUG("Booked MdtRpcZdifference successfully");
574 
575  // correlation number of MDT hits vs RPC hits
576  std::string MdtNHitsvsRpcNHits_title = "MdtNHitsvsRpcNHits";
577  const char* MdtNHitsvsRpcNHits_title_char =
578  MdtNHitsvsRpcNHits_title.c_str();
579 
580  TH2* MdtNHitsvsRpcNHits =
581  new TH2I(MdtNHitsvsRpcNHits_title_char, MdtNHitsvsRpcNHits_title_char,
582  11, -1, 10, 11, -1, 10);
583  ATH_CHECK(mdtrpc_shift_dqmf.regHist(MdtNHitsvsRpcNHits));
584 
585  MdtNHitsvsRpcNHits->GetYaxis()->SetTitle("Number of MDT hits (10dB)");
586  MdtNHitsvsRpcNHits->GetXaxis()->SetTitle("Number of RPC hits (10dB)");
587  MdtNHitsvsRpcNHits->SetFillColor(42);
588  MdtNHitsvsRpcNHits->SetOption("COLZ");
589  MdtNHitsvsRpcNHits->SetMarkerColor(1);
590  MdtNHitsvsRpcNHits->SetMarkerStyle(21);
591  MdtNHitsvsRpcNHits->SetMarkerSize(0.2);
592 
593  ATH_MSG_DEBUG("INSIDE bookHistograms : "
594  << MdtNHitsvsRpcNHits << MdtNHitsvsRpcNHits_title.c_str());
595  ATH_MSG_DEBUG("RUN : " << run);
596  ATH_MSG_DEBUG("Booked MdtNHitsvsRpcNHits successfully");
597 
598  return StatusCode::SUCCESS;
599 }
600 /*----------------------------------------------------------------------------------*/
601 // input hardware name as produced from convertChamberName()
603  const std::string& hardware_name, const std::string& layer_name, int binz,
604  int binminz, int binmaxz, int binx, int binminx, int binmaxx) {
605 
606  if (!m_doMdtvsRpcESD) {
607  return;
608  }
611  return;
612 
613  binz = binz / m_mdtvsrpcreducerpcnbins;
614  binx = binx / m_mdtvsrpcreducemdtnbins;
615 
616  // declare a group of histograms
617  std::string generic_path_mdtvsrpcmonitoring =
618  "Muon/MuonRawDataMonitoring/MDTvsRPC";
619  MonGroup mdtvsrpc_prd_expert(
620  this, generic_path_mdtvsrpcmonitoring + "/Chambers/" + hardware_name,
622  MuonDQAHistList& lst = m_stationHists.getList(hardware_name);
623 
625  // histo path for mdt vrs rpc
626 
627  // mdt vs rpc - doublephi separated
628  std::string mdtvsrpc_dphi1_title =
629  hardware_name + "_" + layer_name + "_MDTtube_vs_RPCstrip_doublPhi1";
630  std::string mdtvsrpc_dphi2_title =
631  hardware_name + "_" + layer_name + "_MDTtube_vs_RPCstrip_doublPhi2";
632  const char* mdtvsrpc_dphi1_title_char = mdtvsrpc_dphi1_title.c_str();
633  const char* mdtvsrpc_dphi2_title_char = mdtvsrpc_dphi2_title.c_str();
634 
635  TH2* mdttubevsrpcetastrip_doublphi1 =
636  new TH2I(mdtvsrpc_dphi1_title_char, mdtvsrpc_dphi1_title_char, binz,
637  binminz, binmaxz, binx, binminx, binmaxx);
638  lst.addHist(mdttubevsrpcetastrip_doublphi1);
639  // mdtvsrpcexp_prd.regHist(mdttubevsrpcetastrip_doublphi1);
640  mdttubevsrpcetastrip_doublphi1->SetOption("COLZ");
641  mdttubevsrpcetastrip_doublphi1->SetFillColor(42);
642  mdttubevsrpcetastrip_doublphi1->SetMarkerColor(1);
643  mdttubevsrpcetastrip_doublphi1->SetMarkerStyle(21);
644  mdttubevsrpcetastrip_doublphi1->SetMarkerSize(0.2); // 1
645  mdttubevsrpcetastrip_doublphi1->GetXaxis()->SetTitle(
646  "<--- IP Rpc Eta strip EC --->");
647  mdttubevsrpcetastrip_doublphi1->GetYaxis()->SetTitle(
648  "<--- IP Mdt wire number ADC Cut ON EC --->");
649 
650  if (mdtvsrpc_prd_expert.regHist(mdttubevsrpcetastrip_doublphi1)
651  .isFailure()) {
653  "couldn't register mdttubevsrpcetastrip_doublphi1 hist to "
654  "MonGroup");
655  }
656  TH2* mdttubevsrpcetastrip_doublphi2 =
657  new TH2I(mdtvsrpc_dphi2_title_char, mdtvsrpc_dphi2_title_char, binz,
658  binminz, binmaxz, binx, binminx, binmaxx);
659  lst.addHist(mdttubevsrpcetastrip_doublphi2);
660  // mdtvsrpcexp_prd.regHist(mdttubevsrpcetastrip_doublphi2);
661  mdttubevsrpcetastrip_doublphi2->SetOption("COLZ");
662  mdttubevsrpcetastrip_doublphi2->SetFillColor(42);
663  mdttubevsrpcetastrip_doublphi2->SetMarkerColor(1);
664  mdttubevsrpcetastrip_doublphi2->SetMarkerStyle(21);
665  mdttubevsrpcetastrip_doublphi2->SetMarkerSize(0.2); // 1
666  mdttubevsrpcetastrip_doublphi2->GetXaxis()->SetTitle(
667  "<--- IP Rpc Eta strip EC --->");
668  mdttubevsrpcetastrip_doublphi2->GetYaxis()->SetTitle(
669  "<--- IP Mdt wire number ADC Cut ON EC --->");
670 
671  if (mdtvsrpc_prd_expert.regHist(mdttubevsrpcetastrip_doublphi2)
672  .isFailure()) {
674  "couldn't register mdttubevsrpcetastrip_doublphi2 hist to "
675  "MonGroup");
676  }
677  ATH_MSG_DEBUG("INSIDE bookMDTvsRPCHistograms doublPhi 1: "
678  << mdttubevsrpcetastrip_doublphi1);
679  ATH_MSG_DEBUG("INSIDE bookMDTvsRPCHistograms doublPhi 2: "
680  << mdttubevsrpcetastrip_doublphi1);
681  ATH_MSG_DEBUG("RUN : " << run);
682 
684  // histo path for mdt tdc for doublphi1 and 2
685  // doubletphi 1
686 
687  std::string generic_path_mdttdcdoublphi1 =
688  "/muoncosmics/MDTvsRPC/Chambers/" + hardware_name + "/" + layer_name;
689  std::string mdttdcdoublphi1_title =
690  hardware_name + "_" + layer_name + "_MDTtdc_doublPhi1";
691  const char* mdttdcdoublphi1_title_char = mdttdcdoublphi1_title.c_str();
692 
693  TH1* mdttdcdoublphi1 = new TH1I(
694  mdttdcdoublphi1_title_char, mdttdcdoublphi1_title_char,
695  TDCNbin / m_mdtvsrpcreducemdttdcnbins, TDCminrange, TDCmaxrange);
696  lst.addHist(mdttdcdoublphi1);
697  // mdtvsrpcexp_prd.regHist(mdttdcdoublphi1);
698  mdttdcdoublphi1->SetFillColor(42);
699  mdttdcdoublphi1->SetMarkerColor(1);
700  mdttdcdoublphi1->SetMarkerStyle(21);
701  mdttdcdoublphi1->SetMarkerSize(0.2);
702  mdttdcdoublphi1->GetXaxis()->SetTitle("Time Spectrum [ns]");
703  mdttdcdoublphi1->GetYaxis()->SetTitle("Counts");
704 
705  if (mdtvsrpc_prd_expert.regHist(mdttdcdoublphi1).isFailure()) {
706  ATH_MSG_WARNING("couldn't register mdttdcdoublphi1 hist to MonGroup");
707  }
708  ATH_MSG_DEBUG("INSIDE bookmdttdcdoublphi1Histograms: "
709  << mdttdcdoublphi1 << generic_path_mdttdcdoublphi1);
710  ATH_MSG_DEBUG("RUN : " << run);
711 
712  // --------------- doublphi2
713 
714  std::string generic_path_mdttdcdoublphi2 =
715  "/muoncosmics/MDTvsRPC/Chambers/" + hardware_name + "/" + layer_name;
716  std::string mdttdcdoublphi2_title =
717  hardware_name + "_" + layer_name + "_MDTtdc_doublPhi2";
718  const char* mdttdcdoublphi2_title_char = mdttdcdoublphi2_title.c_str();
719 
720  TH1* mdttdcdoublphi2 = new TH1I(
721  mdttdcdoublphi2_title_char, mdttdcdoublphi2_title_char,
722  TDCNbin / m_mdtvsrpcreducemdttdcnbins, TDCminrange, TDCmaxrange);
723  lst.addHist(mdttdcdoublphi2);
724  // mdtvsrpcexp_prd.regHist(mdttdcdoublphi2);
725  mdttdcdoublphi2->SetFillColor(42);
726  mdttdcdoublphi2->SetMarkerColor(1);
727  mdttdcdoublphi2->SetMarkerStyle(21);
728  mdttdcdoublphi2->SetMarkerSize(0.2);
729  mdttdcdoublphi2->GetXaxis()->SetTitle("Time Spectrum [ns]");
730  mdttdcdoublphi2->GetYaxis()->SetTitle("Counts");
731 
732  if (mdtvsrpc_prd_expert.regHist(mdttdcdoublphi2).isFailure()) {
733  ATH_MSG_WARNING("couldn't register mdttdcdoublphi2 hist to MonGroup");
734  }
735 
736  ATH_MSG_DEBUG("INSIDE bookmdttdcdoublphi2Histograms: "
737  << mdttdcdoublphi2 << generic_path_mdttdcdoublphi2.c_str());
738  ATH_MSG_DEBUG("RUN : " << run);
739 }
740 /*----------------------------------------------------------------------------------*/
742  const std::string& sector_name, const std::string& layer_name,
743  float stripzmin, float stripzmax, float wirezmin, float wirezmax) {
744  if (!m_doMdtvsRpcESD) {
745  return;
746  }
749  return;
750 
751  // declare a group of histograms
752  std::string generic_path_mdtvsrpcmonitoring =
753  "Muon/MuonRawDataMonitoring/MDTvsRPC";
754  MonGroup mdtvsrpc_prd_shift(
755  this, generic_path_mdtvsrpcmonitoring + "/Sectors/" + sector_name, run,
757  MuonDQAHistList& lst = m_stationHists.getList(sector_name);
758 
760  // histo path for mdt vrs rpc
761  std::string generic_path_mdtvsrpcsector = generic_path_mdtvsrpcmonitoring +
762  "/Sectors/" + sector_name +
763  layer_name;
764  std::string mdtvsrpcsector_title =
765  sector_name + "_" + layer_name + "_MDTtube_vs_RPCstrip";
766  const char* mdtvsrpcsector_title_char = mdtvsrpcsector_title.c_str();
767 
768  int MDTvsRPCNbinx =
769  int((-stripzmin + stripzmax) / 30 / m_mdtvsrpcreducemdtnbins);
770  int MDTvsRPCNbinz =
771  int((-wirezmin + wirezmax) / 30 / m_mdtvsrpcreducerpcnbins);
772 
773  TH2* mdtvsrpcsector = new TH2I(
774  mdtvsrpcsector_title_char, mdtvsrpcsector_title_char, MDTvsRPCNbinz,
775  stripzmin, stripzmax, MDTvsRPCNbinx, wirezmin, wirezmax);
776  lst.addHist(mdtvsrpcsector);
777 
778  mdtvsrpcsector->SetOption("COLZ");
779  mdtvsrpcsector->SetFillColor(42);
780  mdtvsrpcsector->SetMarkerColor(1);
781  mdtvsrpcsector->SetMarkerStyle(21);
782  mdtvsrpcsector->GetXaxis()->SetTitle(
783  "<--- Side C Rpc Eta strip z [mm] Side A "
784  "--->");
785  mdtvsrpcsector->GetYaxis()->SetTitle(
786  "<--- Side C Mdt wire z [mm] Side A "
787  "--->");
788 
789  ATH_MSG_DEBUG("INSIDE bookMDTvsRPCsectorHistograms: "
790  << mdtvsrpcsector << generic_path_mdtvsrpcsector.c_str());
791  ATH_MSG_DEBUG("RUN : " << run);
792 
793  if (mdtvsrpc_prd_shift.regHist(mdtvsrpcsector).isFailure()) {
794  ATH_MSG_WARNING("couldn't register mdtvsrpcsector hist to MonGroup");
795  }
796 }
MdtVsRpcRawDataValAlg::m_StationPhi
int m_StationPhi
Definition: MdtVsRpcRawDataValAlg.h:98
MdtVsRpcRawDataValAlg::bookMDTvsRPCHistograms
void bookMDTvsRPCHistograms(const std::string &m_hardware_name, const std::string &m_layer_name, int binz, int binminz, int binmaxz, int binx, int binminx, int binmaxx)
Definition: MdtVsRpcRawDataValAlg.cxx:602
convertChamberName
std::string convertChamberName(int, int, int, const std::string &)
Definition: MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx:10
selectChambersRange
bool selectChambersRange(const std::string &, const std::string &, int, int, int, int, const std::string &)
Definition: MuonDQA/MuonDQAUtils/src/MuonChambersRange.cxx:7
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MuonGM::MdtReadoutElement::innerTubeRadius
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
ManagedMonitorToolBase
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
Definition: ManagedMonitorToolBase.h:73
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MuonDQAHistList::getH2
TH2 * getH2(const std::string &hist_name) const
Definition: MuonDQAHistMap.h:51
MdtVsRpcRawDataValAlg::m_StationEta
int m_StationEta
Definition: MdtVsRpcRawDataValAlg.h:97
MdtVsRpcRawDataValAlg::m_mdtvsrpcsectorhist
bool m_mdtvsrpcsectorhist
Definition: MdtVsRpcRawDataValAlg.h:83
MdtVsRpcRawDataValAlg::m_BMLid
int m_BMLid
Definition: MdtVsRpcRawDataValAlg.h:106
MdtVsRpcRawDataValAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtVsRpcRawDataValAlg.h:65
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition: IdentifiableContainerMT.h:209
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:55
MdtVsRpcRawDataValAlg::m_MdtRpcZdiff
TH1 * m_MdtRpcZdiff
Definition: MdtVsRpcRawDataValAlg.h:110
MdtVsRpcRawDataValAlg::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Definition: MdtVsRpcRawDataValAlg.h:61
RpcFiredChannel.h
MdtVsRpcRawDataValAlg::m_clusterContainerName
std::string m_clusterContainerName
Definition: MdtVsRpcRawDataValAlg.h:80
MdtVsRpcRawDataValAlg::m_BOLid
int m_BOLid
Definition: MdtVsRpcRawDataValAlg.h:107
MdtVsRpcRawDataValAlg::m_key_mdt
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_key_mdt
Definition: MdtVsRpcRawDataValAlg.h:95
RpcIdHelper
Definition: RpcIdHelper.h:51
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
MuonDQAHistList::addHist
void addHist(TH1 *p)
Definition: MuonDQAHistMap.h:35
MuonChamberNameConverter.h
RpcPad.h
MdtVsRpcRawDataValAlg::m_mdtvsrpcreducerpcnbins
int m_mdtvsrpcreducerpcnbins
Definition: MdtVsRpcRawDataValAlg.h:85
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MdtVsRpcRawDataValAlg::m_layerSector_name_list
std::vector< std::string > m_layerSector_name_list
Definition: MdtVsRpcRawDataValAlg.h:57
MdtVsRpcRawDataValAlg::m_mdtvsrpcchamberhist
bool m_mdtvsrpcchamberhist
Definition: MdtVsRpcRawDataValAlg.h:82
MdtVsRpcRawDataValAlg::m_doClusters
bool m_doClusters
Definition: MdtVsRpcRawDataValAlg.h:79
MdtVsRpcRawDataValAlg::m_chamberName
std::string m_chamberName
Definition: MdtVsRpcRawDataValAlg.h:91
MdtVsRpcRawDataValAlg::m_sector
int m_sector
Definition: MdtVsRpcRawDataValAlg.h:54
ManagedMonitorToolBase::MonGroup
A container of information describing a monitoring object.
Definition: ManagedMonitorToolBase.h:137
MdtVsRpcRawDataValAlg::initialize
StatusCode initialize()
Definition: MdtVsRpcRawDataValAlg.cxx:70
AthenaMonManager::tier0ESD
@ tier0ESD
Definition: AthenaMonManager.h:49
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ManagedMonitorToolBase::initialize
virtual StatusCode initialize()
Definition: ManagedMonitorToolBase.cxx:617
MuonChambersRange.h
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
MdtVsRpcRawDataValAlg::m_doMdtvsRpcESD
bool m_doMdtvsRpcESD
Definition: MdtVsRpcRawDataValAlg.h:89
MdtVsRpcRawDataValAlg::m_stationHists
MuonDQAHistMap m_stationHists
Definition: MdtVsRpcRawDataValAlg.h:77
z
#define z
Muon::RpcPrepData
Class to represent RPC measurements.
Definition: RpcPrepData.h:35
AthenaMonManager::tier0
@ tier0
Definition: AthenaMonManager.h:49
MdtVsRpcRawDataValAlg::bookHistogramsRecurrent
virtual StatusCode bookHistogramsRecurrent()
An inheriting class should either override this function, bookHists() or bookHistograms().
Definition: MdtVsRpcRawDataValAlg.cxx:534
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonGM::RpcReadoutElement::NphiStrips
int NphiStrips() const
returns the number of phi strips
ManagedMonitorToolBase::ATTRIB_UNMANAGED
@ ATTRIB_UNMANAGED
Definition: ManagedMonitorToolBase.h:130
MdtIdHelper
Definition: MdtIdHelper.h:61
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MuonCosmicSetup.h
AthenaMonManager.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MakeTH3DFromTH2Ds.hists
hists
Definition: MakeTH3DFromTH2Ds.py:72
run
Definition: run.py:1
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
MuonDQAHistMap.h
MuonGM::MuonReadoutElement::globalPosition
const Amg::Vector3D globalPosition() const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:47
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
MuonGM::RpcReadoutElement::NetaStrips
int NetaStrips() const
returns the number of eta strips
MdtVsRpcRawDataValAlg::m_layer_name_list
std::vector< std::string > m_layer_name_list
Definition: MdtVsRpcRawDataValAlg.h:56
ManagedMonitorToolBase::MonGroup::regHist
StatusCode regHist(TH1 *h)
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition: ManagedMonitorToolBase.cxx:192
ManagedMonitorToolBase::m_environment
AthenaMonManager::Environment_t m_environment
Definition: ManagedMonitorToolBase.h:839
MdtVsRpcRawDataValAlg::m_side
int m_side
Definition: MdtVsRpcRawDataValAlg.h:55
chambersCosmicSetup
bool chambersCosmicSetup(const std::string &, int)
Definition: MuonCosmicSetup.cxx:7
MdtVsRpcRawDataValAlg::m_cosmicStation
int m_cosmicStation
Definition: MdtVsRpcRawDataValAlg.h:100
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonDQAHistMap::getList
MuonDQAHistList & getList(std::string station_name)
Definition: MuonDQAHistMap.h:78
MuonGM::RpcReadoutElement::stripPos
Amg::Vector3D stripPos(const Identifier &id) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx:177
MdtVsRpcRawDataValAlg::m_key_rpc
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_key_rpc
Definition: MdtVsRpcRawDataValAlg.h:93
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MuonGM::RpcReadoutElement::StripPitch
double StripPitch(bool measphi) const
returns the strip pitch for the phi or eta plane
MdtVsRpcRawDataValAlg.h
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MdtVsRpcRawDataValAlg::bookMDTvsRPCsectorHistograms
void bookMDTvsRPCsectorHistograms(const std::string &m_sector_name, const std::string &m_layer_name, float stripzmin, float stripzmax, float wirezmin, float wirezmax)
Definition: MdtVsRpcRawDataValAlg.cxx:741
MuonDQAHistList
Definition: MuonDQAHistMap.h:29
MdtVsRpcRawDataValAlg::MdtVsRpcRawDataValAlg
MdtVsRpcRawDataValAlg(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MdtVsRpcRawDataValAlg.cxx:45
MdtVsRpcRawDataValAlg::m_MdtNHitsvsRpcNHits
TH2 * m_MdtNHitsvsRpcNHits
Definition: MdtVsRpcRawDataValAlg.h:111
ManagedMonitorToolBase::MonGroup::getHist
StatusCode getHist(TH1 *&h, const std::string &hName)
Returns a TH1 via the pointer passed as the first argument.
Definition: ManagedMonitorToolBase.cxx:206
MdtVsRpcRawDataValAlg::m_StationSize
std::string m_StationSize
Definition: MdtVsRpcRawDataValAlg.h:92
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MdtVsRpcRawDataValAlg::m_BISid
int m_BISid
Definition: MdtVsRpcRawDataValAlg.h:105
MdtVsRpcRawDataValAlg::m_mdtvsrpcreducemdttdcnbins
int m_mdtvsrpcreducemdttdcnbins
Definition: MdtVsRpcRawDataValAlg.h:87
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MdtVsRpcRawDataValAlg::fillHistograms
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
Definition: MdtVsRpcRawDataValAlg.cxx:89
RpcPadContainer.h
MdtVsRpcRawDataValAlg::m_lastEvent
int m_lastEvent
Definition: MdtVsRpcRawDataValAlg.h:99
MuonGM::MdtReadoutElement::getNtubesperlayer
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
MdtVsRpcRawDataValAlg::m_BMFid
int m_BMFid
Definition: MdtVsRpcRawDataValAlg.h:108
readCCLHist.float
float
Definition: readCCLHist.py:83
MdtVsRpcRawDataValAlg::m_mdtvsrpcreducemdtnbins
int m_mdtvsrpcreducemdtnbins
Definition: MdtVsRpcRawDataValAlg.h:86
RpcCoinMatrix.h
ManagedMonitorToolBase::newRunFlag
bool newRunFlag() const
Definition: ManagedMonitorToolBase.h:792
Identifier
Definition: IdentifierFieldParser.cxx:14