28 : gmtProducer( ps.getParameter<
InputTag >(
"gmtProducer") ),
29 lctProducer( ps.getParameter<
InputTag >(
"lctProducer") ),
31 statusProducer( ps.getParameter<
InputTag >(
"statusProducer") ),
32 mbProducer( ps.getParameter<
InputTag >(
"mbProducer") )
66 for(
int sector=0; sector<6; sector++) {
69 for(
int subSector=0; subSector<2 && fpga<5; subSector++)
80 for(
int sector=0; sector<6; sector++) {
83 for(
int subSector=0; subSector<2 && fpga<5; subSector++)
101 statusToken_ = consumes<L1CSCStatusDigiCollection>(statusTag_);
102 corrlctsToken_ = consumes<CSCCorrelatedLCTDigiCollection>(corrlctsTag_);
103 tracksToken_ = consumes<L1CSCTrackCollection>(tracksTag_);
104 dtStubsToken_ = consumes<CSCTriggerContainer<csctf::TrackStub> >(dtStubsTag_);
111 for(
unsigned int j=0;
j<2;
j++)
112 for(
unsigned int i=0;
i<5;
i++)
113 for(
unsigned int s=0;
s<6;
s++)
182 trackModeVsQ = ibooker.
book2D(
"CSCTF_Track_ModeVsQual",
"CSC Track Mode Vs Quality", 19, -0.5, 18.5, 4, 0, 4);
211 csctfTrackM = ibooker.
book1D(
"CSCTF_Track_Mode",
"CSC Track Mode", 19, -0.5, 18.5);
320 csctfbx = ibooker.
book2D(
"CSCTF_bx",
"CSCTF BX", 12,1,13, 7,-3,3) ;
345 csctfbx_H = ibooker.
book2D(
"CSCTF_bx_H",
"CSCTF HALO BX", 12,1,13, 7,-3,3) ;
378 csctfntrack = ibooker.
book1D(
"CSCTF_ntrack",
"Number of CSCTracks found per event", 5, 0, 5 ) ;
389 for(
int i=0;
i<12;
i++) {
391 sprintf(hname ,
"DTstubsTimeTrackMenTimeArrival_%d",
i+1);
392 sprintf(htitle,
"T_{track} - T_{DT stub} sector %d",
i+1);
416 csctflcts = ibooker.
book2D(
"CSCTF_LCT",
"CSCTF LCTs", 12,1,13, 18,0,18);
432 for (
int iEndcap = 0; iEndcap < 2; iEndcap++) {
433 for (
int iStation = 1; iStation < 5; iStation++) {
434 for (
int iRing = 1; iRing < 4; iRing++) {
435 if (iStation != 1 && iRing > 2)
continue;
436 TString signEndcap=
"+";
437 if(iEndcap==0) signEndcap=
"-";
440 snprintf(lcttitle,200,
"ME%s%d/%d", signEndcap.Data(), iStation, iRing);
442 csctflcts -> setBinLabel(9-ihist,lcttitle,2);
444 else csctflcts -> setBinLabel(ihist+1,lcttitle,2);
594 for(
int cscid = 1; cscid < 37; cscid++){
596 sprintf(bxtitle,
"%d", cscid);
628 for(
int cscid = 1; cscid < 19; cscid++){
630 sprintf(bxtitle,
"%d", cscid);
667 edm::LogInfo(
"L1TCSCTF") <<
"Changing triggerscales and triggerptscales...";
670 int NumCSCTfTracksRep = 0;
680 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label ";
685 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
686 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
696 for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ ) {
700 vector<L1MuRegionalCand> INPCands = RRItr->getCSCCands();
701 vector<L1MuRegionalCand>::const_iterator INPItr;
707 for( INPItr = INPCands.begin(); INPItr != INPCands.end(); ++INPItr ) {
713 if (
verbose_)
edm::LogInfo(
"DataNotFound") <<
"cand " << nCandsBx <<
" -> assigned CSCTF bx: " << INPItr->bx() << endl;
720 if (nCands != 1)
return;
727 edm::LogInfo(
"DataNotFound") <<
"\tCSCTFCand ntrack " << ncsctftrack << endl;
736 bool integrity=status->first, se=
false, sm=
false, bx=
false, af=
false, fmm=
false;
739 for(std::vector<L1CSCSPStatusDigi>::const_iterator stat=status->second.begin(); stat!=status->second.end(); stat++)
741 se |= stat->SEs()&0xFFF;
742 sm |= stat->SMs()&0xFFF;
743 bx |= stat->BXs()&0xFFF;
744 af |= stat->AFs()&0xFFF;
745 fmm|= stat->FMM()!=8;
754 if(nStat!=0)
L1ABXN /= nStat;
777 int endcap = (*csc).first.endcap()-1;
778 int station = (*csc).first.station()-1;
779 int sector = (*csc).first.triggerSector()-1;
781 int ring = (*csc).first.ring();
782 int cscId = (*csc).first.triggerCscId()-1;
783 int fpga = ( subSector ? subSector-1 : station+1 );
784 int strip = lct -> getStrip();
785 int keyWire = lct -> getKeyWG();
786 int bx = lct -> getBX();
789 int endcapAssignment = 1;
791 float sectorArg = sector;
795 endcapAssignment = -1;
800 int signedStation = (station +
shift)* endcapAssignment;
801 if( (station == 0) && (endcap == 0)) signedStation = subSector - 1;
802 if( (station == 0) && (endcap == 1)) signedStation = (-1)*subSector;
804 float chamberArg1 = cscId * 0.1 + sectorArg;
808 float chamberArg11 = chamberArg1;
809 if(sectorArg == 1) chamberArg1 = chamberArg11 - 0.1;
810 if(sectorArg == 2) chamberArg1 = chamberArg11 - 0.2;
811 if(sectorArg == 3) chamberArg1 = chamberArg11 - 0.3;
812 if(sectorArg == 4) chamberArg1 = chamberArg11 - 0.4;
813 if(sectorArg == 5) chamberArg1 = chamberArg11 - 0.5;
829 if( endcap<0||endcap>1 || sector<0||sector>6 || station<0||station>3 || cscId<0||cscId>8 || fpga<0||fpga>4)
831 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);
837 if(endcap==1) EndCapLUT=0;
841 lclPhi =
srLUTs_[fpga][EndCapLUT][sector]->
localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend(),
gangedME11a_);
843 bzero(&lclPhi,
sizeof(lclPhi));
850 bzero(&gblPhi,
sizeof(gblPhi));
857 bzero(&gblEta,
sizeof(gblEta));
878 }
else if(station==1) {
881 }
else if(station==2) {
884 }
else if(station==3) {
894 }
else if(station==1) {
897 }
else if(station==2) {
900 }
else if(station==3) {
911 if(station == 0 && ring == 1){
921 if(station == 3 && ring == 2){
928 if (station == 0 && ring == 1){
929 int realID = cscId+6*sector+3*subSector;
930 if(realID>36) realID -= 36;
935 if (station == 0 && ring == 2){
936 int realID = (cscId-3)+6*sector+3*subSector;
937 if(realID>36) realID -= 36;
942 if (station == 0 && ring == 3){
943 int realID = (cscId-6)+6*sector+3*subSector;
944 if(realID>36) realID -= 36;
949 if (station == 1 && ring == 1){
950 int realID = cscId+3*sector+2;
951 if(realID>18) realID -= 18;
956 if (station == 1 && ring == 2){
957 int realID = (cscId-3)+6*sector+3;
958 if(realID>36) realID -= 36;
964 if (station == 2 && ring == 1){
965 int realID = cscId+3*sector+2;
966 if(realID>18) realID -= 18;
972 if (station == 2 && ring == 2){
973 int realID = (cscId-3)+6*sector+3;
974 if(realID>36) realID -= 36;
979 if (station == 3 && ring == 1){
980 int realID = cscId+3*sector+2;
981 if(realID>18) realID -= 18;
986 if (station == 3 && ring == 2){
987 int realID = (cscId-3)+6*sector+3;
988 if(realID>36) realID -= 36;
1013 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
1016 NumCSCTfTracksRep++;
1017 long LUTAdd = trk->first.ptLUTAddress();
1018 int trigMode = ( (LUTAdd)&0xf0000 ) >> 16;
1019 int trEta = (trk->first.eta_packed() );
1025 if( trk->first.endcap() != 1)
1032 int trSector = 6*(trk->first.endcap()-1)+trk->first.sector();
1033 int trBX = trk->first.BX();
1047 double trPhi02PI = fmod(trPhi +
1048 ((trSector-1)*
M_PI/3) +
1051 if (trigMode == 15) {
1065 if (
abs(trEta) < 24) {
1066 if (trigMode == 2 ||
1077 if (trigMode == 8 ||
1082 if (trigMode == 2 ||
1096 int trRank = trk->first.rank();
1098 int trQuality = ((trRank>>5)&0x3);
1166 int cscTrackStub = 0;
1230 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
1231 for(std::vector<csctf::TrackStub>::const_iterator stub=vstubs.begin();
1232 stub!=vstubs.end(); stub++)
1236 edm::LogInfo(
"DataNotFound") <<
"\n mbEndcap: " << stub->endcap();
1237 edm::LogInfo(
"DataNotFound") <<
"\n stub->getStrip()[FLAG]: " << stub->getStrip();
1238 edm::LogInfo(
"DataNotFound") <<
"\n stub->getKeyWG()[CAL]: " << stub->getKeyWG();
1239 edm::LogInfo(
"DataNotFound") <<
"\n stub->BX(): " << stub->BX();
1240 edm::LogInfo(
"DataNotFound") <<
"\n stub->sector(): " << stub->sector();
1241 edm::LogInfo(
"DataNotFound") <<
"\n stub->subsector(): " << stub->subsector();
1242 edm::LogInfo(
"DataNotFound") <<
"\n stub->station(): " << stub->station();
1243 edm::LogInfo(
"DataNotFound") <<
"\n stub->phiPacked(): " << stub->phiPacked();
1244 edm::LogInfo(
"DataNotFound") <<
"\n stub->getBend(): " << stub->getBend();
1245 edm::LogInfo(
"DataNotFound") <<
"\n stub->getQuality(): " << stub->getQuality();
1246 edm::LogInfo(
"DataNotFound") <<
"\n stub->cscid(): " << stub->cscid() << endl;
1249 int mbId = (stub->endcap()==2) ? 6 : 0;
1250 mbId += stub->sector();
1255 if (stub->getKeyWG() == 0)
1258 int bxDT = stub->BX()-stub->getStrip();
1259 int subDT = stub->subsector();
1266 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
1268 trkBX = trk->first.BX();
1269 int trkId = (trk->first.endcap()==2) ? 6 : 0;
1270 trkId += trk->first.sector();
1273 <<
" Sector: " << trkId
1274 <<
" SubSector: " << trk->first.subsector()
1275 <<
" Endcap: " << trk->first.endcap();
1277 edm::LogInfo(
"DataNotFound") <<
"\n DT BX: " << stub->BX()
1278 <<
" Sector: " << mbId
1279 <<
" SubSector: " << stub->subsector()
1280 <<
" Endcap: " << stub->endcap() << endl;
1287 edm::LogInfo(
"DataNotFound") <<
"Fill :" << trkBX+6-bxDT <<
" -- " << subDT <<
" -- cands" << endl;
MonitorElement * DTstubsTimeTrackMenTimeArrival[12]
MonitorElement * csctfoccupancies
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
MonitorElement * csctfTrackEtaHighQ
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * csctflcts
lclphidat localPhi(int strip, int pattern, int quality, int lr, const bool gangedME1a=false) const
Geometry Lookup Tables.
MonitorElement * csctfTrackPhi
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
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_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
void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * me11_lctWire
MonitorElement * csc_strip_MEminus31
unsigned phiPacked() const
Return the binned phi for this stub.
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
double etaValue() const
return the Eta Value of this stub's position.
const L1MuScale * getPhiScale() const
get the phi scale
MonitorElement * book1D(Args &&...args)
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
MonitorElement * csc_wire_MEplus13
edm::InputTag lctProducer
MonitorElement * csc_wire_MEplus21
virtual void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< L1CSCTrackCollection > tracksToken_
MonitorElement * csc_strip_MEminus41
MonitorElement * me42_lctGblEta
MonitorElement * csc_strip_MEplus31
MonitorElement * csc_wire_MEplus32
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > corrlctsToken_
double phiValue() const
return the Phi Value of this stub's position in local coordinates.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * csctferrors
T const * product() const
MonitorElement * book2D(Args &&...args)
void addUntrackedParameter(std::string const &name, T const &value)
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.
virtual void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
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
void setPhiPacked(const unsigned &phi_)
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
TH2F * getTH2F(void) const
MonitorElement * csc_wire_MEminus12
class global_eta_data gbletadat
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
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