cpp code problem in the ma5 expert mode
Hi, Ma5 team:
I am a newbie in the expert mode. Here's the problem i've encountered:
In my collider simulation, a new particle decays into 2leptons plus 2 jets, since the lepton could be originated from other particles thus i want to reconstruct the invariant mass in the expert mode. The input file is the lhco type file, and my strategy is that firstly find out the two leptons which stand nextest to each other and then the jets located next to these two leptons, finally reconstruct mass of these four particles. I've wrote my cpp code and it could pass the compiling, but when run the madanalysisjob the program crashed and give the following information:
*******
=> file size: 1.14 Mo
=> sample format: LHCO file produced by an unknown generator (cross section assumed in pb).
=> progress: [> ]
*** Break *** segmentation violation
=======
There was a crash.
This is the entire stack trace of all threads:
=======
#0 0x00007fb46230fa0c in __libc_waitpid (pid=2956, stat_loc=stat_loc
entry=0x7ffcbc0
entry=0) at ../sysdeps/
#1 0x00007fb462295232 in do_system (line=<optimized out>) at ../sysdeps/
#2 0x00007fb463339243 in TUnixSystem:
#3 0x00007fb46333af4c in TUnixSystem:
#4 <signal handler called>
#5 0x000000000040d6c4 in MA5::sst:
#6 0x0000000000407838 in main ()
=======
The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
http://
from above as an attachment in addition to anything else
that might help us fixing this issue.
=======
#5 0x000000000040d6c4 in MA5::sst:
#6 0x0000000000407838 in main ()
=======
*******
Here's my cpp code:
*******
#include "SampleAnalyzer
using namespace MA5;
using namespace std;
// -------
// Initialize
// function called one time at the beginning of the analysis
// -------
bool sst::Initialize
{
// Initializing PhysicsService for MC
PHYSICS-
// Initializing PhysicsService for RECO
PHYSICS-
PHYSICS-
// Initializing the histogram
myHisto = plots_.
cout << "END Initialization" << endl;
return true;
}
// -------
// Execute
// function called each time one event is read
// -------
bool sst::Execute(
{
// Normalization of the histogram: L = 100 fb-1
double nrm = 0.0001198 * 100000. / 10000.;
std::vector<const RecLeptonFormat*> Leptons;
std::vector<const RecJetFormat*> Jats;
std::vector<const RecLeptonFormat*> MyLeptons;
std::vector<const RecJetFormat*> MyJets;
const RecJetFormat* clstJats1;
const RecJetFormat* clstJats2;
if (event.rec()!=0)
{
// Collect the electrons into Leptons
for (unsigned int i=0;i<event.
{
const RecLeptonFormat *elec = &(event.
if (elec->pt()>10)
Leptons.
}
// Collect the muons into Leptons
for (unsigned int i=0;i<event.
{
const RecLeptonFormat *mu = &(event.
if (mu->pt()>10)
Leptons.
}
// Collect the jets into Jats
for (unsigned int i=0;i<event.
{
const RecJetFormat *jts = &(event.
if (jts->pt()>20)
Jats.
}
// Requiring the same-sign trilepton and four jets
if (Leptons.size()==3)
if (Leptons[
if (Jats.size()==4)
// Requiring two of the three leptons located in a relatively narrow cone, and find out the two jets next to them
if (Leptons[
{if (Leptons[
{MyLeptons.
MyLeptons.
else
{
MyLeptons.
MyLeptons.
}
}
else if (Leptons[
{MyLeptons.
MyLeptons.
else
{
MyLeptons.
MyLeptons.
}
clstJats1 = Jats[0];
clstJats2 = Jats[0];
for (unsigned int i=0;i<Jats.
{if (MyLeptons[
clstJats1 = Jats[i];
if (MyLeptons[
clstJats2 = Jats[i];
}
MyJets.
MyJets.
// Next we should plot the invariant mass of the charged Higgs through MyLeptons and MyJets
{TLorentzVector hp = MyLeptons[
myHisto-
{myHisto-
}
return true;
}
// -------
// Finalize
// function called one time at the end of the analysis
// -------
void sst::Finalize(const SampleFormat& summary, const std::vector<
{
// Saving histogram
*out(
plots_
// Finalizing cuts and histos
plots_
}
*******
Anything wrong with this code?
Thanks!
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Benjamin Fuks
- Solved:
- Last query:
- Last reply: