forked from ANNIEsoft/ToolAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLAPPDLoadStore.cpp
More file actions
1760 lines (1584 loc) · 75.4 KB
/
LAPPDLoadStore.cpp
File metadata and controls
1760 lines (1584 loc) · 75.4 KB
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
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "LAPPDLoadStore.h"
LAPPDLoadStore::LAPPDLoadStore() : Tool() {}
bool LAPPDLoadStore::Initialise(std::string configfile, DataModel &data)
{
/////////////////// Useful header ///////////////////////
if (configfile != "")
m_variables.Initialise(configfile); // loading config file
// m_variables.Print();
m_data = &data; // assigning transient data pointer
/////////////////////////////////////////////////////////////////
// Control variables
// Control variables used in this tool
retval = 0;
eventNo = 0;
CLOCK_to_NSEC = 3.125; // 3.125 ns per clock cycle
errorEventsNumber = 0;
// Control variables that you get from the config file, for this tool
m_variables.Get("ReadStore", ReadStore);
m_variables.Get("Nboards", Nboards);
m_variables.Get("StorePedinputfile", PedFileName);
m_variables.Get("PedinputfileTXT", PedFileNameTXT);
m_variables.Get("DoPedSubtraction", DoPedSubtract);
m_variables.Get("LAPPDStoreReadInVerbosity", LAPPDStoreReadInVerbosity);
m_variables.Get("num_vector_data", num_vector_data);
m_variables.Get("num_vector_pps", num_vector_pps);
m_variables.Get("SelectSingleLAPPD", SelectSingleLAPPD);
m_variables.Get("SelectedLAPPD", SelectedLAPPD);
mergingModeReadIn = false;
m_variables.Get("mergingModeReadIn", mergingModeReadIn);
ReadStorePdeFile = false;
m_variables.Get("ReadStorePdeFile", ReadStorePdeFile);
MultiLAPPDMap = false;
m_variables.Get("MultiLAPPDMap", MultiLAPPDMap);
loadPSEC = true;
m_variables.Get("loadPSEC", loadPSEC);
loadPPS = false;
m_variables.Get("loadPPS", loadPPS);
loadOffsets = false;
m_variables.Get("loadOffsets", loadOffsets);
LoadBuiltPPSInfo = true;
m_variables.Get("LoadBuiltPPSInfo", LoadBuiltPPSInfo);
loadFromStoreDirectly = false;
m_variables.Get("loadFromStoreDirectly", loadFromStoreDirectly);
// Control variables in this tool, initialized in this tool
NonEmptyEvents = 0;
NonEmptyDataEvents = 0;
PPSnumber = 0;
mergedEvent = false;
isFiltered = false;
isBLsub = false;
isCFD = false;
// Global Control variables that you get from the config file
m_variables.Get("stopEntries", stopEntries);
m_variables.Get("PsecReceiveMode", PsecReceiveMode);
m_variables.Get("RawDataOutputWavLabel", OutputWavLabel);
m_variables.Get("RawDataInputWavLabel", InputWavLabel);
m_variables.Get("NChannels", NChannels);
m_variables.Get("Nsamples", Nsamples);
m_variables.Get("TrigChannel", TrigChannel);
m_variables.Get("SampleSize", SampleSize);
m_variables.Get("LAPPDchannelOffset", LAPPDchannelOffset);
// Data variables
// Data variables you get from other tools (it not initialized in execute)
// Data variables you use in this tool
m_variables.Get("PSECinputfile", NewFileName);
// Verbosity
// Details on channels, samples and max vector sizes and trigger channel
m_variables.Get("Nsamples", Nsamples);
m_variables.Get("TrigChannel", TrigChannel);
runNumber = 0;
subRunNumber = 0;
partFileNumber = 0;
eventNumberInPF = 0;
ReadStore = 0;
// get data file
/*
if (ReadStore == 1)
{
// get data from a StoreFile in ANNIEEvent format
m_data->Stores["ANNIEEvent"] = new BoostStore(false, 2);
m_data->Stores["ANNIEEvent"]->Initialise(NewFileName);
cout << "LAPPDStoreReadIn Reading new ANNIEevent from " << NewFileName << endl;
}
else if (ReadStore == 0)
{ // get data from previous chain, or m_data
cout << "LAPPDStoreReadIn Using ANNIEevent or CStore" << endl;
}*/
// Grab all pedestal files and prepare the map channel|pedestal-vector for substraction
if (DoPedSubtract == 1)
{
PedestalValues = new std::map<unsigned long, vector<int>>;
/*if (ReadStorePdeFile)
{
m_data->Stores["PedestalFile"] = new BoostStore(false, 2);
bool ret = false;
if (FILE *file = fopen(PedFileName.c_str(), "r"))
{
fclose(file);
ret = true;
cout << "Using Store Pedestal File" << endl;
}
if (ret)
{
m_data->Stores["PedestalFile"]->Initialise(PedFileName);
long Pedentries;
m_data->Stores["PedestalFile"]->Header->Get("TotalEntries", Pedentries);
if (LAPPDStoreReadInVerbosity > 0)
cout << PedFileName << " got " << Pedentries << endl;
m_data->Stores["PedestalFile"]->Get("PedestalMap", PedestalValues);
}
}
else*/
{
for (int i = 0; i < Nboards; i++)
{
if (LAPPDStoreReadInVerbosity > 0)
cout << "Reading Pedestal File " << PedFileNameTXT << " " << i << endl;
ReadPedestals(i);
}
}
if (LAPPDStoreReadInVerbosity > 0)
cout << "PEDSIZES: " << PedestalValues->size() << " " << PedestalValues->at(0).size() << " " << PedestalValues->at(4).at(5) << endl;
}
// set some control variables for later tools
m_data->CStore.Set("SelectSingleLAPPD", SelectSingleLAPPD);
m_data->Stores["ANNIEEvent"]->Set("Nsamples", Nsamples);
m_data->Stores["ANNIEEvent"]->Set("NChannels", NChannels);
m_data->Stores["ANNIEEvent"]->Set("TrigChannel", TrigChannel);
m_data->Stores["ANNIEEvent"]->Set("LAPPDchannelOffset", LAPPDchannelOffset);
m_data->Stores["ANNIEEvent"]->Set("SampleSize", SampleSize);
m_data->Stores["ANNIEEvent"]->Set("isFiltered", isFiltered);
m_data->Stores["ANNIEEvent"]->Set("isBLsubtracted", isBLsub);
m_data->Stores["ANNIEEvent"]->Set("isCFD", isCFD);
LAPPDEventIndex_ID = {0, 0, 0, 0, 0}; // initialize for five LAPPDs
if (loadOffsets)
LoadOffsetsAndCorrections();
if (LAPPDStoreReadInVerbosity > 11)
debugStoreReadIn.open("debugStoreReadIn.txt");
std::string ACCIDConfigFile;
get_ok = m_variables.Get("ACCIDConfigFile", ACCIDConfigFile);
if(!get_ok) {
Log("LAPPDLoadStore: Missing ACCIDConfigFile in config!",v_error,LAPPDStoreReadInVerbosity);
return false;
}
idConfigRecords = LoadIDConfig(ACCIDConfigFile);
if (LAPPDStoreReadInVerbosity > 1)
{
// print the ACCID config records for debug
cout << "Loaded LAPPD ID Config Records from " << ACCIDConfigFile << ":" << endl;
for (const auto& record : idConfigRecords) {
cout << "RunNumber: " << record.RunNumber
<< ", ACCID: " << record.ACCID
<< ", ManufacturerID: " << record.ManufacturerID
<< ", Position: " << record.Position << endl;
}
int testRunNum = 5907;
int testManuID = 39; // example ManufacturerID to query
auto result= queryNearestACCID(idConfigRecords, testRunNum, testManuID);
int nearestACCID = std::get<0>(result);
std::string position = std::get<1>(result);
cout << "Querying nearest ACCID for RunNumber: " << testRunNum << ", ManufacturerID: " << testManuID << endl;
cout << "Nearest ACCID: " << nearestACCID << ", Position: " << position << endl;
}
return true;
}
void LAPPDLoadStore::CleanDataObjects()
{
LAPPD_ID = -9999;
Raw_buffer.clear();
Parse_buffer.clear();
ReadBoards.clear();
data.clear();
meta.clear();
pps.clear();
LAPPDWaveforms.clear();
EventType = -9999;
LAPPDana = false;
ParaBoards.clear();
meta.clear();
LAPPDWaveforms.clear();
data.clear();
Parse_buffer.clear();
// LAPPDDataMap.clear();
// DataStreams.clear();
runInfoLoaded = false;
LAPPD_IDs.clear();
LAPPDLoadedTimeStampsRaw.clear();
LAPPDLoadedBeamgatesRaw.clear();
LAPPDLoadedOffsets.clear();
LAPPDLoadedTSCorrections.clear();
LAPPDLoadedBGCorrections.clear();
LAPPDLoadedOSInMinusPS.clear();
}
bool LAPPDLoadStore::Execute()
{
// 1. clean data variables
// 2. decide loading data or not, load the data from PsecData dat to tool
// 3. parse and pass data to later tools
CleanDataObjects();
m_data->CStore.Set("LAPPD_new_event", false);
LoadRunInfo();
if (MultiLAPPDMap)
{
bool gotDataStream = m_data->Stores["ANNIEEvent"]->Get("DataStreams", DataStreams);
bool getMap = m_data->Stores["ANNIEEvent"]->Get("LAPPDDataMap", LAPPDDataMap);
if (getMap && DataStreams["LAPPD"] == true && LAPPDDataMap.size() > 0)
{
// cout << "Outside, size of LAPPDDatamap = " << LAPPDDataMap.size() << endl;
bool gotBeamgates_ns = m_data->Stores["ANNIEEvent"]->Get("LAPPDBeamgate_ns", LAPPDBeamgate_ns);
bool gotTimeStamps_ns = m_data->Stores["ANNIEEvent"]->Get("LAPPDTimeStamps_ns", LAPPDTimeStamps_ns);
bool gotTimeStampsRaw = m_data->Stores["ANNIEEvent"]->Get("LAPPDTimeStampsRaw", LAPPDTimeStampsRaw);
bool gotBeamgatesRaw = m_data->Stores["ANNIEEvent"]->Get("LAPPDBeamgatesRaw", LAPPDBeamgatesRaw);
bool gotOffsets = m_data->Stores["ANNIEEvent"]->Get("LAPPDOffsets", LAPPDOffsets);
bool gotTSCorrection = m_data->Stores["ANNIEEvent"]->Get("LAPPDTSCorrection", LAPPDTSCorrection);
bool gotDBGCorrection = m_data->Stores["ANNIEEvent"]->Get("LAPPDBGCorrection", LAPPDBGCorrection);
bool gotOSInMinusPS = m_data->Stores["ANNIEEvent"]->Get("LAPPDOSInMinusPS", LAPPDOSInMinusPS);
if (LoadBuiltPPSInfo)
{
bool gotBG_PPSBefore = m_data->Stores["ANNIEEvent"]->Get("LAPPDBG_PPSBefore", LAPPDBG_PPSBefore);
bool gotBG_PPSAfter = m_data->Stores["ANNIEEvent"]->Get("LAPPDBG_PPSAfter", LAPPDBG_PPSAfter);
bool gotBG_PPSDiff = m_data->Stores["ANNIEEvent"]->Get("LAPPDBG_PPSDiff", LAPPDBG_PPSDiff);
bool gotBG_PPSMissing = m_data->Stores["ANNIEEvent"]->Get("LAPPDBG_PPSMissing", LAPPDBG_PPSMissing);
bool gotTS_PPSBefore = m_data->Stores["ANNIEEvent"]->Get("LAPPDTS_PPSBefore", LAPPDTS_PPSBefore);
bool gotTS_PPSAfter = m_data->Stores["ANNIEEvent"]->Get("LAPPDTS_PPSAfter", LAPPDTS_PPSAfter);
bool gotTS_PPSDiff = m_data->Stores["ANNIEEvent"]->Get("LAPPDTS_PPSDiff", LAPPDTS_PPSDiff);
bool gotTS_PPSMissing = m_data->Stores["ANNIEEvent"]->Get("LAPPDTS_PPSMissing", LAPPDTS_PPSMissing);
if (LAPPDStoreReadInVerbosity > 3)
{
cout << "LAPPDLoadStore: gotOffsets = " << gotOffsets << ", gotBG_PPSBefore = " << gotBG_PPSBefore << ", gotTS_PPSBefore = " << gotTS_PPSBefore << endl;
cout << "Size of LAPPDDataMap = " << LAPPDDataMap.size() << ", LAPPDOffsets = " << LAPPDOffsets.size() << ", LAPPDBG_PPSBefore = " << LAPPDBG_PPSBefore.size() << ", LAPPDTS_PPSBefore = " << LAPPDTS_PPSBefore.size() << endl;
cout << "gotBG_PPSBefore = " << gotBG_PPSBefore << ", gotBG_PPSAfter = " << gotBG_PPSAfter << ", gotBG_PPSDiff = " << gotBG_PPSDiff << ", gotBG_PPSMissing = " << gotBG_PPSMissing << endl;
cout << "gotTS_PPSBefore = " << gotTS_PPSBefore << ", gotTS_PPSAfter = " << gotTS_PPSAfter << ", gotTS_PPSDiff = " << gotTS_PPSDiff << ", gotTS_PPSMissing = " << gotTS_PPSMissing << endl;
}
}
}
else
{
return true;
}
}
// decide loading data or not, set to LAPPDana for later tools
LAPPDana = LoadData();
m_data->CStore.Set("LAPPDana", LAPPDana);
if (LAPPDStoreReadInVerbosity > 0)
cout << "LAPPDana for loading was set to " << LAPPDana << endl;
if (!LAPPDana)
{
// not loading data, return
return true;
}
if (!MultiLAPPDMap)
{
// parse and pass data to later tools
int frametype = static_cast<int>(Raw_buffer.size() / ReadBoards.size());
if (frametype != num_vector_data && frametype != num_vector_pps)
{
cout << "Problem identifying the frametype, size of raw vector was " << Raw_buffer.size() << endl;
cout << "It was expected to be either " << num_vector_data * ReadBoards.size() << " or " << num_vector_pps * ReadBoards.size() << endl;
cout << "Please check manually!" << endl;
LAPPDana = false;
m_data->CStore.Set("LAPPDana", LAPPDana);
m_data->CStore.Set("LAPPDPPShere", LAPPDana);
return true;
}
if (frametype == num_vector_pps && loadPPS)
{
// if it's PPS, don't to anything relate to merging
m_data->CStore.Set("LAPPDanaData", false);
// set LAPPDana to false
LAPPDana = false;
m_data->CStore.Set("LAPPDana", LAPPDana);
ParsePPSData();
m_data->CStore.Set("LAPPD_ID", LAPPD_ID);
m_data->Stores["ANNIEEvent"]->Set("LAPPD_ID", LAPPD_ID);
m_data->CStore.Set("LoadingPPS", true);
if (LAPPDStoreReadInVerbosity > 0)
cout << "LAPPDStoreReadIn: PPS data loaded, LAPPDanaData is false, set LAPPDana to false" << endl;
return true;
}
if (frametype == num_vector_data && loadPSEC)
{
m_data->CStore.Set("LAPPDanaData", true);
LoadRunInfo();
bool parsData = ParsePSECData();
runInfoLoaded = true;
LAPPDana = parsData;
m_data->CStore.Set("LAPPDana", LAPPDana);
m_data->CStore.Set("LoadingPPS", false);
if (!parsData)
{
cout << "LAPPDStoreReadIn: PSEC data parsing failed, set LAPPDana to false and return" << endl;
return true;
}
NonEmptyDataEvents += 1;
}
// parsing finished, do pedestal subtraction
DoPedestalSubtract();
// save some timestamps relate to this event, for later using
SaveTimeStamps();
vector<int> ReadedBoards;
vector<int> ACDCReadedLAPPDID;
for (auto it = ReadBoards.begin(); it != ReadBoards.end(); it++)
{
ReadedBoards.push_back(*it);
ACDCReadedLAPPDID.push_back(LAPPD_ID);
// cout << "ReadedBoards loaded with " << *it << endl;
}
if (LAPPDStoreReadInVerbosity > 0)
cout << "*************************END LAPPDStoreReadIn************************************" << endl;
m_data->CStore.Set("LAPPD_ID", LAPPD_ID);
m_data->Stores["ANNIEEvent"]->Set("LAPPD_ID", LAPPD_ID);
m_data->Stores["ANNIEEvent"]->Set("RawLAPPDData", LAPPDWaveforms); // leave this only for the merger tool
m_data->Stores["ANNIEEvent"]->Set("MergeLAPPDPsec", LAPPDWaveforms);
m_data->Stores["ANNIEEvent"]->Set("ACDCmetadata", meta);
m_data->Stores["ANNIEEvent"]->Set("ACDCboards", ReadBoards);
m_data->Stores["ANNIEEvent"]->Set("SortedBoards", ParaBoards);
m_data->Stores["ANNIEEvent"]->Set("TriggerChannelBase", TrigChannel);
m_data->Stores["ANNIEEvent"]->Set("ACDCReadedLAPPDID", ACDCReadedLAPPDID);
m_data->Stores["ANNIEEvent"]->Set("ReadedBoards", ReadedBoards);
m_data->CStore.Set("NewLAPPDDataAvailable", true);
if (LAPPDStoreReadInVerbosity > 11)
debugStoreReadIn << " Set NewLAPPDDataAvailable to true" << endl;
NonEmptyEvents += 1;
eventNo++;
if (LAPPDStoreReadInVerbosity > 2)
{
cout << "Finish LAPPDStoreReadIn, Printing the ANNIEEvent" << endl;
m_data->Stores["ANNIEEvent"]->Print(false);
}
}
else
{
// if we are reading multiple LAPPD data from one ANNIEEvent
// assume we only have PSEC data in ANNIEEvent, no PPS event.
// loop the map, for each PSEC data, do the same loading and parsing.
// load the waveform by using LAPPD_ID * board_number * channel_number as the key
// data was already loaded in the LoadData()
vector<int> ReadedBoards;
vector<int> ACDCReadedLAPPDID;
if (LAPPDStoreReadInVerbosity > 0)
cout << "LAPPDStoreReadIn: LAPPDDataMap has " << LAPPDDataMap.size() << " LAPPD PSEC data " << endl;
bool ValidDataLoaded = false;
std::map<unsigned long, PsecData>::iterator it;
for (it = LAPPDDataMap.begin(); it != LAPPDDataMap.end(); it++)
{
ParaBoards.clear();
uint64_t time = it->first;
PsecData dat = it->second;
ReadBoards = dat.BoardIndex; // From the data, board index is not related to the LAPPD_ID! WHY use this way?
Raw_buffer = dat.RawWaveform;
LAPPD_ID = dat.LAPPD_ID;
if (LAPPD_ID>20) {
tuple<int, string> queryResult = queryNearestACCID(idConfigRecords, runNumber, LAPPD_ID);
if (LAPPDStoreReadInVerbosity > 2)
cout << "LAPPDLoadStore: Mapped ManufacturerID " << LAPPD_ID << " to ACCID " << get<0>(queryResult) << " for run " << runNumber << endl;
LAPPD_ID = get<0>(queryResult);
}
if (LAPPD_ID != SelectedLAPPD && SelectSingleLAPPD)
continue;
if (Raw_buffer.size() == 0 || ReadBoards.size() == 0)
{
m_data->CStore.Set("LAPPDana", false);
cout << "LAPPD Load Store, find Raw buffer size == 0 or ReadBoards size == 0" << endl;
continue;
// return true;
}
if (LAPPDStoreReadInVerbosity > 0)
{
// print ReadBoards
cout << "LAPPD ID " << LAPPD_ID << " ReadBoards size is " << ReadBoards.size() << ", data: " << endl;
for (auto it = ReadBoards.begin(); it != ReadBoards.end(); it++)
{
cout << ", " << *it;
}
cout << endl;
}
// push all elements in ReadBoards to ReadedBoards
for (auto it = ReadBoards.begin(); it != ReadBoards.end(); it++)
{
ReadedBoards.push_back(*it);
ACDCReadedLAPPDID.push_back(LAPPD_ID);
// cout << "ReadedBoards loaded with " << *it << endl;
}
int frametype = static_cast<int>(Raw_buffer.size() / ReadBoards.size());
if (frametype != num_vector_data)
{
cout << "LAPPDStoreReadIn: For LAPPD_ID " << LAPPD_ID << " frametype is not num_vector_data, skip this LAPPD" << endl;
continue;
}
m_data->CStore.Set("LAPPDanaData", true);
if (LAPPDStoreReadInVerbosity > 3)
{
cout << "Before parsing data, printing size and element in ReadBoards, ReadedBoards, ParaBoards" << endl;
cout << "ReadBoards size is " << ReadBoards.size() << endl;
for (auto it = ReadBoards.begin(); it != ReadBoards.end(); it++)
{
cout << ", " << *it;
}
cout << endl;
cout << "ReadedBoards size is " << ReadedBoards.size() << endl;
for (auto it = ReadedBoards.begin(); it != ReadedBoards.end(); it++)
{
cout << ", " << *it;
}
cout << endl;
cout << "ParaBoards size is " << ParaBoards.size() << endl;
for (auto it = ParaBoards.begin(); it != ParaBoards.end(); it++)
{
cout << ", " << *it;
}
cout << endl;
}
bool parsData = ParsePSECData(); // TODO: now assuming all boards just has 30 channels. Need to be changed for gen 2
if (parsData)
{
ValidDataLoaded = true;
if (LAPPDStoreReadInVerbosity > 2)
cout << "LAPPDLoadStore: Loaded LAPPD data for LAPPD_ID " << LAPPD_ID << " at time " << time << endl;
LAPPDLoadedTimeStamps.push_back(time);
LAPPD_IDs.push_back(LAPPD_ID);
// print the size of LAPPDTimeStampsRaw, print all keys in it
if (LAPPDStoreReadInVerbosity > 0)
{
cout << "LAPPDTimeStampsRaw size is " << LAPPDTimeStampsRaw.size() << endl;
for (auto it = LAPPDTimeStampsRaw.begin(); it != LAPPDTimeStampsRaw.end(); it++)
{
cout << "LAPPDTimeStampsRaw key is " << it->first << endl;
}
}
// print the size of LAPPDOffsets, print all keys in it
if (LAPPDStoreReadInVerbosity > 0)
{
cout << "LAPPDOffsets size is " << LAPPDOffsets.size() << endl;
for (auto it = LAPPDOffsets.begin(); it != LAPPDOffsets.end(); it++)
{
cout << "LAPPDOffsets key is " << it->first << endl;
}
}
LAPPDLoadedTimeStampsRaw.push_back(LAPPDTimeStampsRaw.at(time));
LAPPDLoadedBeamgatesRaw.push_back(LAPPDBeamgatesRaw.at(time));
LAPPDLoadedOffsets.push_back(LAPPDOffsets.at(time));
LAPPDLoadedTSCorrections.push_back(LAPPDTSCorrection.at(time));
LAPPDLoadedBGCorrections.push_back(LAPPDBGCorrection.at(time));
LAPPDLoadedOSInMinusPS.push_back(LAPPDOSInMinusPS.at(time));
if (LAPPDStoreReadInVerbosity > 2)
cout << "parsing finished for LAPPD_ID " << LAPPD_ID << " at time " << time << endl;
if (LoadBuiltPPSInfo)
{
LAPPDLoadedBG_PPSBefore.push_back(LAPPDBG_PPSBefore.at(time));
LAPPDLoadedBG_PPSAfter.push_back(LAPPDBG_PPSAfter.at(time));
LAPPDLoadedBG_PPSDiff.push_back(LAPPDBG_PPSDiff.at(time));
LAPPDLoadedBG_PPSMissing.push_back(LAPPDBG_PPSMissing.at(time));
LAPPDLoadedTS_PPSBefore.push_back(LAPPDTS_PPSBefore.at(time));
LAPPDLoadedTS_PPSAfter.push_back(LAPPDTS_PPSAfter.at(time));
LAPPDLoadedTS_PPSDiff.push_back(LAPPDTS_PPSDiff.at(time));
LAPPDLoadedTS_PPSMissing.push_back(LAPPDTS_PPSMissing.at(time));
if (LAPPDTS_PPSMissing.at(time) != LAPPDBG_PPSMissing.at(time) && ((LAPPDTS_PPSMissing.at(time) > -100 && LAPPDTS_PPSMissing.at(time) < 100) || (LAPPDBG_PPSMissing.at(time) > -100 && LAPPDBG_PPSMissing.at(time) < 100)))
{
cout << "LAPPDLoadStore: PPS missing number is not the same on BG and TS for LAPPD_ID " << LAPPD_ID << " at time " << time << ", BG: " << LAPPDBG_PPSMissing.at(time) << ", TS: " << LAPPDTS_PPSMissing.at(time) << endl;
cout << "LAPPDLoadStore: BG_PPSDiff: " << LAPPDBG_PPSDiff.at(time) << ", TS_PPSDiff: " << LAPPDTS_PPSDiff.at(time) << endl;
}
}
}
NonEmptyEvents += 1;
NonEmptyDataEvents += 1;
}
eventNo++;
LAPPDana = ValidDataLoaded;
m_data->CStore.Set("LAPPDana", LAPPDana);
DoPedestalSubtract();
m_data->Stores["ANNIEEvent"]->Set("RawLAPPDData", LAPPDWaveforms); // leave this only for the merger tool
m_data->Stores["ANNIEEvent"]->Set("LAPPD_IDs", LAPPD_IDs);
m_data->Stores["ANNIEEvent"]->Set("LAPPDLoadedTimeStamps", LAPPDLoadedTimeStamps);
m_data->Stores["ANNIEEvent"]->Set("ACDCboards", ReadedBoards);
m_data->Stores["ANNIEEvent"]->Set("ACDCReadedLAPPDID", ACDCReadedLAPPDID);
m_data->Stores["ANNIEEvent"]->Set("ACDCmetadata", meta);
m_data->Stores["ANNIEEvent"]->Set("LAPPDDataMap", LAPPDDataMap);
m_data->Stores["ANNIEEvent"]->Set("LAPPDBeamgate_ns", LAPPDBeamgate_ns);
m_data->Stores["ANNIEEvent"]->Set("LAPPDTimeStamps_ns", LAPPDTimeStamps_ns);
m_data->Stores["ANNIEEvent"]->Set("LAPPDTimeStampsRaw", LAPPDTimeStampsRaw);
m_data->Stores["ANNIEEvent"]->Set("LAPPDBeamgatesRaw", LAPPDBeamgatesRaw);
m_data->Stores["ANNIEEvent"]->Set("LAPPDOffsets", LAPPDOffsets);
m_data->Stores["ANNIEEvent"]->Set("LAPPDTSCorrection", LAPPDTSCorrection);
m_data->Stores["ANNIEEvent"]->Set("LAPPDBGCorrection", LAPPDBGCorrection);
m_data->Stores["ANNIEEvent"]->Set("LAPPDOSInMinusPS", LAPPDOSInMinusPS);
if (LoadBuiltPPSInfo)
{
m_data->Stores["ANNIEEvent"]->Set("LAPPDBG_PPSBefore", LAPPDBG_PPSBefore);
m_data->Stores["ANNIEEvent"]->Set("LAPPDBG_PPSAfter", LAPPDBG_PPSAfter);
m_data->Stores["ANNIEEvent"]->Set("LAPPDBG_PPSDiff", LAPPDBG_PPSDiff);
m_data->Stores["ANNIEEvent"]->Set("LAPPDBG_PPSMissing", LAPPDBG_PPSMissing);
m_data->Stores["ANNIEEvent"]->Set("LAPPDTS_PPSBefore", LAPPDTS_PPSBefore);
m_data->Stores["ANNIEEvent"]->Set("LAPPDTS_PPSAfter", LAPPDTS_PPSAfter);
m_data->Stores["ANNIEEvent"]->Set("LAPPDTS_PPSDiff", LAPPDTS_PPSDiff);
m_data->Stores["ANNIEEvent"]->Set("LAPPDTS_PPSMissing", LAPPDTS_PPSMissing);
}
// TODO: save other timestamps, variables and metadata for later use
if (eventNo % 100 == 0)
{
cout << "LAPPDLoadStore: Loaded " << eventNo << " events, " << NonEmptyDataEvents << " non empty LAPPD PSEC data loaded from all LAPPDs" << endl;
}
}
if (LAPPDStoreReadInVerbosity > 0)
cout << "LAPPDLoadStore: Finished loading LAPPD data" << endl;
return true;
}
bool LAPPDLoadStore::Finalise()
{
cout << "\033[1;34mLAPPDLoadStore: Finalising\033[0m" << endl;
cout << "LAPPDLoadStore: Got pps event in total: " << PPSnumber << endl;
cout << "LAPPDLoadStore: Got error data or PPS events in total: " << errorEventsNumber << endl;
cout << "LAPPDLoadStore: Got non empty data and PPS events in total: " << NonEmptyEvents << endl;
cout << "LAPPDLoadStore: Got non empty data events in total: " << NonEmptyDataEvents << endl;
cout << "LAPPDLoadStore: End at event number: " << eventNo << endl;
return true;
}
bool LAPPDLoadStore::ReadPedestals(int boardNo)
{
if (LAPPDStoreReadInVerbosity > 0)
cout << "Getting Pedestals " << boardNo << endl;
std::string LoadName = PedFileNameTXT;
string nextLine; // temp line to parse
double finalsampleNo;
std::string ext = std::to_string(boardNo);
ext += ".txt";
LoadName += ext;
PedFile.open(LoadName); // final name: PedFileNameTXT + boardNo + .txt
if (!PedFile.is_open())
{
cout << "Failed to open " << LoadName << "!" << endl;
return false;
}
if (LAPPDStoreReadInVerbosity > 0)
cout << "Opened file: " << LoadName << endl;
int sampleNo = 0; // sample number
while (getline(PedFile, nextLine))
{
istringstream iss(nextLine); // copies the current line in the file
int location = -1; // counts the current perameter in the line
string stempValue; // current string in the line
int tempValue; // current int in the line
unsigned long channelNo = boardNo * 30; // channel number
// cout<<"NEW BOARD "<<channelNo<<" "<<sampleNo<<endl;
// starts the loop at the beginning of the line
while (iss >> stempValue)
{
location++;
int tempValue = stoi(stempValue, 0, 10);
if (sampleNo == 0)
{
vector<int> tempPed;
tempPed.push_back(tempValue);
// cout<<"First time: "<<channelNo<<" "<<tempValue<<endl;
PedestalValues->insert(pair<unsigned long, vector<int>>(channelNo, tempPed));
if (LAPPDStoreReadInVerbosity > 0)
cout << "Inserting pedestal at channelNo " << channelNo << endl;
// newboard=false;
}
else
{
// cout<<"Following time: "<<channelNo<<" "<<tempValue<<" F "<<PedestalValues->count(channelNo)<<endl;
(((PedestalValues->find(channelNo))->second)).push_back(tempValue);
}
channelNo++;
}
sampleNo++;
}
if (LAPPDStoreReadInVerbosity > 0)
cout << "FINAL SAMPLE NUMBER: " << PedestalValues->size() << " " << (((PedestalValues->find(0))->second)).size() << endl;
PedFile.close();
return true;
}
bool LAPPDLoadStore::MakePedestals()
{
// Empty for now...
// should be moved to ASCII readin?
return true;
}
int LAPPDLoadStore::getParsedMeta(std::vector<unsigned short> buffer, int BoardId)
{
// Catch empty buffers
if (buffer.size() == 0)
{
std::cout << "You tried to parse ACDC data without pulling/setting an ACDC buffer" << std::endl;
return -1;
}
// Prepare the Metadata vector
// meta.clear();
// Helpers
int chip_count = 0;
// Indicator words for the start/end of the metadata
const unsigned short startword = 0xBA11;
unsigned short endword = 0xFACE;
unsigned short endoffile = 0x4321;
// Empty metadata map for each Psec chip <PSEC #, vector with information>
map<int, vector<unsigned short>> PsecInfo;
// Empty trigger metadata map for each Psec chip <PSEC #, vector with trigger>
map<int, vector<unsigned short>> PsecTriggerInfo;
unsigned short CombinedTriggerRateCount;
// Empty vector with positions of aboves startword
vector<int> start_indices =
{
1539, 3091, 4643, 6195, 7747};
// Fill the psec info map
vector<unsigned short>::iterator bit;
for (int i : start_indices)
{
// Write the first word after the startword
bit = buffer.begin() + (i + 1);
// As long as the endword isn't reached copy metadata words into a vector and add to map
vector<unsigned short> InfoWord;
while (*bit != endword && *bit != endoffile && InfoWord.size() < 14)
{
InfoWord.push_back(*bit);
++bit;
}
PsecInfo.insert(pair<int, vector<unsigned short>>(chip_count, InfoWord));
chip_count++;
}
// Fill the psec trigger info map
for (int chip = 0; chip < NUM_PSEC; chip++)
{
for (int ch = 0; ch < NUM_CH / NUM_PSEC; ch++)
{
if (LAPPDStoreReadInVerbosity > 10)
cout << "parsing meta step1-1" << endl;
// Find the trigger data at begin + last_metadata_start + 13_info_words + 1_end_word + 1
bit = buffer.begin() + start_indices[4] + 13 + 1 + 1 + ch + (chip * (NUM_CH / NUM_PSEC));
if (LAPPDStoreReadInVerbosity > 10)
cout << "parsing meta step1-2" << endl;
PsecTriggerInfo[chip].push_back(*bit);
}
}
if (LAPPDStoreReadInVerbosity > 10)
cout << "parsing meta step1.5" << endl;
// Fill the combined trigger
CombinedTriggerRateCount = buffer[7792];
//----------------------------------------------------------
// Start the metadata parsing
meta.push_back(BoardId);
for (int CHIP = 0; CHIP < NUM_PSEC; CHIP++)
{
meta.push_back((0xDCB0 | CHIP));
// cout<<"size of info word is "<<PsecInfo[CHIP].size()<<endl;
// cout<<"size of trigger word is "<<PsecTriggerInfo[CHIP].size()<<endl;
for (int INFOWORD = 0; INFOWORD < 13; INFOWORD++)
{
if (LAPPDStoreReadInVerbosity > 10)
cout << "parsing meta step2-1 infoword " << INFOWORD << endl;
if (PsecInfo[CHIP].size() < 13)
{
NonEmptyEvents = NonEmptyEvents - 1;
NonEmptyDataEvents = NonEmptyDataEvents - 1;
cout << "meta data parsing wrong! PsecInfo[CHIP].size() < 13" << endl;
m_data->CStore.Set("LAPPDana", false);
return 1;
}
try
{
meta.push_back(PsecInfo[CHIP][INFOWORD]);
}
catch (...)
{
NonEmptyEvents = NonEmptyEvents - 1;
NonEmptyDataEvents = NonEmptyDataEvents - 1;
cout << "meta data parsing wrong! meta.push_back(PsecInfo[CHIP][INFOWORD]);" << endl;
m_data->CStore.Set("LAPPDana", false);
return 1;
}
}
for (int TRIGGERWORD = 0; TRIGGERWORD < 6; TRIGGERWORD++)
{
if (LAPPDStoreReadInVerbosity > 10)
cout << "parsing meta step2-2 trigger word" << endl;
if (PsecTriggerInfo[CHIP].size() < 6)
{
NonEmptyEvents = NonEmptyEvents - 1;
NonEmptyDataEvents = NonEmptyDataEvents - 1;
cout << "meta data parsing wrong! PsecTriggerInfo[CHIP].size() < 6" << endl;
m_data->CStore.Set("LAPPDana", false);
return 1;
}
try
{
meta.push_back(PsecTriggerInfo[CHIP][TRIGGERWORD]);
}
catch (...)
{
NonEmptyEvents = NonEmptyEvents - 1;
NonEmptyDataEvents = NonEmptyDataEvents - 1;
cout << "meta data parsing wrong! meta.push_back(PsecTriggerInfo[CHIP][TRIGGERWORD]);" << endl;
m_data->CStore.Set("LAPPDana", false);
return 1;
}
}
}
meta.push_back(CombinedTriggerRateCount);
meta.push_back(0xeeee);
return 0;
}
int LAPPDLoadStore::getParsedData(std::vector<unsigned short> buffer, int ch_start)
{
// Catch empty buffers
if (buffer.size() == 0)
{
std::cout << "You tried to parse ACDC data without pulling/setting an ACDC buffer" << std::endl;
return -1;
}
// Helpers
int DistanceFromZero;
int channel_count = 0;
// Indicator words for the start/end of the metadata
const unsigned short startword = 0xF005;
unsigned short endword = 0xBA11;
unsigned short endoffile = 0x4321;
// Empty vector with positions of aboves startword
vector<int> start_indices =
{
2, 1554, 3106, 4658, 6210};
// Fill data map
vector<unsigned short>::iterator bit;
for (int i : start_indices)
{
// Write the first word after the startword
bit = buffer.begin() + (i + 1);
// As long as the endword isn't reached copy metadata words into a vector and add to map
vector<unsigned short> InfoWord;
while (*bit != endword && *bit != endoffile)
{
InfoWord.push_back((unsigned short)*bit);
if (InfoWord.size() == NUM_SAMP)
{
data.insert(pair<int, vector<unsigned short>>(ch_start + channel_count, InfoWord));
if (LAPPDStoreReadInVerbosity > 5)
cout << "inserted data to channel " << ch_start + channel_count << endl;
InfoWord.clear();
channel_count++;
}
++bit;
}
}
return 0;
}
bool LAPPDLoadStore::LoadData()
{
// TODO: when looping in Stores["ANNIEEvent"], the multiple PSEC data will be saved in std::map<double,PsecData> LAPPDDatas;
// so we need to loop the map to get all data and waveforms, using the LAPPD_ID, board number, channel number to form a global channel-waveform map
// then loop all waveforms based on channel number
if (loadFromStoreDirectly)
m_data->Stores["ANNIEEvent"]->GetEntry(eventNo);
if (LAPPDStoreReadInVerbosity > 2)
cout << "Got eventNo " << eventNo << endl;
// if loaded enough events, stop the loop and return false
if (NonEmptyEvents == stopEntries || NonEmptyEvents > stopEntries || NonEmptyDataEvents == stopEntries || NonEmptyDataEvents > stopEntries)
{
if (LAPPDStoreReadInVerbosity > 0)
cout << "LAPPDStoreReadIn: NonEmptyEvents is " << NonEmptyEvents << ", NonEmptyDataEvents is " << NonEmptyDataEvents << ", stopEntries is " << stopEntries << ", stop the loop" << endl;
m_data->vars.Set("StopLoop", 1);
return false;
}
// if (mergedEvent)
// DataStreams["LAPPD"] = true;
// print the load information: DataStreams["LAPPD"] value, PsecReceiveMode, MultiLAPPDMap
if (LAPPDStoreReadInVerbosity > 0)
{
cout << "LAPPDStoreReadIn: DataStreams[LAPPD] is " << DataStreams["LAPPD"] << ", PsecReceiveMode is " << PsecReceiveMode << ", MultiLAPPDMap is " << MultiLAPPDMap << endl;
}
if (loadPSEC || loadPPS)
{ // if load any kind of data
// if there is no LAPPD data in event store, and not getting data from CStore, return false, don't load
if (!DataStreams["LAPPD"] && PsecReceiveMode == 0 && !MultiLAPPDMap) // if doesn't have datastream, not reveive data from raw data store (PsecReceiveMode), not loading multiple LAPPD map from processed data
{
return false;
}
else if (PsecReceiveMode == 1 && !MultiLAPPDMap) // no LAPPD data in event store, but load from CStore (for merging LAPPD to ANNIEEvent)
{ // only get PSEC object from CStore
// if loading from raw data, and the loading was set to pause, return false
bool LAPPDRawLoadingPaused = false;
m_data->CStore.Get("PauseLAPPDDecoding", LAPPDRawLoadingPaused);
if (LAPPDRawLoadingPaused)
{
m_data->CStore.Set("NewLAPPDDataAvailable", false);
return false;
}
PsecData dat;
bool getData = m_data->CStore.Get("LAPPDData", dat);
if (getData)
{
m_data->CStore.Set("StoreLoadedLAPPDData", dat);
}
if (LAPPDStoreReadInVerbosity > 0)
cout << "LAPPDStoreReadIn: getting LAPPDData from CStore" << endl;
bool mergingLoad;
// if in merging mode, but no LAPPD data in CStore, return false, don't load
m_data->CStore.Get("LAPPDanaData", mergingLoad);
if (!mergingLoad && mergingModeReadIn)
{
if (LAPPDStoreReadInVerbosity > 0)
cout << "LAPPDStoreReadIn: mergingMode is true but LAPPDanaData is false, set LAPPDana to false" << endl;
return false;
}
if (getData)
{
vector<unsigned int> errorcodes = dat.errorcodes;
if (errorcodes.size() == 1 && errorcodes[0] == 0x00000000)
{
if (LAPPDStoreReadInVerbosity > 1)
printf("No errorcodes found all good: 0x%08x\n", errorcodes[0]);
}
else
{
printf("When Loading PPS: Errorcodes found: %li\n", errorcodes.size());
for (unsigned int k = 0; k < errorcodes.size(); k++)
{
printf("Errorcode: 0x%08x\n", errorcodes[k]);
}
errorEventsNumber++;
return false;
}
ReadBoards = dat.BoardIndex;
Raw_buffer = dat.RawWaveform;
if (Raw_buffer.size() == 0 || ReadBoards.size() == 0)
{
cout << "LAPPD Load Store, find Raw buffer size == 0 or ReadBoards size == 0" << endl;
return false;
}
LAPPD_ID = dat.LAPPD_ID;
if (LAPPD_ID>20) {
tuple<int, string> queryResult = queryNearestACCID(idConfigRecords, runNumber, LAPPD_ID);
if (LAPPDStoreReadInVerbosity > 2)
cout << "LAPPDLoadStore: Mapped ManufacturerID " << LAPPD_ID << " to ACCID " << get<0>(queryResult) << " for run " << runNumber << endl;
LAPPD_ID = get<0>(queryResult);
}
if (LAPPD_ID != SelectedLAPPD && SelectSingleLAPPD)
return false;
m_data->CStore.Set("PsecTimestamp", dat.Timestamp);
if (LAPPDStoreReadInVerbosity > 2)
{
cout << " Got Data " << endl;
dat.Print();
}
int frameType = static_cast<int>(Raw_buffer.size() / ReadBoards.size());
if (LAPPDStoreReadInVerbosity > 0)
cout << "LAPPDStoreReadIn: got Data from CStore, frame type is " << frameType << endl;
if (loadPSEC)
{
if (frameType == num_vector_data)
{
m_data->CStore.Set("LoadingPPS", false);
return true;
}
}
if (loadPPS)
{
if (frameType == num_vector_pps)
{
m_data->CStore.Set("LoadingPPS", true);
return true;
}
}
return false;
}
else
{
return false;
}
}
else if (DataStreams["LAPPD"] && PsecReceiveMode == 0 && !MultiLAPPDMap) // if load single lappd data at ID 0, require Datastream, not receive from cstore, not in multiLAPPDMap mode
{
PsecData dat;
m_data->Stores["ANNIEEvent"]->Get("LAPPDData", dat);
ReadBoards = dat.BoardIndex;
Raw_buffer = dat.RawWaveform;
LAPPD_ID = dat.LAPPD_ID;
if (LAPPD_ID>20) {
tuple<int, string> queryResult = queryNearestACCID(idConfigRecords, runNumber, LAPPD_ID);
if (LAPPDStoreReadInVerbosity > 2)
cout << "LAPPDLoadStore: Mapped ManufacturerID " << LAPPD_ID << " to ACCID " << get<0>(queryResult) << " for run " << runNumber << endl;
LAPPD_ID = get<0>(queryResult);
}
if (LAPPD_ID != SelectedLAPPD && SelectSingleLAPPD)
return false;
m_data->CStore.Set("PsecTimestamp", dat.Timestamp);
if (Raw_buffer.size() != 0 || ReadBoards.size() != 0)
{
if (LAPPDStoreReadInVerbosity > 0)
{
cout << "Getting data length format" << static_cast<int>(Raw_buffer.size() / ReadBoards.size()) << ", psec timestamp is " << dat.Timestamp << endl;
cout << "ReadBoards size " << ReadBoards.size() << " Raw_buffer size " << Raw_buffer.size() << " LAPPD_ID " << LAPPD_ID << endl;
}
}
else
{
cout << "LAPPDStoreReadIn: loading data with raw buffer size 0 or ReadBoards size 0, skip loading" << endl;
cout << "ReadBoards size " << ReadBoards.size() << " Raw_buffer size " << Raw_buffer.size() << " LAPPD_ID " << LAPPD_ID << endl;
return false;
}
return true;
}
else if (DataStreams["LAPPD"] && PsecReceiveMode == 0 && MultiLAPPDMap) // if not receive from cstore, and load multi lappd map
{
if (LAPPDStoreReadInVerbosity > 0)