/usr/share/pythia8-examples/examples/main32.cc is in pythia8-examples 8.1.86-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | // main32.cc is a part of the PYTHIA event generator.
// Copyright (C) 2014 Torbjorn Sjostrand.
// PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
// Please respect the MCnet Guidelines, see GUIDELINES for details.
// This is a sample program showing Alpgen- or Madgraph-style MLM matching
// for Madgraph LHEF or native Alpgen format event files.
//
// Please see the 'Jet Matching Style' manual page for a description of the
// parameters and user options.
// Includes and namespace
#include "Pythia8/Pythia.h"
#include "CombineMatchingInput.h"
using namespace Pythia8;
//==========================================================================
int main() {
// Generator and read in commands.
Pythia pythia;
pythia.readFile("main32.cmnd");
// Extract settings to be used in the main program.
int nEvent = pythia.mode("Main:numberOfEvents");
int nAbort = pythia.mode("Main:timesAllowErrors");
int nSkip = pythia.mode("Main:spareMode1");
// Create UserHooks pointer. Stop if it failed. Pass pointer to Pythia.
CombineMatchingInput combined;
UserHooks* matching = combined.getHook(pythia);
if (!matching) return 1;
pythia.setUserHooksPtr(matching);
// Initialise Pythia.
if (!pythia.init()) {
cout << "Error: could not initialise Pythia" << endl;
return 1;
};
// Optionally skip ahead in LHEF.
pythia.LHAeventSkip( nSkip );
// Begin event loop. Optionally quit it before end of file.
int iAbort = 0;
for (int iEvent = 0; ; ++iEvent) {
if (nEvent > 0 && iEvent >= nEvent) break;
// Generate events. Quit if at end of file or many failures.
if (!pythia.next()) {
if (pythia.info.atEndOfFile()) {
cout << "Info: end of input file reached" << endl;
break;
}
if (++iAbort < nAbort) continue;
cout << "Abort: too many errors in generation" << endl;
break;
}
// Event analysis goes here.
// End of event loop.
}
// Final statistics and done.
pythia.stat();
delete matching;
return 0;
}
|