Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:09

0001 #include "EventFilter/L1TRawToDigi/interface/OmtfDtUnpacker.h"
0002 
0003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0004 
0005 #include "EventFilter/L1TRawToDigi/interface/OmtfDtDataWord64.h"
0006 
0007 namespace omtf {
0008 
0009   void DtUnpacker::unpack(unsigned int fed,
0010                           unsigned int amc,
0011                           const DtDataWord64 &data,
0012                           std::vector<L1MuDTChambPhDigi> &phi_Container,
0013                           std::vector<L1MuDTChambThDigi> &the_Container) {
0014     LogTrace("") << "HERE OMTF->DT " << std::endl;
0015     LogTrace("") << data << std::endl;
0016     if (data.sector() == 0) {
0017       LogTrace("") << "...data skipped, since from oberlaping chambers." << std::endl;
0018       return;  // skip signal from chamber fiber exchange
0019     }
0020     int bx = data.bxNum() - 3;
0021     int whNum = (fed == 1380) ? -2 : 2;
0022     int sector = (amc - 1) * 2 + data.sector();
0023     if (sector == 12)
0024       sector = 0;
0025     int station = data.station() + 1;
0026     LogTrace("") << "DT_AMC#  " << amc << " RAW_SECTOR: " << data.sector() << " DT_SECTOR: " << sector << std::endl;
0027     phi_Container.push_back(L1MuDTChambPhDigi(bx,
0028                                               whNum,
0029                                               sector,
0030                                               station,
0031                                               data.phi(),
0032                                               data.phiB(),
0033                                               data.quality(),
0034                                               data.fiber(),      // utag/Ts2Tag
0035                                               data.bcnt_st()));  //ucnt/BxCnt
0036     int pos[7];
0037     int posQual[7];
0038     for (unsigned int i = 0; i < 7; i++) {
0039       pos[i] = (data.eta() >> i & 1);
0040       posQual[i] = (data.etaQuality() >> i & 1);
0041     }
0042     if (data.eta())
0043       LogTrace("") << "HERE DATA DT ETA";
0044     if (data.eta())
0045       the_Container.push_back(L1MuDTChambThDigi(bx, whNum, sector, station, pos, posQual));
0046   }
0047 
0048 }  // namespace omtf