Thanks for the reply.
I load my libraries with gROOT->LoadMacro():
void Load()
{
gROOT->LoadMacro("Vector.cc+g");
gROOT->LoadMacro("Particle.cc+g");
gROOT->LoadMacro("Detector.cc+g");
}
And to start my code I simply write in the terminal : root -l Load.C
My code could look like:
TFile *f = TFile::Open("Hijing_000244918_AA_05020_30k.root" ,"READ");
TTree *t = static_cast<TTree*>(f->Get("T"));
Header* h = new Header;
TClonesArray* p = new TClonesArray("TParticle");
t->SetBranchAddress("header", &(h->run));
t->SetBranchAddress("particles", &p);
for (int i = 0; i < t->GetEntries(); i++) { /// Loop over each event
vector<Vector> particles_intersection_mcp;
t->GetEntry(i);
for (int j = 0; j < p->GetEntries(); j++) { Loop over particles
TParticle* q = static_cast<TParticle*>(p->At(j));
TParticlePDG* pdg = pdgDb->GetParticle(q->GetPdgCode());
for (unsigned int i = 0; i < position_array_quartz_T0A.size(); i++){ Intersection with each detector
“ Findes intersection with some detector class and the intersection vectors are analyzed with root histogram functions"
}
}
}
I want to speed ud the loop where the intersection with the detector class is analyzed by using OpenMP.
To make it clear it’s only the detector class function, that should run faster, and the plotting with the ROOT functions is not the problem.