ATLAS Offline Software
LArFebErrorSummaryMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARROD_LARFEBERRORSUMMARYMAKER
6 #define LARROD_LARFEBERRORSUMMARYMAKER
7 
8 
9 /********************************************************************
10 
11 NAME: LArFebSummaryMaker
12  Algorithm that makes LArFebSummary
13 
14 ********************************************************************/
15 
18 #include <GaudiKernel/ServiceHandle.h>
19 #include <GaudiKernel/ToolHandle.h>
20 
24 
27 
31 
33 
34 #include <array>
35 #include <set>
36 
37 class LArOnlineID;
38 
40 {
41  public:
42 
44  virtual ~LArFebErrorSummaryMaker() = default;
45 
46  virtual StatusCode initialize() override final;
47  virtual StatusCode execute(const EventContext& ctx) const override final;
48  virtual StatusCode finalize() override final;
49 
50  private:
51 
52  //Counters:
53  mutable std::atomic<int> m_missingFebsWarns{0}; //counter for missing FEB warnings
54  //Lock used when keeping track of errors (rare)
55  mutable std::mutex m_mtx; //mutex to guards write-ops on the following objects:
56  mutable std::array<unsigned, LArFebErrorSummary::N_LArFebErrorType> m_errors ATLAS_THREAD_SAFE; //error types accumulator
57  mutable std::map<unsigned,unsigned> m_errsPerFeb ATLAS_THREAD_SAFE;
58 
59 
60  //The following variables are set in initialize:
61  std::set<unsigned int> m_all_febs ;
62  bool m_isHec=false;
63  bool m_isFcal=false;
64  bool m_isEmb=false;
65  bool m_isEmec=false;
66  bool m_isEmPS=false;
67  bool m_isAside=false;
68  bool m_isCside=false;
69 
70  const LArOnlineID* m_onlineHelper=nullptr;
71 
72  // properties:
73  Gaudi::Property<int> m_warnLimit{ this, "warnLimit", 10, "Limit the number of warning messages for missing input" };
74  Gaudi::Property<bool> m_checkAllFeb{ this, "CheckAllFEB", true, "Check all FEBS ?" };
75  Gaudi::Property<std::string> m_partition{ this, "PartitionId", "", "Should contain DAQ partition (+ eventually the EventBuilder)" };
76  Gaudi::Property<std::set<unsigned int> > m_knownEvtId{ this, "MaskFebEvtId", {}, "ignore these FEBs for EvtId" };
77  Gaudi::Property<std::set<unsigned int> > m_knownSCACStatus{ this, "MaskFebScacStatus", {}, "ignore these FEBs for ScacStatus" };
78  Gaudi::Property<std::set<unsigned int> > m_knownZeroSample{ this, "MaskFebZeroSample", {}, "ignore these FEBs for ZeroSample" };
79 
83  Gaudi::Property<int> m_minFebsInError{this,"minFebInError",1,
84  "Minimum number of FEBs in error to trigger EventInfo::LArError (1 by default/bulk, 4 in online/express"};
85 
86  SG::ReadCondHandleKey<LArBadFebCont> m_bfKey{this,"BFKey","LArBadFeb","Key of the BadFebContainer in the conditions store"};
87  SG::ReadHandleKey<LArFebHeaderContainer> m_readKey{this,"ReadKey","LArFebHeader"};
88  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"EventInfoKey","EventInfo"};
89  SG::WriteDecorHandleKey<xAOD::EventInfo> m_eventInfoDecorKey{this,"EventInfoDecorKey","EventInfo.larFlags"};
90  SG::WriteHandleKey<LArFebErrorSummary> m_writeKey{this,"WriteKey","LArFebErrorSummary"};
91 
92  // methods:
93  static bool masked (unsigned int hid, const std::set<unsigned int>& v_feb) ;
94 };
95 #endif
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey< xAOD::EventInfo >
LArFebErrorSummaryMaker::m_isEmPS
bool m_isEmPS
Definition: LArFebErrorSummaryMaker.h:66
LArFebErrorSummaryMaker::m_missingFebsWarns
std::atomic< int > m_missingFebsWarns
Definition: LArFebErrorSummaryMaker.h:53
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
LArFebErrorSummaryMaker::m_bfKey
SG::ReadCondHandleKey< LArBadFebCont > m_bfKey
Definition: LArFebErrorSummaryMaker.h:86
LArFebErrorSummaryMaker::m_writeKey
SG::WriteHandleKey< LArFebErrorSummary > m_writeKey
Definition: LArFebErrorSummaryMaker.h:90
LArFebErrorSummaryMaker::m_eventInfoDecorKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
Definition: LArFebErrorSummaryMaker.h:89
LArFebErrorSummaryMaker::m_knownSCACStatus
Gaudi::Property< std::set< unsigned int > > m_knownSCACStatus
Definition: LArFebErrorSummaryMaker.h:77
LArFebErrorSummaryMaker::m_checkAllFeb
Gaudi::Property< bool > m_checkAllFeb
Definition: LArFebErrorSummaryMaker.h:74
LArFebErrorSummaryMaker::masked
static bool masked(unsigned int hid, const std::set< unsigned int > &v_feb)
Definition: LArFebErrorSummaryMaker.cxx:318
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SG::ReadHandleKey< LArFebHeaderContainer >
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
LArFebErrorSummaryMaker
Definition: LArFebErrorSummaryMaker.h:40
LArBadChannelCont.h
LArFebErrorSummaryMaker::m_isEmb
bool m_isEmb
Definition: LArFebErrorSummaryMaker.h:64
LArFebErrorSummaryMaker::m_knownZeroSample
Gaudi::Property< std::set< unsigned int > > m_knownZeroSample
Definition: LArFebErrorSummaryMaker.h:78
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
LArFebErrorSummaryMaker::m_isEmec
bool m_isEmec
Definition: LArFebErrorSummaryMaker.h:65
SG::WriteHandleKey< LArFebErrorSummary >
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArFebErrorSummaryMaker::m_knownEvtId
Gaudi::Property< std::set< unsigned int > > m_knownEvtId
Definition: LArFebErrorSummaryMaker.h:76
LArFebErrorSummaryMaker::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: LArFebErrorSummaryMaker.h:88
LArFebErrorSummaryMaker::finalize
virtual StatusCode finalize() override final
Definition: LArFebErrorSummaryMaker.cxx:324
ReadCondHandleKey.h
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
LArFebErrorSummaryMaker::~LArFebErrorSummaryMaker
virtual ~LArFebErrorSummaryMaker()=default
LArFebHeaderContainer.h
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
LArFebErrorSummaryMaker::ATLAS_THREAD_SAFE
std::map< unsigned, unsigned > m_errsPerFeb ATLAS_THREAD_SAFE
Definition: LArFebErrorSummaryMaker.h:57
LArFebErrorSummaryMaker::m_warnLimit
Gaudi::Property< int > m_warnLimit
Definition: LArFebErrorSummaryMaker.h:73
LArOnlineID
Definition: LArOnlineID.h:20
LArFebErrorSummaryMaker::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArFebErrorSummaryMaker.h:70
LArFebErrorSummaryMaker::m_minFebsInError
Gaudi::Property< int > m_minFebsInError
Minimum number of FEBs in error to trigger EventInfo::LArError Defined as 1 by default/bulk,...
Definition: LArFebErrorSummaryMaker.h:83
EventInfo.h
LArFebErrorSummaryMaker::m_isFcal
bool m_isFcal
Definition: LArFebErrorSummaryMaker.h:63
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
LArFebErrorSummaryMaker::m_isHec
bool m_isHec
Definition: LArFebErrorSummaryMaker.h:62
LArFebErrorSummaryMaker::m_all_febs
std::set< unsigned int > m_all_febs
Definition: LArFebErrorSummaryMaker.h:61
LArFebErrorSummaryMaker::initialize
virtual StatusCode initialize() override final
Definition: LArFebErrorSummaryMaker.cxx:15
LArFebErrorSummaryMaker::m_readKey
SG::ReadHandleKey< LArFebHeaderContainer > m_readKey
Definition: LArFebErrorSummaryMaker.h:87
LArFebErrorSummaryMaker::m_mtx
std::mutex m_mtx
Definition: LArFebErrorSummaryMaker.h:55
LArFebErrorSummaryMaker::m_partition
Gaudi::Property< std::string > m_partition
Definition: LArFebErrorSummaryMaker.h:75
LArFebErrorSummaryMaker::m_isCside
bool m_isCside
Definition: LArFebErrorSummaryMaker.h:68
LArFebErrorSummary.h
checker_macros.h
Define macros for attributes used to control the static checker.
LArFebErrorSummaryMaker::ATLAS_THREAD_SAFE
std::array< unsigned, LArFebErrorSummary::N_LArFebErrorType > m_errors ATLAS_THREAD_SAFE
Definition: LArFebErrorSummaryMaker.h:56
LArFebErrorSummaryMaker::m_isAside
bool m_isAside
Definition: LArFebErrorSummaryMaker.h:67
LArFebErrorSummaryMaker::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: LArFebErrorSummaryMaker.cxx:86