JeffersonLab / hpstr

Heavy Photon Search Toolkit for Reconstruction
2 stars 19 forks source link

Commit to Push In A New Pulse Analysis Processor #155

Closed rodwyer100 closed 1 year ago

rodwyer100 commented 2 years ago

Core Files to be Submitted

SvtRawDataAnaProcessor.cxx SvtRawDataAnaProcessor.h config/rawSvtAna_cfg.json and config/rawSvtAna_cfgChannel.json \analysis\selections\svtHit directory and all files contained therein. \analysis\plotconfigs\rawSvtAna...3.json \analysis\src\RawSvtHitHistos.cxx

The SvtRawDataAnaProcessor.cxx takes in many cuts on events based on amplitude, time, channel, phase, etc. and handles them using the region_selector object of previous processors. What cuts are meant to be applied are placed in the _cfg (cfgChannel implements a more aggresive cut that pares down channels; it is separate only so that we don't misapply it) After an event passes these cuts, it checks whether another private int sample is enabled.

Say it is enabled. Then the following occurs:

We give rawSvtAna_cfg a basline and timeProfiles file directory. It expects to find raw dat files from our database including baselines and channel time profiles for some run (14552 in all code currently). Afterwards it populated a private array of the SvtRawDataAnaProcessor object (something like baseLines1[][][][] or baseLines2) with all the basline information for each channel separated into feb and hybrid. baseLines1 handles the first two layers, the other the remaining ones. It also does the same for the characteristic times. Once these are populated, the processor generates root plots of fits for 200 fits among the cuts that a person establishes. For instance, if the processor is given a json file in svtHit with a high chi_sqr threshold cut, then it only plot really nice curves. These curves are just stored wherever you are running the hpstr job

Now that it has performed the sampling pulse profile operation, it moves onto the next step. It generates histograms using the histogram multiplier key as implemented by HistoManager (it makes a separate histogram for each layer and hybrid). The histograms it makes are specified in the rawSvtAna3.json file in analsys/plotconfigs. RawSvtHitHistos.cxx then populates these one and two dimensional histograms. It is here where the time difference between two pulses, etc. is implemented.

I have verified that this processor (and its adjacent files) work as intended.

They will require structure and comment improvements that I intend on implementing either here or as I go on.

rodwyer100 commented 1 year ago

I have fiddled again. Let me know what you think.

rodwyer100 commented 1 year ago

Alright made all the changes required. Let me know if I put too many skip statements; I think it should be correct.

rodwyer100 commented 1 year ago

I have not fixed the simple branch conflicts but I think they can be just changed to my version. Let me know if you disagree.

rodwyer100 commented 1 year ago

Found some files that were untracked. Should have all your changes implemented now, and included the dat files locally

omar-moreno commented 1 year ago

Before you commit just run:

find . -type f -name '.h' -o -name '.cxx' -exec clang-format -i --style=Google {} ';'

This will give you a consistent style.

On Wed, Dec 14, 2022 at 10:45 AM rodwyer100 @.***> wrote:

@.**** commented on this pull request.

In processing/src/HpsEventFile.cxx https://github.com/JeffersonLab/hpstr/pull/155#discussion_r1048840937:

@@ -38,4 +38,4 @@ bool HpsEventFile::nextEvent() { intree->GetEntry(entry++);

return true; -} +}

I don't honestly don't know why it keeps saying I fiddled with the whitespace. This is not intentional. I changed it back I think from the previous whitespace. I promise we'll adopt a convention when I talk with Sarah.

— Reply to this email directly, view it on GitHub https://github.com/JeffersonLab/hpstr/pull/155#discussion_r1048840937, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4JMXAXYXRDTPFBTPRWFMLWNIIURANCNFSM6AAAAAARONSED4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rodwyer100 commented 1 year ago

I don't think I have the clang-format command installed.

rodwyer100 commented 1 year ago

*and I don't have sudo privileges. I could try this locally.

rodwyer100 commented 1 year ago

I made a commit with the style changes. For some reason it didn't let me make a git message.

cbravo135 commented 1 year ago

I had requested in a previous comment we wait until we have a discussion on what style to use to change style, and do it in a separate PR. Can you revert that commit that changed the style and open a separate PR with this?

rodwyer100 commented 1 year ago

Done