690 edm::LogInfo(
"L1TCSCTF") <<
"Changing triggerscales and triggerptscales...";
693 int NumCSCTfTracksRep = 0;
703 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label ";
708 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
709 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
719 for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ ) {
723 vector<L1MuRegionalCand> INPCands = RRItr->getCSCCands();
724 vector<L1MuRegionalCand>::const_iterator INPItr;
730 for( INPItr = INPCands.begin(); INPItr != INPCands.end(); ++INPItr ) {
736 if (
verbose_)
edm::LogInfo(
"DataNotFound") <<
"cand " << nCandsBx <<
" -> assigned CSCTF bx: " << INPItr->bx() << endl;
743 if (nCands != 1)
return;
750 edm::LogInfo(
"DataNotFound") <<
"\tCSCTFCand ntrack " << ncsctftrack << endl;
759 bool integrity=status->first, se=
false, sm=
false, bx=
false, af=
false, fmm=
false;
762 for(std::vector<L1CSCSPStatusDigi>::const_iterator stat=status->second.begin(); stat!=status->second.end(); stat++)
764 se |= stat->SEs()&0xFFF;
765 sm |= stat->SMs()&0xFFF;
766 bx |= stat->BXs()&0xFFF;
767 af |= stat->AFs()&0xFFF;
768 fmm|= stat->FMM()!=8;
771 int ise = stat->SEs()&0xFFF;
772 int ism = stat->SMs()&0xFFF;
773 int ibx = stat->BXs()&0xFFF;
774 int iaf = stat->AFs()&0xFFF;
775 int ifmm= stat->FMM();
776 int slot= stat->slot();
779 for(
int j=0;
j<15;
j++) {
784 if(slot>=6 && slot<=11) sp_num = slot-5;
785 if(slot>=16 && slot<=21) sp_num = slot-9;
788 if (link>=1 && link<=3) mpc_id=2;
789 else if(link>=4 && link<=6) mpc_id=3;
790 else if(link>=7 && link<=9) mpc_id=13;
791 else if(link>=10 && link<=12) mpc_id=19;
792 else if(link>=13 && link<=15) mpc_id=25;
795 if (link>=1 && link<=3) mpc_id=4;
796 else if(link>=4 && link<=6) mpc_id=5;
797 else if(link>=7 && link<=9) mpc_id=14;
798 else if(link>=10 && link<=12) mpc_id=20;
799 else if(link>=13 && link<=15) mpc_id=26;
802 if (link>=1 && link<=3) mpc_id=6;
803 else if(link>=4 && link<=6) mpc_id=7;
804 else if(link>=7 && link<=9) mpc_id=15;
805 else if(link>=10 && link<=12) mpc_id=21;
806 else if(link>=13 && link<=15) mpc_id=27;
809 if (link>=1 && link<=3) mpc_id=8;
810 else if(link>=4 && link<=6) mpc_id=9;
811 else if(link>=7 && link<=9) mpc_id=16;
812 else if(link>=10 && link<=12) mpc_id=22;
813 else if(link>=13 && link<=15) mpc_id=28;
816 if (link>=1 && link<=3) mpc_id=10;
817 else if(link>=4 && link<=6) mpc_id=11;
818 else if(link>=7 && link<=9) mpc_id=17;
819 else if(link>=10 && link<=12) mpc_id=23;
820 else if(link>=13 && link<=15) mpc_id=29;
823 if (link>=1 && link<=3) mpc_id=12;
824 else if(link>=4 && link<=6) mpc_id=1;
825 else if(link>=7 && link<=9) mpc_id=18;
826 else if(link>=10 && link<=12) mpc_id=24;
827 else if(link>=13 && link<=15) mpc_id=30;
830 if (link>=1 && link<=3) mpc_id=32;
831 else if(link>=4 && link<=6) mpc_id=33;
832 else if(link>=7 && link<=9) mpc_id=43;
833 else if(link>=10 && link<=12) mpc_id=49;
834 else if(link>=13 && link<=15) mpc_id=55;
837 if (link>=1 && link<=3) mpc_id=34;
838 else if(link>=4 && link<=6) mpc_id=35;
839 else if(link>=7 && link<=9) mpc_id=44;
840 else if(link>=10 && link<=12) mpc_id=50;
841 else if(link>=13 && link<=15) mpc_id=56;
844 if (link>=1 && link<=3) mpc_id=36;
845 else if(link>=4 && link<=6) mpc_id=37;
846 else if(link>=7 && link<=9) mpc_id=45;
847 else if(link>=10 && link<=12) mpc_id=51;
848 else if(link>=13 && link<=15) mpc_id=57;
851 if (link>=1 && link<=3) mpc_id=38;
852 else if(link>=4 && link<=6) mpc_id=39;
853 else if(link>=7 && link<=9) mpc_id=46;
854 else if(link>=10 && link<=12) mpc_id=52;
855 else if(link>=13 && link<=15) mpc_id=58;
858 if (link>=1 && link<=3) mpc_id=40;
859 else if(link>=4 && link<=6) mpc_id=41;
860 else if(link>=7 && link<=9) mpc_id=47;
861 else if(link>=10 && link<=12) mpc_id=53;
862 else if(link>=13 && link<=15) mpc_id=59;
865 if (link>=1 && link<=3) mpc_id=42;
866 else if(link>=4 && link<=6) mpc_id=31;
867 else if(link>=7 && link<=9) mpc_id=48;
868 else if(link>=10 && link<=12) mpc_id=54;
869 else if(link>=13 && link<=15) mpc_id=60;
895 if(nStat!=0)
L1ABXN /= nStat;
918 int endcap = (*csc).first.endcap()-1;
919 int station = (*csc).first.station()-1;
920 int sector = (*csc).first.triggerSector()-1;
922 int ring = (*csc).first.ring();
923 int cscId = (*csc).first.triggerCscId()-1;
924 int fpga = ( subSector ? subSector-1 : station+1 );
925 int strip = lct -> getStrip();
926 int keyWire = lct -> getKeyWG();
927 int bx = lct -> getBX();
930 int endcapAssignment = 1;
932 float sectorArg = sector;
936 endcapAssignment = -1;
941 int signedStation = (station +
shift)* endcapAssignment;
942 if( (station == 0) && (endcap == 0)) signedStation = subSector - 1;
943 if( (station == 0) && (endcap == 1)) signedStation = (-1)*subSector;
945 float chamberArg1 = cscId * 0.1 + sectorArg;
949 float chamberArg11 = chamberArg1;
950 if(sectorArg == 1) chamberArg1 = chamberArg11 - 0.1;
951 if(sectorArg == 2) chamberArg1 = chamberArg11 - 0.2;
952 if(sectorArg == 3) chamberArg1 = chamberArg11 - 0.3;
953 if(sectorArg == 4) chamberArg1 = chamberArg11 - 0.4;
954 if(sectorArg == 5) chamberArg1 = chamberArg11 - 0.5;
970 if( endcap<0||endcap>1 || sector<0||sector>6 || station<0||station>3 || cscId<0||cscId>8 || fpga<0||fpga>4)
972 edm::LogError(
"L1CSCTF: CSC TP are out of range: ")<<
" endcap: "<<(endcap+1)<<
" station: "<<(station+1) <<
" sector: "<<(sector+1)<<
" subSector: "<<subSector<<
" fpga: "<<fpga<<
" cscId: "<<(cscId+1);
978 if(endcap==1) EndCapLUT=0;
982 lclPhi =
srLUTs_[fpga][EndCapLUT][sector]->
localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend(),
gangedME11a_);
984 bzero(&lclPhi,
sizeof(lclPhi));
991 bzero(&gblPhi,
sizeof(gblPhi));
998 bzero(&gblEta,
sizeof(gblEta));
1004 theStub.setPhiPacked(gblPhi.global_phi);
1005 theStub.setEtaPacked(gblEta.global_eta);
1007 float etaG = theStub.etaValue();
1008 float phiG = fmod( theStub.phiValue()+15.0*
M_PI/180+(sector)*60.0*
M_PI/180, 2.*
M_PI );
1019 }
else if(station==1) {
1022 }
else if(station==2) {
1025 }
else if(station==3) {
1035 }
else if(station==1) {
1038 }
else if(station==2) {
1041 }
else if(station==3) {
1052 if(station == 0 && ring == 1){
1062 if(station == 3 && ring == 2){
1069 if (station == 0 && ring == 1){
1070 int realID = cscId+6*sector+3*subSector;
1071 if(realID>36) realID -= 36;
1076 if (station == 0 && ring == 2){
1077 int realID = (cscId-3)+6*sector+3*subSector;
1078 if(realID>36) realID -= 36;
1083 if (station == 0 && ring == 3){
1084 int realID = (cscId-6)+6*sector+3*subSector;
1085 if(realID>36) realID -= 36;
1090 if (station == 1 && ring == 1){
1091 int realID = cscId+3*sector+2;
1092 if(realID>18) realID -= 18;
1097 if (station == 1 && ring == 2){
1098 int realID = (cscId-3)+6*sector+3;
1099 if(realID>36) realID -= 36;
1105 if (station == 2 && ring == 1){
1106 int realID = cscId+3*sector+2;
1107 if(realID>18) realID -= 18;
1113 if (station == 2 && ring == 2){
1114 int realID = (cscId-3)+6*sector+3;
1115 if(realID>36) realID -= 36;
1120 if (station == 3 && ring == 1){
1121 int realID = cscId+3*sector+2;
1122 if(realID>18) realID -= 18;
1127 if (station == 3 && ring == 2){
1128 int realID = (cscId-3)+6*sector+3;
1129 if(realID>36) realID -= 36;
1154 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
1157 NumCSCTfTracksRep++;
1158 long LUTAdd = trk->first.ptLUTAddress();
1159 int trigMode = ( (LUTAdd)&0xf0000 ) >> 16;
1160 int trEta = (trk->first.eta_packed() );
1166 if( trk->first.endcap() != 1)
1173 int trSector = 6*(trk->first.endcap()-1)+trk->first.sector();
1174 int trBX = trk->first.BX();
1188 double trPhi02PI = fmod(trPhi +
1189 ((trSector-1)*
M_PI/3) +
1192 if (trigMode == 15) {
1206 if (
abs(trEta) < 24) {
1207 if (trigMode == 2 ||
1218 if (trigMode == 8 ||
1223 if (trigMode == 2 ||
1237 int trRank = trk->first.rank();
1239 int trQuality = ((trRank>>5)&0x3);
1307 int cscTrackStub = 0;
1371 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
1372 for(std::vector<csctf::TrackStub>::const_iterator stub=vstubs.begin();
1373 stub!=vstubs.end(); stub++)
1377 edm::LogInfo(
"DataNotFound") <<
"\n mbEndcap: " << stub->endcap();
1378 edm::LogInfo(
"DataNotFound") <<
"\n stub->getStrip()[FLAG]: " << stub->getStrip();
1379 edm::LogInfo(
"DataNotFound") <<
"\n stub->getKeyWG()[CAL]: " << stub->getKeyWG();
1380 edm::LogInfo(
"DataNotFound") <<
"\n stub->BX(): " << stub->BX();
1381 edm::LogInfo(
"DataNotFound") <<
"\n stub->sector(): " << stub->sector();
1382 edm::LogInfo(
"DataNotFound") <<
"\n stub->subsector(): " << stub->subsector();
1383 edm::LogInfo(
"DataNotFound") <<
"\n stub->station(): " << stub->station();
1384 edm::LogInfo(
"DataNotFound") <<
"\n stub->phiPacked(): " << stub->phiPacked();
1385 edm::LogInfo(
"DataNotFound") <<
"\n stub->getBend(): " << stub->getBend();
1386 edm::LogInfo(
"DataNotFound") <<
"\n stub->getQuality(): " << stub->getQuality();
1387 edm::LogInfo(
"DataNotFound") <<
"\n stub->cscid(): " << stub->cscid() << endl;
1390 int mbId = (stub->endcap()==2) ? 6 : 0;
1391 mbId += stub->sector();
1396 if (stub->getKeyWG() == 0)
1399 int bxDT = stub->BX()-stub->getStrip();
1400 int subDT = stub->subsector();
1407 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
1409 trkBX = trk->first.BX();
1410 int trkId = (trk->first.endcap()==2) ? 6 : 0;
1411 trkId += trk->first.sector();
1414 <<
" Sector: " << trkId
1415 <<
" SubSector: " << trk->first.subsector()
1416 <<
" Endcap: " << trk->first.endcap();
1418 edm::LogInfo(
"DataNotFound") <<
"\n DT BX: " << stub->BX()
1419 <<
" Sector: " << mbId
1420 <<
" SubSector: " << stub->subsector()
1421 <<
" Endcap: " << stub->endcap() << endl;
1428 edm::LogInfo(
"DataNotFound") <<
"Fill :" << trkBX+6-bxDT <<
" -- " << subDT <<
" -- cands" << endl;
MonitorElement * DTstubsTimeTrackMenTimeArrival[12]
MonitorElement * csctfoccupancies
unsigned long long cacheIdentifier() const
MonitorElement * csctfTrackEtaHighQ
MonitorElement * csctflcts
lclphidat localPhi(int strip, int pattern, int quality, int lr, const bool gangedME1a=false) const
Geometry Lookup Tables.
MonitorElement * csctfTrackPhi
MonitorElement * csctferrors_mpc
MonitorElement * csc_strip_MEminus22
unsigned long long m_scalesCacheID
MonitorElement * csctfTrackPhi_H
MonitorElement * csc_wire_MEplus31
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * csc_strip_MEplus21
MonitorElement * csc_strip_MEplus11
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
MonitorElement * csc_wire_MEminus13
MonitorElement * csc_wire_MEminus22
MonitorElement * me11_lctGblPhi
MonitorElement * csc_wire_MEplus12
MonitorElement * csc_wire_MEminus31
MonitorElement * csc_wire_MEminus32
MonitorElement * csctfTrackEtaLowQ
MonitorElement * csc_strip_MEminus12
static void setGeometry(const edm::ESHandle< CSCGeometry > &thegeom)
MonitorElement * csctfTrackEta
MonitorElement * me11_lctWire
MonitorElement * csc_strip_MEminus31
MonitorElement * csc_wire_MEminus21
edm::InputTag statusProducer
edm::EDGetTokenT< L1CSCStatusDigiCollection > statusToken_
MonitorElement * csctfTrackEta_H
MonitorElement * me42_lctGblPhi
const L1MuTriggerScales * ts
gblphidat globalPhiME(int phi_local, int wire_group, int cscid, const bool gangedME1a=false) const
MonitorElement * cscTrackStubNumbers
MonitorElement * csc_strip_MEminus32
MonitorElement * me11_lctStrip
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * csc_strip_MEminus42
MonitorElement * csc_wire_MEplus41
const L1MuScale * getPhiScale() const
get the phi scale
MonitorElement * csc_strip_MEplus13
Abs< T >::type abs(const T &t)
MonitorElement * csc_strip_MEplus22
MonitorElement * csc_wire_MEminus41
MonitorElement * csctfChamberOccupancies
MonitorElement * csc_wire_MEplus13
edm::InputTag lctProducer
MonitorElement * csc_wire_MEplus21
edm::EDGetTokenT< L1CSCTrackCollection > tracksToken_
MonitorElement * csc_strip_MEminus41
MonitorElement * me42_lctGblEta
MonitorElement * csc_strip_MEplus31
MonitorElement * csc_wire_MEplus32
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > corrlctsToken_
MonitorElement * csctferrors
T const * product() const
MonitorElement * csc_wire_MEminus42
class global_phi_data gblphidat
MonitorElement * csc_strip_MEplus41
MonitorElement * csctfTrackM
edm::EDGetTokenT< L1CSCTrackCollection > mbtracksToken_
T const * product() const
MonitorElement * csctfbx_H
std::vector< CSCCorrelatedLCTDigi >::const_iterator const_iterator
class local_phi_data lclphidat
Data Types.
static int triggerSubSectorFromLabels(int station, int chamber)
MonitorElement * csctfntrack
edm::InputTag trackProducer
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmtProducerToken_
MonitorElement * csc_wire_MEplus42
MonitorElement * trackModeVsQ
MonitorElement * me11_lctGblEta
gbletadat globalEtaME(int phi_bend, int phi_local, int wire_group, int cscid, const bool gangedME1a=false) const
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * csc_strip_MEminus21
MonitorElement * csctfoccupancies_H
MonitorElement * csc_strip_MEplus32
MonitorElement * csc_strip_MEplus12
static unsigned int const shift
CSCSectorReceiverLUT * srLUTs_[5][2][6]
std::pair< const_iterator, const_iterator > Range
const L1MuTriggerPtScale * tpts
MonitorElement * me11_lctLocalPhi
MonitorElement * csc_strip_MEminus11
MonitorElement * csc_strip_MEminus13
unsigned long long m_ptScaleCacheID
MonitorElement * csc_wire_MEplus11
MonitorElement * csc_wire_MEminus12
class global_eta_data gbletadat
int ism(int ieta, int iphi)
MonitorElement * cscWireStripOverflow
MonitorElement * csc_strip_MEplus42
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > dtStubsToken_
edm::InputTag gmtProducer
MonitorElement * me11_lctPackedPhi
MonitorElement * csc_wire_MEplus22
MonitorElement * csc_wire_MEminus11