Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-04-21 02:53:05

0001 #include "EventFilter/L1TRawToDigi/interface/OmtfCscUnpacker.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0004 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
0005 #include "DataFormats/CSCDigi/interface/CSCConstants.h"
0006 #include "DataFormats/L1TMuon/interface/OMTF/OmtfCscDataWord64.h"
0007 
0008 namespace omtf {
0009 
0010   void CscUnpacker::init() { theOmtf2CscDet = mapEleIndex2CscDet(); }
0011 
0012   void CscUnpacker::unpack(unsigned int fed,
0013                            unsigned int amc,
0014                            const CscDataWord64& data,
0015                            CSCCorrelatedLCTDigiCollection* prod) {
0016     EleIndex omtfEle(fed, amc, data.linkNum());
0017     std::map<EleIndex, CSCDetId>::const_iterator icsc = theOmtf2CscDet.find(omtfEle);
0018     if (icsc == theOmtf2CscDet.end()) {
0019       LogTrace(" ") << " CANNOT FIND key: " << omtfEle << std::endl;
0020       return;
0021     }
0022     CSCDetId cscId = theOmtf2CscDet[omtfEle];
0023     LogTrace("") << "OMTF->CSC " << cscId << std::endl;
0024     LogTrace("") << data << std::endl;
0025     if (data.linkNum() >= 30) {
0026       LogTrace(" ") << " data from overlap, skip digi " << std::endl;
0027       return;
0028     }
0029     CSCCorrelatedLCTDigi digi(data.hitNum(),  //trknmb
0030                               data.valid(),
0031                               data.quality(),
0032                               data.wireGroup(),
0033                               data.halfStrip(),
0034                               data.clctPattern(),
0035                               data.bend(),
0036                               data.bxNum() + (CSCConstants::LCT_CENTRAL_BX - 3));
0037     LogTrace("") << digi << std::endl;
0038     //producedCscLctDigis->insertDigi( cscId, digi);
0039     prod->insertDigi(cscId, digi);
0040   }
0041 
0042 }  // namespace omtf