Reading and processing track and pixel information

Hello,
I reconstructed tracks with corryvreckan and produced an output file containing the event/pixel/track data using the [FileWriter] module. Now I want to access these information in a root macro. For the events this seemed to have worked for me by sourcing my local corryvreckan installation (Almalinux9 on lxplus) and my root macro is essentially this:

R__ADD_LIBRARY_PATH($/path/to/lib/folder)
R__LOAD_LIBRARY(libCorryvreckanObjects)

void april_test() {
    // Open the ROOT file
    TFile *root_file = TFile::Open("data.root");


    // Access the  "Event" TTree and the global branch
    TTree *event_tree = dynamic_cast<TTree*>(root_file->Get("Event"));
    TBranch *global_branch = event_tree->GetBranch("global");

    corryvreckan::Event* event = nullptr;
    event_tree->SetBranchAddress("global", &event);

    // Get the total number of events in the TTree
    Long64_t n_entries = event_tree->GetEntries();

   // Looping over events
    for (Long64_t i = 0; i < n_entries; ++i) {
        event_tree->GetEntry(i);
    }

Now for the pixel and track tree I am not able to make it work. When trying to get the pixel information:

TTree *pixel_tree = dynamic_cast<TTree*>(root_file->Get("Pixel"));
//first mimosa plane
TBranch *mimosa0_branch = pixel_tree->GetBranch("mimosa26_0"); 

std::vector<corryvreckan::Pixel*>* pixels;
pixel_tree->SetBranchAddress("mimosa26_0", &pixels);

An error occurs:
Error in TTree::SetBranchAddress: The class requested (vectorcorryvreckan::Pixel*) for the branch “mimosa26_0” is an instance of an stl collection and does not have a compiled CollectionProxy. Please generate the dictionary for this collection (vectorcorryvreckan::Pixel*) to avoid to write corrupted data.

I assume this is some mistake on my side, because Corryvreckan very likely provides this dictionaries. I also tried using #include “/path/to/pixel.hpp” at the beginning, but it did not help.

I have the same problem for the track information. Also, when trying to use #include “path/to/track.hpp” I get the additional error:
fatal error: ‘core/utils/exceptions.h’ file not found
#include “core/utils/exceptions.h”

There seems to be some confusion in the paths. I checked similar topics, but none of them really helped me solve my problem. Does someone know how to properly process pixel and track information?

Cheers,
Christopher

Hi @chkrause,

I had been traveling, sorry for the delay.

I am not sure what is going wrong and would investigate if you could provide me an example file to test on. Don’t want to promise any results though.

Lennart

Hi @chkrause,

sorry for the long silence - just to keep you updated:

This is a bug on our side we found and will fix.

This is still a mystery we are working on.

Alright, thanks for looking into it.