98 #include <TGeoVolume.h> 99 #include <TGeoManager.h> 100 #include <TGeoShape.h> 101 #include <TGeoBBox.h> 125 using std::ostringstream;
127 using namespace genie;
198 <<
" *** Generating event............ " << ievent;
204 event->AttachSummary(interaction);
211 event->SetVertex(x4);
214 <<
"Generated event: " << *
event;
245 bool geom_is_accessible = ! (gSystem->AccessPathName(
gOptRootGeom.c_str()));
246 if (!geom_is_accessible) {
248 <<
"The specified ROOT geometry doesn't exist! Initialization failed!";
253 TGeoVolume * top_volume = gm->GetTopVolume();
254 TGeoShape * ts = top_volume->GetShape();
255 TGeoBBox * box = (TGeoBBox *)ts;
260 fox = (box->GetOrigin())[0];
261 foy = (box->GetOrigin())[1];
262 foz = (box->GetOrigin())[2];
276 TRandom3 & rnd_geo = rnd->
RndGeom();
278 double rndx = 2 * (rnd_geo.Rndm() - 0.5);
279 double rndy = 2 * (rnd_geo.Rndm() - 0.5);
280 double rndz = 2 * (rnd_geo.Rndm() - 0.5);
283 double x_gen =
fox + rndx *
fdx;
284 double y_gen =
foy + rndy *
fdy;
285 double z_gen =
foz + rndz *
fdz;
287 TLorentzVector
pos(x_gen, y_gen, z_gen, t_gen);
293 string sname =
"genie::EventGenerator";
294 string sconfig =
"NeutralHeavyLepton";
299 LOG(
"gevgen_nhl",
pFATAL) <<
"Couldn't instantiate the NHL generator";
308 LOG(
"gevgen_nhl",
pINFO) <<
"Parsing command line arguments";
326 LOG(
"gevgen_nhl",
pDEBUG) <<
"Reading MC run number";
329 LOG(
"gevgen_nhl",
pDEBUG) <<
"Unspecified run number - Using default";
336 <<
"Reading number of events to generate";
340 <<
"You need to specify the number of events";
349 <<
"Reading NHL mass";
353 <<
"You need to specify the NHL mass";
364 <<
"Reading NHL energy";
368 <<
"You need to specify the NHL energy";
378 <<
"Reading NHL decay mode";
382 <<
"You need to specify the decay mode";
391 <<
"Specified decay is not allowed kinematically for the given NHL mass";
404 LOG(
"gevgen_nhl",
pDEBUG) <<
"Getting input geometry";
408 bool accessible_geom_file =
409 ! (gSystem->AccessPathName(geom.c_str()));
410 if (accessible_geom_file) {
427 <<
"Checking for input geometry length units";
430 LOG(
"gevgen_nhl",
pDEBUG) <<
"Using default geometry length units";
448 LOG(
"gevgen_nhl",
pDEBUG) <<
"Checking for input volume name";
451 LOG(
"gevgen_nhl",
pDEBUG) <<
"Using the <master volume>";
458 LOG(
"gevgen_nhl",
pDEBUG) <<
"Reading the event filename prefix";
462 <<
"Will set the default event filename prefix";
468 LOG(
"gevgen_nhl",
pINFO) <<
"Reading random number seed";
471 LOG(
"gevgen_nhl",
pINFO) <<
"Unspecified random number seed - Using default";
479 ostringstream gminfo;
481 gminfo <<
"Using ROOT geometry - file: " <<
gOptRootGeom 484 <<
", length units: " << lunits;
497 <<
"\n @@ Geometry : " << gminfo.str()
498 <<
"\n @@ Statistics : " <<
gOptNev <<
" events";
505 <<
"\n gevgen_nhl [-h] " 507 <<
"\n -E nhl_energy (temporary)" 508 <<
"\n --mass nhl_mass" 509 <<
"\n -m decay_mode" 510 <<
"\n -f flux ** not installed yet **" 511 <<
"\n [-g geometry]" 512 <<
"\n [-t top_volume_name_at_geom]" 513 <<
"\n [-L length_units_at_geom]" 514 <<
"\n -n n_of_events " 515 <<
"\n [-o output_event_file_prefix]" 516 <<
"\n [--seed random_number_seed]" 517 <<
"\n [--message-thresholds xml_file]" 518 <<
"\n [--event-record-print-level level]" 519 <<
"\n [--mc-job-status-refresh-rate rate]" 521 <<
" Please also read the detailed documentation at http://www.genie-mc.org" 522 <<
" or look at the source code: $GENIE/src/Apps/gNeutralHeavyLeptonEvGen.cxx"
void RandGen(long int seed)
static void SetPrintLevel(int print_level)
double ArgAsDouble(char opt)
TLorentzVector GeneratePosition(void)
string ArgAsString(char opt)
THE MAIN GENIE PROJECT NAMESPACE
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
static RandomGen * Instance()
Access instance.
string gOptRootGeomTopVol
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
NtpMCFormat_t kDefOptNtpFormat
void ReadFromCommandLine(int argc, char **argv)
void Update(int iev, const EventRecord *event)
const EventRecordVisitorI * NHLGenerator(void)
A singleton holding random number generator classes. All random number generation in GENIE should tak...
void SetRefreshRate(int rate)
Summary information for an interaction.
Simple class to create & update MC job status files and env. vars. This is used to be able to keep tr...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void GetCommandLineArgs(int argc, char **argv)
double UnitFromString(string u)
const Algorithm * GetAlgorithm(const AlgId &algid)
void InitBoundingBox(void)
void Save(void)
get the even tree
TRandom3 & RndGeom(void) const
rnd number generator used by geometry drivers
void AddEventRecord(int ievent, const EventRecord *ev_rec)
save the event tree
string kDefOptEvFilePrefix
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
void CustomizeFilenamePrefix(string prefix)
void Initialize(void)
add event
static PDGLibrary * Instance(void)
static RunOpt * Instance(void)
static AlgFactory * Instance()
A utility class to facilitate creating the GENIE MC Ntuple from the output GENIE GHEP event records...
Singleton class to load & serve a TDatabasePDG.
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
void MesgThresholds(string inpfile)
Command line argument parser.
enum genie::ENtpMCFormat NtpMCFormat_t
The GENIE Algorithm Factory.
static Interaction * NHL(double E=0, int decayed_mode=-1)
string AsString(NHLDecayMode_t nhldm)
NHLDecayMode_t gOptDecayMode
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
int main(int argc, char **argv)
bool OptionExists(char opt)
was option set?
enum genie::ENHLDecayMode NHLDecayMode_t
bool IsKinematicallyAllowed(NHLDecayMode_t nhldm, double Mnhl)
Event finding and building.