27 return StatusCode::FAILURE;
33 return StatusCode::FAILURE;
42 std::vector<std::string> part;
58 bool eventRejected =
false;
59 std::bitset<13> rejectionBits;
60 std::vector<int> febInErrorTree(0);
61 std::unordered_set<unsigned int> chanids;
65 if(pLArAccDigitContainer.
isValid()){
71 if(pLArAccDigitContainer->empty())
return StatusCode::SUCCESS;
73 for (
auto itDig: * pLArAccDigitContainer) {
74 unsigned int id = (itDig->hardwareID()).get_identifier32().get_compact();
85 unsigned lumi_block = thisEvent->lumiBlock();
93 return StatusCode::FAILURE;
96 if (hdrCont->empty()) {
100 if (!lArFebErrorSummary.
isValid()) {
102 return StatusCode::FAILURE;
105 uint32_t firstEventType = (*hdrCont->begin())->DetEventType();
109 float larEventSize = 0;
114 for (
auto it: * hdrCont) {
121 unsigned int partitionNb_dE =
returnPartition(barrel_ec,pos_neg,ftmon,slmon);
122 unsigned int subdet = partitionNb_dE / 2;
125 nfeb[partitionNb_dE]++ ;
127 ATH_MSG_WARNING(
"Unknown partition number: "<< partitionNb_dE <<
" not filling !");
130 larEventSize += (float) (it->RodRawDataSize() + it->RodResults1Size() + it->RodResults2Size());
133 uint32_t eventType = it->DetEventType();
135 if (eventType == 4 && it->RodRawDataSize() != 0) eventType = 14;
146 bool currentFebStatus =
false;
147 uint16_t feberrorSummary = lArFebErrorSummary->feb_error(febid);
149 if ( feberrorSummary != 0 ){
154 unsigned int partitionNb_dE =
returnPartition(barrel_ec,pos_neg,ft,slot);
158 fillErrorsSummary(partitionNb_dE,ft,slot,feberrorSummary,lar_inerror, rejectionBits, currentFebStatus, eventRejected);
160 ATH_MSG_WARNING(
"Unknown partition number: "<< partitionNb_dE <<
" not filling !");
165 ATH_MSG_WARNING(
"Summarry FEB error: "<< feberrorSummary <<
" The histogram not created !");
174 for(
auto nf: nfeb) nbOfFeb+=nf;
176 bool newHighWaterMarkNFebBlocksTotal =
false;
179 newHighWaterMarkNFebBlocksTotal =
true;
188 unsigned subdet = i / 2;
197 if (febInErrorTree.size()>=1 || newHighWaterMarkNFebBlocksTotal || nbOfFeb <
m_nbOfFebBlocksTotal ){
198 evtrej=1; evt_yield = 100.;
199 if (febInErrorTree.size()>=4) evtrej=2;
207 return StatusCode::SUCCESS;
212 unsigned int part = be*2+pn;
215 if ((ft == 3 || ft == 10 || ft == 16 || ft == 22) && (sl > 2)) part = be*2+pn + 2;
216 if (ft == 6) part = be*2 + pn + 4;
225 if (
error & (1<<0) ){
226 unsigned subdet = partitNb_2 / 2;
230 currentFebStatus =
true;
231 rejectionBits.set(0);
236 if (
error & (1<<1) ){
237 unsigned subdet = partitNb_2 / 2;
241 currentFebStatus =
true;
242 rejectionBits.set(1);
247 if (
error & (1<<2) ){
248 unsigned subdet = partitNb_2 / 2;
252 currentFebStatus =
true;
253 rejectionBits.set(2);
258 if (
error & (1<<3) ){
259 unsigned subdet = partitNb_2 / 2;
263 currentFebStatus =
true;
264 rejectionBits.set(3);
269 if (
error & (1<<4) ){
270 unsigned subdet = partitNb_2 / 2;
274 currentFebStatus =
true;
275 rejectionBits.set(4);
280 if (
error & (1<<5) ){
281 unsigned subdet = partitNb_2 / 2;
285 currentFebStatus =
true;
286 rejectionBits.set(5);
291 if (
error & (1<<6) ){
292 unsigned subdet = partitNb_2 / 2;
296 currentFebStatus =
true;
297 rejectionBits.set(6);
302 if (
error & (1<<7) ){
303 unsigned subdet = partitNb_2 / 2;
307 currentFebStatus =
true;
308 rejectionBits.set(7);
313 if (
error & (1<<8) ){
314 unsigned subdet = partitNb_2 / 2;
318 currentFebStatus =
true;
319 rejectionBits.set(8);
324 if (
error & (1<<9) ){
325 unsigned subdet = partitNb_2 / 2;
329 currentFebStatus =
true;
330 rejectionBits.set(9);
336 if (
error & (1<<11) ){
337 unsigned subdet = partitNb_2 / 2;
341 currentFebStatus =
true;
342 rejectionBits.set(10);
347 if (
error & (1<<12) ){
350 unsigned subdet = partitNb_2 / 2;
354 currentFebStatus =
true;
355 rejectionBits.set(11);
361 if (
error & (1<<13) ){
362 unsigned subdet = partitNb_2 / 2;
366 currentFebStatus =
true;
367 rejectionBits.set(12);
373 if (currentFebStatus){
374 unsigned subdet = partitNb_2 / 2;
380 eventRejected =
true;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Header file to be included by clients of the Monitored infrastructure.
Handle class for reading a decoration on an object.
const ServiceHandle< StoreGateSvc > & detStore() const
Environment_t environment() const
Accessor functions for the environment.
virtual StatusCode initialize() override
initialize
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Gaudi::Property< std::vector< std::string > > m_partitions
Gaudi::Property< bool > m_ignoreMissingHeaderEMB
unsigned int returnPartition(int be, int pn, int ft, int sl) const
Gaudi::Property< std::string > m_MonGroupName
std::atomic< int > m_nbOfFebBlocksTotal
const LArOnlineID * m_onlineHelper
virtual StatusCode initialize() override
Overwrite dummy method from AlgTool.
Gaudi::Property< bool > m_ignoreMissingHeaderPS
void fillErrorsSummary(unsigned int partitNb_2, int ft, int slot, uint16_t error, bool lar_inerror, std::bitset< 13 > &rejectionBits, bool ¤tFebStatus, bool &eventRejected) const
std::vector< std::map< std::string, int > > m_histoGroups
Gaudi::Property< std::vector< std::string > > m_SubDetNames
SG::ReadHandleKey< LArFebHeaderContainer > m_hdrContKey
LArCalibPedMonAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
SG::ReadHandleKey< LArFebErrorSummary > m_lArFebErrorSummaryKey
SG::ReadHandleKey< LArAccumulatedDigitContainer > m_accDigitContainerKey
virtual StatusCode fillHistograms(const EventContext &ctx) const override
Called each event.
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.
std::vector< V > buildToolMap(const ToolHandleArray< GenericMonitoringTool > &tools, const std::string &baseName, int nHist)
Builds an array of indices (base case)
void fill(H5::Group &out_file, size_t iterations)