Skip to content

Commit 251e7c3

Browse files
committed
Update 1D histograms for AHDC
1 parent a89a29f commit 251e7c3

File tree

1 file changed

+102
-54
lines changed

1 file changed

+102
-54
lines changed

src/main/java/org/clas/detectors/AHDCmonitor.java

Lines changed: 102 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class AHDCmonitor extends DetectorMonitor {
1919

2020
public AHDCmonitor(String name) {
2121
super(name);
22-
this.setDetectorTabNames("charge", "time","Occupancy","1D");
22+
this.setDetectorTabNames("charge", "time", "time1D", "Occupancy","1D");
2323
this.init(false);
2424
}
2525

@@ -88,19 +88,23 @@ public void createHistos() {
8888
// initialize canvas and create histograms
8989
this.setNumberOfEvents(0);
9090

91-
this.getDetectorCanvas().getCanvas("charge").divide(1, 3);
91+
this.getDetectorCanvas().getCanvas("charge").divide(1, 4);
9292
this.getDetectorCanvas().getCanvas("charge").setGridX(false);
9393
this.getDetectorCanvas().getCanvas("charge").setGridY(false);
9494

9595
this.getDetectorCanvas().getCanvas("time").divide(1, 4);
9696
this.getDetectorCanvas().getCanvas("time").setGridX(false);
9797
this.getDetectorCanvas().getCanvas("time").setGridY(false);
9898

99-
this.getDetectorCanvas().getCanvas("Occupancy").divide(2, 3);
99+
this.getDetectorCanvas().getCanvas("time1D").divide(2, 3);
100+
this.getDetectorCanvas().getCanvas("time1D").setGridX(false);
101+
this.getDetectorCanvas().getCanvas("time1D").setGridY(false);
102+
103+
this.getDetectorCanvas().getCanvas("Occupancy").divide(2, 3);
100104
this.getDetectorCanvas().getCanvas("Occupancy").setGridX(false);
101105
this.getDetectorCanvas().getCanvas("Occupancy").setGridY(false);
102106

103-
this.getDetectorCanvas().getCanvas("1D").divide(2, 3);
107+
this.getDetectorCanvas().getCanvas("1D").divide(2, 1);
104108
this.getDetectorCanvas().getCanvas("1D").setGridX(false);
105109
this.getDetectorCanvas().getCanvas("1D").setGridY(false);
106110

@@ -132,7 +136,12 @@ public void createHistos() {
132136
hist2d_integral.setTitleY("layer number");
133137
hist2d_integral.setTitleX("wire number");
134138
hist2d_integral.setTitle("< integral >");
135-
139+
// put here because it is related to the charge
140+
H2F hist2d_timeOverThreshold = new H2F("timeOverThreshold", "timeOverThreshold", 100, 1, 100, 8, 1, 9);
141+
H2F hist2d_raw_timeOverThreshold = new H2F("raw_timeOverThreshold", "raw_timeOverThreshold", 100, 1, 100, 8, 1, 9);
142+
hist2d_timeOverThreshold.setTitleY("layer number");
143+
hist2d_timeOverThreshold.setTitleX("wire number");
144+
hist2d_timeOverThreshold.setTitle("< timeOverThreshold >");
136145
// time
137146
H2F hist2d_timeMax = new H2F("timeMax", "timeMax", 100, 1, 100, 8, 1, 9);
138147
H2F hist2d_raw_timeMax = new H2F("raw_timeMax", "raw_timeMax", 100, 1, 100, 8, 1, 9);
@@ -146,19 +155,43 @@ public void createHistos() {
146155
hist2d_leadingEdgeTime.setTitleX("wire number");
147156
hist2d_leadingEdgeTime.setTitle("< leadingEdgeTime >");
148157

149-
H2F hist2d_timeOverThreshold = new H2F("timeOverThreshold", "timeOverThreshold", 100, 1, 100, 8, 1, 9);
150-
H2F hist2d_raw_timeOverThreshold = new H2F("raw_timeOverThreshold", "raw_timeOverThreshold", 100, 1, 100, 8, 1, 9);
151-
hist2d_timeOverThreshold.setTitleY("layer number");
152-
hist2d_timeOverThreshold.setTitleX("wire number");
153-
hist2d_timeOverThreshold.setTitle("< timeOverThreshold >");
154-
155158
H2F hist2d_constantFractionTime = new H2F("constantFractionTime", "constantFractionTime", 100, 1, 100, 8, 1, 9);
156159
H2F hist2d_raw_constantFractionTime = new H2F("raw_constantFractionTime", "raw_constantFractionTime", 100, 1, 100, 8, 1, 9);
157160
hist2d_constantFractionTime.setTitleY("layer number");
158161
hist2d_constantFractionTime.setTitleX("wire number");
159162
hist2d_constantFractionTime.setTitle("< constantFractionTime >");
160163

161-
// Occupancy
164+
H2F hist2d_wftime = new H2F("wftime2d", "wftime2d", 100, 1, 100, 8, 1, 9);
165+
H2F hist2d_raw_wftime = new H2F("raw_wftime2d", "raw_wftime2d", 100, 1, 100, 8, 1, 9);
166+
hist2d_wftime.setTitleY("layer number");
167+
hist2d_wftime.setTitleX("wire number");
168+
hist2d_wftime.setTitle("< wftime >");
169+
170+
H1F hist1d_leadingEdgeTime = new H1F("leadingEdgeTime1D", "leadingEdgeTime1D", 100, 0, 1500);
171+
hist1d_leadingEdgeTime.setTitleX("leadingEdgeTime (ns)");
172+
hist1d_leadingEdgeTime.setTitleY("count");
173+
174+
H1F hist1d_timeOverThreshold = new H1F("timeOverThreshold1D", "timeOverThreshold1D", 100, 0, 1500);
175+
hist1d_timeOverThreshold.setTitleX("timeOverThreshold (ns)");
176+
hist1d_timeOverThreshold.setTitleY("count");
177+
178+
H1F hist1d_constantFractionTime = new H1F("constantFractionTime1D", "constantFractionTime1D", 100, 0, 1500);
179+
hist1d_constantFractionTime.setTitleX("constantFractionTime (ns)");
180+
hist1d_constantFractionTime.setTitleY("count");
181+
182+
H1F hist1d_wftime = new H1F("wftime1D", "wftime1D", 100, 0, 30);
183+
hist1d_wftime.setTitleX("wftime (bin)");
184+
hist1d_wftime.setTitleY("count");
185+
186+
H1F hist1d_adcMax = new H1F("adcMax1D", "adcMax1D", 100, 0, 4095);
187+
hist1d_adcMax.setTitleX("adcMax");
188+
hist1d_adcMax.setTitleY("count");
189+
190+
H1F hist1d_integral = new H1F("integral1D", "integral1D", 100, 0, 40000);
191+
hist1d_integral.setTitleX("integral");
192+
hist1d_integral.setTitleY("count");
193+
194+
// Occupancy
162195
H1F hits_vs_layer = new H1F("hits_vs_layer", "raw_occupancy", 8, 1, 9);
163196
hits_vs_layer.setTitleY("hits");
164197
hits_vs_layer.setTitleX("layer");
@@ -202,34 +235,22 @@ public void createHistos() {
202235
number_of_layers_hit.setTitleY("number of events");
203236
number_of_layers_hit.setTitleX("N layers firing");
204237

205-
206-
H1F tdc_values = new H1F("tdc_values", "TDC Values of layers hit", 200, 0, 400);
207-
tdc_values.setTitleX("TDC");
208-
209-
H1F time_values = new H1F("time_values", "time Values of layers hit", 200, 0, 400);
210-
time_values.setTitleX("time");
211-
212-
H1F average_waveform = new H1F("average_waveform", "average waveform", 50, 0, 51);
238+
// tab 1D
239+
H1F average_waveform = new H1F("average_waveform", "average waveform", 30, 0, 30);
213240
average_waveform.setTitleX("sample");
214241

215-
H1F average_waveform_raw = new H1F("average_waveform_raw", "average waveform", 50, 0, 51);
242+
H1F average_waveform_raw = new H1F("average_waveform_raw", "average waveform", 30, 0, 30);
216243
average_waveform_raw.setTitleX("sample");
217244

218-
H1F average_waveform_sample_count = new H1F("average_waveform_sample_count", "sample count", 50, 0, 51);
245+
H1F average_waveform_sample_count = new H1F("average_waveform_sample_count", "sample count", 30, 0, 30);
219246
average_waveform_sample_count.setTitleX("sample");
220247

221-
H1F average_waveform_samples = new H1F("average_waveform_samples", "N samples", 50, 0, 51);
248+
H1F average_waveform_samples = new H1F("average_waveform_samples", "N samples", 30, 0, 30);
222249
average_waveform_samples.setTitleX("sample counts");
223250

224-
225-
226251
H1F waveform_timestamp = new H1F("waveform_timestamp", "waveform timestamp", 100, 0, 1000);
227252
waveform_timestamp.setTitleX("wf timestamp");
228253

229-
H1F waveform_time = new H1F("waveform_time", "waveform time", 100, 0, 1000);
230-
waveform_time.setTitleX("wf time");
231-
232-
233254
// add graph to DataGroup
234255
DataGroup dg = new DataGroup(14,1);
235256
dg.addDataSet(hist2d_occupancy, 0);
@@ -256,14 +277,19 @@ public void createHistos() {
256277
dg.addDataSet(missing_layer_hit6, 20);
257278
dg.addDataSet(missing_layer_hit5, 22);
258279
dg.addDataSet(number_of_layers_hit, 23);
259-
dg.addDataSet(tdc_values, 24);
260-
dg.addDataSet(time_values, 25);
261-
dg.addDataSet(waveform_time, 26);
262-
dg.addDataSet(average_waveform, 27);
263-
dg.addDataSet(average_waveform_raw, 28);
264-
dg.addDataSet(average_waveform_sample_count, 29);
265-
dg.addDataSet(average_waveform_samples, 30);
266-
this.getDataGroup().add(dg,0,0,0);
280+
dg.addDataSet(hist2d_wftime, 24);
281+
dg.addDataSet(hist2d_raw_wftime, 25);
282+
dg.addDataSet(hist1d_integral, 26);
283+
dg.addDataSet(hist1d_leadingEdgeTime, 27);
284+
dg.addDataSet(hist1d_timeOverThreshold, 28);
285+
dg.addDataSet(hist1d_constantFractionTime, 29);
286+
dg.addDataSet(hist1d_wftime, 30);
287+
dg.addDataSet(hist1d_adcMax, 31);
288+
dg.addDataSet(average_waveform, 32);
289+
dg.addDataSet(average_waveform_raw, 33);
290+
dg.addDataSet(average_waveform_sample_count, 34);
291+
dg.addDataSet(average_waveform_samples, 35);
292+
this.getDataGroup().add(dg,0,0,0);
267293
}
268294

269295
@Override
@@ -279,6 +305,9 @@ public void plotHistos() {
279305
this.getDetectorCanvas().getCanvas("charge").cd(2);
280306
//this.getDetectorCanvas().getCanvas("charge").getPad(2).getAxisZ().setLog(true);
281307
this.getDetectorCanvas().getCanvas("charge").draw(this.getDataGroup().getItem(0,0,0).getH2F("integral"));
308+
this.getDetectorCanvas().getCanvas("charge").cd(3);
309+
//this.getDetectorCanvas().getCanvas("charge").getPad(2).getAxisZ().setLog(getLogZ());
310+
this.getDetectorCanvas().getCanvas("charge").draw(this.getDataGroup().getItem(0,0,0).getH2F("timeOverThreshold"));
282311
this.getDetectorCanvas().getCanvas("charge").update();
283312

284313
this.getDetectorCanvas().getCanvas("time").cd(0);
@@ -288,13 +317,33 @@ public void plotHistos() {
288317
//this.getDetectorCanvas().getCanvas("time").getPad(1).getAxisZ().setLog(getLogZ());
289318
this.getDetectorCanvas().getCanvas("time").draw(this.getDataGroup().getItem(0,0,0).getH2F("leadingEdgeTime"));
290319
this.getDetectorCanvas().getCanvas("time").cd(2);
291-
//this.getDetectorCanvas().getCanvas("time").getPad(2).getAxisZ().setLog(getLogZ());
292-
this.getDetectorCanvas().getCanvas("time").draw(this.getDataGroup().getItem(0,0,0).getH2F("timeOverThreshold"));
293-
this.getDetectorCanvas().getCanvas("time").cd(3);
294320
///this.getDetectorCanvas().getCanvas("time").getPad(3).getAxisZ().setLog(getLogZ());
295321
this.getDetectorCanvas().getCanvas("time").draw(this.getDataGroup().getItem(0,0,0).getH2F("constantFractionTime"));
322+
this.getDetectorCanvas().getCanvas("time").cd(3);
323+
///this.getDetectorCanvas().getCanvas("time").getPad(3).getAxisZ().setLog(getLogZ());
324+
this.getDetectorCanvas().getCanvas("time").draw(this.getDataGroup().getItem(0,0,0).getH2F("wftime2d"));
296325
this.getDetectorCanvas().getCanvas("time").update();
297326

327+
this.getDetectorCanvas().getCanvas("time1D").cd(0);
328+
///this.getDetectorCanvas().getCanvas("time1D").getPad(3).getAxisZ().setLog(getLogZ());
329+
this.getDetectorCanvas().getCanvas("time1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("adcMax1D"));
330+
this.getDetectorCanvas().getCanvas("time1D").cd(2);
331+
//this.getDetectorCanvas().getCanvas("time1D").getPad(0).getAxisZ().setLog(getLogZ());
332+
this.getDetectorCanvas().getCanvas("time1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("integral1D"));
333+
this.getDetectorCanvas().getCanvas("time1D").cd(4);
334+
///this.getDetectorCanvas().getCanvas("time1D").getPad(3).getAxisZ().setLog(getLogZ());
335+
this.getDetectorCanvas().getCanvas("time1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("timeOverThreshold1D"));
336+
this.getDetectorCanvas().getCanvas("time1D").cd(1);
337+
//this.getDetectorCanvas().getCanvas("time1D").getPad(1).getAxisZ().setLog(getLogZ());
338+
this.getDetectorCanvas().getCanvas("time1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("leadingEdgeTime1D"));
339+
this.getDetectorCanvas().getCanvas("time1D").cd(3);
340+
///this.getDetectorCanvas().getCanvas("time1D").getPad(3).getAxisZ().setLog(getLogZ());
341+
this.getDetectorCanvas().getCanvas("time1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("constantFractionTime1D"));
342+
this.getDetectorCanvas().getCanvas("time1D").cd(5);
343+
///this.getDetectorCanvas().getCanvas("time1D").getPad(3).getAxisZ().setLog(getLogZ());
344+
this.getDetectorCanvas().getCanvas("time1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("wftime1D"));
345+
this.getDetectorCanvas().getCanvas("time1D").update();
346+
298347
this.getDetectorCanvas().getCanvas("Occupancy").cd(0);
299348
this.getDetectorCanvas().getCanvas("Occupancy").draw(this.getDataGroup().getItem(0,0,0).getH1F("occupancy_vs_layer"));
300349
this.getDetectorCanvas().getCanvas("Occupancy").cd(1);
@@ -312,14 +361,8 @@ public void plotHistos() {
312361

313362

314363
this.getDetectorCanvas().getCanvas("1D").cd(0);
315-
this.getDetectorCanvas().getCanvas("1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("tdc_values"));
316-
this.getDetectorCanvas().getCanvas("1D").cd(1);
317-
this.getDetectorCanvas().getCanvas("1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("time_values"));
318-
this.getDetectorCanvas().getCanvas("1D").cd(2);
319364
this.getDetectorCanvas().getCanvas("1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("average_waveform_samples"));
320-
this.getDetectorCanvas().getCanvas("1D").cd(3);
321-
this.getDetectorCanvas().getCanvas("1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("waveform_time"));
322-
this.getDetectorCanvas().getCanvas("1D").cd(4);
365+
this.getDetectorCanvas().getCanvas("1D").cd(1);
323366
this.getDetectorCanvas().getCanvas("1D").draw(this.getDataGroup().getItem(0,0,0).getH1F("average_waveform"));
324367

325368
this.getDetectorView().getView().repaint();
@@ -346,20 +389,21 @@ public void processEvent(DataEvent event) {
346389
long timestamp = wfbank.getLong("timestamp", loop);
347390
int time = wfbank.getInt("time", loop);
348391

349-
if( AHDCmonitor.getLayerNumber(layer) > 7 ) continue;
392+
this.getDataGroup().getItem(0,0,0).getH2F("raw_wftime2d").fill(comp, AHDCmonitor.getLayerNumber(layer), time);
393+
this.getDataGroup().getItem(0,0,0).getH1F("wftime1D").fill(time);
394+
395+
if( AHDCmonitor.getLayerNumber(layer) > 8 ) continue;
350396
//System.out.println("wf timestamp: " + timestamp);
351397

352398
//H1F waveform_timestamp = this.getDataGroup().getItem(0,0,0).getH1F("waveform_timestamp");
353399
//waveform_timestamp.fill(timestamp);
354400

355-
H1F waveform_time = this.getDataGroup().getItem(0,0,0).getH1F("waveform_time");
356-
waveform_time.fill(time);
357401

358402
H1F average_waveform_raw = this.getDataGroup().getItem(0,0,0).getH1F("average_waveform_raw");
359403
H1F average_waveform_sample_count = this.getDataGroup().getItem(0,0,0).getH1F("average_waveform_sample_count");
360404
H1F average_waveform_samples = this.getDataGroup().getItem(0,0,0).getH1F("average_waveform_samples");
361405
int n_samples = 0;
362-
for(int i= 0; i<49 ; i++) {
406+
for(int i= 0; i<29 ; i++) {
363407
int sample_value = wfbank.getShort("s"+(i+1), loop);
364408
average_waveform_raw.fill(i,sample_value);
365409
if(sample_value >0) {
@@ -369,7 +413,6 @@ public void processEvent(DataEvent event) {
369413
}
370414
}
371415
average_waveform_samples.fill(n_samples);
372-
waveform_time.fill(time);
373416
} //waveform loop
374417

375418
//System.out.println("Derp\n");
@@ -444,8 +487,6 @@ public void processEvent(DataEvent event) {
444487
//System.out.println("ROW " + loop + " SECTOR = " + sector + " LAYER = " + layer + " COMPONENT = " + comp + " ORDER + " + order +
445488
// " ADC = " + adc + " TIME = " + time + "leadingEdgeTime = " + leadingEdgeTime);
446489
if(adc>=0 && time>0) {
447-
this.getDataGroup().getItem(0,0,0).getH1F("tdc_values").fill(leadingEdgeTime);
448-
this.getDataGroup().getItem(0,0,0).getH1F("time_values").fill(time);
449490

450491
int layer_number = AHDCmonitor.getLayerNumber(layer);
451492

@@ -458,6 +499,11 @@ public void processEvent(DataEvent event) {
458499
this.getDataGroup().getItem(0,0,0).getH2F("raw_leadingEdgeTime").fill(comp, layer_number, leadingEdgeTime);
459500
this.getDataGroup().getItem(0,0,0).getH2F("raw_timeOverThreshold").fill(comp, layer_number, timeOverThreshold);
460501
this.getDataGroup().getItem(0,0,0).getH2F("raw_constantFractionTime").fill(comp, layer_number, constantFractionTime);
502+
this.getDataGroup().getItem(0,0,0).getH1F("leadingEdgeTime1D").fill(leadingEdgeTime);
503+
this.getDataGroup().getItem(0,0,0).getH1F("timeOverThreshold1D").fill(timeOverThreshold);
504+
this.getDataGroup().getItem(0,0,0).getH1F("constantFractionTime1D").fill(constantFractionTime);
505+
this.getDataGroup().getItem(0,0,0).getH1F("adcMax1D").fill(adc);
506+
this.getDataGroup().getItem(0,0,0).getH1F("integral1D").fill(integral);
461507

462508
this.getDataGroup().getItem(0,0,0).getH1F("hits_vs_layer").fill(layer_number);
463509
//this.getDataGroup().getItem(0,0,0).getH1F("occupancy_vs_layer").fill(layer_number);
@@ -519,6 +565,7 @@ public void analysisUpdate() {
519565
float raw_leadingEdgeTime = this.getDataGroup().getItem(0,0,0).getH2F("raw_leadingEdgeTime").getDataBufferBin(ibin);
520566
float raw_timeOverThreshold = this.getDataGroup().getItem(0,0,0).getH2F("raw_timeOverThreshold").getDataBufferBin(ibin);
521567
float raw_constantFractionTime = this.getDataGroup().getItem(0,0,0).getH2F("raw_constantFractionTime").getDataBufferBin(ibin);
568+
float raw_wftime2d = this.getDataGroup().getItem(0,0,0).getH2F("raw_wftime2d").getDataBufferBin(ibin);
522569
// renormalise them
523570
this.getDataGroup().getItem(0,0,0).getH2F("occupancy").setDataBufferBin(ibin, 100.0*raw_occupancy/nevents);
524571
this.getDataGroup().getItem(0,0,0).getH2F("adcMax").setDataBufferBin(ibin, raw_adcMax/raw_occupancy);
@@ -527,6 +574,7 @@ public void analysisUpdate() {
527574
this.getDataGroup().getItem(0,0,0).getH2F("leadingEdgeTime").setDataBufferBin(ibin, raw_leadingEdgeTime/raw_occupancy);
528575
this.getDataGroup().getItem(0,0,0).getH2F("timeOverThreshold").setDataBufferBin(ibin, raw_timeOverThreshold/raw_occupancy);
529576
this.getDataGroup().getItem(0,0,0).getH2F("constantFractionTime").setDataBufferBin(ibin, raw_constantFractionTime/raw_occupancy);
577+
this.getDataGroup().getItem(0,0,0).getH2F("wftime2d").setDataBufferBin(ibin, raw_wftime2d/raw_occupancy);
530578
}
531579
}
532580
}

0 commit comments

Comments
 (0)