110 hid = theHistogramId->setHistoId(
"errorType",
id_);
111 meErrorType_ = theDMBE->book1D(hid,
"Type of errors",15,24.5,39.5);
114 hid = theHistogramId->setHistoId(
"NErrors",
id_);
115 meNErrors_ = theDMBE->book1D(hid,
"Number of errors",36,0.,36.);
120 hid = theHistogramId->setHistoId(
"fullType",
id_);
121 meFullType_ = theDMBE->book1D(hid,
"Type of FIFO full",7,0.5,7.5);
126 hid = theHistogramId->setHistoId(
"TBMMessage",
id_);
127 meTBMMessage_ = theDMBE->book1D(hid,
"TBM trailer message",8,-0.5,7.5);
131 hid = theHistogramId->setHistoId(
"TBMType",
id_);
132 meTBMType_ = theDMBE->book1D(hid,
"Type of TBM trailer",5,-0.5,4.5);
135 hid = theHistogramId->setHistoId(
"EvtNbr",
id_);
138 hid = theHistogramId->setHistoId(
"evtSize",
id_);
141 for(
int j=0;
j!=37;
j++){
142 std::stringstream
temp; temp <<
j;
143 hid =
"FedChNErrArray_" + temp.str();
145 hid =
"FedChLErrArray_" + temp.str();
147 hid =
"FedETypeNErrArray_" + temp.str();
150 delete theHistogramId;
164 unsigned int numberOfSeriousErrors = 0;
168 if( isearch != input.
end() ) {
171 for(di = isearch->data.
begin(); di != isearch->data.
end(); di++) {
172 int FedId = di->getFedId();
174 int errorType = di->getType();
175 int TBMType=-1;
int TBMMessage=-1;
int evtSize=-1;
int evtNbr=-1;
int fullType=-1;
182 if(errorType == 32 || errorType == 33 || errorType == 34) {
183 long long errorWord = di->getWord64();
184 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
187 uint32_t errorWord = di->getWord32();
188 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
215 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
216 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
217 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
218 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
219 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
220 if ((chanNmbr<1)||(chanNmbr>36)) chanNmbr=0;
231 if (T0==1) TBMMessage=0;
232 if (T1==1) TBMMessage=1;
233 if (T2==1) TBMMessage=2;
234 if (T3==1) TBMMessage=3;
235 if (T4==1) TBMMessage=4;
236 if (T5==1) TBMMessage=5;
237 if (T6==1) TBMMessage=6;
238 if (T7==1) TBMMessage=7;
240 int StateMach_bits = 4;
241 int StateMach_shift = 8;
242 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
243 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
248 case(1) :
case(9) : {
251 case(2) :
case(4) :
case(6) : {
257 default : TBMType = 4;
279 if(errorType == 32 || errorType == 33 || errorType == 34){
280 long long errorWord = di->getWord64();
282 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
284 uint32_t errorWord = di->getWord32();
285 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
312 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
313 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
314 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
315 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
316 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
317 if ((chanNmbr<1)||(chanNmbr>36)) chanNmbr=0;
328 if (T0==1) TBMMessage=0;
329 if (T1==1) TBMMessage=1;
330 if (T2==1) TBMMessage=2;
331 if (T3==1) TBMMessage=3;
332 if (T4==1) TBMMessage=4;
333 if (T5==1) TBMMessage=5;
334 if (T6==1) TBMMessage=6;
335 if (T7==1) TBMMessage=7;
336 int StateMach_bits = 4;
337 int StateMach_shift = 8;
338 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
339 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
344 case(1) :
case(9) : {
347 case(2) :
case(4) :
case(6) : {
353 default : TBMType = 4;
374 if(bladeon && endcap){
375 if(errorType == 32 || errorType == 33 || errorType == 34){
376 long long errorWord = di->getWord64();
378 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
380 uint32_t errorWord = di->getWord32();
381 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
408 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
409 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
410 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
411 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
412 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
413 if ((chanNmbr<1)||(chanNmbr>36)) chanNmbr=0;
424 if (T0==1) TBMMessage=0;
425 if (T1==1) TBMMessage=1;
426 if (T2==1) TBMMessage=2;
427 if (T3==1) TBMMessage=3;
428 if (T4==1) TBMMessage=4;
429 if (T5==1) TBMMessage=5;
430 if (T6==1) TBMMessage=6;
431 if (T7==1) TBMMessage=7;
432 int StateMach_bits = 4;
433 int StateMach_shift = 8;
434 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
435 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
440 case(1) :
case(9) : {
443 case(2) :
case(4) :
case(6) : {
449 default : TBMType = 4;
470 if(!(FedId==38&&chanNmbr==7)){
471 if(errorType==29 || (errorType==30 && TBMType==1)){
475 static const char chNfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChNErrArray_%d";
476 char chNbuf[
sizeof(chNfmt) + 2*32];
477 sprintf(chNbuf, chNfmt, FedId, chanNmbr);
482 static const char chLfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChLErrArray_%d";
483 char chLbuf[
sizeof(chLfmt) + 2*32];
484 sprintf(chLbuf, chLfmt, FedId, chanNmbr);
489 numberOfSeriousErrors++;
490 int messageType = 99;
491 if(errorType<30) messageType = errorType-25;
492 else if(errorType>30) messageType = errorType-19;
493 else if(errorType==30 && TBMMessage==0) messageType = errorType-25;
494 else if(errorType==30 && TBMMessage==1) messageType = errorType-24;
495 else if(errorType==30 && (TBMMessage==2 || TBMMessage==3 || TBMMessage==4)) messageType = errorType-23;
496 else if(errorType==30 && TBMMessage==7) messageType = errorType-22;
497 else if(errorType==30 && TBMType==1) messageType = errorType-21;
498 else if(errorType==30 && TBMType==2) messageType = errorType-20;
499 else if(errorType==30 && TBMType==3) messageType = errorType-19;
501 static const char fmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedETypeNErrArray_%d";
502 char buf[
sizeof(
fmt) + 2*32];
503 sprintf(buf, fmt, FedId, messageType);
511 static const char buf[] =
"Pixel/AdditionalPixelErrors/FED_%d";
512 char feddir[
sizeof(buf)+2];
513 sprintf(feddir,buf,FedId);
516 static const char buf1[] =
"Pixel/AdditionalPixelErrors/FED_%d/NErrors_siPixelDigis_%d";
517 char hname1[
sizeof(buf1)+4];
518 sprintf(hname1,buf1,FedId,FedId);
519 me = theDMBE->
get(hname1);
520 if(me) me->
Fill((
int)numberOfSeriousErrors);
521 static const char buf2[] =
"Pixel/AdditionalPixelErrors/FED_%d/TBMMessage_siPixelDigis_%d";
522 char hname2[
sizeof(buf2)+4];
523 sprintf(hname2,buf2,FedId,FedId);
524 me = theDMBE->
get(hname2);
525 if(me) me->
Fill((
int)TBMMessage);
526 static const char buf3[] =
"Pixel/AdditionalPixelErrors/FED_%d/TBMType_siPixelDigis_%d";
527 char hname3[
sizeof(buf3)+4];
528 sprintf(hname3,buf3,FedId,FedId);
529 me = theDMBE->
get(hname3);
530 if(me) me->
Fill((
int)TBMType);
531 static const char buf4[] =
"Pixel/AdditionalPixelErrors/FED_%d/errorType_siPixelDigis_%d";
532 char hname4[
sizeof(buf4)+4];
533 sprintf(hname4,buf4,FedId,FedId);
534 me = theDMBE->
get(hname4);
535 if(me) me->
Fill((
int)errorType);
536 static const char buf5[] =
"Pixel/AdditionalPixelErrors/FED_%d/fullType_siPixelDigis_%d";
537 char hname5[
sizeof(buf5)+4];
538 sprintf(hname5,buf5,FedId,FedId);
539 me = theDMBE->
get(hname5);
540 if(me) me->
Fill((
int)fullType);
541 static const char buf6[] =
"Pixel/AdditionalPixelErrors/FED_%d/EvtNbr_siPixelDigis_%d";
542 char hname6[
sizeof(buf6)+4];
543 sprintf(hname6,buf6,FedId,FedId);
544 me = theDMBE->
get(hname6);
545 if(me) me->
Fill((
int)evtNbr);
546 static const char buf7[] =
"Pixel/AdditionalPixelErrors/FED_%d/evtSize_siPixelDigis_%d";
547 char hname7[
sizeof(buf7)+4];
548 sprintf(hname7,buf7,FedId,FedId);
549 me = theDMBE->
get(hname7);
550 if(me) me->
Fill((
int)evtSize);
551 theDMBE->
cd(currDir);
556 return numberOfSeriousErrors;
562 unsigned int numberOfSeriousErrors = 0;
565 if( isearch != input.
end() ) {
568 for(di = isearch->data.
begin(); di != isearch->data.
end(); di++) {
569 int FedId = di->getFedId();
572 if(FedId==static_cast<int>(
id_)) {
573 errorType = di->getType();
576 int TBMType=-1;
int TBMMessage=-1;
int evtSize=-1;
int fullType=-1;
580 if((errorType == 32)||(errorType == 33)||(errorType == 34)) {
581 long long errorWord = di->getWord64();
590 if(!(FedId==38&&chanNmbr==7)) (
meEvtSize_)->Fill((
int)evtSize);
595 uint32_t errorWord = di->getWord32();
597 case(25) :
case(39) : {
625 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
626 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
627 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
628 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
629 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
630 if ((chanNmbr<1)||(chanNmbr>36)) chanNmbr=0;
641 if(!(FedId==38&&chanNmbr==7)){
652 int StateMach_bits = 4;
653 int StateMach_shift = 8;
654 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
655 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
660 case(1) :
case(9) : {
663 case(2) :
case(4) :
case(6) : {
669 default : TBMType = 4;
671 if(!(FedId==38&&chanNmbr==7)) (
meTBMType_)->Fill((
int)TBMType);
672 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
676 if(!(FedId==38&&chanNmbr==7))(
meEvtNbr_)->Fill((
int)evtNbr);
677 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
679 case(35) :
case(36) :
case(37) :
case(38) : {
680 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
687 if(errorType==29 || (errorType==30 && TBMType==1)){
688 if(!(FedId==38&&chanNmbr==7)){
691 static const char chNfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChNErrArray_%d";
692 char chNbuf[
sizeof(chNfmt) + 2*32];
693 sprintf(chNbuf, chNfmt, FedId, chanNmbr);
698 static const char chLfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChLErrArray_%d";
699 char chLbuf[
sizeof(chLfmt) + 2*32];
700 sprintf(chLbuf, chLfmt, FedId, chanNmbr);
705 numberOfSeriousErrors++;
706 int messageType = 99;
707 if(errorType<30) messageType = errorType-25;
708 else if(errorType>30) messageType = errorType-19;
709 else if(errorType==30 && TBMMessage==0) messageType = errorType-25;
710 else if(errorType==30 && TBMMessage==1) messageType = errorType-24;
711 else if(errorType==30 && (TBMMessage==2 || TBMMessage==3 || TBMMessage==4)) messageType = errorType-23;
712 else if(errorType==30 && TBMMessage==7) messageType = errorType-22;
713 else if(errorType==30 && TBMType==1) messageType = errorType-21;
714 else if(errorType==30 && TBMType==2) messageType = errorType-20;
715 else if(errorType==30 && TBMType==3) messageType = errorType-19;
717 static const char fmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedETypeNErrArray_%d";
718 char buf[
sizeof(
fmt) + 2*32];
719 sprintf(buf, fmt, FedId, messageType);
728 if(numberOfSeriousErrors>0) (
meNErrors_)->
Fill((
float)numberOfSeriousErrors);
733 return numberOfSeriousErrors;
T getParameter(std::string const &) const
MonitorElement * meEvtSize_
MonitorElement * meFullType_
iterator find(det_id_type id)
MonitorElement * meFedChLErrArray_[37]
static const int DB6_shift
void cd(void)
go to top directory (ie. root)
static const int PXID_bits
static const int LINK_bits
MonitorElement * meFedChNErrArray_[37]
static const long long TRLRBGN_mask
static const int DB3_shift
void bookFED(const edm::ParameterSet &iConfig)
Book FED histograms.
static const int ROC_shift
static const int TRLREND_bits
MonitorElement * meErrorType_
MonitorElement * meNErrors_
static const int LINK_shift
static const uint32_t DCOL_mask
static std::string const input
int fillFED(const edm::DetSetVector< SiPixelRawDataError > &input)
Fill FED histograms.
MonitorElement * meEvtNbr_
MonitorElement * meFedETypeNErrArray_[21]
static const uint32_t ADC_mask
int fill(const edm::DetSetVector< SiPixelRawDataError > &input, bool modon=true, bool ladon=false, bool bladeon=false)
Fill histograms.
static const long long TRLREND_mask
static const int TRLRBGN_bits
static const uint32_t DataBit_mask
static const uint32_t ROC_mask
static const uint32_t LINK_mask
static const int DB7_shift
static const int DB5_shift
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
static const int ADC_bits
~SiPixelRawDataErrorModule()
Destructor.
static const int DataBit_bits
static const int DB1_shift
static const int DCOL_bits
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
iterator end()
Return the off-the-end iterator.
static const int EVTLGT_shift
SiPixelRawDataErrorModule()
Default constructor.
static const int DB4_shift
static const int TRLRBGN_shift
static const int DB0_shift
static const int DCOL_shift
static const long long EVTLGT_mask
MonitorElement * meTBMMessage_
static const int PXID_shift
static const int ADC_shift
static const int ROC_bits
static const uint32_t PXID_mask
static const int TRLREND_shift
iterator begin()
Return an iterator to the first DetSet.
collection_type::const_iterator const_iterator
MonitorElement * meTBMType_
collection_type::const_iterator const_iterator
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
static const int EVTLGT_bits
static const int DB2_shift
void book(const edm::ParameterSet &iConfig, int type=0, bool isUpgrade=false)
Book histograms.
const std::string & pwd(void) const