24 #include <sys/types.h>
31 m_onlineHelper(nullptr),
34 m_nbOfFebBlocksTotal(-1)
48 return StatusCode::FAILURE;
54 return StatusCode::FAILURE;
64 std::vector<std::string>
part;
80 bool eventRejected =
false;
81 std::bitset<13> rejectionBits;
83 std::vector<int> febInErrorTree(0);
84 std::vector<int> febErrorTypeTree(0);
98 unsigned lumi_block = thisEvent->
lumiBlock();
107 return StatusCode::FAILURE;
110 if (hdrCont->
size()==0) {
112 return StatusCode::SUCCESS;
115 if (!lArFebErrorSummary.
isValid()) {
117 return StatusCode::FAILURE;
124 std::vector<std::string> l1triggers;
125 if(!trigTool.empty()) {
129 for (
unsigned int i=0;
i< l1triggers.size();
i++) {
136 if (l1triggers.size()>0) {trigok=
true;}
else {trigok=
false;}
139 uint32_t firstEventType = (*hdrCont->
begin())->DetEventType();
142 std::lock_guard<std::mutex> lock(m_mut);
151 std::lock_guard<std::mutex> lock(m_mut);
152 if (!m_dspThrDone && firstEventType == 4) {
169 if (!dspThreshFlat.
good()) {
171 <<
". Will not fill histograms." );
174 for (
unsigned iChan=0;iChan<chanMax;++iChan) {
181 ATH_MSG_WARNING(
"No LArDSPThresholds key specified. Will not fill these histograms" );
188 if (firstEventType == 4 && (*hdrCont->
begin())->RodRawDataSize() != 0) firstEventType = 14;
191 int firstEventNbSp=-1;
192 unsigned int totNbOfSweet2 = 0;
193 float larEventSize = 0;
194 float larEventSize_part[8] = {0.,0.,0.,0.,0.,0.,0.,0.};
207 for ( ;
it!=it_e;++
it) {
216 unsigned int subdet = partitionNb_dE / 2;
219 nfeb[partitionNb_dE]++ ;
221 ATH_MSG_WARNING(
"Unknown partition number: "<< partitionNb_dE <<
" not filling !");
224 larEventSize += (
float) ((*it)->RodRawDataSize() + (*it)->RodResults1Size() + (*it)->RodResults2Size());
225 if(partitionNb_dE<8) larEventSize_part[partitionNb_dE] += (
float) ((*it)->RodRawDataSize() + (*it)->RodResults1Size() + (*it)->RodResults2Size());
228 uint32_t eventType = (*it)->DetEventType();
230 if (eventType == 4 && (*it)->RodRawDataSize() != 0) eventType = 14;
232 if (firstEventNbSp < 0)
233 if ((*it)->NbSamples() != 0)
234 firstEventNbSp=(*it)->NbSamples();
237 l1word = (*it)->LVL1TigType();
240 if (firstEventType == 4) totNbOfSweet2 = totNbOfSweet2+(*it)->NbSweetCells2();
244 sw1 = (*it)->NbSweetCells1();
245 sw2 = (*it)->NbSweetCells2();
247 if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != l1Trig){
256 bool anyfebIE =
false;
260 bool currentFebStatus =
false;
263 if ( feberrorSummary != 0 ){
272 fillErrorsSummary(partitionNb_dE,
ft,slot,feberrorSummary,lar_inerror, rejectionBits, currentFebStatus, eventRejected);
274 ATH_MSG_WARNING(
"Unknown partition number: "<< partitionNb_dE <<
" not filling !");
277 if (currentFebStatus && febInErrorTree.size()<33){
279 febErrorTypeTree.push_back(rejectionBits.to_ulong());
282 if(currentFebStatus) anyfebIE = currentFebStatus;
289 for(
auto nf: nfeb) nbOfFeb+=nf;
290 if (firstEventType == 2 || firstEventType == 4 || firstEventType == 14) {
295 bool newHighWaterMarkNFebBlocksTotal =
false;
307 unsigned subdet =
i / 2;
320 if (febInErrorTree.size()>=1 || newHighWaterMarkNFebBlocksTotal || nbOfFeb <
m_nbOfFebBlocksTotal ){
321 evtrej=0; evt_yield = 100.;
322 if (febInErrorTree.size()>=4) evtrej=1;
324 else evtyieldout=100.;
345 evtrej=6; evt_yield = 0.; evtyieldout=0.;
368 fill(
m_monGroupName,mon_febInErrorTree,mon_febErrorTypeTree,eventTime,eventTime_ns,evtonerej);
376 if(streamsThisEvent.size()==1 && streamsThisEvent[0] ==
m_streams.size()) streamsThisEvent[0]=
m_streams.size()-1;
381 for(
unsigned int str=0;
str<streamsThisEvent.size(); ++
str) {
383 if(trigok && streamsThisEvent[
str] <
m_streams.size() && (
m_streams[streamsThisEvent[
str]].find(
"CosmicCalo") != std::string::npos)) {
394 streambin = streamsThisEvent[
str];
395 evsize = larEventSize/262144;
399 unsigned subdet =
i / 2;
407 unsigned subdet =
i / 2;
414 return StatusCode::SUCCESS;
422 if (m_badFebs.count(std::make_pair(slot,
ft)) != 0)
return;
427 if (
error & (1<<0) ){
428 unsigned subdet = partitNb_2 / 2;
432 currentFebStatus =
true;
433 rejectionBits.set(0);
438 if (
error & (1<<1) ){
439 unsigned subdet = partitNb_2 / 2;
443 currentFebStatus =
true;
444 rejectionBits.set(1);
449 if (
error & (1<<2) ){
450 unsigned subdet = partitNb_2 / 2;
454 currentFebStatus =
true;
455 rejectionBits.set(2);
460 if (
error & (1<<3) ){
461 unsigned subdet = partitNb_2 / 2;
465 currentFebStatus =
true;
466 rejectionBits.set(3);
471 if (
error & (1<<4) ){
472 unsigned subdet = partitNb_2 / 2;
476 currentFebStatus =
true;
477 rejectionBits.set(4);
482 if (
error & (1<<5) ){
483 unsigned subdet = partitNb_2 / 2;
487 currentFebStatus =
true;
488 rejectionBits.set(5);
493 if (
error & (1<<6) ){
494 unsigned subdet = partitNb_2 / 2;
498 currentFebStatus =
true;
499 rejectionBits.set(6);
504 if (
error & (1<<7) ){
505 unsigned subdet = partitNb_2 / 2;
509 currentFebStatus =
true;
510 rejectionBits.set(7);
515 if (
error & (1<<8) ){
516 unsigned subdet = partitNb_2 / 2;
520 currentFebStatus =
true;
521 rejectionBits.set(8);
526 if (
error & (1<<9) ){
527 unsigned subdet = partitNb_2 / 2;
531 currentFebStatus =
true;
532 rejectionBits.set(9);
538 if (
error & (1<<11) ){
539 unsigned subdet = partitNb_2 / 2;
543 currentFebStatus =
true;
544 rejectionBits.set(10);
549 if (
error & (1<<12) ){
552 unsigned subdet = partitNb_2 / 2;
556 currentFebStatus =
true;
557 rejectionBits.set(11);
563 if (
error & (1<<13) ){
564 unsigned subdet = partitNb_2 / 2;
568 currentFebStatus =
true;
569 rejectionBits.set(12);
575 unsigned subdet = partitNb_2 / 2;
577 if (currentFebStatus){
582 eventRejected =
true;
613 unsigned int binContent = 0;
616 if (binContent != 0){
622 int subdet = partitionNb_dE / 2;
624 m_badFebs[std::make_pair(slot,
ft)] = binContent;
628 ATH_MSG_INFO(
"filling for " << partitionNb_dE <<
" partition, slot: " << slot <<
"FT: " <<
ft);
631 ATH_MSG_WARNING(
"Unknown partition number: "<< partitionNb_dE <<
" not filling !");
747 if ((
ft == 3 ||
ft == 10 ||
ft == 16 ||
ft == 22) && (sl > 2))
part =
be*2+
pn + 2;