Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-16 23:02:00

0001 #ifndef CSCFileReader_h
0002 #define CSCFileReader_h
0003 
0004 #include "FWCore/Framework/interface/stream/EDProducer.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "DataFormats/Provenance/interface/EventID.h"
0008 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0009 
0010 #include <vector>
0011 #include <string>
0012 #include <list>
0013 #include <map>
0014 
0015 #include "FileReaderDDU.h"
0016 #include "FileReaderDCC.h"
0017 
0018 class CSCFileReader : public edm::stream::EDProducer<> {
0019 private:
0020   std::vector<std::string> fileNames[40];
0021   std::vector<std::string>::const_iterator currentFile[40];
0022 
0023   int firstEvent, nEvents, tfDDUnumber;
0024   int expectedNextL1A, currentL1A[40];
0025   int nActiveRUIs, nActiveFUs;
0026   unsigned int runNumber;
0027 
0028   unsigned short *tmpBuf;
0029   const unsigned short *fuEvent[4];
0030   size_t fuEventSize[4];
0031   const unsigned short *ruBuf[40];
0032   size_t ruBufSize[40];
0033 
0034   FileReaderDDU RUI[40];
0035   FileReaderDCC FU[4];
0036 
0037   std::map<unsigned int, std::list<unsigned int> > FED;
0038 
0039   int readRUI(int rui, const unsigned short *&buf, size_t &length);
0040   int buildEventFromRUIs(FEDRawDataCollection *data);
0041 
0042   int readFU(int fu, const unsigned short *&buf, size_t &length);
0043   int nextEventFromFUs(FEDRawDataCollection *data);
0044 
0045 public:
0046   CSCFileReader(const edm::ParameterSet &pset);
0047   ~CSCFileReader(void) override;
0048 
0049   virtual int fillRawData(edm::Event &e, /* edm::Timestamp& tstamp,*/ FEDRawDataCollection *&data);
0050 
0051   void produce(edm::Event &, edm::EventSetup const &) override;
0052 
0053   bool fFirstReadBug;
0054 };
0055 
0056 #endif