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;
555 iEvent.
getByLabel(m_DEsource[CTF][2],ctf_trk_data_);
556 iEvent.
getByLabel(m_DEsource[CTF][3],ctf_trk_emul_);
558 iEvent.
getByLabel(m_DEsource[CTF][0],ctf_data);
559 iEvent.
getByLabel(m_DEsource[CTF][1],ctf_emul);
561 iEvent.
getByLabel(m_DEsource[CTF][0].
label(),
"MuonL1CSCStatusDigiCollection",ctf_sta_data_);
562 iEvent.
getByLabel(m_DEsource[CTF][1].
label(),
"MuonL1CSCStatusDigiCollection",ctf_sta_emul_);
566 ctf_sta_data = &(ctf_sta_data_->second);
569 ctf_sta_emul = &(ctf_sta_emul_->second);
577 typedef L1CSCTrackCollection::const_iterator ctcIt;
580 for(ctcIt tcit=ctf_trk_data_->begin(); tcit!=ctf_trk_data_->end(); tcit++) {
582 if((tcit->first.bx() < -1) || (tcit->first.bx() > 1))
588 ctf_trc_data_v.push_back(
L1MuRegionalCand(tcit->first.getDataWord(), tcit->first.bx()));
592 for (mapIt mit = ldc.begin(); mit != ldc.end(); mit++)
597 for (vecIt vit = ldc.get((*mit).first).first;
598 vit != ldc.get((*mit).first).second; vit++)
599 ctf_trk_data_v.push_back(*vit);
606 for(ctcIt tcit=ctf_trk_emul_->begin();tcit!=ctf_trk_emul_->end(); tcit++) {
607 if((tcit->first.bx() < -1) || (tcit->first.bx() > 1))
609 ctf_trc_emul_v.push_back(
L1MuRegionalCand(tcit->first.getDataWord(), tcit->first.bx()));
611 for (mapIt mit = ldc.begin(); mit != ldc.end(); mit++)
612 for (vecIt vit = ldc.get((*mit).first).first;
613 vit != ldc.get((*mit).first).second; vit++)
614 ctf_trk_emul_v.push_back(*vit);
617 ctf_trk_emul = &ctf_trk_emul_v;
638 iEvent.
getByLabel(m_DEsource[LTC][0],ltc_data);
639 iEvent.
getByLabel(m_DEsource[LTC][1],ltc_emul);
653 iEvent.
getByLabel(m_DEsource[GMT][0], gmt_data);
654 iEvent.
getByLabel(m_DEsource[GMT][1], gmt_emul);
655 iEvent.
getByLabel(m_DEsource[GMT][0], gmt_rdt_data_);
656 iEvent.
getByLabel(m_DEsource[GMT][1], gmt_rdt_emul_);
660 gmt_can_data_vec.clear(); gmt_can_emul_vec.clear();
661 gmt_rdt_data_vec.clear(); gmt_rdt_emul_vec.clear();
663 typedef std::vector<L1MuGMTReadoutRecord>::const_iterator GmtRrIt;
665 std::vector<L1MuGMTReadoutRecord> gmt_rdt_data_bx = gmt_rdt_data_->getRecords();
666 for(GmtRrIt igmtrr=gmt_rdt_data_bx.begin(); igmtrr!=gmt_rdt_data_bx.end(); igmtrr++) {
668 typedef std::vector<L1MuGMTExtendedCand>::const_iterator GmtECIt;
669 std::vector<L1MuGMTExtendedCand> gmc;
670 gmc = igmtrr->getGMTCands();
671 for(GmtECIt iter1=gmc.begin(); iter1!=gmc.end(); iter1++) {
672 L1MuGMTCand cand(iter1->getDataWord(),iter1->bx());
674 cand.setEtaValue(iter1->etaValue());
675 cand.setPtValue (iter1->ptValue ());
676 gmt_can_data_vec.push_back(cand);
679 typedef L1MuRegionalCandCollection::const_iterator GmtRCIt;
682 rmc = igmtrr->getDTBXCands();
683 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
685 rmc = igmtrr->getCSCCands();
686 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
688 rmc = igmtrr->getBrlRPCCands();
689 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
691 rmc = igmtrr->getFwdRPCCands();
692 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
695 std::vector<L1MuGMTReadoutRecord> gmt_rdt_emul_bx = gmt_rdt_emul_->getRecords();
696 for(GmtRrIt igmtrr=gmt_rdt_emul_bx.begin(); igmtrr!=gmt_rdt_emul_bx.end(); igmtrr++) {
698 typedef std::vector<L1MuGMTExtendedCand>::const_iterator GmtECIt;
699 std::vector<L1MuGMTExtendedCand> gmc;
700 gmc = igmtrr->getGMTCands();
701 for(GmtECIt iter1=gmc.begin(); iter1!=gmc.end(); iter1++) {
702 gmt_can_emul_vec.push_back(
L1MuGMTCand(iter1->getDataWord(),iter1->bx()));
705 typedef L1MuRegionalCandCollection::const_iterator GmtRCIt;
708 rmc = igmtrr->getDTBXCands();
709 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
711 rmc = igmtrr->getCSCCands();
712 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
714 rmc = igmtrr->getBrlRPCCands();
715 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
717 rmc = igmtrr->getFwdRPCCands();
718 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
721 gmt_rdt_data = &gmt_rdt_data_vec;
722 gmt_rdt_emul = &gmt_rdt_emul_vec;
723 gmt_can_data = &gmt_can_data_vec;
724 gmt_can_emul = &gmt_can_emul_vec;
734 iEvent.
getByLabel(m_DEsource[GLT][0], glt_rdt_data);
735 iEvent.
getByLabel(m_DEsource[GLT][1], glt_rdt_emul);
736 iEvent.
getByLabel(m_DEsource[GLT][0], glt_evm_data);
737 iEvent.
getByLabel(m_DEsource[GLT][1], glt_evm_emul);
738 iEvent.
getByLabel(m_DEsource[GLT][0], glt_obj_data);
739 iEvent.
getByLabel(m_DEsource[GLT][1], glt_obj_emul);
745 bool isValidDE[
DEnsys][2];
746 for(
int i=0;
i<
DEnsys;
i++)
for(
int j=0;
j<2;
j++) isValidDE[
i][
j]=
false;
752 isValidDE[
GCT][0] = gct_isolaem_data .
isValid(); isValidDE[
GCT][1] =gct_isolaem_emul .
isValid();
753 isValidDE[
GCT][0]&= gct_noisoem_data .
isValid(); isValidDE[
GCT][1]&=gct_noisoem_emul .
isValid();
754 isValidDE[
GCT][0]&= gct_cenjets_data .
isValid(); isValidDE[
GCT][1]&=gct_cenjets_emul .
isValid();
755 isValidDE[
GCT][0]&= gct_forjets_data .
isValid(); isValidDE[
GCT][1]&=gct_forjets_emul .
isValid();
756 isValidDE[
GCT][0]&= gct_taujets_data .
isValid(); isValidDE[
GCT][1]&=gct_taujets_emul .
isValid();
768 if (m_DEsource[CTP][0].
label().
find(
"tf") == std::string::npos) {
787 for(
int j=0;
j<2;
j++) {
788 isValid[
i] &= isValidDE[
i][
j];
793 std::cout <<
"L1Comparator sys isValid? (evt:" << nevt_ <<
") ";
810 std::cout <<
"L1Comparator start processing the collections.\n" << std::flush;
813 if(m_doSys[ETP]&&isValid[ETP]) process<EcalTrigPrimDigiCollection> ( ecal_tp_data, ecal_tp_emul,
ETP,
ECALtp);
814 if(m_doSys[HTP]&&isValid[HTP]) process<HcalTrigPrimDigiCollection> ( hcal_tp_data, hcal_tp_emul,
HTP,
HCALtp);
815 if(m_doSys[RCT]&&isValid[RCT]) process<L1CaloEmCollection> ( rct_em_data, rct_em_emul,
RCT,
RCTem);
816 if(m_doSys[RCT]&&isValid[RCT]) process<L1CaloRegionCollection> ( rct_rgn_data, rct_rgn_emul,
RCT,
RCTrgn);
817 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_isolaem_data, gct_isolaem_emul,
GCT,
GCTisolaem);
818 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_noisoem_data, gct_noisoem_emul,
GCT,
GCTnoisoem);
819 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_cenjets_data, gct_cenjets_emul,
GCT,
GCTcenjets);
820 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_forjets_data, gct_forjets_emul,
GCT,
GCTforjets);
821 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_taujets_data, gct_taujets_emul,
GCT,
GCTtaujets);
822 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtHadCollection> ( gct_ht_data, gct_ht_emul,
GCT,
GCTethad);
823 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtMissCollection> ( gct_etmiss_data, gct_etmiss_emul,
GCT,
GCTetmiss);
824 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtTotalCollection> ( gct_ettota_data , gct_ettota_emul,
GCT,
GCTettot);
825 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHtMissCollection> ( gct_htmiss_data, gct_htmiss_emul,
GCT,
GCThtmiss);
826 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFRingEtSumsCollection> ( gct_hfring_data, gct_hfring_emul,
GCT,
GCThfring);
827 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFBitCountsCollection> ( gct_hfbcnt_data, gct_hfbcnt_emul,
GCT,
GCThfbit);
829 if(m_doSys[DTP]&&isValid[DTP]) process<L1MuDTChambPhDigiCollection> ( dtp_ph_data, dtp_ph_emul,
DTP,
DTtpPh);
830 if(m_doSys[DTP]&&isValid[DTP]) process<L1MuDTChambThDigiCollection> ( dtp_th_data, dtp_th_emul,
DTP,
DTtpTh);
831 if(m_doSys[DTF]&&isValid[DTF]) process<L1MuRegionalCandCollection> ( dtf_data, dtf_emul,
DTF,
DTtf);
832 if(m_doSys[DTF]&&isValid[DTF]) process<L1MuRegionalCandCollection> ( dtf_trk_data, dtf_trk_emul,
DTF,
DTtftrk);
833 if(m_DEsource[CTP][0].
label().find(
"tf") == std::string::npos) {
834 if(m_doSys[CTP]&&isValid[CTP]) process<CSCALCTDigiCollection_> ( ctp_ano_data, ctp_ano_emul,
CTP,
CSCtpa);
835 if(m_doSys[CTP]&&isValid[CTP]) process<CSCCLCTDigiCollection_> ( ctp_cat_data, ctp_cat_emul,
CTP,
CSCtpc);
837 if(m_doSys[CTP]&&isValid[CTP]) process<CSCCorrelatedLCTDigiCollection_>( ctp_lct_data, ctp_lct_emul,
CTP,
CSCtpl);
838 if(m_doSys[CTF]&&isValid[CTF]) process<L1MuRegionalCandCollection> ( ctf_data, ctf_emul,
CTF,
CSCtf);
839 if(m_doSys[CTF]&&isValid[CTF]) process<CSCCorrelatedLCTDigiCollection_>( ctf_trk_data, ctf_trk_emul,
CTF,
CSCtftrk);
841 if(m_doSys[CTF]&&isValid[CTF]) process<L1CSCSPStatusDigiCollection_> ( ctf_sta_data, ctf_sta_emul,
CTF,
CSCtfsta);
842 if(m_doSys[RPC]&&isValid[RPC]) process<L1MuRegionalCandCollection> ( rpc_cen_data, rpc_cen_emul,
RPC,
RPCcen);
843 if(m_doSys[RPC]&&isValid[RPC]) process<L1MuRegionalCandCollection> ( rpc_for_data, rpc_for_emul,
RPC,
RPCfor);
844 if(m_doSys[LTC]&&isValid[LTC]) process<LTCDigiCollection> ( ltc_data, ltc_emul,
LTC,
LTCi);
845 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuGMTCandCollection> ( gmt_data, gmt_emul,
GMT,
GMTmain);
846 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuRegionalCandCollection> ( gmt_rdt_data, gmt_rdt_emul,
GMT,
GMTrdt);
847 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuGMTCandCollection> ( gmt_can_data, gmt_can_emul,
GMT,
GMTcnd);
852 if(m_doSys[GLT] && isValid[GLT] ) {
858 else if(m_dumpMode==-1)
861 if(dumpEvent_ && prt) {
862 m_dumpFile <<
"\nEntry: " << nevt_
863 <<
" (event:" << evtNum_
864 <<
" | run:" << runNum_
865 <<
")\n" << std::flush;
869 m_dumpFile <<
"\n GT...\n";
875 std::vector<bool> gltDecBits[2], gltTchBits[2];
876 globalDBit[0] = glt_rdt_data->decision();
877 globalDBit[1] = glt_rdt_emul->decision();
878 gltDecBits[0] = glt_rdt_data->decisionWord();
879 gltDecBits[1] = glt_rdt_emul->decisionWord();
882 gltTchBits[0] = glt_rdt_data->technicalTriggerWord();
883 gltTchBits[1] = glt_rdt_emul->technicalTriggerWord();
884 gltdigimon.set(globalDBit, gltDecBits, gltTchBits);
886 DEncand[
GLT][0]=1; DEncand[
GLT][1]=1;
887 DEmatchEvt[
GLT] = compareCollections(glt_rdt_data, glt_rdt_emul);
892 DEmatchEvt[GLT] &= compareCollections(glt_evm_data, glt_evm_emul);
894 DEmatchEvt[GLT] &= compareCollections(glt_obj_data, glt_obj_emul);
897 char dumptofile[1000];
898 if(DEmatchEvt[GLT]) sprintf(ok,
"successful");
899 else sprintf(ok,
"failed");
900 sprintf(dumptofile,
" ...GT data and emulator comparison: %s\n", ok);
901 m_dumpFile<<dumptofile;
905 std::cout <<
"L1Comparator done processing all collections.\n" << std::flush;
908 std::cout <<
"[L1Comparator] sys match? << evt." << nevt_ <<
": ";
917 bool evt_match =
true;
919 evt_match &= DEmatchEvt[
i];
931 m_match &= evt_match;
932 m_dumpFile << std::flush;
935 if(m_dedigis.size()==0) {
937 std::cout <<
"\n [L1Comparator] adding empty collection to DErecord\n";
942 std::auto_ptr<L1DataEmulRecord>
record
943 (
new L1DataEmulRecord(evt_match,m_doSys,DEmatchEvt,DEncand,m_dedigis, gltdigimon));
945 std::cout <<
"\n [L1Comparator] printing DErecord"
947 <<
"|evt:" << evtNum_
948 <<
"|run:" << runNum_
949 <<
"):\n" << std::flush;
951 <<
"\n" << std::flush;
957 bool dorawdata =
false;
961 iEvent.
getByLabel(m_FEDsource[0], raw_fedcoll_data);
962 iEvent.
getByLabel(m_FEDsource[1], raw_fedcoll_emul);
964 rawval &= raw_fedcoll_data.
isValid();
965 rawval &= raw_fedcoll_emul.
isValid();
967 compareFedRawCollections(raw_fedcoll_data,raw_fedcoll_emul, m_fedId);
971 std::cout <<
"L1comparator::analize() end. " << nevt_ << std::endl;
980 std::cout <<
"L1Comparator::process -ing system:" << sys
981 <<
" (" <<
SystLabel[sys] <<
"), data type " << cid
982 <<
"...\n" << std::flush;
984 std::cout <<
"L1Comparator::process debug "
985 <<
" (size " << data->size() <<
"," <<emul->size() <<
")"
986 <<
".\n" << std::flush;
992 else if(m_dumpMode==-1)
994 else if(m_dumpMode>0) {
1010 <<
" system:" <<
SystLabel[sys] <<
"(id " << sys <<
")"
1012 <<
" ndata:" << ndata
1013 <<
" nemul:" << nemul
1014 <<
" (size " << data->size() <<
"," <<emul->size() <<
")"
1015 <<
".\n" << std::flush;
1017 if(ndata==0&&nemul==0) {
1020 <<
"empty collections -- exiting!\n" << std::flush;
1024 m_dumpFile << std::setiosflags(std::ios::showpoint | std::ios::fixed
1025 | std::ios::right | std::ios::adjustfield);
1026 std::cout << std::setiosflags(std::ios::showpoint | std::ios::fixed
1027 | std::ios::right | std::ios::adjustfield);
1029 if(dumpEvent_ && prt ) {
1030 m_dumpFile <<
"\nEntry: " << nevt_
1031 <<
" (event:" << evtNum_
1032 <<
" | run:" << runNum_
1033 <<
")\n" << std::flush;
1038 m_dumpFile <<
"\n sys:" <<
SystLabel[sys]
1039 <<
" (" << sys <<
"), type:" << cid
1043 std::cout <<
"L1Comparator::process print:\n" << std::flush
1048 DEmatchEvt[sys] &= cmp.
do_compare(m_dumpFile,m_dumpMode);
1054 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1058 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1061 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1065 m_dedigis.insert(m_dedigis.end(), dg.begin(), dg.end());
1066 for(
int i=0;
i<2;
i++)
1073 <<
" ndata:" << DEncand[sys][0]
1074 <<
" nemul:" << DEncand[sys][1]
1075 <<
" (size " << data->size() <<
"," <<emul->size() <<
")"
1076 <<
" ndigis:" << dg.size()
1077 <<
" agree? " << DEmatchEvt[sys]
1081 std::cout <<
"L1Comparator::process -ing system:"
1082 << sys <<
" (" <<
SystLabel[sys] <<
")...done.\n"
1093 std::cout <<
"L1Comparator -- result of GT embedded comparison.\n"
1094 <<
"L1GlobalTriggerReadoutRecord:: data and emulator agree? "
1095 << ((*data==*emul)?
"yes":
"no")
1098 m_dumpFile <<
"\n L1GlobalTriggerReadoutRecord candidates...\n";
1100 bool thematch =
true;
1102 thematch &= (*data==*emul);
1104 bool match = thematch;
1106 if(m_dumpMode==0 && match)
1113 std::auto_ptr<L1GlobalTriggerReadoutRecord>
1115 std::auto_ptr<L1GlobalTriggerReadoutRecord>
1119 m_dumpFile <<
"\tmatch stage: ";
1120 match &= (data->gtfeWord() == emul->gtfeWord() );
1121 m_dumpFile <<
" gtfeWord:" <<
match;
1122 match &= (data->gtFdlWord() == emul->gtFdlWord() );
1123 m_dumpFile <<
" gtFdlWord:" <<
match;
1124 match &= (data->muCollectionRefProd() == emul->muCollectionRefProd());
1125 m_dumpFile <<
" muCollectionRefProd:" << match <<
"\n";
1126 boost::uint16_t dt_psb_bid=0, em_psb_bid=0;
1127 size_t npsbw = (data_->gtPsbVector().size()>emul_->gtPsbVector().size())?
1128 emul_->gtPsbVector().size():data_->gtPsbVector().size();
1129 for(
int idx=0; idx<(int)npsbw; idx++) {
1130 if(data_->gtPsbVector().at(idx) != emul_->gtPsbVector().at(idx) ) {
1132 dt_psb_bid = data_->gtPsbVector().at(idx).boardId();
1133 em_psb_bid = emul_->gtPsbVector().at(idx).boardId();
1137 match &= (data->gtPsbWord(dt_psb_bid) == emul->gtPsbWord(em_psb_bid) );
1145 m_dumpFile <<
" gtPsbWord("<<dt_psb_bid<<
","<<em_psb_bid<<
"):" << match <<
"\n";
1150 m_dumpFile <<
"\n\tGlobal decision: "
1151 << data->decision() <<
" (data) "
1152 << emul->decision() <<
" (emul) "
1156 m_dumpFile <<
"\n\tDecisionWord (bits: 63:0, 127:64)";
1158 std::vector<bool> data_gtword = data->decisionWord();
1159 std::vector<bool> emul_gtword = emul->decisionWord();
1160 m_dumpFile <<
"\n\tdata: ";
1161 for(
int i=0;
i<nbitword;
i++) {
1162 if (
i%16==0) m_dumpFile <<
" ";
1163 m_dumpFile << (data_gtword.at(nbitword-1-
i) ?
'1' :
'0');
1165 m_dumpFile <<
"\n\t ";
1166 for(
int i=0;
i<nbitword;
i++) {
1167 if (
i%16==0) m_dumpFile <<
" ";
1168 m_dumpFile << (data_gtword.at(nbitword*2-1-
i) ?
'1' :
'0');
1170 m_dumpFile <<
"\n\temul: ";
1171 for(
int i=0;
i<nbitword;
i++) {
1172 if (
i%16==0) m_dumpFile <<
" ";
1173 m_dumpFile << (emul_gtword.at(nbitword-1-
i) ?
'1' :
'0');
1175 m_dumpFile <<
"\n\t ";
1176 for(
int i=0;
i<nbitword;
i++) {
1177 if (
i%16==0) m_dumpFile <<
" ";
1178 m_dumpFile << (emul_gtword.at(nbitword*2-1-
i) ?
'1' :
'0');
1180 m_dumpFile << std::endl;
1182 m_dumpFile <<
"\n\tDecisionWordExtended (bits: 0:63)";
1183 std::vector<bool> data_decwext = data->gtFdlWord().gtDecisionWordExtended();
1184 std::vector<bool> emul_decwext = emul->gtFdlWord().gtDecisionWordExtended();
1185 m_dumpFile <<
"\n\tdata: ";
1186 for(
int i=0;
i<nbitword;
i++) {
1187 if (
i%16==0) m_dumpFile <<
" ";
1188 m_dumpFile << (data_decwext.at(nbitword-1-
i) ?
'1' :
'0');
1190 m_dumpFile <<
"\n\temul: ";
1191 for(
int i=0;
i<nbitword;
i++) {
1192 if (
i%16==0) m_dumpFile <<
" ";
1193 m_dumpFile << (emul_decwext.at(nbitword-1-
i) ?
'1' :
'0');
1195 m_dumpFile << std::endl;
1197 m_dumpFile <<
"\n\tTechnical triggers (bits: 0:63)";
1198 std::vector<bool> data_fdlttw = data->gtFdlWord().gtTechnicalTriggerWord();
1199 std::vector<bool> emul_fdlttw = emul->gtFdlWord().gtTechnicalTriggerWord();
1200 assert((
int)data_fdlttw.size()==nbitword);
1201 m_dumpFile <<
"\n\tdata: ";
1202 for(
int i=0;
i<nbitword;
i++) {
1203 if (
i%16==0) m_dumpFile <<
" ";
1204 m_dumpFile << (data_fdlttw.at(nbitword-1-
i) ?
'1' :
'0');
1206 m_dumpFile <<
"\n\temul: ";
1207 for(
int i=0;
i<nbitword;
i++) {
1208 if (
i%16==0) m_dumpFile <<
" ";
1209 m_dumpFile << (emul_fdlttw.at(nbitword-1-
i) ?
'1' :
'0');
1211 m_dumpFile << std::endl;
1213 m_dumpFile <<
"\n\tL1GtFdlWord";
1214 m_dumpFile <<
"\n\tdata: "
1215 <<
" BoardId:" << data->gtFdlWord().boardId()
1216 <<
" BxInEvent:" << data->gtFdlWord().bxInEvent()
1217 <<
" BxNr:" << data->gtFdlWord().bxNr()
1218 <<
" EventNr:" << data->gtFdlWord().eventNr()
1219 <<
" NoAlgo:" << data->gtFdlWord().noAlgo()
1220 <<
" FinalOR:" << data->gtFdlWord().finalOR()
1221 <<
" LocalBxNr:" << data->gtFdlWord().localBxNr();
1222 m_dumpFile <<
"\n\temul: "
1223 <<
" BoardId:" << emul->gtFdlWord().boardId()
1224 <<
" BxInEvent:" << emul->gtFdlWord().bxInEvent()
1225 <<
" BxNr:" << emul->gtFdlWord().bxNr()
1226 <<
" EventNr:" << emul->gtFdlWord().eventNr()
1227 <<
" NoAlgo:" << emul->gtFdlWord().noAlgo()
1228 <<
" FinalOR:" << emul->gtFdlWord().finalOR()
1229 <<
" LocalBxNr:" << emul->gtFdlWord().localBxNr()
1232 m_dumpFile <<
"\n\tL1GtfeWord";
1233 m_dumpFile <<
"\n\tdata: "
1234 <<
" BoardId:" << data->gtfeWord().boardId()
1235 <<
" RecordLength:" << data->gtfeWord().recordLength()
1236 <<
" BxNr:" << data->gtfeWord().bxNr()
1237 <<
" SetupVersion:" << data->gtfeWord().setupVersion()
1238 <<
" ActiveBoards:" << data->gtfeWord().activeBoards()
1239 <<
" TotalTriggerNr:" << data->gtfeWord().totalTriggerNr();
1240 m_dumpFile <<
"\n\temul: "
1241 <<
" BoardId:" << emul->gtfeWord().boardId()
1242 <<
" RecordLength:" << emul->gtfeWord().recordLength()
1243 <<
" BxNr:" << emul->gtfeWord().bxNr()
1244 <<
" SetupVersion:" << emul->gtfeWord().setupVersion()
1245 <<
" ActiveBoards:" << emul->gtfeWord().activeBoards()
1246 <<
" TotalTriggerNr:" << emul->gtfeWord().totalTriggerNr()
1250 m_dumpFile <<
"\n\tgtPsbWord";
1251 m_dumpFile <<
"\n\tdata: "
1252 <<
" Board Id:" << data->gtPsbWord(dt_psb_bid).boardId()
1253 <<
" BxInEvent:" << data->gtPsbWord(dt_psb_bid).bxInEvent()
1254 <<
" BxNr:" << data->gtPsbWord(dt_psb_bid).bxNr()
1255 <<
" LocalBxNr:" << data->gtPsbWord(dt_psb_bid).localBxNr()
1256 <<
" EventNr:" << data->gtPsbWord(dt_psb_bid).eventNr();
1257 m_dumpFile <<
"\n\temul: "
1258 <<
" Board Id:" << emul->gtPsbWord(em_psb_bid).boardId()
1259 <<
" BxInEvent:" << emul->gtPsbWord(em_psb_bid).bxInEvent()
1260 <<
" BxNr:" << emul->gtPsbWord(em_psb_bid).bxNr()
1261 <<
" LocalBxNr:" << emul->gtPsbWord(em_psb_bid).localBxNr()
1262 <<
" EventNr:" << emul->gtPsbWord(em_psb_bid).eventNr()
1269 m_dumpFile <<
"\n\tA_Data_CH7:0";
1270 m_dumpFile <<
"\n\tdata: ";
1271 for (
int i=0;
i<8; ++
i)
1272 m_dumpFile << data->gtPsbWord(dt_psb_bid).aData(7-
i) <<
" ";
1273 m_dumpFile <<
"\n\temul: ";
1274 for (
int i=0;
i<8; ++
i)
1275 m_dumpFile << emul->gtPsbWord(em_psb_bid).aData(7-
i) <<
" ";
1276 m_dumpFile << std::endl;
1278 m_dumpFile <<
"\n\tA_Data_CH7:0";
1279 m_dumpFile <<
"\n\tdata: ";
1280 for (
int i=0;
i<8; ++
i)
1281 m_dumpFile << data->gtPsbWord(dt_psb_bid).bData(7-
i) <<
" ";
1282 m_dumpFile <<
"\n\temul: ";
1283 for (
int i=0;
i<8; ++
i)
1284 m_dumpFile << emul->gtPsbWord(em_psb_bid).bData(7-
i) <<
" ";
1285 m_dumpFile <<
"\n" << std::endl;
1292 m_dumpFile <<
"---debug: print full gt record---";
1293 m_dumpFile <<
"\n\tdata: ";
1294 data->print(m_dumpFile);
1295 m_dumpFile <<
"\n\temul: ";
1296 emul->print(m_dumpFile);
1298 m_dumpFile <<
"---debug: print full gt record Done.---\n\n";
1302 if(match) sprintf(ok,
"successful");
1303 else sprintf(ok,
"failed");
1304 m_dumpFile <<
" ...L1GlobalTriggerReadoutRecord data and emulator comparison: "
1316 std::cout <<
"L1Comparator -- result of GT embedded comparison.\n"
1317 <<
"L1GlobalTriggerEvmReadoutRecord data and emulator agree? "
1318 << ((*data==*emul)?
"yes":
"no")
1321 m_dumpFile <<
"\n L1GlobalTriggerEvmReadoutRecord candidates...\n";
1324 match &= (*data==*emul);
1326 if(m_dumpMode==0 && match)
1330 m_dumpFile <<
"\n\tGlobal decision: "
1331 << data->decision() <<
" (data) "
1332 << emul->decision() <<
" (emul) "
1336 m_dumpFile <<
"\n\tDecisionWord (bits: 0:63, 127:64)";
1338 std::vector<bool> data_gtword = data->decisionWord();
1339 std::vector<bool> emul_gtword = emul->decisionWord();
1340 m_dumpFile <<
"\n\tdata: ";
1341 for(
int i=0;
i<nbitword;
i++) {
1342 if (
i%16==0) m_dumpFile <<
" ";
1343 m_dumpFile << (data_gtword.at(nbitword-1-
i) ?
'1' :
'0');
1345 m_dumpFile <<
"\n\t ";
1346 for(
int i=0;
i<nbitword;
i++) {
1347 if (
i%16==0) m_dumpFile <<
" ";
1348 m_dumpFile << (data_gtword.at(nbitword*2-1-
i) ?
'1' :
'0');
1350 m_dumpFile <<
"\n\temul: ";
1351 for(
int i=0;
i<nbitword;
i++) {
1352 if (
i%16==0) m_dumpFile <<
" ";
1353 m_dumpFile << (emul_gtword.at(nbitword-1-
i) ?
'1' :
'0');
1355 m_dumpFile <<
"\n\t ";
1356 for(
int i=0;
i<nbitword;
i++) {
1357 if (
i%16==0) m_dumpFile <<
" ";
1358 m_dumpFile << (emul_gtword.at(nbitword*2-1-
i) ?
'1' :
'0');
1360 m_dumpFile << std::endl;
1362 m_dumpFile <<
"\n\tDecisionWordExtended (bits: 0:63)";
1363 std::vector<bool> data_decwext = data->gtFdlWord().gtDecisionWordExtended();
1364 std::vector<bool> emul_decwext = emul->gtFdlWord().gtDecisionWordExtended();
1365 m_dumpFile <<
"\n\tdata: ";
1366 for(
int i=0;
i<nbitword;
i++) {
1367 if (
i%16==0) m_dumpFile <<
" ";
1368 m_dumpFile << (data_decwext.at(nbitword-1-
i) ?
'1' :
'0');
1370 m_dumpFile <<
"\n\temul: ";
1371 for(
int i=0;
i<nbitword;
i++) {
1372 if (
i%16==0) m_dumpFile <<
" ";
1373 m_dumpFile << (emul_decwext.at(nbitword-1-
i) ?
'1' :
'0');
1375 m_dumpFile << std::endl;
1377 m_dumpFile <<
"\n\tTechnical triggers (bits: 0:63)";
1378 std::vector<bool> data_fdlttw = data->gtFdlWord().gtTechnicalTriggerWord();
1379 std::vector<bool> emul_fdlttw = emul->gtFdlWord().gtTechnicalTriggerWord();
1380 assert((
int)data_fdlttw.size()==nbitword);
1381 m_dumpFile <<
"\n\tdata: ";
1382 for(
int i=0;
i<nbitword;
i++) {
1383 if (
i%16==0) m_dumpFile <<
" ";
1384 m_dumpFile << (data_fdlttw.at(nbitword-1-
i) ?
'1' :
'0');
1386 m_dumpFile <<
"\n\temul: ";
1387 for(
int i=0;
i<nbitword;
i++) {
1388 if (
i%16==0) m_dumpFile <<
" ";
1389 m_dumpFile << (emul_fdlttw.at(nbitword-1-
i) ?
'1' :
'0');
1391 m_dumpFile << std::endl;
1393 m_dumpFile <<
"\n\tL1GtFdlWord";
1394 m_dumpFile <<
"\n\tdata: "
1395 <<
" BoardId:" << data->gtFdlWord().boardId()
1396 <<
" BxInEvent:" << data->gtFdlWord().bxInEvent()
1397 <<
" BxNr:" << data->gtFdlWord().bxNr()
1398 <<
" EventNr:" << data->gtFdlWord().eventNr()
1399 <<
" NoAlgo:" << data->gtFdlWord().noAlgo()
1400 <<
" FinalOR:" << data->gtFdlWord().finalOR()
1401 <<
" LocalBxNr:" << data->gtFdlWord().localBxNr();
1402 m_dumpFile <<
"\n\temul: "
1403 <<
" BoardId:" << emul->gtFdlWord().boardId()
1404 <<
" BxInEvent:" << emul->gtFdlWord().bxInEvent()
1405 <<
" BxNr:" << emul->gtFdlWord().bxNr()
1406 <<
" EventNr:" << emul->gtFdlWord().eventNr()
1407 <<
" NoAlgo:" << emul->gtFdlWord().noAlgo()
1408 <<
" FinalOR:" << emul->gtFdlWord().finalOR()
1409 <<
" LocalBxNr:" << emul->gtFdlWord().localBxNr()
1412 m_dumpFile <<
"\n\tL1GtfeWord";
1413 m_dumpFile <<
"\n\tdata: "
1414 <<
" BoardId:" << data->gtfeWord().boardId()
1415 <<
" RecordLength:" << data->gtfeWord().recordLength()
1416 <<
" BxNr:" << data->gtfeWord().bxNr()
1417 <<
" SetupVersion:" << data->gtfeWord().setupVersion()
1418 <<
" ActiveBoards:" << data->gtfeWord().activeBoards()
1419 <<
" TotalTriggerNr:" << data->gtfeWord().totalTriggerNr();
1420 m_dumpFile <<
"\n\temul: "
1421 <<
" BoardId:" << emul->gtfeWord().boardId()
1422 <<
" RecordLength:" << emul->gtfeWord().recordLength()
1423 <<
" BxNr:" << emul->gtfeWord().bxNr()
1424 <<
" SetupVersion:" << emul->gtfeWord().setupVersion()
1425 <<
" ActiveBoards:" << emul->gtfeWord().activeBoards()
1426 <<
" TotalTriggerNr:" << emul->gtfeWord().totalTriggerNr()
1430 m_dumpFile <<
"\n\ttcsWord";
1431 m_dumpFile <<
"\n\tdata:"
1432 <<
" DaqNr:" << data->tcsWord().daqNr()
1433 <<
" TriggerType:" << data->tcsWord().triggerType()
1434 <<
" Status:" << data->tcsWord().status()
1435 <<
" BxNr:" << data->tcsWord().bxNr()
1436 <<
" PartTrigNr:" << data->tcsWord().partTrigNr()
1437 <<
" EventNr:" << data->tcsWord().eventNr() <<
"\n\t"
1438 <<
" AssignedPartitions:" << data->tcsWord().assignedPartitions()
1439 <<
" PartRunNr:" << data->tcsWord().partTrigNr()
1440 <<
" OrbitNr:" << data->tcsWord().orbitNr();
1441 m_dumpFile <<
"\n\temul:"
1442 <<
" DaqNr:" << emul->tcsWord().daqNr()
1443 <<
" TriggerType:" << emul->tcsWord().triggerType()
1444 <<
" Status:" << emul->tcsWord().status()
1445 <<
" BxNr:" << emul->tcsWord().bxNr()
1446 <<
" PartTrigNr:" << emul->tcsWord().partTrigNr()
1447 <<
" EventNr:" << emul->tcsWord().eventNr() <<
"\n\t"
1448 <<
" AssignedPartitions:" << emul->tcsWord().assignedPartitions()
1449 <<
" PartRunNr:" << emul->tcsWord().partTrigNr()
1450 <<
" OrbitNr:" << emul->tcsWord().orbitNr()
1451 <<
"\n" << std::endl;
1454 if(match) sprintf(ok,
"successful");
1455 else sprintf(ok,
"failed");
1456 m_dumpFile <<
" ...L1GlobalTriggerEvmReadoutRecord data and emulator comparison: "
1467 m_dumpFile <<
"\n L1GlobalTriggerObjectMapRecord candidates...\n";
1472 const std::vector<L1GlobalTriggerObjectMap>& data_ovec = data->gtObjectMap();
1473 const std::vector<L1GlobalTriggerObjectMap>& emul_ovec = emul->gtObjectMap();
1476 match &= ( data_ovec.at(idx).algoName() == emul_ovec.at(idx).algoName() );
1477 match &= ( data_ovec.at(idx).algoBitNumber() == emul_ovec.at(idx).algoBitNumber() );
1478 match &= ( data_ovec.at(idx).algoGtlResult() == emul_ovec.at(idx).algoGtlResult() );
1479 match &= ( data_ovec.at(idx).combinationVector() == emul_ovec.at(idx).combinationVector() );
1480 match &= ( data_ovec.at(idx).operandTokenVector().size()==emul_ovec.at(idx).operandTokenVector().size());
1483 match &= ( data_ovec.at(idx).operandTokenVector().at(
i).tokenName ==
1484 emul_ovec.at(idx).operandTokenVector().at(
i).tokenName );
1485 match &= ( data_ovec.at(idx).operandTokenVector().at(
i).tokenNumber ==
1486 emul_ovec.at(idx).operandTokenVector().at(
i).tokenNumber );
1487 match &= ( data_ovec.at(idx).operandTokenVector().at(
i).tokenResult ==
1488 emul_ovec.at(idx).operandTokenVector().at(
i).tokenResult );
1493 if(m_dumpMode==0 && match)
1498 m_dumpFile <<
"\n\tL1GlobalTriggerObjectMap";
1499 m_dumpFile <<
"\n\tdata: "
1500 <<
" algorithmName:" << data_ovec.at(idx).algoName()
1501 <<
" Bitnumber:" << data_ovec.at(idx).algoBitNumber()
1502 <<
" GTLresult:" << data_ovec.at(idx).algoGtlResult()
1503 <<
" combinationVectorSize:" << data_ovec.at(idx).combinationVector().size()
1504 <<
" operandTokenVector:" << data_ovec.at(idx).operandTokenVector().size();
1505 m_dumpFile <<
"\n\temul: "
1506 <<
" algorithmName:" << emul_ovec.at(idx).algoName()
1507 <<
" Bitnumber:" << emul_ovec.at(idx).algoBitNumber()
1508 <<
" GTLresult:" << emul_ovec.at(idx).algoGtlResult()
1509 <<
" combinationVectorSize:" << emul_ovec.at(idx).combinationVector().size()
1510 <<
" operandTokenVector:" << emul_ovec.at(idx).operandTokenVector().size()
1511 <<
"\n" << std::endl;
1514 if(match) sprintf(ok,
"successful");
1515 else sprintf(ok,
"failed");
1516 m_dumpFile <<
" ...L1GlobalTriggerObjectMapRecord data and emulator comparison: "
1527 std::cout <<
"[L1Comparator] fedraw start processing :" << std::endl << std::flush;
1529 m_dumpFile <<
"\nEvent: " << nevt_ << std::endl;
1532 m_dumpFile <<
"\n FEDRawData candidates...\n";
1533 const FEDRawData& raw_fed_data = data->FEDData(fedId);
1534 const FEDRawData& raw_fed_emul = emul->FEDData(fedId);
1535 bool raw_match=
true;
1536 for(
int i=0;
i!=(int)raw_fed_data.
size();
i++) {
1537 raw_match &= ( raw_fed_data.
data()[
i] == raw_fed_emul.
data()[
i] );
1539 unsigned long dd = 0, de = 0;
1540 for(
int i=0;
i<(int)raw_fed_data.
size()/4;
i++) {
1542 for(
int j=0;
j<4;
j++)
1543 dd += ((raw_fed_data.
data()[
i*4+
j]&0xff)<<(8*
j));
1544 for(
int j=0;
j<4;
j++)
1545 de += ((raw_fed_emul.
data()[
i*4+
j]&0xff)<<(8*
j));
1546 if(m_dumpMode==-1 || (m_dumpMode==1 && dd!=de) ) {
1547 m_dumpFile <<
"\n\tdata: " << std::setw(8) << std::setfill(
'0') << std::hex <<
dd;
1548 m_dumpFile <<
"\n\temul: " << std::setw(8) << std::setfill(
'0') << std::hex << de;
1550 m_dumpFile << std::endl;
1553 if(raw_match) sprintf(ok,
"successful");
1554 else sprintf(ok,
"failed");
1555 m_dumpFile <<
" ...FEDRawData data and emulator comparison: "
1560 template <
class myCol>
1564 typedef typename myCol::iterator col_it;
1565 col_sz ndata = data->size();
1566 col_sz nemul = emul->size();
1569 m_dumpFile <<
" #cand mismatch!"
1570 <<
"\tdata: " << ndata
1571 <<
"\temul: " << nemul
1574 col_it itd = data ->
begin();
1575 col_it itm = emul ->
begin();
1576 for (col_sz
i=0;
i<ndata;
i++) {
1577 match &= dumpCandidate(*itd++,*itm++, m_dumpFile);
1587 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_
static PFTauRenderPlugin instance
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 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 &)
bool do_compare(std::ofstream &, int dump=0)
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)
char data[epos_bytes_allocation]
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)