37 edm::LogInfo(
"DataNotFound") <<
"L1TCSCTF: constructor...." << endl;
67 for (
int subSector = 0; subSector < 2 && fpga < 5; subSector++)
80 for (
int subSector = 0; subSector < 2 && fpga < 5; subSector++)
96 statusToken_ = consumes<L1CSCStatusDigiCollection>(statusTag_);
97 corrlctsToken_ = consumes<CSCCorrelatedLCTDigiCollection>(corrlctsTag_);
98 tracksToken_ = consumes<L1CSCTrackCollection>(tracksTag_);
99 dtStubsToken_ = consumes<CSCTriggerContainer<csctf::TrackStub> >(dtStubsTag_);
104 for (
unsigned int j = 0;
j < 2;
j++)
105 for (
unsigned int i = 0;
i < 5;
i++)
106 for (
unsigned int s = 0;
s < 6;
s++)
141 for (
int ybin = 1; ybin <= 60; ybin++) {
145 snprintf(
ytitle, 50,
"%d", ybin);
188 trackModeVsQ = ibooker.
book2D(
"CSCTF_Track_ModeVsQual",
"CSC Track Mode Vs Quality", 19, -0.5, 18.5, 4, 0, 4);
217 csctfTrackM = ibooker.
book1D(
"CSCTF_Track_Mode",
"CSC Track Mode", 19, -0.5, 18.5);
241 ibooker.
book2D(
"CSCTF_Chamber_Occupancies",
"CSCTF Chamber Occupancies", 54, -0.05, 5.35, 10, -5.5, 4.5);
325 csctfbx = ibooker.
book2D(
"CSCTF_bx",
"CSCTF BX", 12, 1, 13, 7, -3, 3);
350 csctfbx_H = ibooker.
book2D(
"CSCTF_bx_H",
"CSCTF HALO BX", 12, 1, 13, 7, -3, 3);
383 csctfntrack = ibooker.
book1D(
"CSCTF_ntrack",
"Number of CSCTracks found per event", 5, 0, 5);
394 for (
int i = 0;
i < 12;
i++) {
395 sprintf(hname,
"DTstubsTimeTrackMenTimeArrival_%d",
i + 1);
396 sprintf(htitle,
"T_{track} - T_{DT stub} sector %d",
i + 1);
420 csctflcts = ibooker.
book2D(
"CSCTF_LCT",
"CSCTF LCTs", 12, 1, 13, 18, 0, 18);
436 for (
int iEndcap = 0; iEndcap < 2; iEndcap++) {
437 for (
int iStation = 1; iStation < 5; iStation++) {
438 for (
int iRing = 1; iRing < 4; iRing++) {
439 if (iStation != 1 && iRing > 2)
441 TString signEndcap =
"+";
446 snprintf(lcttitle, 200,
"ME%s%d/%d", signEndcap.Data(), iStation, iRing);
599 for (
int cscid = 1; cscid < 37; cscid++) {
601 sprintf(bxtitle,
"%d", cscid);
633 for (
int cscid = 1; cscid < 19; cscid++) {
635 sprintf(bxtitle,
"%d", cscid);
664 edm::LogInfo(
"L1TCSCTF") <<
"Changing triggerscales and triggerptscales...";
667 int NumCSCTfTracksRep = 0;
670 edm::LogInfo(
"DataNotFound") <<
"L1TCSCTF: analyze...." << endl;
676 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label ";
681 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
682 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
692 for (RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++) {
696 vector<L1MuRegionalCand> INPCands = RRItr->getCSCCands();
697 vector<L1MuRegionalCand>::const_iterator INPItr;
703 for (INPItr = INPCands.begin(); INPItr != INPCands.end(); ++INPItr) {
704 if (!INPItr->empty()) {
709 edm::LogInfo(
"DataNotFound") <<
"cand " << nCandsBx <<
" -> assigned CSCTF bx: " << INPItr->bx() << endl;
722 edm::LogInfo(
"DataNotFound") <<
"bxWindow: " << bxWindow << endl;
726 edm::LogInfo(
"DataNotFound") <<
"\tCSCTFCand ntrack " << ncsctftrack << endl;
734 bool integrity =
status->first, se =
false, sm =
false,
bx =
false, af =
false, fmm =
false;
737 for (std::vector<L1CSCSPStatusDigi>::const_iterator
stat =
status->second.begin();
stat !=
status->second.end();
739 se |=
stat->SEs() & 0xFFF;
740 sm |=
stat->SMs() & 0xFFF;
741 bx |=
stat->BXs() & 0xFFF;
742 af |=
stat->AFs() & 0xFFF;
743 fmm |=
stat->FMM() != 8;
745 int ise =
stat->SEs() & 0xFFF;
747 int ibx =
stat->BXs() & 0xFFF;
748 int iaf =
stat->AFs() & 0xFFF;
749 int ifmm =
stat->FMM();
750 int slot =
stat->slot();
752 for (
int j = 0;
j < 15;
j++) {
756 if (slot >= 6 && slot <= 11)
758 if (slot >= 16 && slot <= 21)
762 if (link >= 1 && link <= 3)
764 else if (link >= 4 && link <= 6)
766 else if (link >= 7 && link <= 9)
768 else if (link >= 10 && link <= 12)
770 else if (link >= 13 && link <= 15)
772 }
else if (sp_num == 2) {
773 if (link >= 1 && link <= 3)
775 else if (link >= 4 && link <= 6)
777 else if (link >= 7 && link <= 9)
779 else if (link >= 10 && link <= 12)
781 else if (link >= 13 && link <= 15)
783 }
else if (sp_num == 3) {
784 if (link >= 1 && link <= 3)
786 else if (link >= 4 && link <= 6)
788 else if (link >= 7 && link <= 9)
790 else if (link >= 10 && link <= 12)
792 else if (link >= 13 && link <= 15)
794 }
else if (sp_num == 4) {
795 if (link >= 1 && link <= 3)
797 else if (link >= 4 && link <= 6)
799 else if (link >= 7 && link <= 9)
801 else if (link >= 10 && link <= 12)
803 else if (link >= 13 && link <= 15)
805 }
else if (sp_num == 5) {
806 if (link >= 1 && link <= 3)
808 else if (link >= 4 && link <= 6)
810 else if (link >= 7 && link <= 9)
812 else if (link >= 10 && link <= 12)
814 else if (link >= 13 && link <= 15)
816 }
else if (sp_num == 6) {
817 if (link >= 1 && link <= 3)
819 else if (link >= 4 && link <= 6)
821 else if (link >= 7 && link <= 9)
823 else if (link >= 10 && link <= 12)
825 else if (link >= 13 && link <= 15)
827 }
else if (sp_num == 7) {
828 if (link >= 1 && link <= 3)
830 else if (link >= 4 && link <= 6)
832 else if (link >= 7 && link <= 9)
834 else if (link >= 10 && link <= 12)
836 else if (link >= 13 && link <= 15)
838 }
else if (sp_num == 8) {
839 if (link >= 1 && link <= 3)
841 else if (link >= 4 && link <= 6)
843 else if (link >= 7 && link <= 9)
845 else if (link >= 10 && link <= 12)
847 else if (link >= 13 && link <= 15)
849 }
else if (sp_num == 9) {
850 if (link >= 1 && link <= 3)
852 else if (link >= 4 && link <= 6)
854 else if (link >= 7 && link <= 9)
856 else if (link >= 10 && link <= 12)
858 else if (link >= 13 && link <= 15)
860 }
else if (sp_num == 10) {
861 if (link >= 1 && link <= 3)
863 else if (link >= 4 && link <= 6)
865 else if (link >= 7 && link <= 9)
867 else if (link >= 10 && link <= 12)
869 else if (link >= 13 && link <= 15)
871 }
else if (sp_num == 11) {
872 if (link >= 1 && link <= 3)
874 else if (link >= 4 && link <= 6)
876 else if (link >= 7 && link <= 9)
878 else if (link >= 10 && link <= 12)
880 else if (link >= 13 && link <= 15)
882 }
else if (sp_num == 12) {
883 if (link >= 1 && link <= 3)
885 else if (link >= 4 && link <= 6)
887 else if (link >= 7 && link <= 9)
889 else if (link >= 10 && link <= 12)
891 else if (link >= 13 && link <= 15)
897 if ((ise >>
j) & 0
x1)
901 if ((ibx >>
j) & 0
x1)
903 if ((iaf >>
j) & 0
x1)
909 if (
stat->VPs() != 0) {
943 int endcap = (*csc).first.endcap() - 1;
944 int station = (*csc).first.station() - 1;
945 int sector = (*csc).first.triggerSector() - 1;
947 int ring = (*csc).first.ring();
948 int cscId = (*csc).first.triggerCscId() - 1;
949 int fpga = (subSector ? subSector - 1 :
station + 1);
950 int strip = lct->getStrip();
951 int keyWire = lct->getKeyWG();
952 int bx = lct->getBX();
954 int endcapAssignment = 1;
960 endcapAssignment = -1;
965 int signedStation = (
station +
shift) * endcapAssignment;
967 signedStation = subSector - 1;
969 signedStation = (-1) * subSector;
971 float chamberArg1 = cscId * 0.1 + sectorArg;
975 float chamberArg11 = chamberArg1;
977 chamberArg1 = chamberArg11 - 0.1;
979 chamberArg1 = chamberArg11 - 0.2;
981 chamberArg1 = chamberArg11 - 0.3;
983 chamberArg1 = chamberArg11 - 0.4;
985 chamberArg1 = chamberArg11 - 0.5;
1001 if (endcap < 0 || endcap > 1 || sector < 0 || sector > 6 || station < 0 || station > 3 || cscId < 0 ||
1002 cscId > 8 || fpga < 0 || fpga > 4) {
1004 <<
" endcap: " << (
endcap + 1) <<
" station: " << (
station + 1) <<
" sector: " << (
sector + 1)
1005 <<
" subSector: " << subSector <<
" fpga: " << fpga <<
" cscId: " << (cscId + 1);
1017 lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend(),
gangedME11a_);
1019 bzero(&lclPhi,
sizeof(lclPhi));
1027 bzero(&gblPhi,
sizeof(gblPhi));
1033 lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId + 1,
gangedME11a_);
1035 bzero(&gblEta,
sizeof(gblEta));
1118 int realID = cscId + 6 *
sector + 3 * subSector;
1124 if (keyWire > 48 ||
strip > 224)
1130 if (keyWire > 48 ||
strip > 224)
1136 int realID = (cscId - 3) + 6 *
sector + 3 * subSector;
1142 if (keyWire > 64 ||
strip > 160)
1148 if (keyWire > 64 ||
strip > 160)
1154 int realID = (cscId - 6) + 6 *
sector + 3 * subSector;
1160 if (keyWire > 32 ||
strip > 128)
1166 if (keyWire > 32 ||
strip > 128)
1172 int realID = cscId + 3 *
sector + 2;
1178 if (keyWire > 112 ||
strip > 160)
1184 if (keyWire > 112 ||
strip > 160)
1190 int realID = (cscId - 3) + 6 *
sector + 3;
1196 if (keyWire > 64 ||
strip > 160)
1202 if (keyWire > 64 ||
strip > 160)
1209 int realID = cscId + 3 *
sector + 2;
1215 if (keyWire > 96 ||
strip > 160)
1221 if (keyWire > 96 ||
strip > 160)
1228 int realID = (cscId - 3) + 6 *
sector + 3;
1234 if (keyWire > 64 ||
strip > 160)
1240 if (keyWire > 64 ||
strip > 160)
1246 int realID = cscId + 3 *
sector + 2;
1252 if (keyWire > 96 ||
strip > 160)
1258 if (keyWire > 96 ||
strip > 160)
1264 int realID = (cscId - 3) + 6 *
sector + 3;
1270 if (keyWire > 64 ||
strip > 160)
1276 if (keyWire > 64 ||
strip > 160)
1293 for (L1CSCTrackCollection::const_iterator trk =
tracks->begin(); trk <
tracks->end(); trk++) {
1294 NumCSCTfTracksRep++;
1295 long LUTAdd = trk->first.ptLUTAddress();
1296 int trigMode = ((LUTAdd)&0xf0000) >> 16;
1297 int trEta = (trk->first.eta_packed());
1302 if (trk->first.endcap() != 1) {
1304 trEta = -1 * holder;
1308 int trSector = 6 * (trk->first.endcap() - 1) + trk->first.sector();
1309 int trBX = trk->first.BX();
1323 double trPhi02PI = fmod(trPhi + ((trSector - 1) *
M_PI / 3) + (
M_PI * 14 / 180.), 2 *
M_PI);
1325 if (trigMode == 15) {
1338 if (
abs(trEta) < 24) {
1339 if (trigMode == 2 || trigMode == 3 || trigMode == 4 || trigMode == 5 || trigMode == 6 || trigMode == 7 ||
1340 trigMode == 11 || trigMode == 12 || trigMode == 13 || trigMode == 14)
1343 if (trigMode == 8 || trigMode == 9 || trigMode == 10)
1346 if (trigMode == 2 || trigMode == 3 || trigMode == 4 || trigMode == 5)
1358 int trRank = trk->first.rank();
1360 int trQuality = ((trRank >> 5) & 0x3);
1428 int cscTrackStub = 0;
1434 trackStub != lctsOfTracks.end();
1487 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
1488 for (std::vector<csctf::TrackStub>::const_iterator stub = vstubs.begin(); stub != vstubs.end(); stub++) {
1490 edm::LogInfo(
"DataNotFound") <<
"\n mbEndcap: " << stub->endcap();
1491 edm::LogInfo(
"DataNotFound") <<
"\n stub->getStrip()[FLAG]: " << stub->getStrip();
1492 edm::LogInfo(
"DataNotFound") <<
"\n stub->getKeyWG()[CAL]: " << stub->getKeyWG();
1493 edm::LogInfo(
"DataNotFound") <<
"\n stub->BX(): " << stub->BX();
1494 edm::LogInfo(
"DataNotFound") <<
"\n stub->sector(): " << stub->sector();
1495 edm::LogInfo(
"DataNotFound") <<
"\n stub->subsector(): " << stub->subsector();
1496 edm::LogInfo(
"DataNotFound") <<
"\n stub->station(): " << stub->station();
1497 edm::LogInfo(
"DataNotFound") <<
"\n stub->phiPacked(): " << stub->phiPacked();
1498 edm::LogInfo(
"DataNotFound") <<
"\n stub->getBend(): " << stub->getBend();
1499 edm::LogInfo(
"DataNotFound") <<
"\n stub->getQuality(): " << stub->getQuality();
1500 edm::LogInfo(
"DataNotFound") <<
"\n stub->cscid(): " << stub->cscid() << endl;
1503 int mbId = (stub->endcap() == 2) ? 6 : 0;
1504 mbId += stub->sector();
1509 if (stub->getKeyWG() == 0)
1512 int bxDT = stub->BX() - stub->getStrip();
1513 int subDT = stub->subsector();
1519 for (L1CSCTrackCollection::const_iterator trk =
tracks->begin(); trk <
tracks->end(); trk++) {
1520 trkBX = trk->first.BX();
1521 int trkId = (trk->first.endcap() == 2) ? 6 : 0;
1522 trkId += trk->first.sector();
1525 <<
"\n trk BX: " << trkBX <<
" Sector: " << trkId <<
" SubSector: " << trk->first.subsector()
1526 <<
" Endcap: " << trk->first.endcap();
1529 <<
"\n DT BX: " << stub->BX() <<
" Sector: " << mbId <<
" SubSector: " << stub->subsector()
1530 <<
" Endcap: " << stub->endcap() << endl;
1533 if (mbId == trkId) {
1536 edm::LogInfo(
"DataNotFound") <<
"Fill :" << trkBX + 6 - bxDT <<
" -- " << subDT <<
" -- cands" << endl;
MonitorElement * DTstubsTimeTrackMenTimeArrival[12]
MonitorElement * csctfoccupancies
MonitorElement * csctfTrackEtaHighQ
MonitorElement * csctflcts
unsigned phiPacked() const
Return the binned phi for this stub.
T getParameter(std::string const &) const
MonitorElement * csctfTrackPhi
MonitorElement * csctferrors_mpc
MonitorElement * csc_strip_MEminus22
unsigned long long m_scalesCacheID
MonitorElement * csctfTrackPhi_H
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * csc_wire_MEplus31
MonitorElement * csc_strip_MEplus21
edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > l1muTscalesToken_
MonitorElement * csc_strip_MEplus11
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
T const * product() const
MonitorElement * csc_wire_MEminus13
MonitorElement * csc_wire_MEminus22
MonitorElement * me11_lctGblPhi
MonitorElement * csc_wire_MEplus12
MonitorElement * csc_wire_MEminus31
double etaValue() const
return the Eta Value of this stub's position.
MonitorElement * csc_wire_MEminus32
MonitorElement * csctfTrackEtaLowQ
const L1MuScale * getPhiScale() const
get the phi scale
Log< level::Error, false > LogError
MonitorElement * csc_strip_MEminus12
MonitorElement * csctfTrackEta
MonitorElement * me11_lctWire
MonitorElement * csc_strip_MEminus31
unsigned long long cacheIdentifier() const
MonitorElement * csc_wire_MEminus21
edm::InputTag statusProducer
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< L1CSCStatusDigiCollection > statusToken_
MonitorElement * csctfTrackEta_H
MonitorElement * me42_lctGblPhi
const L1MuTriggerScales * ts
MonitorElement * cscTrackStubNumbers
MonitorElement * csc_strip_MEminus32
MonitorElement * me11_lctStrip
edm::ESGetToken< L1MuTriggerPtScale, L1MuTriggerPtScaleRcd > ptscalesToken_
MonitorElement * csc_strip_MEminus42
MonitorElement * csc_wire_MEplus41
MonitorElement * csc_strip_MEplus13
Abs< T >::type abs(const T &t)
MonitorElement * csc_strip_MEplus22
MonitorElement * csc_wire_MEminus41
L1TCSCTF(const edm::ParameterSet &ps)
MonitorElement * csctfChamberOccupancies
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * csc_wire_MEplus13
edm::InputTag lctProducer
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * csc_wire_MEplus21
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< L1CSCTrackCollection > tracksToken_
MonitorElement * csc_strip_MEminus41
Log< level::Info, false > LogInfo
MonitorElement * me42_lctGblEta
MonitorElement * csc_strip_MEplus31
MonitorElement * csc_wire_MEplus32
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > corrlctsToken_
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * csctferrors
void addUntrackedParameter(std::string const &name, T const &value)
MonitorElement * csc_wire_MEminus42
class global_phi_data gblphidat
MonitorElement * csc_strip_MEplus41
std::pair< const_iterator, const_iterator > Range
MonitorElement * csctfTrackM
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
edm::EDGetTokenT< L1CSCTrackCollection > mbtracksToken_
MonitorElement * csctfbx_H
std::vector< DigiType >::const_iterator const_iterator
class local_phi_data lclphidat
Data Types.
static int triggerSubSectorFromLabels(int station, int chamber)
double phiValue() const
return the Phi Value of this stub's position in local coordinates.
gblphidat globalPhiME(int phi_local, int wire_group, int cscid, const bool gangedME1a=false) const
MonitorElement * csctfntrack
edm::InputTag trackProducer
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmtProducerToken_
MonitorElement * csc_wire_MEplus42
MonitorElement * trackModeVsQ
MonitorElement * me11_lctGblEta
lclphidat localPhi(int strip, int pattern, int quality, int lr, const bool gangedME1a=false) const
Geometry Lookup Tables.
MonitorElement * csc_strip_MEminus21
MonitorElement * csctfoccupancies_H
MonitorElement * csc_strip_MEplus32
MonitorElement * csc_strip_MEplus12
static unsigned int const shift
void setPhiPacked(const unsigned &phi_)
trackProducer
Run2: False; Run1: True.
CSCSectorReceiverLUT * srLUTs_[5][2][6]
gbletadat globalEtaME(int phi_bend, int phi_local, int wire_group, int cscid, const bool gangedME1a=false) const
const L1MuTriggerPtScale * tpts
MonitorElement * me11_lctLocalPhi
MonitorElement * csc_strip_MEminus11
MonitorElement * csc_strip_MEminus13
unsigned long long m_ptScaleCacheID
MonitorElement * csc_wire_MEplus11
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
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
void setEtaPacked(const unsigned &eta_)
set Eta and Phi from integer values.
MonitorElement * me11_lctPackedPhi
MonitorElement * csc_wire_MEplus22
MonitorElement * csc_wire_MEminus11
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)