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);
430 for (
int iEndcap = 0; iEndcap < 2; iEndcap++) {
431 for (
int iStation = 1; iStation < 5; iStation++) {
432 for (
int iRing = 1; iRing < 4; iRing++) {
433 if (iStation != 1 && iRing > 2)
continue;
434 TString signEndcap=
"+";
435 if(iEndcap==0) signEndcap=
"-";
438 snprintf(lcttitle,200,
"ME%s%d/%d", signEndcap.Data(), iStation, iRing);
440 csctflcts -> setBinLabel(9-ihist,lcttitle,2);
442 else csctflcts -> setBinLabel(ihist+1,lcttitle,2);
486 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
508 edm::LogInfo(
"L1TCSCTF") <<
"Changing triggerscales and triggerptscales...";
511 int NumCSCTfTracksRep = 0;
521 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label ";
526 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
527 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
537 for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ ) {
541 vector<L1MuRegionalCand> INPCands = RRItr->getCSCCands();
542 vector<L1MuRegionalCand>::const_iterator INPItr;
548 for( INPItr = INPCands.begin(); INPItr != INPCands.end(); ++INPItr ) {
554 if (
verbose_)
edm::LogInfo(
"DataNotFound") <<
"cand " << nCandsBx <<
" -> assigned CSCTF bx: " << INPItr->bx() << endl;
561 if (nCands != 1)
return;
568 edm::LogInfo(
"DataNotFound") <<
"\tCSCTFCand ntrack " << ncsctftrack << endl;
577 bool integrity=status->first, se=
false, sm=
false, bx=
false, af=
false, fmm=
false;
580 for(std::vector<L1CSCSPStatusDigi>::const_iterator stat=status->second.begin(); stat!=status->second.end(); stat++)
582 se |= stat->SEs()&0xFFF;
583 sm |= stat->SMs()&0xFFF;
584 bx |= stat->BXs()&0xFFF;
585 af |= stat->AFs()&0xFFF;
586 fmm|= stat->FMM()!=8;
595 if(nStat!=0)
L1ABXN /= nStat;
618 int endcap = (*csc).first.endcap()-1;
619 int station = (*csc).first.station()-1;
620 int sector = (*csc).first.triggerSector()-1;
622 int ring = (*csc).first.ring();
623 int cscId = (*csc).first.triggerCscId()-1;
624 int fpga = ( subSector ? subSector-1 : station+1 );
625 int strip = lct -> getStrip();
626 int keyWire = lct -> getKeyWG();
627 int bx = lct -> getBX();
629 int endcapAssignment = 1;
631 float sectorArg = sector;
635 endcapAssignment = -1;
640 int signedStation = (station +
shift)* endcapAssignment;
641 if( (station == 0) && (endcap == 0)) signedStation = subSector - 1;
642 if( (station == 0) && (endcap == 1)) signedStation = (-1)*subSector;
644 float chamberArg1 = cscId * 0.1 + sectorArg;
648 float chamberArg11 = chamberArg1;
649 if(sectorArg == 1) chamberArg1 = chamberArg11 - 0.1;
650 if(sectorArg == 2) chamberArg1 = chamberArg11 - 0.2;
651 if(sectorArg == 3) chamberArg1 = chamberArg11 - 0.3;
652 if(sectorArg == 4) chamberArg1 = chamberArg11 - 0.4;
653 if(sectorArg == 5) chamberArg1 = chamberArg11 - 0.5;
669 if( endcap<0||endcap>1 || sector<0||sector>6 || station<0||station>3 || cscId<0||cscId>8 || fpga<0||fpga>4)
671 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);
676 lclPhi =
srLUTs_[fpga]->
localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend());
678 bzero(&lclPhi,
sizeof(lclPhi));
685 bzero(&gblPhi,
sizeof(gblPhi));
690 gblEta =
srLUTs_[fpga]->
globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1);
692 bzero(&gblEta,
sizeof(gblEta));
706 if (endcap == 0 && station == 0 && ring == 1) {
csctflcts ->
Fill(bx, 8.5); }
707 if (endcap == 0 && station == 0 && ring == 2) {
csctflcts ->
Fill(bx, 7.5); }
708 if (endcap == 0 && station == 0 && ring == 3) {
csctflcts ->
Fill(bx, 6.5); }
709 if (endcap == 0 && station == 1 && ring == 1) {
csctflcts ->
Fill(bx, 5.5); }
710 if (endcap == 0 && station == 1 && ring == 2) {
csctflcts ->
Fill(bx, 4.5); }
711 if (endcap == 0 && station == 2 && ring == 1) {
csctflcts ->
Fill(bx, 3.5); }
712 if (endcap == 0 && station == 2 && ring == 2) {
csctflcts ->
Fill(bx, 2.5); }
713 if (endcap == 0 && station == 3 && ring == 1) {
csctflcts ->
Fill(bx, 1.5); }
714 if (endcap == 0 && station == 3 && ring == 2) {
csctflcts ->
Fill(bx, 0.5); }
717 if (endcap == 1 && station == 0 && ring == 1) {
csctflcts ->
Fill(bx, 9.5); }
718 if (endcap == 1 && station == 0 && ring == 2) {
csctflcts ->
Fill(bx, 10.5); }
719 if (endcap == 1 && station == 0 && ring == 3) {
csctflcts ->
Fill(bx, 11.5); }
720 if (endcap == 1 && station == 1 && ring == 1) {
csctflcts ->
Fill(bx, 12.5); }
721 if (endcap == 1 && station == 1 && ring == 2) {
csctflcts ->
Fill(bx, 13.5); }
722 if (endcap == 1 && station == 2 && ring == 1) {
csctflcts ->
Fill(bx, 14.5); }
723 if (endcap == 1 && station == 2 && ring == 2) {
csctflcts ->
Fill(bx, 15.5); }
724 if (endcap == 1 && station == 3 && ring == 1) {
csctflcts ->
Fill(bx, 16.5); }
725 if (endcap == 1 && station == 3 && ring == 2) {
csctflcts ->
Fill(bx, 17.5); }
728 if(station == 0 && ring == 1){
738 if(station == 3 && ring == 2){
762 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
766 long LUTAdd = trk->first.ptLUTAddress();
767 int trigMode = ( (LUTAdd)&0xf0000 ) >> 16;
768 int trEta = (trk->first.eta_packed() );
774 if( trk->first.endcap() != 1)
781 int trSector = 6*(trk->first.endcap()-1)+trk->first.sector();
782 int trBX = trk->first.BX();
796 double trPhi02PI = fmod(trPhi +
797 ((trSector-1)*
M_PI/3) +
800 if (trigMode == 15) {
814 if (
abs(trEta) < 24) {
845 int trRank = trk->first.rank();
847 int trQuality = ((trRank>>5)&0x3);
915 int cscTrackStub = 0;
979 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
980 for(std::vector<csctf::TrackStub>::const_iterator stub=vstubs.begin();
981 stub!=vstubs.end(); stub++)
985 edm::LogInfo(
"DataNotFound") <<
"\n mbEndcap: " << stub->endcap();
986 edm::LogInfo(
"DataNotFound") <<
"\n stub->getStrip()[FLAG]: " << stub->getStrip();
987 edm::LogInfo(
"DataNotFound") <<
"\n stub->getKeyWG()[CAL]: " << stub->getKeyWG();
988 edm::LogInfo(
"DataNotFound") <<
"\n stub->BX(): " << stub->BX();
989 edm::LogInfo(
"DataNotFound") <<
"\n stub->sector(): " << stub->sector();
990 edm::LogInfo(
"DataNotFound") <<
"\n stub->subsector(): " << stub->subsector();
991 edm::LogInfo(
"DataNotFound") <<
"\n stub->station(): " << stub->station();
992 edm::LogInfo(
"DataNotFound") <<
"\n stub->phiPacked(): " << stub->phiPacked();
993 edm::LogInfo(
"DataNotFound") <<
"\n stub->getBend(): " << stub->getBend();
994 edm::LogInfo(
"DataNotFound") <<
"\n stub->getQuality(): " << stub->getQuality();
995 edm::LogInfo(
"DataNotFound") <<
"\n stub->cscid(): " << stub->cscid() << endl;
998 int mbId = (stub->endcap()==2) ? 6 : 0;
999 mbId += stub->sector();
1004 if (stub->getKeyWG() == 0)
1007 int bxDT = stub->BX()-stub->getStrip();
1008 int subDT = stub->subsector();
1015 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
1017 trkBX = trk->first.BX();
1018 int trkId = (trk->first.endcap()==2) ? 6 : 0;
1019 trkId += trk->first.sector();
1022 <<
" Sector: " << trkId
1023 <<
" SubSector: " << trk->first.subsector()
1024 <<
" Endcap: " << trk->first.endcap();
1026 edm::LogInfo(
"DataNotFound") <<
"\n DT BX: " << stub->BX()
1027 <<
" Sector: " << mbId
1028 <<
" SubSector: " << stub->subsector()
1029 <<
" Endcap: " << stub->endcap() << endl;
1036 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
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
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 * 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)
MonitorElement * me11_lctWire
unsigned phiPacked() const
Return the binned phi for this stub.
edm::InputTag statusProducer
edm::EDGetTokenT< L1CSCStatusDigiCollection > statusToken_
MonitorElement * csctfTrackEta_H
MonitorElement * me42_lctGblPhi
const L1MuTriggerScales * ts
MonitorElement * cscTrackStubNumbers
lclphidat localPhi(int strip, int pattern, int quality, int lr) const
Geometry Lookup Tables.
MonitorElement * me11_lctStrip
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double etaValue() const
return the Eta Value of this stub's position.
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_
MonitorElement * me42_lctGblEta
CSCSectorReceiverLUT * srLUTs_[5]
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > corrlctsToken_
double phiValue() const
return the Phi Value of this stub's position in local coordinates.
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
MonitorElement * me11_lctGblEta
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
void setPhiPacked(const unsigned &phi_)
std::pair< const_iterator, const_iterator > Range
const L1MuTriggerPtScale * tpts
MonitorElement * me11_lctLocalPhi
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 setEtaPacked(const unsigned &eta_)
set Eta and Phi from integer values.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * me11_lctPackedPhi
gblphidat globalPhiME(int phi_local, int wire_group, int cscid) const