282 unsigned int nDataMuons = 0;
283 unsigned int nEmulMuons = 0;
284 int dataMuonArray[8][10], emuMuonArray[8][10];
287 for(
int par=0; par<3; par++)
289 dataMuonArray[
muon][par]=0;
290 emuMuonArray[
muon][par] =0;
292 emuMuonArray[
muon][3] =-1;
293 dataMuonArray[
muon][3]=-1;
295 emuMuonArray[
muon][4]=7;
296 dataMuonArray[
muon][4]=7;
298 for(
int par2=5; par2<10; par2++)
300 emuMuonArray[
muon][par2]= -1;
301 dataMuonArray[
muon][par2]= -1;
314 <<
"\n No valid [data tracks] product found: "
315 <<
" L1CSCTrackCollection"
321 for(L1CSCTrackCollection::const_iterator trk=tracks.
product()->begin(); trk!=tracks.
product()->end(); trk++)
325 if( (trk->first.BX() <2) && (trk->first.BX() > -1) )
329 dataMuonArray[nDataMuons][0] = trk->first.ptLUTAddress();
330 dataMuonArray[nDataMuons][1] = trk->first.sector();
331 dataMuonArray[nDataMuons][2] = trk->first.endcap();
332 dataMuonArray[nDataMuons][8] = trk->first.outputLink();
333 dataMuonArray[nDataMuons][4] = trk->first.BX();
334 dataMuonArray[nDataMuons][5] = trk->first.rank();
335 dataMuonArray[nDataMuons][6] = trk->first.localPhi();
336 dataMuonArray[nDataMuons][7] = trk->first.eta_packed();
337 dataMuonArray[nDataMuons][9] = trk->first.modeExtended();
352 <<
"\n No valid [emulator tracks] product found: "
353 <<
" L1CSCTrackCollection"
358 for(L1CSCTrackCollection::const_iterator trk=tracks.
product()->begin(); trk!=tracks.
product()->end(); trk++)
362 if((trk->first.BX() <2) && (trk->first.BX() >-1))
366 emuMuonArray[nEmulMuons][0] = trk->first.ptLUTAddress();
367 emuMuonArray[nEmulMuons][1] = trk->first.sector();
368 emuMuonArray[nEmulMuons][2] = trk->first.endcap();
369 emuMuonArray[nEmulMuons][4] = trk->first.BX();
370 emuMuonArray[nEmulMuons][5] = trk->first.rank();
371 emuMuonArray[nEmulMuons][6] = trk->first.localPhi();
372 emuMuonArray[nEmulMuons][7] = trk->first.eta_packed();
373 emuMuonArray[nEmulMuons][9] = trk->first.modeExtended();
379 if( (nDataMuons!=0)||(nEmulMuons!=0) ) {
385 if(nDataMuons==nEmulMuons)
388 for(
unsigned int mu1=0; mu1<nDataMuons; mu1++)
390 for(
unsigned int mu2=0; mu2<nEmulMuons; mu2++)
391 if((emuMuonArray[mu2][1]==dataMuonArray[mu1][1])&&(emuMuonArray[mu2][2]==dataMuonArray[mu1][2]))
393 if(emuMuonArray[mu2][0]==dataMuonArray[mu1][0])
395 emuMuonArray[mu2][3]=mu1;
396 dataMuonArray[mu1][3]=1;
401 for(
unsigned int c2a=0; c2a<nEmulMuons; c2a++)
403 if(emuMuonArray[c2a][3]==-1)
405 for(
unsigned int cor_a=0; cor_a<nDataMuons; cor_a++)
407 if( (dataMuonArray[cor_a][1]==emuMuonArray[c2a][1]) && (dataMuonArray[cor_a][2]==emuMuonArray[c2a][2]))
409 emuMuonArray[c2a][3]=cor_a;
410 dataMuonArray[cor_a][3]=1;
416 bool multiMap =
false;
419 for(
unsigned int c1a=0; c1a<(nEmulMuons-1); c1a++)
421 for(
unsigned int c1b=(c1a+1); c1b<nEmulMuons; c1b++)
423 if(emuMuonArray[c1a][3]==emuMuonArray[c1b][3])
435 for(
unsigned int mu3=0; mu3<nEmulMuons; mu3++)
437 int mapping = emuMuonArray[mu3][3];
438 if((mapping!=-1)&&(multiMap==
false))
441 int emuPhi12 = (0x0000ff & emuMuonArray[mu3][0]);
442 int datPhi12 = (0x0000ff & dataMuonArray[mapping][0]);
443 int emuPhi23 = (0x000f00 & emuMuonArray[mu3][0])>>8;
444 int datPhi23 = (0x000f00 & dataMuonArray[mapping][0])>>8;
445 int emuEta = (0x00f000 & emuMuonArray[mu3][0])>>12;
446 int datEta = (0x00f000 & dataMuonArray[mapping][0])>>12;
449 int emuFrSin = (0xf00000 & emuMuonArray[mu3][0])>>20;
450 int datFrSin = (0xf00000 & dataMuonArray[mapping][0])>>20;
452 int emuQual = emuMuonArray[mu3][5]>>5;
453 int datQual = dataMuonArray[mapping][5]>>5;
454 int emuPt = 0x1f & emuMuonArray[mu3][5];
455 int datPt = 0x1f & dataMuonArray[mapping][5];
456 int emuModeExtended = emuMuonArray[mu3][9];
457 int datModeExtended = dataMuonArray[mapping][9];
463 if(emuModeExtended==datModeExtended)
471 if(dataMuonArray[mapping][8]==1)
476 phiComp->
Fill(dataMuonArray[mapping][6],emuMuonArray[mu3][6]);
477 etaComp->
Fill(dataMuonArray[mapping][7],emuMuonArray[mu3][7]);
493 for(
int dJ=0; dJ<7; dJ++)
495 for(
int dK=0; dK<15; dK++)
497 eDtStub[dJ][dK] = -55;
498 dDtStub[dJ][dK] = -55;
499 dDtStub[7][dK] = -55;
511 <<
"\n No valid [Data Stubs] product found: "
512 <<
" L1CSCTrackCollection"
519 vector<csctf::TrackStub> stuList = stub_list.
get();
520 vector<csctf::TrackStub>::const_iterator stu= stuList.begin();
521 for(; stu!=stuList.end(); stu++)
525 if((stu->BX()>4) && (stu->BX()<9))
527 dDtStub[0][dDtCounter] = stu->phiPacked();
528 dDtStub[1][dDtCounter] = stu->getQuality();
529 dDtStub[2][dDtCounter] = stu->endcap();
530 dDtStub[3][dDtCounter] = stu->sector();
531 dDtStub[4][dDtCounter] = stu->subsector();
546 <<
"\n No valid [Data Stubs] product found: "
547 <<
" L1CSCTrackCollection"
552 vector<csctf::TrackStub> emuList = emulStub.
get();
553 vector<csctf::TrackStub>::const_iterator eStu=emuList.begin();
554 for(; eStu!=emuList.end(); eStu++)
559 if((eStu->BX()>4) && (eStu->BX()<9) )
561 eDtStub[0][eDtCounter] = eStu->phiPacked();
562 eDtStub[1][eDtCounter] = eStu->getQuality();
563 eDtStub[2][eDtCounter] = eStu->endcap();
564 eDtStub[3][eDtCounter] = eStu->sector();
565 eDtStub[4][eDtCounter] = eStu->subsector();
573 for(
int eS=0; eS<eDtCounter; eS++)
576 for(
int dS=0; dS<dDtCounter; dS++)
579 if(eDtStub[2][eS]==dDtStub[2][dS])
582 if(eDtStub[3][eS]==dDtStub[3][dS])
585 if(eDtStub[4][eS]==dDtStub[4][dS])
588 if( (eDtStub[0][eS]==dDtStub[0][dS]) && (eDtStub[1][eS]==dDtStub[1][dS]) && (eDtStub[6][eS]!=1) && (dDtStub[6][dS]!=1) )
603 for(
int eS2=0; eS2<eDtCounter; eS2++)
605 for(
int dS2=0; dS2<dDtCounter; dS2++)
608 if( (eDtStub[2][eS2]==dDtStub[2][dS2]) && (eDtStub[3][eS2]==dDtStub[3][dS2]) && (eDtStub[4][eS2]==dDtStub[4][dS2]) )
611 if( ((dDtStub[7][eS2]==-55) || (dDtStub[7][dS2]>(
abs(eDtStub[0][eS2]-dDtStub[0][dS2]))) ) && (eDtStub[6][eS2]!=1) && (dDtStub[6][dS2]!=1) )
614 dDtStub[5][dS2] = eS2;
616 eDtStub[5][eS2] = dS2;
618 dDtStub[7][dS2] =
abs(eDtStub[0][eS2]-dDtStub[0][dS2]);
625 bool dtSMulti =
false;
628 for(
int eS3a=0; eS3a<eDtCounter-1; eS3a++)
629 for(
int eS3b=eS3a+1; eS3b<eDtCounter; eS3b++)
631 if( eDtStub[5][eS3a]==eDtStub[5][eS3b] ) dtSMulti=
true;
632 if( eDtStub[5][eS3a]==-55 || eDtStub[5][eS3b]==-55 ) dtUnmap++;
636 for(
int dS3a=0; dS3a<dDtCounter-1; dS3a++)
637 for(
int dS3b=dS3a+1; dS3b<dDtCounter; dS3b++)
639 if( dDtStub[5][dS3a]==dDtStub[5][dS3b] ) dtSMulti=
true;
640 if( dDtStub[5][dS3a]==-55||dDtStub[5][dS3b]==-55 ) dtUnmap++;
647 if(dtSMulti==
false && dtUnmap==0)
649 for(
int phil=0; phil<eDtCounter; phil++)
651 if(eDtStub[6][phil]==1 || eDtStub[6][phil]==2)
653 int indexFil = eDtStub[3][phil]*2+eDtStub[4][phil]-1;
654 dtStubPhi->
Fill(eDtStub[0][phil], dDtStub[0][ eDtStub[5][phil] ]);
656 if( eDtStub[0][phil] != dDtStub[0][ eDtStub[5][phil] ])
MonitorElement * etaComp_1d
MonitorElement * qualComp
std::vector< T > get() const
edm::EDGetTokenT< L1CSCTrackCollection > emulTrackProducer
edm::EDGetTokenT< L1CSCTrackCollection > dataTrackProducer
MonitorElement * qualComp_1d
MonitorElement * dtStubPhi
MonitorElement * phiComp_1d
CSCTriggerContainer< csctf::TrackStub > process(const L1MuDTChambPhContainer *)
edm::EDGetTokenT< L1MuDTChambPhContainer > emulStubProducer
MonitorElement * ptComp_1d
Abs< T >::type abs(const T &t)
void push_many(const std::vector< T > &data)
MonitorElement * pt1Comp_1d
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > dataStubProducer
MonitorElement * occComp_1d
MonitorElement * dtStubPhi_1d
T const * product() const
MonitorElement * pt5Comp_1d
MonitorElement * badDtStubSector
MonitorElement * pt4Comp_1d
MonitorElement * pt2Comp_1d
bool isUninitialized() const
MonitorElement * pt3Comp_1d
CSCTFDTReceiver * my_dtrc