ATLAS Offline Software
LArRawChannelBuilderStatistics.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 
8 #include <iostream>
9 
11  unsigned short bitpat):
12  m_N_errors(nerr),
13  m_bit_pattern(bitpat),
14  m_s("")
15 {
16  m_error_count.resize(m_N_errors);
17  m_error_string.resize(m_N_errors);
21 
22  for( unsigned int i=0; i<m_N_errors; i++ )
23  {
24  m_error_count[i]=0;
28  }
29  m_events=0;
30 
31  m_first=true;
32 }
33 
35 {
36  if(nerr<m_N_errors)
37  {
38  m_error_count[nerr]++;
39  m_errors_this_event[nerr]++;
40  }
41 }
42 
44 {
45  if(nerr<m_N_errors)
46  return m_error_count[nerr];
47  return 0;
48 }
49 
51 {
52  if(nerr<m_N_errors)
53  return m_errors_per_event[nerr];
54  return 0;
55 }
56 
58 {
59  if(nerr<m_N_errors)
60  return m_errorsSq_per_event[nerr];
61  return 0;
62 }
63 
65 {
66  return m_events;
67 }
68 
69 void LArRawChannelBuilderStatistics::setErrorString(unsigned int nerr, const std::string& s)
70 {
71  if(nerr<m_N_errors)
72  m_error_string[nerr]=s;
73 }
75 {
76  if(nerr>=m_N_errors)
77  return m_s;
78  return m_error_string[nerr];
79 }
81 {
82  return m_N_errors;
83 }
84 
86 {
87  return m_bit_pattern;
88 }
89 
91 {
92  for( unsigned int i=0; i<m_N_errors; i++ )
93  {
94  // errors per event
97 
99  }
100  m_events++;
101 }
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
LArRawChannelBuilderStatistics::m_errors_this_event
std::vector< unsigned long > m_errors_this_event
Definition: LArRawChannelBuilderStatistics.h:46
LArRawChannelBuilderStatistics::setErrorString
void setErrorString(unsigned int nerr, const std::string &s)
Definition: LArRawChannelBuilderStatistics.cxx:69
LArRawChannelBuilderStatistics::m_N_errors
const unsigned int m_N_errors
Definition: LArRawChannelBuilderStatistics.h:43
LArRawChannelBuilderStatistics::LArRawChannelBuilderStatistics
LArRawChannelBuilderStatistics(unsigned int nerr, unsigned short bitpat)
Definition: LArRawChannelBuilderStatistics.cxx:10
LArRawChannelBuilderStatistics::incrementErrorCount
void incrementErrorCount(unsigned int nerr)
Definition: LArRawChannelBuilderStatistics.cxx:34
LArRawChannelBuilderStatistics::m_bit_pattern
const unsigned int m_bit_pattern
Definition: LArRawChannelBuilderStatistics.h:52
LArRawChannelBuilderStatistics::m_first
bool m_first
Definition: LArRawChannelBuilderStatistics.h:55
LArRawChannelBuilderStatistics::m_s
const std::string m_s
Definition: LArRawChannelBuilderStatistics.h:53
LArRawChannelBuilderStatistics::returnErrorCount
ulonglong returnErrorCount(unsigned int nerr)
Definition: LArRawChannelBuilderStatistics.cxx:43
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArRawChannelBuilderStatistics::returnErrorCountSqPerEvent
ulonglong returnErrorCountSqPerEvent(unsigned int nerr)
Definition: LArRawChannelBuilderStatistics.cxx:57
LArRawChannelBuilderStatistics::m_errorsSq_per_event
std::vector< ulonglong > m_errorsSq_per_event
Definition: LArRawChannelBuilderStatistics.h:48
LArRawChannelBuilderStatistics::returnEvents
unsigned long returnEvents() const
Definition: LArRawChannelBuilderStatistics.cxx:64
LArRawChannelBuilderStatistics::returnErrorCountPerEvent
ulonglong returnErrorCountPerEvent(unsigned int nerr)
Definition: LArRawChannelBuilderStatistics.cxx:50
LArRawChannelBuilderStatistics::m_errors_per_event
std::vector< ulonglong > m_errors_per_event
Definition: LArRawChannelBuilderStatistics.h:47
LArRawChannelBuilderStatistics::m_error_count
std::vector< ulonglong > m_error_count
Definition: LArRawChannelBuilderStatistics.h:44
LArRawChannelBuilderStatistics::resetErrorcountPerEvent
void resetErrorcountPerEvent()
Definition: LArRawChannelBuilderStatistics.cxx:90
LArRawChannelBuilderStatistics::returnMaxErrors
unsigned int returnMaxErrors() const
Definition: LArRawChannelBuilderStatistics.cxx:80
LArRawChannelBuilderStatistics.h
LArRawChannelBuilderStatistics::m_events
unsigned long m_events
Definition: LArRawChannelBuilderStatistics.h:49
LArRawChannelBuilderStatistics::m_error_string
std::vector< std::string > m_error_string
Definition: LArRawChannelBuilderStatistics.h:45
LArRawChannelBuilderStatistics::returnErrorString
std::string returnErrorString(unsigned int nerr)
Definition: LArRawChannelBuilderStatistics.cxx:74
LArRawChannelBuilderStatistics::returnBitPattern
unsigned int returnBitPattern() const
Definition: LArRawChannelBuilderStatistics.cxx:85