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

Implementing BiPo event data processing in REST #106

Merged
merged 23 commits into from
Jul 7, 2023
Merged

Implementing BiPo event data processing in REST #106

merged 23 commits into from
Jul 7, 2023

Conversation

jgalan
Copy link
Member

@jgalan jgalan commented May 16, 2023

jgalan Large: 1105

Class documentation preview has been rendered here.

In order to launch the event data processing the file needs to be uncompressed. Inside the pipeline/external/BiPo/ there is an example of launching a basic processing chain.

We still need to uncompress the original file before start the data processing, so we need to do something like this:

gzip -d -c /path/to/binary/data/BiPo3Mod2_run_2600.data.gz > /tmp/BiPo3Mod2_run_2600.data
restManager --c /path/to/rml/BiPoToRawSignal.rml --f /tmp/BiPo3Mod2_run_2600.data
rm /tmp/BiPo3Mod2_run_2600.data

Then, we can access the information of the new generated ROOT file and quickly inspect the file using:

restRoot RawData_BiPo3Mod2_02600.root

Inside the ROOT command shell, we can access:

  • Run information
run0->PrintMetadata();
Screenshot 2023-05-17 at 13 08 44
  • Matacq and BiPo configuration settings:
md0_BiPo->PrintMetadata()
Screenshot 2023-05-17 at 13 10 12
  • Finding some event entries that satisfy certain conditions
root [1] run0->GetEventEntriesWithConditions("rawAna_MaxPeakAmplitude>50 && rawAna_MaxPeakAmplitude<1000")
(std::vector<int>) { 0, 1, 2, 4, 9, 14, 17, 20, 22, 25, 26 }
  • Updating the entry and printing analysis tree observables
root [3] run0->GetEntry(17)
root [4] run0->GetAnalysisTree()->PrintObservables()
Screenshot 2023-05-17 at 13 16 55
  • Drawing the active event and saving to png
TCanvas c;
ev0->DrawEvent();
c.Print("Entry17.png");

BiPo_Run2600_Ev1714

An example was added to include the analysis (using TRestRawSignalAnalysisProcess) of two different range of the waveforms, the example at examples/01.BiPo/ contains a plots.rml definition that will generate few prebuilt plots.

restManager --c plots.rml --f RawData_BiPo3Mod2_02600.root

R02503_BiPo3Mod2_Raw

@jgalan jgalan requested review from hgmaluenda and juanangp May 17, 2023 07:07
@jgalan
Copy link
Member Author

jgalan commented May 17, 2023

@juanangp I get the following compilation error.

error: constexpr variable cannot have non-literal type 'const std::string' (aka 'const basic_string<char>')
constexpr std::string TAG_ACQ_2 = "AC2";

what is the problem using just const?

@jgalan
Copy link
Member Author

jgalan commented May 17, 2023

Then I get plenty of errors, because fread requires a void * and changing it to std::array the compilation complains. So I just pushed force the original version.

Perhaps this is a change to be made once the validation pipeline is running for this example.

@juanangp
Copy link
Member

@juanangp I get the following compilation error.

error: constexpr variable cannot have non-literal type 'const std::string' (aka 'const basic_string<char>')
constexpr std::string TAG_ACQ_2 = "AC2";

what is the problem using just const?

Indeed, constexpr cannot be used with std::string, but should be possible to do constexpr std::string_view TAG_ACQ_2 = "AC2"; or constexpr char[] TAG_ACQ_2 = "AC2";

Is better to use constexpr in this case because it would be already available at compile time, which means that will be faster https://stackoverflow.com/questions/41125651/constexpr-vs-static-const-which-one-to-prefer. Anyhow, it is not a big deal but I think is a good practise to use constexpr.

@juanangp
Copy link
Member

Then I get plenty of errors, because fread requires a void * and changing it to std::array the compilation complains. So I just pushed force the original version.

Perhaps this is a change to be made once the validation pipeline is running for this example.

I guess you have to do something like &stdArray[0], I can have a look later on.

@jgalan jgalan marked this pull request as ready for review May 25, 2023 13:55
@jgalan jgalan requested a review from Anakintana June 20, 2023 11:20
@jgalan jgalan merged commit 5da09a6 into master Jul 7, 2023
@jgalan jgalan deleted the jgalan_bipo branch July 7, 2023 09:43
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.

3 participants