CFEL - ASG Software Suite  2.5.0
CASS
roottree_converter.h
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file roottree_converter.h file contains declaration of processor 2001
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _ROOTTREE_CONVERTER_H_
10 #define _ROOTTREE_CONVERTER_H_
11 
12 #include <string>
13 #include <list>
14 #include <map>
15 
16 #include "processor.h"
18 #include "tree_structure.h"
19 #include "delayline_detector.h"
20 
21 
22 class TTree;
23 class TFile;
24 
25 namespace cass
26 {
27 /** root file converter
28  *
29  * will write detectorhits of user specified delayline detectors to a root
30  * tree.
31  *
32  * @cassttng Processor/\%name\%/{Detectors}\n
33  * comma separated list of Delaylinedetectors who's hits should be
34  * added to the tree.
35  * @cassttng Processor/\%name\%/{Particles}\n
36  * comma separated list of Particles who's hits should be
37  * added to the tree. The corrosponding detector does not need to be
38  * added above since this processor will find out what detector
39  * a particle belongs to automatically.
40  * @cassttng Processor/\%name\%/{Processors}\n
41  * comma separated list of 0d Processors who's values should be
42  * added to the tree.
43  * @cassttng Processor/\%name\%/{MachineData}\n
44  * Flag whether to add the Beamline and Epics data to the tree.
45  * Default is false.
46  * @cassttng Processor/\%name\%/{EventStatus}\n
47  * Flag whether to add the EventStatus array data to the tree.
48  * Default is false.
49  *
50  * @author Lutz Foucar
51  */
52 class pp2001 : public Processor
53 {
54 public:
55  /** Construct processor for converting histograms to root histograms */
56  pp2001(const name_t&, std::string);
57 
58  /** only a stub does nothing, but needs to be there because its pure virtual in base class */
59  virtual void processEvent(const CASSEvent&);
60 
61  /** load the settings of this pp */
62  virtual void loadSettings(size_t);
63 
64  /** dump all histogram to a root file just before quitting */
65  virtual void aboutToQuit();
66 
67  /** overwrite the retrieval of an histogram */
68  virtual const result_t& result(const CASSEvent::id_t eventid=0);
69 
70  /** overwrite the release */
71  virtual void releaseEvent(const CASSEvent &){}
72 
73 protected:
74  /** the root file */
75  TFile * _rootfile;
76 
77  /** the root tree to fill */
78  TTree * _tree;
79 
80  /** list of detectors who's hits should be filled into the tree */
81  std::list<ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type> _detectors;
82 
83  /** list of particles whos hits should be added to the tree */
84  std::list<std::pair<ACQIRIS::DelaylineDetector::particles_t::key_type,
85  ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type> > _particles;
86 
87  /** structure that should be written to tree */
89 
90  /** pointer to the above structure (needed by the tree) */
92 
93  /** copy of the event id */
94  uint64_t _eventid;
95 
96  /** machine data structure */
98 
99  /** pointer to the machine structure defined above */
101 
102  /** event status structure */
104 
105  /** pointer to the event status structure */
107 
108  /** container for all 0d Processors that should be added to the tree */
109  std::list<shared_pointer> _pps;
110 
111  /** 0d processor structure */
113 
114  /** pointer to the 0d processor structure */
116 
117 private:
118  /** a lock to make the process reentrant */
120 };
121 } // end namespace cass
122 
123 #endif
eventStatus_t * _eventstatusstructure_ptr
pointer to the event status structure
Event to store all LCLS Data.
Definition: cass_event.h:32
uint64_t _eventid
copy of the event id
pp2001(const name_t &, std::string)
Construct processor for converting histograms to root histograms.
virtual const result_t & result(const CASSEvent::id_t eventid=0)
overwrite the retrieval of an histogram
check if FEL is off by checking for bykick which is eventid
file contains declaration of classes that extract information of acqiris detectors.
uint64_t id_t
define the id type
Definition: cass_event.h:52
machinestructure_t * _machinestructure_ptr
pointer to the machine structure defined above
TTree * _tree
the root tree to fill
file contains the classes that describe a delayline detector.
TFile * _rootfile
the root file
QMutex _lock
a lock to make the process reentrant
treestructure_t _treestructure
structure that should be written to tree
base class for processors.
Definition: processor.h:39
std::map< std::string, treedetector_t > treestructure_t
a map will enable us to identify the right detector in the container
std::vector< bool > eventStatus_t
a vector of bools that show which eventcodes where associated with the event
std::map< std::string, double > machinestructure_t
the machine structure just a map of values identified by a string
std::list< ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type > _detectors
list of detectors who's hits should be filled into the tree
file contains processors baseclass declaration
std::list< shared_pointer > _pps
container for all 0d Processors that should be added to the tree
virtual void processEvent(const CASSEvent &)
only a stub does nothing, but needs to be there because its pure virtual in base class ...
virtual void loadSettings(size_t)
load the settings of this pp
std::map< std::string, double > ppstructure_t
the 0d processor structure a map of values identified by a string
ppstructure_t _ppstructure
0d processor structure
root file converter
eventStatus_t _eventstatusstructure
event status structure
std::string name_t
define the name type
Definition: processor.h:46
virtual void aboutToQuit()
dump all histogram to a root file just before quitting
virtual void releaseEvent(const CASSEvent &)
overwrite the release
defining structures for the root tree
machinestructure_t _machinestructure
machine data structure
treestructure_t * _treestructure_ptr
pointer to the above structure (needed by the tree)
ppstructure_t * _ppstructure_ptr
pointer to the 0d processor structure
std::list< std::pair< ACQIRIS::DelaylineDetector::particles_t::key_type, ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type > > _particles
list of particles whos hits should be added to the tree