Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_DAQTree.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_DAQTree.h
4 // Created: Tue Oct 22 14:55:40 EDT 2013
5 // Creator: dalton (on Linux gluon45.jlab.org 2.6.32-358.18.1.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _JEventProcessor_DAQTree_
9 #define _JEventProcessor_DAQTree_
10 
11 #include <JANA/JEventProcessor.h>
12 #include "TH1D.h"
13 #include "TTree.h"
14 
15 #include <stdint.h>
16 
17 // Doxygen documentation
18 /**
19  This plugin is designed to make root trees of low level data from the DAQ.
20  Each low level data type will have its own tree in the file.
21  Each event and each channel is a new entry in the tree.
22 
23  Trees will be named after the low level data type used to fill them.
24  Currently the data types that are supported are: \n
25  Df125WindowRawData \n
26  Df125PulseRawData \n
27  Df125PulseIntegral \n
28  Df125PulseTime \n
29  Df125PulsePedestal \n
30  Df125TriggerTime \n
31  DF1TDCHit \n
32  DF1TDCTriggerTime \n
33  Df250WindowRawData \n
34  Df250PulseRawData \n
35  Df250PulseIntegral \n
36  Df250PulseTime \n
37  Df250PulsePedestal \n
38  Df250TriggerTime \n
39 
40  The data types that might be added in future: \n
41  Df250StreamingRawData \n
42  Df250WindowSum \n
43 
44  Wiki documentation can be found here: https://halldweb1.jlab.org/wiki/index.php/DAQTree_plugin
45 */
46 
47 class JEventProcessor_DAQTree:public jana::JEventProcessor{
48  public:
51  const char* className(void){return "JEventProcessor_DAQTree";}
52 
53  TTree *Df125WindowRawData_tree; ///< f125 readout
54  TTree *Df125PulseRawData_tree; ///< f125 readout mode 2
55  TTree *Df125PulseIntegral_tree; ///< f125 readout modes 3 and 7
56  TTree *Df125PulseTime_tree; ///< f125 readout modes 3,4,7 and 8
57  TTree *Df125PulsePedestal_tree; ///< f125 readout modes 4,7 and 8
58  TTree *Df125TriggerTime_tree; ///< all f125 readout modes
61  TTree *Df250WindowRawData_tree; ///< f250 readout modes 1 and 8
62  TTree *Df250PulseRawData_tree; ///< f250 readout mode 2
63  TTree *Df250PulseIntegral_tree; ///< f250 readout modes 3 and 7
64  TTree *Df250PulseTime_tree; ///< f250 readout modes 3,4,7 and 8
65  TTree *Df250PulsePedestal_tree; ///< f250 readout modes 4,7 and 8
66  TTree *Df250TriggerTime_tree; ///< all f250 readout modes
67 
68  uint32_t channelnum; ///< Arbitrary global channel number (sorted by crate, slot, channel). Note that when data is sparsified then this value will not have a constant relationship with any particular physical channel.
69  uint32_t eventnum; ///< Event number
70  uint32_t rocid; ///< (from DDAQAddress) Crate number
71  uint32_t slot; ///< (from DDAQAddress) Slot number in crate
72  uint32_t channel; ///< (from DDAQAddress) Channel number in slot
73  uint32_t itrigger; ///< (from DDAQAddress) Trigger number for cases when this hit was read in a multi-event block (from DDAQAddress)
74  vector<uint32_t> waveform; ///< STL vector of samples of the waveform for the event\n for f125WRD, f250WRD, f250PRD
75  uint32_t nsamples; ///< Number of samples extracted from the waveform\n for f125WRD, f250WRD, f250PRD
76  uint32_t w_integral; ///< Sum of all samples extracted from the waveform\n for f125WRD, f250WRD, f250PRD
77  uint32_t w_min; ///< Minimum sample extracted from the waveform\n for f125WRD, f250WRD, f250PRD
78  uint32_t w_max; ///< Maximum sample extracted from the waveform\n for f125WRD, f250WRD, f250PRD
79  uint32_t w_samp1; ///< First sample extracted from the waveform (for simple analysis in case the STL vector is difficult to access)\n for f250WRD, f250PRD
80  uint32_t w_ped; ///< the sum of the first 10 samples extracted from the waveform for use as a pedestal\n for f125WRD, f250WRD, Always = 0 for f250PRD
81  Float_t w_time; ///< the time (in samples) of the pulse calculated similar to the IU method\n for f125WRD, f250WRD, f250PRD
82  uint32_t pulse_number; /// \n for f250PRD, f250PI, f250PT
83  uint32_t quality_factor; /// \n for f250PI, f250PT
84  int32_t integral; /// \n for f250PI
85  int32_t pedestal; /// \n for f250PI and f250PP
86  uint32_t nsamples_integral; /// \n for f250PI
87  uint32_t nsamples_pedestal; /// \n for f250PI and f250PP
88  uint32_t pulse_peak; /// \n for f250PP
89  uint32_t time; /// \n for f250PT, f250TT, F1TDCH
90  uint32_t first_sample_number; /// \n for f250PRD
91  bool invalid_samples; /// \n for f250WRD, f250PRD
92  bool overflow; /// \n for f250WRD, f250PRD
93  uint32_t trig_time; /// \n for F1TDCH
94  uint32_t data_word; /// \n for F1TDCH
95 
96  private:
97  jerror_t init(void); ///< Called once at program start.
98  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
99  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
100  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
101  jerror_t fini(void); ///< Called after last event of last event source has been processed.
116 
117 };
118 
119 #endif // _JEventProcessor_DAQTree_
TTree * Df125PulseTime_tree
f125 readout modes 3,4,7 and 8
Float_t w_time
the time (in samples) of the pulse calculated similar to the IU method for f125WRD, f250WRD, f250PRD
uint32_t rocid
(from DDAQAddress) Crate number
vector< uint32_t > waveform
STL vector of samples of the waveform for the event for f125WRD, f250WRD, f250PRD.
TTree * Df250TriggerTime_tree
all f250 readout modes
TTree * Df250PulseIntegral_tree
f250 readout modes 3 and 7
jerror_t init(void)
for F1TDCH
bool overflow
for f250WRD, f250PRD
uint32_t w_integral
Sum of all samples extracted from the waveform for f125WRD, f250WRD, f250PRD.
uint32_t eventnum
Event number.
uint32_t nsamples_integral
for f250PI and f250PP
TTree * Df250PulsePedestal_tree
f250 readout modes 4,7 and 8
uint32_t pulse_peak
for f250PI and f250PP
uint32_t nsamples_pedestal
for f250PI
int32_t integral
for f250PI, f250PT
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
TTree * Df250WindowRawData_tree
f250 readout modes 1 and 8
uint32_t data_word
for F1TDCH
uint32_t w_min
Minimum sample extracted from the waveform for f125WRD, f250WRD, f250PRD.
uint32_t nsamples
Number of samples extracted from the waveform for f125WRD, f250WRD, f250PRD.
uint32_t w_max
Maximum sample extracted from the waveform for f125WRD, f250WRD, f250PRD.
uint32_t w_samp1
First sample extracted from the waveform (for simple analysis in case the STL vector is difficult to ...
uint32_t channel
(from DDAQAddress) Channel number in slot
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
TTree * Df125PulseIntegral_tree
f125 readout modes 3 and 7
TTree * Df125PulsePedestal_tree
f125 readout modes 4,7 and 8
jerror_t fini(void)
Called after last event of last event source has been processed.
TTree * Df250PulseRawData_tree
f250 readout mode 2
TTree * Df250PulseTime_tree
f250 readout modes 3,4,7 and 8
uint32_t channelnum
Arbitrary global channel number (sorted by crate, slot, channel). Note that when data is sparsified t...
TTree * Df125WindowRawData_tree
f125 readout
uint32_t slot
(from DDAQAddress) Slot number in crate
uint32_t first_sample_number
for f250PT, f250TT, F1TDCH
uint32_t trig_time
for f250WRD, f250PRD
TTree * Df125PulseRawData_tree
f125 readout mode 2
uint32_t itrigger
(from DDAQAddress) Trigger number for cases when this hit was read in a multi-event block (from DDAQA...
TTree * Df125TriggerTime_tree
all f125 readout modes
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
uint32_t w_ped
the sum of the first 10 samples extracted from the waveform for use as a pedestal for f125WRD...
uint32_t quality_factor
for f250PRD, f250PI, f250PT