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) {
909 if(station == 0 && ring == 1){
919 if(station == 3 && ring == 2){
926 if (station == 0 && ring == 1){
927 int realID = cscId+6*sector+3*subSector;
928 if(realID>36) realID -= 36;
933 if (station == 0 && ring == 2){
934 int realID = (cscId-3)+6*sector+3*subSector;
935 if(realID>36) realID -= 36;
940 if (station == 0 && ring == 3){
941 int realID = (cscId-6)+6*sector+3*subSector;
942 if(realID>36) realID -= 36;
947 if (station == 1 && ring == 1){
948 int realID = cscId+3*sector+2;
949 if(realID>18) realID -= 18;
954 if (station == 1 && ring == 2){
955 int realID = (cscId-3)+6*sector+3;
956 if(realID>36) realID -= 36;
962 if (station == 2 && ring == 1){
963 int realID = cscId+3*sector+2;
964 if(realID>18) realID -= 18;
970 if (station == 2 && ring == 2){
971 int realID = (cscId-3)+6*sector+3;
972 if(realID>36) realID -= 36;
977 if (station == 3 && ring == 1){
978 int realID = cscId+3*sector+2;
979 if(realID>18) realID -= 18;
984 if (station == 3 && ring == 2){
985 int realID = (cscId-3)+6*sector+3;
986 if(realID>36) realID -= 36;
1011 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
1014 NumCSCTfTracksRep++;
1015 long LUTAdd = trk->first.ptLUTAddress();
1016 int trigMode = ( (LUTAdd)&0xf0000 ) >> 16;
1017 int trEta = (trk->first.eta_packed() );
1023 if( trk->first.endcap() != 1)
1030 int trSector = 6*(trk->first.endcap()-1)+trk->first.sector();
1031 int trBX = trk->first.BX();
1045 double trPhi02PI = fmod(trPhi +
1046 ((trSector-1)*
M_PI/3) +
1049 if (trigMode == 15) {
1063 if (
abs(trEta) < 24) {
1064 if (trigMode == 2 ||
1075 if (trigMode == 8 ||
1080 if (trigMode == 2 ||
1094 int trRank = trk->first.rank();
1096 int trQuality = ((trRank>>5)&0x3);
1164 int cscTrackStub = 0;
1228 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
1229 for(std::vector<csctf::TrackStub>::const_iterator stub=vstubs.begin();
1230 stub!=vstubs.end(); stub++)
1234 edm::LogInfo(
"DataNotFound") <<
"\n mbEndcap: " << stub->endcap();
1235 edm::LogInfo(
"DataNotFound") <<
"\n stub->getStrip()[FLAG]: " << stub->getStrip();
1236 edm::LogInfo(
"DataNotFound") <<
"\n stub->getKeyWG()[CAL]: " << stub->getKeyWG();
1237 edm::LogInfo(
"DataNotFound") <<
"\n stub->BX(): " << stub->BX();
1238 edm::LogInfo(
"DataNotFound") <<
"\n stub->sector(): " << stub->sector();
1239 edm::LogInfo(
"DataNotFound") <<
"\n stub->subsector(): " << stub->subsector();
1240 edm::LogInfo(
"DataNotFound") <<
"\n stub->station(): " << stub->station();
1241 edm::LogInfo(
"DataNotFound") <<
"\n stub->phiPacked(): " << stub->phiPacked();
1242 edm::LogInfo(
"DataNotFound") <<
"\n stub->getBend(): " << stub->getBend();
1243 edm::LogInfo(
"DataNotFound") <<
"\n stub->getQuality(): " << stub->getQuality();
1244 edm::LogInfo(
"DataNotFound") <<
"\n stub->cscid(): " << stub->cscid() << endl;
1247 int mbId = (stub->endcap()==2) ? 6 : 0;
1248 mbId += stub->sector();
1253 if (stub->getKeyWG() == 0)
1256 int bxDT = stub->BX()-stub->getStrip();
1257 int subDT = stub->subsector();
1264 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
1266 trkBX = trk->first.BX();
1267 int trkId = (trk->first.endcap()==2) ? 6 : 0;
1268 trkId += trk->first.sector();
1271 <<
" Sector: " << trkId
1272 <<
" SubSector: " << trk->first.subsector()
1273 <<
" Endcap: " << trk->first.endcap();
1275 edm::LogInfo(
"DataNotFound") <<
"\n DT BX: " << stub->BX()
1276 <<
" Sector: " << mbId
1277 <<
" SubSector: " << stub->subsector()
1278 <<
" Endcap: " << stub->endcap() << endl;
1285 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