Segmentation violation

Hello all!
I am getting a problem with a code that uses root along with pythia8. The compilation is ok. But during run, i get this

The code is

#include "Pythia.h"
#include "TFile.h"
#include "TH1.h"
#include "TH2.h"
#include "TCanvas.h"
using namespace Pythia8; 

int main() {

   Pythia pythia;

  Event& event = pythia.event;
  ParticleDataTable& pdt = pythia.particleData;
  Info& info = pythia.info;

  pythia.readFile("ruchi.cmnd");    
  int    nEvent  = pythia.mode("Main:numberOfEvents");
  int    nList   = pythia.mode("Main:numberToList");
  int    nShow   = pythia.mode("Main:timesToShow");
  bool   showCS  = pythia.flag("Main:showChangedSettings");
  bool   showCPD = pythia.flag("Main:showChangedParticleData");
  double fractionqq;
  double fractionqg;
  double fractiongg;
  int nListJets = 5;
  double ebeam = 7000.0;
  
  pythia.init();

 if (showCS) pythia.settings.listChanged();
  if (showCPD) pdt.listChanged();
 TFile *file = TFile::Open("ruchi.root","recreate");
  CellJet cellJet;

  TH2D *hfractiongg = new TH2D("fractiongg","Fraction of gg", 100, 0., 0.8, 100, 0., 1.);

 TH2D *hfractionqq = new TH2D("fractionqq","Fraction of qq", 100, 0., 0.8, 100, 0., 1.);
 TH2D *hfractionqg = new TH2D("fractionqg","Fraction of qg", 100, 0., 0.8, 100, 0., 1.);

   pythia.readString("PhaseSpace:pTHatMin = 0");
   pythia.readString("PhaseSpace:pTHatMax = 5600.");

   double qq=0;
  double qg=0;
  double gg=0;
  double tot=0;
  int nPace = max(1, nEvent / max(1, nShow) ); 
  double xT1=0.0;
  for (int i=0; i<100; i++){
    double xT2=xT1+.01;


 for (int iEvent = 0; iEvent < nEvent; ++iEvent) {
    if (nShow > 0 && iEvent % nPace == 0) 
      cout << " Now begin event " << iEvent << endl;

      if (!pythia.next()) {
      cout << " Event generation aborted prematurely, owing to error!\n"; 
      break;
    }
 
     if (iEvent < nList) { 
      info.list();
      pythia.process.list();
      event.list();
    }
     cellJet. analyze( pythia.event );
     double et = cellJet.eT(0);
        double  xT = et/ebeam;
     if (xT <= xT2 && xT >=xT1){

 
    if (pythia.process[3].id() == 21 && pythia.process[4].id() == 21)
      gg = gg+1;
    else 
      if(pythia.process[3].id()>=1 && pythia.process[3].id()<=5 && pythia.process[4].id()>=1 && pythia.process[4].id()<=5)
	qq =qq+1;
      else
	if(pythia.process[3].id()>=1 && pythia.process[3].id()<=5 && pythia.process[4].id()==21 || pythia.process[4].id()>=1 && pythia.process[4].id()<=5 && pythia.process[3].id()==21)
	  qg = qg+1;
    
  
 tot = tot + qq + qg + gg;
    fractionqq = qq/tot;
   fractionqg = qg/tot;
    fractiongg = gg/tot;

    cout << "number of qq events = " << qq << endl << "number of qg events = " << qg << endl << "number of gg events = " << gg << endl << "number of total events = " << tot << endl;


      cout << "fraction of qq events = " << fractionqq << endl << "fraction of qg events = " << fractionqg << endl << "fraction of gg events = " << fractiongg << endl;
      double xTmean=(xT1+xT2)/2.;
          hfractionqq->Fill(xTmean, fractionqq );
          hfractionqg->Fill(xTmean, fractionqg );
           hfractiongg->Fill(xTmean, fractiongg );
       }
      }
 xT2=xT1;
  }

 file->Write();
  file->Close();
  delete file;
return 0;
}

By commenting out various lines, i got that this is due to the line:

 double  xT = et/ebeam;

Is there something wrong with this?

Hi all

IN root 5.24 running with pythia8.130
I get the massage

Warning in TParticle::SetPdg: PDG code 5100039 unknown from TDatabasePDG
Warning in TParticle::SetPdg: PDG code 5100039 unknown from TDatabasePDG

when I try

myPythia8->ReadString("5100039: m0 = 2000 ");
myPythia8->ReadString("ExtraDimensionsG*:gg2G*g = on");
myPythia8->ReadString("ExtraDimensionsG*:qg2G*q = on");
myPythia8->ReadString("ExtraDimensionsG*:qqbar2G*g = on");

and I dont know how the get the mass
when I use
// mass = part->GetMass();

as I did before in Pythia6 (which worked) actually this is a TParticle command and not TMCParticle command like in Pythia6 ,it gives me segmentation violation

-------- End PYTHIA Event Listing -----------------------------------------------------------------------------------------------
name: proton
pdg: 2212 daughters:0

name: proton
pdg: 2212 daughters:0

name: d
pdg: 1 daughters:2

name: d_bar
pdg: -1 daughters:2

Using host libthread_db library “/lib/tls/i686/cmov/libthread_db.so.1”.
Attaching to program: /proc/7593/exe, process 7593
[Thread debugging using libthread_db enabled]
[New Thread -1228097856 (LWP 7593)]
0xffffe410 in __kernel_vsyscall ()
#1 0xb6d882f3 in waitpid () from /lib/tls/i686/cmov/libc.so.6
#2 0xb6d30669 in strtold_l () from /lib/tls/i686/cmov/libc.so.6
#3 0xb6e37add in system () from /lib/tls/i686/cmov/libpthread.so.0
#4 0xb7a6970d in TUnixSystem::Exec () from /localscratch/Rootpyth/root/lib/libCore.so
#5 0xb7a705a3 in TUnixSystem::StackTrace () from /localscratch/Rootpyth/root/lib/libCore.so
#6 0xb7a6e2af in TUnixSystem::DispatchSignals () from /localscratch/Rootpyth/root/lib/libCore.so
#7 0xb7a6e37d in SigHandler () from /localscratch/Rootpyth/root/lib/libCore.so
#8 0xb7a67060 in sighandler () from /localscratch/Rootpyth/root/lib/libCore.so
#9
#10 0xb5d13273 in TParticle::GetMass () from /localscratch/Rootpyth/root/lib/libEG.so
#11 0xb5d2f603 in G__G__EG_125_0_16 () from /localscratch/Rootpyth/root/lib/libEG.so
#12 0xb719edfa in Cint::G__ExceptionWrapper () from /localscratch/Rootpyth/root/lib/libCint.so
#13 0xb71b1381 in G__exec_asm () from /localscratch/Rootpyth/root/lib/libCint.so
#14 0xb7273176 in G__exec_loop () from /localscratch/Rootpyth/root/lib/libCint.so
#15 0xb726d587 in G__exec_statement () from /localscratch/Rootpyth/root/lib/libCint.so
#16 0xb7272b94 in G__exec_loop () from /localscratch/Rootpyth/root/lib/libCint.so
#17 0xb726d587 in G__exec_statement () from /localscratch/Rootpyth/root/lib/libCint.so
#18 0xb72192cc in G__interpret_func () from /localscratch/Rootpyth/root/lib/libCint.so
#19 0xb7206eba in G__getfunction () from /localscratch/Rootpyth/root/lib/libCint.so
#20 0xb71e9113 in G__getitem () from /localscratch/Rootpyth/root/lib/libCint.so
#21 0xb71ede8e in G__getexpr () from /localscratch/Rootpyth/root/lib/libCint.so
#22 0xb71f51d1 in G__calc_internal () from /localscratch/Rootpyth/root/lib/libCint.so
#23 0xb7279bc2 in G__process_cmd () from /localscratch/Rootpyth/root/lib/libCint.so
#24 0xb7a574f3 in TCint::ProcessLine () from /localscratch/Rootpyth/root/lib/libCore.so
#25 0xb7a5c74f in TCint::ProcessLineSynch () from /localscratch/Rootpyth/root/lib/libCore.so
#26 0xb797fd98 in TApplication::ExecuteFile () from /localscratch/Rootpyth/root/lib/libCore.so
#27 0xb798030c in TApplication::ProcessFile () from /localscratch/Rootpyth/root/lib/libCore.so
#28 0xb797d81b in TApplication::ProcessLine () from /localscratch/Rootpyth/root/lib/libCore.so
#29 0xb6f7a66e in TRint::HandleTermInput () from /localscratch/Rootpyth/root/lib/libRint.so
#30 0xb6f78a15 in TTermInputHandler::Notify () from /localscratch/Rootpyth/root/lib/libRint.so
#31 0xb6f7b134 in TTermInputHandler::ReadNotify () from /localscratch/Rootpyth/root/lib/libRint.so
#32 0xb7a6de8b in TUnixSystem::CheckDescriptors () from /localscratch/Rootpyth/root/lib/libCore.so
#33 0xb7a6e477 in TUnixSystem::DispatchOneEvent () from /localscratch/Rootpyth/root/lib/libCore.so
#34 0xb79dd10e in TSystem::InnerLoop () from /localscratch/Rootpyth/root/lib/libCore.so
#35 0xb79e0ca2 in TSystem::Run () from /localscratch/Rootpyth/root/lib/libCore.so
#36 0xb797bcd8 in TApplication::Run () from /localscratch/Rootpyth/root/lib/libCore.so
#37 0xb6f7ac2f in TRint::Run () from /localscratch/Rootpyth/root/lib/libRint.so
#38 0x08048dab in main ()

and what does status means in the print out and how can I get it?
no id name [size=150] [color=red] status [/color] [/size] mothers daughters colours p_x p_y p_z e m
0 90 (system) -11 0 0 0 0 0 0 0.000 0.000 0.000 10000.000 10000.000
1 2212 (p+) -12 0 0 7 0 0 0 0.000 0.000 5000.000 5000.000 0.938
2 2212 (p+) -12 0 0 8 0 0 0 0.000 0.000 -5000.000 5000.000 0.938
3 1 (d) -21 7 7 5 6 101 0 0.000 0.000 1322.273 1322.273 0.000
4 -1 (dbar) -21 8 8 5 6 0 102 0.000 0.000 -990.968 990.968 0.000
5 5100039 (Graviton*) -22 3 4 9 9 0 0 -1.410 -28.627 19.752 2000.374 2000.071
6 21 (g) -23 3 4 10 10 101 102 1.410 28.627 311.552 312.867 0.000
7 1 (d) -61 1 0 3 3 101 0 -1.337 -0.494 1322.272 1322.272 0.000
8 -1 (dbar) -61 2 0 4 4 0 102 1.667 -0.994 -990.967 990.969 0.000
9 5100039 [size=200] (Graviton*) [color=red] -62 [/color] [/size] 5 5 15 16 0 0 -0.766 -29.998 19.760 2000.393 2000.071

does any body know why
thanks

hi

I use the Rootclass TPythia8.h ,and not Pythia.h
does it work like this ?

Hi,

If you need pythia8, I recommend that you try the current trunk (july 2010 and later).

Cheers,
Philippe.