CMS 3D CMS Logo

LmfSource.h
Go to the documentation of this file.
1 #ifndef SourceModule_H
2 #define SourceModule_H
3 
4 #include <vector>
5 #include <string>
6 #include <cinttypes>
7 #include <fstream>
8 
13 
15 private:
16  struct IndexRecord {
17  uint32_t orbit;
18  uint32_t filePos;
19  // bool operator<(const IndexRecord& i) const { return orbit < i.orbit; }
20  };
21 
22 public:
24  ~LmfSource() override {}
25 
26 private:
29  void produce(edm::Event& e) override;
30 
37  edm::EventAuxiliary::ExperimentType& eType) override;
38 
39  bool openFile(int iFile);
40 
41  bool readFileHeader();
42 
49  bool readEventWithinFile(bool doSkip);
50 
56 
57 private:
60  std::vector<std::string> fileNames_;
61 
64  int iFile_;
65 
69 
73 
77  int fedId_;
78 
81  std::vector<uint32_t> header_;
82 
83  static const unsigned fileHeaderSize;
84 
87  std::vector<uint32_t> fileHeader_;
88 
91  static const unsigned char minDataFormatVersion_;
92 
95  static const unsigned char maxDataFormatVersion_;
96 
100  bool filter() const;
101 
106  bool readEvent(bool doSkip = false);
107 
112  bool nextEventWithinFile();
113 
118  void checkFileNames();
119 
123  void readIndexTable();
124 
126  uint32_t lumiBlock_;
127  uint32_t runNum_;
128  uint32_t bx_;
129  uint32_t eventNum_;
130  uint32_t orbitNum_;
131 
132  unsigned char dataFormatVers_;
133 
134  std::ifstream in_;
135 
138  bool rcRead_;
139 
140  unsigned preScale_;
141 
144  uint32_t iEvent_;
145 
148  uint32_t iEventInFile_;
149 
150  uint32_t indexTablePos_;
151 
153 
154  int nFeds_;
155 
159  std::vector<IndexRecord> indexTable_;
160 
164  static const unsigned maxEvents_ = 1 << 20;
165 
169  static const unsigned maxEventSize_ = 1 << 20; //1MB. (full DCC event is 49kB)
170 
175 
180 
184 
188 
192 
193  std::ifstream fileList_;
194 
198 
202 };
203 #endif //SourceModule_H not defined
LmfSource::fedId_
int fedId_
Definition: LmfSource.h:77
LmfSource::in_
std::ifstream in_
Definition: LmfSource.h:134
LmfSource::inputDir_
std::string inputDir_
Definition: LmfSource.h:187
LmfSource::calibTrig_
int calibTrig_
Definition: LmfSource.h:152
LmfSource::setRunAndEventInfo
bool setRunAndEventInfo(edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &eType) override
Definition: LmfSource.cc:222
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
LmfSource::produce
void produce(edm::Event &e) override
Definition: LmfSource.cc:113
edm::ProducerSourceBase
Definition: ProducerSourceBase.h:23
LmfSource::header_
std::vector< uint32_t > header_
Definition: LmfSource.h:81
edm::InputSourceDescription
Definition: InputSourceDescription.h:20
LmfSource::IndexRecord
Definition: LmfSource.h:16
LmfSource::maxEventSize_
static const unsigned maxEventSize_
Definition: LmfSource.h:169
LmfSource::IndexRecord::filePos
uint32_t filePos
Definition: LmfSource.h:18
FEDRawData.h
LmfSource::rcRead_
bool rcRead_
Definition: LmfSource.h:138
FEDRawData
Definition: FEDRawData.h:19
LmfSource::orderedRead_
bool orderedRead_
Definition: LmfSource.h:174
LmfSource::fileList_
std::ifstream fileList_
Definition: LmfSource.h:193
LmfSource::iFile_
int iFile_
Definition: LmfSource.h:64
LmfSource::readIndexTable
void readIndexTable()
Definition: LmfSource.cc:462
LmfSource
Definition: LmfSource.h:14
LmfSource::readEvent
bool readEvent(bool doSkip=false)
Definition: LmfSource.cc:200
LmfSource::fileHeaderSize
static const unsigned fileHeaderSize
Definition: LmfSource.h:83
LmfSource::fedColl_
FEDRawDataCollection fedColl_
Definition: LmfSource.h:68
LmfSource::verbosity_
int verbosity_
Definition: LmfSource.h:201
OrderedSet.t
t
Definition: OrderedSet.py:90
LmfSource::readEventWithinFile
bool readEventWithinFile(bool doSkip)
Definition: LmfSource.cc:258
LmfSource::watchFileList_
bool watchFileList_
Definition: LmfSource.h:179
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LmfSource::lumiBlock_
uint32_t lumiBlock_
Definition: LmfSource.h:126
LmfSource::currentFileName_
std::string currentFileName_
Definition: LmfSource.h:191
edm::ParameterSet
Definition: ParameterSet.h:36
Timestamp.h
LmfSource::eventNum_
uint32_t eventNum_
Definition: LmfSource.h:129
LmfSource::bx_
uint32_t bx_
Definition: LmfSource.h:128
LmfSource::timeStamp_
uint64_t timeStamp_
Definition: LmfSource.h:125
LmfSource::orbitNum_
uint32_t orbitNum_
Definition: LmfSource.h:130
LmfSource::openFile
bool openFile(int iFile)
Definition: LmfSource.cc:129
LmfSource::fileHeader_
std::vector< uint32_t > fileHeader_
Definition: LmfSource.h:87
LmfSource::iEventInFile_
uint32_t iEventInFile_
Definition: LmfSource.h:148
LmfSource::toString
std::string toString(edm::TimeValue_t &t) const
Definition: LmfSource.cc:430
FEDRawDataCollection.h
LmfSource::~LmfSource
~LmfSource() override
Definition: LmfSource.h:24
LmfSource::emptyFedBlock_
FEDRawData emptyFedBlock_
Definition: LmfSource.h:72
LmfSource::maxDataFormatVersion_
static const unsigned char maxDataFormatVersion_
Definition: LmfSource.h:95
LmfSource::filter
bool filter() const
Definition: LmfSource.cc:428
LmfSource::indexTablePos_
uint32_t indexTablePos_
Definition: LmfSource.h:150
LmfSource::fileNames_
std::vector< std::string > fileNames_
Definition: LmfSource.h:60
LmfSource::maxEvents_
static const unsigned maxEvents_
Definition: LmfSource.h:164
LmfSource::indexTable_
std::vector< IndexRecord > indexTable_
Definition: LmfSource.h:159
LmfSource::nFeds_
int nFeds_
Definition: LmfSource.h:154
LmfSource::nextEventWithinFile
bool nextEventWithinFile()
Definition: LmfSource.cc:176
LmfSource::dataFormatVers_
unsigned char dataFormatVers_
Definition: LmfSource.h:132
edm::EventAuxiliary::ExperimentType
ExperimentType
Definition: EventAuxiliary.h:18
LmfSource::checkFileNames
void checkFileNames()
Definition: LmfSource.cc:442
LmfSource::IndexRecord::orbit
uint32_t orbit
Definition: LmfSource.h:17
LmfSource::runNum_
uint32_t runNum_
Definition: LmfSource.h:127
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
LmfSource::LmfSource
LmfSource(const edm::ParameterSet &pset, const edm::InputSourceDescription &isd)
Definition: LmfSource.cc:23
LmfSource::preScale_
unsigned preScale_
Definition: LmfSource.h:140
LmfSource::iEvent_
uint32_t iEvent_
Definition: LmfSource.h:144
ntuplemaker.time
time
Definition: ntuplemaker.py:310
edm::EventID
Definition: EventID.h:31
edm::Event
Definition: Event.h:73
LmfSource::readFileHeader
bool readFileHeader()
Definition: LmfSource.cc:56
LmfSource::minDataFormatVersion_
static const unsigned char minDataFormatVersion_
Definition: LmfSource.h:91
LmfSource::fileListName_
std::string fileListName_
Definition: LmfSource.h:183
LmfSource::nSecondsToSleep_
int nSecondsToSleep_
Definition: LmfSource.h:197
edm::TimeValue_t
unsigned long long TimeValue_t
Definition: Timestamp.h:28
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
ProducerSourceBase.h