CFEL - ASG Software Suite  2.5.0
CASS
cbf_output.h
Go to the documentation of this file.
1 // Copyright (C) 2012 Lutz Foucar
2 
3 /**
4  * @file cbf_output.h output of 2d histograms into the cbf.
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _CBF_OUTPUT_H_
10 #define _CBF_OUTPUT_H_
11 
12 #include <string>
13 
14 #include "processor.h"
15 
16 namespace cass
17 {
18 /** converts histograms to (c)rystal (b)inary (f)ormat files.
19  *
20  * @PPList "pp1500": converts histograms to (c)rystal (b)inary (f)ormat files.
21  *
22  * @cassttng Processor/\%name\%/{Name} \n
23  * processor name containing the histogram that write to cbf.
24  * If not set then no cbf file will be written when condition is true
25  * @cassttng Processor/\%name\%/{SummaryName} \n
26  * processor name containing Histogram to be written as summary to
27  * cbf. If not set then no summary will be written
28  * @cassttng Processor/\%name\%/{FileBaseName} \n
29  * Default name given by program parameter
30  * @cassttng Processor/\%name\%/{MaximumNbrFilesPerDir} \n
31  * Distribute the files over subdirectories where each subdir contains
32  * this amount of files. If -1 it will not distribute the files.
33  * Default is -1.
34  *
35  * @author Stephan Kassemeyer
36  * @author Lutz Foucar
37  */
38 class pp1500 : public Processor
39 {
40 public:
41  /** constructor */
42  pp1500(const name_t &);
43 
44  /** overwrite process event */
45  virtual void processEvent(const CASSEvent&);
46 
47  /** dump dark to cbf just before quitting */
48  virtual void aboutToQuit();
49 
50  /** load the settings of this pp */
51  virtual void loadSettings(size_t);
52 
53  /** overwrite the retrieval of an histogram */
54  virtual const result_t& result(const CASSEvent::id_t eventid=0);
55 
56  /** overwrite the release */
57  virtual void releaseEvent(const CASSEvent &){}
58 
59 protected:
60  /** the filename that the data will be written to */
61  std::string _basefilename;
62 
63  /** pp containing histogram to dump to cbf */
65 
66  /** pp containing histogram that will be written as summary to dump to cbf */
68 
69  /** the number of files in each subdir */
71 
72  /** counter to count how many files have been written */
74 
75 private:
76  /** a lock to make the process reentrant */
78 };
79 } //end namespace cass
80 #endif
Event to store all LCLS Data.
Definition: cass_event.h:32
std::string _basefilename
the filename that the data will be written to
Definition: cbf_output.h:61
check if FEL is off by checking for bykick which is eventid
shared_pointer _summaryHist
pp containing histogram that will be written as summary to dump to cbf
Definition: cbf_output.h:67
pp1500(const name_t &)
constructor
Definition: cbf_output.cpp:28
uint64_t id_t
define the id type
Definition: cass_event.h:52
converts histograms to (c)rystal (b)inary (f)ormat files.
Definition: cbf_output.h:38
shared_pointer _pHist
pp containing histogram to dump to cbf
Definition: cbf_output.h:64
virtual void releaseEvent(const CASSEvent &)
overwrite the release
Definition: cbf_output.h:57
base class for processors.
Definition: processor.h:39
virtual const result_t & result(const CASSEvent::id_t eventid=0)
overwrite the retrieval of an histogram
Definition: cbf_output.cpp:94
virtual void processEvent(const CASSEvent &)
overwrite process event
Definition: cbf_output.cpp:99
file contains processors baseclass declaration
int _maxFilePerSubDir
the number of files in each subdir
Definition: cbf_output.h:70
int _filecounter
counter to count how many files have been written
Definition: cbf_output.h:73
QMutex _lock
a lock to make the process reentrant
Definition: cbf_output.h:77
virtual void aboutToQuit()
dump dark to cbf just before quitting
Definition: cbf_output.cpp:130
std::string name_t
define the name type
Definition: processor.h:46
std::tr1::shared_ptr< Processor > shared_pointer
a shared pointer of this
Definition: processor.h:43
virtual void loadSettings(size_t)
load the settings of this pp
Definition: cbf_output.cpp:34