Conversation
This reverts commit 6e3c7d8.
Tools for Event Builder version 2, contains EB tools, and two tools for LAPPD_EB tool chain, and one script for LAPPD timestamp fitting
ANNIEEventTreeMaker tool for processed data from EventBuilderV2 tool chain, like the PhaseIITreeMaker
|
Hi Yue. Sorry for the delay on this. First some top level comments on the PR - as always, please try to address just one thing with each PR. If this addresses 3 things, it would be better as 3 smaller PRs. If bugs spring up later someone can check out a commit before/after each PR merge, check does the code work/not work, and relatively easily pinpoint where the bug was introduced. Minimal PRs = less changes = less code to look for the bug in. Keeping all related changes together also makes it easier to spot when a change that impacts other tools has been introduced but not all impacts accounted for. etc etc. Secondly, validation is good (especially for any PRs that affect "standard" toolchains), but I feel like it's really critical for event-building. Have you processed the same runs with the old and new toolchains compared the outputs? If you can run in an 'equivalent' kind of configuration, a simple That may be a lot of work, but changes to event building impact all analysis of data out of the detector - I do think we should validate before we 'tag' this as the new offcial (especially for a rewrite of this magnitude, but the same tools should be used for any EB changes going forwards). |
|
Related but indepdent: I also think it would be good to benchmark performance. |
|
Regarding 1. in your PR comment specifically
is a sentence I dread reading. Is there really no way to linearise this? Running a toolchain, then a script, then another toolchain is really antithetical to the ToolChain process. We've now had this with trigger overlap, with beam information, with LAPPD timing, with muon fitting.... The process to analyse data becomes a long string of scripts, executables, a bunch of intermediate files.... n.b. is this the |
|
OK, some specific comments on the actual code:
can we get these from input file? Surely we should not need to ask the user to tell us if it's data or not.
surely
if there's some reason this cyclic mapping is needed, perhaps we should wrap it in a single function in the datamodel, rather than needing to repeat this multi-step operation.
|
Thanks for the reply! |
This is before updates from comments on ANNIEsoft#307 PR
|
Seeing this PR was split into smaller chunks, I will close this PR and we can review the newest ones. Marcus provided some very helpful comments that Yue has since implemented in the code in the new PRs. |
* 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>
This PR includes tools for two toolchains: LAPPD_EB and EventBuilderV2, and one tool for BeamClusterAnalysis tool chain.
LAPPD_EB generates a ROOT file containing LAPPD timestamps and CTC timestamps for fitting. A script is then used to fit these timestamps and generate an offset file for LAPPD event building (LAPPDTreeMaker and offsetFit_MultipleLAPPD.cpp).
EventBuilderV2 is based on the data decoders from version 1 of event building, which primarily used ANNIEEventBuilder. It introduces a tool similar to the LAPPD data decoder (LAPPDLoadStore). Version 2 adopts a different strategy for loading raw data, discards the build type implementation (in EBLoadRaw), and separates the event-building processes for each subsystem into distinct tools (the other EB* tools).
For BeamClusterAnalysis, I provide a updated version of the PhaseIITreeMaker: ANNIEEventTreeMaker. This tool will generate tree based on event, rather than CTC-MRD or CTC-cluster pairs. It also includes more information like beam PoT.
More details can be found in the slides from the collaboration meeting and the analysis workshop.
https://annie-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=5633