neugen_inputs Class Reference

#include <neugen3_dummy.h>

List of all members.

Public Member Functions

 neugen_inputs ()
 neugen_inputs (const neugen_inputs *inputs)
 ~neugen_inputs ()
void print (ostream &stream) const
void write_neugen_input_card (const char *filename) const
interaction get_interaction (void) const
final_state get_final_state (void) const
neugen_cuts get_cuts (void) const
bool qel_sum (void) const
bool res_sum (void) const
bool dis_sum (void) const
bool inclusive (void) const
int nbins (void) const
int xsec_type_code (void) const
int plot_var_code (void) const
int flux_id_code (void) const
int plot_range_code (void) const
int nu_type_code (void) const
int wcurrent_code (void) const
int target_code (void) const
int init_state_code (void) const
int process_mask_code (void) const
int qel_bit_in_mask (void) const
int res_bit_in_mask (void) const
int dis_bit_in_mask (void) const
int cut_var_code (void) const
float energy_min (void) const
float energy_max (void) const
float energy (void) const
float plot_var_min (void) const
float plot_var_max (void) const
float cut_var_min (void) const
float cut_var_max (void) const
string final_state_code (void) const
string xsec_type_string (void) const
string plot_var_string (void) const
string flux_id_string (void) const
string plot_range_string (void) const
string nu_type_string (void) const
string wcurrent_string (void) const
string target_string (void) const
string final_state_string (void) const
string init_state_string (void) const
string cut_var_string (void) const
void set_nbins (int nbins)
void set_qel_bit_in_mask (bool on)
void set_res_bit_in_mask (bool on)
void set_dis_bit_in_mask (bool on)
void set_xsec_type (string xsec_type)
void set_e_min (float e_min)
void set_e_max (float e_max)
void set_e (float e)
void set_plot_var (string variable)
void set_flux (string flux)
void set_range (string range)
void set_plot_var_min (float var_min)
void set_plot_var_max (float var_max)
void set_neutrino (string neutrino)
void set_wcurrent (string wcurrent)
void set_target (string target)
void set_final_state (string fin_state)
void set_initial_state (string init_state)
void set_cut_var (string variable)
void set_cut_var_min (float var_min)
void set_cut_var_max (float var_max)
void set_qel_sum (bool on)
void set_res_sum (bool on)
void set_dis_sum (bool on)
void set_inclusive (bool on)

Private Member Functions

void init (void)
int neugen_xsec_type_code (string xsec_type)
int neugen_flux_code (string flux)
int neugen_plot_range_code (string range)
int neugen_neutrino_code (string neutrino)
int neugen_weak_current_code (string wcurrent)
string neugen_final_state_code (string fin_state)
int neugen_initial_state_code (string init_state)
int neugen_variable_code (string plot_variable)
void compute_process_mask (void)
int bool2int (bool on)
int n_matches (string input, string pattern)

Private Attributes

int _nbins
int _xsec_type_code
float _emin
float _emax
float _e
int _plot_var_code
int _flux_id_code
int _plot_range_code
float _plot_var_min
float _plot_var_max
int _nu_type_code
int _wcurrent_code
int _target_code
string _final_state_code
int _init_state_code
int _process_mask_code
int _cut_var_code
float _cut_var_min
float _cut_var_max
int _qel_sum
int _res_sum
int _dis_sum
bool _inclusive
int _qel_bit_in_mask
int _res_bit_in_mask
int _dis_bit_in_mask
int _fin_p
int _fin_n
int _fin_pi_plus
int _fin_pi_0
int _fin_pi_minus
string _xsec_type_str
string _plot_var_str
string _flux_id_str
string _plot_range_str
string _nu_type_str
string _wcurrent_str
string _target_str
string _final_state_str
string _init_state_str
string _cut_var_str

Friends

ostream & operator<< (ostream &stream, const neugen_inputs &inputs)

Detailed Description

____________________________________________________________________________

Definition at line 25 of file neugen3_dummy.h.


Constructor & Destructor Documentation

neugen_inputs::neugen_inputs (  ) 

Definition at line 36 of file neugen_inputs.cxx.

References init().

00037 {
00038   init();
00039 }

neugen_inputs::neugen_inputs ( const neugen_inputs inputs  ) 

Definition at line 41 of file neugen_inputs.cxx.

References _cut_var_code, _cut_var_max, _cut_var_min, _cut_var_str, _dis_bit_in_mask, _dis_sum, _e, _emax, _emin, _fin_n, _fin_p, _fin_pi_0, _fin_pi_minus, _fin_pi_plus, _final_state_code, _final_state_str, _flux_id_code, _flux_id_str, _init_state_code, _init_state_str, _nbins, _nu_type_code, _nu_type_str, _plot_range_code, _plot_range_str, _plot_var_code, _plot_var_max, _plot_var_min, _plot_var_str, _process_mask_code, _qel_bit_in_mask, _qel_sum, _res_bit_in_mask, _res_sum, _target_code, _target_str, _wcurrent_code, _wcurrent_str, _xsec_type_code, _xsec_type_str, and init().

00042 {
00043   init();
00044 
00045    // neugen card params
00046 
00047   _nbins             = inputs->_nbins;       
00048   _xsec_type_code    = inputs->_xsec_type_code;
00049   _emin              = inputs->_emin;
00050   _emax              = inputs->_emax;
00051   _e                 = inputs->_e;
00052   _plot_var_code     = inputs->_plot_var_code;
00053   _flux_id_code      = inputs->_flux_id_code;
00054   _plot_range_code   = inputs->_plot_range_code;
00055   _plot_var_min      = inputs->_plot_var_min;
00056   _plot_var_max      = inputs->_plot_var_max;
00057   _nu_type_code      = inputs->_nu_type_code;
00058   _wcurrent_code     = inputs->_wcurrent_code;
00059   _target_code       = inputs->_target_code;
00060   _final_state_code  = inputs->_final_state_code;
00061   _init_state_code   = inputs->_init_state_code;
00062   _process_mask_code = inputs->_process_mask_code;
00063   _cut_var_code      = inputs->_cut_var_code;
00064   _cut_var_min       = inputs->_cut_var_min;
00065   _cut_var_max       = inputs->_cut_var_max;
00066   _qel_sum           = inputs->_qel_sum;
00067   _res_sum           = inputs->_res_sum;
00068   _dis_sum           = inputs->_dis_sum;
00069 
00070   _qel_bit_in_mask   = inputs->_qel_bit_in_mask;
00071   _res_bit_in_mask   = inputs->_res_bit_in_mask;
00072   _dis_bit_in_mask   = inputs->_dis_bit_in_mask;
00073 
00074    // aux
00075 
00076   _fin_p             = inputs->_fin_p;
00077   _fin_n             = inputs->_fin_n;       
00078   _fin_pi_plus       = inputs->_fin_pi_plus;   
00079   _fin_pi_0          = inputs->_fin_pi_0;   
00080   _fin_pi_minus      = inputs->_fin_pi_minus;  
00081   _xsec_type_str     = inputs->_xsec_type_str;
00082   _plot_var_str      = inputs->_plot_var_str;
00083   _flux_id_str       = inputs->_flux_id_str;
00084   _plot_range_str    = inputs->_plot_range_str;
00085   _nu_type_str       = inputs->_nu_type_str;
00086   _wcurrent_str      = inputs->_wcurrent_str;
00087   _target_str        = inputs->_target_str;
00088   _final_state_str   = inputs->_final_state_str;
00089   _init_state_str    = inputs->_init_state_str;
00090   _cut_var_str       = inputs->_cut_var_str;
00091 }

neugen_inputs::~neugen_inputs (  ) 

Definition at line 93 of file neugen_inputs.cxx.

00094 {
00095 
00096 }


Member Function Documentation

int neugen_inputs::bool2int ( bool  on  )  [private]

Definition at line 490 of file neugen_inputs.cxx.

Referenced by set_dis_sum(), set_qel_sum(), and set_res_sum().

00491 {
00492   if (on) return 1;
00493   else    return 0;
00494 }

void neugen_inputs::compute_process_mask ( void   )  [private]

Definition at line 459 of file neugen_inputs.cxx.

References _dis_bit_in_mask, _process_mask_code, _qel_bit_in_mask, _res_bit_in_mask, and dis.

Referenced by set_dis_bit_in_mask(), set_qel_bit_in_mask(), and set_res_bit_in_mask().

00460 {
00461   int qel, dis, res;
00462   
00463   (_qel_bit_in_mask == 1) ? qel = 0 : qel = 1;
00464   (_res_bit_in_mask == 1) ? res = 0 : res = 1;
00465   (_dis_bit_in_mask == 1) ? dis = 0 : dis = 1;
00466   
00467   _process_mask_code = qel + 2 * res + 4 * dis;
00468 }

int neugen_inputs::cut_var_code ( void   )  const [inline]

Definition at line 63 of file neugen_inputs.h.

References _cut_var_code.

00063 { return _cut_var_code;      }

float neugen_inputs::cut_var_max ( void   )  const [inline]

Definition at line 70 of file neugen_inputs.h.

References _cut_var_max.

00070 { return _cut_var_max;       }

float neugen_inputs::cut_var_min ( void   )  const [inline]

Definition at line 69 of file neugen_inputs.h.

References _cut_var_min.

00069 { return _cut_var_min;       }

string neugen_inputs::cut_var_string ( void   )  const [inline]

Definition at line 81 of file neugen_inputs.h.

References _cut_var_str.

00081 { return _cut_var_str;       }

int neugen_inputs::dis_bit_in_mask ( void   )  const [inline]

Definition at line 62 of file neugen_inputs.h.

References _dis_bit_in_mask.

00062 { return _dis_bit_in_mask;   }

bool neugen_inputs::dis_sum ( void   )  const [inline]

Definition at line 48 of file neugen_inputs.h.

References _dis_sum.

00048 { return _dis_sum == 1;      }

float neugen_inputs::energy ( void   )  const [inline]

Definition at line 66 of file neugen_inputs.h.

References _e.

00066 { return _e;                 }

float neugen_inputs::energy_max ( void   )  const [inline]

Definition at line 65 of file neugen_inputs.h.

References _emax.

00065 { return _emax;              }

float neugen_inputs::energy_min ( void   )  const [inline]

Definition at line 64 of file neugen_inputs.h.

References _emin.

00064 { return _emin;              }

string neugen_inputs::final_state_code ( void   )  const [inline]

Definition at line 71 of file neugen_inputs.h.

References _final_state_code.

00071 { return _final_state_code;  }

string neugen_inputs::final_state_string ( void   )  const [inline]

Definition at line 79 of file neugen_inputs.h.

References _final_state_str.

00079 { return _final_state_str;   }

int neugen_inputs::flux_id_code ( void   )  const [inline]

Definition at line 53 of file neugen_inputs.h.

References _flux_id_code.

00053 { return _flux_id_code;      }

string neugen_inputs::flux_id_string ( void   )  const [inline]

Definition at line 74 of file neugen_inputs.h.

References _flux_id_str.

00074 { return _flux_id_str;       }

neugen_cuts neugen_inputs::get_cuts ( void   )  const

Definition at line 216 of file neugen_inputs.cxx.

References _cut_var_code, _cut_var_max, _cut_var_min, _dis_sum, _process_mask_code, _qel_sum, _res_sum, and kinematic_variable::get_kin_var_id_from_code().

00217 {
00218   kinematic_variable_t kvid = 
00219                   kinematic_variable::get_kin_var_id_from_code(_cut_var_code);
00220 
00221   bool sumQel = (_qel_sum == 1);
00222   bool sumRes = (_res_sum == 1);
00223   bool sumDis = (_dis_sum == 1);
00224 
00225   neugen_cuts cuts(kvid, _cut_var_min, _cut_var_max, 
00226                                   _process_mask_code, sumQel, sumRes, sumDis);
00227 
00228   return cuts;
00229 }

final_state neugen_inputs::get_final_state ( void   )  const

Definition at line 207 of file neugen_inputs.cxx.

References _fin_n, _fin_p, _fin_pi_0, _fin_pi_minus, _fin_pi_plus, and final_state::setFinalState().

00208 {
00209   final_state state;
00210 
00211   state.setFinalState(_fin_p, _fin_n, _fin_pi_plus, _fin_pi_minus, _fin_pi_0);
00212 
00213   return state;
00214 }

interaction neugen_inputs::get_interaction ( void   )  const
bool neugen_inputs::inclusive ( void   )  const [inline]

Definition at line 49 of file neugen_inputs.h.

References _inclusive.

00049 { return _inclusive;         }

void neugen_inputs::init ( void   )  [private]

Definition at line 496 of file neugen_inputs.cxx.

References _cut_var_code, _cut_var_max, _cut_var_min, _cut_var_str, _dis_bit_in_mask, _dis_sum, _e, _emax, _emin, _fin_n, _fin_p, _fin_pi_0, _fin_pi_minus, _fin_pi_plus, _final_state_code, _final_state_str, _flux_id_code, _flux_id_str, _init_state_code, _init_state_str, _nbins, _nu_type_code, _nu_type_str, _plot_range_code, _plot_range_str, _plot_var_code, _plot_var_max, _plot_var_min, _plot_var_str, _process_mask_code, _qel_bit_in_mask, _qel_sum, _res_bit_in_mask, _res_sum, _target_code, _target_str, _wcurrent_code, _wcurrent_str, _xsec_type_code, and _xsec_type_str.

Referenced by neugen_inputs().

00497 {
00498   //-- init neugen cards variables
00499   
00500   _nbins             = 0;
00501   _xsec_type_code    = 0;
00502   _emin              = 0;
00503   _emax              = 0;
00504   _e                 = 0;
00505   _plot_var_code     = 0;
00506   _flux_id_code      = 0;
00507   _plot_range_code   = 0;
00508   _plot_var_min      = 0;
00509   _plot_var_max      = 0;
00510   _nu_type_code      = 0;
00511   _wcurrent_code     = 0;
00512   _target_code       = 0;
00513   _final_state_code  = "00000";
00514   _init_state_code   = 0;
00515   _process_mask_code = 0;
00516   _cut_var_code      = 0;
00517   _cut_var_min       = 0;
00518   _cut_var_max       = 0;
00519   _qel_sum           = 0;
00520   _res_sum           = 0;
00521   _dis_sum           = 0;
00522 
00523   _qel_bit_in_mask   = 0;
00524   _res_bit_in_mask   = 0;
00525   _dis_bit_in_mask   = 0;
00526 
00527   //-- init auxiliary variables
00528 
00529   _fin_p             = 0;
00530   _fin_n             = 0;
00531   _fin_pi_plus       = 0;
00532   _fin_pi_0          = 0;
00533   _fin_pi_minus      = 0;
00534   
00535   _xsec_type_str     = "";
00536   _plot_var_str      = "";
00537   _flux_id_str       = "";
00538   _plot_range_str    = "";
00539   _nu_type_str       = "";
00540   _wcurrent_str      = "";
00541   _target_str        = "";
00542   _final_state_str   = "";
00543   _init_state_str    = "";
00544   _cut_var_str       = "";    
00545 }

int neugen_inputs::init_state_code ( void   )  const [inline]

Definition at line 58 of file neugen_inputs.h.

References _init_state_code.

00058 { return _init_state_code;   }

string neugen_inputs::init_state_string ( void   )  const [inline]

Definition at line 80 of file neugen_inputs.h.

References _init_state_str.

00080 { return _init_state_str;    }

int neugen_inputs::n_matches ( string  input,
string  pattern 
) [private]

Definition at line 470 of file neugen_inputs.cxx.

Referenced by neugen_final_state_code().

00471 {
00472   // if max = 1 then this is ok - do something more generic later
00473   
00474   if (input.find(pattern) != string::npos) return 1;
00475   else return 0;
00476 
00477   /*
00478   string::size_type pos = 0;
00479   int n=0;
00480   
00481   while( (pos = input.find_first_of(pattern, pos)) != string::npos ) {
00482 
00483       n++;
00484       input.erase(pos, pattern.length());
00485   }
00486   return n;
00487   */
00488 }

int neugen_inputs::nbins ( void   )  const [inline]

Definition at line 50 of file neugen_inputs.h.

References _nbins.

00050 { return _nbins;             }

string neugen_inputs::neugen_final_state_code ( string  fin_state  )  [private]

Definition at line 415 of file neugen_inputs.cxx.

References _fin_n, _fin_p, _fin_pi_0, _fin_pi_minus, _fin_pi_plus, and n_matches().

Referenced by set_final_state().

00416 {
00417 // build neugen's final state - in the form (pn+-0)
00418 
00419   _fin_p        = 0;   // init
00420   _fin_n        = 0;
00421   _fin_pi_plus  = 0;
00422   _fin_pi_0     = 0;
00423   _fin_pi_minus = 0;
00424 
00425   _fin_p        = n_matches(fin_state, "p ");
00426   _fin_n        = n_matches(fin_state, "n ");
00427   _fin_pi_plus  = n_matches(fin_state, "pi(+)");
00428   _fin_pi_0     = n_matches(fin_state, "pi(0)");
00429   _fin_pi_minus = n_matches(fin_state, "pi(-)");
00430 
00431   ostringstream code;
00432 
00433   code << _fin_p << _fin_n << _fin_pi_plus << _fin_pi_minus << _fin_pi_0;
00434 
00435   return code.str();
00436 }

int neugen_inputs::neugen_flux_code ( string  flux  )  [private]

Definition at line 382 of file neugen_inputs.cxx.

Referenced by set_flux().

00383 {
00384   if      (flux.find("ANL")  != string::npos) return 1;
00385   else if (flux.find("GGM")  != string::npos) return 2;
00386   else if (flux.find("BNL")  != string::npos) return 3;
00387   else if (flux.find("BEBC") != string::npos) return 4;
00388   else return 0;  
00389 }

int neugen_inputs::neugen_initial_state_code ( string  init_state  )  [private]

Definition at line 438 of file neugen_inputs.cxx.

Referenced by set_initial_state().

00439 {
00440   if      (init_state.find("nu + p")     != string::npos) return 1;
00441   else if (init_state.find("nu + n")     != string::npos) return 2;
00442   else if (init_state.find("nu_bar + p") != string::npos) return 3;
00443   else if (init_state.find("nu_bar + n") != string::npos) return 4;
00444   else if (init_state.find("nu + N")     != string::npos) return 5; // ????
00445   else if (init_state.find("nu_bar + N") != string::npos) return 6; // ????
00446   else                                              return 0;
00447 }

int neugen_inputs::neugen_neutrino_code ( string  neutrino  )  [private]

Definition at line 397 of file neugen_inputs.cxx.

Referenced by set_neutrino().

00398 {
00399   if      (neutrino.find("nu_e")       != string::npos) return  5;
00400   else if (neutrino.find("nu_e_bar")   != string::npos) return  6;
00401   else if (neutrino.find("nu_mu")      != string::npos) return  7;
00402   else if (neutrino.find("nu_mu_bar")  != string::npos) return  8;
00403   else if (neutrino.find("nu_tau")     != string::npos) return  9;
00404   else if (neutrino.find("nu_tau_bar") != string::npos) return 10;
00405   else                                                  return  0;
00406 }

int neugen_inputs::neugen_plot_range_code ( string  range  )  [private]

Definition at line 391 of file neugen_inputs.cxx.

Referenced by set_range().

00392 {
00393   if (range.find("custom") != string::npos) return 2;
00394   else return 1;
00395 }

int neugen_inputs::neugen_variable_code ( string  plot_variable  )  [private]

Definition at line 449 of file neugen_inputs.cxx.

Referenced by set_cut_var(), and set_plot_var().

00450 {
00451   if      (cut_variable.find("none")  != string::npos) return 0;
00452   else if (cut_variable.find("|q^2|") != string::npos) return 1;
00453   else if (cut_variable.find("W")     != string::npos) return 2;
00454   else if (cut_variable.find("x")     != string::npos) return 3;
00455   else if (cut_variable.find("y")     != string::npos) return 4;
00456   else                                                 return 0;
00457 }      

int neugen_inputs::neugen_weak_current_code ( string  wcurrent  )  [private]

Definition at line 408 of file neugen_inputs.cxx.

Referenced by set_wcurrent().

00409 {
00410   if (wcurrent.find("+") != string::npos)       return 3;
00411   else if (wcurrent.find("NC") != string::npos) return 2;
00412   else                                          return 1;
00413 }

int neugen_inputs::neugen_xsec_type_code ( string  xsec_type  )  [private]

Definition at line 376 of file neugen_inputs.cxx.

Referenced by set_xsec_type().

00377 {
00378   if (xsec_type.find("differential") != string::npos) return 2;
00379   else return 1;
00380 }

int neugen_inputs::nu_type_code ( void   )  const [inline]

Definition at line 55 of file neugen_inputs.h.

References _nu_type_code.

00055 { return _nu_type_code;      }

string neugen_inputs::nu_type_string ( void   )  const [inline]

Definition at line 76 of file neugen_inputs.h.

References _nu_type_str.

00076 { return _nu_type_str;       }

int neugen_inputs::plot_range_code ( void   )  const [inline]

Definition at line 54 of file neugen_inputs.h.

References _plot_range_code.

00054 { return _plot_range_code;   }

string neugen_inputs::plot_range_string ( void   )  const [inline]

Definition at line 75 of file neugen_inputs.h.

References _plot_range_str.

00075 { return _plot_range_str;    }

int neugen_inputs::plot_var_code ( void   )  const [inline]

Definition at line 52 of file neugen_inputs.h.

References _plot_var_code.

00052 { return _plot_var_code;     }

float neugen_inputs::plot_var_max ( void   )  const [inline]

Definition at line 68 of file neugen_inputs.h.

References _plot_var_max.

00068 { return _plot_var_max;      }

float neugen_inputs::plot_var_min ( void   )  const [inline]

Definition at line 67 of file neugen_inputs.h.

References _plot_var_min.

00067 { return _plot_var_min;      }

string neugen_inputs::plot_var_string ( void   )  const [inline]

Definition at line 73 of file neugen_inputs.h.

References _plot_var_str.

00073 { return _plot_var_str;      }

void neugen_inputs::print ( ostream &  stream  )  const

Definition at line 547 of file neugen_inputs.cxx.

References _cut_var_code, _cut_var_max, _cut_var_min, _dis_bit_in_mask, _dis_sum, _e, _emax, _emin, _final_state_code, _flux_id_code, _init_state_code, _nbins, _nu_type_code, _plot_range_code, _plot_var_code, _plot_var_max, _plot_var_min, _process_mask_code, _qel_bit_in_mask, _qel_sum, _res_bit_in_mask, _res_sum, _target_code, _wcurrent_code, and _xsec_type_code.

00548 {
00549   stream << "number of bins =  " << _nbins             << endl;
00550   stream << "xsec type =       " << _xsec_type_code    << endl;
00551   stream << "E min =           " << _emin              << endl;
00552   stream << "E max =           " << _emax              << endl;
00553   stream << "E =               " << _e                 << endl;
00554   stream << "plot var =        " << _plot_var_code     << endl;
00555   stream << "flux id =         " << _flux_id_code      << endl;
00556   stream << "plot range =      " << _plot_range_code   << endl;
00557   stream << "plot var - min =  " << _plot_var_min      << endl;
00558   stream << "plot var - max =  " << _plot_var_max      << endl;
00559   stream << "neutrino type =   " << _nu_type_code      << endl;
00560   stream << "weak current =    " << _wcurrent_code     << endl;
00561   stream << "target =          " << _target_code       << endl;
00562   stream << "final state =     " << _final_state_code  << endl;
00563   stream << "initial state =   " << _init_state_code   << endl;
00564   stream << "process mask =    " << _process_mask_code << endl;
00565   stream << "qel bit in mask = " << _qel_bit_in_mask   << endl;
00566   stream << "res bit in mask = " << _res_bit_in_mask   << endl;
00567   stream << "dis bit in mask = " << _dis_bit_in_mask   << endl;
00568   stream << "cut variable =    " << _cut_var_code      << endl;
00569   stream << "cut var - min =   " << _cut_var_min       << endl;
00570   stream << "cut var - max =   " << _cut_var_max       << endl;
00571   stream << "qel sum =         " << _qel_sum           << endl;
00572   stream << "res sum =         " << _res_sum           << endl;
00573   stream << "dis sum =         " << _dis_sum           << endl;
00574 }

int neugen_inputs::process_mask_code ( void   )  const [inline]

Definition at line 59 of file neugen_inputs.h.

References _process_mask_code.

00059 { return _process_mask_code; }

int neugen_inputs::qel_bit_in_mask ( void   )  const [inline]

Definition at line 60 of file neugen_inputs.h.

References _qel_bit_in_mask.

00060 { return _qel_bit_in_mask;   }

bool neugen_inputs::qel_sum ( void   )  const [inline]

Definition at line 46 of file neugen_inputs.h.

References _qel_sum.

00046 { return _qel_sum == 1;      }

int neugen_inputs::res_bit_in_mask ( void   )  const [inline]

Definition at line 61 of file neugen_inputs.h.

References _res_bit_in_mask.

00061 { return _res_bit_in_mask;   }

bool neugen_inputs::res_sum ( void   )  const [inline]

Definition at line 47 of file neugen_inputs.h.

References _res_sum.

00047 { return _res_sum == 1;      }

void neugen_inputs::set_cut_var ( string  variable  ) 

Definition at line 324 of file neugen_inputs.cxx.

References _cut_var_code, _cut_var_str, and neugen_variable_code().

00325 {
00326   _cut_var_str  = cut_variable;
00327   _cut_var_code = neugen_variable_code(cut_variable);
00328 }

void neugen_inputs::set_cut_var_max ( float  var_max  ) 

Definition at line 335 of file neugen_inputs.cxx.

References _cut_var_max.

00336 {
00337   _cut_var_max = var_max;
00338 }

void neugen_inputs::set_cut_var_min ( float  var_min  ) 

Definition at line 330 of file neugen_inputs.cxx.

References _cut_var_min.

00331 {
00332   _cut_var_min = var_min;
00333 }

void neugen_inputs::set_dis_bit_in_mask ( bool  on  ) 

Definition at line 250 of file neugen_inputs.cxx.

References _dis_bit_in_mask, and compute_process_mask().

00251 {
00252   ( on ) ? _dis_bit_in_mask = 1 : _dis_bit_in_mask = 0;
00253 
00254   compute_process_mask();
00255 }

void neugen_inputs::set_dis_sum ( bool  on  ) 

Definition at line 359 of file neugen_inputs.cxx.

References _dis_sum, and bool2int().

Referenced by set_inclusive().

00360 {
00361   _dis_sum  = bool2int(on);
00362 }

void neugen_inputs::set_e ( float  e  ) 

Definition at line 273 of file neugen_inputs.cxx.

References _e.

00274 {
00275   _e = e;
00276 }

void neugen_inputs::set_e_max ( float  e_max  ) 

Definition at line 268 of file neugen_inputs.cxx.

References _emax.

00269 {
00270   _emax = e_max;
00271 }

void neugen_inputs::set_e_min ( float  e_min  ) 

Definition at line 263 of file neugen_inputs.cxx.

References _emin.

00264 {
00265   _emin = e_min;
00266 }

void neugen_inputs::set_final_state ( string  fin_state  ) 

Definition at line 364 of file neugen_inputs.cxx.

References _final_state_code, _final_state_str, and neugen_final_state_code().

00365 {
00366   _final_state_str  = fin_state;
00367   _final_state_code = neugen_final_state_code(fin_state);
00368 }

void neugen_inputs::set_flux ( string  flux  ) 

Definition at line 284 of file neugen_inputs.cxx.

References _flux_id_code, _flux_id_str, and neugen_flux_code().

00285 {
00286   _flux_id_str  = flux;
00287   _flux_id_code = neugen_flux_code(flux);
00288 }

void neugen_inputs::set_inclusive ( bool  on  ) 

Definition at line 340 of file neugen_inputs.cxx.

References _inclusive, set_dis_sum(), set_qel_sum(), and set_res_sum().

00341 {
00342   _inclusive = on;
00343   
00344   set_qel_sum(on);
00345   set_res_sum(on);
00346   set_dis_sum(on);
00347 }

void neugen_inputs::set_initial_state ( string  init_state  ) 
void neugen_inputs::set_nbins ( int  nbins  ) 

Definition at line 231 of file neugen_inputs.cxx.

References _nbins.

00232 {
00233   _nbins = nbins;
00234 }

void neugen_inputs::set_neutrino ( string  neutrino  ) 

Definition at line 306 of file neugen_inputs.cxx.

References _nu_type_code, _nu_type_str, and neugen_neutrino_code().

00307 {
00308   _nu_type_str  = neutrino;
00309   _nu_type_code = neugen_neutrino_code(neutrino);
00310 }

void neugen_inputs::set_plot_var ( string  variable  ) 

Definition at line 278 of file neugen_inputs.cxx.

References _plot_var_code, _plot_var_str, and neugen_variable_code().

00279 {
00280   _plot_var_str  = plot_variable;
00281   _plot_var_code = neugen_variable_code(plot_variable);
00282 }

void neugen_inputs::set_plot_var_max ( float  var_max  ) 

Definition at line 301 of file neugen_inputs.cxx.

References _plot_var_max.

00302 {
00303   _plot_var_max = var_max;
00304 }

void neugen_inputs::set_plot_var_min ( float  var_min  ) 

Definition at line 296 of file neugen_inputs.cxx.

References _plot_var_min.

00297 {
00298   _plot_var_min = var_min;
00299 }

void neugen_inputs::set_qel_bit_in_mask ( bool  on  ) 

Definition at line 236 of file neugen_inputs.cxx.

References _qel_bit_in_mask, and compute_process_mask().

00237 {
00238   ( on ) ? _qel_bit_in_mask = 1 : _qel_bit_in_mask = 0;
00239 
00240   compute_process_mask();
00241 }

void neugen_inputs::set_qel_sum ( bool  on  ) 

Definition at line 349 of file neugen_inputs.cxx.

References _qel_sum, and bool2int().

Referenced by set_inclusive().

00350 {
00351   _qel_sum  = bool2int(on);
00352 }

void neugen_inputs::set_range ( string  range  ) 

Definition at line 290 of file neugen_inputs.cxx.

References _plot_range_code, _plot_range_str, and neugen_plot_range_code().

00291 {
00292   _plot_range_str  = range;
00293   _plot_range_code = neugen_plot_range_code(range);
00294 }

void neugen_inputs::set_res_bit_in_mask ( bool  on  ) 

Definition at line 243 of file neugen_inputs.cxx.

References _res_bit_in_mask, and compute_process_mask().

00244 {
00245   ( on ) ? _res_bit_in_mask = 1 : _res_bit_in_mask = 0;
00246 
00247   compute_process_mask();
00248 }

void neugen_inputs::set_res_sum ( bool  on  ) 

Definition at line 354 of file neugen_inputs.cxx.

References _res_sum, and bool2int().

Referenced by set_inclusive().

00355 {
00356   _res_sum  = bool2int(on);
00357 }

void neugen_inputs::set_target ( string  target  ) 

Definition at line 318 of file neugen_inputs.cxx.

References _target_code, and _target_str.

00319 {
00320   _target_str  = ""; // unused
00321   _target_code = 0;  // unused
00322 }

void neugen_inputs::set_wcurrent ( string  wcurrent  ) 

Definition at line 312 of file neugen_inputs.cxx.

References _wcurrent_code, _wcurrent_str, and neugen_weak_current_code().

00313 {
00314   _wcurrent_str  = wcurrent;
00315   _wcurrent_code = neugen_weak_current_code(wcurrent);
00316 }

void neugen_inputs::set_xsec_type ( string  xsec_type  ) 

Definition at line 257 of file neugen_inputs.cxx.

References _xsec_type_code, _xsec_type_str, and neugen_xsec_type_code().

00258 {
00259   _xsec_type_str  = xsec_type;
00260   _xsec_type_code = neugen_xsec_type_code(xsec_type);
00261 }

int neugen_inputs::target_code ( void   )  const [inline]

Definition at line 57 of file neugen_inputs.h.

References _target_code.

00057 { return _target_code;       }

string neugen_inputs::target_string ( void   )  const [inline]

Definition at line 78 of file neugen_inputs.h.

References _target_str.

00078 { return _target_str;        }

int neugen_inputs::wcurrent_code ( void   )  const [inline]

Definition at line 56 of file neugen_inputs.h.

References _wcurrent_code.

00056 { return _wcurrent_code;     }

string neugen_inputs::wcurrent_string ( void   )  const [inline]

Definition at line 77 of file neugen_inputs.h.

References _wcurrent_str.

00077 { return _wcurrent_str;      }

void neugen_inputs::write_neugen_input_card ( const char *  filename  )  const

Definition at line 98 of file neugen_inputs.cxx.

References _cut_var_code, _cut_var_max, _cut_var_min, _dis_sum, _e, _emax, _emin, _final_state_code, _flux_id_code, _init_state_code, _nbins, _nu_type_code, _plot_range_code, _plot_var_code, _plot_var_max, _plot_var_min, _process_mask_code, _qel_sum, _res_sum, _target_code, _wcurrent_code, and _xsec_type_code.

Referenced by nulook_wrapper::create_neugen_inputs_card().

00099 {
00100 // This methods writes out the object state in the form of 'data cards' that
00101 // NeuGEN understands.
00102 //  
00103   ofstream data_card(filename);
00104 
00105   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00106             << _nbins
00107             << " \\\\ nbins:  number of points in plot "
00108             << endl;
00109   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00110             << _xsec_type_code
00111             << " \\\\ xsec type: 1=total, 2=differential "
00112             << endl;
00113   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00114             << _emin
00115             << " \\\\ xsec type=1 - Emin "
00116             << endl;
00117   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00118             << _emax
00119             << " \\\\             - Emax "
00120             << endl;
00121   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00122             << _e
00123             << " \\\\ xsec type=2 - E "
00124             << endl;
00125   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00126             << _plot_var_code
00127             << " \\\\ plot variable "
00128             << endl;
00129   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00130             << _flux_id_code
00131             << " \\\\ flux id (1=ANL, 2=GGM, 3=BNL, 4=BEBC) "
00132             << endl;;
00133   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00134             << _plot_range_code
00135             << " \\\\ plot  range (1=auto, 2=custom) "
00136             << endl;
00137   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00138             << _plot_var_min
00139             << " \\\\ plot range - min "
00140             << endl;
00141   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00142             << _plot_var_max
00143             << " \\\\            - max "
00144             << endl;
00145   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00146             << _nu_type_code
00147             << " \\\\ neutrino (nue/bar=5/6, numu/bar=7/8, nutau/bar=9/10 "
00148             << endl;
00149   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00150             << _wcurrent_code
00151             << " \\\\ weak current (1=CC, 2=NC, 3=BOTH) "
00152             << endl;
00153   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00154             << _target_code
00155             << " \\\\ target: nucleus / particle code, -1 for isoscalar "
00156             << endl;
00157   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00158             << _final_state_code
00159             << " \\\\ final state - in the form pn+-0 "
00160             << endl;
00161   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00162             << _init_state_code
00163             << " \\\\ initial state - (1=v-p, 2=v-n, 3=vbar-p, 4=vbar-n "
00164             << endl;
00165   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00166             << _process_mask_code
00167             << " \\\\ process mask: bits for qel, res, dis, coh "
00168             << endl;
00169   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00170             << _cut_var_code
00171             << " \\\\ cuts variable (0=none, 1=|q^2|, 2=W, 3=x, 4=y "
00172             << endl;
00173   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00174             << _cut_var_min
00175             << " \\\\ cut variable - min "
00176             << endl;
00177   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00178             << _cut_var_max
00179             << " \\\\             - max "
00180             << endl;
00181   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00182             << _qel_sum 
00183             << " \\\\ qelsum: >0 means add qel channel "
00184             << endl;
00185   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00186             << _res_sum 
00187             << " \\\\ ressum: >0 means add all res channels "
00188             << endl;
00189   data_card << setiosflags(ios::left) << setfill(' ') << setw(9)
00190             << _dis_sum 
00191             << " \\\\ dissum: >0 means add all dis "
00192             << endl;
00193 }

int neugen_inputs::xsec_type_code ( void   )  const [inline]

Definition at line 51 of file neugen_inputs.h.

References _xsec_type_code.

00051 { return _xsec_type_code;    }

string neugen_inputs::xsec_type_string ( void   )  const [inline]

Definition at line 72 of file neugen_inputs.h.

References _xsec_type_str.

00072 { return _xsec_type_str;     }


Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const neugen_inputs inputs 
) [friend]

Member Data Documentation

float neugen_inputs::_cut_var_max [private]
float neugen_inputs::_cut_var_min [private]
string neugen_inputs::_cut_var_str [private]

Definition at line 172 of file neugen_inputs.h.

Referenced by cut_var_string(), init(), neugen_inputs(), and set_cut_var().

int neugen_inputs::_dis_sum [private]
float neugen_inputs::_e [private]

Definition at line 131 of file neugen_inputs.h.

Referenced by energy(), init(), neugen_inputs(), print(), set_e(), and write_neugen_input_card().

float neugen_inputs::_emax [private]
float neugen_inputs::_emin [private]
int neugen_inputs::_fin_n [private]

Definition at line 158 of file neugen_inputs.h.

Referenced by get_final_state(), init(), neugen_final_state_code(), and neugen_inputs().

int neugen_inputs::_fin_p [private]

Definition at line 157 of file neugen_inputs.h.

Referenced by get_final_state(), init(), neugen_final_state_code(), and neugen_inputs().

int neugen_inputs::_fin_pi_0 [private]

Definition at line 160 of file neugen_inputs.h.

Referenced by get_final_state(), init(), neugen_final_state_code(), and neugen_inputs().

Definition at line 161 of file neugen_inputs.h.

Referenced by get_final_state(), init(), neugen_final_state_code(), and neugen_inputs().

Definition at line 159 of file neugen_inputs.h.

Referenced by get_final_state(), init(), neugen_final_state_code(), and neugen_inputs().

Definition at line 170 of file neugen_inputs.h.

Referenced by final_state_string(), init(), neugen_inputs(), and set_final_state().

string neugen_inputs::_flux_id_str [private]

Definition at line 165 of file neugen_inputs.h.

Referenced by flux_id_string(), init(), neugen_inputs(), and set_flux().

bool neugen_inputs::_inclusive [private]

Definition at line 149 of file neugen_inputs.h.

Referenced by inclusive(), and set_inclusive().

Definition at line 171 of file neugen_inputs.h.

Referenced by init(), init_state_string(), neugen_inputs(), and set_initial_state().

int neugen_inputs::_nbins [private]

Definition at line 127 of file neugen_inputs.h.

Referenced by init(), nbins(), neugen_inputs(), print(), set_nbins(), and write_neugen_input_card().

string neugen_inputs::_nu_type_str [private]

Definition at line 167 of file neugen_inputs.h.

Referenced by init(), neugen_inputs(), nu_type_string(), and set_neutrino().

Definition at line 166 of file neugen_inputs.h.

Referenced by init(), neugen_inputs(), plot_range_string(), and set_range().

string neugen_inputs::_plot_var_str [private]

Definition at line 164 of file neugen_inputs.h.

Referenced by init(), neugen_inputs(), plot_var_string(), and set_plot_var().

int neugen_inputs::_qel_sum [private]
int neugen_inputs::_res_sum [private]
string neugen_inputs::_target_str [private]

Definition at line 169 of file neugen_inputs.h.

Referenced by init(), neugen_inputs(), set_target(), and target_string().

string neugen_inputs::_wcurrent_str [private]

Definition at line 168 of file neugen_inputs.h.

Referenced by init(), neugen_inputs(), set_wcurrent(), and wcurrent_string().

Definition at line 163 of file neugen_inputs.h.

Referenced by init(), neugen_inputs(), set_xsec_type(), and xsec_type_string().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1