Skip to content

Updated changes from main#14

Open
S81D wants to merge 89 commits intoS81D:new_event_builderfrom
ANNIEsoft:Application
Open

Updated changes from main#14
S81D wants to merge 89 commits intoS81D:new_event_builderfrom
ANNIEsoft:Application

Conversation

@S81D
Copy link
Owner

@S81D S81D commented Aug 5, 2024

No description provided.

jminock and others added 30 commits August 5, 2024 15:42
…262)

* Read Simple Reco info to PhaseIITreeMaker and add Simple Tank Track Length variable

* Updated Reweight Tool and added separate Reweight Flux Tool

---------

Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
…er to fix charge omission seen for MC Hits (#259)

* Update ClusterFinderConfig

Narrow cluster window - typical use is 5 hits in 50ns, not 5 hits in 100ns

* Update EventSelectorConfig

New timing offsets moved the PMTs "back" by an average of ~10ns. When looking for PMT/MRD coincidence, we this need to adjust this offset value.

* Update ClusterClassifiers.cpp

With new gains calibration we now have 121 active PMTs instead of 123. Adjust charge balance parameter to reflect the number of active PMTs that could capture light.

In the future, will alter this to read in the channel keys so that it automatically grabs the correct number of active PMTs.

* Update ClusterFinder.cpp

Fixed issues seen with ClusterFinder and the omission of charge for MC Hits:

- Change MC hit time away from 2ns discretization, as the new data hit times are float values.
- As a result, need to change for loop to not just grab integer hit times (old), but also grab float hit times. 
- MC Hits with times < 0 were being ignored due to a variable set to 0. Tool now keeps all hit times, even if they are negative due to time smearing.
- Reduce first-photon effect by modifying how hit timing is assigned for a "pulse"/digit. Followed what the tool DigitBuilder used: median photon hit time as the "pulse" time.

Also,
- In Data, mandate hits need to be > 0 (there is a weird spike at 0 in cluster times that are from this and are likely unphysical)


TODO: Potentially expand the MC "pulse" integration window from 10ns to something larger. Average charge per hit is lower and total number of hits slightly higher in MC than data, indicating the pulse window may be too narrow and is cutting what should be one pulse into two. Need to check with calibration to see what the average pulse window length is for ~SPE pulses.

* Update ClusterFinderConfig

Same as data - cluster window 50ns, looking for at least 5 hits

* Update ClusterFinderConfig

Dropped line pointing to an external WCSim channel key ID (not really an issue cause they are the same)

* Update DeadPMTIDs_p2v7.txt

Updated mask to omit additional PMT to reflect new gains data. (PMT 337, aka 6 here, no longer active in data)

* Update LoadWCSimConfig

Added a small description on where to find collaboration WCSim samples. Also cut down on commented lines

* Update LoadGenieEventConfig

Updated tool config to read in new collaboration samples. Added description to each variable per doc 5230-v2 (LoadGenieEvent Tutorial)

* Update PhaseIITreeMakerConfig

In prep for whenever we have tank reco available

* Update LoadGeometryConfig

new gains

* Update DeadPMTIDs_p2v7.txt

Updated new inactive PMT from the gains calibration

* Update LoadWCSimConfig

Updated config to include paths to latest collaboration samples

* Add files via upload

PMT timing offsets derived from Laser calibration data. These offsets should be considered precision software corrections on top of the previous firmware corrections at the ADC level to correct for the large cabling delays.

* Update LoadGeometry.h

Updated header file with PMT timing offsets

* Update LoadGeometryConfig

Path to PMT timing offset .csv file

* Update EventSelector.cpp

1. Updated default offset value (745) to 755 to account for new timing offsets of the PMTs.

2. In the new gains file, there are measurements for the 121 active PMTs. Two PMTs were deemed "inactive" and are no longer included. (Old file used to have 123 active PMTs). These PMTs were omitted as no data/hits were recorded on them during the source calibration. In principle there should only be hits in the active PMTs. However, even though there were no data/hits recorded in those tubes for the source calibration, for very energetic events occasionally one of the since "inactived" PMTs registers a hit for some reason and tries to access the map, which crashes this tool. Just added a condition that the channel must exist in the map in order to count that hit.

* Update LoadGeometry.cpp

Adjust LoadGeometry to include new PMT Timing offsets from .csv file, derived from the laser source calibration.

* Update PhaseIIADCHitFinder.cpp

- Grab new PMT timing offset values from .csv file to subtract from the hit times --> added this to all methods of hit finding

- Instead of grabbing the x tick with the maximum ADC value as the hit time (always binned to 2ns), assign float hit times based when the pulse crosses 50% of its maximum above threshold. Currently only implemented for the Pulse Finding Approach "Threshold" and Pulse Window Type "Dynamic" (the default, used configuration of the code). 

TODO: 
- Add this hit timing approach to all configurations of the code. 
- (Maybe) per Bob's recommendation, it might be better to instead assign the hit time using the following:
1. get the time at 50% between peak and threshold
2. get the time at 20% " " " "
3. Draw a straight line between these two points to extrapolate the time to zero threshold
This way it would lessen the effect of time shifts between large and small pulses.

* Update PhaseIIADCHitFinder.h

Added offset map to header

* Add files via upload

Old tool, new toolchain: output raw waveforms of PMT and aux channels from built, processed ANNIEEvents (that contain the raw waveforms). Useful to analyze PMT waveforms, as well as look at aux channel waveforms like the BoosterRWM and BoosterRF.

* Add files via upload

In case users want to eventbuild part files with raw waveforms (useful for source analysis), this toolchain complements the official event building toolchain that is used to create our processed data. Configurations for the tools to extract raw waveforms successfully from the PMTs are taken from Gian's AmBe analysis work. Currently, the event building for this toolchain has only been tested for Tank + CTC events.

* Add files via upload

Added README for event building toolchain, with reference to the ANNIE wiki page on how to properly event build.

* Update README.md

small syntax fix for EventBuilder README file

* Update ClusterFinder.cpp

Missed a bracket which caused the CI build error

* Update LoadWCSim.cpp

When using the "automatic" method for loading in GENIE files in the LoadGenieEvent, this was causing that tool to crash as it couldn't find the proper path based on the WCSim file name. Removed the to_string function

* Update EventSelector.cpp

Removed the charge threshold (> 200 pe) needed to consider tank/MRD coincidence. Given the README states "PMTMRDCoincCut: Flags events that do not have a certain time offset between PMT & MRD cluster" this should include all PMT clusters, and not just some that are over a certain charge threshold. This change in reality likely won't change much, as most muon tracks in the MRD deposit enough light to leave more than 200 pe worth of charge, but per our Slack convo it's probably best to just remove this condition as its not obvious.
…268)

* Update DNNTrackLengthTrainConfig

Changed the storing location of ScalingVarsStore.bs since the Data_Energy_Reco directory doesn't exist in the main ToolAnalysis repository.

* Update EventSelectorConfig

Applied the cuts that we use currently in the Energy Reconstruction.

* Update HitCleanerConfig

Lowered the verbosity

* Update LoadWCSimConfig

Upped the verbosity

* Update LoadWCSimLAPPDConfig

Upped the verbosity

* Update TimeClusteringConfig

Lowered the verbosity

* Adding the PhaseIITreeMaker Tool

Adding a config file for the PhaseIITreeMaker Tool so we can use it in the Energy Reconstruction ToolChain.

* Rename PhaseIITreeMakerConfig.txt to PhaseIITreeMakerConfig

Removed the .txt from the file name

* Update ToolsConfig

Added a line for the PhaseIITreeMaker Tool

* Update DNNTrackLengthPredictConfig

Changed the path of ScalingVarsStore.bs according to the change I made in the Train_Test/DNNTrackLengthTrainConfig

* Update EventSelectorConfig

Applied the current cuts used in the Energy Reconstruction

* Update HitCleanerConfig

Lowered the verbosity

* Update LoadWCSimConfig

Upped the verbosity

* Update LoadWCSimLAPPDConfig

Upped the verbosity

* Update ToolsConfig

Added a line for the PhaseIITreeMaker Tool

* Adding PhaseIITreeMaker in /Predict

Adding a config file for PhaseIITreeMaker just like I did for the Train_Test ToolChain

* Rename PhaseIITreeMakerConfig.txt to PhaseIITreeMakerConfig

Removed the .txt from the file name

* Update PlotsTrackLengthAndEnergy.cpp

Added a histogram that plots the Energy Relative Deviation between E_true and E_reco

* Update PlotsTrackLengthAndEnergy.cpp

Added a missing line

* Updating PhaseIITreeMaker to include Digit info

Added lines of code to the .h and .cpp files to include the digitX, digitY, digitZ and digitT variables in the root ouput

* Update PhaseIITreeMaker.cpp

re-trigger workflow

---------

Co-authored-by: marc1uk <marc1uk_@hotmail.com>
…ool: (#267)

- Renamed load_from_file -> load_from_csv
- Introduced variable save_to_csv
- Updated documentation at beginning of RingCounting.py to reflect changes
- Updated README.md to reflect changes
- Updated UserTools/RingCounting/RingCountingConfig to reflect changes

Users using the RingCounting tool need to update their RingCountingConfig files following this change.
* Read Simple Reco info to PhaseIITreeMaker and add Simple Tank Track Length variable

* Updated Reweight Tool and added separate Reweight Flux Tool

* Updated reading in new ANNIE flux histograms

---------

Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
* Read Simple Reco info to PhaseIITreeMaker and add Simple Tank Track Length variable

* Updated Reweight Tool and added separate Reweight Flux Tool

* Added RingCounting variables to PhaseIITreeMaker

---------

Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
* Update Makefile

PythonScript lives /ToolAnalysis. It can't be edited, so 'make clean' break at that point.

* Update Makefile

rework solution to make it less specific. this version removes all files that can be removed, skipping those that aren't writable.

---------

Co-authored-by: marc1uk <marc1uk_@hotmail.com>
* Update BeamFetcherV2.cpp

- fixed a bug where not all timestamps were being saved to the output ROOT file
- clear beamdatamap after writing it to the root file. This increases the speed of the tool by ~2x
- change the beam triggerword from 5 to 14 (undelayed beam trigger). This doesn't really affect the entries we get (< 1% difference in total counts and total recorded POT), but Yue's new event building (coming soon) builds on 14, so trying to stay consistent with that

* Update BeamFetcherV2.cpp

Missed two small changes

* Update BeamFetcherV2.h
* Update ClusterFinderConfig

With the new timing offsets for data, cluster window can be reduced from 50ns to 40ns, as MC shows all reflected + scattered light resulting is captured within 40ns of the initial hit.

* Update ClusterFinderConfig

New PMT timing offsets reduced spread in hit times that were a result of unsubtracted TOF differences. The cluster window can be reduced from 50ns to 40ns; this narrower window still captures all light from the interaction according to the MC.
* Update ChannelSPEGains2023.csv

this channel does not have a gains measurement as its off/inactive. However, for some reason in very rare instances a hit is registered (not sure why this is the case). Set the gains to 0 in case a hit is registered, as to assign it 0 ADC value and not contribute any charge.

* Update TankPMTTimingOffsets.csv

Same as the gains, but assign a hit time offset of 0 (no measurement data on this channel from the laser calibration)
Add "pulse width" as a configuration variable in MC hits. It is traditionally 10ns in width, but this width is yet to be tuned to data.
If database entry for a particular device doesn't return any values, fill that device branch in the output root file with -9999 instead of leaving it empty. 

We use this tool in the BeamFetcherV2 toolchain to produce beam root files that are then used by the event building toolchain. The beam root files contain a branch for each device. Without this modification, as the BeamFetcherV2 toolchain loops over RAWData part files, grabs CTC timestamps and queries for DB values, if a device entry is empty the toolchain will fail to fill the entire device branch as the entries between branches will be unequal.
Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
…ct x,y,z conventions (#284)

Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
…produced it. (#285)

* A new tool that links vectors of MCHits to the particle that deposited the most energy to the cluster.

* Changing variables over to pointers

* Making this thing actually work. LoadWCSim outputs were not as expected...

* Some final adjustments and finally a README
Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
…d momentum transfer, bjorken x, elasticity y, and target nuclei (#280)

Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
…Gs and momentum, energy and momentum transfer, bjorken x, elasticity y, and target nuclei (#281)

Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
Expand file limit to allow tools like LoadANNIEEvent to loop over all part files of a run
* Update PhaseIIADCHitFinder.cpp

Assigned correct 50% interpolation time instead of max ADC time

* Update PhaseIIADCHitFinder.cpp

clean up verbose of the hit finding tool
* Add files via upload

New BeamQuality tool (from Andrew) to produce BeamStatuses from the BeamFetcherV2 that the EventBuilding can interface with

* Update Factory.cpp

* Update Unity.h

* Update BeamQuality.cpp

change beam trigger to 14 for the new event builder

---------

Co-authored-by: marc1uk <marc1uk_@hotmail.com>
* Delete configfiles/EventBuilder/BeamDecoderConfig

BeamFetcherV2 and BeamQuality tools replace BeamDecoder functionality

* Add files via upload

BeamFetcherV2 device list (currently set to read all of them)

* Update MRDDataDecoderConfig

drop verbose

* Update README.md

* Update ToolsConfig

* Add files via upload
* Add check for TriggerWord being set

* Set StopLoop to 1 when failed to get TriggerWord
* Update PMTDataDecoder.cpp

Add functionality for reading the RWM + BRF waveforms

* Update PMTDataDecoder.h

* Add files via upload

New Fit RWM+BRF tool that will find the rising edge of the auxiliary channel waveforms

* Create README.md

README for the new RWM fitting tool

* Update FitRWMWaveform.cpp

delete histograms to prevent potential memory leakage
* Update FindMrdTracks.cpp

Don't hault the toolchain if there are no MRD tracks

* Update TriggerDataDecoder.cpp

Triggers are stored to the buffer - clear it to speed up the tool. Also adding verbosity conditions on std out

* Update LoadRawDataConfig

Wrong config variables - now it should work out of the box as intended

* Update CreateMyList.sh

Rather than passing the path of the RAWData file to the bash script, add it hard coded. Not great practice but this script is used for a very specific purpose to generate a list file containing part files from the RAWData, and the data location has not changed in years (and likely won't change for now).

* Update FindMrdTracks.cpp

revert changes
* Added MuonFitter Tool

* Fixed minor bug for string delimination

---------

Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
Co-authored-by: marc1uk <marc1uk_@hotmail.com>
marc1uk and others added 20 commits September 19, 2025 06:01
remove unneeded #include "DummyTool.h" from main.cpp
* Update DeadPMTIDs_p2v7.txt

Add two PMTs to the deadlist based on observed occurrence of hits in data

* Update DeadPMTIDs_p2v7.txt

359 shows some activity for higher-energy events. We can remove it from the dead mask but more investigation is needed
* Added LAPPDWaveformDisplayTool

* Update ConfigGeo

it has been updated to the latest geometry file.

---------

Co-authored-by: Mustafa Kandemir <kandemir@anniegpvm01.fnal.gov>
* PMTWaveformSim tool

* Update LoadGeometry.h

add timing uncertainty map to .h

* Update README.md

Caution note for seeding

---------

Co-authored-by: brichards64 <benjamin.richards@warwick.ac.uk>
* Update BFV2
Add a memory clean for BeamDataQuery map, also clean the TimeToTriggerWordMapComplete from trigger data decoder.
Now we can run BFV2 for the whole run to avoid the entry lost issue at the beginning of processing

* Update for BFV2

Cleaning the BeamDataQuery doesn't change too much, removed
Usage: ./CreateMyList.sh RUN

will populate my_files.txt with all the raw part files from the run
Co-authored-by: James Minock <jminock@anniegpvm02.fnal.gov>
stupid security measures
* Adjusted logic to handle MC waveforms

From Andrew's changes, MC now has a waveform simulator that ClusterFinder handles as data-like hits. As a result we must adjust some of the logic used by downstream tools.

* Update README.md

* Update PhaseIITreeMaker.cpp

Add option to skip execution step in case PMTWaveform has no MCHits

* Update PhaseIITreeMaker.cpp

typo
…ry within configfiles (#360)

* update new makefile to support ToolChain folders embedded in a hierarchy (e.g. EnergyReco/Predict)

* make it more robust - need to specify hierarchy not just last folder name

* update readme

* actually fix it to support toolchain hierarchies for real this tiem

* Update Makefile

re-trigger CI as workflow needed updating

* correct default ToolChain and re-enable debug symbols

* re-add excludes, we do need them

---------

Co-authored-by: Marcus O'Flaherty <moflaher@fnal.gov>
The LAPPDHit and LAPPDPulse.h are for LAPPD so they are included in this PR

Co-authored-by: marc1uk <marc1uk_@hotmail.com>
* Update FullTankPMTGeometry.csv

Add offline / dead PMTs

* Update FullTankPMTGeometry.csv

* Dead channel flexibility in the data and MC

* Update README.md

Add info about ApplyDeadMask

* Update README.md

ApplyDeadMask info for TreeMaker

* Update ClusterFinder.cpp

Given the tool fetches from Detector.h, need to use "detectorstatus" rather than "channelstatus"

* Update PhaseIITreeMaker.cpp

Seems like the goto is illegal because goto skip_channel skips SPE_available’s initialization. Declare it first.

* Update PhaseIITreeMaker.cpp

forgot to change this to detectorstatus

* Extra whitespace at the end (row) leading to crash

* Update PhaseIITreeMaker.cpp

Final modification - remove hits from being included in the cluster tree
* Add EBPMT for PMT pairing in EventBuilding

* Modifications based on comments from PR#332:

1. I move the get and check of `RWMRawWaveforms` and `BRFRawWaveforms` to line 75 to 85.
2. I move the check and return to line 44-49.
3. The line 122 was still at 122, but only print after the `[]`
4. For line 125 and 137, I change the usage of `[]` to a int AlmostCompleteWaveforms_CountHere, initialized to be zero.
5. I would want to use that but may want to leave this to future optimization... since everything is working right now. (not perfectly because I do see zero PMT waveform from some timestamps, but they can be removed in later steps no matter where they are from)
6. Now at line 339 to 341, changed to emplace as you suggest.

* Fix a bug about NumWavesInCompleteSet.
Previously, if NumWavesInCompleteSet was set to 140 and there are only ~133 PMT waveforms exist in data, the AlmostCompleteWaveforms[PMTCounterTimeNs] won't be created. But the usage of AlmostCompleteWaveforms[PMTCounterTimeNs] in Log will create an entry there. This won't affect the later code because there are checks to require AlmostCompleteWaveforms[PMTCounterTimeNs] > 5.

Now the Log was removed and the tolerance for PMT number is changed to 10 at:
ChannelKey.size() >= (NumWavesInCompleteSet - 10)

* The correct file for previous commit

---------

Co-authored-by: marc1uk <marc1uk_@hotmail.com>
* Update README.md

Beef up Hit finding README (yay more documentation)

* Update PhaseIIADCHitFinder.cpp

Add entire ADC trace to the pulse class

* Update ADCPulse.cpp

Expand ADCpulse class to include entire trace

* Update ADCPulse.h

Extend ADCpulse class to include traces

* Update ADCPulse.h

bug fix and additional documentation for the newly added pulse features

* Update ADCPulse.cpp

more bug fixes to ADCpulse (should work now!)

* Update PhaseIIADCHitFinder.cpp

bug fix for storing traces

* Update ADCPulse.h

trying to make it as backwards compatible as possible
* Update Factory.cpp

Add PrintADCTraces to factory

* Update Unity.h

add to unity

* New PrintADCTraces tool

* PrintADCTraces working toolchain

* Update PrintADCTraces.cpp

- condensed some code
- added a name to the TGraph
- removed the double delete
* Adjust EventSelector logic to handle MC waveforms
Another downstream tool modification to adjust how the tool uses MC hits that are coming from the waveform generator.
* Update README.md
Added config variable that tells EventSelector to use MC waveform hits rather than the default MC hits.
* Update EventSelector.cpp
Added skip event for PMTWaveformSim
* Update EventSelector.cpp
Cleaned up logic
* Update EventSelector.cpp
- code condensed by merging data and MC logic together
- removed the event skipping check
* Remove skipping of events

Instead, we can fill one of the dead PMTs with a "minimal" waveform to pass to the hit finding tool

* Remove event skipping for hit finder tool

* Fix skip event

* Add files via upload

* Add files via upload

* Add files via upload

* Update PMTWaveformSim.cpp

forgot to set the channel ID to a dead PMT

* Update README.md

Quick disclaimer about the dummy channel
…368)

* Add CalcMinMaxAmp method to LAPPDTraceMax

Added CalcMinMaxAmp method to LAPPDTraceMax class.

* Implement CalcMinMaxAmp function for waveform analysis

Added a new function to calculate minimum and maximum amplitudes along with RMS, standard deviation, variance, and integral of the waveform.

* Add noise study variables and metadata timestamps

Added new variables for noise study and metadata timestamps also adding RMS, min and max waveform amplitudes fro dark room data

* Add new timestamp metadata and related branches

* Clean up LAPPDClusterTree.cpp formatting

Removed unnecessary closing brace and adjusted formatting.

* Fix missing newline at end of LAPPDClusterTree.cpp

* Improve ACDCmetadata handling and timestamp extraction

Added error handling for ACDCmetadata retrieval and refactored timestamp extraction from ACDC metadata.

* Add timestamps_meta to LAPPDClusterTree

* Add endl to OUT OF RANGE error messages

* Fix min/max assignments and removing double mean calculation

Refactor CalcMinMaxAmp function to correct min/max assignments and removing double mean calculation.

* Add meta_timestamp_int variable for timestamp handling
* Add BRF / beam jitter to the MC

Include additional jitter / uncertainty observed in the data to correctly model the BNB spill structure

* Update AssignBunchTimingMCConfig

* Update AssignBunchTimingMCConfig
S81D pushed a commit that referenced this pull request Feb 10, 2026
Add PMT type load from channel class to tree maker
marc1uk and others added 9 commits February 15, 2026 06:08
attempt to fix CI error... no information to go on so let's try...
switch CI hosting repo for docker-run-action as it currently needs update to a new API version.
Some events have parameter throws that make the xsec_total < 0. Add error handling to account for events where re-weighting failed. An example of what sometimes happens:

Executing tool LoadWCSim with MC entry 20, trigger 0
Analyse: GReWeightXSecMEC.cxx:500: double genie::rew::GReWeightXSecMEC::CalcWeightPNDelta(const genie::EventRecord&): Assertion `xsec_tot > 0.' failed.
Aborted (core dumped)

This causes the toolchain to crash at entry N, leading to a large loss in statistics. To remedy this we can use a recovery point where the weight will automatically be assigned as 1.0 if such a problematic value is sampled in multisim.
* Add EBTriggerGrouper tool for EBV2

* Update EBTriggerGrouper.cpp

remove leaked pointers

---------

Co-authored-by: Andy Mastbaum <amastbaum@gmail.com>
Co-authored-by: marc1uk <15327579+marc1uk@users.noreply.github.com>
* Cleanup and refactor LoadWCSim to facilitate later additions. Also, a fix to the PlotWaveforms Makefile to fix a build error

* Update LoadWCSim.cpp

minor comment changes just to trigger CI with updated workflow.

* Update LoadWCSim.cpp

another tweak to retrigger CI workflow with updated action

* Update LoadWCSim.cpp

yet another workflow attempt

* Removing couts

Removing some debugging couts and changing a last cout into a logmessage

---------

Co-authored-by: marc1uk <15327579+marc1uk@users.noreply.github.com>
trying to address intermittent error 100 from cleanup step presumably due to updates to some github runners
…noisy/dead/channels (#374)

MRD geometries that show dead paddles that should be masked out and noisy paddles labelled HOT for weights in MC and track building The columns are based of Steven Doran's changes to the pmt water tank geometry to do the same
* Update ClusterFinderConfig

Narrow cluster window - typical use is 5 hits in 50ns, not 5 hits in 100ns

* Update EventSelectorConfig

New timing offsets moved the PMTs "back" by an average of ~10ns. When looking for PMT/MRD coincidence, we this need to adjust this offset value.

* Update ClusterClassifiers.cpp

With new gains calibration we now have 121 active PMTs instead of 123. Adjust charge balance parameter to reflect the number of active PMTs that could capture light.

In the future, will alter this to read in the channel keys so that it automatically grabs the correct number of active PMTs.

* Update ClusterFinder.cpp

Fixed issues seen with ClusterFinder and the omission of charge for MC Hits:

- Change MC hit time away from 2ns discretization, as the new data hit times are float values.
- As a result, need to change for loop to not just grab integer hit times (old), but also grab float hit times. 
- MC Hits with times < 0 were being ignored due to a variable set to 0. Tool now keeps all hit times, even if they are negative due to time smearing.
- Reduce first-photon effect by modifying how hit timing is assigned for a "pulse"/digit. Followed what the tool DigitBuilder used: median photon hit time as the "pulse" time.

Also,
- In Data, mandate hits need to be > 0 (there is a weird spike at 0 in cluster times that are from this and are likely unphysical)


TODO: Potentially expand the MC "pulse" integration window from 10ns to something larger. Average charge per hit is lower and total number of hits slightly higher in MC than data, indicating the pulse window may be too narrow and is cutting what should be one pulse into two. Need to check with calibration to see what the average pulse window length is for ~SPE pulses.

* Update ClusterFinderConfig

Same as data - cluster window 50ns, looking for at least 5 hits

* Update ClusterFinderConfig

Dropped line pointing to an external WCSim channel key ID (not really an issue cause they are the same)

* Update DeadPMTIDs_p2v7.txt

Updated mask to omit additional PMT to reflect new gains data. (PMT 337, aka 6 here, no longer active in data)

* Update LoadWCSimConfig

Added a small description on where to find collaboration WCSim samples. Also cut down on commented lines

* Update LoadGenieEventConfig

Updated tool config to read in new collaboration samples. Added description to each variable per doc 5230-v2 (LoadGenieEvent Tutorial)

* Update PhaseIITreeMakerConfig

In prep for whenever we have tank reco available

* Update LoadGeometryConfig

new gains

* Update DeadPMTIDs_p2v7.txt

Updated new inactive PMT from the gains calibration

* Update LoadWCSimConfig

Updated config to include paths to latest collaboration samples

* Add files via upload

PMT timing offsets derived from Laser calibration data. These offsets should be considered precision software corrections on top of the previous firmware corrections at the ADC level to correct for the large cabling delays.

* Update LoadGeometry.h

Updated header file with PMT timing offsets

* Update LoadGeometryConfig

Path to PMT timing offset .csv file

* Update EventSelector.cpp

1. Updated default offset value (745) to 755 to account for new timing offsets of the PMTs.

2. In the new gains file, there are measurements for the 121 active PMTs. Two PMTs were deemed "inactive" and are no longer included. (Old file used to have 123 active PMTs). These PMTs were omitted as no data/hits were recorded on them during the source calibration. In principle there should only be hits in the active PMTs. However, even though there were no data/hits recorded in those tubes for the source calibration, for very energetic events occasionally one of the since "inactived" PMTs registers a hit for some reason and tries to access the map, which crashes this tool. Just added a condition that the channel must exist in the map in order to count that hit.

* Update LoadGeometry.cpp

Adjust LoadGeometry to include new PMT Timing offsets from .csv file, derived from the laser source calibration.

* Update PhaseIIADCHitFinder.cpp

- Grab new PMT timing offset values from .csv file to subtract from the hit times --> added this to all methods of hit finding

- Instead of grabbing the x tick with the maximum ADC value as the hit time (always binned to 2ns), assign float hit times based when the pulse crosses 50% of its maximum above threshold. Currently only implemented for the Pulse Finding Approach "Threshold" and Pulse Window Type "Dynamic" (the default, used configuration of the code). 

TODO: 
- Add this hit timing approach to all configurations of the code. 
- (Maybe) per Bob's recommendation, it might be better to instead assign the hit time using the following:
1. get the time at 50% between peak and threshold
2. get the time at 20% " " " "
3. Draw a straight line between these two points to extrapolate the time to zero threshold
This way it would lessen the effect of time shifts between large and small pulses.

* Update PhaseIIADCHitFinder.h

Added offset map to header

* Add files via upload

Old tool, new toolchain: output raw waveforms of PMT and aux channels from built, processed ANNIEEvents (that contain the raw waveforms). Useful to analyze PMT waveforms, as well as look at aux channel waveforms like the BoosterRWM and BoosterRF.

* Add files via upload

In case users want to eventbuild part files with raw waveforms (useful for source analysis), this toolchain complements the official event building toolchain that is used to create our processed data. Configurations for the tools to extract raw waveforms successfully from the PMTs are taken from Gian's AmBe analysis work. Currently, the event building for this toolchain has only been tested for Tank + CTC events.

* Add files via upload

Added README for event building toolchain, with reference to the ANNIE wiki page on how to properly event build.

* Update README.md

small syntax fix for EventBuilder README file

* Update ClusterFinder.cpp

Missed a bracket which caused the CI build error

* Update LoadWCSim.cpp

When using the "automatic" method for loading in GENIE files in the LoadGenieEvent, this was causing that tool to crash as it couldn't find the proper path based on the WCSim file name. Removed the to_string function

* Initial bug fix to prevent double counting and add hooks for eventbuilding. Also a default toolconfig for testing.

* Big commit time. New BeamQuality tool to produce BeamStatuses from the BeamFetcherV2 that ANNIEEventBuilder interfaces with. Minor changes to config files.

* Add new tools for LAPPD toolchain v1
Add LAPPDLoadStore, load the LAPPD PsecData from multiple store format
Add LAPPDStoreReorder
Add LAPPDPlots for plotting functions
Add LAPPDThresReco for a threshold based pulse finder and hit finder
Add LAPPDTreeMaker
Change some verbosity related print in TriggerDataDecoder

* Add LAPPD_EB tool chain for generating timestamp tree.
Add LAPPDRaw tool for generating lappd analysis tree

* Fixing a bug wherein not all timestamps were being saved to the ROOT file correctly

* New event builder

Added tools:
EBLoadRaw : Load RawData
EBTriggerGrouper : group trigger for event building
EBPMT : Load PMT hits, build with the grouped triggers
EBMRD : Load MRD events, build with the grouped triggers
EBLAPPD : Load LAPPD info, build with the grouped triggers
EBSaver : use the pairing information, save the build events to boost
store
Modified tools:
PhaseIITreeMaker: include loading LAPPD timing information, and grouped
triggers
Added file:
offsetFit_MultipleLAPPD.cpp : use for LAPPD offset fitting

Added tool chains:
EventBuildingV2 : new event building tool chain
LAPPD_EB: generate LAPPD timing information with trigger information,
used for LAPPD offset fit

 On branch Application
 Your branch is up to date with 'origin/Application'.

 Changes to be committed:
	new file:   UserTools/EBLAPPD/EBLAPPD.cpp
	new file:   UserTools/EBLAPPD/EBLAPPD.h
	new file:   UserTools/EBLAPPD/README.md
	new file:   UserTools/EBLoadRaw/EBLoadRaw.cpp
	new file:   UserTools/EBLoadRaw/EBLoadRaw.h
	new file:   UserTools/EBLoadRaw/README.md
	new file:   UserTools/EBMRD/EBMRD.cpp
	new file:   UserTools/EBMRD/EBMRD.h
	new file:   UserTools/EBMRD/README.md
	new file:   UserTools/EBPMT/EBPMT.cpp
	new file:   UserTools/EBPMT/EBPMT.h
	new file:   UserTools/EBPMT/README.md
	new file:   UserTools/EBSaver/EBSaver.cpp
	new file:   UserTools/EBSaver/EBSaver.h
	new file:   UserTools/EBSaver/README.md
	new file:   UserTools/EBTriggerGrouper/EBTriggerGrouper.cpp
	new file:   UserTools/EBTriggerGrouper/EBTriggerGrouper.h
	new file:   UserTools/EBTriggerGrouper/README.md
	modified:   UserTools/Factory/Factory.cpp
	modified:   UserTools/PhaseIITreeMaker/PhaseIITreeMaker.cpp
	modified:   UserTools/PhaseIITreeMaker/PhaseIITreeMaker.h
	modified:   UserTools/Unity.h
	modified:   configfiles/BeamClusterAnalysis/PhaseIITreeMakerConfig
	new file:   configfiles/EventBuilderV2/DefaultTriggerMask.txt
	new file:   configfiles/EventBuilderV2/EBLAPPDConfig
	new file:   configfiles/EventBuilderV2/EBLoadRawConfig
	new file:   configfiles/EventBuilderV2/EBMRDConfig
	new file:   configfiles/EventBuilderV2/EBPMTConfig
	new file:   configfiles/EventBuilderV2/EBSaverConfig
	new file:   configfiles/EventBuilderV2/EBTriggerGrouperConfig
	new file:   configfiles/EventBuilderV2/LAPPDLoadStoreConfig
	new file:   configfiles/EventBuilderV2/MRDDataDecoderConfig
	new file:   configfiles/EventBuilderV2/PMTDataDecoderConfig
	new file:   configfiles/EventBuilderV2/PhaseIIADCCalibratorConfig
	new file:   configfiles/EventBuilderV2/PhaseIIADCHitFinderConfig
	new file:   configfiles/EventBuilderV2/ToolChainConfig
	new file:   configfiles/EventBuilderV2/ToolsConfig
	new file:   configfiles/EventBuilderV2/TriggerDataDecoderConfig
	new file:   configfiles/EventBuilderV2/list.txt
	modified:   configfiles/LAPPDRaw/Configs
	modified:   configfiles/LAPPDRaw/list.txt
	modified:   configfiles/LAPPD_EB/list.txt
	new file:   offsetFit_MultipleLAPPD.cpp

* Changes to be committed:
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   configfiles/LoadGeometry/ChannelSPEGains2023.csv

* Add more pairing oprion to EBLAPPD, EBMRD, add muni trigger to
EBTriggerGrouper

 Changes to be committed:
	modified:   UserTools/ClusterFinder/ClusterFinder.cpp
	modified:   UserTools/EBLAPPD/EBLAPPD.cpp
	modified:   UserTools/EBMRD/EBMRD.cpp
	modified:   UserTools/EBTriggerGrouper/EBTriggerGrouper.cpp
	modified:   UserTools/EBTriggerGrouper/EBTriggerGrouper.h
	modified:   UserTools/TriggerDataDecoder/TriggerDataDecoder.cpp
	modified:   configfiles/BeamClusterAnalysis/ClusterClassifiersConfig
	modified:   configfiles/BeamClusterAnalysis/ClusterFinderConfig
	new file:   configfiles/BeamClusterAnalysis/ClusterFinderConfig_default
	modified:   configfiles/BeamClusterAnalysis/EventSelectorConfig
	modified:   configfiles/BeamClusterAnalysis/PhaseIITreeMakerConfig
	modified:   configfiles/BeamClusterAnalysis/my_inputs.txt
	modified:   configfiles/EventBuilder/ANNIEEventBuilderConfig
	modified:   configfiles/EventBuilder/LoadRawDataConfig
	modified:   configfiles/EventBuilder/MRDDataDecoderConfig
	modified:   configfiles/EventBuilder/my_files.txt

* Changes to be committed:
	modified:   UserTools/EventSelector/EventSelector.cpp

* add waveform print function to LAPPDPlots
add LAPPDProcessedAna tool chain, to use new LAPPD tools to load
processed data

 Changes to be committed:
	modified:   UserTools/LAPPDPlots/LAPPDPlots.cpp
	modified:   UserTools/LAPPDPlots/LAPPDPlots.h
	modified:   configfiles/EventBuilderV2/EBPMTConfig
	modified:   configfiles/EventBuilderV2/EBTriggerGrouperConfig
	modified:   configfiles/EventBuilderV2/list.txt
	new file:   configfiles/LAPPDProcessedAna/ConfigGeo
	new file:   configfiles/LAPPDProcessedAna/ConfigPlot
	new file:   configfiles/LAPPDProcessedAna/ConfigPreProcess
	new file:   configfiles/LAPPDProcessedAna/ConfigStoreReadIn
	new file:   configfiles/LAPPDProcessedAna/Configs
	new file:   configfiles/LAPPDProcessedAna/FindMrdTracksConfig
	new file:   configfiles/LAPPDProcessedAna/LoadANNIEEventConfig
	new file:   configfiles/LAPPDProcessedAna/TimeClusteringConfig
	new file:   configfiles/LAPPDProcessedAna/ToolChainConfig
	new file:   configfiles/LAPPDProcessedAna/ToolsConfig
	new file:   configfiles/LAPPDProcessedAna/list.txt

* add pot and beam_ok loading to phase II tree maker
add beam profile loading to EBSaver

 Changes to be committed:
	new file:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	new file:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h
	new file:   UserTools/ANNIEEventTreeMaker/README.md
	modified:   UserTools/EBLoadRaw/EBLoadRaw.cpp
	modified:   UserTools/EBSaver/EBSaver.cpp
	modified:   UserTools/EBSaver/EBSaver.h
	modified:   UserTools/Factory/Factory.cpp
	modified:   UserTools/PhaseIITreeMaker/PhaseIITreeMaker.cpp
	modified:   UserTools/PhaseIITreeMaker/PhaseIITreeMaker.h
	modified:   UserTools/Unity.h
	modified:   configfiles/EventBuilderV2/EBPMTConfig
	modified:   configfiles/EventBuilderV2/EBSaverConfig
	modified:   configfiles/EventBuilderV2/EBTriggerGrouperConfig
	modified:   configfiles/EventBuilderV2/list.txt

* debug of beam info loading in EBSaver
load in PhaseIITriggerTree

 Changes to be committed:
	modified:   UserTools/EBSaver/EBSaver.cpp
	modified:   UserTools/PhaseIITreeMaker/PhaseIITreeMaker.cpp

* update LAPPDLoadStore for loading from multiple lappds map
update LAPPDProcessedAna tool chain for processing built mutiple LAPPD data
update the lappd offset fit script for empty PPS problem
fix bug in EBSaver

 Changes to be committed:
	modified:   UserTools/EBSaver/EBSaver.cpp
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.h
	modified:   UserTools/LoadANNIEEvent/LoadANNIEEvent.cpp
	modified:   configfiles/LAPPDProcessedAna/Configs
	modified:   configfiles/LAPPDProcessedAna/LoadANNIEEventConfig
	modified:   configfiles/LAPPDProcessedAna/list.txt
	modified:   offsetFit_MultipleLAPPD.cpp

* Update BeamFetcherV2.cpp

1. Clear beamdatamap after writing to root file. This increases the speed of the toolchain by ~2x
2. Change trigword from 5 to 14. This doesn't have a huge effect but Yue's new event building toolchain constructs events with 14 as the "base" to pair timestamps as its the beam trigger from the BNB

* Update TriggerDataDecoderConfig

Adding a trigger mask for this toolchain

* Create DefaultTriggerMask.txt

TriggerDataDecoder will only load trigword 14 from the RawData (undelayed beam trigger)

* add LAPPDProcessedFilter tool chain for event building V2 output

modify verbosity of EventBuilderV2 tool chain, reduce the size of output
and debug log

add and modify LAPPDProcessedAna tool chain for multiple LAPPD loading,
some time the LAPPD ID is not exactly followed by the LAPPD board ID.
For example, ususaly LAPPD ID = 2 means the it's board ID has 4 and 5,
but this is not true. The LAPPDLoadStore was changed to load LAPPD data
based on it's ID to channel, rather than using board ID.

other LAPPD tools are also changed.

 Changes to be committed:
	modified:   UserTools/EBSaver/EBSaver.cpp
	modified:   UserTools/Factory/Factory.cpp
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.h
	modified:   UserTools/LAPPDPlots/LAPPDPlots.cpp
	modified:   UserTools/LAPPDPlots/LAPPDPlots.h
	modified:   UserTools/LAPPDStoreReorder/LAPPDStoreReorder.cpp
	modified:   UserTools/LAPPDStoreReorder/LAPPDStoreReorder.h
	modified:   UserTools/LAPPDThresReco/LAPPDThresReco.cpp
	modified:   UserTools/LAPPDThresReco/LAPPDThresReco.h
	modified:   UserTools/LAPPDTimeAlignment/LAPPDTimeAlignment.cpp
	modified:   UserTools/LAPPDTimeAlignment/LAPPDTimeAlignment.h
	modified:   UserTools/LAPPDTreeMaker/LAPPDTreeMaker.cpp
	modified:   UserTools/LAPPDTreeMaker/LAPPDTreeMaker.h
	modified:   UserTools/LoadANNIEEvent/LoadANNIEEvent.cpp
	modified:   UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.cpp
	modified:   UserTools/PhaseIITreeMaker/PhaseIITreeMaker.cpp
	new file:   UserTools/ProcessedLAPPDFilter/ProcessedLAPPDFilter.cpp
	new file:   UserTools/ProcessedLAPPDFilter/ProcessedLAPPDFilter.h
	new file:   UserTools/ProcessedLAPPDFilter/README.md
	modified:   UserTools/Unity.h
	modified:   configfiles/EventBuilderV2/EBLAPPDConfig
	modified:   configfiles/EventBuilderV2/EBLoadRawConfig
	modified:   configfiles/EventBuilderV2/EBMRDConfig
	modified:   configfiles/EventBuilderV2/EBPMTConfig
	modified:   configfiles/EventBuilderV2/EBSaverConfig
	modified:   configfiles/EventBuilderV2/EBTriggerGrouperConfig
	modified:   configfiles/EventBuilderV2/list.txt
	modified:   configfiles/LAPPDProcessedAna/ConfigPlot
	modified:   configfiles/LAPPDProcessedAna/ConfigPreProcess
	modified:   configfiles/LAPPDProcessedAna/ConfigStoreReadIn
	modified:   configfiles/LAPPDProcessedAna/Configs
	modified:   configfiles/LAPPDProcessedAna/LoadANNIEEventConfig
	new file:   configfiles/LAPPDProcessedAna/ProcessedLAPPDFilterConfig
	modified:   configfiles/LAPPDProcessedAna/ToolChainConfig
	modified:   configfiles/LAPPDProcessedAna/ToolsConfig
	new file:   configfiles/LAPPDProcessedAna/knownlist
	modified:   configfiles/LAPPDProcessedAna/list.txt
	new file:   configfiles/LAPPDProcessedFilter/ClusterClassifiersConfig
	new file:   configfiles/LAPPDProcessedFilter/ClusterFinderConfig
	new file:   configfiles/LAPPDProcessedFilter/ConfigGeo
	new file:   configfiles/LAPPDProcessedFilter/EventSelectorConfig
	new file:   configfiles/LAPPDProcessedFilter/FindMrdTracksConfig
	new file:   configfiles/LAPPDProcessedFilter/LoadANNIEEventConfig
	new file:   configfiles/LAPPDProcessedFilter/ProcessedLAPPDFilterConfig
	new file:   configfiles/LAPPDProcessedFilter/TimeClusteringConfig
	new file:   configfiles/LAPPDProcessedFilter/ToolChainConfig
	new file:   configfiles/LAPPDProcessedFilter/ToolsConfig
	new file:   configfiles/LAPPDProcessedFilter/list.txt

* Modify the BeamFetcherV2, add default value for necessery devices in
event builder
add modifications for building laser events in EBLAPPD
add modifications for LAPPDProcessedAna tool chain

* Debug for LAPPDPlots, adjust the board ID - LAPPD ID - channel number mapping
update print out for LAPPD data filter
update LAPPDProcessedAna toolchain config

 Changes to be committed:
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   UserTools/LAPPDPlots/LAPPDPlots.cpp
	modified:   UserTools/ProcessedLAPPDFilter/ProcessedLAPPDFilter.cpp
	modified:   UserTools/ProcessedLAPPDFilter/ProcessedLAPPDFilter.h
	modified:   configfiles/LAPPDProcessedAna/ConfigPlot
	modified:   configfiles/LAPPDProcessedAna/Configs
	modified:   configfiles/LAPPDProcessedAna/ToolChainConfig
	modified:   configfiles/LAPPDProcessedFilter/LoadANNIEEventConfig
	modified:   configfiles/LAPPDProcessedFilter/list.txt

* Update EventSelector.cpp

Removed the charge threshold (> 200 pe) needed to consider tank/MRD coincidence. Given the README states "PMTMRDCoincCut: Flags events that do not have a certain time offset between PMT & MRD cluster" this should include all PMT clusters, and not just some that are over a certain charge threshold. This change in reality likely won't change much, as most muon tracks in the MRD deposit enough light to leave more than 200 pe worth of charge, but per our Slack convo it's probably best to just remove this condition as its not obvious.

* Update IFBeamDBInterfaceV2.cpp

When the tool fetches information and writes to the TTree, if a device was empty/didn't return any values from the database, the entire branch will not be written to the root file to ensure the number of entries is the same between all branches. If there are no entries for a fetched device, fill the "blank" entries with -9999.

* Update IFBeamDBInterfaceV2.h

* Update ToolsConfig

Correct path to LoadGeometry file with PMT Timing offsets

* Update ConfigGeo

Use this geometry file instead - needed to add PMT offsets

* Update ToolsConfig

revert change

* Update LoadRawDataConfig

Changed .txt file list to be consistent with the EventBuilder toolchain

* Rename list.txt to my_files.txt

Consistency with eventbuilder

* Update for board index in LAPPDTimeAlignment and tree maker
update configs files in LAPPDProcessedAna, now normal run without
print out

 Changes to be committed:
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   UserTools/LAPPDPlots/LAPPDPlots.cpp
	modified:   UserTools/LAPPDTimeAlignment/LAPPDTimeAlignment.cpp
	modified:   UserTools/LAPPDTreeMaker/LAPPDTreeMaker.cpp
	modified:   UserTools/LAPPDTreeMaker/LAPPDTreeMaker.h
	modified:   configfiles/LAPPDProcessedAna/ConfigPlot
	modified:   configfiles/LAPPDProcessedAna/Configs
	modified:   configfiles/LAPPDProcessedAna/ToolChainConfig
	modified:   configfiles/LAPPDProcessedAna/list.txt

* Update IFBeamDBInterfaceV2.cpp

Accidentally included the same verbose statement twice

* Rename list.txt to my_files.txt

consistency for grid submissions (same .txt file)

* Add LAPPD pulse and hit information to PhaseeIITreeMaker

Add LAPPD tools to BeamClusterAnalysis tool chain

 Changes to be committed:
	modified:   UserTools/BeamFetcherV2/IFBeamDBInterfaceV2.cpp
	modified:   UserTools/PhaseIITreeMaker/PhaseIITreeMaker.cpp
	modified:   UserTools/PhaseIITreeMaker/PhaseIITreeMaker.h
	modified:   configfiles/BeamClusterAnalysis/LoadANNIEEventConfig
	modified:   configfiles/BeamClusterAnalysis/PhaseIITreeMakerConfig
	modified:   configfiles/BeamClusterAnalysis/ToolsConfig
	modified:   configfiles/BeamClusterAnalysis/my_inputs.txt

* Fix a bug in trigger data decoder about the verbosity
 Changes to be committed:
	modified:   UserTools/TriggerDataDecoder/TriggerDataDecoder.cpp

* Update TriggerDataDecoder.cpp

Verbosity was accidentally a condition on pausing the decoding - this caused the toolchain to dramatically slow down if verbose = 0

* fix bug again

 Changes to be committed:
	modified:   UserTools/TriggerDataDecoder/TriggerDataDecoder.cpp

* Update EBLoadRawConfig

* Update EBSaverConfig

Changed to reflect the output file created from the BeamFetcherV2 tool

* Update CreateMyList.sh

added hard coded raw data path so that users can simply supply the run number and it will find the part files

* debug for LAPPDLoad Raw and Plot after adding LoadMap functions

 Changes to be committed:
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   UserTools/LAPPDPlots/LAPPDPlots.cpp
	modified:   UserTools/LAPPDStoreReorder/LAPPDStoreReorder.cpp
	modified:   UserTools/LAPPDTimeAlignment/LAPPDTimeAlignment.cpp
	modified:   configfiles/EventBuilderV2/EBLoadRawConfig
	modified:   configfiles/EventBuilderV2/EBTriggerGrouperConfig
	modified:   configfiles/EventBuilderV2/TriggerDataDecoderConfig
	modified:   configfiles/EventBuilderV2/my_files.txt
	modified:   configfiles/LAPPDProcessedAna/ConfigPlot
	modified:   configfiles/LAPPDProcessedAna/ToolChainConfig
	modified:   configfiles/LAPPDProcessedAna/ToolsConfig
	modified:   configfiles/LAPPDRaw/ConfigPlot
	modified:   configfiles/LAPPDRaw/ConfigStoreReadIn
	modified:   configfiles/LAPPDRaw/ToolsConfig
	modified:   configfiles/LAPPDRaw/list.txt
	modified:   configfiles/LoadGeometry/LAPPDGeometry.csv

* Update LAPPDLoadStore.cpp

This verbose for loading progress assumed there are more than 10 LAPPD events; if there are less it would lead to a floating point exception

* Update ToolsConfig

Add SaveConfig Tool to save the configuration files to the ProcessedData

* Add files via upload

Add SaveConfigInfo configuration file
- FullDepth = 0 set to just save the configuration files and not all the .csv or other files that are linked. When = 1 was set, it was grabbing non-human readable text from I think root files.

* Add ANNIEEventTreeMaker, save all information of ANNIEEvent to one root
tree. Add it to BeamClusterAnalysis tool chain
Add PMT cluster only filter option to ProcessedLAPPDFilter

 Changes to be committed:
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   UserTools/ProcessedLAPPDFilter/ProcessedLAPPDFilter.cpp
	modified:   UserTools/ProcessedLAPPDFilter/ProcessedLAPPDFilter.h
	new file:   configfiles/BeamClusterAnalysis/ANNIEEventTreeMakerConfig
	modified:   configfiles/BeamClusterAnalysis/ToolsConfig
	modified:   configfiles/LAPPDProcessedFilter/ProcessedLAPPDFilterConfig
	modified:   configfiles/LAPPDProcessedFilter/ToolsConfig
	modified:   configfiles/PreProcessTrigOverlap/CreateMyList.sh

* If readed board == 0 or raw data size == 0, skip the loading in
LAPPDLoadStore, or there will be a seg fault

 Changes to be committed:
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp

* Changes to be committed:
	modified:   DataModel/LAPPDHit.h
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h
	modified:   UserTools/LAPPDThresReco/LAPPDThresReco.cpp

* Fix a small bug in LAPPDLoadStore. When there is no data in Raw_buffer,
the tool was supposed to skip, but shouldn't return. Using return will
cause the executing speed to be extreamly slow.

 Changes to be committed:
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp

* add functions about LAPPD PPS information to EventBuilder
add tools to get information of RWM and BRF
add RWM, BRF, LAPPD PPS information to TreeMaker

* add LAPPD offset Fit script modifications

* add pulse information in LAPPDHit, save the pulse information for hits
in the Tree Maker

 Changes to be committed:
	modified:   DataModel/LAPPDHit.h
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp

* Remove the pulse info printing in the tree maker

* Changes to be committed:
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   configfiles/BeamClusterAnalysis/ToolsConfig

* Add an option to not load PPS infor in the LAPPDLoadStore and tree make
for preprocessed data without PPS
 Changes to be committed:
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.h
	modified:   configfiles/BeamClusterAnalysis/ANNIEEventTreeMakerConfig
	modified:   configfiles/LAPPDProcessedAna/Configs

* Changes to be committed:
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/EBSaver/EBSaver.cpp
	modified:   UserTools/FindMrdTracks/FindMrdTracks.cpp
	modified:   configfiles/LAPPDProcessedFilter/ProcessedLAPPDFilterConfig

* Add LAPPD pulse half height timing and half end timing to tree
Add LAPPD beamgate stop tick in 40 MHz clock information to tree
Fixed a bug in LAPPDLoadStore. This bug will cause discrepancy between
loading data that all have LAPPD info and data that only part have LAPPD
info. It will refresh the ANNIEEvent booststore.

 Changes to be committed:
	modified:   DataModel/LAPPDPulse.h
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.h
	modified:   UserTools/LAPPDStoreReorder/LAPPDStoreReorder.cpp
	modified:   UserTools/LAPPDThresReco/LAPPDThresReco.cpp
	modified:   UserTools/LoadANNIEEvent/LoadANNIEEvent.cpp
	modified:   configfiles/BeamClusterAnalysis/ToolsConfig
	modified:   configfiles/LAPPDProcessedAna/ConfigStoreReadIn
	modified:   configfiles/LAPPDProcessedAna/Configs

* Update ClusterFinderConfig

Adjusted clustering --> min 10 hits in 40ns

* Update ANNIEEventTreeMakerConfig

added .ntuple extension

* Create config.py

python script that will generate the ANNIEEventTreeMaker config file on the grid

* Update CreateMyList.sh

* Fix a bug in threshold reco for pulse time finding, now it's find correct
start and end and won't give error

Fix a bug in the filter for if the AuxHit was empty

Add 0 as default offset value for PMT 416, which is considered as dead
but may give data some time

 Changes to be committed:
	modified:   UserTools/LAPPDThresReco/LAPPDThresReco.cpp
	modified:   UserTools/ProcessedLAPPDFilter/ProcessedLAPPDFilter.cpp
	modified:   configfiles/LoadGeometry/TankPMTTimingOffsets.csv

* Update config.py

* For beam data ~2022 and 2023 with LAPPD 40, some time the data waveform
is empty but the error code is 0, so the LAPPDLoadStore won't exit and
will give error. Fixed.

Add pulse charge analysis for tree maker, fix the name in root tree

 Changes to be committed:
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp

* Update ClusterFinderConfig

* Update Configs

Change Pedestal path

* Add modifications to include the LAPPD40 us level drift. The drift was
calculated in the offsetFit script and loaded in the LAPPDLoadStore as a
part of the offset

 Changes to be committed:
	modified:   UserTools/LAPPDLoadStore/LAPPDLoadStore.cpp
	modified:   offsetFit_MultipleLAPPD.cpp

* Add LAPPDLoadTXT to load ASCII data with other LAPPD Tools.
Add LAPPDASCIIAna for ASCII analysis with new tools. Most of the config
files were copied from LAPPDProcessedAna

 Changes to be committed:
	modified:   UserTools/Factory/Factory.cpp
	new file:   UserTools/LAPPDLoadTXT/LAPPDLoadTXT.cpp
	new file:   UserTools/LAPPDLoadTXT/LAPPDLoadTXT.h
	new file:   UserTools/LAPPDLoadTXT/README.md
	modified:   UserTools/LAPPDPlots/LAPPDPlots.cpp
	modified:   UserTools/Unity.h
	new file:   configfiles/LAPPDASCIIAna/ConfigGeo
	new file:   configfiles/LAPPDASCIIAna/ConfigPlot
	new file:   configfiles/LAPPDASCIIAna/ConfigPreProcess
	new file:   configfiles/LAPPDASCIIAna/ConfigStoreReadIn
	new file:   configfiles/LAPPDASCIIAna/ConfigTXT
	new file:   configfiles/LAPPDASCIIAna/Configs
	new file:   configfiles/LAPPDASCIIAna/FindMrdTracksConfig
	new file:   configfiles/LAPPDASCIIAna/LoadANNIEEventConfig
	new file:   configfiles/LAPPDASCIIAna/ProcessedLAPPDFilterConfig
	new file:   configfiles/LAPPDASCIIAna/TimeClusteringConfig
	new file:   configfiles/LAPPDASCIIAna/ToolChainConfig
	new file:   configfiles/LAPPDASCIIAna/ToolsConfig
	new file:   configfiles/LAPPDASCIIAna/knownlist

* Changes to be committed:
	deleted:    configfiles/LAPPDASCIIAna/knownlist

* Add branches about information for hits in clusters, and some MRD hit
informations

 Changes to be committed:
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h

* Add a stop for LAPPDLoadTXT, when reach the end of the txt file tool
chain will stop

 Changes to be committed:
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/LAPPDLoadTXT/LAPPDLoadTXT.cpp
	modified:   configfiles/LAPPDProcessedAna/Configs

* modified the ASCIIAna configs

* correct some config files

 Changes to be committed:
	modified:   configfiles/LAPPDASCIIAna/ConfigPlot
	modified:   configfiles/LAPPDASCIIAna/ConfigTXT
	modified:   configfiles/LAPPDProcessedAna/ConfigPlot

* Fix a bug in the event builder. In the previous version, the EBPMT will
do matching per 500 loops, and the force matching doesn't work at the
end of each part file. Now there is a flag shows if the PMT was
completely loaded in EBLoadRaw, and EBPMT will do matching if that
flag was found.
Also, some configs was changed, a new tool chain for LAPPD151 analysis
was added.

* Don't use mask file, save all triggers

 Changes to be committed:
	modified:   configfiles/PreProcessTrigOverlap/TriggerDataDecoderConfig

* Update PhaseIIADCHitFinder.cpp

dumb fix

* Add LAPPD waveform to ANNIEEventTreeMaker
Force matching of MRD and LAPPD ad the end of a part file for AmBe runs
Update the trigger grouping

* Modify ANNIEEventTreeMaker for MC file. Change the configs in the
BeamClusterAnalysisMC for using ANNIEEventTreeMaker

* Add verbosity for print out when load genie samples

* force matching for MRD, PMT, LAPPD correctly by adding force matched
bool to EBLoadRaw. The matching should only happen once when the loading
of that data flow reach to the end in that part file.
change verbosities in BCA-MC

* Add debug information in EBLAPPD
Correctly stop the ForceMatching for EBMRD and EBLAPPD
change the configs in EBMRD and TriggerGrouper
There are more triggers from MRD so more CTC entries, so I reduce the trigger grouper buffer
from 30k to 20k to reduce the looping time. The grouper buffer is only
for debugging unmatched triggers.

* Add MRD trigger type to the root tree because there are more MRD Cosmic
triggers now. This will help to avoid mismatching

 Changes to be committed:
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp
	modified:   UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h

* Update ToolsConfig

add SaveConfig tool

* Update TriggerDataDecoderConfig

this shouldnt make a difference but the traditional tools had this variable as 0, and set it as 1 in the LoadRawData tool

* EventBuilderV2 toolchains for sources

modified some config files, but added different toolchains for each source type.

* ANNIEEventTreeMaker Config file creation scripts

Adjusted the python scripts that generate the Config file to include run type, avoiding the need to have separate toolchains for different run types

* Update EBSaver.h

Marvin has recommended to initialize this to 0 to remedy the inconsistent printed total number of events we sometimes see, depending if you do `make` or `make -jn`.

* Config script creator update

Added an additional step to generate the ToolsConfig, which will help in running the toolchain over different run types

* Update config.py

forgot new line

* Update configLAPPD.py

* Add debug info to print channel keys, leave them commented for possible
debug purpose
Add event index for LAPPDLoadStore to correctly load event offsets. If
there are multiple LAPPDs in one part file but the frequency of
triggering is very different, previous indexing will give unexpected bug

* Add EBMRD for EventBuildingV2 tool chain

* Add EBLAPPD tool in EBV2 tool chain

* Add EBSaver for EBV2 tool chain

* Add verbosity check for some cout print out

* Add EBLoadRaw for EBV2 tool chain

* Add ANNIEEventTreeMaker as the part 2 of EBV2, replace PhaseIITreeMaker
This is before updates from comments on #307 PR

* Add LAPPDTreeMaker, this is a part of LAPPD tool chains but also needed by EBV2 work flow

* Add changes from Steven's latest change for Event building about hits from local code at /exp/annie/app/users/doran/EB_BC_TA

Changes list at https://docs.google.com/spreadsheets/d/13OXWEUbxF2vjMa6SKUKhL2rhXHUsshZY1PF4VnS7pnA/edit?gid=88985152#gid=88985152

* Increase the limit about loading files in a tool chain

* Fix a bug about NumWavesInCompleteSet in EBPMT

Previously, if NumWavesInCompleteSet was set to 140 and there are only ~133 PMT waveforms exist in data, the AlmostCompleteWaveforms[PMTCounterTimeNs] won't be created. But the usage of AlmostCompleteWaveforms[PMTCounterTimeNs] in Log will create an entry there. This won't affect the later code because there are checks to require AlmostCompleteWaveforms[PMTCounterTimeNs] > 5.

Now the Log was removed and the tolerance for PMT number is changed to 10 at:
ChannelKey.size() >= (NumWavesInCompleteSet - 10)

Also change the pedestal subtraction for LAPPD_EB tool chain to be 0.

* Add device for bunch rotation information in IFBeamDBInterfaceV2

* Add saving bunch rotation device information to EBSaver

* Add bunch rotation device information saving to ANNIEEventTreeMaker

* Add ADC traces to ADCPulse, to be stored in RecoADCHits

* Remove whatever that settings.json was lol

* Bugfix to ADCPulse

* remove VSCode settings file and ignore it in future

* Bugfix (again) to ADCPulse

* Bugfix (again, again) to ADCPulse

* Bugfix (again, again, AGAIN) to ADCPulse (and HitFinder)

* Tried to make it as backwards compatible as possible... also modified PrintANNIEEvent to read the pulses

* Add B:BRRMP also for bunch rotation, which is "Bunch Rotation 473 Curve
(Volt)"

* Add a bunch rotation on/off flag

* Update ANNIEEventTreeMaker.cpp

Forgot a semicolon :)

* Update EBSaverConfig - no beam in laser

remove beam info for laser runs, missed bug fix

* Update EBLoadRawConfig

wrong path

* Fix a bug for saving the bunch rotation with /D rather than /I in tree

* Add a comment for bunch rotation document in EBSaver.
Add new bunch rotation variables for Filter

* Add PMT type load from channel class to tree maker

* New PrintADCTraces tool to export pulses to root file

* Add README to PrintADCTraces toolchain

* Final modifications for PrintADCTraces

* EventBuilderV2_LED toolchain

* Edit LAPPD filter config for beam cluster jobs

* Add LAPPD follow charge variables

For pulse found in LAPPDThresReco, integral a few bins after the end of
the pulse as a follow charge, to show possible affect from SANDI +
crosstalk

* Update EBTriggerGrouperConfig

Bug fix for LED part 1

* Add ring counting function for BC tool chain and BC-MC tool chain

Put the model into RingCounting config folder, from /exp/annie/app/users/dschmid/RingCountingStore/models/
Modify configs for BeamClusterAnalysis and BeamClusterAnalysisMC
Add branches in ANNIEEventTreeMaker
Commented the verbose display in RingCounting.py
Also set verbose for cout in DigitBuilder.cpp when loading data

* Update configLAPPD.py

filename changed for LAPPD BC - .lappd.root tells the merger scripts NOT to merge the LAPPD files with the normal BC files once the jobs are complete

* Change configs for LAPPDThresReco

    Using 10mV for pulse finding threshold. 10mV is still ~2PE for LAPPD 40,
    way higher than noise level (sigma~2mV) and other non-signal response.
    Also it will give many more pulses. Backgrounds still can be filtered
    out by using other variables

* Update BFV2

Add a memory clean for BeamDataQuery map, also clean the TimeToTriggerWordMapComplete from trigger data decoder.
Now we can run BFV2 for the whole run to avoid the entry lost issue at the beginning of processing

* Update BFV2

Cleaning BeamDataQuery doesn't change too much, removed

* Modify config creators for BC

* Add creation script to populate list file

* restore LoadWCSim.cpp from #372

* Increase THCURR upper limit to 178

Updated the upper limit for THCURR from 176 to 178 to accommodate earlier runs before the 2022 summer shutdown.

* Add conversion from ACCID to Incom ID for runs before 5887, Also add new
BRF channel in PMTDataDecoder

The new Incom ID is saved in the PsecData during data taken, and this
happends after run 5887.  The information filling in ANNIEEventTreeMaker use ID from the PsecData, so
for newer runs after 5887, the Incom ID is automatically filled.

For older runs before 5887, add the conversion for LAPPD_ID.

The BRF signal is also changed to new slot, use run 5887 as the changing
point. However there were some test runs at the end of beam year 2025,
they are ignored.

* Clarify BRF data collection timeline in comments

Added comments to clarify timeline of BRF data collection after run 5870.

* Update channel numbers for BRF and RWM raw data saving

---------

Co-authored-by: Steven Doran <78985334+S81D@users.noreply.github.com>
Co-authored-by: Andrew Sutton <asutton@anniegpvm01.fnal.gov>
Co-authored-by: Feng Yue <fengyvoid@gmail.com>
Co-authored-by: Yue <yuef@iastate.edu>
Co-authored-by: fengyvoid <67118022+fengyvoid@users.noreply.github.com>
Co-authored-by: Steven Doran <doran@iastate.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.