11 #include <JANA/JApplication.h>
12 #include <JANA/JFactory.h>
52 "Flag to decide if timewalk corrections should be applied.");
70 h2_stt_vs_pp_chan[i] =
new TH2I(Form(
"stt_vs_pp_chan_%i", i+1),
"Hit Time vs. Pulse Peak; Pulse Peak (channels); #delta_{t} (ns)", 4096,0.0,4095.0, 160, -5.0, 5.0);
72 h_pp_chan[i] =
new TH1I(Form(
"pp_chan_%i", i+1),
"Pulse Peak; Pulse Peak (channels); Counts", 4096,0.0,4095.0);
74 h_stt_chan[i] =
new TH1I(Form(
"h_stt_chan_%i",i+1),
"ST Time; ST Time (ns); Counts", 160, -5.0, 5.0);
76 h1_st_corr_time[i] =
new TH1I(Form(
"h1_st_corr_time_%i",i+1),
"ST Time; ST Time (ns); Counts", 160, -5.0, 5.0);
78 h2_st_corr_vs_pp[i]=
new TH2I(Form(
"h2_st_corr_vs_pp_%i", i+1),
"Hit Time vs. Pulse Peak; Pulse Peak (channels); #delta_{t} (ns)", 4096,0.0,4095.0, 160, -5.0, 5.0);
92 jout <<
"Error loading /START_COUNTER/timewalk_parms_v2 !" << endl;
118 loop->GetSingle(locTrigger);
122 vector<const DSCHit*> st_hits;
125 for (
unsigned int k = 0; k < st_hits.size(); k++)
127 if(!st_hits[k]->has_fADC || !st_hits[k]->has_TDC)
132 st_hits[k]->GetSingle(the_digihit);
133 if(the_digihit == NULL)
140 double adc_pp = pulse_peak - pedestal/nsamples_pedestal;
142 double T = st_hits[k]->t;
144 double adc_t = st_hits[k]->t_fADC;
145 int sector = st_hits[k]->sector;
149 japp->RootFillLock(
this);
168 st_time -= C0 + C1 *(TMath::Power(A0/A_THRESH, C2));
174 japp->RootFillUnLock(
this);
uint32_t pedestal
pedestal info used by FPGA (if any)
uint32_t Get_L1FrontPanelTriggerBits(void) const
jerror_t fini(void)
Called after last event of last event source has been processed.
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
uint32_t nsamples_pedestal
number of samples used in pedestal
jerror_t init(void)
Called once at program start.
double USE_TIMEWALK_CORRECTION
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
TH2I ** h2_stt_vs_pp_chan
static TH1I * pedestal[nChan]
uint32_t pulse_peak
maximum sample in pulse
vector< vector< double > > timewalk_parameters
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
~JEventProcessor_st_tw_corr_auto()
JEventProcessor_st_tw_corr_auto()