Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_ST_online_lowlevel.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_ST_online_lowlevel.h
4 // Created: Fri Jun 19 13:21:45 EDT 2015
5 // Creator: mkamel (on Linux ifarm1401 2.6.32-431.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _JEventProcessor_ST_online_lowlevel_
9 #define _JEventProcessor_ST_online_lowlevel_
10 
11 #include <JANA/JEventProcessor.h>
12 using namespace jana;
13 using namespace std;
14 using std::vector;
15 using std::string;
16 // ***************** C++ header files******************
17 //*****************************************************
18 #include <stdint.h>
19 #include <vector>
20 #include <stdio.h>
21 //***************** ROOT header files********************
22 //*******************************************************
23 #include <TMath.h>
24 #include <TDirectory.h>
25 #include <TH1.h>
26 #include <TH2.h>
27 //***************** ST header files************************
28 //*********************************************************
31 #include "START_COUNTER/DSCHit.h"
32 // ***************** DAQ header files (Triger Times)*********
33 //***********************************************************
34 #include "DAQ/Df250WindowRawData.h"
35 #include "DAQ/Df250PulseRawData.h"
36 #include "DAQ/Df250PulseTime.h"
37 #include "DAQ/Df250PulseIntegral.h"
38 #include "DAQ/Df250PulsePedestal.h"
39 #include "DAQ/Df250Config.h"
40 #include <TTAB/DTTabUtilities.h>
41 //****************************** Define some constants *********
42 //**************************************************************
43 const uint32_t NCHANNELS = 30; // number of scintillator paddles
44 const float_t ADC_PT_RES = 0.0625; // fADC250 pulse time resolution (ns)
45 //const float_t TDC_RES = 0.0559; // f1TDC resolution (ns)
46 //***************** Declare Two Dimensional Histograms*************
47 //*****************************************************************
48 static TH2I *h2_st_adc_tdc_multi;
49 static TH2I *h2_st_adc_hit_multi;
50 static TH2I *h2_raw_pi_sector;
51 static TH2I *h2_raw_ped_sector;
52 static TH2I *h2_raw_pt_sector;
53 static TH2I *h2_adc_pp_sector;
54 static TH2I *h2_adc_pcpi_sector;
55 static TH2I *h2_adc_pt_sector;
56 static TH2I *h2_adc_ped_sector;
57 static TH2I *h2_st_time_vs_pcpi;
58 static TH2I *h2_st_time_vs_pp;
59 static TH2I *h2_raw_tdcTime_sec;
60 static TH2I *h2_tdcTime_sec;
61 static TH2I *h2_t_sec;
62 static TH2I *h2_tTDC_sec;
63 static TH2I *h2_tfADC_sec;
64 static TH2I *h2_dE_sec;
65 //***************** Declare One Dimensional Histograms****************
66 //********************************************************************
67 static TH1I *h1_adc_sec;
68 static TH1I *h1_tdc_sec;
69 static TH1I *h1_hit_sec;
70 static TH1I *st_num_events;
71 //***************** Declare Dynamic Arrays of waveform Histograms********
72 // &&&&&& define the Boolian variables needed &&&&&
73 //***********************************************************************
74 TH1I** h_amp_vs_sampl_chan = new TH1I*[NCHANNELS];
75 TH1I** h_amp_vs_sampl_chan150 = new TH1I*[NCHANNELS];
76 TH1I** h_amp_vs_sampl_chan1000 = new TH1I*[NCHANNELS];
77 TH1I** h_amp_vs_sampl_chan2000 = new TH1I*[NCHANNELS];
78 TH1I** h_amp_vs_sampl_chan3000 = new TH1I*[NCHANNELS];
79 TH1I** h_amp_vs_sampl_chan4000 = new TH1I*[NCHANNELS];
86 Double_t adc_pp;
87 Double_t adc_t;
88 Double_t adc_ped;
89 Double_t adc_pi;
90 Double_t adc_pcpi;
91 Double_t tdc_t;
92 Double_t st_time;
93 //// Offsets from CCDB
94 vector<double> a_pedestals;
95 vector<double> adc_time_offsets;
96 vector<double> tdc_time_offsets;
97 double t_tdc_base;
98 double t_base;
99 double t_scale;
100 //**************Histograms limits Determination******************************
101 //***************************************************************************
102 const uint32_t ADC_MULTI_MIN = 0.; // Lower limit of adc multiplicity histogram
103 const uint32_t ADC_MULTI_MAX = 31.; // Upper limit of adc multiplicity histogram
104 const uint32_t ADC_MULTI_BINS = 31.; // Number of bins in adc multiplicity histogram
105 const uint32_t TDC_MULTI_MIN = 0.; // Lower limit of tdc multiplicity histogram
106 const uint32_t TDC_MULTI_MAX = 40.; // Upper limit of tdc multiplicity histogram
107 const uint32_t TDC_MULTI_BINS = 40.; // Number of bins in tdc multiplicity histogram
108 const uint32_t PI_MIN = 0.; // Lower limit of pulse integral histogram
109 const uint32_t PI_MAX = 12000.; // Upper limit of pulse integral histogram
110 const uint32_t PI_BINS = 240.; // Number of bins in pulse integral histogram
111 const uint32_t PED_MIN = 90.; // Lower limit of pedestal histogram
112 const uint32_t PED_MAX = 120.; // Upper limit of pedestal histogram
113 const uint32_t PED_BINS = 30.; // Number of bins in pedestal histogram
114 const uint32_t PT_MIN = 0.; // Lower limit of pulse time histogram (ns)
115 const uint32_t PT_MAX = 200.; // Upper limit of pulse time histogram (ns)
116 const uint32_t PT_BINS = 200.; // Number of bins in pulse time histogram
117 const uint32_t TDC_DHIT_MIN = 0.; // Lower limit of tdc digihit time histogram
118 const uint32_t TDC_DHIT_MAX = 2200.; // Upper limit of tdc digihit time histogram
119 const uint32_t TDC_DHIT_BINS = 220.; // Number of bins in tdc digihit time histogram
120 const float_t T_HIT_MIN = -80.; // Lower limit of hit time histogram (ns)
121 const float_t T_HIT_MAX = 80.; // Upper limit of hit time histogram (ns)
122 const float_t T_HIT_BINS = 160.; // Number of bins in hit time histogram
123 
124 class JEventProcessor_ST_online_lowlevel:public jana::JEventProcessor{
125  public:
128  const char* className(void){return "JEventProcessor_ST_online_lowlevel";}
129 
130  private:
131  jerror_t init(void); ///< Called once at program start.
132  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
133  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
134  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
135  jerror_t fini(void); ///< Called after last event of last event source has been processed.
136 
137 
138 };
139 
140 #endif // _JEventProcessor_ST_online_lowlevel_
141 
Bool_t bool_sec[NCHANNELS]
const uint32_t PT_BINS
static TH2I * h2_st_adc_hit_multi
const uint32_t PI_BINS
TH1I ** h_amp_vs_sampl_chan1000
static TH2I * h2_st_time_vs_pcpi
static TH2I * h2_tTDC_sec
const uint32_t ADC_MULTI_MAX
const uint32_t PED_BINS
const Int_t NCHANNELS
const uint32_t TDC_DHIT_BINS
char string[256]
static TH2I * h2_t_sec
Bool_t bool_sec150[NCHANNELS]
TH1I ** h_amp_vs_sampl_chan2000
const uint32_t TDC_DHIT_MAX
TH1I ** h_amp_vs_sampl_chan
static TH2I * h2_raw_ped_sector
static TH1I * h1_hit_sec
const uint32_t TDC_MULTI_MAX
const uint32_t ADC_MULTI_MIN
static TH2I * h2_st_time_vs_pp
static TH2I * h2_dE_sec
TH1I ** h_amp_vs_sampl_chan3000
Bool_t bool_sec1000[NCHANNELS]
const float_t T_HIT_MAX
static TH2I * h2_raw_tdcTime_sec
const uint32_t PED_MAX
const float_t T_HIT_BINS
static TH2I * h2_adc_ped_sector
static TH2I * h2_tfADC_sec
const float_t ADC_PT_RES
static TH2I * h2_st_adc_tdc_multi
const uint32_t TDC_MULTI_BINS
static TH1I * st_num_events
const uint32_t TDC_MULTI_MIN
const uint32_t ADC_MULTI_BINS
vector< double > a_pedestals
vector< double > tdc_time_offsets
static TH2I * h2_adc_pp_sector
const float_t T_HIT_MIN
const uint32_t PED_MIN
TH1I ** h_amp_vs_sampl_chan150
static TH2I * h2_raw_pt_sector
Bool_t bool_sec2000[NCHANNELS]
const uint32_t PI_MAX
static TH2I * h2_raw_pi_sector
static TH2I * h2_adc_pcpi_sector
TH1I ** h_amp_vs_sampl_chan4000
static TH2I * h2_adc_pt_sector
static TH2I * h2_tdcTime_sec
static TH1I * h1_tdc_sec
const uint32_t PT_MAX
static TH1I * h1_adc_sec
Bool_t bool_sec4000[NCHANNELS]
vector< double > adc_time_offsets
const uint32_t PT_MIN
Bool_t bool_sec3000[NCHANNELS]
const uint32_t PI_MIN
const uint32_t TDC_DHIT_MIN