gEvServ.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \program gevserv
5 
6 \brief GENIE v+A event generation server
7 
8  Syntax :
9  gevserv [-p port]
10 
11  Options :
12  [] denotes an optional argument
13  -p port number (default: 9090)
14 
15 \author Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
16  University of Liverpool & STFC Rutherford Appleton Lab
17 
18 \created September 18, 2007
19 
20 \cpright Copyright (c) 2003-2016, GENIE Neutrino MC Generator Collaboration
21  For the full text of the license visit http://copyright.genie-mc.org
22  or see $GENIE/LICENSE
23 */
24 //____________________________________________________________________________
25 
26 #include <cassert>
27 #include <iostream>
28 #include <sstream>
29 #include <string>
30 #include <vector>
31 
32 #include <TSystem.h>
33 #include <TServerSocket.h>
34 #include <TSocket.h>
35 #include <TMessage.h>
36 #include <TBits.h>
37 #include <TMath.h>
38 
39 #include "Conventions/Units.h"
40 #include "EVGCore/EventRecord.h"
41 #include "EVGDrivers/GEVGDriver.h"
42 #include "EVGDrivers/GEVGPool.h"
43 #include "EVGDrivers/GMCJMonitor.h"
44 #include "GHEP/GHepFlags.h"
45 #include "GHEP/GHepParticle.h"
46 #include "GHEP/GHepRecord.h"
48 #include "Messenger/Messenger.h"
49 #include "Numerical/Spline.h"
50 #include "PDG/PDGCodeList.h"
51 #include "Utils/XSecSplineList.h"
52 #include "Utils/StringUtils.h"
53 #include "Utils/CmdLnArgParser.h"
54 
55 using std::string;
56 using std::vector;
57 using std::ostringstream;
58 
59 using namespace genie;
60 using namespace genie::utils;
61 
62 // ** Prototypes
63 //
64 void GetCommandLineArgs (int argc, char ** argv);
65 void PrintSyntax (void);
66 void RunInitChecks (void);
67 void HandleMesg (string mesg);
68 void Handshake (void);
69 void Configure (string mesg);
70 void CalcTotalXSec (string mesg);
71 void GenerateEvent (string mesg);
72 void Shutdown (void);
73 
74 // ** Consts & Defaults
75 //
76 const int kDefPortNum = 9090; // default port number
77 const string kHandshakeCmdRecv = "RUB GENIE LAMP";
78 const string kHandshakeMesgSent = "YOU HAVE 3 WISHES!";
79 const string kConfigCmdRecv = "CONFIG";
80 const string kConfigOkMesgSent = "CONFIG COMPLETED";
81 const string kConfigCmdLdSpl = "load-splines";
82 const string kConfigCmdNeuList = "neutrino-list";
83 const string kConfigCmdTgtList = "target-list";
84 const string kXSecCmdRecv = "XSEC";
85 const string kXSecCmdSent = "XSECSPL";
86 const string kXSecOkMesgSent = "XSEC SENT";
87 const string kEvgenCmdRecv = "EVTVTX";
88 const string kEvgenHdrCmdSent = "EVTREC";
89 const string kEvgenStdhepCmdSent = "STDHEP";
90 const string kEvgenOkMesgSent = "EVENT GENERATED";
91 const string kShutdownCmdRecv = "SHUTDOWN";
92 const string kShutdownOkMesgSent = "SHUTTING DOWN";
93 const string kErrNoConf = "*** NOT CONFIGURED! ***";
94 const string kErrNoDriver = "*** NO EVENT GENERATION DRIVER! ***";
95 const string kErrNoEvent = "*** NULL OR UNPHYSICAL EVENT! ***";
96 const string kErr = "FAILED";
97 
98 // ** User-specified options:
99 //
100 int gOptPortNum; // port number
101 
102 // ** Globals
103 //
104 TSocket * gSock = 0; // tcp/ip socket
105 bool gShutDown = false; // 'shutting down?' flag
106 bool gConfigured = false; // 'am I configured?' flag
107 GEVGPool gGPool; // list of GENIE event generation drivers used in job
108 
109 //____________________________________________________________________________
110 int main(int argc, char ** argv)
111 {
112  // Parse command line arguments
113  GetCommandLineArgs(argc,argv);
114 
115  // Run some checks
116  RunInitChecks();
117 
118  // Open a server socket
119  TServerSocket * serv_sock = new TServerSocket(gOptPortNum, kTRUE);
120 
121  // Accept a connection
122  gSock = serv_sock->Accept();
123 
124  if(!gSock) exit(1);
125  LOG("gevserv", pNOTICE) << "Listening on port: " << gOptPortNum;
126 
127  // Set no TCP/IP NODELAY
128  int delay_ok = gSock->SetOption(kNoDelay,1);
129  LOG("gevserv", pNOTICE) << "TCP_NODELAY > " << delay_ok;
130 
131  // Start listening for messages & take the corresponding actions
132 
133  while(1) {
134 
135  if(gShutDown) break;
136 
137  TMessage * mesg = 0;
138 
139  gSock->Recv(mesg);
140 
141  if(!mesg) continue;
142  if(mesg->What() != kMESS_STRING) continue;
143 
144  char mesg_content[2048];
145  mesg->ReadString(mesg_content, 2048);
146 
147  LOG("gevserv", pNOTICE) << "Processing mesg > " << mesg_content;
148 
149  HandleMesg(mesg_content);
150 
151  } // while(1)
152 
153  return 0;
154 }
155 //____________________________________________________________________________
156 void HandleMesg(string mesg)
157 {
158  if(mesg.find(kHandshakeCmdRecv.c_str()) != string::npos)
159  {
160  Handshake();
161  }
162  else
163  if (mesg.find(kConfigCmdRecv.c_str()) != string::npos)
164  {
165  Configure(mesg);
166  }
167  else
168  if (mesg.find(kXSecCmdRecv.c_str()) != string::npos)
169  {
170  CalcTotalXSec(mesg);
171  }
172  else
173  if (mesg.find(kEvgenCmdRecv.c_str()) != string::npos)
174  {
175  GenerateEvent(mesg);
176  }
177  else
178  if (mesg.find(kShutdownCmdRecv.c_str()) != string::npos)
179  {
180  Shutdown();
181  }
182 }
183 //____________________________________________________________________________
184 void Handshake(void)
185 {
186 // Reply to client messages checking whether the event server is active
187 //
188  LOG("gevserv", pNOTICE)
189  << "GENIE was pinged by a client (lamp was rubbed)! Responding...";
190 
191  gSock->Send(kHandshakeMesgSent.c_str());
192 
193  LOG("gevserv", pINFO) << "...done!";
194 }
195 //____________________________________________________________________________
196 void Configure(string mesg)
197 {
198 // Configure the GENIE event server
199 // ** Load splines
200 // - if the "load-splines" command is contained in the mesg
201 // - the splines are loaded from the the XML file specified in $GSPLOAD (server-side)
202 // the "load-splines" mesg is sent
203 // ** Specify the neutrino list
204 // - adding a "neutrino-list=<comma separated list of pdg codes>" in the mesg
205 // ** Specify the target list
206 // - adding a "target-list=<comma separated list of pdg codes>" in the mesg
207 //
208 // Note:
209 // - All nedded cross section splines for the specified neutrino/target lists must
210 // be available in the specified XML file. If not GENIE will attempt building the
211 // the missing ones which may increase start-up overheads.
212 // - You can further control GENIE (suppress modes, set messenger verbosity, ...)
213 // by setting all the std GENIE env vars at the server side.
214 // See the GENIE web site.
215 
216  LOG("gevserv", pNOTICE) << "Configuring GENIE event server";
217 
218  mesg = str::FilterString(kConfigCmdRecv, mesg);
219  mesg = str::FilterString(":", mesg);
220  mesg = str::TrimSpaces(mesg);
221 
222  LOG("gevserv", pNOTICE) << "Configure options: " << mesg;
223 
224  // Autoload splines from the XML file pointed at the $GSPLOAD env. var.
225  // (if set at the server side)
226  //
227  if(mesg.find(kConfigCmdLdSpl) != string::npos) {
229  xspl->AutoLoad();
230 
231  mesg.erase(mesg.find(kConfigCmdLdSpl),12);
232  mesg = str::TrimSpaces(mesg);
233  }
234 
235  // Extract neutrino and target lists from the input mesg
236  //
237  bool allowdup = false;
238  PDGCodeList neutrinos(allowdup);
239  PDGCodeList targets(allowdup);
240 
241  vector<string> conf_opt_v = str::Split(mesg," ");
242  vector<string>::iterator conf_opt_iter = conf_opt_v.begin();
243 
244  for( ; conf_opt_iter != conf_opt_v.end(); ++conf_opt_iter) {
245  string conf_opt = *conf_opt_iter;
246  LOG("gevserv", pNOTICE)
247  << "Processing config option: " << conf_opt;
248 
249  vector<string> sv = str::Split(conf_opt, "=");
250  assert(sv.size()==2);
251  string list_name = sv[0];
252  string particle_list = sv[1];
253 
254  vector<string> particles = str::Split(particle_list, ",");
255  vector<string>::iterator particle_iter = particles.begin();
256 
257  for( ; particle_iter != particles.end(); ++particle_iter) {
258  string particle_code_str = *particle_iter;
259  int particle_code = atoi(particle_code_str.c_str());
260 
261  if(list_name.find(kConfigCmdNeuList) != string::npos)
262  {
263  neutrinos.push_back(particle_code);
264  } else
265  if(list_name.find(kConfigCmdTgtList) != string::npos)
266  {
267  targets.push_back(particle_code);
268  }
269  }
270  }
271 
272  LOG("gevserv", pNOTICE)
273  << "Specified neutrino list: " << neutrinos;
274  LOG("gevserv", pNOTICE)
275  << "Specified target list: " << targets;
276 
277 
278  // Loop over the specified neutrinos and targets and for each
279  // possible pair create / configure a GENIE event generation driver.
280  //
281  PDGCodeList::const_iterator nuiter;
282  PDGCodeList::const_iterator tgtiter;
283 
284  for(nuiter = neutrinos.begin(); nuiter != neutrinos.end(); ++nuiter) {
285  for(tgtiter = targets.begin(); tgtiter != targets.end(); ++tgtiter) {
286 
287  int target_code = *tgtiter;
288  int neutrino_code = *nuiter;
289 
290  InitialState init_state(target_code, neutrino_code);
291 
292  LOG("gevserv", pNOTICE)
293  << "\n\n ---- Creating a GEVGDriver object configured for init-state: "
294  << init_state.AsString() << " ----\n\n";
295 
296  GEVGDriver * evgdriver = new GEVGDriver;
297  evgdriver->Configure(init_state);
298  evgdriver->UseSplines(); // will also check if all splines needed are loaded
299 
300  gGPool.insert( GEVGPool::value_type(init_state.AsString(), evgdriver) );
301 
302  } // targets
303  } // neutrinos
304 
305  LOG("gevserv", pNOTICE)
306  << "All necessary GEVGDriver object were pushed into GEVGPool\n";
307 
308  gConfigured = true;
309 
310  gSock->Send(kConfigOkMesgSent.c_str());
311 
312  LOG("gevserv", pINFO) << "...done!";
313 }
314 //____________________________________________________________________________
315 void CalcTotalXSec(string mesg)
316 {
317  LOG("gevserv", pNOTICE)
318  << "Sending total xsec for enabled channels - Input info : " << mesg;
319 
320  if(!gConfigured) {
321  LOG("gevserv", pERROR)
322  << "Event server is not configured - Can not generate event";
323  gSock->Send(kErrNoConf.c_str());
324  gSock->Send(kErr.c_str());
325  return;
326  }
327 
328  // Extract info from the input mesg
329 
330  mesg = str::FilterString(kXSecCmdRecv, mesg);
331  mesg = str::FilterString(":", mesg);
332  mesg = str::TrimSpaces(mesg);
333 
334  vector<string> sv = str::Split(mesg," ");
335  assert(sv.size()==2);
336 
337  int ipdgnu = atoi(sv[0].c_str()); // neutrino code
338  int ipdgtgt = atoi(sv[1].c_str()); // target code
339 
340  // Find the appropriate event generation driver for the given initial state
341 
342  InitialState init_state(ipdgtgt, ipdgnu);
343  GEVGDriver * evg_driver = gGPool.FindDriver(init_state);
344  if(!evg_driver) {
345  LOG("gevserv", pERROR)
346  << "No GEVGDriver object for init state: " << init_state.AsString();
347  gSock->Send(kErrNoDriver.c_str());
348  gSock->Send(kErr.c_str());
349  return;
350  }
351 
352  // Ask the event generation driver to sum up the splines for all enabled
353  // channels
354 
355  LOG("gevserv", pNOTICE)
356  << "Requesting total cross section for init state: "
357  << init_state.AsString();
358 
359  evg_driver->CreateXSecSumSpline (
360  1000 /*nknots*/, 0.001 /*Emin*/, 300 /*Emax*/, true /*in-log*/);
361 
362  const Spline * total_xsec_spl = evg_driver->XSecSumSpline();
363  assert(total_xsec_spl);
364 
365  // Send back the cross section data (use 200 MeV bins from 0.010 -> 200.010 GeV)
366 
367  double dE = 0.200;
368  double Emin = 0.010;
369  double Emax = 200.010;
370  int np = (int) TMath::Ceil((Emax-Emin)/dE);
371 
372  ostringstream xsec_hdr;
373  xsec_hdr << kXSecCmdSent << ":" << np;
374  gSock->Send(xsec_hdr.str().c_str());
375 
376  for(int ip=0; ip<np; ip++) {
377  double E = Emin + ip*dE;
378  double xs = TMath::Max(0., total_xsec_spl->Evaluate(E) / (1E-38*units::cm2));
379 
380  ostringstream xsec_spl_knot;
381  xsec_spl_knot << ip << " " << E << " " << Form("%15.8e",xs);
382  gSock->Send(xsec_spl_knot.str().c_str());
383  }
384 
385  gSock->Send(kXSecOkMesgSent.c_str());
386 
387  LOG("gevserv", pINFO) << "...done!";
388 }
389 //____________________________________________________________________________
390 void GenerateEvent(string mesg)
391 {
392  LOG("gevserv", pNOTICE) << "Generating event - Input info : " << mesg;
393 
394  if(!gConfigured) {
395  LOG("gevserv", pERROR)
396  << "Event server is not configured - Can not generate event";
397  gSock->Send(kErrNoConf.c_str());
398  gSock->Send(kErr.c_str());
399  return;
400  }
401 
402  // Extract info from the input mesg
403 
404  mesg = str::FilterString(kEvgenCmdRecv, mesg);
405  mesg = str::FilterString(":", mesg);
406  mesg = str::TrimSpaces(mesg);
407 
408  vector<string> sv = str::Split(mesg," ");
409 
410  assert(sv.size()==11);
411  int irun = atoi(sv[0].c_str()); // just pass through
412  int ievt = atoi(sv[1].c_str()); // ...
413  int ipdgnunoosc = atoi(sv[2].c_str()); // ...
414  double vtxx = atof(sv[3].c_str()); // ...
415  double vtxy = atof(sv[4].c_str()); // ...
416  double vtxz = atof(sv[5].c_str()); // ...
417  int ipdgnu = atoi(sv[6].c_str()); // neutrino code
418  int ipdgtgt = atoi(sv[7].c_str()); // target code
419  double px = atof(sv[8].c_str()); // neutrino px
420  double py = atof(sv[9].c_str()); // neutrino py
421  double pz = atof(sv[10].c_str()); // neutrino pz
422  double E = TMath::Sqrt(px*px + py*py + pz*pz);
423 
424  TLorentzVector p4(px,py,pz,E);
425 
426  // Find the appropriate event generation driver for the given initial state
427 
428  InitialState init_state(ipdgtgt, ipdgnu);
429  GEVGDriver * evg_driver = gGPool.FindDriver(init_state);
430  if(!evg_driver) {
431  LOG("gevserv", pERROR)
432  << "No GEVGDriver object for init state: " << init_state.AsString();
433  gSock->Send(kErrNoDriver.c_str());
434  gSock->Send(kErr.c_str());
435  return;
436  }
437 
438  // Generate the requested event
439 
440  EventRecord * event = evg_driver->GenerateEvent(p4);
441 
442  // Check/print the generated event
443  bool failed = (event==0) || event->IsUnphysical();
444  if(failed) {
445  LOG("gevserv", pWARN)
446  << "Failed to generate the requested event";
447  gSock->Send(kErrNoEvent.c_str());
448  gSock->Send(kErr.c_str());
449  return;
450  }
451  LOG("gevserv", pINFO) << "Generated event: " << *event;
452 
453  // Extract some summary info & convert to what MINOS expects
454 
455  const Interaction * interaction = event->Summary();
456  const ProcessInfo & proc_info = interaction->ProcInfo();
457  const Kinematics & kine = interaction->Kine();
458 
459  int int_type = -1;
460  if (proc_info.IsQuasiElastic()) int_type = 1;
461  else if (proc_info.IsResonant()) int_type = 2;
462  else if (proc_info.IsDeepInelastic()) int_type = 3;
463  else if (proc_info.IsCoherent()) int_type = 4;
464  else if (proc_info.IsInverseMuDecay()) int_type = 5;
465  else if (proc_info.IsNuElectronElastic()) int_type = 6;
466 
467  int iaction = -1;
468  if (proc_info.IsWeakNC()) iaction = 0;
469  else if (proc_info.IsWeakCC()) iaction = 1;
470  else iaction = 2; // cc+nc interference
471 
472  int nucleon = -1;
473  GHepParticle * hitnucl = event->HitNucleon();
474  if(hitnucl) {
475  nucleon = hitnucl->Pdg();
476  }
477 
478  int hitquark = interaction->InitState().Tgt().HitQrkPdg();
479 
480  bool get_selected = true;
481  double xbj_sel = kine.x (get_selected);
482  double y_sel = kine.y (get_selected);
483  double W2_sel = TMath::Power(kine.W (get_selected), 2.);
484  double q2_sel = -1 * kine.Q2(get_selected);
485 
486  double tot_xsec = event->XSec();
487  double diff_xsec = event->DiffXSec();
488 
489  int ihadmode = 0; // need to fill
490 
491  // Send back the event through the tcp/ip socket
492 
493  ostringstream hdr1, hdr2, hdr3, hdr4, stdhep_hdr;
494 
495  hdr1
496  << kEvgenHdrCmdSent << ": "
497  << irun << " "
498  << ievt << " "
499  << ipdgnunoosc << " "
500  << vtxx << " "
501  << vtxy << " "
502  << vtxz;
503  hdr2
504  << ipdgnu << " "
505  << ipdgtgt << " "
506  << px << " "
507  << py << " "
508  << pz;
509  hdr3
510  << int_type << " "
511  << iaction << " "
512  << nucleon << " "
513  << hitquark << " "
514  << xbj_sel << " "
515  << y_sel << " "
516  << W2_sel << " "
517  << q2_sel;
518  hdr4
519  << tot_xsec << " "
520  << diff_xsec << " "
521  << ihadmode;
522 
523  stdhep_hdr
524  << kEvgenStdhepCmdSent << ": "
525  << event->GetEntriesFast();
526 
527  gSock->Send(hdr1.str().c_str());
528  gSock->Send(hdr2.str().c_str());
529  gSock->Send(hdr3.str().c_str());
530  gSock->Send(hdr4.str().c_str());
531  gSock->Send(stdhep_hdr.str().c_str());
532 
533  unsigned int i=0;
534  TIter event_iter(event);
535  GHepParticle * p = 0;
536  while ( (p = dynamic_cast<GHepParticle *>(event_iter.Next())) ) {
537 
538  ostringstream stdhep_entry;
539 
540  stdhep_entry
541  << i << " " << p->Status() << " " << p->Pdg() << " "
542  << p->FirstMother() << " " << p->LastMother() << " "
543  << p->FirstDaughter() << " " << p->LastDaughter() << " "
544  << p->Px() << " " << p->Py() << " " << p->Pz() << " " << p->E() << " "
545  << p->Mass() << " "
546  << p->Vx() << " " << p->Vy() << " " << p->Vz() << " " << p->Vt();
547 
548  gSock->Send(stdhep_entry.str().c_str());
549  i++;
550  }
551 
552  // Clean-up and report success
553 
554  delete event;
555 
556  gSock->Send(kEvgenOkMesgSent.c_str());
557 
558  LOG("gevserv", pINFO) << "...done!";
559 }
560 //____________________________________________________________________________
561 void Shutdown(void)
562 {
563  LOG("gevserv", pNOTICE) << "Shutting GENIE event server down ...";
564 
565  gShutDown = true;
566 
567  gSock->Send(kShutdownOkMesgSent.c_str());
568 
569  LOG("gevserv", pINFO) << "...done!";
570 }
571 //____________________________________________________________________________
572 void RunInitChecks(void)
573 {
574  if(gSystem->Getenv("GSPLOAD")) {
575  string splines_filename = gSystem->Getenv("GSPLOAD");
576  bool is_accessible = ! (gSystem->AccessPathName( splines_filename.c_str() ));
577  if (!is_accessible) {
578  LOG("gevserv", pWARN)
579  << "*** The file (" << splines_filename
580  << ") specified in $GSPLOAD doesn't seem to be available!";
581  LOG("gevserv", pWARN)
582  << "*** Expect a significant start-up overhead!";
583  }
584  } else {
585  LOG("gevserv", pWARN) << "*** $GSPLOAD was not set!";
586  LOG("gevserv", pWARN) << "*** Expect a significant start-up overhead!";
587  }
588 }
589 //____________________________________________________________________________
590 void GetCommandLineArgs(int argc, char ** argv)
591 {
592  LOG("gevserv", pNOTICE) << "Parsing command line arguments";
593 
594  CmdLnArgParser parser(argc,argv);
595 
596  // port number:
597  if( parser.OptionExists('p') ) {
598  LOG("gevserv", pINFO) << "Reading port number";
599  gOptPortNum = parser.ArgAsInt('p');
600  } else {
601  LOG("gevserv", pINFO)
602  << "Unspecified port number - Using default (" << kDefPortNum << ")";
604  }
605 }
606 //____________________________________________________________________________
607 void PrintSyntax(void)
608 {
609  LOG("gevserv", pNOTICE)
610  << "\n\n" << "Syntax:" << "\n"
611  << " gevserv [-p port] \n";
612 }
613 //____________________________________________________________________________
614 
bool IsResonant(void) const
Definition: ProcessInfo.cxx:92
double W(bool selected=false) const
Definition: Kinematics.cxx:167
void CreateXSecSumSpline(int nk, double Emin, double Emax, bool inlogE=true)
Definition: GEVGDriver.cxx:441
void RunInitChecks(void)
Definition: gEvServ.cxx:572
const string kXSecCmdSent
Definition: gEvServ.cxx:85
bool IsWeakCC(void) const
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
#define pERROR
Definition: Messenger.h:60
double E(void) const
Get energy.
Definition: GHepParticle.h:92
const string kConfigCmdRecv
Definition: gEvServ.cxx:79
int FirstDaughter(void) const
Definition: GHepParticle.h:69
int HitQrkPdg(void) const
Definition: Target.cxx:259
bool IsInverseMuDecay(void) const
bool IsQuasiElastic(void) const
Definition: ProcessInfo.cxx:67
const char * p
Definition: xmltok.h:285
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:47
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
void Shutdown(void)
Definition: gEvServ.cxx:561
double x(bool selected=false) const
Definition: Kinematics.cxx:109
TString ip
Definition: loadincs.C:5
float vtxz
Definition: NusVarsTemp.cxx:32
double Mass(void) const
Mass that corresponds to the PDG code.
const Spline * XSecSumSpline(void) const
Definition: GEVGDriver.h:88
GEVGDriver * FindDriver(const InitialState &init) const
Definition: GEVGPool.cxx:50
static XSecSplineList * Instance()
const string kEvgenHdrCmdSent
Definition: gEvServ.cxx:88
double Evaluate(double x) const
Definition: Spline.cxx:362
static const double cm2
Definition: Units.h:77
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:91
double dE
GHepStatus_t Status(void) const
Definition: GHepParticle.h:65
A list of PDG codes.
Definition: PDGCodeList.h:33
double Px(void) const
Get Px.
Definition: GHepParticle.h:89
double y(bool selected=false) const
Definition: Kinematics.cxx:122
int LastMother(void) const
Definition: GHepParticle.h:68
double Vt(void) const
Get production time.
Definition: GHepParticle.h:98
int Pdg(void) const
Definition: GHepParticle.h:64
int FirstMother(void) const
Definition: GHepParticle.h:67
void GenerateEvent(string mesg)
Definition: gEvServ.cxx:390
Summary information for an interaction.
Definition: Interaction.h:56
const string kErrNoEvent
Definition: gEvServ.cxx:95
const string kErr
Definition: gEvServ.cxx:96
int LastDaughter(void) const
Definition: GHepParticle.h:70
int gOptPortNum
Definition: gEvServ.cxx:100
const string kShutdownCmdRecv
Definition: gEvServ.cxx:91
const string kXSecCmdRecv
Definition: gEvServ.cxx:84
const string kConfigCmdTgtList
Definition: gEvServ.cxx:83
bool IsWeakNC(void) const
void PrintSyntax(void)
Definition: gEvServ.cxx:607
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool IsNuElectronElastic(void) const
Float_t E
Definition: plot.C:20
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:44
const string kEvgenStdhepCmdSent
Definition: gEvServ.cxx:89
const Kinematics & Kine(void) const
Definition: Interaction.h:71
bool gConfigured
Definition: gEvServ.cxx:106
string AsString(void) const
TSocket * gSock
Definition: gEvServ.cxx:104
GENIE Event Generation Driver. A minimalist user interface object for generating neutrino interaction...
Definition: GEVGDriver.h:55
#define pINFO
Definition: Messenger.h:63
const string kConfigCmdLdSpl
Definition: gEvServ.cxx:81
const string kErrNoConf
Definition: gEvServ.cxx:93
#define pWARN
Definition: Messenger.h:61
string TrimSpaces(string input)
Definition: StringUtils.cxx:24
const string kShutdownOkMesgSent
Definition: gEvServ.cxx:92
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:38
bool IsDeepInelastic(void) const
Definition: ProcessInfo.cxx:82
const string kConfigOkMesgSent
Definition: gEvServ.cxx:80
const string kEvgenCmdRecv
Definition: gEvServ.cxx:87
const string kEvgenOkMesgSent
Definition: gEvServ.cxx:90
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
string FilterString(string filt, string input)
Definition: StringUtils.cxx:85
void HandleMesg(string mesg)
Definition: gEvServ.cxx:156
vector< string > Split(string input, string delim)
Definition: StringUtils.cxx:42
float vtxy
Definition: NusVarsTemp.cxx:31
virtual bool IsUnphysical(void) const
Definition: GHepRecord.h:120
const string kHandshakeMesgSent
Definition: gEvServ.cxx:78
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:324
double Vz(void) const
Get production z.
Definition: GHepParticle.h:97
void CalcTotalXSec(string mesg)
Definition: gEvServ.cxx:315
void Configure(string mesg)
Definition: gEvServ.cxx:196
exit(0)
void Configure(int nu_pdgc, int Z, int A)
Definition: GEVGDriver.cxx:138
assert(nhit_max >=nhit_nbins)
float vtxx
Definition: NusVarsTemp.cxx:30
int main(int argc, char **argv)
Definition: gEvServ.cxx:110
const InitialState & InitState(void) const
Definition: Interaction.h:69
double Emax
const string kErrNoDriver
Definition: gEvServ.cxx:94
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
bool gShutDown
Definition: gEvServ.cxx:105
void UseSplines(void)
Definition: GEVGDriver.cxx:509
double Vy(void) const
Get production y.
Definition: GHepParticle.h:96
Command line argument parser.
double Q2(bool selected=false) const
Definition: Kinematics.cxx:135
#define pNOTICE
Definition: Messenger.h:62
const Target & Tgt(void) const
Definition: InitialState.h:67
const string kConfigCmdNeuList
Definition: gEvServ.cxx:82
List of cross section vs energy splines.
void Handshake(void)
Definition: gEvServ.cxx:184
void GetCommandLineArgs(int argc, char **argv)
Definition: gEvServ.cxx:590
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
GEVGPool gGPool
Definition: gEvServ.cxx:107
bool OptionExists(char opt)
was option set?
const int kDefPortNum
Definition: gEvServ.cxx:76
Root of GENIE utility namespaces.
const string kHandshakeCmdRecv
Definition: gEvServ.cxx:77
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:67
const string kXSecOkMesgSent
Definition: gEvServ.cxx:86
double Vx(void) const
Get production x.
Definition: GHepParticle.h:95
Initial State information.
Definition: InitialState.h:49
EventRecord * GenerateEvent(const TLorentzVector &nu4p)
Definition: GEVGDriver.cxx:229
bool IsCoherent(void) const
Definition: ProcessInfo.cxx:97
A pool of GEVGDriver objects with an initial state key.
Definition: GEVGPool.h:38
double Py(void) const
Get Py.
Definition: GHepParticle.h:90