9 m_stage1_layer2_ = iConfig.
getParameter<
bool>(
"stage1_layer2_");
12 std::cout <<
"\nL1COMPARATOR constructor...\n" << std::flush;
14 std::vector<unsigned int> dosys(0,
DEnsys);
18 if((
int)dosys.size()!=
DEnsys)
20 <<
"wrong selection of systems to be compared\n" 21 <<
"\t the size of the mask COMPARE_COLLS (" << dosys.size()
22 <<
") is not " <<
DEnsys << std::endl;
23 assert((
int)dosys.size()==
DEnsys);
25 for(
int isys=0; isys<
DEnsys; isys++)
26 if( dosys[isys]!=0 && dosys[isys]!=1 )
28 <<
"L1Comparator: comparison flag for system " << isys
29 <<
" is non boolean: " << dosys[isys] <<
". Exiting.\n";
32 m_doSys[
i] = dosys[
i];
40 std::cout <<
"[L1Comparator] list of systems to process: ";
48 assert(
ETP==0); assert(
HTP==1); assert(
RCT== 2); assert(
GCT== 3);
49 assert(
DTP==4); assert(
DTF==5); assert(
CTP== 6); assert(
CTF== 7);
50 assert(
RPC==8); assert(
LTC==9); assert(
GMT==10); assert(
GLT==11);
58 if(!m_dumpFile.good())
60 <<
" L1Comparator::L1Comparator() : " 61 <<
" couldn't open dump file " << m_dumpFileName.c_str() << std::endl;
69 for(
int j=0; j<2; j++)
76 produces<L1DataEmulRecord>().setBranchAlias(
"L1DataEmulRecord");
83 tokenCaloEm_[0] = consumes<L1CaloEmCollection>(tag0);
84 tokenCaloEm_[1] = consumes<L1CaloEmCollection>(tag1);
85 tokenCaloRegion_[0] = consumes<L1CaloRegionCollection>(tag0);
86 tokenCaloRegion_[1] = consumes<L1CaloRegionCollection>(tag1);
95 if(m_stage1_layer2_ ==
false) {
97 for (
int i = 0;
i < 2 ; ++
i) {
100 tokenGctEmCand_isoEm_[
i] = consumes<L1GctEmCandCollection>(
edm::InputTag(label,
"isoEm"));
101 tokenGctEmCand_nonIsoEm_[
i] = consumes<L1GctEmCandCollection>(
edm::InputTag(label,
"nonIsoEm"));
102 tokenGctJetCand_cenJets_[
i] = consumes<L1GctJetCandCollection>(
edm::InputTag(label,
"cenJets"));
103 tokenGctJetCand_forJets_[
i] = consumes<L1GctJetCandCollection>(
edm::InputTag(label,
"forJets"));
104 tokenGctJetCand_tauJets_[
i] = consumes<L1GctJetCandCollection>(
edm::InputTag(label,
"tauJets"));
105 tokenGctEtTotal_[
i] = consumes<L1GctEtTotalCollection>(
tag);
106 tokenGctEtHad_[
i] = consumes<L1GctEtHadCollection>(
tag);
107 tokenGctEtMiss_[
i] = consumes<L1GctEtMissCollection>(
tag);
108 tokenGctHFRingEtSums_[
i] = consumes<L1GctHFRingEtSumsCollection>(
tag);
109 tokenGctHFBitCounts_[
i] = consumes<L1GctHFBitCountsCollection>(
tag);
110 tokenGctHtMiss_[
i] = consumes<L1GctHtMissCollection>(
tag);
111 tokenGctJetCounts_[
i] = consumes<L1GctJetCountsCollection>(
tag);
114 if(m_stage1_layer2_ ==
true) {
115 for (
int i = 0;
i < 2 ; ++
i) {
118 tokenGctEmCand_isoEm_[
i] = consumes<L1GctEmCandCollection>(
edm::InputTag(label,
"isoEm"));
119 tokenGctEmCand_nonIsoEm_[
i] = consumes<L1GctEmCandCollection>(
edm::InputTag(label,
"nonIsoEm"));
120 tokenGctJetCand_cenJets_[
i] = consumes<L1GctJetCandCollection>(
edm::InputTag(label,
"cenJets"));
121 tokenGctJetCand_forJets_[
i] = consumes<L1GctJetCandCollection>(
edm::InputTag(label,
"forJets"));
122 tokenGctJetCand_tauJets_[
i] = consumes<L1GctJetCandCollection>(
edm::InputTag(label,
"tauJets"));
123 tokenGctJetCand_isoTauJets_[
i] = consumes<L1GctJetCandCollection>(
edm::InputTag(label,
"isoTauJets"));
124 tokenGctEtTotal_[
i] = consumes<L1GctEtTotalCollection>(
tag);
125 tokenGctEtHad_[
i] = consumes<L1GctEtHadCollection>(
tag);
126 tokenGctEtMiss_[
i] = consumes<L1GctEtMissCollection>(
tag);
127 tokenGctHFRingEtSums_[
i] = consumes<L1GctHFRingEtSumsCollection>(
tag);
128 tokenGctHFBitCounts_[
i] = consumes<L1GctHFBitCountsCollection>(
tag);
129 tokenGctHtMiss_[
i] = consumes<L1GctHtMissCollection>(
tag);
130 tokenGctJetCounts_[
i] = consumes<L1GctJetCountsCollection>(
tag);
141 tokenMuDTChambPh_[0] = consumes<L1MuDTChambPhContainer>(tag0);
142 tokenMuDTChambPh_[1] = consumes<L1MuDTChambPhContainer>(tag1);
143 tokenMuDTChambTh_[0] = consumes<L1MuDTChambThContainer>(tag0);
144 tokenMuDTChambTh_[1] = consumes<L1MuDTChambThContainer>(tag1);
152 tokenMuDTTrack_[0] = consumes<L1MuDTTrackContainer>(
edm::InputTag(tag0.
label(),
"DATA"));
153 tokenMuDTTrack_[1] = consumes<L1MuDTTrackContainer>(
edm::InputTag(tag1.label(),
"DTTF"));
161 tokenMuRegionalCandRPCb_[0] = consumes<L1MuRegionalCandCollection>(
edm::InputTag(tag0.
label(),
"RPCb"));
162 tokenMuRegionalCandRPCb_[1] = consumes<L1MuRegionalCandCollection>(
edm::InputTag(tag1.label(),
"RPCb"));
163 tokenMuRegionalCandRPCf_[0] = consumes<L1MuRegionalCandCollection>(
edm::InputTag(tag0.
label(),
"RPCf"));
164 tokenMuRegionalCandRPCf_[1] = consumes<L1MuRegionalCandCollection>(
edm::InputTag(tag1.label(),
"RPCf"));
172 tokenLTCDigi_[0] = consumes<LTCDigiCollection>(dummyTag);
173 tokenLTCDigi_[1] = consumes<LTCDigiCollection>(dummyTag);
181 tokenMuGMTCand_[0] = consumes<L1MuGMTCandCollection>(tag0);
182 tokenMuGMTCand_[1] = consumes<L1MuGMTCandCollection>(tag1);
183 tokenMuReadoutCand_[0] = consumes<L1MuGMTReadoutCollection>(tag0);
184 tokenMuReadoutCand_[1] = consumes<L1MuGMTReadoutCollection>(tag1);
188 std::cout <<
"\nL1Comparator constructor...done.\n" << std::flush;
199 std::cout <<
"\nL1COMPARATOR beginRun...\n" << std::flush;
218 std::cout <<
"RCT key is empty. Sub-systems is disabled ("<<m_doSys[
RCT]<<
")\n";
220 std::cout <<
"GCT key is empty. Sub-systems is disabled ("<<m_doSys[
GCT]<<
")\n";
222 std::cout <<
"DTTF key is empty. Sub-systems is disabled ("<<m_doSys[
DTF]<<
")\n";
224 std::cout <<
"CSCTF key is empty. Sub-systems is disabled ("<<m_doSys[
CTF]<<
")\n";
226 std::cout <<
"RPC key is empty. Sub-systems is disabled ("<<m_doSys[
RPC]<<
")\n";
228 std::cout <<
"GMT key is empty. Sub-systems is disabled ("<<m_doSys[
GMT]<<
")\n";
230 std::cout <<
"GT key is empty. Sub-systems is disabled ("<<m_doSys[
GLT]<<
")\n";
240 <<
"No L1TriggerKey found." 245 std::cout <<
"L1COMPARATOR beginRun... done\n" << std::flush;
251 m_dumpFile <<
"\n\n-------\n" 252 <<
"Global data|emulator agreement: " 253 << m_match << std::endl;
262 runNum_ = iEvent.
id().
run();
265 std::cout <<
"\nL1COMPARATOR entry:" << nevt_ <<
" | evt:" << evtNum_
266 <<
" | run:" << runNum_ <<
"\n" << std::flush;
273 for(
int j=0; j<2; j++)
275 DEmatchEvt[
i] =
true;
288 iEvent.
getByToken(tokenCaloEm_[0], rct_em_data);
289 iEvent.
getByToken(tokenCaloEm_[1], rct_em_emul);
290 iEvent.
getByToken(tokenCaloRegion_[0], rct_rgn_data);
291 iEvent.
getByToken(tokenCaloRegion_[1], rct_rgn_emul);
324 if(m_stage1_layer2_ ==
false){
325 iEvent.
getByToken(tokenGctEmCand_isoEm_[0],gct_isolaem_data);
326 iEvent.
getByToken(tokenGctEmCand_isoEm_[1],gct_isolaem_emul);
327 iEvent.
getByToken(tokenGctEmCand_nonIsoEm_[0],gct_noisoem_data);
328 iEvent.
getByToken(tokenGctEmCand_nonIsoEm_[1],gct_noisoem_emul);
329 iEvent.
getByToken(tokenGctJetCand_cenJets_[0],gct_cenjets_data);
330 iEvent.
getByToken(tokenGctJetCand_cenJets_[1],gct_cenjets_emul);
331 iEvent.
getByToken(tokenGctJetCand_forJets_[0],gct_forjets_data);
332 iEvent.
getByToken(tokenGctJetCand_forJets_[1],gct_forjets_emul);
333 iEvent.
getByToken(tokenGctJetCand_tauJets_[0],gct_taujets_data);
334 iEvent.
getByToken(tokenGctJetCand_tauJets_[1],gct_taujets_emul);
335 iEvent.
getByToken(tokenGctEtHad_[0],gct_ht_data);
336 iEvent.
getByToken(tokenGctEtHad_[1],gct_ht_emul);
337 iEvent.
getByToken(tokenGctEtMiss_[0],gct_etmiss_data);
338 iEvent.
getByToken(tokenGctEtMiss_[1],gct_etmiss_emul);
339 iEvent.
getByToken(tokenGctEtTotal_[0],gct_ettota_data);
340 iEvent.
getByToken(tokenGctEtTotal_[1],gct_ettota_emul);
341 iEvent.
getByToken(tokenGctHtMiss_[0],gct_htmiss_data);
342 iEvent.
getByToken(tokenGctHtMiss_[1],gct_htmiss_emul);
343 iEvent.
getByToken(tokenGctHFRingEtSums_[0],gct_hfring_data);
344 iEvent.
getByToken(tokenGctHFRingEtSums_[1],gct_hfring_emul);
345 iEvent.
getByToken(tokenGctHFBitCounts_[0],gct_hfbcnt_data);
346 iEvent.
getByToken(tokenGctHFBitCounts_[1],gct_hfbcnt_emul);
347 iEvent.
getByToken(tokenGctJetCounts_[0],gct_jetcnt_data);
348 iEvent.
getByToken(tokenGctJetCounts_[1],gct_jetcnt_emul);
350 if(m_stage1_layer2_ ==
true){
351 iEvent.
getByToken(tokenGctEmCand_isoEm_[0],gct_isolaem_data);
352 iEvent.
getByToken(tokenGctEmCand_isoEm_[1],gct_isolaem_emul);
353 iEvent.
getByToken(tokenGctEmCand_nonIsoEm_[0],gct_noisoem_data);
354 iEvent.
getByToken(tokenGctEmCand_nonIsoEm_[1],gct_noisoem_emul);
355 iEvent.
getByToken(tokenGctJetCand_cenJets_[0],gct_cenjets_data);
356 iEvent.
getByToken(tokenGctJetCand_cenJets_[1],gct_cenjets_emul);
357 iEvent.
getByToken(tokenGctJetCand_forJets_[0],gct_forjets_data);
358 iEvent.
getByToken(tokenGctJetCand_forJets_[1],gct_forjets_emul);
359 iEvent.
getByToken(tokenGctJetCand_tauJets_[0],gct_taujets_data);
360 iEvent.
getByToken(tokenGctJetCand_tauJets_[1],gct_taujets_emul);
361 iEvent.
getByToken(tokenGctJetCand_isoTauJets_[0],gct_isotaujets_data);
362 iEvent.
getByToken(tokenGctJetCand_isoTauJets_[1],gct_isotaujets_emul);
363 iEvent.
getByToken(tokenGctEtHad_[0],gct_ht_data);
364 iEvent.
getByToken(tokenGctEtHad_[1],gct_ht_emul);
365 iEvent.
getByToken(tokenGctEtMiss_[0],gct_etmiss_data);
366 iEvent.
getByToken(tokenGctEtMiss_[1],gct_etmiss_emul);
367 iEvent.
getByToken(tokenGctEtTotal_[0],gct_ettota_data);
368 iEvent.
getByToken(tokenGctEtTotal_[1],gct_ettota_emul);
369 iEvent.
getByToken(tokenGctHtMiss_[0],gct_htmiss_data);
370 iEvent.
getByToken(tokenGctHtMiss_[1],gct_htmiss_emul);
371 iEvent.
getByToken(tokenGctHFRingEtSums_[0],gct_hfring_data);
372 iEvent.
getByToken(tokenGctHFRingEtSums_[1],gct_hfring_emul);
373 iEvent.
getByToken(tokenGctHFBitCounts_[0],gct_hfbcnt_data);
374 iEvent.
getByToken(tokenGctHFBitCounts_[1],gct_hfbcnt_emul);
375 iEvent.
getByToken(tokenGctJetCounts_[0],gct_jetcnt_data);
376 iEvent.
getByToken(tokenGctJetCounts_[1],gct_jetcnt_emul);
386 iEvent.
getByToken(tokenMuDTChambPh_[0],dtp_ph_data_);
387 iEvent.
getByToken(tokenMuDTChambPh_[1],dtp_ph_emul_);
388 iEvent.
getByToken(tokenMuDTChambTh_[0],dtp_th_data_);
389 iEvent.
getByToken(tokenMuDTChambTh_[1],dtp_th_emul_);
407 iEvent.
getByToken(tokenMuDTTrack_[0],dtf_trk_data_);
408 iEvent.
getByToken(tokenMuDTTrack_[1],dtf_trk_emul_);
411 typedef std::vector<L1MuDTTrackCand> L1MuDTTrackCandCollection;
413 dtf_trk_data_v.clear(); dtf_trk_emul_v.clear();
415 L1MuDTTrackCandCollection
const *dttc = dtf_trk_data_->
getContainer();
416 for(L1MuDTTrackCandCollection::const_iterator it=dttc->begin();
417 it!=dttc->end(); it++)
421 L1MuDTTrackCandCollection
const *dttc = dtf_trk_emul_->
getContainer();
422 for(L1MuDTTrackCandCollection::const_iterator it=dttc->begin();
423 it!=dttc->end(); it++)
426 dtf_trk_data =&dtf_trk_data_v;
427 dtf_trk_emul =&dtf_trk_emul_v;
436 iEvent.
getByToken(tokenMuRegionalCandRPCb_[0],rpc_cen_data);
437 iEvent.
getByToken(tokenMuRegionalCandRPCb_[1],rpc_cen_emul);
438 iEvent.
getByToken(tokenMuRegionalCandRPCf_[0],rpc_for_data);
439 iEvent.
getByToken(tokenMuRegionalCandRPCf_[1],rpc_for_emul);
461 iEvent.
getByToken(tokenMuGMTCand_[0], gmt_data);
462 iEvent.
getByToken(tokenMuGMTCand_[1], gmt_emul);
463 iEvent.
getByToken(tokenMuReadoutCand_[0], gmt_rdt_data_);
464 iEvent.
getByToken(tokenMuReadoutCand_[1], gmt_rdt_emul_);
468 gmt_can_data_vec.clear(); gmt_can_emul_vec.clear();
469 gmt_rdt_data_vec.clear(); gmt_rdt_emul_vec.clear();
471 typedef std::vector<L1MuGMTReadoutRecord>::const_iterator GmtRrIt;
473 std::vector<L1MuGMTReadoutRecord> gmt_rdt_data_bx = gmt_rdt_data_->
getRecords();
474 for(GmtRrIt igmtrr=gmt_rdt_data_bx.begin(); igmtrr!=gmt_rdt_data_bx.end(); igmtrr++) {
476 typedef std::vector<L1MuGMTExtendedCand>::const_iterator GmtECIt;
477 std::vector<L1MuGMTExtendedCand> gmc;
478 gmc = igmtrr->getGMTCands();
479 for(GmtECIt iter1=gmc.begin(); iter1!=gmc.end(); iter1++) {
481 cand.setPhiValue(iter1->phiValue());
482 cand.setEtaValue(iter1->etaValue());
483 cand.setPtValue (iter1->ptValue ());
484 gmt_can_data_vec.push_back(
cand);
487 typedef L1MuRegionalCandCollection::const_iterator GmtRCIt;
490 rmc = igmtrr->getDTBXCands();
491 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
493 rmc = igmtrr->getCSCCands();
494 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
496 rmc = igmtrr->getBrlRPCCands();
497 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
499 rmc = igmtrr->getFwdRPCCands();
500 gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
503 std::vector<L1MuGMTReadoutRecord> gmt_rdt_emul_bx = gmt_rdt_emul_->
getRecords();
504 for(GmtRrIt igmtrr=gmt_rdt_emul_bx.begin(); igmtrr!=gmt_rdt_emul_bx.end(); igmtrr++) {
506 typedef std::vector<L1MuGMTExtendedCand>::const_iterator GmtECIt;
507 std::vector<L1MuGMTExtendedCand> gmc;
508 gmc = igmtrr->getGMTCands();
509 for(GmtECIt iter1=gmc.begin(); iter1!=gmc.end(); iter1++) {
510 gmt_can_emul_vec.push_back(
L1MuGMTCand(iter1->getDataWord(),iter1->bx()));
513 typedef L1MuRegionalCandCollection::const_iterator GmtRCIt;
516 rmc = igmtrr->getDTBXCands();
517 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
519 rmc = igmtrr->getCSCCands();
520 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
522 rmc = igmtrr->getBrlRPCCands();
523 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
525 rmc = igmtrr->getFwdRPCCands();
526 gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
529 gmt_rdt_data = &gmt_rdt_data_vec;
530 gmt_rdt_emul = &gmt_rdt_emul_vec;
531 gmt_can_data = &gmt_can_data_vec;
532 gmt_can_emul = &gmt_can_emul_vec;
537 bool isValidDE[
DEnsys][2];
538 for(
int i=0;
i<
DEnsys;
i++)
for(
int j=0; j<2; j++) isValidDE[
i][j]=
false;
543 if(m_stage1_layer2_ ==
false){
544 isValidDE[
GCT][0] = gct_isolaem_data .
isValid(); isValidDE[
GCT][1] =gct_isolaem_emul .
isValid();
545 isValidDE[
GCT][0]&= gct_noisoem_data .
isValid(); isValidDE[
GCT][1]&=gct_noisoem_emul .
isValid();
546 isValidDE[
GCT][0]&= gct_cenjets_data .
isValid(); isValidDE[
GCT][1]&=gct_cenjets_emul .
isValid();
547 isValidDE[
GCT][0]&= gct_forjets_data .
isValid(); isValidDE[
GCT][1]&=gct_forjets_emul .
isValid();
548 isValidDE[
GCT][0]&= gct_taujets_data .
isValid(); isValidDE[
GCT][1]&=gct_taujets_emul .
isValid();
556 if(m_stage1_layer2_ ==
true){
557 isValidDE[
GCT][0] = gct_isolaem_data .
isValid();
558 isValidDE[
GCT][1] = gct_isolaem_emul .
isValid();
559 isValidDE[
GCT][0]&= gct_noisoem_data .
isValid();
560 isValidDE[
GCT][1]&= gct_noisoem_emul .
isValid();
561 isValidDE[
GCT][0]&= gct_cenjets_data .
isValid();
562 isValidDE[
GCT][1]&= gct_cenjets_emul .
isValid();
563 isValidDE[
GCT][0]&= gct_forjets_data .
isValid();
564 isValidDE[
GCT][1]&= gct_forjets_emul .
isValid();
565 isValidDE[
GCT][0]&= gct_taujets_data .
isValid();
566 isValidDE[
GCT][1]&= gct_taujets_emul .
isValid();
567 isValidDE[
GCT][0]&= gct_isotaujets_data .
isValid();
568 isValidDE[
GCT][1]&= gct_isotaujets_emul .
isValid();
569 isValidDE[
GCT][0]&= gct_etmiss_data .
isValid();
570 isValidDE[
GCT][1]&= gct_etmiss_emul .
isValid();
571 isValidDE[
GCT][0]&= gct_ettota_data .
isValid();
572 isValidDE[
GCT][1]&= gct_ettota_emul .
isValid();
573 isValidDE[
GCT][0]&= gct_htmiss_data .
isValid();
574 isValidDE[
GCT][1]&= gct_htmiss_emul .
isValid();
575 isValidDE[
GCT][0]&= gct_hfring_data .
isValid();
576 isValidDE[
GCT][1]&= gct_hfring_emul .
isValid();
577 isValidDE[
GCT][0]&= gct_hfbcnt_data .
isValid();
578 isValidDE[
GCT][1]&= gct_hfbcnt_emul .
isValid();
597 for(
int j=0; j<2; j++) {
598 isValid[
i] &= isValidDE[
i][j];
603 std::cout <<
"L1Comparator sys isValid? (evt:" << nevt_ <<
") ";
620 std::cout <<
"L1Comparator start processing the collections.\n" << std::flush;
623 if(m_doSys[RCT]&&isValid[RCT]) process<L1CaloEmCollection> ( rct_em_data, rct_em_emul,
RCT,
RCTem);
624 if(m_doSys[RCT]&&isValid[RCT]) process<L1CaloRegionCollection> ( rct_rgn_data, rct_rgn_emul,
RCT,
RCTrgn);
626 if(m_stage1_layer2_==
false){
627 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_isolaem_data, gct_isolaem_emul,
GCT,
GCTisolaem);
628 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_noisoem_data, gct_noisoem_emul,
GCT,
GCTnoisoem);
629 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_cenjets_data, gct_cenjets_emul,
GCT,
GCTcenjets);
630 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_forjets_data, gct_forjets_emul,
GCT,
GCTforjets);
631 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_taujets_data, gct_taujets_emul,
GCT,
GCTtaujets);
632 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtHadCollection> ( gct_ht_data, gct_ht_emul,
GCT,
GCTethad);
633 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtMissCollection> ( gct_etmiss_data, gct_etmiss_emul,
GCT,
GCTetmiss);
634 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtTotalCollection> ( gct_ettota_data , gct_ettota_emul,
GCT,
GCTettot);
635 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHtMissCollection> ( gct_htmiss_data, gct_htmiss_emul,
GCT,
GCThtmiss);
636 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFRingEtSumsCollection> ( gct_hfring_data, gct_hfring_emul,
GCT,
GCThfring);
637 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFBitCountsCollection> ( gct_hfbcnt_data, gct_hfbcnt_emul,
GCT,
GCThfbit);
640 if(m_stage1_layer2_==
true){
641 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_isolaem_data, gct_isolaem_emul,
GCT,
GCTisolaem);
642 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_noisoem_data, gct_noisoem_emul,
GCT,
GCTnoisoem);
643 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_cenjets_data, gct_cenjets_emul,
GCT,
GCTcenjets);
644 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_forjets_data, gct_forjets_emul,
GCT,
GCTforjets);
645 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_taujets_data, gct_taujets_emul,
GCT,
GCTtaujets);
646 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_isotaujets_data,gct_isotaujets_emul,
GCT,
GCTisotaujets);
647 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtHadCollection> ( gct_ht_data, gct_ht_emul,
GCT,
GCTethad);
648 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtMissCollection> ( gct_etmiss_data, gct_etmiss_emul,
GCT,
GCTetmiss);
649 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtTotalCollection> ( gct_ettota_data , gct_ettota_emul,
GCT,
GCTettot);
650 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHtMissCollection> ( gct_htmiss_data, gct_htmiss_emul,
GCT,
GCThtmiss);
651 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFRingEtSumsCollection> ( gct_hfring_data, gct_hfring_emul,
GCT,
GCThfring);
652 if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFBitCountsCollection> ( gct_hfbcnt_data, gct_hfbcnt_emul,
GCT,
GCThfbit);
656 if(m_doSys[DTP]&&isValid[DTP]) process<L1MuDTChambPhDigiCollection> ( dtp_ph_data, dtp_ph_emul,
DTP,
DTtpPh);
657 if(m_doSys[DTP]&&isValid[DTP]) process<L1MuDTChambThDigiCollection> ( dtp_th_data, dtp_th_emul,
DTP,
DTtpTh);
659 if(m_doSys[DTF]&&isValid[DTF]) process<L1MuRegionalCandCollection> ( dtf_trk_data, dtf_trk_emul,
DTF,
DTtftrk);
661 if(m_doSys[RPC]&&isValid[RPC]) process<L1MuRegionalCandCollection> ( rpc_cen_data, rpc_cen_emul,
RPC,
RPCcen);
662 if(m_doSys[RPC]&&isValid[RPC]) process<L1MuRegionalCandCollection> ( rpc_for_data, rpc_for_emul,
RPC,
RPCfor);
664 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuGMTCandCollection> ( gmt_data, gmt_emul,
GMT,
GMTmain);
665 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuRegionalCandCollection> ( gmt_rdt_data, gmt_rdt_emul,
GMT,
GMTrdt);
666 if(m_doSys[GMT]&&isValid[GMT]) process<L1MuGMTCandCollection> ( gmt_can_data, gmt_can_emul,
GMT,
GMTcnd);
673 std::cout <<
"L1Comparator done processing all collections.\n" << std::flush;
676 std::cout <<
"[L1Comparator] sys match? << evt." << nevt_ <<
": ";
685 bool evt_match =
true;
687 evt_match &= DEmatchEvt[
i];
699 m_match &= evt_match;
700 m_dumpFile << std::flush;
703 if(m_dedigis.empty()) {
705 std::cout <<
"\n [L1Comparator] adding empty collection to DErecord\n";
710 std::unique_ptr<L1DataEmulRecord>
record 711 (
new L1DataEmulRecord(evt_match,m_doSys,DEmatchEvt,DEncand,m_dedigis, gltdigimon));
713 std::cout <<
"\n [L1Comparator] printing DErecord" 715 <<
"|evt:" << evtNum_
716 <<
"|run:" << runNum_
717 <<
"):\n" << std::flush;
719 <<
"\n" << std::flush;
725 std::cout <<
"L1comparator::analize() end. " << nevt_ << std::endl;
734 std::cout <<
"L1Comparator::process -ing system:" << sys
735 <<
" (" <<
SystLabel[sys] <<
"), data type " << cid
736 <<
"...\n" << std::flush;
738 std::cout <<
"L1Comparator::process debug " 739 <<
" (size " << data->size() <<
"," <<emul->size() <<
")" 740 <<
".\n" << std::flush;
746 else if(m_dumpMode==-1)
748 else if(m_dumpMode>0) {
764 <<
" system:" <<
SystLabel[sys] <<
"(id " << sys <<
")" 766 <<
" ndata:" << ndata
767 <<
" nemul:" << nemul
768 <<
" (size " << data->size() <<
"," <<emul->size() <<
")" 769 <<
".\n" << std::flush;
771 if(ndata==0&&nemul==0) {
774 <<
"empty collections -- exiting!\n" << std::flush;
779 | std::ios::right | std::ios::adjustfield);
781 | std::ios::right | std::ios::adjustfield);
783 if(dumpEvent_ && prt ) {
784 m_dumpFile <<
"\nEntry: " << nevt_
785 <<
" (event:" << evtNum_
786 <<
" | run:" << runNum_
787 <<
")\n" << std::flush;
792 m_dumpFile <<
"\n sys:" <<
SystLabel[sys]
793 <<
" (" << sys <<
"), type:" << cid
797 std::cout <<
"L1Comparator::process print:\n" << std::flush
802 DEmatchEvt[sys] &= cmp.
do_compare(m_dumpFile,m_dumpMode);
808 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
812 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
815 for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
819 m_dedigis.insert(m_dedigis.end(), dg.begin(), dg.end());
820 for(
int i=0;
i<2;
i++)
827 <<
" ndata:" << DEncand[sys][0]
828 <<
" nemul:" << DEncand[sys][1]
829 <<
" (size " << data->size() <<
"," <<emul->size() <<
")" 830 <<
" ndigis:" << dg.size()
831 <<
" agree? " << DEmatchEvt[sys]
835 std::cout <<
"L1Comparator::process -ing system:" 836 << sys <<
" (" <<
SystLabel[sys] <<
")...done.\n" 840 template <
class myCol>
844 typedef typename myCol::iterator col_it;
845 col_sz ndata = data->size();
846 col_sz nemul = emul->size();
849 m_dumpFile <<
" #cand mismatch!" 850 <<
"\tdata: " << ndata
851 <<
"\temul: " << nemul
854 col_it itd = data ->
begin();
855 col_it itm = emul ->
begin();
856 for (col_sz
i=0;
i<ndata;
i++) {
857 match &= dumpCandidate(*itd++,*itm++, m_dumpFile);
867 s<<em<<std::endl<<std::endl;
T getParameter(std::string const &) const
EventNumber_t event() const
The_Container const * getContainer() const
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
L1Comparator(const edm::ParameterSet &)
void beginJob(void) override
std::string print(col_cit it) const
int get_ncand(typeT) const
std::vector< L1DataEmulDigi > L1DEDigiCollection
void produce(edm::Event &, const edm::EventSetup &) override
L1DEDigiCollection getDEDigis() const
void beginRun(edm::Run const &, const edm::EventSetup &) final
std::string GetName(int i=0) const
std::vector< L1MuDTChambThDigi > L1MuDTChambThDigiCollection
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
bool do_compare(std::ofstream &, int dump=0)
std::vector< L1MuDTChambPhDigi > L1MuDTChambPhDigiCollection
Phi_Container const * getContainer() const
const std::string & tscKey() 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]
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
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)
const std::string & subsystemKey(L1Subsystems subsystem) const
TrackContainer const * getContainer() const
std::vector< L1MuGMTCand > L1MuGMTCandCollection
void process(T const *, T const *, const int, const int)