CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <inttypes.h>
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  const edm::InputSourceDescription& isd);
25  virtual ~LmfSource(){}
26 
27 private:
30  virtual void produce(edm::Event &e);
31 
37 
38  bool openFile(int iFile);
39 
40  bool readFileHeader();
41 
48  bool readEventWithinFile(bool doSkip);
49 
55 
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 
89 
92  static const unsigned char minDataFormatVersion_;
93 
96  static const unsigned char maxDataFormatVersion_;
97 
101  bool filter() const;
102 
107  bool readEvent(bool doSkip = false);
108 
113  bool nextEventWithinFile();
114 
119  void checkFileNames();
120 
124  void readIndexTable();
125 
127  uint32_t lumiBlock_;
128  uint32_t runNum_;
129  uint32_t bx_;
130  uint32_t eventNum_;
131  uint32_t orbitNum_;
132 
133  unsigned char dataFormatVers_;
134 
135  std::ifstream in_;
136 
139  bool rcRead_;
140 
141  unsigned preScale_;
142 
145  uint32_t iEvent_;
146 
149  uint32_t iEventInFile_;
150 
151  uint32_t indexTablePos_;
152 
154 
155  int nFeds_;
156 
160  std::vector<IndexRecord> indexTable_;
161 
165  static const unsigned maxEvents_ = 1<<20;
166 
170  static const unsigned maxEventSize_ = 1<<20; //1MB. (full DCC event is 49kB)
171 
176 
181 
185 
189 
193 
194  std::ifstream fileList_;
195 
199 
203 };
204 #endif //SourceModule_H not defined
205 
int iFile_
Definition: LmfSource.h:64
virtual void produce(edm::Event &e)
Definition: LmfSource.cc:117
int nSecondsToSleep_
Definition: LmfSource.h:198
uint32_t orbitNum_
Definition: LmfSource.h:131
bool openFile(int iFile)
Definition: LmfSource.cc:132
std::ifstream in_
Definition: LmfSource.h:135
static const unsigned fileHeaderSize
Definition: LmfSource.h:83
uint32_t runNum_
Definition: LmfSource.h:128
virtual ~LmfSource()
Definition: LmfSource.h:25
bool readEventWithinFile(bool doSkip)
Definition: LmfSource.cc:258
uint32_t indexTablePos_
Definition: LmfSource.h:151
bool rcRead_
Definition: LmfSource.h:139
std::vector< uint32_t > header_
Definition: LmfSource.h:81
std::string fileListName_
Definition: LmfSource.h:184
void checkFileNames()
Definition: LmfSource.cc:450
uint32_t iEventInFile_
Definition: LmfSource.h:149
uint32_t iEvent_
Definition: LmfSource.h:145
LmfSource(const edm::ParameterSet &pset, const edm::InputSourceDescription &isd)
Definition: LmfSource.cc:24
unsigned preScale_
Definition: LmfSource.h:141
int nFeds_
Definition: LmfSource.h:155
static const unsigned char minDataFormatVersion_
Definition: LmfSource.h:92
static const unsigned maxEvents_
Definition: LmfSource.h:165
uint32_t bx_
Definition: LmfSource.h:129
virtual bool setRunAndEventInfo(edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &eType)
Definition: LmfSource.cc:224
FEDRawDataCollection fedColl_
Definition: LmfSource.h:68
std::string inputDir_
Definition: LmfSource.h:188
int verbosity_
Definition: LmfSource.h:202
static const unsigned maxEventSize_
Definition: LmfSource.h:170
int calibTrig_
Definition: LmfSource.h:153
unsigned long long TimeValue_t
Definition: Timestamp.h:28
uint32_t lumiBlock_
Definition: LmfSource.h:127
bool filter() const
Definition: LmfSource.cc:434
unsigned long long uint64_t
Definition: Time.h:15
unsigned char dataFormatVers_
Definition: LmfSource.h:133
int fedId_
Definition: LmfSource.h:77
bool watchFileList_
Definition: LmfSource.h:180
std::vector< IndexRecord > indexTable_
Definition: LmfSource.h:160
bool orderedRead_
Definition: LmfSource.h:175
void readIndexTable()
Definition: LmfSource.cc:473
std::ifstream fileList_
Definition: LmfSource.h:194
bool nextEventWithinFile()
Definition: LmfSource.cc:177
std::string currentFileName_
Definition: LmfSource.h:192
uint64_t timeStamp_
Definition: LmfSource.h:126
std::string toString(edm::TimeValue_t &t) const
Definition: LmfSource.cc:438
uint32_t eventNum_
Definition: LmfSource.h:130
bool readFileHeader()
Definition: LmfSource.cc:59
bool readEvent(bool doSkip=false)
Definition: LmfSource.cc:204
std::vector< uint32_t > fileHeader_
Definition: LmfSource.h:87
FEDRawData emptyFedBlock_
Definition: LmfSource.h:72
std::vector< std::string > fileNames_
Definition: LmfSource.h:60
static const unsigned char maxDataFormatVersion_
Definition: LmfSource.h:96