-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevel3Histogrammer.java
615 lines (504 loc) · 19.2 KB
/
Level3Histogrammer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
import j4np.data.base.DataFrame;
import j4np.hipo5.data.Bank;
import j4np.hipo5.data.CompositeNode;
import j4np.hipo5.data.Event;
import j4np.hipo5.data.Node;
import j4np.hipo5.io.HipoReader;
import j4np.hipo5.io.HipoWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.List;
import java.io.File;
import java.io.IOException;
import java.lang.Math;
import twig.data.GraphErrors;
import twig.data.H1F;
import twig.data.H2F;
import twig.data.StatNumber;
import twig.graphics.TGCanvas;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.io.IOException;
import java.io.PrintWriter;
import j4ml.data.*;
import j4ml.deepnetts.*;
import j4ml.ejml.EJMLModel;
import j4ml.ejml.EJMLModel.ModelType;
/**
*
* @author tyson
*/
public class Level3Histogrammer {
EJMLModel cf;
DataList LtoSconv;
EJMLModel pider;
List<float[]> negTracks = new ArrayList<>();
List<float[]> posTracks = new ArrayList<>();
List<float[]> all_permutations = new ArrayList<>();
public Level3Histogrammer() {
}
public void load_cf(String path) {
cf = new EJMLModel(path, ModelType.TANH_LINEAR);
}
public void load_LtoStripConv(String path) {
LtoSconv = DataList.fromCSV("LtoStrip_convTable.csv",
DataList.range(0, 69), DataList.range(0, 1));
}
public void load_pider(String path) {
pider = new EJMLModel(path, ModelType.SOFTMAX);
}
public Boolean arrayContains(float[] arr, int c) {
for (double value : arr) {
if (value == c) {
return true;
}
}
return false;
}
int[] convLtoStrip(float[] Ls) {
int[] strips = new int[] { -2, -2, -2, -2, -2, -2, -2, -2, -2 };
int[] nStrips = new int[] { 68, 63, 63, 37, 37, 37, 37, 37, 37 };
for (int i = 0; i < 9; i++) {
Ls[i] = Ls[i] * 500;
float[] conv_det_view = LtoSconv.getList().get(i).floatFirst();
for (int str = 0; str < (nStrips[i]); str++) {
// in PCAL V, W take distance from other end
// System.out.printf("wtf %d %d \n",i,str);
if (i == 1 || i == 2) {
if (Ls[i] < conv_det_view[str] && Ls[i] >= conv_det_view[str + 1]) {
strips[i] = str + 1; // add 1 as the upper limit applies to strip+1 due to inverted order
}
} else {
if (Ls[i] >= conv_det_view[str] && Ls[i] < conv_det_view[str + 1]) {
strips[i] = str;
}
}
}
}
return strips;
}
public Boolean arrayNotEmpty(float[] arr) {
for (double value : arr) {
if (value != 0) {
return true;
}
}
return false;
}
public List<Level3Candidate> getCandidatesInSector(List<Level3Candidate> cs, int Sector){
List<Level3Candidate> scs = new ArrayList<Level3Candidate>();
for(Level3Candidate c : cs){
if(c.Sector==Sector){
scs.add(c);
}
}
return scs;
}
public List<Level3Particle> getParticlesInSector(List<Level3Particle> cs, int Sector){
List<Level3Particle> scs = new ArrayList<Level3Particle>();
for(Level3Particle c : cs){
if(c.Sector==Sector){
scs.add(c);
}
}
return scs;
}
public double particlesGetQ2(List<Level3Particle> ps,double beamE){
int bestInd=-1,bestElInd=-1,i=0;
double bestP=0,bestElP=0;
for(Level3Particle p : ps){
if(p.P>bestP){
bestP=p.P;
bestInd=i;
}
if(p.Charge == -1 && p.PID==11 && arrayNotEmpty(p.HTCC_adcs) && p.Vz < 12 && p.Vz > -13) {
if(p.P>bestElP){
bestElP=p.P;
bestElInd=i;
}
}
i++;
}
if(bestElInd!=-1){
bestInd=bestElInd;
}
double Q2=0;
if(bestInd!=-1){
Level3Particle p=ps.get(bestInd);
double E=Math.sqrt(p.P*p.P+p.getM(11)*p.getM(11));
Q2 = 2 * beamE * E* (1. - p.Pz/p.P);
}
return Q2;
}
public double candidatesGetQ2(List<Level3Candidate> ps,double beamE,double respTh){
int bestInd=-1,bestElInd=-1,i=0;
double bestP=0,bestElP=0;
for(Level3Candidate p : ps){
if(p.Pred_P>bestP){
bestP=p.Pred_P;
bestInd=i;
}
if(p.Pred_Charge == -1 && p.pid_resp > respTh && arrayNotEmpty(p.HTCC_adcs) && p.Vz < 12 && p.Vz > -13) {
if(p.Pred_P>bestElP){
bestElP=p.Pred_P;
bestElInd=i;
}
}
i++;
}
if(bestElInd!=-1){
bestInd=bestElInd;
}
double Q2=0;
if(bestInd!=-1){
Level3Candidate p=ps.get(bestInd);
double E=Math.sqrt(p.Pred_P*p.Pred_P+p.getM(11)*p.getM(11));
Q2 = 2 * beamE * E* (1. - p.Pred_Pz/p.Pred_P);
}
return Q2;
}
// 0 1 2 3 4
// 5 6 7 8 9
// 10 11
// Bank[] banks = r.getBanks("DC::tdc", "ECAL::adc", "RUN::config", "FTOF::adc",
// "HTCC::adc",
// "REC::Particle", "REC::Calorimeter",
// "REC::Cherenkov","REC::Track","HitBasedTrkg::HBClusters",
// "HitBasedTrkg::HBTracks","ECAL::clusters");
public List<Level3Candidate> getCandidates(Bank[] banks, CompositeNode tr, CompositeNode pt, Boolean isOut) {
// Instant start_time = Instant.now();
List<Level3Candidate> ps = new ArrayList<Level3Candidate>();
for (int i = 0; i < tr.getRows(); i++) {
// find and initialise Candidates
Level3Candidate part = new Level3Candidate();
// part.setShow(true);
part.find_AI_tracks(tr, pt, i,isOut);
part.find_ClosestRECParticle_fromPredP(banks[5], 999, 999, 999);
part.read_Cal_Bank(banks[6]);
part.find_HTCC_ADCs(banks[4]);
part.set_pid_label();
float[] cf_pred = new float[11];
cf.getOutput(part.track_clusters, cf_pred);
int[] cf_strips = convLtoStrip(cf_pred);
part.read_cal_bank_from_cf_pred(cf_pred, cf_strips, banks[1]);
float[] pid_pred = new float[2];
pider.getOutput(part.get_vars_forpid(), pid_pred); //_noTrack
part.setPidResp(pid_pred[0]);
// part.print();
// part.printbanks(tr,pt,banks[5],banks[6],banks[4]);
ps.add(part);
}
// Instant finish_time = Instant.now();
// timeElapsed += Duration.between(start_time, finish_time).toMillis();
return ps;
}
// 0 1 2 3 4
// 5 6 7 8 9
// 10 11
// Bank[] banks = r.getBanks("DC::tdc", "ECAL::adc", "RUN::config", "FTOF::adc","HTCC::adc",
// "REC::Particle", "REC::Calorimeter", "REC::Cherenkov","REC::Track","HitBasedTrkg::HBClusters",
// "HitBasedTrkg::HBTracks","ECAL::clusters");
public List<Level3Particle> getRECParts(Bank[] banks){
List<Level3Particle> ps = new ArrayList<Level3Particle>();
for (int i = 0; i < banks[5].getRows(); i++) {
Level3Particle part = new Level3Particle();
part.read_Particle_Bank(i, banks[5]);
if(part.PIndex!=-1){ //ie part in FD
part.read_Cal_Bank(banks[6]);
part.read_HTCC_bank(banks[7]);
part.find_sector_cal(banks[6]);
part.find_sector_track(banks[8]);
part.find_track_clusterIDs(banks[10]);
part.find_track_clusters(banks[9]);
part.find_HTCC_ADCs(banks[4]);
part.set_pid_label();
float[] cf_pred= new float[11];
cf.getOutput(part.track_clusters, cf_pred);
int[] cf_strips=convLtoStrip(cf_pred);
part.read_cal_bank_from_cf_pred(cf_pred,cf_strips,banks[1]);
float[] pid_pred =new float[2];
pider.getOutput(part.get_vars_forpid(), pid_pred);
part.setPidResp(pid_pred[0]);
ps.add(part);
}
}
return ps;
}
public static int[] convertL1Trigger(long bits) {
int[] trigger = new int[32];
// System.out.printf("%X - %X\n", bits,bits&0xF);
for (int i = 0; i < trigger.length; i++) {
trigger[i] = 0;
if (((bits >> i) & (1L)) != 0L)
trigger[i] = 1;
// System.out.println(Arrays.toString(trigger));
}
return trigger;
}
public DataList getPred(String file, int nPart, double respTh, Boolean isOut) {
int nFound = 0, nL1=0, nNoL1=0;
DataList pred = new DataList();
double beamE=10.532;
double Q2Cut=1.2;
int L1TrigStart=0;
if(isOut){L1TrigStart=7;}
// String file=dir;
HipoReader r = new HipoReader(file);
Event e = new Event();
// r.getSchemaFactory().show();
Bank[] banks = r.getBanks("DC::tdc", "ECAL::adc", "RUN::config", "FTOF::adc", "HTCC::adc",
"REC::Particle", "REC::Calorimeter", "REC::Cherenkov", "REC::Track", "HitBasedTrkg::HBClusters",
"HitBasedTrkg::HBTracks", "ECAL::clusters");
Bank[] AIbanks = r.getBanks("DC::tdc", "ECAL::adc", "RUN::config", "FTOF::adc", "HTCC::adc",
"RECAI::Particle", "RECAI::Calorimeter", "RECAI::Cherenkov", "RECAI::Track", "HitBasedTrkg::HBClusters",
"HitBasedTrkg::HBTracks", "ECAL::clusters");
CompositeNode tr = new CompositeNode(3210, 2, "i", 1200);
CompositeNode pt = new CompositeNode(3210, 3, "i", 1200);
while (r.hasNext() && nFound < nPart) {
r.nextEvent(e);
e.read(banks);
e.read(AIbanks);
e.read(tr, 32100, 2);
e.read(pt, 32100, 3);
List<Level3Candidate> Candidates = getCandidates(AIbanks, tr, pt, isOut);
List<Level3Particle> RECparticles = getRECParts(banks);
List<Level3Particle> AIRECparticles = getRECParts(AIbanks);
for (int sect = 1; sect < 7; sect++) {
List<Level3Candidate> SectorCandidates = getCandidatesInSector(Candidates,sect);
List<Level3Particle> SectorRECparticles = getParticlesInSector(RECparticles,sect);
List<Level3Particle> SectorAIRECparticles = getParticlesInSector(AIRECparticles,sect);
double rTOd= (180.0 / Math.PI);
long bits = banks[2].getLong("trigger", 0);
int[] L1trigger = convertL1Trigger(bits);
if(L1trigger[L1TrigStart + sect]==1){
nL1++;
} else {
nNoL1++;
}
double InstaQ2=candidatesGetQ2(SectorCandidates, beamE, respTh);
double RECQ2 = particlesGetQ2(SectorRECparticles, beamE);
double RECAIQ2 = particlesGetQ2(SectorAIRECparticles, beamE);
//want to pass Q2 cut event when no Q2 cut in L1 trigger
if(!isOut){
InstaQ2=99999;
RECAIQ2=99999;
RECQ2=99999;
}
for (Level3Candidate p : SectorCandidates) {
int isEl=0;
if(p.Pred_Charge == -1 && p.pid_resp > respTh && arrayNotEmpty(p.HTCC_adcs) && p.Vz < 12 && p.Vz > -13) {
isEl=1;
}
double P=p.Pred_P;
double Theta=p.Pred_Theta*rTOd;
double Phi=p.Pred_Phi*rTOd;
double PCALADC=p.PCAL_energy_fcf;
double TotADC=p.PCAL_energy_fcf+p.ECIN_energy_fcf+p.ECOUT_energy_fcf;
double HTCCADC=0;
for (double adc:p.HTCC_adcs){
HTCCADC+=adc;
}
if(InstaQ2>Q2Cut){
DataEntry de = new DataEntry(
new double[] {P,Theta,Phi,PCALADC,TotADC,HTCCADC,p.pid_resp,p.PID}, // L1trigger[0+sect]
new double[] {0,isEl,L1trigger[L1TrigStart + sect]});
pred.add(de);
}
}
for (Level3Particle p : SectorRECparticles) {
int isEl=0;
if(p.Charge == -1 && p.PID==11 && arrayNotEmpty(p.HTCC_adcs) && p.Vz < 12 && p.Vz > -13) {
isEl=1;
}
double P=p.P;
double Theta=p.Theta*rTOd;
double Phi=p.Phi*rTOd;
double PCALADC=p.PCAL_energy_fcf;
double TotADC=p.PCAL_energy_fcf+p.ECIN_energy_fcf+p.ECOUT_energy_fcf;
double HTCCADC=0;
for (double adc:p.HTCC_adcs){
HTCCADC+=adc;
}
if(RECQ2>Q2Cut){
DataEntry de = new DataEntry(
new double[] {P,Theta,Phi,PCALADC,TotADC,HTCCADC,p.pid_resp,p.PID}, // L1trigger[0+sect]
new double[] {1,isEl,L1trigger[L1TrigStart + sect]});
pred.add(de);
nFound++;
}
}
for (Level3Particle p : SectorAIRECparticles) {
int isEl=0;
if(p.Charge == -1 && p.PID==11 && arrayNotEmpty(p.HTCC_adcs) && p.Vz < 12 && p.Vz > -13) {
isEl=1;
}
double P=p.P;
double Theta=p.Theta*rTOd;
double Phi=p.Phi*rTOd;
double PCALADC=p.PCAL_energy_fcf;
double TotADC=p.PCAL_energy_fcf+p.ECIN_energy_fcf+p.ECOUT_energy_fcf;
double HTCCADC=0;
for (double adc:p.HTCC_adcs){
HTCCADC+=adc;
}
if(RECAIQ2>Q2Cut){
DataEntry de = new DataEntry(
new double[] {P,Theta,Phi,PCALADC,TotADC,HTCCADC,p.pid_resp,p.PID}, // L1trigger[0+sect]
new double[] {2,isEl,L1trigger[L1TrigStart + sect]});
pred.add(de);
}
}
}
}
System.out.printf("\n Nb L1 %d, Nb No L1 %d \n",nL1,nNoL1);
return pred;
}
//whichtoplot: 0 - all, 1 - only InstaRec, 2 - only REC
//withWithoutTrig: 0 - when events don't pass L1 Trigger, 1 - when events pass L1 Trigger, 2 - both
public void PlotVar(DataList pred, int varIndex, int whichtoplot, int withWithoutTrig, String varName, String varUnits,
double low, double high, int nBins) {
int NEvents = pred.getList().size();
int nEls=0,nNotEls=0,nRECEls=0,nRECNotEls=0,nRECAIEls=0,nRECAINotEls=0;
H1F hPosInsta = new H1F("IRec e-", nBins, low, high);
hPosInsta.attr().setLineColor(2);
//hPosInsta.attr().setFillColor(2);
hPosInsta.attr().setLineWidth(3);
hPosInsta.attr().setTitleX(varName + " " + varUnits);
H1F hNegInsta = new H1F("IRec !e-", nBins, low, high);
hNegInsta.attr().setLineColor(5);
hNegInsta.attr().setLineWidth(3);
hNegInsta.attr().setTitleX(varName + " " + varUnits);
H1F hPosREC = new H1F("REC e-", nBins, low, high);
hPosREC.attr().setLineColor(6);
//hPosREC.attr().setFillColor(6);
hPosREC.attr().setLineWidth(3);
hPosREC.attr().setTitleX(varName + " " + varUnits);
H1F hNegREC = new H1F("REC !e-", nBins, low, high);
hNegREC.attr().setLineColor(3);
hNegREC.attr().setLineWidth(3);
hNegREC.attr().setTitleX(varName + " " + varUnits);
H1F hPosRECAI = new H1F("RECAI e-", nBins, low, high);
hPosRECAI.attr().setLineColor(4);
//hPosRECAI.attr().setFillColor(4);
hPosRECAI.attr().setLineWidth(3);
hPosRECAI.attr().setTitleX(varName + " " + varUnits);
H1F hNegRECAI = new H1F("RECAI !e-", nBins, low, high);
hNegRECAI.attr().setLineColor(8);
hNegRECAI.attr().setLineWidth(3);
hNegRECAI.attr().setTitleX(varName + " " + varUnits);
//DataEntry de = new DataEntry(
//new double[] {P,Theta,Phi,PCALADC,TotADC,HTCCADC,p.pid_resp,p.PID}, // L1trigger[0+sect]
//new double[] {isInstaOrRECorRECAI,isEl,L1trigger[0 + sect]});
// Sort predictions into those made on the positive/or negative samples
for (int i = 0; i < NEvents; i += 1) {
float[] vars = pred.getList().get(i).floatFirst();
float[] label = pred.getList().get(i).floatSecond();
if(withWithoutTrig==2){
if(label[0]==0){
if(label[1]==0){
hNegInsta.fill(vars[varIndex]);
} else{
hPosInsta.fill(vars[varIndex]);
}
} else if(label[0]==1){
if(label[1]==0){
hNegREC.fill(vars[varIndex]);
} else{
hPosREC.fill(vars[varIndex]);
}
} else if(label[0]==2){
if(label[1]==0){
hNegRECAI.fill(vars[varIndex]);
} else{
hPosRECAI.fill(vars[varIndex]);
}
}
} else if(withWithoutTrig==label[2]){// 0 or 1
if(label[0]==0){
if(label[1]==0){
hNegInsta.fill(vars[varIndex]);
nNotEls++;
} else{
hPosInsta.fill(vars[varIndex]);
nEls++;
}
} else if(label[0]==1){
if(label[1]==0){
hNegREC.fill(vars[varIndex]);
nRECNotEls++;
} else{
hPosREC.fill(vars[varIndex]);
nRECEls++;
}
} else if(label[0]==2){
if(label[1]==0){
hNegRECAI.fill(vars[varIndex]);
nRECAINotEls++;
} else{
hPosRECAI.fill(vars[varIndex]);
nRECAIEls++;
}
}
}
}
String trigName="With & Without L1 Trigger";
if(withWithoutTrig==0){
trigName="Without L1 Trigger";
} else if(withWithoutTrig==1){
trigName="With L1 Trigger";
}
TGCanvas c = new TGCanvas();
c.setTitle(varName+" "+trigName);
if(whichtoplot==0){
c.draw(hPosInsta).draw(hNegInsta, "same").draw(hPosREC,"same").draw(hNegREC, "same").draw(hPosRECAI,"same").draw(hNegRECAI, "same");
} else if(whichtoplot==1){
c.draw(hPosInsta).draw(hNegInsta, "same");
} if(whichtoplot==2){
c.draw(hPosREC).draw(hNegREC, "same").draw(hPosRECAI,"same").draw(hNegRECAI, "same");
}
c.region().showLegend(0.7, 0.95);
System.out.printf("\n "+trigName+" nb IREC e- %d, nb IREC !e- %d, nb REC e- %d, nb REC !e- %d, nb RECAI e- %d, nb RECAI !e- %d\n",nEls,nNotEls,nRECEls,nRECNotEls,nRECAIEls,nRECAINotEls);
}// End of PlotResponse
public static void main(String[] args) {
// to run, in order
// /open Level3Particle.java
// /open Level3Candidate.java
// /open Level3Histogrammer.java
// Level3Histogrammer.main(new String[]{});
String file = "/Users/tyson/data_repo/trigger_data/rgd/018326/run_18326_1_wAIBanks.h5";
Boolean outbend=false;
//String file = "/Users/tyson/data_repo/trigger_data/rgd/018777/run_18777_3_wAIBanks.h5";
//Boolean outbend=true;
String field="";
if(outbend){field="_outbending";}
Level3Histogrammer tester = new Level3Histogrammer();
tester.load_cf("cf_el_wFTOF"+field+".network");
tester.load_LtoStripConv("LtoStrip_convTable.csv");
tester.load_pider("old_networks/pid_elNegBG_fromcfpred"+field+".network");// _fromcfpred
DataList pred = tester.getPred(file,1000000 ,0.06,outbend);
//whichtoplot: 0 - all, 1 - only InstaRec, 2 - only REC
//withWithoutTrig: 0 - when events don't pass L1 Trigger, 1 - when events pass L1 Trigger, 2 - both
//PlotVar(DataList pred, int varIndex, int whichtoplot, int withWithoutTrig, String varName, String varUnits, double low, double high, int nBins)
//pred:
//new double[] {P,Theta,Phi,PCALADC,TotADC,HTCCADC,p.pid_resp,p.PID}, // L1trigger[0+sect]
//new double[] {isInstaOrRECorRECAI,isEl,L1trigger[0 + sect]});
tester.PlotVar(pred, 0, 0, 1, "P", "[GeV]", 0, 10, 100);
tester.PlotVar(pred, 0, 0, 0, "P", "[GeV]", 0, 10, 100);
//tester.PlotVar(pred, 1, 0, 1, "Theta", "[Deg]", 0, 50, 100);
tester.PlotVar(pred, 3, 0, 2, "PCAL ADC", "", 0, 150000, 500);
tester.PlotVar(pred, 4, 0, 2, "Total ECAL ADC", "", 0, 200000, 500);
tester.PlotVar(pred, 5, 0, 2, "Total HTCC ADC", "", 0, 35000, 500);
tester.PlotVar(pred, 3, 0, 2, "PCAL ADC (low)", "", 0, 400, 400);
tester.PlotVar(pred, 4, 0, 2, "Total ECAL ADC (low)", "", 0, 200, 200);
tester.PlotVar(pred, 5, 0, 2, "Total HTCC ADC (low)", "", 0, 150, 150);
tester.PlotVar(pred, 5, 0, 2, "Total HTCC ADC (med)", "", 0, 500, 50);
//tester.PlotVar(pred, 1, 0, 1, "Phi", "[Deg]", -180, 180, 100);
//tester.PlotVar(pred, 1, 0, 0, "PCAL ADC", "", 0, 200, 200);
//tester.PlotVar(pred, 1, 0, 0, "Total ECAL ADC", "", 0, 200, 200);
}
}