Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:42

0001 #ifndef SOURCECARDTEXTTORCTDIGI_H
0002 #define SOURCECARDTEXTTORCTDIGI_H
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    SourceCardTextToRctDigi
0007 // Class:      SourceCardTextToRctDigi
0008 //
0009 /**\class SourceCardTextToRctDigi SourceCardTextToRctDigi.h
0010  L1Trigger/TextToDigi/src/SourceCardTextToRctDigi.h
0011 
0012  Description: Input text file to be loaded into the source cards and output RCT
0013  digis for pattern tests.
0014 
0015  Implementation:
0016      <Notes on implementation>
0017 */
0018 //
0019 // Original Author:  Alex Tapper
0020 //         Created:  Fri Mar  9 19:11:51 CET 2007
0021 //
0022 //
0023 
0024 // system include files
0025 #include <memory>
0026 
0027 // user include files
0028 #include "FWCore/Framework/interface/one/EDProducer.h"
0029 #include "FWCore/Framework/interface/Frameworkfwd.h"
0030 
0031 #include "FWCore/Framework/interface/Event.h"
0032 #include "FWCore/Framework/interface/MakerMacros.h"
0033 
0034 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0035 
0036 // RCT data includes
0037 #include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
0038 
0039 #include "L1Trigger/TextToDigi/interface/SourceCardRouting.h"
0040 
0041 #include <fstream>
0042 #include <iostream>
0043 
0044 class SourceCardTextToRctDigi : public edm::one::EDProducer<> {
0045 public:
0046   explicit SourceCardTextToRctDigi(const edm::ParameterSet &);
0047   ~SourceCardTextToRctDigi() override;
0048 
0049 private:
0050   void produce(edm::Event &, const edm::EventSetup &) override;
0051 
0052   /// Create empty digi collection
0053   void putEmptyDigi(edm::Event &);
0054 
0055   /// Name out input file
0056   std::string m_textFileName;
0057 
0058   /// Number of events to skip at the start of the file
0059   int m_fileEventOffset;
0060 
0061   /// Event counter
0062   int m_nevt;
0063 
0064   /// file handle
0065   std::ifstream m_file;
0066 
0067   /// source card router
0068   SourceCardRouting m_scRouting;
0069 };
0070 
0071 #endif