4 using namespace dedefs;
11 std::cout <<
"\nL1COMPARATOR constructor...\n" << std::flush;
13 std::vector<unsigned int> dosys(0,
DEnsys);
17 if((
int)dosys.size()!=
DEnsys)
19 <<
"wrong selection of systems to be compared\n"
20 <<
"\t the size of the mask COMPARE_COLLS (" << dosys.size()
21 <<
") is not " <<
DEnsys << std::endl;
22 assert((
int)dosys.size()==
DEnsys);
24 for(
int isys=0; isys<
DEnsys; isys++)
25 if( dosys[isys]!=0 && dosys[isys]!=1 )
27 <<
"L1Comparator: comparison flag for system " << isys
28 <<
" is non boolean: " << dosys[isys] <<
". Exiting.\n";
31 m_doSys[
i] = dosys[
i];
39 std::cout <<
"[L1Comparator] list of systems to process: ";
47 assert(
ETP==0); assert(
HTP==1); assert(
RCT== 2); assert(
GCT== 3);
48 assert(
DTP==4); assert(
DTF==5); assert(
CTP== 6); assert(
CTF== 7);
49 assert(
RPC==8); assert(
LTC==9); assert(
GMT==10); assert(
GLT==11);
52 std::cout <<
"[L1Comparator] debug print collection labels\n";
81 for(
int sys=0; sys<
DEnsys; sys++) {
82 std::string data_label =
SystLabel[sys] +
"sourceData";
83 std::string emul_label =
SystLabel[sys] +
"sourceEmul";
94 <<
"\n\tdt:" << data_label <<
" : " <<m_DEsource[sys][0]
95 <<
"\n\tem:" << emul_label <<
" : " <<m_DEsource[sys][1]
98 std::cout <<
"\tdt:" << data_label <<
" : " <<m_DEsource[sys][2]
99 <<
"\n\tem:" << emul_label <<
" : " <<m_DEsource[sys][3]
118 if(!m_dumpFile.good())
120 <<
" L1Comparator::L1Comparator() : "
121 <<
" couldn't open dump file " << m_dumpFileName.c_str() << std::endl;
129 for(
int j=0;
j<2;
j++)
131 DEmatchEvt[
i] =
true;
136 produces<L1DataEmulRecord>().setBranchAlias(
"L1DataEmulRecord");
139 std::cout <<
"\nL1Comparator constructor...done.\n" << std::flush;
150 std::cout <<
"\nL1COMPARATOR beginRun...\n" << std::flush;
169 std::cout <<
"RCT key is empty. Sub-systems is disabled ("<<m_doSys[
RCT]<<
")\n";
171 std::cout <<
"GCT key is empty. Sub-systems is disabled ("<<m_doSys[
GCT]<<
")\n";
173 std::cout <<
"DTTF key is empty. Sub-systems is disabled ("<<m_doSys[
DTF]<<
")\n";
175 std::cout <<
"CSCTF key is empty. Sub-systems is disabled ("<<m_doSys[
CTF]<<
")\n";
177 std::cout <<
"RPC key is empty. Sub-systems is disabled ("<<m_doSys[
RPC]<<
")\n";
179 std::cout <<
"GMT key is empty. Sub-systems is disabled ("<<m_doSys[
GMT]<<
")\n";
181 std::cout <<
"GT key is empty. Sub-systems is disabled ("<<m_doSys[
GLT]<<
")\n";
182 std::cout <<
"TSC key = " << pKey->tscKey() << std::endl;
191 <<
"No L1TriggerKey found."
196 std::cout <<
"L1COMPARATOR beginRun... done\n" << std::flush;
202 m_dumpFile <<
"\n\n-------\n"
203 <<
"Global data|emulator agreement: "
204 << m_match << std::endl;
213 runNum_ = iEvent.
id().
run();
216 std::cout <<
"\nL1COMPARATOR entry:" << nevt_ <<
" | evt:" << evtNum_
217 <<
" | run:" << runNum_ <<
"\n" << std::flush;
224 for(
int j=0;
j<2;
j++)
226 DEmatchEvt[
i] =
true;
237 iEvent.
getByLabel(m_DEsource[ETP][0], ecal_tp_data);
238 iEvent.
getByLabel(m_DEsource[ETP][1], ecal_tp_emul);
245 iEvent.
getByLabel(m_DEsource[HTP][0], hcal_tp_data);
246 iEvent.
getByLabel(m_DEsource[HTP][1], hcal_tp_emul);
255 iEvent.
getByLabel(m_DEsource[RCT][0], rct_em_data);
256 iEvent.
getByLabel(m_DEsource[RCT][1], rct_em_emul);
257 iEvent.
getByLabel(m_DEsource[RCT][0], rct_rgn_data);
258 iEvent.
getByLabel(m_DEsource[RCT][1], rct_rgn_emul);
289 iEvent.
getByLabel(m_DEsource[GCT][0].
label(),
"isoEm", gct_isolaem_data);
290 iEvent.
getByLabel(m_DEsource[GCT][1].
label(),
"isoEm", gct_isolaem_emul);
291 iEvent.
getByLabel(m_DEsource[GCT][0].
label(),
"nonIsoEm",gct_noisoem_data);
292 iEvent.
getByLabel(m_DEsource[GCT][1].
label(),
"nonIsoEm",gct_noisoem_emul);
293 iEvent.
getByLabel(m_DEsource[GCT][0].
label(),
"cenJets", gct_cenjets_data);
294 iEvent.
getByLabel(m_DEsource[GCT][1].
label(),
"cenJets", gct_cenjets_emul);
295 iEvent.
getByLabel(m_DEsource[GCT][0].
label(),
"forJets", gct_forjets_data);
296 iEvent.
getByLabel(m_DEsource[GCT][1].
label(),
"forJets", gct_forjets_emul);
297 iEvent.
getByLabel(m_DEsource[GCT][0].
label(),
"tauJets", gct_taujets_data);
298 iEvent.
getByLabel(m_DEsource[GCT][1].
label(),
"tauJets", gct_taujets_emul);
300 iEvent.
getByLabel(m_DEsource[GCT][0],gct_ht_data);
301 iEvent.
getByLabel(m_DEsource[GCT][1],gct_ht_emul);
302 iEvent.
getByLabel(m_DEsource[GCT][0],gct_etmiss_data);
303 iEvent.
getByLabel(m_DEsource[GCT][1],gct_etmiss_emul);
304 iEvent.
getByLabel(m_DEsource[GCT][0],gct_ettota_data);
305 iEvent.
getByLabel(m_DEsource[GCT][1],gct_ettota_emul);
306 iEvent.
getByLabel(m_DEsource[GCT][0],gct_htmiss_data);
307 iEvent.
getByLabel(m_DEsource[GCT][1],gct_htmiss_emul);
308 iEvent.
getByLabel(m_DEsource[GCT][0],gct_hfring_data);
309 iEvent.
getByLabel(m_DEsource[GCT][1],gct_hfring_emul);
310 iEvent.
getByLabel(m_DEsource[GCT][0],gct_hfbcnt_data);
311 iEvent.
getByLabel(m_DEsource[GCT][1],gct_hfbcnt_emul);
312 iEvent.
getByLabel(m_DEsource[GCT][0],gct_jetcnt_data);
313 iEvent.
getByLabel(m_DEsource[GCT][1],gct_jetcnt_emul);
322 iEvent.
getByLabel(m_DEsource[DTP][0],dtp_ph_data_);
323 iEvent.
getByLabel(m_DEsource[DTP][1],dtp_ph_emul_);
324 iEvent.
getByLabel(m_DEsource[DTP][0],dtp_th_data_);
325 iEvent.
getByLabel(m_DEsource[DTP][1],dtp_th_emul_);
332 if(dtp_ph_data_.
isValid()) dtp_ph_data = dtp_ph_data_->getContainer();
333 if(dtp_ph_emul_.
isValid()) dtp_ph_emul = dtp_ph_emul_->getContainer();
334 if(dtp_th_data_.
isValid()) dtp_th_data = dtp_th_data_->getContainer();
335 if(dtp_th_emul_.
isValid()) dtp_th_emul = dtp_th_emul_->getContainer();
352 typedef std::vector<L1MuDTTrackCand> L1MuDTTrackCandCollection;
354 dtf_trk_data_v.clear(); dtf_trk_emul_v.clear();
356 L1MuDTTrackCandCollection *dttc = dtf_trk_data_->getContainer();
357 for(L1MuDTTrackCandCollection::const_iterator it=dttc->begin();
358 it!=dttc->end(); it++)
362 L1MuDTTrackCandCollection *dttc = dtf_trk_emul_->getContainer();
363 for(L1MuDTTrackCandCollection::const_iterator it=dttc->begin();
364 it!=dttc->end(); it++)
367 dtf_trk_data =&dtf_trk_data_v;
368 dtf_trk_emul =&dtf_trk_emul_v;
384 if(m_DEsource[CTP][0].
label().
find(
"tf")!=std::string::npos) {
386 iEvent.
getByLabel(
"muonCSCDigis",
"MuonCSCALCTDigi" ,ctp_ano_data_);
387 iEvent.
getByLabel(
"muonCSCDigis",
"MuonCSCCLCTDigi" ,ctp_cat_data_);
388 iEvent.
getByLabel(m_DEsource[CTP][0] ,ctp_lct_data_);
390 iEvent.
getByLabel(m_DEsource[CTP][0].
label(),
"MuonCSCALCTDigi",ctp_ano_data_);
391 iEvent.
getByLabel(m_DEsource[CTP][0].
label(),
"MuonCSCCLCTDigi",ctp_cat_data_);
392 iEvent.
getByLabel(m_DEsource[CTP][0].
label(),
"MuonCSCCorrelatedLCTDigi",ctp_lct_data_);
394 iEvent.
getByLabel(m_DEsource[CTP][1] ,ctp_ano_emul_);
395 iEvent.
getByLabel(m_DEsource[CTP][1] ,ctp_cat_emul_);
396 iEvent.
getByLabel(m_DEsource[CTP][1] ,ctp_lct_emul_);
402 ctp_ano_data_v.clear(); ctp_ano_emul_v.clear();
405 int fifo_pretrig = 10;
406 int fpga_latency = 6;
407 int l1a_window_width = 7;
409 int rawhit_tbin_offset =
410 (fifo_pretrig - fpga_latency) + (l1a_window_width-1)/2;
413 int register_delay = 2;
416 for (mapIt mit = ctp_ano_data_->begin(); mit != ctp_ano_data_->end(); mit++)
417 for (vecIt vit = ctp_ano_data_->get((*mit).first).first;
418 vit != ctp_ano_data_->get((*mit).first).second; vit++)
419 ctp_ano_data_v.push_back(*vit);
420 for (mapIt mit = ctp_ano_emul_->begin(); mit != ctp_ano_emul_->end(); mit++)
421 for (vecIt vit = ctp_ano_emul_->get((*mit).first).first;
422 vit != ctp_ano_emul_->get((*mit).first).second; vit++) {
424 (*vit).getBX() - rawhit_tbin_offset + register_delay;
425 CSCALCTDigi alct((*vit).isValid(), (*vit).getQuality(),
426 (*vit).getAccelerator(), (*vit).getCollisionB(),
427 (*vit).getKeyWG(), emul_bx_corr,
429 ctp_ano_emul_v.push_back(alct);
432 ctp_ano_data =&ctp_ano_data_v;
433 ctp_ano_emul =&ctp_ano_emul_v;
436 ctp_cat_data_v.
clear(); ctp_cat_emul_v.clear();
438 int tbin_cathode_offset = 7, emul_bx_corr;
441 for (mapIt mit = ctp_cat_data_->begin(); mit != ctp_cat_data_->end(); mit++)
442 for (vecIt vit = ctp_cat_data_->get((*mit).first).first;
443 vit != ctp_cat_data_->get((*mit).first).second; vit++)
444 ctp_cat_data_v.push_back(*vit);
445 for (mapIt mit = ctp_cat_emul_->begin(); mit != ctp_cat_emul_->end(); mit++) {
449 int full_cathode_bx = -999;
451 for (vecIt digiIt = crange.first; digiIt != crange.second; digiIt++) {
452 if ((*digiIt).isValid()) {
453 full_cathode_bx = (*digiIt).getFullBX();
458 for (vecIt vit = ctp_cat_emul_->get(detid).first;
459 vit != ctp_cat_emul_->get(detid).second; vit++) {
460 int emul_bx = (*vit).getBX();
461 if (full_cathode_bx != -999)
463 (full_cathode_bx + emul_bx - tbin_cathode_offset) & 0x03;
465 emul_bx_corr = emul_bx & 0x03;
466 CSCCLCTDigi clct((*vit).isValid(), (*vit).getQuality(),
467 (*vit).getPattern(), (*vit).getStripType(),
468 (*vit).getBend(), (*vit).getStrip(),
469 (*vit).getCFEB(), emul_bx_corr,
471 ctp_cat_emul_v.push_back(clct);
475 ctp_cat_data =&ctp_cat_data_v;
476 ctp_cat_emul =&ctp_cat_emul_v;
479 ctp_lct_data_v.
clear(); ctp_lct_emul_v.clear();
481 int tbin_anode_offset = 5, emul_bx_corr;
485 for (mapIt mit = ctp_lct_data_->begin(); mit != ctp_lct_data_->end(); mit++)
490 for (vecIt vit = ctp_lct_data_->get((*mit).first).first;
491 vit != ctp_lct_data_->get((*mit).first).second; vit++)
492 ctp_lct_data_v.push_back(*vit);
493 for (mapIt mit = ctp_lct_emul_->begin(); mit != ctp_lct_emul_->end(); mit++) {
497 int full_anode_bx = -999;
501 digiIt != arange.second; digiIt++) {
502 if ((*digiIt).isValid()) {
503 full_anode_bx = (*digiIt).getFullBX();
509 for (vecIt vit = ctp_lct_emul_->get(detid).first;
510 vit != ctp_lct_emul_->get(detid).second; vit++) {
511 int emul_bx = (*vit).getBX();
512 if (full_anode_bx != -999) {
513 emul_bx_corr = (full_anode_bx + emul_bx - tbin_anode_offset) & 0x01;
516 emul_bx_corr = emul_bx & 0x01;
521 if (m_DEsource[CTP][1].instance() ==
"MPCSORTED") emul_bx_corr += 5;
524 (*vit).getQuality(), (*vit).getKeyWG(),
525 (*vit).getStrip(), (*vit).getPattern(),
526 (*vit).getBend(), emul_bx_corr,
527 (*vit).getMPCLink(), (*vit).getBX0(),
528 (*vit).getSyncErr(), (*vit).getCSCID());
529 ctp_lct_emul_v.push_back(lct);
533 ctp_lct_data =&ctp_lct_data_v;
534 ctp_lct_emul =&ctp_lct_emul_v;
549 iEvent.
getByLabel(m_DEsource[CTF][2],ctf_trk_data_);
550 iEvent.
getByLabel(m_DEsource[CTF][3],ctf_trk_emul_);
552 iEvent.
getByLabel(m_DEsource[CTF][0],ctf_data);
553 iEvent.
getByLabel(m_DEsource[CTF][1],ctf_emul);
555 iEvent.
getByLabel(m_DEsource[CTF][0].
label(),
"MuonL1CSCStatusDigiCollection",ctf_sta_data_);
556 iEvent.
getByLabel(m_DEsource[CTF][1].
label(),
"MuonL1CSCStatusDigiCollection",ctf_sta_emul_);
559 ctf_sta_data = &(ctf_sta_data_->second);
561 ctf_sta_emul = &(ctf_sta_emul_->second);
567 typedef L1CSCTrackCollection::const_iterator ctcIt;
569 for(ctcIt tcit=ctf_trk_data_->begin(); tcit!=ctf_trk_data_->end(); tcit++) {
571 if((tcit->first.bx() < -1) || (tcit->first.bx() > 1))
577 ctf_trc_data_v.push_back(
L1MuRegionalCand(tcit->first.getDataWord(), tcit->first.bx()));
581 for (mapIt mit = ldc.begin(); mit != ldc.end(); mit++)
586 for (vecIt vit = ldc.get((*mit).first).first;
587 vit != ldc.get((*mit).first).second; vit++)
588 ctf_trk_data_v.push_back(*vit);
590 ctf_trk_data = &ctf_trk_data_v;
591 ctf_trc_data = &ctf_trc_data_v;
593 for(ctcIt tcit=ctf_trk_emul_->begin();tcit!=ctf_trk_emul_->end(); tcit++) {
594 if((tcit->first.bx() < -1) || (tcit->first.bx() > 1))
596 ctf_trc_emul_v.push_back(
L1MuRegionalCand(tcit->first.getDataWord(), tcit->first.bx()));
598 for (mapIt mit = ldc.begin(); mit != ldc.end(); mit++)
599 for (vecIt vit = ldc.get((*mit).first).first;
600 vit != ldc.get((*mit).first).second; vit++)
601 ctf_trk_emul_v.push_back(*vit);
603 ctf_trk_emul = &ctf_trk_emul_v;
604 ctf_trc_emul = &ctf_trc_emul_v;
623 iEvent.
getByLabel(m_DEsource[LTC][0],ltc_data);
624 iEvent.
getByLabel(m_DEsource[LTC][1],ltc_emul);
638 iEvent.
getByLabel(m_DEsource[GMT][0], gmt_data);
639 iEvent.
getByLabel(m_DEsource[GMT][1], gmt_emul);
640 iEvent.
getByLabel(m_DEsource[GMT][0], gmt_rdt_data_);
641 iEvent.
getByLabel(m_DEsource[GMT][1], gmt_rdt_emul_);
645 gmt_can_data_vec.clear(); gmt_can_emul_vec.clear();
646 gmt_rdt_data_vec.clear(); gmt_rdt_emul_vec.clear();
648 typedef std::vector<L1MuGMTReadoutRecord>::const_iterator GmtRrIt;
650 std::vector<L1MuGMTReadoutRecord> gmt_rdt_data_bx = gmt_rdt_data_->getRecords();
651 for(GmtRrIt igmtrr=gmt_rdt_data_bx.begin(); igmtrr!=gmt_rdt_data_bx.end(); igmtrr++) {
653 typedef std::vector<L1MuGMTExtendedCand>::const_iterator GmtECIt;
654 std::vector<L1MuGMTExtendedCand> gmc;
655 gmc = igmtrr->getGMTCands();
656 for(GmtECIt iter1=gmc.begin(); iter1!=gmc.end(); iter1++) {
657 L1MuGMTCand cand(iter1->getDataWord(),iter1->bx());
659 cand.setEtaValue(iter1->etaValue());
660 cand.setPtValue (iter1->ptValue ());
661 gmt_can_data_vec.push_back(cand);
664 typedef L1MuRegionalCandCollection::const_iterator GmtRCIt;
667 rmc = igmtrr->getDTBXCands();
668 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
670 rmc = igmtrr->getCSCCands();
671 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
673 rmc = igmtrr->getBrlRPCCands();
674 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
676 rmc = igmtrr->getFwdRPCCands();
677 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
680 std::vector<L1MuGMTReadoutRecord> gmt_rdt_emul_bx = gmt_rdt_emul_->getRecords();
681 for(GmtRrIt igmtrr=gmt_rdt_emul_bx.begin(); igmtrr!=gmt_rdt_emul_bx.end(); igmtrr++) {
683 typedef std::vector<L1MuGMTExtendedCand>::const_iterator GmtECIt;
684 std::vector<L1MuGMTExtendedCand> gmc;
685 gmc = igmtrr->getGMTCands();
686 for(GmtECIt iter1=gmc.begin(); iter1!=gmc.end(); iter1++) {
687 gmt_can_emul_vec.push_back(
L1MuGMTCand(iter1->getDataWord(),iter1->bx()));
690 typedef L1MuRegionalCandCollection::const_iterator GmtRCIt;
693 rmc = igmtrr->getDTBXCands();
694 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
696 rmc = igmtrr->getCSCCands();
697 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
699 rmc = igmtrr->getBrlRPCCands();
700 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
702 rmc = igmtrr->getFwdRPCCands();
703 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
706 gmt_rdt_data = &gmt_rdt_data_vec;
707 gmt_rdt_emul = &gmt_rdt_emul_vec;
708 gmt_can_data = &gmt_can_data_vec;
709 gmt_can_emul = &gmt_can_emul_vec;
719 iEvent.
getByLabel(m_DEsource[GLT][0], glt_rdt_data);
720 iEvent.
getByLabel(m_DEsource[GLT][1], glt_rdt_emul);
721 iEvent.
getByLabel(m_DEsource[GLT][0], glt_evm_data);
722 iEvent.
getByLabel(m_DEsource[GLT][1], glt_evm_emul);
723 iEvent.
getByLabel(m_DEsource[GLT][0], glt_obj_data);
724 iEvent.
getByLabel(m_DEsource[GLT][1], glt_obj_emul);
730 bool isValidDE[
DEnsys][2];
731 for(
int i=0;
i<
DEnsys;
i++)
for(
int j=0;
j<2;
j++) isValidDE[
i][
j]=
false;
737 isValidDE[
GCT][0] = gct_isolaem_data .
isValid(); isValidDE[
GCT][1] =gct_isolaem_emul .
isValid();
738 isValidDE[
GCT][0]&= gct_noisoem_data .
isValid(); isValidDE[
GCT][1]&=gct_noisoem_emul .
isValid();
739 isValidDE[
GCT][0]&= gct_cenjets_data .
isValid(); isValidDE[
GCT][1]&=gct_cenjets_emul .
isValid();
740 isValidDE[
GCT][0]&= gct_forjets_data .
isValid(); isValidDE[
GCT][1]&=gct_forjets_emul .
isValid();
741 isValidDE[
GCT][0]&= gct_taujets_data .
isValid(); isValidDE[
GCT][1]&=gct_taujets_emul .
isValid();
753 if (m_DEsource[CTP][0].
label().
find(
"tf") == std::string::npos) {
772 for(
int j=0;
j<2;
j++) {
773 isValid[
i] &= isValidDE[
i][
j];
778 std::cout <<
"L1Comparator sys isValid? (evt:" << nevt_ <<
") ";
795 std::cout <<
"L1Comparator start processing the collections.\n" << std::flush;
798 if(m_doSys[ETP]&&isValid[ETP]) process<EcalTrigPrimDigiCollection> ( ecal_tp_data, ecal_tp_emul,
ETP,
ECALtp);
799 if(m_doSys[HTP]&&isValid[HTP]) process<HcalTrigPrimDigiCollection> ( hcal_tp_data, hcal_tp_emul,
HTP,
HCALtp);
800 if(m_doSys[RCT]&&isValid[RCT]) process<L1CaloEmCollection> ( rct_em_data, rct_em_emul,
RCT,
RCTem);
801 if(m_doSys[RCT]&&isValid[RCT]) process<L1CaloRegionCollection> ( rct_rgn_data, rct_rgn_emul,
RCT,
RCTrgn);
802 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_isolaem_data, gct_isolaem_emul,
GCT,
GCTisolaem);
803 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_noisoem_data, gct_noisoem_emul,
GCT,
GCTnoisoem);
804 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_cenjets_data, gct_cenjets_emul,
GCT,
GCTcenjets);
805 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_forjets_data, gct_forjets_emul,
GCT,
GCTforjets);
806 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_taujets_data, gct_taujets_emul,
GCT,
GCTtaujets);
807 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtHadCollection> ( gct_ht_data, gct_ht_emul,
GCT,
GCTethad);
808 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtMissCollection> ( gct_etmiss_data, gct_etmiss_emul,
GCT,
GCTetmiss);
809 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtTotalCollection> ( gct_ettota_data , gct_ettota_emul,
GCT,
GCTettot);
810 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHtMissCollection> ( gct_htmiss_data, gct_htmiss_emul,
GCT,
GCThtmiss);
811 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFRingEtSumsCollection> ( gct_hfring_data, gct_hfring_emul,
GCT,
GCThfring);
812 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFBitCountsCollection> ( gct_hfbcnt_data, gct_hfbcnt_emul,
GCT,
GCThfbit);
814 if(m_doSys[DTP]&&isValid[DTP]) process<L1MuDTChambPhDigiCollection> ( dtp_ph_data, dtp_ph_emul,
DTP,
DTtpPh);
815 if(m_doSys[DTP]&&isValid[DTP]) process<L1MuDTChambThDigiCollection> ( dtp_th_data, dtp_th_emul,
DTP,
DTtpTh);
816 if(m_doSys[DTF]&&isValid[DTF]) process<L1MuRegionalCandCollection> ( dtf_data, dtf_emul,
DTF,
DTtf);
817 if(m_doSys[DTF]&&isValid[DTF]) process<L1MuRegionalCandCollection> ( dtf_trk_data, dtf_trk_emul,
DTF,
DTtftrk);
818 if(m_DEsource[CTP][0].
label().find(
"tf") == std::string::npos) {
819 if(m_doSys[CTP]&&isValid[CTP]) process<CSCALCTDigiCollection_> ( ctp_ano_data, ctp_ano_emul,
CTP,
CSCtpa);
820 if(m_doSys[CTP]&&isValid[CTP]) process<CSCCLCTDigiCollection_> ( ctp_cat_data, ctp_cat_emul,
CTP,
CSCtpc);
822 if(m_doSys[CTP]&&isValid[CTP]) process<CSCCorrelatedLCTDigiCollection_>( ctp_lct_data, ctp_lct_emul,
CTP,
CSCtpl);
823 if(m_doSys[CTF]&&isValid[CTF]) process<L1MuRegionalCandCollection> ( ctf_data, ctf_emul,
CTF,
CSCtf);
824 if(m_doSys[CTF]&&isValid[CTF]) process<CSCCorrelatedLCTDigiCollection_>( ctf_trk_data, ctf_trk_emul,
CTF,
CSCtftrk);
826 if(m_doSys[CTF]&&isValid[CTF]) process<L1CSCSPStatusDigiCollection_> ( ctf_sta_data, ctf_sta_emul,
CTF,
CSCtfsta);
827 if(m_doSys[RPC]&&isValid[RPC]) process<L1MuRegionalCandCollection> ( rpc_cen_data, rpc_cen_emul,
RPC,
RPCcen);
828 if(m_doSys[RPC]&&isValid[RPC]) process<L1MuRegionalCandCollection> ( rpc_for_data, rpc_for_emul,
RPC,
RPCfor);
829 if(m_doSys[LTC]&&isValid[LTC]) process<LTCDigiCollection> ( ltc_data, ltc_emul,
LTC,
LTCi);
830 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuGMTCandCollection> ( gmt_data, gmt_emul,
GMT,
GMTmain);
831 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuRegionalCandCollection> ( gmt_rdt_data, gmt_rdt_emul,
GMT,
GMTrdt);
832 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuGMTCandCollection> ( gmt_can_data, gmt_can_emul,
GMT,
GMTcnd);
837 if(m_doSys[GLT] && isValid[GLT] ) {
843 else if(m_dumpMode==-1)
846 if(dumpEvent_ && prt) {
847 m_dumpFile <<
"\nEntry: " << nevt_
848 <<
" (event:" << evtNum_
849 <<
" | run:" << runNum_
850 <<
")\n" << std::flush;
854 m_dumpFile <<
"\n GT...\n";
860 std::vector<bool> gltDecBits[2], gltTchBits[2];
861 globalDBit[0] = glt_rdt_data->decision();
862 globalDBit[1] = glt_rdt_emul->decision();
863 gltDecBits[0] = glt_rdt_data->decisionWord();
864 gltDecBits[1] = glt_rdt_emul->decisionWord();
867 gltTchBits[0] = glt_rdt_data->technicalTriggerWord();
868 gltTchBits[1] = glt_rdt_emul->technicalTriggerWord();
869 gltdigimon.set(globalDBit, gltDecBits, gltTchBits);
871 DEncand[
GLT][0]=1; DEncand[
GLT][1]=1;
872 DEmatchEvt[
GLT] = compareCollections(glt_rdt_data, glt_rdt_emul);
877 DEmatchEvt[GLT] &= compareCollections(glt_evm_data, glt_evm_emul);
879 DEmatchEvt[GLT] &= compareCollections(glt_obj_data, glt_obj_emul);
882 char dumptofile[1000];
883 if(DEmatchEvt[GLT]) sprintf(ok,
"successful");
884 else sprintf(ok,
"failed");
885 sprintf(dumptofile,
" ...GT data and emulator comparison: %s\n", ok);
886 m_dumpFile<<dumptofile;
890 std::cout <<
"L1Comparator done processing all collections.\n" << std::flush;
893 std::cout <<
"[L1Comparator] sys match? << evt." << nevt_ <<
": ";
902 bool evt_match =
true;
904 evt_match &= DEmatchEvt[
i];
916 m_match &= evt_match;
917 m_dumpFile << std::flush;
920 if(m_dedigis.size()==0) {
922 std::cout <<
"\n [L1Comparator] adding empty collection to DErecord\n";
927 std::auto_ptr<L1DataEmulRecord>
record
928 (
new L1DataEmulRecord(evt_match,m_doSys,DEmatchEvt,DEncand,m_dedigis, gltdigimon));
930 std::cout <<
"\n [L1Comparator] printing DErecord"
932 <<
"|evt:" << evtNum_
933 <<
"|run:" << runNum_
934 <<
"):\n" << std::flush;
936 <<
"\n" << std::flush;
942 bool dorawdata =
false;
946 iEvent.
getByLabel(m_FEDsource[0], raw_fedcoll_data);
947 iEvent.
getByLabel(m_FEDsource[1], raw_fedcoll_emul);
949 rawval &= raw_fedcoll_data.
isValid();
950 rawval &= raw_fedcoll_emul.
isValid();
952 compareFedRawCollections(raw_fedcoll_data,raw_fedcoll_emul, m_fedId);
956 std::cout <<
"L1comparator::analize() end. " << nevt_ << std::endl;
965 std::cout <<
"L1Comparator::process -ing system:" << sys
966 <<
" (" <<
SystLabel[sys] <<
"), data type " << cid
967 <<
"...\n" << std::flush;
969 std::cout <<
"L1Comparator::process debug "
970 <<
" (size " << data->size() <<
"," <<emul->size() <<
")"
971 <<
".\n" << std::flush;
977 else if(m_dumpMode==-1)
979 else if(m_dumpMode>0) {
995 <<
" system:" <<
SystLabel[sys] <<
"(id " << sys <<
")"
997 <<
" ndata:" << ndata
998 <<
" nemul:" << nemul
999 <<
" (size " << data->size() <<
"," <<emul->size() <<
")"
1000 <<
".\n" << std::flush;
1002 if(ndata==0&&nemul==0) {
1005 <<
"empty collections -- exiting!\n" << std::flush;
1009 m_dumpFile << std::setiosflags(std::ios::showpoint | std::ios::fixed
1010 | std::ios::right | std::ios::adjustfield);
1011 std::cout << std::setiosflags(std::ios::showpoint | std::ios::fixed
1012 | std::ios::right | std::ios::adjustfield);
1014 if(dumpEvent_ && prt ) {
1015 m_dumpFile <<
"\nEntry: " << nevt_
1016 <<
" (event:" << evtNum_
1017 <<
" | run:" << runNum_
1018 <<
")\n" << std::flush;
1023 m_dumpFile <<
"\n sys:" <<
SystLabel[sys]
1024 <<
" (" << sys <<
"), type:" << cid
1028 std::cout <<
"L1Comparator::process print:\n" << std::flush
1033 DEmatchEvt[sys] &= cmp.
do_compare(m_dumpFile,m_dumpMode);
1039 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1043 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1046 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1050 m_dedigis.insert(m_dedigis.end(), dg.begin(), dg.end());
1051 for(
int i=0;
i<2;
i++)
1058 <<
" ndata:" << DEncand[sys][0]
1059 <<
" nemul:" << DEncand[sys][1]
1060 <<
" (size " << data->size() <<
"," <<emul->size() <<
")"
1061 <<
" ndigis:" << dg.size()
1062 <<
" agree? " << DEmatchEvt[sys]
1066 std::cout <<
"L1Comparator::process -ing system:"
1067 << sys <<
" (" <<
SystLabel[sys] <<
")...done.\n"
1078 std::cout <<
"L1Comparator -- result of GT embedded comparison.\n"
1079 <<
"L1GlobalTriggerReadoutRecord:: data and emulator agree? "
1080 << ((*data==*emul)?
"yes":
"no")
1083 m_dumpFile <<
"\n L1GlobalTriggerReadoutRecord candidates...\n";
1085 bool thematch =
true;
1087 thematch &= (*data==*emul);
1089 bool match = thematch;
1091 if(m_dumpMode==0 && match)
1098 std::auto_ptr<L1GlobalTriggerReadoutRecord>
1100 std::auto_ptr<L1GlobalTriggerReadoutRecord>
1104 m_dumpFile <<
"\tmatch stage: ";
1105 match &= (data->gtfeWord() == emul->gtfeWord() );
1106 m_dumpFile <<
" gtfeWord:" <<
match;
1107 match &= (data->gtFdlWord() == emul->gtFdlWord() );
1108 m_dumpFile <<
" gtFdlWord:" <<
match;
1109 match &= (data->muCollectionRefProd() == emul->muCollectionRefProd());
1110 m_dumpFile <<
" muCollectionRefProd:" << match <<
"\n";
1111 boost::uint16_t dt_psb_bid=0, em_psb_bid=0;
1112 size_t npsbw = (data_->gtPsbVector().size()>emul_->gtPsbVector().size())?
1113 emul_->gtPsbVector().size():data_->gtPsbVector().size();
1114 for(
int idx=0; idx<(int)npsbw; idx++) {
1115 if(data_->gtPsbVector().at(idx) != emul_->gtPsbVector().at(idx) ) {
1117 dt_psb_bid = data_->gtPsbVector().at(idx).boardId();
1118 em_psb_bid = emul_->gtPsbVector().at(idx).boardId();
1122 match &= (data->gtPsbWord(dt_psb_bid) == emul->gtPsbWord(em_psb_bid) );
1130 m_dumpFile <<
" gtPsbWord("<<dt_psb_bid<<
","<<em_psb_bid<<
"):" << match <<
"\n";
1135 m_dumpFile <<
"\n\tGlobal decision: "
1136 << data->decision() <<
" (data) "
1137 << emul->decision() <<
" (emul) "
1141 m_dumpFile <<
"\n\tDecisionWord (bits: 63:0, 127:64)";
1143 std::vector<bool> data_gtword = data->decisionWord();
1144 std::vector<bool> emul_gtword = emul->decisionWord();
1145 m_dumpFile <<
"\n\tdata: ";
1146 for(
int i=0;
i<nbitword;
i++) {
1147 if (
i%16==0) m_dumpFile <<
" ";
1148 m_dumpFile << (data_gtword.at(nbitword-1-
i) ?
'1' :
'0');
1150 m_dumpFile <<
"\n\t ";
1151 for(
int i=0;
i<nbitword;
i++) {
1152 if (
i%16==0) m_dumpFile <<
" ";
1153 m_dumpFile << (data_gtword.at(nbitword*2-1-
i) ?
'1' :
'0');
1155 m_dumpFile <<
"\n\temul: ";
1156 for(
int i=0;
i<nbitword;
i++) {
1157 if (
i%16==0) m_dumpFile <<
" ";
1158 m_dumpFile << (emul_gtword.at(nbitword-1-
i) ?
'1' :
'0');
1160 m_dumpFile <<
"\n\t ";
1161 for(
int i=0;
i<nbitword;
i++) {
1162 if (
i%16==0) m_dumpFile <<
" ";
1163 m_dumpFile << (emul_gtword.at(nbitword*2-1-
i) ?
'1' :
'0');
1165 m_dumpFile << std::endl;
1167 m_dumpFile <<
"\n\tDecisionWordExtended (bits: 0:63)";
1168 std::vector<bool> data_decwext = data->gtFdlWord().gtDecisionWordExtended();
1169 std::vector<bool> emul_decwext = emul->gtFdlWord().gtDecisionWordExtended();
1170 m_dumpFile <<
"\n\tdata: ";
1171 for(
int i=0;
i<nbitword;
i++) {
1172 if (
i%16==0) m_dumpFile <<
" ";
1173 m_dumpFile << (data_decwext.at(nbitword-1-
i) ?
'1' :
'0');
1175 m_dumpFile <<
"\n\temul: ";
1176 for(
int i=0;
i<nbitword;
i++) {
1177 if (
i%16==0) m_dumpFile <<
" ";
1178 m_dumpFile << (emul_decwext.at(nbitword-1-
i) ?
'1' :
'0');
1180 m_dumpFile << std::endl;
1182 m_dumpFile <<
"\n\tTechnical triggers (bits: 0:63)";
1183 std::vector<bool> data_fdlttw = data->gtFdlWord().gtTechnicalTriggerWord();
1184 std::vector<bool> emul_fdlttw = emul->gtFdlWord().gtTechnicalTriggerWord();
1185 assert((
int)data_fdlttw.size()==nbitword);
1186 m_dumpFile <<
"\n\tdata: ";
1187 for(
int i=0;
i<nbitword;
i++) {
1188 if (
i%16==0) m_dumpFile <<
" ";
1189 m_dumpFile << (data_fdlttw.at(nbitword-1-
i) ?
'1' :
'0');
1191 m_dumpFile <<
"\n\temul: ";
1192 for(
int i=0;
i<nbitword;
i++) {
1193 if (
i%16==0) m_dumpFile <<
" ";
1194 m_dumpFile << (emul_fdlttw.at(nbitword-1-
i) ?
'1' :
'0');
1196 m_dumpFile << std::endl;
1198 m_dumpFile <<
"\n\tL1GtFdlWord";
1199 m_dumpFile <<
"\n\tdata: "
1200 <<
" BoardId:" << data->gtFdlWord().boardId()
1201 <<
" BxInEvent:" << data->gtFdlWord().bxInEvent()
1202 <<
" BxNr:" << data->gtFdlWord().bxNr()
1203 <<
" EventNr:" << data->gtFdlWord().eventNr()
1204 <<
" NoAlgo:" << data->gtFdlWord().noAlgo()
1205 <<
" FinalOR:" << data->gtFdlWord().finalOR()
1206 <<
" LocalBxNr:" << data->gtFdlWord().localBxNr();
1207 m_dumpFile <<
"\n\temul: "
1208 <<
" BoardId:" << emul->gtFdlWord().boardId()
1209 <<
" BxInEvent:" << emul->gtFdlWord().bxInEvent()
1210 <<
" BxNr:" << emul->gtFdlWord().bxNr()
1211 <<
" EventNr:" << emul->gtFdlWord().eventNr()
1212 <<
" NoAlgo:" << emul->gtFdlWord().noAlgo()
1213 <<
" FinalOR:" << emul->gtFdlWord().finalOR()
1214 <<
" LocalBxNr:" << emul->gtFdlWord().localBxNr()
1217 m_dumpFile <<
"\n\tL1GtfeWord";
1218 m_dumpFile <<
"\n\tdata: "
1219 <<
" BoardId:" << data->gtfeWord().boardId()
1220 <<
" RecordLength:" << data->gtfeWord().recordLength()
1221 <<
" BxNr:" << data->gtfeWord().bxNr()
1222 <<
" SetupVersion:" << data->gtfeWord().setupVersion()
1223 <<
" ActiveBoards:" << data->gtfeWord().activeBoards()
1224 <<
" TotalTriggerNr:" << data->gtfeWord().totalTriggerNr();
1225 m_dumpFile <<
"\n\temul: "
1226 <<
" BoardId:" << emul->gtfeWord().boardId()
1227 <<
" RecordLength:" << emul->gtfeWord().recordLength()
1228 <<
" BxNr:" << emul->gtfeWord().bxNr()
1229 <<
" SetupVersion:" << emul->gtfeWord().setupVersion()
1230 <<
" ActiveBoards:" << emul->gtfeWord().activeBoards()
1231 <<
" TotalTriggerNr:" << emul->gtfeWord().totalTriggerNr()
1235 m_dumpFile <<
"\n\tgtPsbWord";
1236 m_dumpFile <<
"\n\tdata: "
1237 <<
" Board Id:" << data->gtPsbWord(dt_psb_bid).boardId()
1238 <<
" BxInEvent:" << data->gtPsbWord(dt_psb_bid).bxInEvent()
1239 <<
" BxNr:" << data->gtPsbWord(dt_psb_bid).bxNr()
1240 <<
" LocalBxNr:" << data->gtPsbWord(dt_psb_bid).localBxNr()
1241 <<
" EventNr:" << data->gtPsbWord(dt_psb_bid).eventNr();
1242 m_dumpFile <<
"\n\temul: "
1243 <<
" Board Id:" << emul->gtPsbWord(em_psb_bid).boardId()
1244 <<
" BxInEvent:" << emul->gtPsbWord(em_psb_bid).bxInEvent()
1245 <<
" BxNr:" << emul->gtPsbWord(em_psb_bid).bxNr()
1246 <<
" LocalBxNr:" << emul->gtPsbWord(em_psb_bid).localBxNr()
1247 <<
" EventNr:" << emul->gtPsbWord(em_psb_bid).eventNr()
1254 m_dumpFile <<
"\n\tA_Data_CH7:0";
1255 m_dumpFile <<
"\n\tdata: ";
1256 for (
int i=0;
i<8; ++
i)
1257 m_dumpFile << data->gtPsbWord(dt_psb_bid).aData(7-
i) <<
" ";
1258 m_dumpFile <<
"\n\temul: ";
1259 for (
int i=0;
i<8; ++
i)
1260 m_dumpFile << emul->gtPsbWord(em_psb_bid).aData(7-
i) <<
" ";
1261 m_dumpFile << std::endl;
1263 m_dumpFile <<
"\n\tA_Data_CH7:0";
1264 m_dumpFile <<
"\n\tdata: ";
1265 for (
int i=0;
i<8; ++
i)
1266 m_dumpFile << data->gtPsbWord(dt_psb_bid).bData(7-
i) <<
" ";
1267 m_dumpFile <<
"\n\temul: ";
1268 for (
int i=0;
i<8; ++
i)
1269 m_dumpFile << emul->gtPsbWord(em_psb_bid).bData(7-
i) <<
" ";
1270 m_dumpFile <<
"\n" << std::endl;
1277 m_dumpFile <<
"---debug: print full gt record---";
1278 m_dumpFile <<
"\n\tdata: ";
1279 data->print(m_dumpFile);
1280 m_dumpFile <<
"\n\temul: ";
1281 emul->print(m_dumpFile);
1283 m_dumpFile <<
"---debug: print full gt record Done.---\n\n";
1287 if(match) sprintf(ok,
"successful");
1288 else sprintf(ok,
"failed");
1289 m_dumpFile <<
" ...L1GlobalTriggerReadoutRecord data and emulator comparison: "
1301 std::cout <<
"L1Comparator -- result of GT embedded comparison.\n"
1302 <<
"L1GlobalTriggerEvmReadoutRecord data and emulator agree? "
1303 << ((*data==*emul)?
"yes":
"no")
1306 m_dumpFile <<
"\n L1GlobalTriggerEvmReadoutRecord candidates...\n";
1309 match &= (*data==*emul);
1311 if(m_dumpMode==0 && match)
1315 m_dumpFile <<
"\n\tGlobal decision: "
1316 << data->decision() <<
" (data) "
1317 << emul->decision() <<
" (emul) "
1321 m_dumpFile <<
"\n\tDecisionWord (bits: 0:63, 127:64)";
1323 std::vector<bool> data_gtword = data->decisionWord();
1324 std::vector<bool> emul_gtword = emul->decisionWord();
1325 m_dumpFile <<
"\n\tdata: ";
1326 for(
int i=0;
i<nbitword;
i++) {
1327 if (
i%16==0) m_dumpFile <<
" ";
1328 m_dumpFile << (data_gtword.at(nbitword-1-
i) ?
'1' :
'0');
1330 m_dumpFile <<
"\n\t ";
1331 for(
int i=0;
i<nbitword;
i++) {
1332 if (
i%16==0) m_dumpFile <<
" ";
1333 m_dumpFile << (data_gtword.at(nbitword*2-1-
i) ?
'1' :
'0');
1335 m_dumpFile <<
"\n\temul: ";
1336 for(
int i=0;
i<nbitword;
i++) {
1337 if (
i%16==0) m_dumpFile <<
" ";
1338 m_dumpFile << (emul_gtword.at(nbitword-1-
i) ?
'1' :
'0');
1340 m_dumpFile <<
"\n\t ";
1341 for(
int i=0;
i<nbitword;
i++) {
1342 if (
i%16==0) m_dumpFile <<
" ";
1343 m_dumpFile << (emul_gtword.at(nbitword*2-1-
i) ?
'1' :
'0');
1345 m_dumpFile << std::endl;
1347 m_dumpFile <<
"\n\tDecisionWordExtended (bits: 0:63)";
1348 std::vector<bool> data_decwext = data->gtFdlWord().gtDecisionWordExtended();
1349 std::vector<bool> emul_decwext = emul->gtFdlWord().gtDecisionWordExtended();
1350 m_dumpFile <<
"\n\tdata: ";
1351 for(
int i=0;
i<nbitword;
i++) {
1352 if (
i%16==0) m_dumpFile <<
" ";
1353 m_dumpFile << (data_decwext.at(nbitword-1-
i) ?
'1' :
'0');
1355 m_dumpFile <<
"\n\temul: ";
1356 for(
int i=0;
i<nbitword;
i++) {
1357 if (
i%16==0) m_dumpFile <<
" ";
1358 m_dumpFile << (emul_decwext.at(nbitword-1-
i) ?
'1' :
'0');
1360 m_dumpFile << std::endl;
1362 m_dumpFile <<
"\n\tTechnical triggers (bits: 0:63)";
1363 std::vector<bool> data_fdlttw = data->gtFdlWord().gtTechnicalTriggerWord();
1364 std::vector<bool> emul_fdlttw = emul->gtFdlWord().gtTechnicalTriggerWord();
1365 assert((
int)data_fdlttw.size()==nbitword);
1366 m_dumpFile <<
"\n\tdata: ";
1367 for(
int i=0;
i<nbitword;
i++) {
1368 if (
i%16==0) m_dumpFile <<
" ";
1369 m_dumpFile << (data_fdlttw.at(nbitword-1-
i) ?
'1' :
'0');
1371 m_dumpFile <<
"\n\temul: ";
1372 for(
int i=0;
i<nbitword;
i++) {
1373 if (
i%16==0) m_dumpFile <<
" ";
1374 m_dumpFile << (emul_fdlttw.at(nbitword-1-
i) ?
'1' :
'0');
1376 m_dumpFile << std::endl;
1378 m_dumpFile <<
"\n\tL1GtFdlWord";
1379 m_dumpFile <<
"\n\tdata: "
1380 <<
" BoardId:" << data->gtFdlWord().boardId()
1381 <<
" BxInEvent:" << data->gtFdlWord().bxInEvent()
1382 <<
" BxNr:" << data->gtFdlWord().bxNr()
1383 <<
" EventNr:" << data->gtFdlWord().eventNr()
1384 <<
" NoAlgo:" << data->gtFdlWord().noAlgo()
1385 <<
" FinalOR:" << data->gtFdlWord().finalOR()
1386 <<
" LocalBxNr:" << data->gtFdlWord().localBxNr();
1387 m_dumpFile <<
"\n\temul: "
1388 <<
" BoardId:" << emul->gtFdlWord().boardId()
1389 <<
" BxInEvent:" << emul->gtFdlWord().bxInEvent()
1390 <<
" BxNr:" << emul->gtFdlWord().bxNr()
1391 <<
" EventNr:" << emul->gtFdlWord().eventNr()
1392 <<
" NoAlgo:" << emul->gtFdlWord().noAlgo()
1393 <<
" FinalOR:" << emul->gtFdlWord().finalOR()
1394 <<
" LocalBxNr:" << emul->gtFdlWord().localBxNr()
1397 m_dumpFile <<
"\n\tL1GtfeWord";
1398 m_dumpFile <<
"\n\tdata: "
1399 <<
" BoardId:" << data->gtfeWord().boardId()
1400 <<
" RecordLength:" << data->gtfeWord().recordLength()
1401 <<
" BxNr:" << data->gtfeWord().bxNr()
1402 <<
" SetupVersion:" << data->gtfeWord().setupVersion()
1403 <<
" ActiveBoards:" << data->gtfeWord().activeBoards()
1404 <<
" TotalTriggerNr:" << data->gtfeWord().totalTriggerNr();
1405 m_dumpFile <<
"\n\temul: "
1406 <<
" BoardId:" << emul->gtfeWord().boardId()
1407 <<
" RecordLength:" << emul->gtfeWord().recordLength()
1408 <<
" BxNr:" << emul->gtfeWord().bxNr()
1409 <<
" SetupVersion:" << emul->gtfeWord().setupVersion()
1410 <<
" ActiveBoards:" << emul->gtfeWord().activeBoards()
1411 <<
" TotalTriggerNr:" << emul->gtfeWord().totalTriggerNr()
1415 m_dumpFile <<
"\n\ttcsWord";
1416 m_dumpFile <<
"\n\tdata:"
1417 <<
" DaqNr:" << data->tcsWord().daqNr()
1418 <<
" TriggerType:" << data->tcsWord().triggerType()
1419 <<
" Status:" << data->tcsWord().status()
1420 <<
" BxNr:" << data->tcsWord().bxNr()
1421 <<
" PartTrigNr:" << data->tcsWord().partTrigNr()
1422 <<
" EventNr:" << data->tcsWord().eventNr() <<
"\n\t"
1423 <<
" AssignedPartitions:" << data->tcsWord().assignedPartitions()
1424 <<
" PartRunNr:" << data->tcsWord().partTrigNr()
1425 <<
" OrbitNr:" << data->tcsWord().orbitNr();
1426 m_dumpFile <<
"\n\temul:"
1427 <<
" DaqNr:" << emul->tcsWord().daqNr()
1428 <<
" TriggerType:" << emul->tcsWord().triggerType()
1429 <<
" Status:" << emul->tcsWord().status()
1430 <<
" BxNr:" << emul->tcsWord().bxNr()
1431 <<
" PartTrigNr:" << emul->tcsWord().partTrigNr()
1432 <<
" EventNr:" << emul->tcsWord().eventNr() <<
"\n\t"
1433 <<
" AssignedPartitions:" << emul->tcsWord().assignedPartitions()
1434 <<
" PartRunNr:" << emul->tcsWord().partTrigNr()
1435 <<
" OrbitNr:" << emul->tcsWord().orbitNr()
1436 <<
"\n" << std::endl;
1439 if(match) sprintf(ok,
"successful");
1440 else sprintf(ok,
"failed");
1441 m_dumpFile <<
" ...L1GlobalTriggerEvmReadoutRecord data and emulator comparison: "
1452 m_dumpFile <<
"\n L1GlobalTriggerObjectMapRecord candidates...\n";
1457 const std::vector<L1GlobalTriggerObjectMap>& data_ovec = data->gtObjectMap();
1458 const std::vector<L1GlobalTriggerObjectMap>& emul_ovec = emul->gtObjectMap();
1461 match &= ( data_ovec.at(idx).algoName() == emul_ovec.at(idx).algoName() );
1462 match &= ( data_ovec.at(idx).algoBitNumber() == emul_ovec.at(idx).algoBitNumber() );
1463 match &= ( data_ovec.at(idx).algoGtlResult() == emul_ovec.at(idx).algoGtlResult() );
1464 match &= ( data_ovec.at(idx).combinationVector() == emul_ovec.at(idx).combinationVector() );
1465 match &= ( data_ovec.at(idx).operandTokenVector().size()==emul_ovec.at(idx).operandTokenVector().size());
1468 match &= ( data_ovec.at(idx).operandTokenVector().at(
i).tokenName ==
1469 emul_ovec.at(idx).operandTokenVector().at(
i).tokenName );
1470 match &= ( data_ovec.at(idx).operandTokenVector().at(
i).tokenNumber ==
1471 emul_ovec.at(idx).operandTokenVector().at(
i).tokenNumber );
1472 match &= ( data_ovec.at(idx).operandTokenVector().at(
i).tokenResult ==
1473 emul_ovec.at(idx).operandTokenVector().at(
i).tokenResult );
1478 if(m_dumpMode==0 && match)
1483 m_dumpFile <<
"\n\tL1GlobalTriggerObjectMap";
1484 m_dumpFile <<
"\n\tdata: "
1485 <<
" algorithmName:" << data_ovec.at(idx).algoName()
1486 <<
" Bitnumber:" << data_ovec.at(idx).algoBitNumber()
1487 <<
" GTLresult:" << data_ovec.at(idx).algoGtlResult()
1488 <<
" combinationVectorSize:" << data_ovec.at(idx).combinationVector().size()
1489 <<
" operandTokenVector:" << data_ovec.at(idx).operandTokenVector().size();
1490 m_dumpFile <<
"\n\temul: "
1491 <<
" algorithmName:" << emul_ovec.at(idx).algoName()
1492 <<
" Bitnumber:" << emul_ovec.at(idx).algoBitNumber()
1493 <<
" GTLresult:" << emul_ovec.at(idx).algoGtlResult()
1494 <<
" combinationVectorSize:" << emul_ovec.at(idx).combinationVector().size()
1495 <<
" operandTokenVector:" << emul_ovec.at(idx).operandTokenVector().size()
1496 <<
"\n" << std::endl;
1499 if(match) sprintf(ok,
"successful");
1500 else sprintf(ok,
"failed");
1501 m_dumpFile <<
" ...L1GlobalTriggerObjectMapRecord data and emulator comparison: "
1512 std::cout <<
"[L1Comparator] fedraw start processing :" << std::endl << std::flush;
1514 m_dumpFile <<
"\nEvent: " << nevt_ << std::endl;
1517 m_dumpFile <<
"\n FEDRawData candidates...\n";
1518 const FEDRawData& raw_fed_data = data->FEDData(fedId);
1519 const FEDRawData& raw_fed_emul = emul->FEDData(fedId);
1520 bool raw_match=
true;
1521 for(
int i=0;
i!=(int)raw_fed_data.
size();
i++) {
1522 raw_match &= ( raw_fed_data.
data()[
i] == raw_fed_emul.
data()[
i] );
1524 unsigned long dd = 0, de = 0;
1525 for(
int i=0;
i<(int)raw_fed_data.
size()/4;
i++) {
1527 for(
int j=0;
j<4;
j++)
1528 dd += ((raw_fed_data.
data()[
i*4+
j]&0xff)<<(8*
j));
1529 for(
int j=0;
j<4;
j++)
1530 de += ((raw_fed_emul.
data()[
i*4+
j]&0xff)<<(8*
j));
1531 if(m_dumpMode==-1 || (m_dumpMode==1 && dd!=de) ) {
1532 m_dumpFile <<
"\n\tdata: " << std::setw(8) << std::setfill(
'0') << std::hex <<
dd;
1533 m_dumpFile <<
"\n\temul: " << std::setw(8) << std::setfill(
'0') << std::hex << de;
1535 m_dumpFile << std::endl;
1538 if(raw_match) sprintf(ok,
"successful");
1539 else sprintf(ok,
"failed");
1540 m_dumpFile <<
" ...FEDRawData data and emulator comparison: "
1545 template <
class myCol>
1549 typedef typename myCol::iterator col_it;
1550 col_sz ndata = data->size();
1551 col_sz nemul = emul->size();
1554 m_dumpFile <<
" #cand mismatch!"
1555 <<
"\tdata: " << ndata
1556 <<
"\temul: " << nemul
1559 col_it itd = data ->
begin();
1560 col_it itm = emul ->
begin();
1561 for (col_sz
i=0;
i<ndata;
i++) {
1562 match &= dumpCandidate(*itd++,*itm++, m_dumpFile);
1572 s<<em<<std::endl<<std::endl;
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< CSCALCTDigi > CSCALCTDigiCollection_
L1Comparator(const edm::ParameterSet &)
std::string print(col_cit it) const
virtual void beginJob(void)
void clear()
clear this ALCT
int get_ncand(typeT) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< L1DataEmulDigi > L1DEDigiCollection
size_t size() const
Lenght of the data buffer in bytes.
virtual void produce(edm::Event &, const edm::EventSetup &)
L1DEDigiCollection getDEDigis() const
void setPhiValue(float phiVal)
Setters for physical values.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< CSCCLCTDigi > CSCCLCTDigiCollection_
std::vector< L1CSCSPStatusDigi > L1CSCSPStatusDigiCollection_
bool do_compare(std::ofstream &, int)
bool compareCollections(edm::Handle< L1GlobalTriggerReadoutRecord > data, edm::Handle< L1GlobalTriggerReadoutRecord > emul)
std::string GetName(int i=0) const
std::vector< L1MuDTChambThDigi > L1MuDTChambThDigiCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
bool compareFedRawCollections(edm::Handle< FEDRawDataCollection > data, edm::Handle< FEDRawDataCollection > emul, int fedid)
virtual void beginRun(edm::Run &, const edm::EventSetup &)
std::vector< L1MuDTChambPhDigi > L1MuDTChambPhDigiCollection
std::vector< CSCCorrelatedLCTDigi > CSCCorrelatedLCTDigiCollection_
std::vector< DigiType >::const_iterator const_iterator
T const * product() const
const std::string SystLabel[DEnsys]
std::vector< std::vector< double > > tmp
bool dumpCandidate(const T &dt, const T &em, std::ostream &s)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void clear()
clear this CLCT
std::pair< const_iterator, const_iterator > Range
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
bool CompareCollections(edm::Handle< T > data, edm::Handle< T > emul)
std::vector< L1MuGMTCand > L1MuGMTCandCollection
void process(T const *, T const *, const int, const int)