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 "Gaudi/Parsers/Factory.h"
35 
36 #include <array>
37 #include <set>
38 
39 class LArOnlineID;
40 
42 {
43  public:
44 
46  virtual ~LArFebErrorSummaryMaker() = default;
47 
48  virtual StatusCode initialize() override final;
49  virtual StatusCode execute(const EventContext& ctx) const override final;
50  virtual StatusCode finalize() override final;
51 
52  private:
53 
54  //Counters:
55  mutable std::atomic<int> m_missingFebsWarns{0}; //counter for missing FEB warnings
56  //Lock used when keeping track of errors (rare)
57  mutable std::mutex m_mtx; //mutex to guards write-ops on the following objects:
58  mutable std::array<unsigned, LArFebErrorSummary::N_LArFebErrorType> m_errors ATLAS_THREAD_SAFE; //error types accumulator
59  mutable std::map<unsigned,unsigned> m_errsPerFeb ATLAS_THREAD_SAFE;
60 
61 
62  //The following variables are set in initialize:
63  std::set<unsigned int> m_all_febs ;
64  bool m_isHec=false;
65  bool m_isFcal=false;
66  bool m_isEmb=false;
67  bool m_isEmec=false;
68  bool m_isEmPS=false;
69  bool m_isAside=false;
70  bool m_isCside=false;
71 
72  const LArOnlineID* m_onlineHelper=nullptr;
73 
74  // properties:
75  Gaudi::Property<int> m_warnLimit{ this, "warnLimit", 10, "Limit the number of warning messages for missing input" };
76  Gaudi::Property<bool> m_checkAllFeb{ this, "CheckAllFEB", true, "Check all FEBS ?" };
77  Gaudi::Property<std::string> m_partition{ this, "PartitionId", "", "Should contain DAQ partition (+ eventually the EventBuilder)" };
78  Gaudi::Property<std::set<unsigned int> > m_knownEvtId{ this, "MaskFebEvtId", {}, "ignore these FEBs for EvtId" };
79  Gaudi::Property<std::set<unsigned int> > m_knownSCACStatus{ this, "MaskFebScacStatus", {}, "ignore these FEBs for ScacStatus" };
80  Gaudi::Property<std::set<unsigned int> > m_knownZeroSample{ this, "MaskFebZeroSample", {}, "ignore these FEBs for ZeroSample" };
81 
85  Gaudi::Property<int> m_minFebsInError{this,"minFebInError",1,
86  "Minimum number of FEBs in error to trigger EventInfo::LArError (1 by default/bulk, 4 in online/express"};
87 
88  SG::ReadCondHandleKey<LArBadFebCont> m_bfKey{this,"BFKey","LArBadFeb","Key of the BadFebContainer in the conditions store"};
89  SG::ReadHandleKey<LArFebHeaderContainer> m_readKey{this,"ReadKey","LArFebHeader"};
90  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"EventInfoKey","EventInfo"};
91  SG::WriteDecorHandleKey<xAOD::EventInfo> m_eventInfoDecorKey{this,"EventInfoDecorKey","EventInfo.larFlags"};
92  SG::WriteHandleKey<LArFebErrorSummary> m_writeKey{this,"WriteKey","LArFebErrorSummary"};
93 
94  // methods:
95  static bool masked (unsigned int hid, const std::set<unsigned int>& v_feb) ;
96 };
97 #endif
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
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:68
LArFebErrorSummaryMaker::m_missingFebsWarns
std::atomic< int > m_missingFebsWarns
Definition: LArFebErrorSummaryMaker.h:55
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
LArFebErrorSummaryMaker::m_bfKey
SG::ReadCondHandleKey< LArBadFebCont > m_bfKey
Definition: LArFebErrorSummaryMaker.h:88
LArFebErrorSummaryMaker::m_writeKey
SG::WriteHandleKey< LArFebErrorSummary > m_writeKey
Definition: LArFebErrorSummaryMaker.h:92
LArFebErrorSummaryMaker::m_eventInfoDecorKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
Definition: LArFebErrorSummaryMaker.h:91
LArFebErrorSummaryMaker::m_knownSCACStatus
Gaudi::Property< std::set< unsigned int > > m_knownSCACStatus
Definition: LArFebErrorSummaryMaker.h:79
LArFebErrorSummaryMaker::m_checkAllFeb
Gaudi::Property< bool > m_checkAllFeb
Definition: LArFebErrorSummaryMaker.h:76
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:562
SG::ReadHandleKey< LArFebHeaderContainer >
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
LArFebErrorSummaryMaker
Definition: LArFebErrorSummaryMaker.h:42
LArBadChannelCont.h
LArFebErrorSummaryMaker::m_isEmb
bool m_isEmb
Definition: LArFebErrorSummaryMaker.h:66
LArFebErrorSummaryMaker::m_knownZeroSample
Gaudi::Property< std::set< unsigned int > > m_knownZeroSample
Definition: LArFebErrorSummaryMaker.h:80
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
LArFebErrorSummaryMaker::m_isEmec
bool m_isEmec
Definition: LArFebErrorSummaryMaker.h:67
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:78
LArFebErrorSummaryMaker::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: LArFebErrorSummaryMaker.h:90
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:59
LArFebErrorSummaryMaker::m_warnLimit
Gaudi::Property< int > m_warnLimit
Definition: LArFebErrorSummaryMaker.h:75
LArOnlineID
Definition: LArOnlineID.h:20
LArFebErrorSummaryMaker::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArFebErrorSummaryMaker.h:72
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:85
EventInfo.h
LArFebErrorSummaryMaker::m_isFcal
bool m_isFcal
Definition: LArFebErrorSummaryMaker.h:65
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
LArFebErrorSummaryMaker::m_isHec
bool m_isHec
Definition: LArFebErrorSummaryMaker.h:64
LArFebErrorSummaryMaker::m_all_febs
std::set< unsigned int > m_all_febs
Definition: LArFebErrorSummaryMaker.h:63
LArFebErrorSummaryMaker::initialize
virtual StatusCode initialize() override final
Definition: LArFebErrorSummaryMaker.cxx:15
LArFebErrorSummaryMaker::m_readKey
SG::ReadHandleKey< LArFebHeaderContainer > m_readKey
Definition: LArFebErrorSummaryMaker.h:89
LArFebErrorSummaryMaker::m_mtx
std::mutex m_mtx
Definition: LArFebErrorSummaryMaker.h:57
LArFebErrorSummaryMaker::m_partition
Gaudi::Property< std::string > m_partition
Definition: LArFebErrorSummaryMaker.h:77
LArFebErrorSummaryMaker::m_isCside
bool m_isCside
Definition: LArFebErrorSummaryMaker.h:70
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:58
LArFebErrorSummaryMaker::m_isAside
bool m_isAside
Definition: LArFebErrorSummaryMaker.h:69
LArFebErrorSummaryMaker::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: LArFebErrorSummaryMaker.cxx:86