108 hid = theHistogramId->setHistoId(
"errorType",
id_);
109 meErrorType_ = theDMBE->book1D(hid,
"Type of errors",15,24.5,39.5);
112 hid = theHistogramId->setHistoId(
"NErrors",
id_);
113 meNErrors_ = theDMBE->book1D(hid,
"Number of errors",36,0.,36.);
118 hid = theHistogramId->setHistoId(
"fullType",
id_);
119 meFullType_ = theDMBE->book1D(hid,
"Type of FIFO full",7,0.5,7.5);
124 hid = theHistogramId->setHistoId(
"TBMMessage",
id_);
125 meTBMMessage_ = theDMBE->book1D(hid,
"TBM trailer message",8,-0.5,7.5);
129 hid = theHistogramId->setHistoId(
"TBMType",
id_);
130 meTBMType_ = theDMBE->book1D(hid,
"Type of TBM trailer",5,-0.5,4.5);
133 hid = theHistogramId->setHistoId(
"EvtNbr",
id_);
136 hid = theHistogramId->setHistoId(
"evtSize",
id_);
139 for(
int j=0;
j!=37;
j++){
140 std::stringstream
temp; temp <<
j;
141 hid =
"FedChNErrArray_" + temp.str();
143 hid =
"FedChLErrArray_" + temp.str();
145 hid =
"FedETypeNErrArray_" + temp.str();
148 delete theHistogramId;
162 unsigned int numberOfSeriousErrors = 0;
166 if( isearch != input.
end() ) {
169 for(di = isearch->data.
begin(); di != isearch->data.
end(); di++) {
170 int FedId = di->getFedId();
172 int errorType = di->getType();
173 int TBMType=-1;
int TBMMessage=-1;
int evtSize=-1;
int evtNbr=-1;
int fullType=-1;
180 if(errorType == 32 || errorType == 33 || errorType == 34) {
181 long long errorWord = di->getWord64();
182 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
185 uint32_t errorWord = di->getWord32();
186 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
213 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
214 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
215 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
216 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
217 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
218 if ((chanNmbr<1)||(chanNmbr>36)) chanNmbr=0;
229 if (T0==1) TBMMessage=0;
230 if (T1==1) TBMMessage=1;
231 if (T2==1) TBMMessage=2;
232 if (T3==1) TBMMessage=3;
233 if (T4==1) TBMMessage=4;
234 if (T5==1) TBMMessage=5;
235 if (T6==1) TBMMessage=6;
236 if (T7==1) TBMMessage=7;
238 int StateMach_bits = 4;
239 int StateMach_shift = 8;
240 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
241 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
246 case(1) :
case(9) : {
249 case(2) :
case(4) :
case(6) : {
255 default : TBMType = 4;
277 if(errorType == 32 || errorType == 33 || errorType == 34){
278 long long errorWord = di->getWord64();
280 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
282 uint32_t errorWord = di->getWord32();
283 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
310 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
311 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
312 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
313 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
314 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
315 if ((chanNmbr<1)||(chanNmbr>36)) chanNmbr=0;
326 if (T0==1) TBMMessage=0;
327 if (T1==1) TBMMessage=1;
328 if (T2==1) TBMMessage=2;
329 if (T3==1) TBMMessage=3;
330 if (T4==1) TBMMessage=4;
331 if (T5==1) TBMMessage=5;
332 if (T6==1) TBMMessage=6;
333 if (T7==1) TBMMessage=7;
334 int StateMach_bits = 4;
335 int StateMach_shift = 8;
336 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
337 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
342 case(1) :
case(9) : {
345 case(2) :
case(4) :
case(6) : {
351 default : TBMType = 4;
372 if(bladeon && endcap){
373 if(errorType == 32 || errorType == 33 || errorType == 34){
374 long long errorWord = di->getWord64();
376 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
378 uint32_t errorWord = di->getWord32();
379 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
406 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
407 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
408 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
409 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
410 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
411 if ((chanNmbr<1)||(chanNmbr>36)) chanNmbr=0;
422 if (T0==1) TBMMessage=0;
423 if (T1==1) TBMMessage=1;
424 if (T2==1) TBMMessage=2;
425 if (T3==1) TBMMessage=3;
426 if (T4==1) TBMMessage=4;
427 if (T5==1) TBMMessage=5;
428 if (T6==1) TBMMessage=6;
429 if (T7==1) TBMMessage=7;
430 int StateMach_bits = 4;
431 int StateMach_shift = 8;
432 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
433 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
438 case(1) :
case(9) : {
441 case(2) :
case(4) :
case(6) : {
447 default : TBMType = 4;
468 if(!(FedId==38&&chanNmbr==7)){
469 if(errorType==29 || (errorType==30 && TBMType==1)){
473 static const char chNfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChNErrArray_%d";
474 char chNbuf[
sizeof(chNfmt) + 2*32];
475 sprintf(chNbuf, chNfmt, FedId, chanNmbr);
480 static const char chLfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChLErrArray_%d";
481 char chLbuf[
sizeof(chLfmt) + 2*32];
482 sprintf(chLbuf, chLfmt, FedId, chanNmbr);
487 numberOfSeriousErrors++;
488 int messageType = 99;
489 if(errorType<30) messageType = errorType-25;
490 else if(errorType>30) messageType = errorType-19;
491 else if(errorType==30 && TBMMessage==0) messageType = errorType-25;
492 else if(errorType==30 && TBMMessage==1) messageType = errorType-24;
493 else if(errorType==30 && (TBMMessage==2 || TBMMessage==3 || TBMMessage==4)) messageType = errorType-23;
494 else if(errorType==30 && TBMMessage==7) messageType = errorType-22;
495 else if(errorType==30 && TBMType==1) messageType = errorType-21;
496 else if(errorType==30 && TBMType==2) messageType = errorType-20;
497 else if(errorType==30 && TBMType==3) messageType = errorType-19;
499 static const char fmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedETypeNErrArray_%d";
500 char buf[
sizeof(
fmt) + 2*32];
501 sprintf(buf, fmt, FedId, messageType);
509 static const char buf[] =
"Pixel/AdditionalPixelErrors/FED_%d";
510 char feddir[
sizeof(buf)+2];
511 sprintf(feddir,buf,FedId);
514 static const char buf1[] =
"Pixel/AdditionalPixelErrors/FED_%d/NErrors_siPixelDigis_%d";
515 char hname1[
sizeof(buf1)+4];
516 sprintf(hname1,buf1,FedId,FedId);
517 me = theDMBE->
get(hname1);
518 if(me) me->
Fill((
int)numberOfSeriousErrors);
519 static const char buf2[] =
"Pixel/AdditionalPixelErrors/FED_%d/TBMMessage_siPixelDigis_%d";
520 char hname2[
sizeof(buf2)+4];
521 sprintf(hname2,buf2,FedId,FedId);
522 me = theDMBE->
get(hname2);
523 if(me) me->
Fill((
int)TBMMessage);
524 static const char buf3[] =
"Pixel/AdditionalPixelErrors/FED_%d/TBMType_siPixelDigis_%d";
525 char hname3[
sizeof(buf3)+4];
526 sprintf(hname3,buf3,FedId,FedId);
527 me = theDMBE->
get(hname3);
528 if(me) me->
Fill((
int)TBMType);
529 static const char buf4[] =
"Pixel/AdditionalPixelErrors/FED_%d/errorType_siPixelDigis_%d";
530 char hname4[
sizeof(buf4)+4];
531 sprintf(hname4,buf4,FedId,FedId);
532 me = theDMBE->
get(hname4);
533 if(me) me->
Fill((
int)errorType);
534 static const char buf5[] =
"Pixel/AdditionalPixelErrors/FED_%d/fullType_siPixelDigis_%d";
535 char hname5[
sizeof(buf5)+4];
536 sprintf(hname5,buf5,FedId,FedId);
537 me = theDMBE->
get(hname5);
538 if(me) me->
Fill((
int)fullType);
539 static const char buf6[] =
"Pixel/AdditionalPixelErrors/FED_%d/EvtNbr_siPixelDigis_%d";
540 char hname6[
sizeof(buf6)+4];
541 sprintf(hname6,buf6,FedId,FedId);
542 me = theDMBE->
get(hname6);
543 if(me) me->
Fill((
int)evtNbr);
544 static const char buf7[] =
"Pixel/AdditionalPixelErrors/FED_%d/evtSize_siPixelDigis_%d";
545 char hname7[
sizeof(buf7)+4];
546 sprintf(hname7,buf7,FedId,FedId);
547 me = theDMBE->
get(hname7);
548 if(me) me->
Fill((
int)evtSize);
549 theDMBE->
cd(currDir);
554 return numberOfSeriousErrors;
560 unsigned int numberOfSeriousErrors = 0;
563 if( isearch != input.
end() ) {
566 for(di = isearch->data.
begin(); di != isearch->data.
end(); di++) {
567 int FedId = di->getFedId();
570 if(FedId==static_cast<int>(
id_)) {
571 errorType = di->getType();
574 int TBMType=-1;
int TBMMessage=-1;
int evtSize=-1;
int fullType=-1;
578 if((errorType == 32)||(errorType == 33)||(errorType == 34)) {
579 long long errorWord = di->getWord64();
588 if(!(FedId==38&&chanNmbr==7)) (
meEvtSize_)->Fill((
int)evtSize);
593 uint32_t errorWord = di->getWord32();
595 case(25) :
case(39) : {
623 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
624 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
625 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
626 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
627 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
628 if ((chanNmbr<1)||(chanNmbr>36)) chanNmbr=0;
639 if(!(FedId==38&&chanNmbr==7)){
650 int StateMach_bits = 4;
651 int StateMach_shift = 8;
652 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
653 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
658 case(1) :
case(9) : {
661 case(2) :
case(4) :
case(6) : {
667 default : TBMType = 4;
669 if(!(FedId==38&&chanNmbr==7)) (
meTBMType_)->Fill((
int)TBMType);
670 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
674 if(!(FedId==38&&chanNmbr==7))(
meEvtNbr_)->Fill((
int)evtNbr);
675 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
677 case(35) :
case(36) :
case(37) :
case(38) : {
678 chanNmbr = (errorWord >>
LINK_shift) & LINK_mask;
685 if(errorType==29 || (errorType==30 && TBMType==1)){
686 if(!(FedId==38&&chanNmbr==7)){
689 static const char chNfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChNErrArray_%d";
690 char chNbuf[
sizeof(chNfmt) + 2*32];
691 sprintf(chNbuf, chNfmt, FedId, chanNmbr);
696 static const char chLfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChLErrArray_%d";
697 char chLbuf[
sizeof(chLfmt) + 2*32];
698 sprintf(chLbuf, chLfmt, FedId, chanNmbr);
703 numberOfSeriousErrors++;
704 int messageType = 99;
705 if(errorType<30) messageType = errorType-25;
706 else if(errorType>30) messageType = errorType-19;
707 else if(errorType==30 && TBMMessage==0) messageType = errorType-25;
708 else if(errorType==30 && TBMMessage==1) messageType = errorType-24;
709 else if(errorType==30 && (TBMMessage==2 || TBMMessage==3 || TBMMessage==4)) messageType = errorType-23;
710 else if(errorType==30 && TBMMessage==7) messageType = errorType-22;
711 else if(errorType==30 && TBMType==1) messageType = errorType-21;
712 else if(errorType==30 && TBMType==2) messageType = errorType-20;
713 else if(errorType==30 && TBMType==3) messageType = errorType-19;
715 static const char fmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedETypeNErrArray_%d";
716 char buf[
sizeof(
fmt) + 2*32];
717 sprintf(buf, fmt, FedId, messageType);
726 if(numberOfSeriousErrors>0) (
meNErrors_)->
Fill((
float)numberOfSeriousErrors);
731 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
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
void book(const edm::ParameterSet &iConfig, int type=0)
Book histograms.
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
const std::string & pwd(void) const