ATLAS Offline Software
LArNoisyROFillerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #include "LArNoisyROFillerTool.h"
9 
10 
11 namespace D3PD{
12 
14  const std::string& name,
15  const IInterface* parent)
17 {
18  declareProperty("SaveNB",m_SaveNB = true);
19  declareProperty("SaveFEBID",m_SaveFEBIDs = true);
20  declareProperty("SavePAID",m_SavePAIDs = true);
21 
22  LArNoisyROFillerTool::book().ignore(); // Avoid coverity warnings
23 }
24 
25 
27 {
28  if (m_SaveNB) CHECK( addVariable("nNoisyFEB", m_nNoisyFEB, "Number of LAr FEB declared noisy"));
29 
30  if (m_SaveFEBIDs) CHECK( addVariable("NoisyFEB", m_NoisyFEBIDs, "List of FEB ids for FEB declared noisy"));
31 
32  if (m_SaveNB) CHECK( addVariable("nNoisyPA", m_nNoisyPA, "Number of LAr preamp declared noisy"));
33 
34  if (m_SavePAIDs) CHECK( addVariable("NoisyPA", m_NoisyPAIDs, "List of preamp ids for preamp declared noisy"));
35 
36  return StatusCode::SUCCESS;
37 }
38 
40 {
41  const std::vector<HWIdentifier>& noisyfebs = c.get_noisy_febs();
42  if (m_SaveNB) *m_nNoisyFEB = noisyfebs.size();
43 
44  if (m_SaveFEBIDs)
45  {
46  m_NoisyFEBIDs->clear();
47  for (HWIdentifier hwid : noisyfebs) {
48  m_NoisyFEBIDs->push_back(hwid.get_identifier32().get_compact());
49  }
50  }
51 
52 
53  const std::vector< std::pair<HWIdentifier, std::vector<int> > >& noisypas = c.get_noisy_preamps();
54  if (m_SaveNB) *m_nNoisyPA = 0;
55 
56  if (m_SavePAIDs) m_NoisyPAIDs->clear();
57  for ( size_t i = 0; i < noisypas.size(); i++ )
58  {
59  if (m_SaveNB) *m_nNoisyPA += noisypas[i].second.size();
60  if (m_SavePAIDs)
61  m_NoisyPAIDs->push_back( std::make_pair( noisypas[i].first.get_identifier32().get_compact(),noisypas[i].second));
62  }
63 
64  return StatusCode::SUCCESS;
65 }
66 
67 }
68 
69 
D3PD::LArNoisyROFillerTool::m_nNoisyPA
int * m_nNoisyPA
Definition: LArNoisyROFillerTool.h:47
D3PD::LArNoisyROFillerTool::m_NoisyPAIDs
std::vector< std::pair< unsigned long, std::vector< int > > > * m_NoisyPAIDs
Definition: LArNoisyROFillerTool.h:49
D3PD::LArNoisyROFillerTool::m_SaveNB
bool m_SaveNB
Definition: LArNoisyROFillerTool.h:41
D3PD::LArNoisyROFillerTool::m_NoisyFEBIDs
std::vector< unsigned long > * m_NoisyFEBIDs
Definition: LArNoisyROFillerTool.h:45
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition: AddVariable.cxx:85
HWIdentifier
Definition: HWIdentifier.h:13
D3PD::LArNoisyROFillerTool::book
virtual StatusCode book()
Book variables for this block.
Definition: LArNoisyROFillerTool.cxx:26
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::LArNoisyROFillerTool::LArNoisyROFillerTool
LArNoisyROFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: LArNoisyROFillerTool.cxx:13
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition: BlockFillerTool.h:68
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::LArNoisyROFillerTool::m_SaveFEBIDs
bool m_SaveFEBIDs
Definition: LArNoisyROFillerTool.h:44
HWIdentifier.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
errorcheck.h
Helpers for checking error return status codes and reporting errors.
D3PD::LArNoisyROFillerTool::m_nNoisyFEB
int * m_nNoisyFEB
Definition: LArNoisyROFillerTool.h:43
D3PD::LArNoisyROFillerTool::m_SavePAIDs
bool m_SavePAIDs
Definition: LArNoisyROFillerTool.h:48
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:536
D3PD::LArNoisyROFillerTool::fill
virtual StatusCode fill(const LArNoisyROSummary &c)
fill variables
Definition: LArNoisyROFillerTool.cxx:39
python.compressB64.c
def c
Definition: compressB64.py:93
LArNoisyROSummary
Summary information for noisy LAr preamp / FEBs.
Definition: LArNoisyROSummary.h:26
LArNoisyROFillerTool.h