63 (
const char **)decay_ana_param_str,
74 #define POS_FLAG_LD (1<<0)
75 #define POS_FLAG_TD (1<<1)
76 #define POS_FLAG_RD (1<<2)
77 #define POS_FLAG_BD (1<<3)
78 #define POS_FLAG_LU (1<<4)
79 #define POS_FLAG_TU (1<<5)
80 #define POS_FLAG_RU (1<<6)
81 #define POS_FLAG_BU (1<<7)
95 char title[256], name[256];
101 if ( i > N_DECAY_HISTS-1)
104 sprintf(name,
"hDecay%03d", i+1);
110 hDecHist[i] = H1_BOOK(name, title, nbin, xlow, xhigh);
115 if ( i > 3*N_DECAY_HISTS-1)
124 hDecHist[i] = H1_BOOK(name, title, nbin, xlow, xhigh);
155 sprintf(title,
"%s, Ext. ON, Run %s_%04d", decay_ana_param.
histotitles.
decaytitles.titles[i-2*N_DECAY_HISTS],
195 n = bk_locate(pevent,
"TDC0", &ptdc);
209 memset(&counter, 0x00,
sizeof(counter));
210 memset(&tdc_data, 0x00,
sizeof(tdc_data));
212 for (
int i=1; i<n; i++){
218 tdc_data[channel][counter[channel]] = lem_data->
data;
263 if ( !foundTD && !foundMCP2 )
return SUCCESS;
264 if ( !foundTD ) masterCH =
MCP2F;
268 if ( tdc_data[
POSLDI][0] > 0 && tdc_data[
POSLDO][0] > 0 ) {
269 difftime_last = tdc_data[
POSLDI][0] - tdc_data[masterCH][0];
275 if ( tdc_data[
POSTDI][0] > 0 && tdc_data[
POSTDO][0] > 0 ) {
276 difftime_last = tdc_data[
POSTDI][0] - tdc_data[masterCH][0];
282 if ( tdc_data[
POSRDI][0] > 0 && tdc_data[
POSRDO][0] > 0 ) {
283 difftime_last = tdc_data[
POSRDI][0] - tdc_data[masterCH][0];
289 if ( tdc_data[
POSBDI][0] > 0 && tdc_data[
POSBDO][0] > 0 ) {
290 difftime_last = tdc_data[
POSBDI][0] - tdc_data[masterCH][0];
298 if ( tdc_data[
POSLUI][0] > 0 && tdc_data[
POSLUO][0] > 0 ) {
299 difftime_last = tdc_data[
POSLUI][0] - tdc_data[masterCH][0];
305 if ( tdc_data[
POSTUI][0] > 0 && tdc_data[
POSTUO][0] > 0 ) {
306 difftime_last = tdc_data[
POSTUI][0] - tdc_data[masterCH][0];
312 if ( tdc_data[
POSRUI][0] > 0 && tdc_data[
POSRUO][0] > 0 ) {
313 difftime_last = tdc_data[
POSRUI][0] - tdc_data[masterCH][0];
319 if ( tdc_data[
POSBUI][0] > 0 && tdc_data[
POSBUO][0] > 0 ) {
320 difftime_last = tdc_data[
POSBUI][0] - tdc_data[masterCH][0];
328 if ( tdc_data[masterCH][1] != 0 &&
336 if ( tdc_data[
POSLDI][1] != 0 ){
338 abs(tdc_data[
POSLDI][1]-tdc_data[
POSLDO][1]) < 50 )
return SUCCESS;
343 hDecHist[24]->Fill( (
float)(tdc_data[
POSLDI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[0], 1.);
347 if ( tdc_data[
POSLUI][1] != 0 ){
349 abs(tdc_data[
POSLUI][1]-tdc_data[
POSLUO][1]) < 50 )
return SUCCESS;
352 hDecHist[12]->Fill( (
float)(tdc_data[
POSLUI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[4], 1.);
354 hDecHist[28]->Fill( (
float)(tdc_data[
POSLUI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[4], 1.);
360 if ( tdc_data[
POSTDI][1] != 0 ){
362 abs(tdc_data[
POSTDI][1]-tdc_data[
POSTDO][1]) < 50)
return SUCCESS;
367 hDecHist[25]->Fill( (
float)(tdc_data[
POSTDI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[1], 1.);
371 if ( tdc_data[
POSTUI][1] != 0 ){
373 abs(tdc_data[
POSTUI][1]-tdc_data[
POSTUO][1]) < 50)
return SUCCESS;
376 hDecHist[13]->Fill( (
float)(tdc_data[
POSTUI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[5], 1.);
378 hDecHist[29]->Fill( (
float)(tdc_data[
POSTUI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[5], 1.);
384 if ( tdc_data[
POSRDI][1] != 0 ){
386 abs(tdc_data[
POSRDI][1]-tdc_data[
POSRDO][1]) < 50)
return SUCCESS;
389 hDecHist[10]->Fill( (
float)(tdc_data[
POSRDI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[2], 1.);
391 hDecHist[26]->Fill( (
float)(tdc_data[
POSRDI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[2], 1.);
395 if ( tdc_data[
POSRUI][1] != 0 ){
397 abs(tdc_data[
POSRUI][1]-tdc_data[
POSRUO][1]) < 50)
return SUCCESS;
400 hDecHist[14]->Fill( (
float)(tdc_data[
POSRUI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[6], 1.);
402 hDecHist[30]->Fill( (
float)(tdc_data[
POSRUI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[6], 1.);
408 if ( tdc_data[
POSBDI][1] != 0 ){
410 abs(tdc_data[
POSBDI][1]-tdc_data[
POSBDO][1]) < 50)
return SUCCESS;
413 hDecHist[11]->Fill( (
float)(tdc_data[
POSBDI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[3], 1.);
415 hDecHist[27]->Fill( (
float)(tdc_data[
POSBDI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[3], 1.);
419 if ( tdc_data[
POSBUI][1] != 0 ){
421 abs(tdc_data[
POSBUI][1]-tdc_data[
POSBUO][1]) < 50)
return SUCCESS;
424 hDecHist[15]->Fill( (
float)(tdc_data[
POSBUI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[7], 1.);
426 hDecHist[31]->Fill( (
float)(tdc_data[
POSBUI][0] - tdc_data[masterCH][0]) + t0shift_param.
delta_t0[7], 1.);
struct DECAYANAMODULE_PARAM::@1::@3 decaybin
DECAYANAMODULE_PARAM decay_ana_param
struct TRIGGER_SETTINGS::@20 event_2_settings
#define N_OFFSET_PPC_HISTOGRAMS
ID offset of postpileup-rejected histograms.
struct DECAYANAMODULE_PARAM::@0 histotitles
#define EXTON1_FLAG
flag for "red/green", "on/off" mode: ON
struct DECAYANAMODULE_PARAM::@1 histobinning
struct DECAYANAMODULE_PARAM::@0::@2 decaytitles
TObjArray * gHistoFolderStack
TRIGGER_SETTINGS trigger_settings
struct TRIGGER_SETTINGS::@17 events
static TH1F * hDecHist[4 *N_DECAY_HISTS]
struct TRIGGER_SETTINGS::@19 event_1_settings
DECAYANAMODULE_PARAM_STR(decay_ana_param_str)
#define DATA_N_HITS
max. of DATA_N_HITS in data file
#define EXTOFF1_FLAG
flag for "red/green", "on/off" mode: OFF
INT decay_eor(INT run_number)
TFolder * gManaHistosFolder
INT decay_bor(INT run_number)
#define N_TDC_CHANNELS
number of TDC channels
INT decay_ana(EVENT_HEADER *, void *)
static DWORD dataWindowMuonDecay
#define N_OFFSET_ONOFF_HISTOGRAMS
ID offset for "on/off", "red/green" histograms: no offset means "off".
#define N_DECAY_HISTS
number of LE-uSR npp decay histograms
T0SHIFT_PARAM t0shift_param
ANA_MODULE decay_ana_module
#define EVENT_0_TYPE
EVENT type 0 = BC-MCP1-(e+)