ATLAS Offline Software
AFPTechnicalMonitorTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
10 
11 #include <GaudiKernel/MsgStream.h>
12 #include <GaudiKernel/StatusCode.h>
14 #include <LWHists/TH1F_LW.h>
15 
16 
19 
20 
22 AFPTechnicalMonitorTool( const std::string & type, const std::string & name,
23  const IInterface* parent )
25  , m_histsDirectoryName ("AFP/Technical/")
26  , m_cNearStation (s_cNearStationIndex)
27  , m_cFarStation (s_cFarStationIndex)
28 {
31 }
32 
33 
35 {
36 }
37 
38 // Description: Used for rebooking unmanaged histograms
40 {
41  return StatusCode::SUCCESS;
42 }
43 
44 // Description: Used for re-booking managed histograms
46 {
47  // ********** Per lumi block **********
48  ManagedMonitorToolBase::MonGroup managed_booking_lumiBlock(this, m_histsDirectoryName.data(), lumiBlock); // to re-booked every luminosity block
49 
50  // book histograms in stations
52  station->bookHistograms(this);
53 
54  // book general histograms
55  m_bcIDATLAS = TH1F_LW::create("bcIDATLAS",
56  "Distribution of bcID from AFP",
57  3564, -0.5, 3563.5);
58  m_bcIDATLAS->SetXTitle("bcID^{ATLAS}");
59  m_bcIDATLAS->SetYTitle("number of events");
60  regHist(m_bcIDATLAS, managed_booking_lumiBlock ).ignore();
61 
62 
63  // create and register histogram only if Raw data is processed
65  m_bcIDAfp = TH1F_LW::create("bcIDAfp",
66  "Distribution of bcID from AFP",
67  3564, -0.5, 3563.5);
68  m_bcIDAfp->SetXTitle("bcID^{AFP}");
69  m_bcIDAfp->SetYTitle("number of events");
70  regHist(m_bcIDAfp, managed_booking_lumiBlock ).ignore();
71 
72 
73  m_bcIDDiffAfpAtlas = TH1F_LW::create("bcIDDiffAfpAtlas",
74  "Distribution of difference between bcID from AFP and ATLAS",
75  21, -10.5, 10.5);
76  m_bcIDDiffAfpAtlas->SetXTitle("bcID^{AFP} - bcID^{ATLAS}");
77  m_bcIDDiffAfpAtlas->SetYTitle("number of events");
78  regHist(m_bcIDDiffAfpAtlas, managed_booking_lumiBlock ).ignore();
79  }
80 
81  return StatusCode::SUCCESS;
82 }
83 
84 
86 {
87  // read information
88  const xAOD::EventInfo* eventInfo = nullptr;
89  CHECK( evtStore()->retrieve( eventInfo) );
90 
91  // create and register histogram only if Raw data is processed
93 
94  // read information
95  const AFP_RawContainer* afpContainer = nullptr;
96  CHECK(evtStore()->retrieve(afpContainer));
97 
98  for (const AFP_SiRawCollection& hitCollection : afpContainer->collectionsSi()) {
99  for (const AFP_SiRawData& hit : hitCollection.dataRecords()) {
100  if (hit.link() <= 3) { // hit.link() is unsigned, so always greater than 0
102  }
103  else if (hit.link() >= 8 && hit.link() <= 11) {
105  }
106  else
107  ATH_MSG_WARNING("Unrecognised station index: "<<hit.link());
108  }
109  }
110 
112  station->eventEnd();
113 
114  // fill histograms
115  m_bcIDAfp->Fill(afpContainer->bcId());
116  m_bcIDDiffAfpAtlas->Fill(afpContainer->bcId() - eventInfo->bcid());
117  }
118 
119  m_bcIDATLAS->Fill(eventInfo->bcid());
120 
121  return StatusCode::SUCCESS;
122 }
123 
124 
126 {
127  // if( endOfLumiBlockFlag() ) {
128  // for (AFPTechnicalStationMonitor* station : m_stationsMonitors)
129  // station->endOfLumiBlock(this);
130  // }
131 
132  return StatusCode::SUCCESS;
133 }
134 
135 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AFPTechnicalMonitorTool::m_stationsMonitors
std::vector< AFPTechnicalStationMonitor * > m_stationsMonitors
Vector of all stations monitors.
Definition: AFPTechnicalMonitorTool.h:60
AFPTechnicalMonitorTool::~AFPTechnicalMonitorTool
virtual ~AFPTechnicalMonitorTool()
Does nothing.
Definition: AFPTechnicalMonitorTool.cxx:34
TH1F_LW.h
AFPTechnicalStationMonitor
A class monitoring technical parameters of one station.
Definition: AFPTechnicalStationMonitor.h:22
ManagedMonitorToolBase::lumiBlock
@ lumiBlock
Definition: ManagedMonitorToolBase.h:114
TH1F_LW::create
static TH1F_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup)
Definition: TH1F_LW.cxx:33
ManagedMonitorToolBase
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
Definition: ManagedMonitorToolBase.h:74
AFPTechnicalMonitorTool::m_cNearStation
AFPTechnicalStationMonitor m_cNearStation
Station on C side that is closer to the interaction point.
Definition: AFPTechnicalMonitorTool.h:55
AFPTechnicalMonitorTool::m_cFarStation
AFPTechnicalStationMonitor m_cFarStation
Station on C side that is further away from the interaction point.
Definition: AFPTechnicalMonitorTool.h:57
AFP_RawContainer.h
AFPTechnicalMonitorTool::procHistograms
virtual StatusCode procHistograms()
Does nothing.
Definition: AFPTechnicalMonitorTool.cxx:125
AFPTechnicalMonitorTool::AFPTechnicalMonitorTool
AFPTechnicalMonitorTool(const std::string &type, const std::string &name, const IInterface *parent)
Adds two stations monitors on C side to m_stationsMonitors.
Definition: AFPTechnicalMonitorTool.cxx:22
AFPTechnicalMonitorTool::s_cFarStationIndex
static const int s_cFarStationIndex
ID number of the far station on C side.
Definition: AFPTechnicalMonitorTool.h:49
AFP_SiRawData.h
AFP_RawContainer::bcId
uint16_t bcId() const
Definition: AFP_RawContainer.h:18
AFPTechnicalMonitorTool::bookHistogramsRecurrent
virtual StatusCode bookHistogramsRecurrent()
Does nothing.
Definition: AFPTechnicalMonitorTool.cxx:39
AFP_RawContainer
Definition: AFP_RawContainer.h:13
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
ManagedMonitorToolBase::MonGroup
A container of information describing a monitoring object.
Definition: ManagedMonitorToolBase.h:138
AFP_RawCollection
Class representing collection of silicon detector data.
Definition: AFP_RawCollection.h:14
AFPTechnicalMonitorTool::m_histsDirectoryName
const std::string m_histsDirectoryName
Name of the Root file path where histograms should be saved.
Definition: AFPTechnicalMonitorTool.h:52
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthenaMonManager::online
@ online
Definition: AthenaMonManager.h:49
AFPTechnicalMonitorTool::m_bcIDAfp
LWHist1D * m_bcIDAfp
distribution of bcID sent by AFP
Definition: AFPTechnicalMonitorTool.h:63
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthenaMonManager::tier0Raw
@ tier0Raw
Definition: AthenaMonManager.h:49
AthenaMonManager.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AFPTechnicalStationMonitor::fillHistograms
void fillHistograms(const AFP_SiRawData &hit)
Fills general station monitoring histograms and executes AFPTechnicalLayerMonitor::fillHistograms()
Definition: AFPTechnicalStationMonitor.cxx:52
AFPTechnicalMonitorTool::m_bcIDDiffAfpAtlas
LWHist1D * m_bcIDDiffAfpAtlas
distribution of difference between ATLAS and AFP bcID
Definition: AFPTechnicalMonitorTool.h:65
ManagedMonitorToolBase::m_environment
AthenaMonManager::Environment_t m_environment
Definition: ManagedMonitorToolBase.h:902
AFP_RawContainer::collectionsSi
const std::list< AFP_SiRawCollection > & collectionsSi() const
Definition: AFP_RawContainer.h:30
LWHist::SetXTitle
void SetXTitle(const char *)
Definition: LWHist.cxx:431
AFP_SiRawData
Class representing data record for silicon detectors.
Definition: AFP_SiRawData.h:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LWHist::SetYTitle
void SetYTitle(const char *)
Definition: LWHist.cxx:440
AFPTechnicalMonitorTool::s_cNearStationIndex
static const int s_cNearStationIndex
ID number of the near station on C side.
Definition: AFPTechnicalMonitorTool.h:47
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
AFPTechnicalMonitorTool::fillHistograms
virtual StatusCode fillHistograms()
Fills general histograms and calls AFPTechnicalStationMonitor::fillHistograms and AFPTechnicalStation...
Definition: AFPTechnicalMonitorTool.cxx:85
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AFPTechnicalMonitorTool.h
AFPTechnicalMonitorTool::m_bcIDATLAS
LWHist1D * m_bcIDATLAS
distribution of bcID sent by ATLAS
Definition: AFPTechnicalMonitorTool.h:64
AFPTechnicalMonitorTool::bookHistograms
virtual StatusCode bookHistograms()
Books histograms for general monitoring and executes AFPTechnicalStationMonitor::bookHistograms() for...
Definition: AFPTechnicalMonitorTool.cxx:45
LWHist1D::Fill
virtual void Fill(const double &x)=0
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
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