90 scope0 =
new TH1F (
"scope0",
"waveform Ch 0", 1024, -0.5, 1023.5);
91 scope1 =
new TH1F (
"scope1",
"waveform Ch 1", 1024, -0.5, 1023.5);
92 scope2 =
new TH1F (
"scope2",
"waveform Ch 2", 1024, -0.5, 1023.5);
93 scope3 =
new TH1F (
"scope3",
"waveform Ch 3", 1024, -0.5, 1023.5);
95 scope0->SetLineColor(kYellow+2);
96 scope1->SetLineColor(kBlue);
97 scope2->SetLineColor(kViolet);
98 scope3->SetLineColor(kGreen);
100 h1a =
new TH1F(
"h1a",
"Waveform", 4500, -0.5, 4499.5);
101 h1b =
new TH1F(
"h1b",
"Waveform", 4500, -0.5, 4499.5);
102 h1c =
new TH1F(
"h1c",
"Waveform", 4500, -0.5, 4499.5);
103 h1d =
new TH1F(
"h1d",
"Waveform", 4500, -0.5, 4499.5);
105 h2a =
new TH1F(
"h2a",
"Waveform", 4500, -0.5, 4499.5);
106 h2b =
new TH1F(
"h2b",
"Waveform", 4500, -0.5, 4499.5);
107 h2c =
new TH1F(
"h2c",
"Waveform", 4500, -0.5, 4499.5);
108 h2d =
new TH1F(
"h2d",
"Waveform", 4500, -0.5, 4499.5);
110 h3a =
new TH1F(
"h3a",
"Waveform", 4500, -0.5, 4499.5);
111 h3b =
new TH1F(
"h3b",
"Waveform", 4500, -0.5, 4499.5);
112 h3c =
new TH1F(
"h3c",
"Waveform", 4500, -0.5, 4499.5);
113 h3d =
new TH1F(
"h3d",
"Waveform", 4500, -0.5, 4499.5);
115 h4a =
new TH1F(
"h4a",
"Waveform", 4500, -0.5, 4499.5);
116 h4b =
new TH1F(
"h4b",
"Waveform", 4500, -0.5, 4499.5);
117 h4c =
new TH1F(
"h4c",
"Waveform", 4500, -0.5, 4499.5);
118 h4d =
new TH1F(
"h4d",
"Waveform", 4500, -0.5, 4499.5);
120 h1a_D =
new TH1F(
"h1a_D",
"Waveform", 4001, -0.5, 4000.5);
121 h1b_D =
new TH1F(
"h1b_D",
"Waveform", 4001, -0.5, 4000.5);
122 h1c_D =
new TH1F(
"h1c_D",
"Waveform", 4001, -0.5, 4000.5);
123 h1d_D =
new TH1F(
"h1d_D",
"Waveform", 4001, -0.5, 4000.5);
124 h2a_D =
new TH1F(
"h2a_D",
"Waveform", 4001, -0.5, 4000.5);
125 h2b_D =
new TH1F(
"h2b_D",
"Waveform", 4001, -0.5, 4000.5);
126 h2c_D =
new TH1F(
"h2c_D",
"Waveform", 4001, -0.5, 4000.5);
127 h2d_D =
new TH1F(
"h2d_D",
"Waveform", 4001, -0.5, 4000.5);
128 h3a_D =
new TH1F(
"h3a_D",
"Waveform", 4001, -0.5, 4000.5);
129 h3b_D =
new TH1F(
"h3b_D",
"Waveform", 4001, -0.5, 4000.5);
130 h3c_D =
new TH1F(
"h3c_D",
"Waveform", 4001, -0.5, 4000.5);
131 h3d_D =
new TH1F(
"h3d_D",
"Waveform", 4001, -0.5, 4000.5);
132 h4a_D =
new TH1F(
"h4a_D",
"Waveform", 4001, -0.5, 4000.5);
133 h4b_D =
new TH1F(
"h4b_D",
"Waveform", 4001, -0.5, 4000.5);
134 h4c_D =
new TH1F(
"h4c_D",
"Waveform", 4001, -0.5, 4000.5);
135 h4d_D =
new TH1F(
"h4d_D",
"Waveform", 4001, -0.5, 4000.5);
155 static int skipentries=0;
157 static bool SetSkipEntry =
true;
162 SetSkipEntry =
false;
165 cout <<
" Skipped " << skipentries <<
" events." << endl;
171 static bool PriorPassed =
true;
175 int nhb = p->
iValue(0,
"NHYBRIDS");
192 cout <<
"Wrong number of hybrids: "
193 << nhb <<
" found but expected "
207 for (
int i=1;
i<nhb-1;
i++)
213 cout <<
"Data length mismatch: "
215 <<
" out of " << p->
iValue(0,
"NSAMPLES")
216 <<
" on hybrid " <<
i
229 if (!PriorPassed) cout << endl;
234 static int entries=0;
238 cout <<
"Processed " << entries;
239 time_t now =
time(0);
240 char* dt = ctime(&now);
241 cout <<
" at " << dt << endl;
277 int samples = p1->
iValue(0,
"SAMPLES");
278 for (
int i = 0;
i < samples;
i++)
299 int nhb = p->
iValue(0,
"NHYBRIDS");
300 for (
int i=0;
i<nhb;
i++)
302 if (p->
iValue(
i,
"NSAMPLES")<24)
304 cout <<
"ERROR in Sample Length, "<< p->
iValue(
i,
"NSAMPLES") <<
" abort event" << endl;
309 static bool FirstEvent =
true;
312 cout <<
"Reports for " << nhb <<
" Hybrids:" << endl;
313 for (
int i=0;
i<nhb;
i++)
315 cout <<
i <<
": " << p->
iValue(
i,
"NSAMPLES") << endl;
325 for (idigi = 0; idigi< 4500; idigi++)
327 h1a->Fill( idigi, p->
iValue(idigi, 0,
"RAWSAMPLES"));
328 h1b->Fill( idigi, p->
iValue(idigi, 1,
"RAWSAMPLES"));
329 h1c->Fill( idigi, p->
iValue(idigi, 2,
"RAWSAMPLES"));
330 h1d->Fill( idigi, p->
iValue(idigi, 3,
"RAWSAMPLES"));
332 h2a->Fill( idigi, p->
iValue(idigi, 4,
"RAWSAMPLES"));
333 h2b->Fill( idigi, p->
iValue(idigi, 5,
"RAWSAMPLES"));
334 h2c->Fill( idigi, p->
iValue(idigi, 6,
"RAWSAMPLES"));
335 h2d->Fill( idigi, p->
iValue(idigi, 7,
"RAWSAMPLES"));
337 h3a->Fill( idigi, p->
iValue(idigi, 8,
"RAWSAMPLES"));
338 h3b->Fill( idigi, p->
iValue(idigi, 9,
"RAWSAMPLES"));
339 h3c->Fill( idigi, p->
iValue(idigi,10,
"RAWSAMPLES"));
340 h3d->Fill( idigi, p->
iValue(idigi,11,
"RAWSAMPLES"));
342 h4a->Fill( idigi, p->
iValue(idigi, 12,
"RAWSAMPLES"));
343 h4b->Fill( idigi, p->
iValue(idigi, 13,
"RAWSAMPLES"));
344 h4c->Fill( idigi, p->
iValue(idigi, 14,
"RAWSAMPLES"));
345 h4d->Fill( idigi, p->
iValue(idigi, 15,
"RAWSAMPLES"));
347 if (idigi>500 && idigi<3500)
370 for (
int JINX =0; JINX<nhb; JINX++)
374 for (
int i=0;
i<
min(p->
iValue(JINX,
"NSAMPLES"),24);
i++)
395 cout <<
"ERROR " << nhb <<
" Hybrids Found:" << endl;
396 for (
int i=0;
i<nhb;
i++)
398 cout <<
i <<
": " << p->
iValue(
i,
"NSAMPLES") << endl;
412 cout <<
"Saved " << nSaved;
413 cout <<
" percentage "
414 << 100.0*(
double)nSaved/(
double)entries;
429 cout <<
"file is already open " << endl;
448 cout <<
"no file open " << endl;
464 int b2G(
int num) {
return (num >> 1) ^ num; }