Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:25

0001 #include "EventFilter/CSCRawToDigi/interface/CSCAnodeData.h"
0002 #include "EventFilter/CSCRawToDigi/interface/CSCALCTHeader.h"
0003 #include "EventFilter/CSCRawToDigi/interface/CSCAnodeData2006.h"
0004 #include "EventFilter/CSCRawToDigi/interface/CSCAnodeData2007.h"
0005 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 #include <cstring>  // for bzero
0008 
0009 CSCAnodeData::CSCAnodeData(const CSCALCTHeader &header)  ///for digi->raw packing
0010     : firmwareVersion(header.alctFirmwareVersion()) {
0011   if (firmwareVersion == 2006) {
0012     theData = std::shared_ptr<CSCAnodeDataFormat>(new CSCAnodeData2006(header));
0013   } else {
0014     theData = std::shared_ptr<CSCAnodeDataFormat>(new CSCAnodeData2007(header));
0015   }
0016 }
0017 
0018 // initialize
0019 CSCAnodeData::CSCAnodeData(const CSCALCTHeader &header, const unsigned short *buf)
0020     : firmwareVersion(header.alctFirmwareVersion()) {
0021   if (firmwareVersion == 2006) {
0022     theData = std::shared_ptr<CSCAnodeDataFormat>(new CSCAnodeData2006(header, buf));
0023   } else {
0024     theData = std::shared_ptr<CSCAnodeDataFormat>(new CSCAnodeData2007(header, buf));
0025   }
0026 }
0027 
0028 std::vector<std::vector<CSCWireDigi> > CSCAnodeData::wireDigis() const {
0029   std::vector<std::vector<CSCWireDigi> > result;
0030   for (int layer = CSCDetId::minLayerId(); layer <= CSCDetId::maxLayerId(); ++layer) {
0031     result.push_back(wireDigis(layer));
0032   }
0033   return result;
0034 }