81 void visual_raw(
int hl,
int id,
int run,
int event,
bool fedshort,
bool fDump,
short unsigned int*
buf)
const;
118 crateToken = esConsumes<CSCCrateMap, CSCCrateMapRcd>();
119 cscmapToken = esConsumes<CSCChamberMap, CSCChamberMapRcd>();
136 debug =
pset.getUntrackedParameter<
bool>(
"Debug",
false);
142 b904Setup =
pset.getUntrackedParameter<
bool>(
"B904Setup",
false);
156 produces<CSCWireDigiCollection>(
"MuonCSCWireDigi");
157 produces<CSCStripDigiCollection>(
"MuonCSCStripDigi");
158 produces<CSCComparatorDigiCollection>(
"MuonCSCComparatorDigi");
159 produces<CSCALCTDigiCollection>(
"MuonCSCALCTDigi");
160 produces<CSCCLCTDigiCollection>(
"MuonCSCCLCTDigi");
161 produces<CSCCorrelatedLCTDigiCollection>(
"MuonCSCCorrelatedLCTDigi");
164 produces<CSCCFEBStatusDigiCollection>(
"MuonCSCCFEBStatusDigi");
165 produces<CSCTMBStatusDigiCollection>(
"MuonCSCTMBStatusDigi");
166 produces<CSCDMBStatusDigiCollection>(
"MuonCSCDMBStatusDigi");
167 produces<CSCALCTStatusDigiCollection>(
"MuonCSCALCTStatusDigi");
168 produces<CSCDDUStatusDigiCollection>(
"MuonCSCDDUStatusDigi");
169 produces<CSCDCCStatusDigiCollection>(
"MuonCSCDCCStatusDigi");
173 produces<CSCDCCFormatStatusDigiCollection>(
"MuonCSCDCCFormatStatusDigi");
177 produces<CSCRPCDigiCollection>(
"MuonCSCRPCDigi");
181 produces<GEMPadDigiClusterCollection>(
"MuonGEMPadDigiCluster");
185 produces<CSCShowerDigiCollection>(
"MuonCSCShowerDigi");
186 produces<CSCShowerDigiCollection>(
"MuonCSCShowerDigiAnode");
187 produces<CSCShowerDigiCollection>(
"MuonCSCShowerDigiCathode");
188 produces<CSCShowerDigiCollection>(
"MuonCSCShowerDigiAnodeALCT");
210 ->setComment(
"# Define input to the unpacker");
211 desc.add<
bool>(
"UseExaminer",
true)
212 ->setComment(
"# Use CSC examiner to check for corrupt or semi-corrupt data & avoid unpacker crashes");
213 desc.add<
unsigned int>(
"ExaminerMask", 535557110)->setComment(
"# This mask is needed by the examiner");
214 desc.add<
bool>(
"UseSelectiveUnpacking",
true)
215 ->setComment(
"# Use Examiner to unpack good chambers and skip only bad ones");
216 desc.add<
unsigned int>(
"ErrorMask", 0)->setComment(
"# This mask simply reduces error reporting");
217 desc.add<
bool>(
"UnpackStatusDigis",
false)->setComment(
"# Unpack general status digis?");
218 desc.add<
bool>(
"UseFormatStatus",
true)->setComment(
"# Unpack FormatStatus digi?");
219 desc.add<
bool>(
"useRPCs",
false)->setComment(
"Unpack RPC data");
220 desc.add<
bool>(
"useGEMs",
true)->setComment(
"Unpack GEM trigger data");
221 desc.add<
bool>(
"useCSCShowers",
true)->setComment(
"Unpack CSCShower trigger data");
222 desc.addUntracked<
bool>(
"Debug",
false)->setComment(
"# Turn on lots of output");
223 desc.addUntracked<
bool>(
"PrintEventNumber",
false);
224 desc.addUntracked<
bool>(
"runDQM",
false);
225 desc.addUntracked<
bool>(
"VisualFEDInspect",
false)->setComment(
"# Visualization of raw data in corrupted events");
226 desc.addUntracked<
bool>(
"VisualFEDShort",
false)->setComment(
"# Visualization of raw data in corrupted events");
227 desc.addUntracked<
bool>(
"FormatedEventDump",
false);
228 desc.addUntracked<
bool>(
"SuppressZeroLCT",
true);
229 desc.addUntracked<
bool>(
"DisableMappingCheck",
false)
230 ->setComment(
"# Disable FED/DDU to chamber mapping inconsistency check");
231 desc.addUntracked<
bool>(
"B904Setup",
false)->setComment(
"# Make the unpacker aware of B904 test setup configuration");
232 descriptions.
add(
"muonCSCDCCUnpacker",
desc);
233 descriptions.
setComment(
" This is the generic cfi file for CSC unpacking");
256 auto wireProduct = std::make_unique<CSCWireDigiCollection>();
257 auto stripProduct = std::make_unique<CSCStripDigiCollection>();
258 auto alctProduct = std::make_unique<CSCALCTDigiCollection>();
259 auto clctProduct = std::make_unique<CSCCLCTDigiCollection>();
260 auto comparatorProduct = std::make_unique<CSCComparatorDigiCollection>();
261 auto rpcProduct = std::make_unique<CSCRPCDigiCollection>();
262 auto corrlctProduct = std::make_unique<CSCCorrelatedLCTDigiCollection>();
263 auto cfebStatusProduct = std::make_unique<CSCCFEBStatusDigiCollection>();
264 auto dmbStatusProduct = std::make_unique<CSCDMBStatusDigiCollection>();
265 auto tmbStatusProduct = std::make_unique<CSCTMBStatusDigiCollection>();
266 auto dduStatusProduct = std::make_unique<CSCDDUStatusDigiCollection>();
267 auto dccStatusProduct = std::make_unique<CSCDCCStatusDigiCollection>();
268 auto alctStatusProduct = std::make_unique<CSCALCTStatusDigiCollection>();
270 auto formatStatusProduct = std::make_unique<CSCDCCFormatStatusDigiCollection>();
272 auto gemProduct = std::make_unique<GEMPadDigiClusterCollection>();
274 auto lctShowerProduct =
275 std::make_unique<CSCShowerDigiCollection>();
276 auto anodeShowerProductOTMB =
277 std::make_unique<CSCShowerDigiCollection>();
278 auto cathodeShowerProductOTMB =
279 std::make_unique<CSCShowerDigiCollection>();
280 auto anodeShowerProductALCT = std::make_unique<
286 unsigned long dccBinCheckMask = 0x06080016;
289 const unsigned postLS1_map[] = {841, 842, 843, 844, 845, 846, 847, 848, 849, 831, 832, 833,
290 834, 835, 836, 837, 838, 839, 861, 862, 863, 864, 865, 866,
291 867, 868, 869, 851, 852, 853, 854, 855, 856, 857, 858, 859};
294 std::vector<unsigned int> cscFEDids;
298 cscFEDids.push_back(
id);
303 cscFEDids.push_back(
id);
306 for (
unsigned int i = 0;
i < cscFEDids.size();
i++)
308 unsigned int id = cscFEDids[
i];
316 unsigned long length = fedData.
size();
336 if (examiner !=
nullptr)
340 const short unsigned int*
data = (
short unsigned int*)fedData.
data();
342 LogTrace(
"badData") <<
"Length: " << length / 2;
372 formatStatusProduct->insertDigi(
CSCDetId(1, 1, 1, 1, 1),
386 short unsigned*
buf = (
short unsigned int*)fedData.
data();
396 ptrExaminer =
nullptr;
398 std::vector<CSCDDUEventData> fed_Data;
399 std::vector<CSCDDUEventData>* ptr_fedData = &fed_Data;
407 fed_Data.push_back(single_dduData);
423 fed_Data = dccData.dduData();
427 short unsigned* bufForDcc = (
short unsigned int*)fedData.
data();
432 dccStatusProduct->insertDigi(
layer,
434 dccData.dccTrailer().data(),
436 bufForDcc[length / 2 - 4]));
440 const std::vector<CSCDDUEventData>& dduData = *ptr_fedData;
442 for (
unsigned int iDDU = 0; iDDU < dduData.size(); ++iDDU)
446 if (dduData[iDDU].trailer().errorstat() &
errorMask) {
447 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi")
448 <<
"FED ID" <<
id <<
" DDU# " << iDDU <<
" has serious error - no digis unpacked! " << std::hex
449 << dduData[iDDU].trailer().errorstat();
454 dduStatusProduct->insertDigi(
457 dduData[iDDU].trailer().
data(),
459 dduData[iDDU].trailer0()));
462 const std::vector<CSCEventData>& cscData = dduData[iDDU].cscData();
466 for (
unsigned int iCSC = 0; iCSC < cscData.size(); ++iCSC)
469 int vmecrate = cscData[iCSC].dmbHeader()->crateID();
470 int dmb = cscData[iCSC].dmbHeader()->dmbID();
476 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"crate = " << vmecrate <<
"; dmb = " << dmb;
478 if ((vmecrate >= 1) && (vmecrate <= 60) && (dmb >= 1) && (dmb <= 10) && (dmb != 6)) {
479 layer = pcrate->
detId(vmecrate, dmb, icfeb, ilayer);
481 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
" detID input out of range!!! ";
482 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
" skipping chamber vme= " << vmecrate <<
" dmb= " << dmb;
489 unsigned int dduid = cscmapping->
ddu(
layer);
490 if ((dduid >= 1) && (dduid <= 36)) {
491 dduid = postLS1_map[dduid - 1];
497 LogTrace(
"CSCDDUUnpacker|CSCRawToDigi") <<
" CSC->FED/DDU mapping inconsistency!!! ";
498 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi")
499 <<
"readout FED/DDU ID=" <<
id <<
" expected ID=" << dduid <<
", skipping chamber " <<
layer 500 <<
" vme= " << vmecrate <<
" dmb= " << dmb;
506 int nalct = cscData[iCSC].dmbHeader()->nalct();
507 bool goodALCT =
false;
509 if (nalct && cscData[iCSC].alctHeader()) {
510 if (cscData[iCSC].alctHeader()->
check()) {
513 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"not storing ALCT digis; alct is bad or not present";
517 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"nALCT==0 !!!";
522 std::vector<CSCALCTDigi> alctDigis = cscData[iCSC].alctHeader()->ALCTDigis();
524 std::vector<CSCALCTDigi> alctDigis_0;
525 for (
int unsigned i = 0;
i < alctDigis.size(); ++
i) {
527 alctDigis_0.push_back(alctDigis[
i]);
529 alctProduct->move(std::make_pair(alctDigis_0.begin(), alctDigis_0.end()),
layer);
531 alctProduct->move(std::make_pair(alctDigis.begin(), alctDigis.end()),
layer);
536 std::vector<CSCShowerDigi> anodeShowerDigisALCT = cscData[iCSC].alctHeader()->alctShowerDigis();
537 anodeShowerProductALCT->move(std::make_pair(anodeShowerDigisALCT.begin(), anodeShowerDigisALCT.end()),
543 int nclct = cscData[iCSC].dmbHeader()->nclct();
544 bool goodTMB =
false;
546 if (nclct && cscData[iCSC].tmbData()) {
547 if (cscData[iCSC].tmbHeader()->
check()) {
548 if (cscData[iCSC].comparatorData()->
check())
551 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"one of TMB checks failed! not storing TMB digis ";
555 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"nCLCT==0 !!!";
560 std::vector<CSCCorrelatedLCTDigi> correlatedlctDigis =
561 cscData[iCSC].tmbHeader()->CorrelatedLCTDigis(
layer.rawId());
563 std::vector<CSCCorrelatedLCTDigi> correlatedlctDigis_0;
564 for (
int unsigned i = 0;
i < correlatedlctDigis.size(); ++
i) {
565 if (correlatedlctDigis[
i].
isValid())
566 correlatedlctDigis_0.push_back(correlatedlctDigis[
i]);
568 corrlctProduct->move(std::make_pair(correlatedlctDigis_0.begin(), correlatedlctDigis_0.end()),
layer);
570 corrlctProduct->move(std::make_pair(correlatedlctDigis.begin(), correlatedlctDigis.end()),
layer);
572 std::vector<CSCCLCTDigi> clctDigis = cscData[iCSC].tmbHeader()->CLCTDigis(
layer.rawId());
574 std::vector<CSCCLCTDigi> clctDigis_0;
575 for (
int unsigned i = 0;
i < clctDigis.size(); ++
i) {
577 clctDigis_0.push_back(clctDigis[
i]);
579 clctProduct->move(std::make_pair(clctDigis_0.begin(), clctDigis_0.end()),
layer);
581 clctProduct->move(std::make_pair(clctDigis.begin(), clctDigis.end()),
layer);
588 std::vector<CSCShowerDigi> lctShowerDigis;
589 lctShowerDigis.push_back(lctShowerDigi);
590 lctShowerProduct->move(std::make_pair(lctShowerDigis.begin(), lctShowerDigis.end()),
layer);
594 CSCShowerDigi anodeShowerDigiOTMB = cscData[iCSC].tmbHeader()->anodeShowerDigi(
layer.rawId());
595 if (anodeShowerDigiOTMB.
isValid()) {
596 std::vector<CSCShowerDigi> anodeShowerDigis;
597 anodeShowerDigis.push_back(anodeShowerDigiOTMB);
598 anodeShowerProductOTMB->move(std::make_pair(anodeShowerDigis.begin(), anodeShowerDigis.end()),
layer);
602 CSCShowerDigi cathodeShowerDigiOTMB = cscData[iCSC].tmbHeader()->cathodeShowerDigi(
layer.rawId());
603 if (cathodeShowerDigiOTMB.
isValid()) {
604 std::vector<CSCShowerDigi> cathodeShowerDigis;
605 cathodeShowerDigis.push_back(cathodeShowerDigiOTMB);
606 cathodeShowerProductOTMB->move(std::make_pair(cathodeShowerDigis.begin(), cathodeShowerDigis.end()),
612 if (cscData[iCSC].tmbData()->checkSize()) {
613 if (
useRPCs_ && cscData[iCSC].tmbData()->hasRPC()) {
614 std::vector<CSCRPCDigi> rpcDigis = cscData[iCSC].tmbData()->rpcData()->digis();
615 rpcProduct->move(std::make_pair(rpcDigis.begin(), rpcDigis.end()),
layer);
619 if (
useGEMs_ && cscData[iCSC].tmbData()->hasGEM()) {
620 for (
int unsigned igem = 0; igem < (
int unsigned)(cscData[iCSC].tmbData()->gemData()->numGEMs());
622 int gem_chamber =
layer.chamber();
623 int gem_region = (
layer.endcap() == 1) ? 1 : -1;
630 std::vector<GEMPadDigiCluster> gemDigis =
631 cscData[iCSC].tmbData()->gemData()->etaDigis(igem, 7 -
ieta);
632 if (!gemDigis.empty()) {
633 gemProduct->move(std::make_pair(gemDigis.begin(), gemDigis.end()), gemid);
639 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
" TMBData check size failed!";
646 if (cscData[iCSC].cfebData(icfeb) !=
nullptr)
647 cfebStatusProduct->insertDigi(
layer, cscData[iCSC].cfebData(icfeb)->statusDigi());
650 dmbStatusProduct->insertDigi(
653 tmbStatusProduct->insertDigi(
657 alctStatusProduct->insertDigi(
667 layer = pcrate->
detId(vmecrate, dmb, 0, ilayer);
669 std::vector<CSCWireDigi> wireDigis = cscData[iCSC].wireDigis(ilayer);
670 wireProduct->move(std::make_pair(wireDigis.begin(), wireDigis.end()),
layer);
674 layer = pcrate->
detId(vmecrate, dmb, icfeb, ilayer);
675 if (cscData[iCSC].cfebData(icfeb) && cscData[iCSC].cfebData(icfeb)->
check()) {
676 std::vector<CSCStripDigi> stripDigis;
677 cscData[iCSC].cfebData(icfeb)->digis(
layer.rawId(), stripDigis);
678 stripProduct->move(std::make_pair(stripDigis.begin(), stripDigis.end()),
layer);
682 if (goodTMB && (cscData[iCSC].tmbHeader() !=
nullptr)) {
683 int nCFEBs = cscData[iCSC].tmbHeader()->NCFEBs();
684 for (icfeb = 0; icfeb < nCFEBs; ++icfeb) {
685 layer = pcrate->
detId(vmecrate, dmb, icfeb, ilayer);
686 std::vector<CSCComparatorDigi> comparatorDigis =
687 cscData[iCSC].comparatorData()->comparatorDigis(
layer.rawId(), icfeb);
690 layer = pcrate->
detId(vmecrate, dmb, 0, ilayer);
691 comparatorProduct->move(std::make_pair(comparatorDigis.begin(), comparatorDigis.end()),
layer);
699 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"ERROR! Examiner rejected FED #" <<
id;
706 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi")
707 <<
" Examiner errors:0x" << std::hex << examiner->
errors() <<
" & 0x" <<
examinerMask <<
" = " 715 if (examiner !=
nullptr)
720 e.put(
std::move(wireProduct),
"MuonCSCWireDigi");
721 e.put(
std::move(stripProduct),
"MuonCSCStripDigi");
722 e.put(
std::move(alctProduct),
"MuonCSCALCTDigi");
723 e.put(
std::move(clctProduct),
"MuonCSCCLCTDigi");
724 e.put(
std::move(comparatorProduct),
"MuonCSCComparatorDigi");
725 e.put(
std::move(corrlctProduct),
"MuonCSCCorrelatedLCTDigi");
728 e.put(
std::move(formatStatusProduct),
"MuonCSCDCCFormatStatusDigi");
731 e.put(
std::move(cfebStatusProduct),
"MuonCSCCFEBStatusDigi");
732 e.put(
std::move(dmbStatusProduct),
"MuonCSCDMBStatusDigi");
733 e.put(
std::move(tmbStatusProduct),
"MuonCSCTMBStatusDigi");
734 e.put(
std::move(dduStatusProduct),
"MuonCSCDDUStatusDigi");
735 e.put(
std::move(dccStatusProduct),
"MuonCSCDCCStatusDigi");
736 e.put(
std::move(alctStatusProduct),
"MuonCSCALCTStatusDigi");
740 e.put(
std::move(rpcProduct),
"MuonCSCRPCDigi");
743 e.put(
std::move(gemProduct),
"MuonGEMPadDigiCluster");
746 e.put(
std::move(lctShowerProduct),
"MuonCSCShowerDigi");
747 e.put(
std::move(anodeShowerProductOTMB),
"MuonCSCShowerDigiAnode");
748 e.put(
std::move(cathodeShowerProductOTMB),
"MuonCSCShowerDigiCathode");
749 e.put(
std::move(anodeShowerProductALCT),
"MuonCSCShowerDigiAnodeALCT");
752 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"[CSCDCCUnpacker]: " <<
numOfEvents <<
" events processed ";
758 int hl,
int id,
int run,
int event,
bool fedshort,
bool fDump,
short unsigned int*
buf)
const {
759 std::cout << std::endl << std::endl << std::endl;
760 std::cout <<
"Run: " <<
run <<
" Event: " <<
event << std::endl;
764 <<
"(scroll down to see summary)" << std::endl;
766 std::cout <<
"Problem seems in FED-" <<
id <<
" " 767 <<
"(scroll down to see summary)" << std::endl;
768 std::cout <<
"********************************************************************************" << std::endl;
769 std::cout << hl <<
" words of data:" << std::endl;
773 std::vector<int> dcc_id;
776 for (
int i = 750;
i < 758;
i++)
779 for (
int i = 830;
i < 838;
i++)
782 char dcc_common[] =
"DCC-";
786 std::vector<int> ddu_id;
787 int ddu_h1_12_13 = 0;
788 for (
int i = 1;
i < 37;
i++)
791 char ddu_common[] =
"DDU-";
792 char ddu_header1[] =
"Header 1";
793 char ddu_header2[] =
"Header 2";
794 char ddu_header3[] =
"Header 3";
795 char ddu_trail1[] =
"Trailer 1", ddu_trail2[] =
"Trailer 2", ddu_trail3[] =
"Trailer 3";
797 char ddu_trailer1_bit[] = {
'8',
'0',
'0',
'0',
'f',
'f',
'f',
'f',
'8',
'0',
'0',
'0',
'8',
'0',
'0',
'0'};
798 char ddu_trailer3_bit[] = {
'a'};
800 char ddu_tr1_err_common[] =
"Incomplet";
804 char dmb_common[] =
"DMB", dmb_header1[] =
"Header 1", dmb_header2[] =
"Header 2";
805 char dmb_common_crate[] =
"crate:", dmb_common_slot[] =
"slot:";
806 char dmb_common_l1a[] =
"L1A:";
807 char dmb_header1_bit[] = {
'9',
'9',
'9',
'9'};
808 char dmb_header2_bit[] = {
'a',
'a',
'a',
'a'};
809 char dmb_tr1[] =
"Trailer 1", dmb_tr2[] =
"Trailer 2";
810 char dmb_tr1_bit[] = {
'f',
'f',
'f',
'f'}, dmb_tr2_bit[] = {
'e',
'e',
'e',
'e'};
815 char alct_common[] =
"ALCT", alct_header1[] =
"Header 1", alct_header2[] =
"Header 2";
816 char alct_common_bxn[] =
"BXN:";
817 char alct_common_wcnt2[] =
"| Actual word count:";
818 char alct_common_wcnt1[] =
"Expected word count:";
819 char alct_header1_bit[] = {
'd',
'd',
'd',
'd',
'b',
'0',
'a'};
820 char alct_header2_bit[] = {
'0',
'0',
'0',
'0'};
821 char alct_tr1[] =
"Trailer 1";
826 char tmb_common[] =
"TMB", tmb_header1[] =
"Header", tmb_tr1[] =
"Trailer";
827 char tmb_header1_bit[] = {
'd',
'd',
'd',
'd',
'b',
'0',
'c'};
828 char tmb_tr1_bit[] = {
'd',
'd',
'd',
'd',
'e',
'0',
'f'};
833 char cfeb_common[] =
"CFEB", cfeb_tr1[] =
"Trailer", cfeb_b[] =
"B-word";
834 char cfeb_common_sample[] =
"sample:";
841 int word_lines = hl / 4;
844 char tempbuf_short[17];
845 char sign1[] =
" --->| ";
848 int word_numbering = 0;
849 int ddu_inst_i = 0, ddu_inst_n = 0, ddu_inst_l1a = 0;
850 int ddu_inst_bxn = 0;
851 int dmb_inst_crate = 0, dmb_inst_slot = 0, dmb_inst_l1a = 0;
853 int alct_inst_l1a = 0;
854 int alct_inst_bxn = 0;
855 int alct_inst_wcnt1 = 0;
856 int alct_inst_wcnt2 = 0;
859 int tmb_inst_l1a = 0;
860 int tmb_inst_wcnt1 = 0;
861 int tmb_inst_wcnt2 = 0;
864 int dcc_h1_check = 0;
867 int ddu_h2_found = 0;
872 bool dcc_check =
false;
873 bool ddu_h2_check[sz1] = {
false};
874 bool ddu_h1_check =
false;
875 bool dmb_h1_check[sz1] = {
false};
876 bool dmb_h2_check[sz1] = {
false};
877 bool ddu_h2_h1 =
false;
878 bool ddu_tr1_check[sz1] = {
false};
879 bool alct_h1_check[sz1] = {
false};
880 bool alct_h2_check[sz1] = {
false};
881 bool alct_tr1_check[sz1] = {
false};
882 bool dmb_tr1_check[sz1] = {
false};
883 bool dmb_tr2_check[sz1] = {
false};
884 bool tmb_h1_check[sz1] = {
false};
885 bool tmb_tr1_check[sz1] = {
false};
886 bool cfeb_tr1_check[sz1] = {
false};
887 bool cfeb_b_check[sz1] = {
false};
888 bool ddu_tr1_bad_check[sz1] = {
false};
889 bool extraction = fedshort;
893 std::vector<int> ddu_h1_coll;
894 std::vector<int> ddu_h1_n_coll;
895 std::vector<int> ddu_h2_coll;
896 std::vector<int> ddu_h3_coll;
897 std::vector<int> ddu_t1_coll;
898 std::vector<int> ddu_t2_coll;
899 std::vector<int> ddu_t3_coll;
900 std::vector<int> ddu_l1a_coll;
901 std::vector<int> ddu_bxn_coll;
903 std::vector<int> dmb_h1_coll;
904 std::vector<int> dmb_h2_coll;
905 std::vector<int> dmb_t1_coll;
906 std::vector<int> dmb_t2_coll;
907 std::vector<int> dmb_crate_coll;
908 std::vector<int> dmb_slot_coll;
909 std::vector<int> dmb_l1a_coll;
911 std::vector<int> alct_h1_coll;
912 std::vector<int> alct_h2_coll;
913 std::vector<int> alct_t1_coll;
914 std::vector<int> alct_l1a_coll;
915 std::vector<int> alct_bxn_coll;
916 std::vector<int> alct_wcnt1_coll;
917 std::vector<int> alct_wcnt2_coll;
918 std::vector<int> alct_wcnt2_id_coll;
920 std::vector<int> tmb_h1_coll;
921 std::vector<int> tmb_t1_coll;
922 std::vector<int> tmb_l1a_coll;
923 std::vector<int> tmb_wcnt1_coll;
924 std::vector<int> tmb_wcnt2_coll;
926 std::vector<int> cfeb_t1_coll;
931 char dcc_header1[] =
"DCC Header 1";
932 char dcc_header2[] =
"DCC Header 2";
933 char dcc_trail1[] =
"DCC Trailer 1", dcc_trail1_bit[] = {
'e'};
934 char dcc_trail2[] =
"DCC Trailer 2", dcc_trail2_bit[] = {
'a'};
937 for (
int i = 0;
i < hl;
i++) {
939 for (
int j = -1;
j < 4;
j++) {
940 sprintf(tempbuf_short,
942 buf[
i + 4 * (
j - 1) + 3],
943 buf[
i + 4 * (
j - 1) + 2],
944 buf[
i + 4 * (
j - 1) + 1],
945 buf[
i + 4 * (
j - 1)]);
951 ddu_h2_check[
j] = ((
buf[
i + 4 * (
j - 1) + 1] == 0x8000) && (
buf[
i + 4 * (
j - 1) + 2] == 0x0001) &&
952 (
buf[
i + 4 * (
j - 1) + 3] == 0x8000));
954 ddu_tr1_check[
j] = ((tempbuf_short[0] == ddu_trailer1_bit[0]) && (tempbuf_short[1] == ddu_trailer1_bit[1]) &&
955 (tempbuf_short[2] == ddu_trailer1_bit[2]) && (tempbuf_short[3] == ddu_trailer1_bit[3]) &&
956 (tempbuf_short[4] == ddu_trailer1_bit[4]) && (tempbuf_short[5] == ddu_trailer1_bit[5]) &&
957 (tempbuf_short[6] == ddu_trailer1_bit[6]) && (tempbuf_short[7] == ddu_trailer1_bit[7]) &&
958 (tempbuf_short[8] == ddu_trailer1_bit[8]) && (tempbuf_short[9] == ddu_trailer1_bit[9]) &&
959 (tempbuf_short[10] == ddu_trailer1_bit[10]) && (tempbuf_short[11] == ddu_trailer1_bit[11]) &&
960 (tempbuf_short[12] == ddu_trailer1_bit[12]) && (tempbuf_short[13] == ddu_trailer1_bit[13]) &&
961 (tempbuf_short[14] == ddu_trailer1_bit[14]) && (tempbuf_short[15] == ddu_trailer1_bit[15]));
963 dmb_h1_check[
j] = ((tempbuf_short[0] == dmb_header1_bit[0]) && (tempbuf_short[4] == dmb_header1_bit[1]) &&
964 (tempbuf_short[8] == dmb_header1_bit[2]) && (tempbuf_short[12] == dmb_header1_bit[3]));
966 dmb_h2_check[
j] = ((tempbuf_short[0] == dmb_header2_bit[0]) && (tempbuf_short[4] == dmb_header2_bit[1]) &&
967 (tempbuf_short[8] == dmb_header2_bit[2]) && (tempbuf_short[12] == dmb_header2_bit[3]));
968 alct_h1_check[
j] = ((tempbuf_short[0] == alct_header1_bit[0]) && (tempbuf_short[4] == alct_header1_bit[1]) &&
969 (tempbuf_short[8] == alct_header1_bit[2]) && (tempbuf_short[12] == alct_header1_bit[3]) &&
970 (tempbuf_short[13] == alct_header1_bit[4]) && (tempbuf_short[14] == alct_header1_bit[5]) &&
971 (tempbuf_short[15] == alct_header1_bit[6]));
972 alct_h2_check[
j] = (((tempbuf_short[0] == alct_header2_bit[0]) && (tempbuf_short[1] == alct_header2_bit[1]) &&
973 (tempbuf_short[2] == alct_header2_bit[2]) && (tempbuf_short[3] == alct_header2_bit[3])) ||
974 ((tempbuf_short[4] == alct_header2_bit[0]) && (tempbuf_short[5] == alct_header2_bit[1]) &&
975 (tempbuf_short[6] == alct_header2_bit[2]) && (tempbuf_short[7] == alct_header2_bit[3])) ||
976 ((tempbuf_short[8] == alct_header2_bit[0]) && (tempbuf_short[9] == alct_header2_bit[1]) &&
977 (tempbuf_short[10] == alct_header2_bit[2]) && (tempbuf_short[11] == alct_header2_bit[3])) ||
978 ((tempbuf_short[12] == alct_header2_bit[0]) && (tempbuf_short[13] == alct_header2_bit[1]) &&
979 (tempbuf_short[14] == alct_header2_bit[2]) && (tempbuf_short[15] == alct_header2_bit[3]))
984 (((
buf[
i + 4 * (
j - 1)] & 0xFFFF) == 0xDE0D) && ((
buf[
i + 4 * (
j - 1) + 1] & 0xF800) == 0xD000) &&
985 ((
buf[
i + 4 * (
j - 1) + 2] & 0xF800) == 0xD000) && ((
buf[
i + 4 * (
j - 1) + 3] & 0xF000) == 0xD000));
987 dmb_tr1_check[
j] = ((tempbuf_short[0] == dmb_tr1_bit[0]) && (tempbuf_short[4] == dmb_tr1_bit[1]) &&
988 (tempbuf_short[8] == dmb_tr1_bit[2]) && (tempbuf_short[12] == dmb_tr1_bit[3]));
989 dmb_tr2_check[
j] = ((tempbuf_short[0] == dmb_tr2_bit[0]) && (tempbuf_short[4] == dmb_tr2_bit[1]) &&
990 (tempbuf_short[8] == dmb_tr2_bit[2]) && (tempbuf_short[12] == dmb_tr2_bit[3]));
992 tmb_h1_check[
j] = ((tempbuf_short[0] == tmb_header1_bit[0]) && (tempbuf_short[4] == tmb_header1_bit[1]) &&
993 (tempbuf_short[8] == tmb_header1_bit[2]) && (tempbuf_short[12] == tmb_header1_bit[3]) &&
994 (tempbuf_short[13] == tmb_header1_bit[4]) && (tempbuf_short[14] == tmb_header1_bit[5]) &&
995 (tempbuf_short[15] == tmb_header1_bit[6]));
996 tmb_tr1_check[
j] = ((tempbuf_short[0] == tmb_tr1_bit[0]) && (tempbuf_short[4] == tmb_tr1_bit[1]) &&
997 (tempbuf_short[8] == tmb_tr1_bit[2]) && (tempbuf_short[12] == tmb_tr1_bit[3]) &&
998 (tempbuf_short[13] == tmb_tr1_bit[4]) && (tempbuf_short[14] == tmb_tr1_bit[5]) &&
999 (tempbuf_short[15] == tmb_tr1_bit[6]));
1002 (((
buf[
i + 4 * (
j - 1) + 1] & 0xF000) == 0x7000) && ((
buf[
i + 4 * (
j - 1) + 2] & 0xF000) == 0x7000) &&
1003 ((
buf[
i + 4 * (
j - 1) + 1] != 0x7FFF) || (
buf[
i + 4 * (
j - 1) + 2] != 0x7FFF)) &&
1004 ((
buf[
i + 4 * (
j - 1) + 3] == 0x7FFF) || ((
buf[
i + 4 * (
j - 1) + 3] &
buf[
i + 4 * (
j - 1)]) == 0x0 &&
1005 (
buf[
i + 4 * (
j - 1) + 3] +
buf[
i + 4 * (
j - 1)] == 0x7FFF))));
1007 (((
buf[
i + 4 * (
j - 1) + 3] & 0xF000) == 0xB000) && ((
buf[
i + 4 * (
j - 1) + 2] & 0xF000) == 0xB000) &&
1008 ((
buf[
i + 4 * (
j - 1) + 1] & 0xF000) == 0xB000) && ((
buf[
i + 4 * (
j - 1)] = 3 & 0xF000) == 0xB000));
1010 ddu_tr1_bad_check[
j] =
1011 ((tempbuf_short[0] != ddu_trailer1_bit[0]) &&
1014 (tempbuf_short[4] != ddu_trailer1_bit[4]) &&
1017 (tempbuf_short[8] == ddu_trailer1_bit[8]) && (tempbuf_short[9] == ddu_trailer1_bit[9]) &&
1018 (tempbuf_short[10] == ddu_trailer1_bit[10]) && (tempbuf_short[11] == ddu_trailer1_bit[11]) &&
1019 (tempbuf_short[12] == ddu_trailer1_bit[12]) && (tempbuf_short[13] == ddu_trailer1_bit[13]) &&
1020 (tempbuf_short[14] == ddu_trailer1_bit[14]) && (tempbuf_short[15] == ddu_trailer1_bit[15]));
1024 ddu_h2_h1 = ddu_h2_check[2];
1026 sprintf(tempbuf_short,
"%04x%04x%04x%04x",
buf[
i + 3],
buf[
i + 2],
buf[
i + 1],
buf[
i]);
1029 ddu_h1_12_13 = (
buf[
i] >> 8);
1030 for (
int kk = 0;
kk < 36;
kk++) {
1031 if (((
buf[
i + 3] & 0xF000) == 0x5000) && (ddu_h1_12_13 == ddu_id[
kk]) && ddu_h2_h1) {
1032 ddu_h1_coll.push_back(word_numbering);
1033 ddu_h1_n_coll.push_back(ddu_id[
kk]);
1034 ddu_inst_l1a = ((
buf[
i + 2] & 0xFFFF) + ((
buf[
i + 3] & 0x00FF) << 16));
1035 ddu_l1a_coll.push_back(ddu_inst_l1a);
1036 ddu_inst_bxn = (
buf[
i + 1] & 0xFFF0) >> 4;
1037 ddu_bxn_coll.push_back(ddu_inst_bxn);
1039 "%6i %04x %04x %04x %04x%s%s%i %s%s %s %i %s %i",
1056 ddu_h1_check =
true;
1062 dcc_h1_id = (((
buf[
i + 1] << 12) & 0xF000) >> 4) + (
buf[
i] >> 8);
1063 for (
int dcci = 0; dcci < 16; dcci++) {
1064 if ((dcc_id[dcci] == dcc_h1_id) && (((
buf[
i + 3] & 0xF000) == 0x5000) && (!ddu_h1_check))) {
1066 "%6i %04x %04x %04x %04x%s%s%i %s",
1076 dcc_h1_check = word_numbering;
1084 if (((word_numbering - 1) == dcc_h1_check) && ((
buf[
i + 3] & 0xFF00) == 0xD900)) {
1086 "%6i %04x %04x %04x %04x%s%s",
1096 }
else if ((word_numbering == word_lines - 1) && (tempbuf_short[0] == dcc_trail1_bit[0])) {
1098 "%6i %04x %04x %04x %04x%s%s",
1108 }
else if ((word_numbering == word_lines) && (tempbuf_short[0] == dcc_trail2_bit[0])) {
1110 "%6i %04x %04x %04x %04x%s%s",
1123 else if (ddu_h2_check[1]) {
1124 ddu_inst_i = ddu_h1_n_coll.size();
1125 if (ddu_inst_i > 0) {
1126 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1129 "%6i %04x %04x %04x %04x%s%s%i %s",
1139 ddu_h2_coll.push_back(word_numbering);
1146 else if ((ddu_h2_check[0] && dmb_h1_check[2]) || (ddu_h2_check[0] && ddu_tr1_check[2])) {
1147 ddu_inst_i = ddu_h1_n_coll.size();
1148 if (ddu_inst_i > 0) {
1149 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1152 "%6i %04x %04x %04x %04x%s%s%i %s",
1162 ddu_h3_coll.push_back(word_numbering);
1170 else if (dmb_h1_check[1]) {
1173 dmb_inst_l1a = ((
buf[
i] & 0x0FFF) + ((
buf[
i + 1] & 0xFFF) << 12));
1174 dmb_l1a_coll.push_back(dmb_inst_l1a);
1175 if (dmb_h2_check[2]) {
1176 dmb_inst_crate = ((
buf[
i + 4 + 1] >> 4) & 0xFF);
1177 dmb_inst_slot = (
buf[
i + 4 + 1] & 0xF);
1178 dmb_crate_coll.push_back(dmb_inst_crate);
1179 dmb_slot_coll.push_back(dmb_inst_slot);
1182 "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i %s %i",
1198 dmb_h1_coll.push_back(word_numbering);
1204 else if (dmb_h2_check[1]) {
1205 dmb_inst_crate = ((
buf[
i + 1] >> 4) & 0xFF);
1206 dmb_inst_slot = (
buf[
i + 1] & 0xF);
1207 dmb_h2_coll.push_back(word_numbering);
1208 if (dmb_h1_check[0])
1209 dmb_inst_l1a = ((
buf[
i - 4] & 0x0FFF) + ((
buf[
i - 4 + 1] & 0xFFF) << 12));
1211 "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i %s %i",
1234 else if (ddu_tr1_check[1]) {
1235 ddu_inst_i = ddu_h1_n_coll.size();
1236 if (ddu_inst_i > 0) {
1237 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1241 "%6i %04x %04x %04x %04x%s%s%i %s",
1251 ddu_t1_coll.push_back(word_numbering);
1257 else if (alct_h1_check[1]) {
1258 alct_start = word_numbering;
1259 alct_inst_l1a = (
buf[
i + 2] & 0x0FFF);
1260 alct_l1a_coll.push_back(alct_inst_l1a);
1262 "%6i %04x %04x %04x %04x%s%s %s%s %s %i",
1274 alct_h1_coll.push_back(word_numbering);
1279 else if ((alct_h1_check[0]) && (alct_h2_check[2])) {
1280 alct_inst_bxn = (
buf[
i] & 0x0FFF);
1281 alct_bxn_coll.push_back(alct_inst_bxn);
1283 "%6i %04x %04x %04x %04x%s%s %s%s%s %i",
1295 alct_h2_coll.push_back(word_numbering);
1301 else if (alct_tr1_check[1]) {
1302 alct_stop = word_numbering;
1303 if ((alct_start != 0) && (alct_stop != 0) && (alct_stop > alct_start)) {
1304 alct_inst_wcnt2 = 4 * (alct_stop - alct_start + 1);
1305 alct_wcnt2_coll.push_back(alct_inst_wcnt2);
1306 alct_wcnt2_id_coll.push_back(alct_start);
1308 alct_inst_wcnt1 = (
buf[
i + 3] & 0x7FF);
1309 alct_wcnt1_coll.push_back(alct_inst_wcnt1);
1311 "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i",
1325 alct_t1_coll.push_back(word_numbering);
1328 alct_inst_wcnt2 = 0;
1334 else if ((ddu_h2_h1) && (tempbuf_short[0] == ddu_trailer3_bit[0])) {
1336 ddu_inst_i = ddu_h1_n_coll.size();
1337 if (ddu_inst_i > 0) {
1338 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1342 "%6i %04x %04x %04x %04x%s%s%i %s",
1352 ddu_t3_coll.push_back(word_numbering);
1357 else if ((ddu_tr1_check[0]) && (tempbuf_short[0] != ddu_trailer3_bit[0])) {
1359 ddu_inst_i = ddu_h1_n_coll.size();
1360 if (ddu_inst_i > 0) {
1361 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1365 "%6i %04x %04x %04x %04x%s%s%i %s",
1375 ddu_t2_coll.push_back(word_numbering);
1381 else if (dmb_tr1_check[1]) {
1383 "%6i %04x %04x %04x %04x%s%s %s",
1392 dmb_t1_coll.push_back(word_numbering);
1398 else if (dmb_tr2_check[1]) {
1400 "%6i %04x %04x %04x %04x%s%s %s",
1409 dmb_t2_coll.push_back(word_numbering);
1414 else if (tmb_h1_check[1]) {
1415 tmb_start = word_numbering;
1416 tmb_inst_l1a = (
buf[
i + 2] & 0x000F);
1417 tmb_l1a_coll.push_back(tmb_inst_l1a);
1419 "%6i %04x %04x %04x %04x%s%s %s%s%s %i",
1431 tmb_h1_coll.push_back(word_numbering);
1434 }
else if (tmb_tr1_check[1]) {
1435 tmb_stop = word_numbering;
1436 if ((tmb_start != 0) && (tmb_stop != 0) && (tmb_stop > tmb_start)) {
1437 tmb_inst_wcnt2 = 4 * (tmb_stop - tmb_start + 1);
1438 tmb_wcnt2_coll.push_back(tmb_inst_wcnt2);
1440 tmb_inst_wcnt1 = (
buf[
i + 3] & 0x7FF);
1441 tmb_wcnt1_coll.push_back(tmb_inst_wcnt1);
1443 "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i",
1457 tmb_t1_coll.push_back(word_numbering);
1463 else if (cfeb_tr1_check[1]) {
1466 "%6i %04x %04x %04x %04x%s%s %s%s %s %i",
1478 cfeb_t1_coll.push_back(word_numbering);
1481 }
else if (cfeb_b_check[1]) {
1483 "%6i %04x %04x %04x %04x%s%s %s",
1498 else if (ddu_tr1_bad_check[1]) {
1499 ddu_inst_i = ddu_h1_n_coll.size();
1500 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1502 "%6i %04x %04x %04x %04x%s%s%i %s %s",
1512 ddu_tr1_err_common);
1517 else if (extraction && (!ddu_h1_check) && (!dcc_check)) {
1519 sprintf(tempbuf,
"%6i %04x %04x %04x %04x", word_numbering,
buf[
i + 3],
buf[
i + 2],
buf[
i + 1],
buf[
i]);
1524 std::cout <<
"..................................................." << std::endl;
1529 else if ((!ddu_h1_check) && (!dcc_check)) {
1530 sprintf(tempbuf,
"%6i %04x %04x %04x %04x", word_numbering,
buf[
i + 3],
buf[
i + 2],
buf[
i + 1],
buf[
i]);
1535 ddu_h1_check =
false;
1539 std::cout <<
"********************************************************************************" << std::endl
1542 std::cout <<
"For complete output turn off VisualFEDShort in muonCSCDigis configuration file." << std::endl;
1543 std::cout <<
"********************************************************************************" << std::endl
1548 std::cout << ddu_h1_coll.size() <<
" " << ddu_common <<
" " << ddu_header1 <<
" " 1549 <<
"found" << std::endl;
1554 for (
unsigned int k = 0;
k < ddu_h1_coll.size(); ++
k) {
1561 <<
" " << ddu_h1_coll[
k] <<
" " << sign1 <<
" " << ddu_common <<
" " << ddu_h1_n_coll[
k] <<
" " 1562 << dmb_common_l1a <<
" " << ddu_l1a_coll[
k] <<
" " << alct_common_bxn <<
" " << ddu_bxn_coll[
k]
1567 std::cout <<
"||||||||||||||||||||" << std::endl;
1569 std::cout << ddu_h2_coll.size() <<
" " << ddu_common <<
" " << ddu_header2 <<
" " 1570 <<
"found" << std::endl;
1571 for (
unsigned int k = 0;
k < ddu_h2_coll.size(); ++
k)
1572 std::cout <<
"Line: " << ddu_h2_coll[
k] << std::endl;
1574 std::cout <<
"||||||||||||||||||||" << std::endl;
1576 std::cout << ddu_h3_coll.size() <<
" " << ddu_common <<
" " << ddu_header3 <<
" " 1577 <<
"found" << std::endl;
1578 for (
unsigned int k = 0;
k < ddu_h3_coll.size(); ++
k)
1579 std::cout <<
"Line: " << ddu_h3_coll[
k] << std::endl;
1581 std::cout <<
"||||||||||||||||||||" << std::endl;
1583 std::cout << ddu_t1_coll.size() <<
" " << ddu_common <<
" " << ddu_trail1 <<
" " 1584 <<
"found" << std::endl;
1585 for (
unsigned int k = 0;
k < ddu_t1_coll.size(); ++
k)
1586 std::cout <<
"Line: " << ddu_t1_coll[
k] << std::endl;
1588 std::cout <<
"||||||||||||||||||||" << std::endl;
1590 std::cout << ddu_t2_coll.size() <<
" " << ddu_common <<
" " << ddu_trail2 <<
" " 1591 <<
"found" << std::endl;
1592 for (
unsigned int k = 0;
k < ddu_t2_coll.size(); ++
k)
1593 std::cout <<
"Line: " << ddu_t2_coll[
k] << std::endl;
1595 std::cout <<
"||||||||||||||||||||" << std::endl;
1597 std::cout << ddu_t3_coll.size() <<
" " << ddu_common <<
" " << ddu_trail3 <<
" " 1598 <<
"found" << std::endl;
1599 for (
unsigned int k = 0;
k < ddu_t3_coll.size(); ++
k)
1600 std::cout <<
"Line: " << ddu_t3_coll[
k] << std::endl;
1602 std::cout <<
"||||||||||||||||||||" << std::endl;
1604 std::cout << dmb_h1_coll.size() <<
" " << dmb_common <<
" " << dmb_header1 <<
" " 1605 <<
"found" << std::endl;
1607 for (
unsigned int k = 0;
k < dmb_h1_coll.size(); ++
k) {
1614 <<
" " << dmb_h1_coll[
k] <<
" " << sign1 << dmb_common <<
" " << dmb_common_crate <<
" " 1615 << dmb_crate_coll[
k] <<
" " << dmb_common_slot <<
" " << dmb_slot_coll[
k] <<
" " << dmb_common_l1a <<
" " 1616 << dmb_l1a_coll[
k] << std::endl;
1619 std::cout <<
"||||||||||||||||||||" << std::endl;
1621 std::cout << dmb_h2_coll.size() <<
" " << dmb_common <<
" " << dmb_header2 <<
" " 1622 <<
"found" << std::endl;
1623 for (
unsigned int k = 0;
k < dmb_h2_coll.size(); ++
k)
1624 std::cout <<
"Line: " << dmb_h2_coll[
k] << std::endl;
1626 std::cout <<
"||||||||||||||||||||" << std::endl;
1628 std::cout << dmb_t1_coll.size() <<
" " << dmb_common <<
" " << dmb_tr1 <<
" " 1629 <<
"found" << std::endl;
1630 for (
unsigned int k = 0;
k < dmb_t1_coll.size(); ++
k)
1631 std::cout <<
"Line: " << dmb_t1_coll[
k] << std::endl;
1633 std::cout <<
"||||||||||||||||||||" << std::endl;
1635 std::cout << dmb_t2_coll.size() <<
" " << dmb_common <<
" " << dmb_tr2 <<
" " 1636 <<
"found" << std::endl;
1637 for (
unsigned int k = 0;
k < dmb_t2_coll.size(); ++
k)
1638 std::cout <<
"Line: " << dmb_t2_coll[
k] << std::endl;
1640 std::cout <<
"||||||||||||||||||||" << std::endl;
1642 std::cout << alct_h1_coll.size() <<
" " << alct_common <<
" " << alct_header1 <<
" " 1643 <<
"found" << std::endl;
1644 for (
unsigned int k = 0;
k < alct_h1_coll.size(); ++
k) {
1652 <<
" " << alct_h1_coll[
k] <<
" " << sign1 <<
" " << alct_common <<
" " << dmb_common_l1a <<
" " 1653 << alct_l1a_coll[
k] << std::endl;
1657 std::cout <<
"||||||||||||||||||||" << std::endl;
1659 std::cout << alct_h2_coll.size() <<
" " << alct_common <<
" " << alct_header2 <<
" " 1660 <<
"found" << std::endl;
1661 for (
unsigned int k = 0;
k < alct_h2_coll.size(); ++
k) {
1669 <<
" " << alct_h1_coll[
k] <<
" " << sign1 <<
" " << alct_common <<
" " << alct_common_bxn <<
" " 1670 << alct_bxn_coll[
k] << std::endl;
1674 std::cout <<
"||||||||||||||||||||" << std::endl;
1676 std::cout << alct_t1_coll.size() <<
" " << alct_common <<
" " << alct_tr1 <<
" " 1677 <<
"found" << std::endl;
1678 for (
unsigned int k = 0;
k < alct_t1_coll.size(); ++
k) {
1686 <<
" " << alct_t1_coll[
k] <<
" " << sign1 <<
" " << alct_common <<
" " << alct_common_wcnt1 <<
" " 1687 << alct_wcnt1_coll[
k] <<
" " << alct_common_wcnt2 <<
" ";
1688 if (!alct_wcnt2_coll.empty()) {
1689 std::cout << alct_wcnt2_coll[
k] << std::endl;
1691 std::cout <<
"Undefined (ALCT Header is not found) " << std::endl;
1696 std::cout <<
"||||||||||||||||||||" << std::endl;
1698 std::cout << tmb_h1_coll.size() <<
" " << tmb_common <<
" " << tmb_header1 <<
" " 1699 <<
"found" << std::endl;
1700 for (
unsigned int k = 0;
k < tmb_h1_coll.size(); ++
k) {
1708 <<
" " << tmb_h1_coll[
k] <<
" " << sign1 <<
" " << tmb_common <<
" " << dmb_common_l1a <<
" " 1709 << tmb_l1a_coll[
k] << std::endl;
1713 std::cout <<
"||||||||||||||||||||" << std::endl;
1715 std::cout << tmb_t1_coll.size() <<
" " << tmb_common <<
" " << tmb_tr1 <<
" " 1716 <<
"found" << std::endl;
1717 for (
unsigned int k = 0;
k < tmb_t1_coll.size(); ++
k) {
1725 <<
" " << tmb_t1_coll[
k] <<
" " << sign1 <<
" " << tmb_common <<
" " << alct_common_wcnt1 <<
" " 1726 << tmb_wcnt1_coll[
k] <<
" " << alct_common_wcnt2 <<
" " << tmb_wcnt2_coll[
k] << std::endl;
1730 std::cout <<
"||||||||||||||||||||" << std::endl;
1732 std::cout << cfeb_t1_coll.size() <<
" " << cfeb_common <<
" " << cfeb_tr1 <<
" " 1733 <<
"found" << std::endl;
1734 for (
unsigned int k = 0;
k < cfeb_t1_coll.size(); ++
k)
1735 std::cout <<
"Line: " << cfeb_t1_coll[
k] << std::endl;
1736 std::cout <<
"********************************************************************************" << std::endl;
std::map< CSCIdType, ExaminerStatusType > statusDetailed(void) const
void crcCFEB(bool enable)
bool SuppressZeroLCT
Suppress zeros LCTs.
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcd > cscmapToken
static void setDebug(bool value)
void modeDDU(bool enable)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
CSCMonitorInterface * monitor
ExaminerMaskType getMask() const
size_t size() const
Lenght of the data buffer in bytes.
bool useRPCs_
option to unpack RPC data
void crcALCT(bool enable)
bool visualFEDInspect
Visualization of raw data.
constexpr std::array< uint8_t, layerIndexSize > layer
static void setDebug(const bool value)
virtual void process(CSCDCCExaminer *examiner, CSCDCCEventData *dccData)=0
edm::ESGetToken< CSCCrateMap, CSCCrateMapRcd > crateToken
T const * product() const
static void setDebug(const bool value)
static void setErrorMask(unsigned int value)
void visual_raw(int hl, int id, int run, int event, bool fedshort, bool fDump, short unsigned int *buf) const
Visualization of raw data in FED-less events (Robert Harr and Alexander Sakharov) ...
~CSCDCCUnpacker() override
Destructor.
static void setDebug(bool value)
std::map< CSCIdType, ExaminerStatusType > payloadDetailed(void) const
const char * errName(int num) const
bool useCSCShowers_
option to unpack CSC shower data
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void setComment(std::string const &value)
edm::EDGetTokenT< FEDRawDataCollection > i_token
Token for consumes interface & access to data.
CSCDetId detId(int vme, int dmb, int cfeb, int layer=0) const
unsigned int examinerMask
std::map< CSCIdType, ExaminerStatusType > errorsDetailed(void) const
bool useSelectiveUnpacking
bool useGEMs_
option to unpack GEM cluster data
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int ddu(const CSCDetId &) const
ddu id for given DetId
int32_t check(const uint16_t *&buffer, int32_t length)
char data[epos_bytes_allocation]
ExaminerStatusType errors(void) const
CSCDCCUnpacker(const edm::ParameterSet &pset)
Constructor.
std::map< DDUIdType, ExaminerStatusType > errorsDetailedDDU(void) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void setMask(ExaminerMaskType mask)
static void setDebug(const bool value)
static void setDebug(bool debugValue)
void produce(edm::Event &e, const edm::EventSetup &c) override
Produce digis out of raw data.
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...