ATLAS Offline Software
InDetGlobalSynchMonTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
20 //Local
23 
24 //Framework
26 #include "GaudiKernel/StatusCode.h"
27 
37 
38 #include "LWHists/TH1I_LW.h"
39 #include "LWHists/TH2I_LW.h"
40 #include "LWHists/TProfile_LW.h"
41 
42 //Root
43 #include "TProfile2D.h"
44 //Standard c++
45 #include <string>
46 #include <vector>
47 #include <set>
48 #include <map>
49 
50 #define ROB_PIXEL_BARREL 0x11
51 #define ROB_PIXEL_DISKS 0x12
52 #define ROB_PIXEL_BLAYER 0x13
53 
54 #define ROB_SCT_BARREL_A 0x21
55 #define ROB_SCT_BARREL_C 0x22
56 #define ROB_SCT_EC_A 0x23
57 #define ROB_SCT_EC_C 0x24
58 
59 #define ROB_TRT_BARREL_A 0x31
60 #define ROB_TRT_BARREL_C 0x32
61 #define ROB_TRT_EC_A 0x33
62 #define ROB_TRT_EC_C 0x34
63 
64 
66  const std::string & type,
67  const std::string & name,
68  const IInterface* parent)
70  m_tracks(nullptr),
71  m_n_sct_robs_JO(90),
72  m_n_trt_robs_JO(190),
73  m_n_pix_robs_JO(132),
74  m_diff_LVL1ID(nullptr),
75  m_diff_Overview_LVL1ID(nullptr),
76  m_diff_BCID(nullptr),
77  m_diff_Pixel_SCT_TRT_BCID(nullptr),
78  m_diff_Overview_BCID(nullptr),
79  m_diff_SCT_BCID(nullptr),
80  m_diff_TRT_BCID(nullptr),
81  m_diff_PIX_BCID(nullptr),
82  m_diff_SCT_TRT_BCID(nullptr),
83  m_diff_SCT_PIX_BCID(nullptr),
84  m_diff_SCT_TRT_BCID_evt(nullptr),
85  m_diff_SCT_PIX_BCID_evt(nullptr),
86  m_BCID(0),
87  m_det_diff_BCID(0),
88  m_LVL1ID(0),
89  m_det_diff_LVL1ID(0),
90  m_SCT_BCID(nullptr),
91  m_TRT_BCID(nullptr),
92  m_PIX_BCID(nullptr),
93  m_Pixel_Hits_BCID(nullptr),
94  m_SCT_Hits_BCID(nullptr),
95  m_TRT_Hits_BCID(nullptr),
96  m_InDet_Hits_BCID(nullptr),
97  m_Tracks_BCID(nullptr)
98 {
99  // Get parameter values from jobOptions file
100  declareProperty("sct_robs_JO", m_n_sct_robs_JO);
101  declareProperty("trt_robs_JO", m_n_trt_robs_JO);
102  declareProperty("pix_robs_JO", m_n_pix_robs_JO);
103 }
104 
106  if ( InDetGlobalMotherTrigMonTool::initialize().isFailure() )
107  {
108  if ( msgLvl(MSG::DEBUG) ) msg(MSG::DEBUG) << "Could not initialize Monitor tool base!" << endmsg;
109  return StatusCode::FAILURE;
110  }
111 
112  m_robMapping.clear();
113 
114  m_robMapping.insert( std::pair<short,short>(ROB_PIXEL_BARREL, 0) );
115  m_robMapping.insert( std::pair<short,short>(ROB_PIXEL_DISKS, 0) );
116  m_robMapping.insert( std::pair<short,short>(ROB_PIXEL_BLAYER, 0) );
117  m_robMapping.insert( std::pair<short,short>(ROB_SCT_BARREL_A, 1) );
118  m_robMapping.insert( std::pair<short,short>(ROB_SCT_BARREL_C, 1) );
119  m_robMapping.insert( std::pair<short,short>(ROB_SCT_EC_A, 1) );
120  m_robMapping.insert( std::pair<short,short>(ROB_SCT_EC_C, 1) );
121  m_robMapping.insert( std::pair<short,short>(ROB_TRT_BARREL_A, 2) );
122  m_robMapping.insert( std::pair<short,short>(ROB_TRT_BARREL_C, 2) );
123  m_robMapping.insert( std::pair<short,short>(ROB_TRT_EC_A, 2) );
124  m_robMapping.insert( std::pair<short,short>(ROB_TRT_EC_C, 2) );
125 
126  m_robRegionMapping.clear();
127  m_robRegionMapping.insert( std::pair<short,short>(ROB_PIXEL_BARREL, 0) );
128  m_robRegionMapping.insert( std::pair<short,short>(ROB_PIXEL_DISKS, 1) );
129  m_robRegionMapping.insert( std::pair<short,short>(ROB_PIXEL_BLAYER, 2) );
130  m_robRegionMapping.insert( std::pair<short,short>(ROB_SCT_BARREL_A, 3) );
131  m_robRegionMapping.insert( std::pair<short,short>(ROB_SCT_BARREL_C, 4) );
132  m_robRegionMapping.insert( std::pair<short,short>(ROB_SCT_EC_A, 5) );
133  m_robRegionMapping.insert( std::pair<short,short>(ROB_SCT_EC_C, 6) );
134  m_robRegionMapping.insert( std::pair<short,short>(ROB_TRT_BARREL_A, 7) );
135  m_robRegionMapping.insert( std::pair<short,short>(ROB_TRT_BARREL_C, 8) );
136  m_robRegionMapping.insert( std::pair<short,short>(ROB_TRT_EC_A, 9) );
137  m_robRegionMapping.insert( std::pair<short,short>(ROB_TRT_EC_C, 10) );
138 
139  return StatusCode::SUCCESS;
140 }
141 
142 
143 //----------------------------------------------------------------------
145 {
146  bool status = true;
147 
148  LWHist::LWHistAxis *axis = nullptr;
149  m_diff_LVL1ID = TProfile_LW::create( "m_diff_LVL1ID",
150  "Fraction of RODS with synchronized LVL1ID in each ID region",
151  11,0,11);
153  axis->SetBinLabel(1,"Pixel Barrel");
154  axis->SetBinLabel(2,"Pixel Disks");
155  axis->SetBinLabel(3,"Pixel B-Layer");
156  axis->SetBinLabel(4,"SCT Barrel A");
157  axis->SetBinLabel(5,"SCT Barrel C");
158  axis->SetBinLabel(6,"SCT ECA");
159  axis->SetBinLabel(7,"SCT ECC");
160  axis->SetBinLabel(8,"TRT Barrel A");
161  axis->SetBinLabel(9,"TRT Barrel C");
162  axis->SetBinLabel(10,"TRT ECA");
163  axis->SetBinLabel(11,"TRT ECC");
164  m_diff_LVL1ID->GetYaxis()->SetTitle("Fraction");
165 
166  status &= regHist(m_diff_LVL1ID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
167 
169  "m_diff_Overview_LVL1ID"
170  ,"LVL1ID difference warning between the detectors and the RODs of each detector",
171  4,-1,3,4,-1,3);
173  axis->SetBinLabel(1,"BCM");
174  axis->SetBinLabel(2,"Pixel");
175  axis->SetBinLabel(3,"SCT");
176  axis->SetBinLabel(4,"TRT");
178  axis->SetBinLabel(1,"BCM");
179  axis->SetBinLabel(2,"Pixel");
180  axis->SetBinLabel(3,"SCT");
181  axis->SetBinLabel(4,"TRT");
182  status &= regHist( m_diff_Overview_LVL1ID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
183 
184  m_diff_BCID = TProfile_LW::create( "m_diff_BCID",
185  "Fraction of RODS with synchronized BCID in each ID region",
186  11,0,11);
187  m_diff_BCID->GetYaxis()->SetTitle("Fraction");
189  axis->SetBinLabel(1,"Pixel Barrel");
190  axis->SetBinLabel(2,"Pixel Disks");
191  axis->SetBinLabel(3,"Pixel B-Layer");
192  axis->SetBinLabel(4,"SCT Barrel A");
193  axis->SetBinLabel(5,"SCT Barrel C");
194  axis->SetBinLabel(6,"SCT ECA");
195  axis->SetBinLabel(7,"SCT ECC");
196  axis->SetBinLabel(8,"TRT Barrel A");
197  axis->SetBinLabel(9,"TRT Barrel C");
198  axis->SetBinLabel(10,"TRT ECA");
199  axis->SetBinLabel(11,"TRT ECC");
200  status &= regHist( m_diff_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
201 
202  m_diff_Pixel_SCT_TRT_BCID = TH2I_LW::create( "m_diff_Pixel_SCT_TRT_BCID"
203  ,"BCID difference warning status between SCT and Pixel vs between SCT and TRT",
204  2,-1,1,2,-1,1);
206  axis->SetBinLabel(1,"SCT!= TRT");
207  axis->SetBinLabel(2,"SCT == TRT");
209  axis->SetBinLabel(1,"SCT != Pix");
210  axis->SetBinLabel(2,"SCT == Pix");
211  status &= regHist( m_diff_Pixel_SCT_TRT_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
212 
213  m_diff_Overview_BCID = TH2I_LW::create( "m_diff_Overview_BCID"
214  ,"BCID difference warning between the detectors and the RODs of each detector",
215  4,-1,3,4,-1,3);
217  axis->SetBinLabel(1,"BCM");
218  axis->SetBinLabel(2,"Pixel");
219  axis->SetBinLabel(3,"SCT");
220  axis->SetBinLabel(4,"TRT");
222  axis->SetBinLabel(1,"BCM");
223  axis->SetBinLabel(2,"Pixel");
224  axis->SetBinLabel(3,"SCT");
225  axis->SetBinLabel(4,"TRT");
226  status &= regHist( m_diff_Overview_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
227 
228 
229  m_diff_SCT_TRT_BCID = TH1I_LW::create( "m_diff_SCT_TRT_BCID"
230  ,"BCID difference between SCT and TRT",
231  20000,-10000,10000);
232  status &= regHist( m_diff_SCT_TRT_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
233 
234  m_diff_SCT_PIX_BCID = TH1I_LW::create( "m_diff_SCT_PIX_BCID",
235  "BCID difference between SCT and PIX",
236  20000,-10000,10000);
237  status &= regHist( m_diff_SCT_PIX_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
238 
239 
240  m_det_diff_BCID.clear();
241  m_det_diff_BCID.push_back( TH2I_LW::create( "m_diff_PIX_BCID",
242  "BCID warning status between PIX RODS",
244  2,-1,1) );
245  status &= regHist( m_det_diff_BCID[0], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
246 
247  m_det_diff_BCID.push_back( TH2I_LW::create( "m_diff_SCT_BCID",
248  "BCID warning status between SCT RODS",
250  2,-1,1) );
251  status &= regHist( m_det_diff_BCID[1], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
252 
253  m_det_diff_BCID.push_back( TH2I_LW::create( "m_diff_TRT_BCID",
254  "BCID warning status between TRT RODS",
256  2,-1,1) );
257  status &= regHist( m_det_diff_BCID[2] , "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
258 
259 
260  m_det_diff_LVL1ID.clear();
261  m_det_diff_LVL1ID.push_back( TH2I_LW::create("m_diff_PIX_LVL1ID",
262  "LVL1ID warning status between PIX RODS",
264  2,-1,1) );
265  status &= regHist( m_det_diff_LVL1ID[0], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
266 
267  m_det_diff_LVL1ID.push_back( TH2I_LW::create("m_diff_SCT_LVL1ID",
268  "LVL1ID warning status between SCT RODS",
270  2,-1,1) );
271  status &= regHist( m_det_diff_LVL1ID[1], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
272 
273  m_det_diff_LVL1ID.push_back( TH2I_LW::create("m_diff_TRT_LVL1ID",
274  "LVL1ID warning status between TRT RODS",
276  2,-1,1) );
277  status &= regHist( m_det_diff_LVL1ID[2], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
278 
279  m_BCID.clear();
280  m_BCID.push_back( TH2I_LW::create( "m_PIX_BCID",
281  "BCID of PIX RODS",
283  5000,0,5000 ) );
284  status &= regHist( m_BCID[0], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
285  m_BCID.push_back( TH2I_LW::create( "m_SCT_BCID",
286  "BCID of SCT RODS",
288  5000,0,5000 ) );
289  status &= regHist( m_BCID[1], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
290  m_BCID.push_back( TH2I_LW::create( "m_TRT_BCID",
291  "BCID of TRT RODS",
293  5000,0,5000 ) );
294  status &= regHist( m_BCID[2], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
295 
296 
297  m_LVL1ID.clear();
298  m_LVL1ID.push_back( TH2I_LW::create( "m_PIX_LVL1ID",
299  "LVL1ID of PIX RODS",
301  5000,0,5000 ) );
302  status &= regHist( m_LVL1ID[0], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
303  m_LVL1ID.push_back( TH2I_LW::create( "m_SCT_LVL1ID",
304  "LVL1ID of SCT RODS",
306  5000,0,5000 ) );
307  status &= regHist( m_LVL1ID[1], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
308  m_LVL1ID.push_back( TH2I_LW::create( "m_TRT_LVL1ID",
309  "LVL1ID of TRT RODS",
311  5000,0,5000 ) );
312  status &= regHist( m_LVL1ID[2], "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
313 
314  m_InDet_Hits_BCID = new TProfile( "m_InDet_Hits_BCID","Number of Inner Detector (Pixel + SCT + TRT) hits vs BCID",
315  5000,0,5000);
316  m_InDet_Hits_BCID->GetXaxis()->SetTitle("BCID");
317  m_InDet_Hits_BCID->GetYaxis()->SetTitle("Total number of inner detector hits");
318  status &= regHist( m_InDet_Hits_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
319 
320  m_Pixel_Hits_BCID = new TProfile( "m_Pixel_Hits_BCID","Number of Pixel hits vs Pixel BCID",
321  500,0,5000);
322  m_Pixel_Hits_BCID->GetXaxis()->SetTitle("BCID");
323  m_Pixel_Hits_BCID->GetYaxis()->SetTitle("Number of Pixel hits");
324  status &= regHist( m_Pixel_Hits_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
325 
326  m_SCT_Hits_BCID = new TProfile( "m_SCT_Hits_BCID","Number of SCT hits vs SCT BCID",
327  500,0,5000);
328  m_SCT_Hits_BCID->GetXaxis()->SetTitle("BCID");
329  m_SCT_Hits_BCID->GetYaxis()->SetTitle("Number of SCT hits");
330  status &= regHist( m_SCT_Hits_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
331 
332  m_TRT_Hits_BCID = new TProfile( "m_TRT_Hits_BCID","Number of TRT hits vs TRT BCID",
333  500,0,5000);
334  m_TRT_Hits_BCID->GetXaxis()->SetTitle("BCID");
335  m_TRT_Hits_BCID->GetYaxis()->SetTitle("Number of TRT hits");
336  status &= regHist( m_TRT_Hits_BCID, "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
337 
338  m_Tracks_BCID = new TProfile( "m_Tracks_BCID","Number of Tracks vs BCID",
339  5000,0,5000);
340  m_Tracks_BCID->GetXaxis()->SetTitle("BCID");
341  m_Tracks_BCID->GetYaxis()->SetTitle("Number of tracks");
342  status &= regHist( m_Tracks_BCID , "InDetGlobal/Synch", run, ATTRIB_MANAGED ).isSuccess();
343 
344  return ( status ? StatusCode::SUCCESS : StatusCode::FAILURE );
345 }
346 
347 
348 //----------------------------------------------------------------------
350 {
351  int prev_bcm_bcid = -1;
352  int prev_bcm_lvl1id = -1;
353 
354  if ( m_doTrigger && InDetGlobalMotherTrigMonTool::CheckTriggers() != StatusCode::SUCCESS ){
355  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Triggers not found!" << endmsg;
356  m_doTrigger = false;
357  }
358 
359  //m_doTrigger = false; // REMOVE
360 
361  if ( m_BCM_RDO != nullptr ) // Protection for when there is no BCM data
362  {
363  // loop over RDO container
364 
365  BCM_RDO_Container::const_iterator it_bcmraw,it_bcmraw_E(m_BCM_RDO->end());
366  for ( it_bcmraw = m_BCM_RDO->begin(); it_bcmraw != it_bcmraw_E; ++it_bcmraw) {
367  if ( !(*it_bcmraw)->empty()) {
368  BCM_RDO_Collection::const_iterator RDO_element_first = (*it_bcmraw)->begin();
369  int bcm_bcid = (*RDO_element_first)->getBCID();
370  int bcm_lvl1id = (*RDO_element_first)->getLVL1ID();
371 
372  if ( bcm_bcid != prev_bcm_bcid && prev_bcm_bcid != -1 )
373  {
374  m_diff_Overview_BCID->Fill(-1.0,-1.0);
375  }
376  if ( bcm_lvl1id != prev_bcm_lvl1id && prev_bcm_lvl1id != -1 )
377  {
378  m_diff_Overview_LVL1ID->Fill(-1.0,-1.0);
379  }
380  prev_bcm_bcid = bcm_bcid;
381  prev_bcm_lvl1id = bcm_lvl1id;
382  }
383  }
384  }
385 
386  //Number of hits in the whole Inner Setector (Pixel+SCT+TRT)
387  int n_InDet_hits = 0;
388 
389  unsigned int prev_pix_bcid = 0;
390  //Fill Pixel BCID histograms
391  if ( m_pixBCIDContainer )
392  prev_pix_bcid = fillTimingHistos( m_pixBCIDContainer,
393  m_BCID,
395  m_diff_BCID,
397  &getBCID );
398  unsigned int prev_sct_bcid = 0;
399  //Fill SCT BCID histograms
400  if ( m_sctBCIDContainer )
401  prev_sct_bcid = fillTimingHistos( m_sctBCIDContainer ,
402  m_BCID,
404  m_diff_BCID,
406  &getBCID );
407  unsigned int prev_trt_bcid = 0;
408  //Fill TRT BCID histograms
409  if ( m_trtBCIDContainer )
410  prev_trt_bcid = fillTimingHistos( m_trtBCIDContainer ,
411  m_BCID,
413  m_diff_BCID,
415  &getBCID );
416  unsigned int prev_pix_lvl1id = 0;
417  //Fill Pixel Level 1 ID difference histograms
418  if ( m_pixLVL1IDContainer )
419  prev_pix_lvl1id = fillTimingHistos( m_pixLVL1IDContainer,
420  m_LVL1ID,
424  &getLVL1ID );
425 
426  unsigned int prev_sct_lvl1id = 0;
427  //Fill SCT Level 1 ID difference histograms
428  if ( m_sctLVL1IDContainer )
429  prev_sct_lvl1id = fillTimingHistos( m_sctLVL1IDContainer,
430  m_LVL1ID,
434  &getLVL1ID );
435  unsigned int prev_trt_lvl1id = 0;
436  //Fill TRT LVL1ID difference histogram
437  if ( m_trtLVL1IDContainer )
438  prev_trt_lvl1id = fillTimingHistos( m_trtLVL1IDContainer,
439  m_LVL1ID,
443  &getLVL1ID );
444 
445  m_diff_Pixel_SCT_TRT_BCID->Fill(((prev_sct_bcid-prev_trt_bcid==0)?0:-1),((prev_sct_bcid-prev_pix_bcid==0)?0:-1));
446 
447 
448  if (prev_sct_bcid-prev_pix_bcid ) m_diff_Overview_BCID->Fill(0.0,1.0);
449  if (prev_trt_bcid-prev_pix_bcid ) m_diff_Overview_BCID->Fill(0.0,2.0);
450  if (prev_sct_bcid-prev_trt_bcid ) m_diff_Overview_BCID->Fill(1.0,2.0);
451  if (prev_pix_bcid-prev_bcm_bcid && prev_bcm_bcid ) m_diff_Overview_BCID->Fill(-1.0,0.0);
452  if (prev_sct_bcid-prev_bcm_bcid && prev_bcm_bcid ) m_diff_Overview_BCID->Fill(-1.0,1.0);
453  if (prev_trt_bcid-prev_bcm_bcid && prev_bcm_bcid ) m_diff_Overview_BCID->Fill(-1.0,2.0);
454 
455  if (prev_sct_lvl1id-prev_pix_lvl1id != 0) m_diff_Overview_LVL1ID->Fill(0.0,1.0);
456  if (prev_trt_lvl1id-prev_pix_lvl1id != 0) m_diff_Overview_LVL1ID->Fill(0.0,2.0);
457  if (prev_sct_lvl1id-prev_trt_lvl1id != 0) m_diff_Overview_LVL1ID->Fill(1.0,2.0);
458  if (prev_pix_lvl1id-prev_bcm_lvl1id != 0 && prev_bcm_lvl1id != 0) m_diff_Overview_LVL1ID->Fill(-1.0,0.0);
459  if (prev_sct_lvl1id-prev_bcm_lvl1id != 0 && prev_bcm_lvl1id != 0) m_diff_Overview_LVL1ID->Fill(-1.0,1.0);
460  if (prev_trt_lvl1id-prev_bcm_lvl1id != 0 && prev_bcm_lvl1id != 0) m_diff_Overview_LVL1ID->Fill(-1.0,2.0);
461 
462 
464 
465  //Count and fill pix hits
466  unsigned int n_Pixel_hits = getPixelHits( m_pixRdoContainer );
467  m_Pixel_Hits_BCID->Fill(prev_pix_bcid,n_Pixel_hits,1);
468  n_InDet_hits += n_Pixel_hits;
469 
470  //Count and fill sct hits
471  unsigned int n_SCT_hits = getSctHits( m_sctRdoContainer );
472  m_SCT_Hits_BCID->Fill(prev_sct_bcid,n_SCT_hits,1);
473  n_InDet_hits += n_SCT_hits;
474  // Fill the trigger related histograms
475 
476  if (m_driftCircleContainer!=nullptr) {
477  int n_TRT_hits=0;
478  TRT_DriftCircleContainer::const_iterator it_col,it_col_E(m_driftCircleContainer->end());
479  for ( it_col = m_driftCircleContainer->begin(); it_col != it_col_E; ++it_col) {
480 
481  const TRT_DriftCircleCollection *colNext=&(**it_col);
482  if (!colNext) continue;
483 
484  n_TRT_hits = n_TRT_hits + colNext->size();
485  }
486  m_TRT_Hits_BCID->Fill(prev_trt_bcid,n_TRT_hits,1);
487  n_InDet_hits = n_InDet_hits + n_TRT_hits;
488  }
489 
490  m_InDet_Hits_BCID->Fill(prev_trt_bcid,(n_InDet_hits),1);
491  int n_Tracks=(m_combined_tracks)?m_combined_tracks->size():0;
492  m_Tracks_BCID->Fill(prev_trt_bcid,n_Tracks,1);
493 
494  return StatusCode::SUCCESS;
495 }
496 
497 
499 {
500  if (count<1)
501  return;
502  //Fill with weight:
503  h->Fill(x,y,count);
504  //Fix number of entries:
505  h->SetEntries(h->GetEntries()+count-1);
506  //Fix sumW2:
507  double sumW,sumW2,sumWX,sumWX2,sumWY,sumWY2,sumWXY;
508  h->getSums(sumW,sumW2,sumWX,sumWX2,sumWY,sumWY2,sumWXY);
509  h->setSums(sumW,h->GetEntries(),sumWX,sumWX2,sumWY,sumWY2,sumWXY);
510 }
511 
513 {
514  int n_hits=0;
515  if ( collection != nullptr )
516  {
517  PixelRDO_Container::const_iterator it_pixcol,it_pixcol_E(collection->end());
518  for ( it_pixcol=collection->begin(); it_pixcol != it_pixcol_E; ++it_pixcol) {
519  const InDetRawDataCollection<PixelRDORawData>* PIX_Collection(*it_pixcol);
520  if (PIX_Collection == nullptr) continue;
521 
522  n_hits = n_hits + PIX_Collection->size();
523  }
524  }
525  return n_hits;
526 }
527 
529 {
530  unsigned int n_SCT_hits =0 ;
531  if ( m_sctRdoContainer != nullptr){
532  SCT_RDO_Container::const_iterator it_sctcol,it_sctcol_E(collection->end());
533  for (it_sctcol = collection->begin(); it_sctcol != it_sctcol_E; ++it_sctcol) {
534  const InDetRawDataCollection<SCT_RDORawData> * SCT_Collection(*it_sctcol);
535  if (SCT_Collection == nullptr) continue;
536  n_SCT_hits = n_SCT_hits + SCT_Collection->size();
537  }
538  }
539  return n_SCT_hits;
540 }
541 
542 unsigned int InDetGlobalSynchMonTool::getBCID(unsigned int bcid)
543 {
544  return bcid;
545 }
546 
547 unsigned int InDetGlobalSynchMonTool::getLVL1ID(unsigned int lvl1id)
548 {
549  return (lvl1id & 0xffff);
550 }
551 
552 
554  std::vector<TH2I_LW *> & timing,
555  std::vector<TH2I_LW *> & timing_diff,
556  TProfile_LW * timing_region_overview,
557  TH2I_LW * timing_over,
558  unsigned int (*procFunc)(unsigned int) )
559 {
560  unsigned int nrobs = 0;
561  unsigned int prev = 0;
562 
563  InDetTimeCollection::const_iterator it_time,it_time_E(collection->end());
564  for ( it_time = collection->begin(); it_time != it_time_E; ++it_time ) {
565 
566  const unsigned int curr = (*procFunc)( (*it_time).second );
567  const int robid = getDetectorId ( (*it_time).first ); //remember only first 2 digits of ROBID
568 
569  std::multimap<short, short>::const_iterator curr_rob = m_robMapping.find(robid);
570 
571  int hist_index = 0;
572 
573  if( curr_rob != m_robMapping.end() )
574  {
575  hist_index = m_robMapping.find(robid)->second;
576  }
577  else
578  {
579  return 0;
580  }
581 
582  timing.at(hist_index)->Fill(nrobs,curr);
583 
584  //Skip difference for first ROD - FIXME
585  if ( it_time > collection->begin() ) {
586  //Fill 0 if bcid is same as last, -1 otherwise
587  timing_diff.at(hist_index)->Fill(nrobs-1,((prev-curr==0)?0:-1));
588  if (prev-curr != 0)
589  {
590  timing_over->Fill(hist_index,hist_index);
591  }
592  else
593  {
594  }
595 
596  std::map<short, short>::const_iterator curr_region = m_robRegionMapping.find(robid);
597  if ( curr_region != m_robRegionMapping.end() ){
598  timing_region_overview->Fill(m_robRegionMapping.find(robid)->second, ((prev-curr==0)?1:0));
599  }
600  else
601  {
602  return 0;
603  }
604  }
605 
606  prev = curr;
607  nrobs++;
608  } // End loop over timing collection
609  return prev;
610 }
ROB_TRT_EC_C
#define ROB_TRT_EC_C
Definition: InDetGlobalSynchMonTool.cxx:62
InDetGlobalMotherMonTool::m_pixRdoContainer
const PixelRDO_Container * m_pixRdoContainer
Definition: InDetGlobalMotherMonTool.h:615
InDetGlobalMotherMonTool::m_pixBCIDContainer
const InDetTimeCollection * m_pixBCIDContainer
Definition: InDetGlobalMotherMonTool.h:625
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
InDetGlobalSynchMonTool.h
ComTime.h
InDetGlobalMotherMonTool::m_sctBCIDContainer
const InDetTimeCollection * m_sctBCIDContainer
Definition: InDetGlobalMotherMonTool.h:626
InDetGlobalSynchMonTool::m_diff_Overview_BCID
TH2I_LW * m_diff_Overview_BCID
BCID warning status between the detectors and the ROD's of each detector.
Definition: InDetGlobalSynchMonTool.h:133
InDetGlobalSynchMonTool::m_diff_Overview_LVL1ID
TH2I_LW * m_diff_Overview_LVL1ID
Definition: InDetGlobalSynchMonTool.h:121
PixelCluster.h
InDetGlobalSynchMonTool::m_det_diff_LVL1ID
std::vector< TH2I_LW * > m_det_diff_LVL1ID
Definition: InDetGlobalSynchMonTool.h:163
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDetGlobalSynchMonTool::m_TRT_Hits_BCID
TProfile * m_TRT_Hits_BCID
Definition: InDetGlobalSynchMonTool.h:178
InDetGlobalMotherMonTool::TRT_DriftCircleCollection
InDet::TRT_DriftCircleCollection TRT_DriftCircleCollection
Definition: InDetGlobalMotherMonTool.h:610
ROB_SCT_EC_C
#define ROB_SCT_EC_C
Definition: InDetGlobalSynchMonTool.cxx:57
InDetGlobalMotherMonTool::m_sctRdoContainer
const SCT_RDO_Container * m_sctRdoContainer
Definition: InDetGlobalMotherMonTool.h:617
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
InDetGlobalMotherMonTool::m_BCM_RDO
const BCM_RDO_Container * m_BCM_RDO
Definition: InDetGlobalMotherMonTool.h:613
InDetGlobalSynchMonTool::getPixelHits
static unsigned int getPixelHits(const PixelRDO_Container *collection)
Definition: InDetGlobalSynchMonTool.cxx:512
TH1I_LW::create
static TH1I_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup)
Definition: TH1I_LW.cxx:33
TH2I_LW::Fill
virtual void Fill(const double &x, const double &y) override
Definition: TH2I_LW.cxx:329
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
InDetGlobalSynchMonTool::getLVL1ID
static unsigned int getLVL1ID(unsigned int lvl1id)
Definition: InDetGlobalSynchMonTool.cxx:547
TProfile_LW.h
SiClusterOnTrack.h
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
ROB_SCT_BARREL_A
#define ROB_SCT_BARREL_A
Definition: InDetGlobalSynchMonTool.cxx:54
InDetGlobalSynchMonTool::fillHistograms
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
Definition: InDetGlobalSynchMonTool.cxx:349
InDetRawDataContainer.h
TProfile_LW
Definition: TProfile_LW.h:24
x
#define x
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
InDetGlobalSynchMonTool::initialize
virtual StatusCode initialize()
Definition: InDetGlobalSynchMonTool.cxx:105
InDetGlobalSynchMonTool::getDetectorId
int getDetectorId(int robid)
Definition: InDetGlobalSynchMonTool.h:91
InDetGlobalMotherTrigMonTool::CheckTriggers
StatusCode CheckTriggers()
Definition: InDetGlobalMotherTrigMonTool.cxx:59
InDetGlobalSynchMonTool::m_Pixel_Hits_BCID
TProfile * m_Pixel_Hits_BCID
Number of hits in the sub-detectors and ID in each BCID.
Definition: InDetGlobalSynchMonTool.h:176
InDetGlobalSynchMonTool::m_robRegionMapping
std::map< short, short > m_robRegionMapping
Definition: InDetGlobalSynchMonTool.h:97
InDetGlobalMotherMonTool::m_trtLVL1IDContainer
const InDetTimeCollection * m_trtLVL1IDContainer
Definition: InDetGlobalMotherMonTool.h:624
LWHist::GetXaxis
LWHistAxis * GetXaxis()
Definition: LWHist.cxx:309
ROB_TRT_EC_A
#define ROB_TRT_EC_A
Definition: InDetGlobalSynchMonTool.cxx:61
InDetGlobalSynchMonTool::bookHistograms
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
Definition: InDetGlobalSynchMonTool.cxx:144
InDetGlobalSynchMonTool::m_InDet_Hits_BCID
TProfile * m_InDet_Hits_BCID
Definition: InDetGlobalSynchMonTool.h:179
InDetGlobalMotherTrigMonTool
This tool derives from InDetGlobalMonitorToolBase The Mother tool interfaces to all subtools.
Definition: InDetGlobalMotherTrigMonTool.h:45
trigDumpTimers.timing
def timing(hist)
Definition: trigDumpTimers.py:13
SCT3_RawData.h
PixelRDORawData.h
LWHist::LWHistAxis::SetTitle
void SetTitle(const char *)
Definition: LWHist.cxx:359
ROB_TRT_BARREL_C
#define ROB_TRT_BARREL_C
Definition: InDetGlobalSynchMonTool.cxx:60
TProfile_LW::create
static TProfile_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, const char *option=" ")
Definition: TProfile_LW.cxx:32
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
TH2I_LW::create
static TH2I_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xmin, const double &xmax, unsigned nbinsy, const double &ymin, const double &ymax)
Definition: TH2I_LW.cxx:33
InDetGlobalSynchMonTool::m_diff_SCT_PIX_BCID
TH1I_LW * m_diff_SCT_PIX_BCID
BCID difference between SCT and PIX.
Definition: InDetGlobalSynchMonTool.h:150
InDetGlobalSynchMonTool::fillNTimesFast
static void fillNTimesFast(TH2I_LW *h, double x, double y, int count)
Definition: InDetGlobalSynchMonTool.cxx:498
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDetGlobalSynchMonTool::m_diff_Pixel_SCT_TRT_BCID
TH2I_LW * m_diff_Pixel_SCT_TRT_BCID
BCID warning status between SCT and Pixel vs between SCT and TRT.
Definition: InDetGlobalSynchMonTool.h:130
InDetGlobalSynchMonTool::InDetGlobalSynchMonTool
InDetGlobalSynchMonTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: InDetGlobalSynchMonTool.cxx:65
TH1I_LW.h
TH2I_LW.h
Pixel1RawData.h
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
test_pyathena.parent
parent
Definition: test_pyathena.py:15
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:242
run
Definition: run.py:1
ManagedMonitorToolBase::ATTRIB_MANAGED
@ ATTRIB_MANAGED
Definition: ManagedMonitorToolBase.h:131
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
ROB_SCT_BARREL_C
#define ROB_SCT_BARREL_C
Definition: InDetGlobalSynchMonTool.cxx:55
InDetGlobalSynchMonTool::m_diff_LVL1ID
TProfile_LW * m_diff_LVL1ID
LVL1ID warning status between different RODS (PIX+SCT+TRT)
Definition: InDetGlobalSynchMonTool.h:120
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:236
InDetGlobalSynchMonTool::m_LVL1ID
std::vector< TH2I_LW * > m_LVL1ID
Definition: InDetGlobalSynchMonTool.h:162
TProfile_LW::Fill
void Fill(const double &x, const double &y)
Definition: TProfile_LW.cxx:223
ROB_TRT_BARREL_A
#define ROB_TRT_BARREL_A
Definition: InDetGlobalSynchMonTool.cxx:59
InDetGlobalMotherMonTool::m_pixLVL1IDContainer
const InDetTimeCollection * m_pixLVL1IDContainer
Definition: InDetGlobalMotherMonTool.h:622
InDetGlobalSynchMonTool::m_n_trt_robs_JO
int m_n_trt_robs_JO
TRT n robs.
Definition: InDetGlobalSynchMonTool.h:109
LWHist::LWHistAxis
Definition: LWHist.h:109
InDetGlobalSynchMonTool::m_robMapping
std::multimap< short, short > m_robMapping
Definition: InDetGlobalSynchMonTool.h:94
InDetTimeCollection
std::vector< std::pair< uint32_t, unsigned int > > InDetTimeCollection
Definition: InDetTimeCollection.h:12
InDetGlobalMotherTrigMonTool::m_doTrigger
bool m_doTrigger
Definition: InDetGlobalMotherTrigMonTool.h:67
TH2I_LW
Definition: TH2I_LW.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SiCluster.h
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
InDetGlobalSynchMonTool::m_diff_BCID
TProfile_LW * m_diff_BCID
BCID warning status between different RODS (PIX+SCT+TRT)
Definition: InDetGlobalSynchMonTool.h:127
ROB_PIXEL_BARREL
#define ROB_PIXEL_BARREL
Definition: InDetGlobalSynchMonTool.cxx:50
InDetGlobalSynchMonTool::getSctHits
unsigned int getSctHits(const SCT_RDO_Container *collection)
Definition: InDetGlobalSynchMonTool.cxx:528
InDetGlobalSynchMonTool::m_diff_SCT_TRT_BCID
TH1I_LW * m_diff_SCT_TRT_BCID
BCID difference between SCT and TRT.
Definition: InDetGlobalSynchMonTool.h:146
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
y
#define y
h
TProfile::Fill
int Fill(double, double)
Definition: rootspy.cxx:523
InDetGlobalSynchMonTool::m_BCID
std::vector< TH2I_LW * > m_BCID
Definition: InDetGlobalSynchMonTool.h:159
InDetGlobalSynchMonTool::m_n_sct_robs_JO
int m_n_sct_robs_JO
SCT n robs.
Definition: InDetGlobalSynchMonTool.h:106
InDetGlobalMotherMonTool::m_trtBCIDContainer
const InDetTimeCollection * m_trtBCIDContainer
Definition: InDetGlobalMotherMonTool.h:627
InDetGlobalSynchMonTool::fillTimingHistos
unsigned int fillTimingHistos(const InDetTimeCollection *collection, std::vector< TH2I_LW * > &timing, std::vector< TH2I_LW * > &timing_diff, TProfile_LW *timing_region_overview, TH2I_LW *timing_over, unsigned int(*procFunc)(unsigned int))
Definition: InDetGlobalSynchMonTool.cxx:553
InDetGlobalMotherTrigMonTool.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
InDetGlobalSynchMonTool::m_Tracks_BCID
TProfile * m_Tracks_BCID
Definition: InDetGlobalSynchMonTool.h:180
InDetGlobalSynchMonTool::getBCID
static unsigned int getBCID(unsigned int bcid)
Definition: InDetGlobalSynchMonTool.cxx:542
InDetGlobalSynchMonTool::m_tracks
const TrackCollection * m_tracks
Definition: InDetGlobalSynchMonTool.h:103
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
ROB_PIXEL_BLAYER
#define ROB_PIXEL_BLAYER
Definition: InDetGlobalSynchMonTool.cxx:52
merge.status
status
Definition: merge.py:17
InDetGlobalSynchMonTool::m_det_diff_BCID
std::vector< TH2I_LW * > m_det_diff_BCID
Definition: InDetGlobalSynchMonTool.h:160
InDetGlobalMotherMonTool::m_sctLVL1IDContainer
const InDetTimeCollection * m_sctLVL1IDContainer
Definition: InDetGlobalMotherMonTool.h:623
InDetTimeCollection.h
ROB_SCT_EC_A
#define ROB_SCT_EC_A
Definition: InDetGlobalSynchMonTool.cxx:56
InDetRawDataCLASS_DEF.h
InDetGlobalMotherMonTool::m_driftCircleContainer
const TRT_DriftCircleContainer * m_driftCircleContainer
the TRT drift circle container
Definition: InDetGlobalMotherMonTool.h:620
InDetGlobalMotherTrigMonTool::initialize
virtual StatusCode initialize()
Definition: InDetGlobalMotherTrigMonTool.cxx:38
InDetGlobalMotherMonTool::m_combined_tracks
const TrackCollection * m_combined_tracks
Definition: InDetGlobalMotherMonTool.h:590
ROB_PIXEL_DISKS
#define ROB_PIXEL_DISKS
Definition: InDetGlobalSynchMonTool.cxx:51
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
LWHist::GetYaxis
LWHistAxis * GetYaxis()
Definition: LWHist.cxx:319
ManagedMonitorToolBase::regHist
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition: ManagedMonitorToolBase.cxx:1454
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
InDetGlobalSynchMonTool::m_SCT_Hits_BCID
TProfile * m_SCT_Hits_BCID
Definition: InDetGlobalSynchMonTool.h:177
InDetGlobalSynchMonTool::m_n_pix_robs_JO
int m_n_pix_robs_JO
PIX n robs.
Definition: InDetGlobalSynchMonTool.h:112