Hi,
I try to put my macro and input file at my desktop and i have executed the macro without errors but when i add extra part in the macro i got the below error when i make m.Loop() ,
It just so simple macro to plot histograms…
p.s. i tried to re run the macro again at my lxplus area but i had the same error as before.
root [3] m.Loop()
*** Break *** segmentation violation
Generating stack trace…
0x000000010fdcaf8d in G__getvariable (in libCint.so) + 8093
0x000000010fcc0d63 in G__getitem (in libCint.so) + 483
0x000000010fcbc739 in G__getexpr (in libCint.so) + 31033
0x000000010fcc2bf6 in G__test (in libCint.so) + 38
0x000000010fd41a48 in G__exec_loop(char const*, char*, std::__1::list<G__FastAllocString, std::__1::allocator<G__FastAllocString> > const&) (in libCint.so) + 488
0x000000010fd38c72 in G__exec_statement (in libCint.so) + 13442
0x000000010fd41c29 in G__exec_loop(char const*, char*, std::__1::list<G__FastAllocString, std::__1::allocator<G__FastAllocString> > const&) (in libCint.so) + 969
0x000000010fd38c72 in G__exec_statement (in libCint.so) + 13442
0x000000010fce178b in G__interpret_func (in libCint.so) + 17019
0x000000010fcccdd9 in G__getfunction (in libCint.so) + 5705
0x000000010fdd479d in G__getstructmem(int, G__FastAllocString&, char*, int, char*, int*, G__var_array*, int) (in libCint.so) + 4237
0x000000010fdca142 in G__getvariable (in libCint.so) + 4434
0x000000010fcc0d63 in G__getitem (in libCint.so) + 483
0x000000010fcbc739 in G__getexpr (in libCint.so) + 31033
0x000000010fd399ab in G__exec_statement (in libCint.so) + 16827
0x000000010fca326d in G__exec_tempfile_core(char const*, __sFILE*) (in libCint.so) + 1133
0x000000010fca2df6 in G__exec_tempfile_fp (in libCint.so) + 22
0x000000010fd465d4 in G__process_cmd (in libCint.so) + 7236
0x000000010f58c589 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) (in libCore.so) + 873
0x000000010f51c4a6 in TRint::HandleTermInput() (in libRint.so) + 678
0x000000010f5c5218 in TUnixSystem::CheckDescriptors() (in libCore.so) + 328
0x000000010f5ce1dd in TMacOSXSystem::DispatchOneEvent(bool) (in libCore.so) + 429
0x000000010f63754a in TSystem::InnerLoop() (in libCore.so) + 26
0x000000010f63739b in TSystem::Run() (in libCore.so) + 203
0x000000010f5d9ea4 in TApplication::Run(bool) (in libCore.so) + 36
0x000000010f51bdf5 in TRint::Run(bool) (in libRint.so) + 1429
0x000000010f2b1e8f in main (in root.exe) + 79
0x00007fff95f7e5ad in start (in libdyld.dylib) + 1
Root > Function Loop() busy flag cleared
My Macro
#define Monopole_Analysis_cxx
#include “Monopole_Analysis.h”
#include <TH2.h>
#include <TStyle.h>
#include <TCanvas.h>
#include <TH1.h>
#include “TChain.h”
#include “TROOT.h”
#include “TH1F.h”
#include “TFile.h”
#include “TH2F.h”
#include “TMath.h”
#include “TH1D.h”
#include “TH2D.h”
void Monopole_Analysis::Loop()
{
Long64_t nentries = fChain->GetEntries();
TFile *output=new TFile(“macro_output.root”,“recreate”);
TH1F* hist_f51_= new TH1F("hist_f51","",100,0,1.2);
TH2F* h2_NbHits_NbSatHits_ = new TH2F(“Sat_Tot”,"",100,0.0,30.0,100,0.0,1.0);
for (long int i=0;i<nentries; i++)
{
GetEntry(i);
for (unsigned int k=0;k<egClust_size->size();k++)
{
hist_f51_->Fill(egClust_frac51->at(k));
}
for (unsigned int j=0;j<Track_Hits->size();j++)
{
float num = Track_SatSubHits ->at(j);
float den = Track_SubHits->at(j);
h2_NbHits_NbSatHits_->Fill(den,num/den);
}
}
hist_f51_->Draw();
h2_NbHits_NbSatHits_->Draw();
output->Write();
}