32 : gmtProducer( ps.getParameter<
InputTag >(
"gmtProducer") ),
33 lctProducer( ps.getParameter<
InputTag >(
"lctProducer") ),
34 trackProducer( ps.getParameter<
InputTag >(
"trackProducer") ),
35 statusProducer( ps.getParameter<
InputTag >(
"statusProducer") ),
36 mbProducer( ps.getParameter<
InputTag >(
"mbProducer") )
82 for(
int subSector=0; subSector<2 && fpga<5; subSector++)
93 for(
int i=0;
i<5;
i++)
109 dbe->
rmdir(
"L1T/L1TCSCTF");
151 haloDelEta23 = dbe->
book1D(
"CSCTF_Halo_Eta23",
"Delta station 2 to station 3 Eta for Halo Muons", 40, -0.20,0.30);
222 csctfntrack = dbe->
book1D(
"CSCTF_ntrack",
"Number of CSCTracks found per event", 5, 0.5, 5.5 ) ;
230 for(
int i=0;
i<12;
i++) {
232 sprintf(hname ,
"DTstubsTimeTrackMenTimeArrival_%d",
i+1);
233 sprintf(htitle,
"T_{track} - T_{DT stub} sector %d",
i+1);
269 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
278 int NumCSCTfTracksRep = 0;
288 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label ";
293 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
294 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
305 for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ ) {
309 vector<L1MuRegionalCand> INPCands = RRItr->getCSCCands();
312 vector<L1MuRegionalCand>::const_iterator INPItr;
319 for( INPItr = INPCands.begin(); INPItr != INPCands.end(); ++INPItr ) {
320 if(!INPItr->empty()) {
325 edm::LogInfo(
"DataNotFound") <<
"cand " << nCandsBx <<
" -> assigned CSCTF bx: " << INPItr->bx() << endl;
334 if (nCands != 1)
return;
337 edm::LogInfo(
"DataNotFound") <<
"bxWindow: " << bxWindow << endl;
343 edm::LogInfo(
"DataNotFound") <<
"\tCSCTFCand ntrack " << ncsctftrack << endl;
352 bool integrity=status->first, se=
false, sm=
false, bx=
false, af=
false, fmm=
false;
355 for(std::vector<L1CSCSPStatusDigi>::const_iterator stat=status->second.begin(); stat!=status->second.end(); stat++)
357 se |= stat->SEs()&0xFFF;
358 sm |= stat->SMs()&0xFFF;
359 bx |= stat->BXs()&0xFFF;
360 af |= stat->AFs()&0xFFF;
361 fmm|= stat->FMM()!=8;
364 if(stat->VPs() != 0) {
372 if(nStat!=0)
L1ABXN /= nStat;
396 int endcap = (*csc).first.endcap()-1;
397 int station = (*csc).first.station()-1;
398 int sector = (*csc).first.triggerSector()-1;
400 int cscId = (*csc).first.triggerCscId()-1;
401 int fpga = ( subSector ? subSector-1 : station+1 );
403 int endcapAssignment = 1;
405 float sectorArg = sector;
409 endcapAssignment = -1;
414 int signedStation = (station +
shift)* endcapAssignment;
415 if( (station == 0) && (endcap == 0)) signedStation = subSector - 1;
416 if( (station == 0) && (endcap == 1)) signedStation = (-1)*subSector;
418 float chamberArg1 = cscId * 0.1 + sectorArg;
422 float chamberArg11 = chamberArg1;
423 if(sectorArg == 1) chamberArg1 = chamberArg11 - 0.1;
424 if(sectorArg == 2) chamberArg1 = chamberArg11 - 0.2;
425 if(sectorArg == 3) chamberArg1 = chamberArg11 - 0.3;
426 if(sectorArg == 4) chamberArg1 = chamberArg11 - 0.4;
427 if(sectorArg == 5) chamberArg1 = chamberArg11 - 0.5;
432 int bunchX = ( (lct->getBX()) - 6 );
434 int timingSectorArg = 3*(sector) + (lct->getMPCLink());
435 if( endcap == 1) timingSectorArg = 3*(sector + 6) + (lct->getMPCLink());
445 if( endcap<0||endcap>1 || sector<0||sector>6 || station<0||station>3 || cscId<0||cscId>8 || fpga<0||fpga>4)
447 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);
452 lclPhi =
srLUTs_[fpga]->
localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend());
454 bzero(&lclPhi,
sizeof(lclPhi));
461 bzero(&gblPhi,
sizeof(gblPhi));
466 gblEta =
srLUTs_[fpga]->
globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1);
468 bzero(&gblEta,
sizeof(gblEta));
487 for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
491 long LUTAdd = trk->first.ptLUTAddress();
492 int trigMode = ( (LUTAdd)&0xf0000 ) >> 16;
493 float etaReal = (trk->first.eta_packed() );
494 if( trk->first.endcap() != 1)
496 float holder = etaReal;
501 float phiReal = ((trk->first.localPhi())*(62.5/24) + (trk->first.sector() - 1)*60)*
M_PI/180 ;
502 if( phiReal > (2*
M_PI) ) phiReal -= (2*
M_PI);
517 double haloVals[4][4];
518 for(
int i = 0;
i < 4;
i++)
530 int endcap = (*csc).first.endcap()-1;
531 int station = (*csc).first.station()-1;
532 int sector = (*csc).first.triggerSector()-1;
533 int cscId = (*csc).first.triggerCscId()-1;
535 int fpga = ( subSector ? subSector-1 : station+1 );
537 if( (station == 1) || (station == 2) )
540 if( endcap == 0 ) modEnd = -1;
542 int indexHalo = modEnd +
station;
543 if(haloVals[indexHalo][0] == 1.0) haloVals[indexHalo][3] = 1.0;
544 if(haloVals[indexHalo][0] == 0) haloVals[indexHalo][0] = 1.0;
545 haloVals[indexHalo][1] = sector*1.0;
548 lclPhi =
srLUTs_[fpga]->
localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend());
554 gblEta =
srLUTs_[fpga]->
globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1);
556 haloVals[indexHalo][2] = gblEta.global_eta/127. * 1.5 + 0.9;
561 if( (haloVals[0][0] == 1.) && (haloVals[1][0] == 1.) && (haloVals[0][3] != 1.) && (haloVals[1][3] != 1.) )
563 if( haloVals[0][1] == haloVals[1][1] ){
564 double delEta23 = haloVals[1][2] - haloVals[0][2];
569 if( (haloVals[2][0] == 1.) && (haloVals[3][0] == 1.) && (haloVals[2][3] != 1.) && (haloVals[3][3] != 1.) )
571 if( haloVals[2][1] == haloVals[3][1] ){
572 double delEta23 = haloVals[3][2] - haloVals[2][2];
578 int cscTrackStub = 0;
599 if( trigMode > 0 && trigMode !=15 && trigMode != 11 )
620 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
621 for(std::vector<csctf::TrackStub>::const_iterator stub=vstubs.begin();
622 stub!=vstubs.end(); stub++){
625 edm::LogInfo(
"DataNotFound") <<
"\n mbEndcap: " << stub->endcap();
626 edm::LogInfo(
"DataNotFound") <<
"\n stub->getStrip()[FLAG]: " << stub->getStrip();
627 edm::LogInfo(
"DataNotFound") <<
"\n stub->getKeyWG()[CAL]: " << stub->getKeyWG();
628 edm::LogInfo(
"DataNotFound") <<
"\n stub->BX(): " << stub->BX();
629 edm::LogInfo(
"DataNotFound") <<
"\n stub->sector(): " << stub->sector();
630 edm::LogInfo(
"DataNotFound") <<
"\n stub->subsector(): " << stub->subsector();
631 edm::LogInfo(
"DataNotFound") <<
"\n stub->station(): " << stub->station();
632 edm::LogInfo(
"DataNotFound") <<
"\n stub->phiPacked(): " << stub->phiPacked();
633 edm::LogInfo(
"DataNotFound") <<
"\n stub->getBend(): " << stub->getBend();
634 edm::LogInfo(
"DataNotFound") <<
"\n stub->getQuality(): " << stub->getQuality();
635 edm::LogInfo(
"DataNotFound") <<
"\n stub->cscid(): " << stub->cscid() << endl;
639 int mbId = (stub->endcap()==2) ? 6 : 0;
640 mbId += stub->sector();
647 if (stub->getKeyWG() == 0) {
650 int bxDT = stub->BX()-stub->getStrip();
651 int subDT = stub->subsector();
658 for(L1CSCTrackCollection::const_iterator trk=tracks->begin();
659 trk<tracks->end(); trk++){
661 trkBX = trk->first.BX();
663 int trkId = (trk->first.endcap()==2) ? 6 : 0;
664 trkId += trk->first.sector();
668 <<
" Sector: " << trkId
669 <<
" SubSector: " << trk->first.subsector()
670 <<
" Endcap: " << trk->first.endcap();
672 edm::LogInfo(
"DataNotFound") <<
"\n DT BX: " << stub->BX()
673 <<
" Sector: " << mbId
674 <<
" SubSector: " << stub->subsector()
675 <<
" Endcap: " << stub->endcap() << endl;
681 edm::LogInfo(
"DataNotFound") <<
"Fill :" << trkBX+6-bxDT <<
" -- " << subDT <<
" -- cands" << endl;
MonitorElement * DTstubsTimeTrackMenTimeArrival[12]
MonitorElement * csctfoccupancies
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * csctfTrackPhi
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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)
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
MonitorElement * csctfHaloL1ABXN
MonitorElement * cscTrackStubNumbers
lclphidat localPhi(int strip, int pattern, int quality, int lr) const
Geometry Lookup Tables.
L1TCSCTF(const edm::ParameterSet &ps)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void setVerbose(unsigned level)
MonitorElement * csctfChamberOccupancies
edm::InputTag lctProducer
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< L1MuGMTReadoutRecord > getRecords() const
MonitorElement * csctfTrackQ
CSCSectorReceiverLUT * srLUTs_[5]
MonitorElement * haloDelEta23
MonitorElement * csctferrors
MonitorElement * csctfCoincL1ABXN
void addUntrackedParameter(std::string const &name, T const &value)
class global_phi_data gblphidat
std::vector< DigiType >::const_iterator const_iterator
class local_phi_data lclphidat
Data Types.
static int triggerSubSectorFromLabels(int station, int chamber)
T const * product() const
edm::InputTag trackProducer
MonitorElement * csctfntrack
static unsigned int const shift
std::pair< const_iterator, const_iterator > Range
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::InputTag gmtProducer
void setCurrentFolder(const std::string &fullpath)
gblphidat globalPhiME(int phi_local, int wire_group, int cscid) const