Hey,
i’m trying to run the following code:
void example_01()
{
TFile *fin = new TFile( "jpsi.root" );
TTree *T;
fin->GetObject("T",T);
BEvent* Event = new BEvent();
T->SetBranchAddress("BEvent",&Event);
TH1F *h_jpsi = new TH1F ( "h_jpsi", "Invariant Mass of #mu^{+}#mu^{-}", 140, 2.7, 3.4 );
int NEvents = (int)T->GetEntries();
for (int idx=0;idx<NEvents;idx++) {
if ((idx % 1000) == 0) printf ( "At Event: %d/%d.\n",idx,NEvents);
T->GetEntry(idx);
int NParticles = Event->NParticles();
TClonesArray& Plist = *(Event->GetParticleList());
for (int i=0;i<NParticles;i++) {
for (int j=0;j<NParticles;j++) {
BParticle* P1 = (BParticle*)Plist[i];
BParticle* P2 = (BParticle*)Plist[j];
if (P1->pid()!=MUON || P2->pid()!=MUON ) continue;
if (P1->charge()!=+1 || P2->charge()!=-1) continue;
float Px = P1->px() + P2->px();
float Py = P1->py() + P2->py();
float Pz = P1->pz() + P2->pz();
float E = P1->e() + P2->e();
float P = sqrt(Px*Px + Py*Py + Pz*Pz);
float Mass = sqrt(E*E - P*P);
h_jpsi->Fill(Mass);
}
}
}
TCanvas* c1 = new TCanvas("c1","c1",600,400);
h_jpsi->SetFillColor(622);
h_jpsi->Draw();
}
First, i use .L peaks.C (name of the file). Then i do: example_01() and i get this:
" IncrementalExecutor::executeFunction: symbol ‘_ZN6BEvent15GetParticleListEv’ unresolved while linking [cling interface function]!
You are probably missing the definition of BEvent::GetParticleList()
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol ‘_ZN6BEventC1Ev’ unresolved while linking [cling interface function]!
You are probably missing the definition of BEvent::BEvent()
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol ‘_ZTI6BEvent’ unresolved while linking [cling interface function]!
You are probably missing the definition of typeinfo for BEvent
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol ‘_ZN6BEvent10NParticlesEv’ unresolved while linking [cling interface function]!
You are probably missing the definition of BEvent::NParticles()
Maybe you need to load the corresponding shared library? "
I really don’t know what’s going on, cause i have been running several similar codes perfectly.
Thanks!