How to save and access reconstructed tracks

I am new to Corryvreckan (and ROOT). I run corry with the following config file:

[Corryvreckan]
output_directory = "corry_output"
log_level = "INFO"

detectors_file = "blah.geo"
histogram_file = "01_reconstruct_tracks.root"

[EventLoaderEUDAQ2]
name = "MIMOSA26_0"
file_name = "blah.raw"
sync_by_event = true
ignore_bore = false

[EventLoaderEUDAQ2]
type = "mimosa26"
file_name = "blah.raw"
sync_by_event = true
discard_raw_events = "MIMOSA26_0"

[ClusteringSpatial]
type = "Mimosa26"

[Tracking4D]
log_level = INFO
momentum = 120.0GeV
track_model = "straightline"
spatial_cut_abs = 100um, 100um
exclude_dut = true
min_hits_on_track = 6

[FileWriter]
file_name = "tracks.root"
include = "Track"

This created the file corry_output/tracks.root which, I guess, contains a collection of Track objects which I would like to retrieve and use getIngercept at some specific z points. How could I do this?

I am trying to run a ROOT script with this content:

#include "TROOT.h"
#include "TObject.h"
#include "TFile.h"
#include "TTree.h"
#include <Track.hpp> // Corry's Track definition.

void main() {
	TFile f("corry_output/tracks.root");

	TTree* tracks;
	f.GetObject("Track", tracks);

	Track track;
	tracks->SetBranchAddress("Track", track);
}

but I get fatal error: 'Track.hpp' file not found. I noticed that if I run this within the ROOT interpreter it fails somewhere else:

root [0] TFile f("tracks.root");
root [1] TTree* tracks; f.GetObject("Track",tracks);
root [2] #include <Track.hpp>
root [3] Track track;
ROOT_prompt_3:1:6: error: expected ';' after expression
Track track;
     ^
     ;
ROOT_prompt_3:1:7: error: use of undeclared identifier 'track'
Track track;
      ^

Any help is very much appreciated.

Hi 0x16B5E,

we store the full C++ objects in the output file, so in order to read and interpret them you need to point ROOT to the class header as well as the compiled library. You can do that e.g. like such:

$ root -l /path/to/data.root
# .L path/to/libCorryvreckanObjects.so

For the header include you might have to provide the full file path or at least make sure that ROOT finds the file in the provided include paths.

Best,
Simon