Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid invoking hardcoded process names when accessing analysis tree observables #47

Open
jgalan opened this issue Apr 19, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jgalan
Copy link
Member

jgalan commented Apr 19, 2022

As it was pointed out at rest-for-physics/tracklib#13 the process TRestDetectorSingleChannelAnalysisProcess access the analysis tree this way:

    map<int, Double_t> sAna_max_amplitude_map =
        fAnalysisTree->GetObservableValue<map<int, Double_t>>("sAna_max_amplitude_map");
    map<int, Double_t> sAna_thr_integral_map =
        fAnalysisTree->GetObservableValue<map<int, Double_t>>("sAna_thr_integral_map");
    Double_t sAna_PeakAmplitudeIntegral =
        fAnalysisTree->GetObservableValue<Double_t>("sAna_PeakAmplitudeIntegral");
    Double_t sAna_ThresholdIntegral = fAnalysisTree->GetObservableValue<Double_t>("sAna_ThresholdIntegral");
    Double_t sAna_NumberOfGoodSignals = fAnalysisTree->GetObservableValue<int>("sAna_NumberOfGoodSignals");

The process name sAna_ could be eventually changed by the user, or even the data processing chain could evolve and get more complex, implementing more than one TRestRawSignalAnalysisProcess.

I am not sure why this needs to be done at this process, however, being the input event a TRestDetectorSignalEvent (which still keeps the daqId value) it seems that all those map values could be directly extracted/calculated from the input event itself. Isn't? The threshold integral should usually be the same as the total integral, and the number of good signals the total number of signals at TRestDetectorSignalEvent.

@nkx111
Copy link
Member

nkx111 commented Apr 26, 2022

I agree it is not a good approach.

If in some cases we must retrieve observables from previous process, maybe we shall call the process's method, instead of fAnalysisTree?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants