81 void visual_raw(
int hl,
int id,
int run,
int event,
bool fedshort,
bool fDump,
short unsigned int*
buf)
const;
119 crateToken = esConsumes<CSCCrateMap, CSCCrateMapRcd>();
120 cscmapToken = esConsumes<CSCChamberMap, CSCChamberMapRcd>();
137 debug =
pset.getUntrackedParameter<
bool>(
"Debug",
false);
143 b904Setup =
pset.getUntrackedParameter<
bool>(
"B904Setup",
false);
145 b904dmb =
pset.getUntrackedParameter<
int>(
"B904dmb", 3);
159 produces<CSCWireDigiCollection>(
"MuonCSCWireDigi");
160 produces<CSCStripDigiCollection>(
"MuonCSCStripDigi");
161 produces<CSCComparatorDigiCollection>(
"MuonCSCComparatorDigi");
162 produces<CSCALCTDigiCollection>(
"MuonCSCALCTDigi");
163 produces<CSCCLCTDigiCollection>(
"MuonCSCCLCTDigi");
164 produces<CSCCorrelatedLCTDigiCollection>(
"MuonCSCCorrelatedLCTDigi");
167 produces<CSCCFEBStatusDigiCollection>(
"MuonCSCCFEBStatusDigi");
168 produces<CSCTMBStatusDigiCollection>(
"MuonCSCTMBStatusDigi");
169 produces<CSCDMBStatusDigiCollection>(
"MuonCSCDMBStatusDigi");
170 produces<CSCALCTStatusDigiCollection>(
"MuonCSCALCTStatusDigi");
171 produces<CSCDDUStatusDigiCollection>(
"MuonCSCDDUStatusDigi");
172 produces<CSCDCCStatusDigiCollection>(
"MuonCSCDCCStatusDigi");
176 produces<CSCDCCFormatStatusDigiCollection>(
"MuonCSCDCCFormatStatusDigi");
180 produces<CSCRPCDigiCollection>(
"MuonCSCRPCDigi");
184 produces<GEMPadDigiClusterCollection>(
"MuonGEMPadDigiCluster");
188 produces<CSCShowerDigiCollection>(
"MuonCSCShowerDigi");
189 produces<CSCShowerDigiCollection>(
"MuonCSCShowerDigiAnode");
190 produces<CSCShowerDigiCollection>(
"MuonCSCShowerDigiCathode");
191 produces<CSCShowerDigiCollection>(
"MuonCSCShowerDigiAnodeALCT");
213 ->setComment(
"# Define input to the unpacker");
214 desc.add<
bool>(
"UseExaminer",
true)
215 ->setComment(
"# Use CSC examiner to check for corrupt or semi-corrupt data & avoid unpacker crashes");
216 desc.add<
unsigned int>(
"ExaminerMask", 535557110)->setComment(
"# This mask is needed by the examiner");
217 desc.add<
bool>(
"UseSelectiveUnpacking",
true)
218 ->setComment(
"# Use Examiner to unpack good chambers and skip only bad ones");
219 desc.add<
unsigned int>(
"ErrorMask", 0)->setComment(
"# This mask simply reduces error reporting");
220 desc.add<
bool>(
"UnpackStatusDigis",
false)->setComment(
"# Unpack general status digis?");
221 desc.add<
bool>(
"UseFormatStatus",
true)->setComment(
"# Unpack FormatStatus digi?");
222 desc.add<
bool>(
"useRPCs",
false)->setComment(
"Unpack RPC data");
223 desc.add<
bool>(
"useGEMs",
true)->setComment(
"Unpack GEM trigger data");
224 desc.add<
bool>(
"useCSCShowers",
true)->setComment(
"Unpack CSCShower trigger data");
225 desc.addUntracked<
bool>(
"Debug",
false)->setComment(
"# Turn on lots of output");
226 desc.addUntracked<
bool>(
"PrintEventNumber",
false);
227 desc.addUntracked<
bool>(
"runDQM",
false);
228 desc.addUntracked<
bool>(
"VisualFEDInspect",
false)->setComment(
"# Visualization of raw data in corrupted events");
229 desc.addUntracked<
bool>(
"VisualFEDShort",
false)->setComment(
"# Visualization of raw data in corrupted events");
230 desc.addUntracked<
bool>(
"FormatedEventDump",
false);
231 desc.addUntracked<
bool>(
"SuppressZeroLCT",
true);
232 desc.addUntracked<
bool>(
"DisableMappingCheck",
false)
233 ->setComment(
"# Disable FED/DDU to chamber mapping inconsistency check");
234 desc.addUntracked<
bool>(
"B904Setup",
false)->setComment(
"# Make the unpacker aware of B904 test setup configuration");
235 desc.addUntracked<
int>(
"B904vmecrate", 1)->setComment(
"# Set vmecrate number for chamber used in B904 test setup");
236 desc.addUntracked<
int>(
"B904dmb", 3)->setComment(
"# Set dmb slot for chamber used in B904 test setup");
237 descriptions.
add(
"muonCSCDCCUnpacker",
desc);
238 descriptions.
setComment(
" This is the generic cfi file for CSC unpacking");
261 auto wireProduct = std::make_unique<CSCWireDigiCollection>();
262 auto stripProduct = std::make_unique<CSCStripDigiCollection>();
263 auto alctProduct = std::make_unique<CSCALCTDigiCollection>();
264 auto clctProduct = std::make_unique<CSCCLCTDigiCollection>();
265 auto comparatorProduct = std::make_unique<CSCComparatorDigiCollection>();
266 auto rpcProduct = std::make_unique<CSCRPCDigiCollection>();
267 auto corrlctProduct = std::make_unique<CSCCorrelatedLCTDigiCollection>();
268 auto cfebStatusProduct = std::make_unique<CSCCFEBStatusDigiCollection>();
269 auto dmbStatusProduct = std::make_unique<CSCDMBStatusDigiCollection>();
270 auto tmbStatusProduct = std::make_unique<CSCTMBStatusDigiCollection>();
271 auto dduStatusProduct = std::make_unique<CSCDDUStatusDigiCollection>();
272 auto dccStatusProduct = std::make_unique<CSCDCCStatusDigiCollection>();
273 auto alctStatusProduct = std::make_unique<CSCALCTStatusDigiCollection>();
275 auto formatStatusProduct = std::make_unique<CSCDCCFormatStatusDigiCollection>();
277 auto gemProduct = std::make_unique<GEMPadDigiClusterCollection>();
279 auto lctShowerProduct =
280 std::make_unique<CSCShowerDigiCollection>();
281 auto anodeShowerProductOTMB =
282 std::make_unique<CSCShowerDigiCollection>();
283 auto cathodeShowerProductOTMB =
284 std::make_unique<CSCShowerDigiCollection>();
285 auto anodeShowerProductALCT = std::make_unique<
291 unsigned long dccBinCheckMask = 0x06080016;
294 const unsigned postLS1_map[] = {841, 842, 843, 844, 845, 846, 847, 848, 849, 831, 832, 833,
295 834, 835, 836, 837, 838, 839, 861, 862, 863, 864, 865, 866,
296 867, 868, 869, 851, 852, 853, 854, 855, 856, 857, 858, 859};
299 std::vector<unsigned int> cscFEDids;
303 cscFEDids.push_back(
id);
308 cscFEDids.push_back(
id);
311 for (
unsigned int i = 0;
i < cscFEDids.size();
i++)
313 unsigned int id = cscFEDids[
i];
321 unsigned long length = fedData.
size();
341 if (examiner !=
nullptr)
345 const short unsigned int*
data = (
short unsigned int*)fedData.
data();
347 LogTrace(
"badData") <<
"Length: " << length / 2;
377 formatStatusProduct->insertDigi(
CSCDetId(1, 1, 1, 1, 1),
391 short unsigned*
buf = (
short unsigned int*)fedData.
data();
401 ptrExaminer =
nullptr;
403 std::vector<CSCDDUEventData> fed_Data;
404 std::vector<CSCDDUEventData>* ptr_fedData = &fed_Data;
412 fed_Data.push_back(single_dduData);
428 fed_Data = dccData.dduData();
432 short unsigned* bufForDcc = (
short unsigned int*)fedData.
data();
437 dccStatusProduct->insertDigi(
layer,
439 dccData.dccTrailer().data(),
441 bufForDcc[length / 2 - 4]));
445 const std::vector<CSCDDUEventData>& dduData = *ptr_fedData;
447 for (
unsigned int iDDU = 0; iDDU < dduData.size(); ++iDDU)
451 if (dduData[iDDU].trailer().errorstat() &
errorMask) {
452 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi")
453 <<
"FED ID" <<
id <<
" DDU# " << iDDU <<
" has serious error - no digis unpacked! " << std::hex
454 << dduData[iDDU].trailer().errorstat();
459 dduStatusProduct->insertDigi(
462 dduData[iDDU].trailer().
data(),
464 dduData[iDDU].trailer0()));
467 const std::vector<CSCEventData>& cscData = dduData[iDDU].cscData();
471 for (
unsigned int iCSC = 0; iCSC < cscData.size(); ++iCSC)
482 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"crate = " << vmecrate <<
"; dmb = " << dmb;
484 if ((vmecrate >= 1) && (vmecrate <= 60) && (dmb >= 1) && (dmb <= 10) && (dmb != 6)) {
485 layer = pcrate->
detId(vmecrate, dmb, icfeb, ilayer);
487 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
" detID input out of range!!! ";
488 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
" skipping chamber vme= " << vmecrate <<
" dmb= " << dmb;
495 unsigned int dduid = cscmapping->
ddu(
layer);
496 if ((dduid >= 1) && (dduid <= 36)) {
497 dduid = postLS1_map[dduid - 1];
503 LogTrace(
"CSCDDUUnpacker|CSCRawToDigi") <<
" CSC->FED/DDU mapping inconsistency!!! ";
504 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi")
505 <<
"readout FED/DDU ID=" <<
id <<
" expected ID=" << dduid <<
", skipping chamber " <<
layer 506 <<
" vme= " << vmecrate <<
" dmb= " << dmb;
512 int nalct = cscData[iCSC].dmbHeader()->nalct();
513 bool goodALCT =
false;
515 if (nalct && cscData[iCSC].alctHeader()) {
516 if (cscData[iCSC].alctHeader()->
check()) {
519 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"not storing ALCT digis; alct is bad or not present";
523 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"nALCT==0 !!!";
528 std::vector<CSCALCTDigi> alctDigis = cscData[iCSC].alctHeader()->ALCTDigis();
530 std::vector<CSCALCTDigi> alctDigis_0;
531 for (
int unsigned i = 0;
i < alctDigis.size(); ++
i) {
534 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") << alctDigis[
i] << std::endl;
535 alctDigis_0.push_back(alctDigis[
i]);
538 alctProduct->move(std::make_pair(alctDigis_0.begin(), alctDigis_0.end()),
layer);
540 alctProduct->move(std::make_pair(alctDigis.begin(), alctDigis.end()),
layer);
545 std::vector<CSCShowerDigi> anodeShowerDigisALCT = cscData[iCSC].alctHeader()->alctShowerDigis();
546 anodeShowerProductALCT->move(std::make_pair(anodeShowerDigisALCT.begin(), anodeShowerDigisALCT.end()),
552 int nclct = cscData[iCSC].dmbHeader()->nclct();
553 bool goodTMB =
false;
555 if (nclct && cscData[iCSC].tmbData()) {
556 if (cscData[iCSC].tmbHeader()->
check()) {
557 if (cscData[iCSC].comparatorData()->
check())
560 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"one of TMB checks failed! not storing TMB digis ";
564 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"nCLCT==0 !!!";
569 std::vector<CSCCorrelatedLCTDigi> correlatedlctDigis =
570 cscData[iCSC].tmbHeader()->CorrelatedLCTDigis(
layer.rawId());
572 std::vector<CSCCorrelatedLCTDigi> correlatedlctDigis_0;
573 for (
int unsigned i = 0;
i < correlatedlctDigis.size(); ++
i) {
574 if (correlatedlctDigis[
i].
isValid()) {
576 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") << correlatedlctDigis[
i] << std::endl;
577 correlatedlctDigis_0.push_back(correlatedlctDigis[
i]);
580 corrlctProduct->move(std::make_pair(correlatedlctDigis_0.begin(), correlatedlctDigis_0.end()),
layer);
582 corrlctProduct->move(std::make_pair(correlatedlctDigis.begin(), correlatedlctDigis.end()),
layer);
584 std::vector<CSCCLCTDigi> clctDigis = cscData[iCSC].tmbHeader()->CLCTDigis(
layer.rawId());
586 std::vector<CSCCLCTDigi> clctDigis_0;
587 for (
int unsigned i = 0;
i < clctDigis.size(); ++
i) {
590 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") << clctDigis[
i] << std::endl;
591 clctDigis_0.push_back(clctDigis[
i]);
594 clctProduct->move(std::make_pair(clctDigis_0.begin(), clctDigis_0.end()),
layer);
596 clctProduct->move(std::make_pair(clctDigis.begin(), clctDigis.end()),
layer);
603 std::vector<CSCShowerDigi> lctShowerDigis;
604 lctShowerDigis.push_back(lctShowerDigi);
605 lctShowerProduct->move(std::make_pair(lctShowerDigis.begin(), lctShowerDigis.end()),
layer);
609 CSCShowerDigi anodeShowerDigiOTMB = cscData[iCSC].tmbHeader()->anodeShowerDigi(
layer.rawId());
610 if (anodeShowerDigiOTMB.
isValid()) {
611 std::vector<CSCShowerDigi> anodeShowerDigis;
612 anodeShowerDigis.push_back(anodeShowerDigiOTMB);
613 anodeShowerProductOTMB->move(std::make_pair(anodeShowerDigis.begin(), anodeShowerDigis.end()),
layer);
617 CSCShowerDigi cathodeShowerDigiOTMB = cscData[iCSC].tmbHeader()->cathodeShowerDigi(
layer.rawId());
618 if (cathodeShowerDigiOTMB.
isValid()) {
619 std::vector<CSCShowerDigi> cathodeShowerDigis;
620 cathodeShowerDigis.push_back(cathodeShowerDigiOTMB);
621 cathodeShowerProductOTMB->move(std::make_pair(cathodeShowerDigis.begin(), cathodeShowerDigis.end()),
627 if (cscData[iCSC].tmbData()->checkSize()) {
628 if (
useRPCs_ && cscData[iCSC].tmbData()->hasRPC()) {
629 std::vector<CSCRPCDigi> rpcDigis = cscData[iCSC].tmbData()->rpcData()->digis();
630 rpcProduct->move(std::make_pair(rpcDigis.begin(), rpcDigis.end()),
layer);
634 if (
useGEMs_ && cscData[iCSC].tmbData()->hasGEM()) {
635 for (
int unsigned igem = 0; igem < (
int unsigned)(cscData[iCSC].tmbData()->gemData()->numGEMs());
637 int gem_chamber =
layer.chamber();
638 int gem_region = (
layer.endcap() == 1) ? 1 : -1;
645 std::vector<GEMPadDigiCluster> gemDigis = cscData[iCSC].tmbData()->gemData()->etaDigis(
646 igem, 7 -
ieta, cscData[iCSC].tmbHeader()->ALCTMatchTime());
647 if (!gemDigis.empty()) {
648 gemProduct->move(std::make_pair(gemDigis.begin(), gemDigis.end()), gemid);
654 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
" TMBData check size failed!";
661 if (cscData[iCSC].cfebData(icfeb) !=
nullptr)
662 cfebStatusProduct->insertDigi(
layer, cscData[iCSC].cfebData(icfeb)->statusDigi());
665 dmbStatusProduct->insertDigi(
668 tmbStatusProduct->insertDigi(
672 alctStatusProduct->insertDigi(
682 layer = pcrate->
detId(vmecrate, dmb, 0, ilayer);
684 std::vector<CSCWireDigi> wireDigis = cscData[iCSC].wireDigis(ilayer);
685 wireProduct->move(std::make_pair(wireDigis.begin(), wireDigis.end()),
layer);
689 layer = pcrate->
detId(vmecrate, dmb, icfeb, ilayer);
690 if (cscData[iCSC].cfebData(icfeb) && cscData[iCSC].cfebData(icfeb)->
check()) {
691 std::vector<CSCStripDigi> stripDigis;
692 cscData[iCSC].cfebData(icfeb)->digis(
layer.rawId(), stripDigis);
693 stripProduct->move(std::make_pair(stripDigis.begin(), stripDigis.end()),
layer);
697 if (goodTMB && (cscData[iCSC].tmbHeader() !=
nullptr)) {
698 int nCFEBs = cscData[iCSC].tmbHeader()->NCFEBs();
699 for (icfeb = 0; icfeb < nCFEBs; ++icfeb) {
700 layer = pcrate->
detId(vmecrate, dmb, icfeb, ilayer);
701 std::vector<CSCComparatorDigi> comparatorDigis =
702 cscData[iCSC].comparatorData()->comparatorDigis(
layer.rawId(), icfeb);
705 layer = pcrate->
detId(vmecrate, dmb, 0, ilayer);
706 comparatorProduct->move(std::make_pair(comparatorDigis.begin(), comparatorDigis.end()),
layer);
714 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"ERROR! Examiner rejected FED #" <<
id;
721 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi")
722 <<
" Examiner errors:0x" << std::hex << examiner->
errors() <<
" & 0x" <<
examinerMask <<
" = " 730 if (examiner !=
nullptr)
735 e.put(
std::move(wireProduct),
"MuonCSCWireDigi");
736 e.put(
std::move(stripProduct),
"MuonCSCStripDigi");
737 e.put(
std::move(alctProduct),
"MuonCSCALCTDigi");
738 e.put(
std::move(clctProduct),
"MuonCSCCLCTDigi");
739 e.put(
std::move(comparatorProduct),
"MuonCSCComparatorDigi");
740 e.put(
std::move(corrlctProduct),
"MuonCSCCorrelatedLCTDigi");
743 e.put(
std::move(formatStatusProduct),
"MuonCSCDCCFormatStatusDigi");
746 e.put(
std::move(cfebStatusProduct),
"MuonCSCCFEBStatusDigi");
747 e.put(
std::move(dmbStatusProduct),
"MuonCSCDMBStatusDigi");
748 e.put(
std::move(tmbStatusProduct),
"MuonCSCTMBStatusDigi");
749 e.put(
std::move(dduStatusProduct),
"MuonCSCDDUStatusDigi");
750 e.put(
std::move(dccStatusProduct),
"MuonCSCDCCStatusDigi");
751 e.put(
std::move(alctStatusProduct),
"MuonCSCALCTStatusDigi");
755 e.put(
std::move(rpcProduct),
"MuonCSCRPCDigi");
758 e.put(
std::move(gemProduct),
"MuonGEMPadDigiCluster");
761 e.put(
std::move(lctShowerProduct),
"MuonCSCShowerDigi");
762 e.put(
std::move(anodeShowerProductOTMB),
"MuonCSCShowerDigiAnode");
763 e.put(
std::move(cathodeShowerProductOTMB),
"MuonCSCShowerDigiCathode");
764 e.put(
std::move(anodeShowerProductALCT),
"MuonCSCShowerDigiAnodeALCT");
767 LogTrace(
"CSCDCCUnpacker|CSCRawToDigi") <<
"[CSCDCCUnpacker]: " <<
numOfEvents <<
" events processed ";
773 int hl,
int id,
int run,
int event,
bool fedshort,
bool fDump,
short unsigned int*
buf)
const {
774 std::cout << std::endl << std::endl << std::endl;
775 std::cout <<
"Run: " <<
run <<
" Event: " <<
event << std::endl;
779 <<
"(scroll down to see summary)" << std::endl;
781 std::cout <<
"Problem seems in FED-" <<
id <<
" " 782 <<
"(scroll down to see summary)" << std::endl;
783 std::cout <<
"********************************************************************************" << std::endl;
784 std::cout << hl <<
" words of data:" << std::endl;
788 std::vector<int> dcc_id;
791 for (
int i = 750;
i < 758;
i++)
794 for (
int i = 830;
i < 838;
i++)
797 char dcc_common[] =
"DCC-";
801 std::vector<int> ddu_id;
802 int ddu_h1_12_13 = 0;
803 for (
int i = 1;
i < 37;
i++)
806 char ddu_common[] =
"DDU-";
807 char ddu_header1[] =
"Header 1";
808 char ddu_header2[] =
"Header 2";
809 char ddu_header3[] =
"Header 3";
810 char ddu_trail1[] =
"Trailer 1", ddu_trail2[] =
"Trailer 2", ddu_trail3[] =
"Trailer 3";
812 char ddu_trailer1_bit[] = {
'8',
'0',
'0',
'0',
'f',
'f',
'f',
'f',
'8',
'0',
'0',
'0',
'8',
'0',
'0',
'0'};
813 char ddu_trailer3_bit[] = {
'a'};
815 char ddu_tr1_err_common[] =
"Incomplet";
819 char dmb_common[] =
"DMB", dmb_header1[] =
"Header 1", dmb_header2[] =
"Header 2";
820 char dmb_common_crate[] =
"crate:", dmb_common_slot[] =
"slot:";
821 char dmb_common_l1a[] =
"L1A:";
822 char dmb_header1_bit[] = {
'9',
'9',
'9',
'9'};
823 char dmb_header2_bit[] = {
'a',
'a',
'a',
'a'};
824 char dmb_tr1[] =
"Trailer 1", dmb_tr2[] =
"Trailer 2";
825 char dmb_tr1_bit[] = {
'f',
'f',
'f',
'f'}, dmb_tr2_bit[] = {
'e',
'e',
'e',
'e'};
830 char alct_common[] =
"ALCT", alct_header1[] =
"Header 1", alct_header2[] =
"Header 2";
831 char alct_common_bxn[] =
"BXN:";
832 char alct_common_wcnt2[] =
"| Actual word count:";
833 char alct_common_wcnt1[] =
"Expected word count:";
834 char alct_header1_bit[] = {
'd',
'd',
'd',
'd',
'b',
'0',
'a'};
835 char alct_header2_bit[] = {
'0',
'0',
'0',
'0'};
836 char alct_tr1[] =
"Trailer 1";
841 char tmb_common[] =
"TMB", tmb_header1[] =
"Header", tmb_tr1[] =
"Trailer";
842 char tmb_header1_bit[] = {
'd',
'd',
'd',
'd',
'b',
'0',
'c'};
843 char tmb_tr1_bit[] = {
'd',
'd',
'd',
'd',
'e',
'0',
'f'};
848 char cfeb_common[] =
"CFEB", cfeb_tr1[] =
"Trailer", cfeb_b[] =
"B-word";
849 char cfeb_common_sample[] =
"sample:";
856 int word_lines = hl / 4;
859 char tempbuf_short[17];
860 char sign1[] =
" --->| ";
863 int word_numbering = 0;
864 int ddu_inst_i = 0, ddu_inst_n = 0, ddu_inst_l1a = 0;
865 int ddu_inst_bxn = 0;
866 int dmb_inst_crate = 0, dmb_inst_slot = 0, dmb_inst_l1a = 0;
868 int alct_inst_l1a = 0;
869 int alct_inst_bxn = 0;
870 int alct_inst_wcnt1 = 0;
871 int alct_inst_wcnt2 = 0;
874 int tmb_inst_l1a = 0;
875 int tmb_inst_wcnt1 = 0;
876 int tmb_inst_wcnt2 = 0;
879 int dcc_h1_check = 0;
882 int ddu_h2_found = 0;
887 bool dcc_check =
false;
888 bool ddu_h2_check[sz1] = {
false};
889 bool ddu_h1_check =
false;
890 bool dmb_h1_check[sz1] = {
false};
891 bool dmb_h2_check[sz1] = {
false};
892 bool ddu_h2_h1 =
false;
893 bool ddu_tr1_check[sz1] = {
false};
894 bool alct_h1_check[sz1] = {
false};
895 bool alct_h2_check[sz1] = {
false};
896 bool alct_tr1_check[sz1] = {
false};
897 bool dmb_tr1_check[sz1] = {
false};
898 bool dmb_tr2_check[sz1] = {
false};
899 bool tmb_h1_check[sz1] = {
false};
900 bool tmb_tr1_check[sz1] = {
false};
901 bool cfeb_tr1_check[sz1] = {
false};
902 bool cfeb_b_check[sz1] = {
false};
903 bool ddu_tr1_bad_check[sz1] = {
false};
904 bool extraction = fedshort;
908 std::vector<int> ddu_h1_coll;
909 std::vector<int> ddu_h1_n_coll;
910 std::vector<int> ddu_h2_coll;
911 std::vector<int> ddu_h3_coll;
912 std::vector<int> ddu_t1_coll;
913 std::vector<int> ddu_t2_coll;
914 std::vector<int> ddu_t3_coll;
915 std::vector<int> ddu_l1a_coll;
916 std::vector<int> ddu_bxn_coll;
918 std::vector<int> dmb_h1_coll;
919 std::vector<int> dmb_h2_coll;
920 std::vector<int> dmb_t1_coll;
921 std::vector<int> dmb_t2_coll;
922 std::vector<int> dmb_crate_coll;
923 std::vector<int> dmb_slot_coll;
924 std::vector<int> dmb_l1a_coll;
926 std::vector<int> alct_h1_coll;
927 std::vector<int> alct_h2_coll;
928 std::vector<int> alct_t1_coll;
929 std::vector<int> alct_l1a_coll;
930 std::vector<int> alct_bxn_coll;
931 std::vector<int> alct_wcnt1_coll;
932 std::vector<int> alct_wcnt2_coll;
933 std::vector<int> alct_wcnt2_id_coll;
935 std::vector<int> tmb_h1_coll;
936 std::vector<int> tmb_t1_coll;
937 std::vector<int> tmb_l1a_coll;
938 std::vector<int> tmb_wcnt1_coll;
939 std::vector<int> tmb_wcnt2_coll;
941 std::vector<int> cfeb_t1_coll;
946 char dcc_header1[] =
"DCC Header 1";
947 char dcc_header2[] =
"DCC Header 2";
948 char dcc_trail1[] =
"DCC Trailer 1", dcc_trail1_bit[] = {
'e'};
949 char dcc_trail2[] =
"DCC Trailer 2", dcc_trail2_bit[] = {
'a'};
952 for (
int i = 0;
i < hl;
i++) {
954 for (
int j = -1;
j < 4;
j++) {
955 sprintf(tempbuf_short,
957 buf[
i + 4 * (
j - 1) + 3],
958 buf[
i + 4 * (
j - 1) + 2],
959 buf[
i + 4 * (
j - 1) + 1],
960 buf[
i + 4 * (
j - 1)]);
966 ddu_h2_check[
j] = ((
buf[
i + 4 * (
j - 1) + 1] == 0x8000) && (
buf[
i + 4 * (
j - 1) + 2] == 0x0001) &&
967 (
buf[
i + 4 * (
j - 1) + 3] == 0x8000));
969 ddu_tr1_check[
j] = ((tempbuf_short[0] == ddu_trailer1_bit[0]) && (tempbuf_short[1] == ddu_trailer1_bit[1]) &&
970 (tempbuf_short[2] == ddu_trailer1_bit[2]) && (tempbuf_short[3] == ddu_trailer1_bit[3]) &&
971 (tempbuf_short[4] == ddu_trailer1_bit[4]) && (tempbuf_short[5] == ddu_trailer1_bit[5]) &&
972 (tempbuf_short[6] == ddu_trailer1_bit[6]) && (tempbuf_short[7] == ddu_trailer1_bit[7]) &&
973 (tempbuf_short[8] == ddu_trailer1_bit[8]) && (tempbuf_short[9] == ddu_trailer1_bit[9]) &&
974 (tempbuf_short[10] == ddu_trailer1_bit[10]) && (tempbuf_short[11] == ddu_trailer1_bit[11]) &&
975 (tempbuf_short[12] == ddu_trailer1_bit[12]) && (tempbuf_short[13] == ddu_trailer1_bit[13]) &&
976 (tempbuf_short[14] == ddu_trailer1_bit[14]) && (tempbuf_short[15] == ddu_trailer1_bit[15]));
978 dmb_h1_check[
j] = ((tempbuf_short[0] == dmb_header1_bit[0]) && (tempbuf_short[4] == dmb_header1_bit[1]) &&
979 (tempbuf_short[8] == dmb_header1_bit[2]) && (tempbuf_short[12] == dmb_header1_bit[3]));
981 dmb_h2_check[
j] = ((tempbuf_short[0] == dmb_header2_bit[0]) && (tempbuf_short[4] == dmb_header2_bit[1]) &&
982 (tempbuf_short[8] == dmb_header2_bit[2]) && (tempbuf_short[12] == dmb_header2_bit[3]));
983 alct_h1_check[
j] = ((tempbuf_short[0] == alct_header1_bit[0]) && (tempbuf_short[4] == alct_header1_bit[1]) &&
984 (tempbuf_short[8] == alct_header1_bit[2]) && (tempbuf_short[12] == alct_header1_bit[3]) &&
985 (tempbuf_short[13] == alct_header1_bit[4]) && (tempbuf_short[14] == alct_header1_bit[5]) &&
986 (tempbuf_short[15] == alct_header1_bit[6]));
987 alct_h2_check[
j] = (((tempbuf_short[0] == alct_header2_bit[0]) && (tempbuf_short[1] == alct_header2_bit[1]) &&
988 (tempbuf_short[2] == alct_header2_bit[2]) && (tempbuf_short[3] == alct_header2_bit[3])) ||
989 ((tempbuf_short[4] == alct_header2_bit[0]) && (tempbuf_short[5] == alct_header2_bit[1]) &&
990 (tempbuf_short[6] == alct_header2_bit[2]) && (tempbuf_short[7] == alct_header2_bit[3])) ||
991 ((tempbuf_short[8] == alct_header2_bit[0]) && (tempbuf_short[9] == alct_header2_bit[1]) &&
992 (tempbuf_short[10] == alct_header2_bit[2]) && (tempbuf_short[11] == alct_header2_bit[3])) ||
993 ((tempbuf_short[12] == alct_header2_bit[0]) && (tempbuf_short[13] == alct_header2_bit[1]) &&
994 (tempbuf_short[14] == alct_header2_bit[2]) && (tempbuf_short[15] == alct_header2_bit[3]))
999 (((
buf[
i + 4 * (
j - 1)] & 0xFFFF) == 0xDE0D) && ((
buf[
i + 4 * (
j - 1) + 1] & 0xF800) == 0xD000) &&
1000 ((
buf[
i + 4 * (
j - 1) + 2] & 0xF800) == 0xD000) && ((
buf[
i + 4 * (
j - 1) + 3] & 0xF000) == 0xD000));
1002 dmb_tr1_check[
j] = ((tempbuf_short[0] == dmb_tr1_bit[0]) && (tempbuf_short[4] == dmb_tr1_bit[1]) &&
1003 (tempbuf_short[8] == dmb_tr1_bit[2]) && (tempbuf_short[12] == dmb_tr1_bit[3]));
1004 dmb_tr2_check[
j] = ((tempbuf_short[0] == dmb_tr2_bit[0]) && (tempbuf_short[4] == dmb_tr2_bit[1]) &&
1005 (tempbuf_short[8] == dmb_tr2_bit[2]) && (tempbuf_short[12] == dmb_tr2_bit[3]));
1007 tmb_h1_check[
j] = ((tempbuf_short[0] == tmb_header1_bit[0]) && (tempbuf_short[4] == tmb_header1_bit[1]) &&
1008 (tempbuf_short[8] == tmb_header1_bit[2]) && (tempbuf_short[12] == tmb_header1_bit[3]) &&
1009 (tempbuf_short[13] == tmb_header1_bit[4]) && (tempbuf_short[14] == tmb_header1_bit[5]) &&
1010 (tempbuf_short[15] == tmb_header1_bit[6]));
1011 tmb_tr1_check[
j] = ((tempbuf_short[0] == tmb_tr1_bit[0]) && (tempbuf_short[4] == tmb_tr1_bit[1]) &&
1012 (tempbuf_short[8] == tmb_tr1_bit[2]) && (tempbuf_short[12] == tmb_tr1_bit[3]) &&
1013 (tempbuf_short[13] == tmb_tr1_bit[4]) && (tempbuf_short[14] == tmb_tr1_bit[5]) &&
1014 (tempbuf_short[15] == tmb_tr1_bit[6]));
1017 (((
buf[
i + 4 * (
j - 1) + 1] & 0xF000) == 0x7000) && ((
buf[
i + 4 * (
j - 1) + 2] & 0xF000) == 0x7000) &&
1018 ((
buf[
i + 4 * (
j - 1) + 1] != 0x7FFF) || (
buf[
i + 4 * (
j - 1) + 2] != 0x7FFF)) &&
1019 ((
buf[
i + 4 * (
j - 1) + 3] == 0x7FFF) || ((
buf[
i + 4 * (
j - 1) + 3] &
buf[
i + 4 * (
j - 1)]) == 0x0 &&
1020 (
buf[
i + 4 * (
j - 1) + 3] +
buf[
i + 4 * (
j - 1)] == 0x7FFF))));
1022 (((
buf[
i + 4 * (
j - 1) + 3] & 0xF000) == 0xB000) && ((
buf[
i + 4 * (
j - 1) + 2] & 0xF000) == 0xB000) &&
1023 ((
buf[
i + 4 * (
j - 1) + 1] & 0xF000) == 0xB000) && ((
buf[
i + 4 * (
j - 1)] = 3 & 0xF000) == 0xB000));
1025 ddu_tr1_bad_check[
j] =
1026 ((tempbuf_short[0] != ddu_trailer1_bit[0]) &&
1029 (tempbuf_short[4] != ddu_trailer1_bit[4]) &&
1032 (tempbuf_short[8] == ddu_trailer1_bit[8]) && (tempbuf_short[9] == ddu_trailer1_bit[9]) &&
1033 (tempbuf_short[10] == ddu_trailer1_bit[10]) && (tempbuf_short[11] == ddu_trailer1_bit[11]) &&
1034 (tempbuf_short[12] == ddu_trailer1_bit[12]) && (tempbuf_short[13] == ddu_trailer1_bit[13]) &&
1035 (tempbuf_short[14] == ddu_trailer1_bit[14]) && (tempbuf_short[15] == ddu_trailer1_bit[15]));
1039 ddu_h2_h1 = ddu_h2_check[2];
1041 sprintf(tempbuf_short,
"%04x%04x%04x%04x",
buf[
i + 3],
buf[
i + 2],
buf[
i + 1],
buf[
i]);
1044 ddu_h1_12_13 = (
buf[
i] >> 8);
1045 for (
int kk = 0;
kk < 36;
kk++) {
1046 if (((
buf[
i + 3] & 0xF000) == 0x5000) && (ddu_h1_12_13 == ddu_id[
kk]) && ddu_h2_h1) {
1047 ddu_h1_coll.push_back(word_numbering);
1048 ddu_h1_n_coll.push_back(ddu_id[
kk]);
1049 ddu_inst_l1a = ((
buf[
i + 2] & 0xFFFF) + ((
buf[
i + 3] & 0x00FF) << 16));
1050 ddu_l1a_coll.push_back(ddu_inst_l1a);
1051 ddu_inst_bxn = (
buf[
i + 1] & 0xFFF0) >> 4;
1052 ddu_bxn_coll.push_back(ddu_inst_bxn);
1054 "%6i %04x %04x %04x %04x%s%s%i %s%s %s %i %s %i",
1071 ddu_h1_check =
true;
1077 dcc_h1_id = (((
buf[
i + 1] << 12) & 0xF000) >> 4) + (
buf[
i] >> 8);
1078 for (
int dcci = 0; dcci < 16; dcci++) {
1079 if ((dcc_id[dcci] == dcc_h1_id) && (((
buf[
i + 3] & 0xF000) == 0x5000) && (!ddu_h1_check))) {
1081 "%6i %04x %04x %04x %04x%s%s%i %s",
1091 dcc_h1_check = word_numbering;
1099 if (((word_numbering - 1) == dcc_h1_check) && ((
buf[
i + 3] & 0xFF00) == 0xD900)) {
1101 "%6i %04x %04x %04x %04x%s%s",
1111 }
else if ((word_numbering == word_lines - 1) && (tempbuf_short[0] == dcc_trail1_bit[0])) {
1113 "%6i %04x %04x %04x %04x%s%s",
1123 }
else if ((word_numbering == word_lines) && (tempbuf_short[0] == dcc_trail2_bit[0])) {
1125 "%6i %04x %04x %04x %04x%s%s",
1138 else if (ddu_h2_check[1]) {
1139 ddu_inst_i = ddu_h1_n_coll.size();
1140 if (ddu_inst_i > 0) {
1141 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1144 "%6i %04x %04x %04x %04x%s%s%i %s",
1154 ddu_h2_coll.push_back(word_numbering);
1161 else if ((ddu_h2_check[0] && dmb_h1_check[2]) || (ddu_h2_check[0] && ddu_tr1_check[2])) {
1162 ddu_inst_i = ddu_h1_n_coll.size();
1163 if (ddu_inst_i > 0) {
1164 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1167 "%6i %04x %04x %04x %04x%s%s%i %s",
1177 ddu_h3_coll.push_back(word_numbering);
1185 else if (dmb_h1_check[1]) {
1188 dmb_inst_l1a = ((
buf[
i] & 0x0FFF) + ((
buf[
i + 1] & 0xFFF) << 12));
1189 dmb_l1a_coll.push_back(dmb_inst_l1a);
1190 if (dmb_h2_check[2]) {
1191 dmb_inst_crate = ((
buf[
i + 4 + 1] >> 4) & 0xFF);
1192 dmb_inst_slot = (
buf[
i + 4 + 1] & 0xF);
1193 dmb_crate_coll.push_back(dmb_inst_crate);
1194 dmb_slot_coll.push_back(dmb_inst_slot);
1197 "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i %s %i",
1213 dmb_h1_coll.push_back(word_numbering);
1219 else if (dmb_h2_check[1]) {
1220 dmb_inst_crate = ((
buf[
i + 1] >> 4) & 0xFF);
1221 dmb_inst_slot = (
buf[
i + 1] & 0xF);
1222 dmb_h2_coll.push_back(word_numbering);
1223 if (dmb_h1_check[0])
1224 dmb_inst_l1a = ((
buf[
i - 4] & 0x0FFF) + ((
buf[
i - 4 + 1] & 0xFFF) << 12));
1226 "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i %s %i",
1249 else if (ddu_tr1_check[1]) {
1250 ddu_inst_i = ddu_h1_n_coll.size();
1251 if (ddu_inst_i > 0) {
1252 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1256 "%6i %04x %04x %04x %04x%s%s%i %s",
1266 ddu_t1_coll.push_back(word_numbering);
1272 else if (alct_h1_check[1]) {
1273 alct_start = word_numbering;
1274 alct_inst_l1a = (
buf[
i + 2] & 0x0FFF);
1275 alct_l1a_coll.push_back(alct_inst_l1a);
1277 "%6i %04x %04x %04x %04x%s%s %s%s %s %i",
1289 alct_h1_coll.push_back(word_numbering);
1294 else if ((alct_h1_check[0]) && (alct_h2_check[2])) {
1295 alct_inst_bxn = (
buf[
i] & 0x0FFF);
1296 alct_bxn_coll.push_back(alct_inst_bxn);
1298 "%6i %04x %04x %04x %04x%s%s %s%s%s %i",
1310 alct_h2_coll.push_back(word_numbering);
1316 else if (alct_tr1_check[1]) {
1317 alct_stop = word_numbering;
1318 if ((alct_start != 0) && (alct_stop != 0) && (alct_stop > alct_start)) {
1319 alct_inst_wcnt2 = 4 * (alct_stop - alct_start + 1);
1320 alct_wcnt2_coll.push_back(alct_inst_wcnt2);
1321 alct_wcnt2_id_coll.push_back(alct_start);
1323 alct_inst_wcnt1 = (
buf[
i + 3] & 0x7FF);
1324 alct_wcnt1_coll.push_back(alct_inst_wcnt1);
1326 "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i",
1340 alct_t1_coll.push_back(word_numbering);
1343 alct_inst_wcnt2 = 0;
1349 else if ((ddu_h2_h1) && (tempbuf_short[0] == ddu_trailer3_bit[0])) {
1351 ddu_inst_i = ddu_h1_n_coll.size();
1352 if (ddu_inst_i > 0) {
1353 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1357 "%6i %04x %04x %04x %04x%s%s%i %s",
1367 ddu_t3_coll.push_back(word_numbering);
1372 else if ((ddu_tr1_check[0]) && (tempbuf_short[0] != ddu_trailer3_bit[0])) {
1374 ddu_inst_i = ddu_h1_n_coll.size();
1375 if (ddu_inst_i > 0) {
1376 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1380 "%6i %04x %04x %04x %04x%s%s%i %s",
1390 ddu_t2_coll.push_back(word_numbering);
1396 else if (dmb_tr1_check[1]) {
1398 "%6i %04x %04x %04x %04x%s%s %s",
1407 dmb_t1_coll.push_back(word_numbering);
1413 else if (dmb_tr2_check[1]) {
1415 "%6i %04x %04x %04x %04x%s%s %s",
1424 dmb_t2_coll.push_back(word_numbering);
1429 else if (tmb_h1_check[1]) {
1430 tmb_start = word_numbering;
1431 tmb_inst_l1a = (
buf[
i + 2] & 0x000F);
1432 tmb_l1a_coll.push_back(tmb_inst_l1a);
1434 "%6i %04x %04x %04x %04x%s%s %s%s%s %i",
1446 tmb_h1_coll.push_back(word_numbering);
1449 }
else if (tmb_tr1_check[1]) {
1450 tmb_stop = word_numbering;
1451 if ((tmb_start != 0) && (tmb_stop != 0) && (tmb_stop > tmb_start)) {
1452 tmb_inst_wcnt2 = 4 * (tmb_stop - tmb_start + 1);
1453 tmb_wcnt2_coll.push_back(tmb_inst_wcnt2);
1455 tmb_inst_wcnt1 = (
buf[
i + 3] & 0x7FF);
1456 tmb_wcnt1_coll.push_back(tmb_inst_wcnt1);
1458 "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i",
1472 tmb_t1_coll.push_back(word_numbering);
1478 else if (cfeb_tr1_check[1]) {
1481 "%6i %04x %04x %04x %04x%s%s %s%s %s %i",
1493 cfeb_t1_coll.push_back(word_numbering);
1496 }
else if (cfeb_b_check[1]) {
1498 "%6i %04x %04x %04x %04x%s%s %s",
1513 else if (ddu_tr1_bad_check[1]) {
1514 ddu_inst_i = ddu_h1_n_coll.size();
1515 ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1517 "%6i %04x %04x %04x %04x%s%s%i %s %s",
1527 ddu_tr1_err_common);
1532 else if (extraction && (!ddu_h1_check) && (!dcc_check)) {
1534 sprintf(tempbuf,
"%6i %04x %04x %04x %04x", word_numbering,
buf[
i + 3],
buf[
i + 2],
buf[
i + 1],
buf[
i]);
1539 std::cout <<
"..................................................." << std::endl;
1544 else if ((!ddu_h1_check) && (!dcc_check)) {
1545 sprintf(tempbuf,
"%6i %04x %04x %04x %04x", word_numbering,
buf[
i + 3],
buf[
i + 2],
buf[
i + 1],
buf[
i]);
1550 ddu_h1_check =
false;
1554 std::cout <<
"********************************************************************************" << std::endl
1557 std::cout <<
"For complete output turn off VisualFEDShort in muonCSCDigis configuration file." << std::endl;
1558 std::cout <<
"********************************************************************************" << std::endl
1563 std::cout << ddu_h1_coll.size() <<
" " << ddu_common <<
" " << ddu_header1 <<
" " 1564 <<
"found" << std::endl;
1569 for (
unsigned int k = 0;
k < ddu_h1_coll.size(); ++
k) {
1576 <<
" " << ddu_h1_coll[
k] <<
" " << sign1 <<
" " << ddu_common <<
" " << ddu_h1_n_coll[
k] <<
" " 1577 << dmb_common_l1a <<
" " << ddu_l1a_coll[
k] <<
" " << alct_common_bxn <<
" " << ddu_bxn_coll[
k]
1582 std::cout <<
"||||||||||||||||||||" << std::endl;
1584 std::cout << ddu_h2_coll.size() <<
" " << ddu_common <<
" " << ddu_header2 <<
" " 1585 <<
"found" << std::endl;
1586 for (
unsigned int k = 0;
k < ddu_h2_coll.size(); ++
k)
1587 std::cout <<
"Line: " << ddu_h2_coll[
k] << std::endl;
1589 std::cout <<
"||||||||||||||||||||" << std::endl;
1591 std::cout << ddu_h3_coll.size() <<
" " << ddu_common <<
" " << ddu_header3 <<
" " 1592 <<
"found" << std::endl;
1593 for (
unsigned int k = 0;
k < ddu_h3_coll.size(); ++
k)
1594 std::cout <<
"Line: " << ddu_h3_coll[
k] << std::endl;
1596 std::cout <<
"||||||||||||||||||||" << std::endl;
1598 std::cout << ddu_t1_coll.size() <<
" " << ddu_common <<
" " << ddu_trail1 <<
" " 1599 <<
"found" << std::endl;
1600 for (
unsigned int k = 0;
k < ddu_t1_coll.size(); ++
k)
1601 std::cout <<
"Line: " << ddu_t1_coll[
k] << std::endl;
1603 std::cout <<
"||||||||||||||||||||" << std::endl;
1605 std::cout << ddu_t2_coll.size() <<
" " << ddu_common <<
" " << ddu_trail2 <<
" " 1606 <<
"found" << std::endl;
1607 for (
unsigned int k = 0;
k < ddu_t2_coll.size(); ++
k)
1608 std::cout <<
"Line: " << ddu_t2_coll[
k] << std::endl;
1610 std::cout <<
"||||||||||||||||||||" << std::endl;
1612 std::cout << ddu_t3_coll.size() <<
" " << ddu_common <<
" " << ddu_trail3 <<
" " 1613 <<
"found" << std::endl;
1614 for (
unsigned int k = 0;
k < ddu_t3_coll.size(); ++
k)
1615 std::cout <<
"Line: " << ddu_t3_coll[
k] << std::endl;
1617 std::cout <<
"||||||||||||||||||||" << std::endl;
1619 std::cout << dmb_h1_coll.size() <<
" " << dmb_common <<
" " << dmb_header1 <<
" " 1620 <<
"found" << std::endl;
1622 for (
unsigned int k = 0;
k < dmb_h1_coll.size(); ++
k) {
1629 <<
" " << dmb_h1_coll[
k] <<
" " << sign1 << dmb_common <<
" " << dmb_common_crate <<
" " 1630 << dmb_crate_coll[
k] <<
" " << dmb_common_slot <<
" " << dmb_slot_coll[
k] <<
" " << dmb_common_l1a <<
" " 1631 << dmb_l1a_coll[
k] << std::endl;
1634 std::cout <<
"||||||||||||||||||||" << std::endl;
1636 std::cout << dmb_h2_coll.size() <<
" " << dmb_common <<
" " << dmb_header2 <<
" " 1637 <<
"found" << std::endl;
1638 for (
unsigned int k = 0;
k < dmb_h2_coll.size(); ++
k)
1639 std::cout <<
"Line: " << dmb_h2_coll[
k] << std::endl;
1641 std::cout <<
"||||||||||||||||||||" << std::endl;
1643 std::cout << dmb_t1_coll.size() <<
" " << dmb_common <<
" " << dmb_tr1 <<
" " 1644 <<
"found" << std::endl;
1645 for (
unsigned int k = 0;
k < dmb_t1_coll.size(); ++
k)
1646 std::cout <<
"Line: " << dmb_t1_coll[
k] << std::endl;
1648 std::cout <<
"||||||||||||||||||||" << std::endl;
1650 std::cout << dmb_t2_coll.size() <<
" " << dmb_common <<
" " << dmb_tr2 <<
" " 1651 <<
"found" << std::endl;
1652 for (
unsigned int k = 0;
k < dmb_t2_coll.size(); ++
k)
1653 std::cout <<
"Line: " << dmb_t2_coll[
k] << std::endl;
1655 std::cout <<
"||||||||||||||||||||" << std::endl;
1657 std::cout << alct_h1_coll.size() <<
" " << alct_common <<
" " << alct_header1 <<
" " 1658 <<
"found" << std::endl;
1659 for (
unsigned int k = 0;
k < alct_h1_coll.size(); ++
k) {
1667 <<
" " << alct_h1_coll[
k] <<
" " << sign1 <<
" " << alct_common <<
" " << dmb_common_l1a <<
" " 1668 << alct_l1a_coll[
k] << std::endl;
1672 std::cout <<
"||||||||||||||||||||" << std::endl;
1674 std::cout << alct_h2_coll.size() <<
" " << alct_common <<
" " << alct_header2 <<
" " 1675 <<
"found" << std::endl;
1676 for (
unsigned int k = 0;
k < alct_h2_coll.size(); ++
k) {
1684 <<
" " << alct_h1_coll[
k] <<
" " << sign1 <<
" " << alct_common <<
" " << alct_common_bxn <<
" " 1685 << alct_bxn_coll[
k] << std::endl;
1689 std::cout <<
"||||||||||||||||||||" << std::endl;
1691 std::cout << alct_t1_coll.size() <<
" " << alct_common <<
" " << alct_tr1 <<
" " 1692 <<
"found" << std::endl;
1693 for (
unsigned int k = 0;
k < alct_t1_coll.size(); ++
k) {
1701 <<
" " << alct_t1_coll[
k] <<
" " << sign1 <<
" " << alct_common <<
" " << alct_common_wcnt1 <<
" " 1702 << alct_wcnt1_coll[
k] <<
" " << alct_common_wcnt2 <<
" ";
1703 if (!alct_wcnt2_coll.empty()) {
1704 std::cout << alct_wcnt2_coll[
k] << std::endl;
1706 std::cout <<
"Undefined (ALCT Header is not found) " << std::endl;
1711 std::cout <<
"||||||||||||||||||||" << std::endl;
1713 std::cout << tmb_h1_coll.size() <<
" " << tmb_common <<
" " << tmb_header1 <<
" " 1714 <<
"found" << std::endl;
1715 for (
unsigned int k = 0;
k < tmb_h1_coll.size(); ++
k) {
1723 <<
" " << tmb_h1_coll[
k] <<
" " << sign1 <<
" " << tmb_common <<
" " << dmb_common_l1a <<
" " 1724 << tmb_l1a_coll[
k] << std::endl;
1728 std::cout <<
"||||||||||||||||||||" << std::endl;
1730 std::cout << tmb_t1_coll.size() <<
" " << tmb_common <<
" " << tmb_tr1 <<
" " 1731 <<
"found" << std::endl;
1732 for (
unsigned int k = 0;
k < tmb_t1_coll.size(); ++
k) {
1740 <<
" " << tmb_t1_coll[
k] <<
" " << sign1 <<
" " << tmb_common <<
" " << alct_common_wcnt1 <<
" " 1741 << tmb_wcnt1_coll[
k] <<
" " << alct_common_wcnt2 <<
" " << tmb_wcnt2_coll[
k] << std::endl;
1745 std::cout <<
"||||||||||||||||||||" << std::endl;
1747 std::cout << cfeb_t1_coll.size() <<
" " << cfeb_common <<
" " << cfeb_tr1 <<
" " 1748 <<
"found" << std::endl;
1749 for (
unsigned int k = 0;
k < cfeb_t1_coll.size(); ++
k)
1750 std::cout <<
"Line: " << cfeb_t1_coll[
k] << std::endl;
1751 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)
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< TrackerTraits > > 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
#define DEFINE_FWK_MODULE(type)
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...