28 : gmtProducer( ps.getParameter<
InputTag >(
"gmtProducer") ),
29 lctProducer( ps.getParameter<
InputTag >(
"lctProducer") ),
30 trackProducer( ps.getParameter<
InputTag >(
"trackProducer") ),
31 statusProducer( ps.getParameter<
InputTag >(
"statusProducer") ),
32 mbProducer( ps.getParameter<
InputTag >(
"mbProducer") )
77 for(
int subSector=0; subSector<2 && fpga<5; subSector++)
91 statusToken_ = consumes<L1CSCStatusDigiCollection>(statusTag_);
92 corrlctsToken_ = consumes<CSCCorrelatedLCTDigiCollection>(corrlctsTag_);
93 tracksToken_ = consumes<L1CSCTrackCollection>(tracksTag_);
94 dtStubsToken_ = consumes<CSCTriggerContainer<csctf::TrackStub> >(dtStubsTag_);
101 for(
int i=0;
i<5;
i++)
119 dbe->
rmdir(
"L1T/L1TCSCTF");
180 trackModeVsQ = dbe->
book2D(
"CSCTF_Track_ModeVsQual",
"CSC Track Mode Vs Quality", 19, -0.5, 18.5, 4, 0, 4);
318 csctfbx = dbe->
book2D(
"CSCTF_bx",
"CSCTF BX", 12,1,13, 7,-3,3) ;
343 csctfbx_H = dbe->
book2D(
"CSCTF_bx_H",
"CSCTF HALO BX", 12,1,13, 7,-3,3) ;
376 csctfntrack = dbe->
book1D(
"CSCTF_ntrack",
"Number of CSCTracks found per event", 5, 0, 5 ) ;
387 for(
int i=0;
i<12;
i++) {
389 sprintf(hname ,
"DTstubsTimeTrackMenTimeArrival_%d",
i+1);
390 sprintf(htitle,
"T_{track} - T_{DT stub} sector %d",
i+1);
419 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
441 edm::LogInfo(
"L1TCSCTF") <<
"Changing triggerscales and triggerptscales...";
444 int NumCSCTfTracksRep = 0;
454 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label ";
459 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
460 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
470 for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ ) {
474 vector<L1MuRegionalCand> INPCands = RRItr->getCSCCands();
475 vector<L1MuRegionalCand>::const_iterator INPItr;
481 for( INPItr = INPCands.begin(); INPItr != INPCands.end(); ++INPItr ) {
487 if (
verbose_)
edm::LogInfo(
"DataNotFound") <<
"cand " << nCandsBx <<
" -> assigned CSCTF bx: " << INPItr->bx() << endl;
494 if (nCands != 1)
return;
501 edm::LogInfo(
"DataNotFound") <<
"\tCSCTFCand ntrack " << ncsctftrack << endl;
510 bool integrity=status->first, se=
false, sm=
false, bx=
false, af=
false, fmm=
false;
513 for(std::vector<L1CSCSPStatusDigi>::const_iterator stat=status->second.begin(); stat!=status->second.end(); stat++)
515 se |= stat->SEs()&0xFFF;
516 sm |= stat->SMs()&0xFFF;
517 bx |= stat->BXs()&0xFFF;
518 af |= stat->AFs()&0xFFF;
519 fmm|= stat->FMM()!=8;
528 if(nStat!=0)
L1ABXN /= nStat;
551 int endcap = (*csc).first.endcap()-1;
552 int station = (*csc).first.station()-1;
553 int sector = (*csc).first.triggerSector()-1;
555 int cscId = (*csc).first.triggerCscId()-1;
556 int fpga = ( subSector ? subSector-1 : station+1 );
558 int endcapAssignment = 1;
560 float sectorArg = sector;
564 endcapAssignment = -1;
569 int signedStation = (station +
shift)* endcapAssignment;
570 if( (station == 0) && (endcap == 0)) signedStation = subSector - 1;
571 if( (station == 0) && (endcap == 1)) signedStation = (-1)*subSector;
573 float chamberArg1 = cscId * 0.1 + sectorArg;
577 float chamberArg11 = chamberArg1;
578 if(sectorArg == 1) chamberArg1 = chamberArg11 - 0.1;
579 if(sectorArg == 2) chamberArg1 = chamberArg11 - 0.2;
580 if(sectorArg == 3) chamberArg1 = chamberArg11 - 0.3;
581 if(sectorArg == 4) chamberArg1 = chamberArg11 - 0.4;
582 if(sectorArg == 5) chamberArg1 = chamberArg11 - 0.5;
598 if( endcap<0||endcap>1 || sector<0||sector>6 || station<0||station>3 || cscId<0||cscId>8 || fpga<0||fpga>4)
600 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);
605 lclPhi =
srLUTs_[fpga]->
localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend());
607 bzero(&lclPhi,
sizeof(lclPhi));
614 bzero(&gblPhi,
sizeof(gblPhi));
619 gblEta =
srLUTs_[fpga]->
globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1);
621 bzero(&gblEta,
sizeof(gblEta));
639 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
643 long LUTAdd = trk->first.ptLUTAddress();
644 int trigMode = ( (LUTAdd)&0xf0000 ) >> 16;
645 int trEta = (trk->first.eta_packed() );
651 if( trk->first.endcap() != 1)
658 int trSector = 6*(trk->first.endcap()-1)+trk->first.sector();
659 int trBX = trk->first.BX();
673 double trPhi02PI = fmod(trPhi +
674 ((trSector-1)*
M_PI/3) +
677 if (trigMode == 15) {
691 if (
abs(trEta) < 24) {
722 int trRank = trk->first.rank();
724 int trQuality = ((trRank>>5)&0x3);
792 int cscTrackStub = 0;
856 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
857 for(std::vector<csctf::TrackStub>::const_iterator stub=vstubs.begin();
858 stub!=vstubs.end(); stub++)
862 edm::LogInfo(
"DataNotFound") <<
"\n mbEndcap: " << stub->endcap();
863 edm::LogInfo(
"DataNotFound") <<
"\n stub->getStrip()[FLAG]: " << stub->getStrip();
864 edm::LogInfo(
"DataNotFound") <<
"\n stub->getKeyWG()[CAL]: " << stub->getKeyWG();
865 edm::LogInfo(
"DataNotFound") <<
"\n stub->BX(): " << stub->BX();
866 edm::LogInfo(
"DataNotFound") <<
"\n stub->sector(): " << stub->sector();
867 edm::LogInfo(
"DataNotFound") <<
"\n stub->subsector(): " << stub->subsector();
868 edm::LogInfo(
"DataNotFound") <<
"\n stub->station(): " << stub->station();
869 edm::LogInfo(
"DataNotFound") <<
"\n stub->phiPacked(): " << stub->phiPacked();
870 edm::LogInfo(
"DataNotFound") <<
"\n stub->getBend(): " << stub->getBend();
871 edm::LogInfo(
"DataNotFound") <<
"\n stub->getQuality(): " << stub->getQuality();
872 edm::LogInfo(
"DataNotFound") <<
"\n stub->cscid(): " << stub->cscid() << endl;
875 int mbId = (stub->endcap()==2) ? 6 : 0;
876 mbId += stub->sector();
881 if (stub->getKeyWG() == 0)
884 int bxDT = stub->BX()-stub->getStrip();
885 int subDT = stub->subsector();
892 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
894 trkBX = trk->first.BX();
895 int trkId = (trk->first.endcap()==2) ? 6 : 0;
896 trkId += trk->first.sector();
899 <<
" Sector: " << trkId
900 <<
" SubSector: " << trk->first.subsector()
901 <<
" Endcap: " << trk->first.endcap();
903 edm::LogInfo(
"DataNotFound") <<
"\n DT BX: " << stub->BX()
904 <<
" Sector: " << mbId
905 <<
" SubSector: " << stub->subsector()
906 <<
" Endcap: " << stub->endcap() << endl;
913 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 * csctfTrackPhi
unsigned long long m_scalesCacheID
MonitorElement * csctfTrackPhi_H
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
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 * csctfTrackEtaLowQ
gbletadat globalEtaME(int phi_bend, int phi_local, int wire_group, int cscid) const
static void setGeometry(const edm::ESHandle< CSCGeometry > &thegeom)
MonitorElement * csctfTrackEta
void analyze(const edm::Event &e, const edm::EventSetup &c)
edm::InputTag statusProducer
edm::EDGetTokenT< L1CSCStatusDigiCollection > statusToken_
MonitorElement * csctfTrackEta_H
const L1MuTriggerScales * ts
MonitorElement * cscTrackStubNumbers
lclphidat localPhi(int strip, int pattern, int quality, int lr) const
Geometry Lookup Tables.
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
const L1MuScale * getPhiScale() const
get the phi scale
Abs< T >::type abs(const T &t)
L1TCSCTF(const edm::ParameterSet &ps)
void setVerbose(unsigned level)
MonitorElement * csctfChamberOccupancies
edm::InputTag lctProducer
edm::EDGetTokenT< L1CSCTrackCollection > tracksToken_
CSCSectorReceiverLUT * srLUTs_[5]
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > corrlctsToken_
MonitorElement * csctferrors
void addUntrackedParameter(std::string const &name, T const &value)
class global_phi_data gblphidat
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)
T const * product() const
MonitorElement * csctfntrack
edm::InputTag trackProducer
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmtProducerToken_
MonitorElement * trackModeVsQ
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * csctfoccupancies_H
static unsigned int const shift
std::pair< const_iterator, const_iterator > Range
const L1MuTriggerPtScale * tpts
unsigned long long m_ptScaleCacheID
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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)
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > dtStubsToken_
edm::InputTag gmtProducer
void setCurrentFolder(const std::string &fullpath)
gblphidat globalPhiME(int phi_local, int wire_group, int cscid) const