CFEL - ASG Software Suite  2.5.0
CASS
raw_sss_reader.h
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file raw_sss_reader.h contains class to read commercial
5  * ccd files created with Per Johnsonn's program
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef _RAWSSSREADERTOPIXDET_H_
11 #define _RAWSSSREADERTOPIXDET_H_
12 
13 #include <fstream>
14 #include <stdint.h>
15 #include <vector>
16 
17 #include "file_reader.h"
18 #include "raw_sss_file_header.hpp"
19 
20 namespace cass
21 {
22 class CASSEvent;
23 
24 namespace pixeldetector
25 {
26 /** class for reading commercial ccd files
27  *
28  * @author Lutz Foucar
29  */
30 class RAWSSSReader : public FileReader
31 {
32 public:
33  /** constructor */
34  RAWSSSReader();
35 
36  /** read the raw.sss file contents put them into cassevent
37  *
38  * @return true when the workers should work on the filled cassevent,
39  * false if not.
40  * @param file the file that contains the data to be put into the cassevent
41  * @param event the CASSEvent where the data will be put into
42  */
43  bool operator()(std::ifstream &file, CASSEvent& event);
44 
45  /** load the settings of the reader */
46  void loadSettings();
47 
48  /** read the file header
49  *
50  * @param file the filestream to the header information of the file
51  */
52  void readHeaderInfo(std::ifstream &file);
53 
54 private:
55  /** the file header information */
57 
58  /** counter to see how many images have been read from file */
59  uint32_t _imagecounter;
60 
61  /** buffer for images */
63 
64  /** the length of the image in bytes */
65  size_t _imageSize;
66 };
67 }//end namespace pixeldetector
68 }//end namespace cass
69 #endif
Event to store all LCLS Data.
Definition: cass_event.h:32
void loadSettings()
load the settings of the reader
void readHeaderInfo(std::ifstream &file)
read the file header
bool operator()(std::ifstream &file, CASSEvent &event)
read the raw.sss file contents put them into cassevent
base class for all file readers
Definition: file_reader.h:24
contains the layout of the sss file headers.
contains base class for all file readers
std::vector< uint8_t > image_t
a raw sss frame
sssFile::Header _header
the file header information
uint32_t _imagecounter
counter to see how many images have been read from file
class for reading commercial ccd files
size_t _imageSize
the length of the image in bytes
sssFile::image_t _imageBuffer
buffer for images