8 #include <JANA/JApplication.h>
9 #include <JANA/JFactory.h>
13 #include <TDirectory.h>
86 TDirectory *
main = gDirectory;
88 TDirectory *tagmDir = gDirectory->mkdir(
"TAGM_TW");
91 gDirectory->mkdir(
"tdc-rf")->cd();
92 for (uint32_t i = 0; i <
NCOLUMNS; ++i)
95 Form(
"#delta t vs. pulse peak for TAGM column %i;\
96 Pulse peak (adc counts);TDC - RF (ns)", i+1), \
99 for (uint32_t i = 0; i <
NROWS; ++i)
101 for (uint32_t j = 0; j < 4; ++j)
104 Form(
"#delta t vs. pulse peak for TAGM ind. column %i, row %i;\
105 Pulse peak (adc counts);TDC - RF (ns)", j+1, i+1),
112 gDirectory->mkdir(
"t-rf")->cd();
113 for (uint32_t i = 0; i <
NCOLUMNS; ++i)
115 h_dt_vs_pp[i] =
new TH2I(Form(
"h_dt_vs_pp_%i", i+1),
116 Form(
"#delta t vs. pulse peak for TAGM column %i;\
117 Pulse peak (adc counts);T - RF (ns)", i+1),\
120 for (uint32_t i = 0; i <
NROWS; ++i)
122 for (uint32_t j = 0; j < 4; ++j)
124 h_dt_vs_pp_ind[i][j] =
new TH2I(Form(
"h_dt_vs_pp_ind_%i_%i", i+1, j+1),
125 Form(
"#delta t vs. pulse peak for TAGM ind. column %i, row %i;\
126 Pulse peak (adc counts);T - RF (ns)", j+1, i+1),
133 h_tdc_adc_all =
new TH2I(
"tdc_adc_all",
"Summed channels;TDC - ADC (ns);Column",
135 h_tdc_adc_all_ind =
new TH2I(
"tdc_adc_all_ind",
"Individual channels;TDC - ADC (ns);Column",
137 h_t_adc_all =
new TH2I(
"t_adc_all",
"Summed channels;TDC - ADC (ns);Column",
139 h_t_adc_all_ind =
new TH2I(
"t_adc_all_ind",
"Individual channels;TDC - ADC (ns);Column",
141 h_adc_rf_all =
new TH2I(
"adc_rf_all",
"Summed channels;ADC - RF (ns);Column",
143 h_adc_rf_all_ind =
new TH2I(
"adc_rf_all_ind",
"Individual channels;ADC - RF (ns);Column",
161 vector<const DRFTime*> locRFTimes;
162 eventLoop->Get(locRFTimes);
177 vector<const DTAGMHit*> hits;
178 loop->Get(hits,
"Calib");
180 vector<const DRFTime*> locRFTimes;
181 loop->Get(locRFTimes,
"TAGH");
182 const DRFTime* locRFTime = NULL;
184 if (locRFTimes.size() > 0)
185 locRFTime = locRFTimes[0];
189 japp->RootFillLock(
this);
191 for (uint32_t i = 0; i < hits.size(); ++i) {
192 if (!hits[i]->has_TDC || !hits[i]->has_fADC)
continue;
193 int col = hits[i]->column;
194 int row = hits[i]->row;
195 double pp = hits[i]->pulse_peak;
196 double tm_t = hits[i]->t;
197 double adc_t = hits[i]->time_fadc;
198 double tdc_t = hits[i]->time_tdc;
246 japp->RootFillUnLock(
this);
jerror_t init(void)
Called once at program start.
jerror_t fini(void)
Called after last event of last event source has been processed.
static TH2I * h_dt_vs_pp_tdc_ind[NROWS][4]
static TH2I * h_tdc_adc_all
static TH2I * h_dt_vs_pp_tdc[NCOLUMNS]
~JEventProcessor_TAGM_TW()
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
JEventProcessor_TAGM_TW()
static TH2I * h_dt_vs_pp_ind[NROWS][4]
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
static TH2I * h_tdc_adc_all_ind
static TH2I * h_adc_rf_all
static TH2I * h_t_adc_all
double Step_TimeToNearInputTime(double locTimeToStep, double locTimeToStepTo) const
DRFTime_factory * dRFTimeFactory
static TH2I * h_t_adc_all_ind
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
int main(int argc, char *argv[])
static TH2I * h_adc_rf_all_ind