gRwght1Param.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \program grwght1p
5 
6 \brief Generates weights given an input GHEP event file and for a given
7  (single) systematic parameter (supported by the ReWeight package).
8  It outputs a ROOT file containing a tree with an entry for every
9  input event. Each such tree entry contains a TArrayF of all computed
10  weights and a TArrayF of all used tweak dial values.
11 
12 \syntax grwght1scan \
13  -f input_event_file
14  [-n n1[,n2]]
15  -s systematic
16  -t n_twk_diall_values
17  [--min-tweak minimum_tweak_value]
18  [--max-tweak maximum_tweak_value]
19  [-p neutrino_codes]
20  [-o output_weights_file]
21  [--seed random_number_seed]
22  [--message-thresholds xml_file]
23  [--event-record-print-level level]
24 
25  where
26  [] is an optional argument.
27 
28  -f
29  Specifies a GHEP input file.
30  -n
31  Specifies an event range.
32  Examples:
33  - Type `-n 50,2350' to process all 2301 events from 50 up to 2350.
34  Note: Both 50 and 2350 are included.
35  - Type `-n 1000' to process the first 1000 events;
36  from event number 0 up to event number 999.
37  This is an optional argument.
38  By default GENIE will process all events.
39  -t
40  Specified the number of tweak dial values between a minimum and a
41  maximum value
42  --min-tweak
43  Specifies the minimum value of the tweaked parameter.
44  Default: -5 (corresponds to -5\sigma)
45  --max-tweak
46  Specifies the maximum value of the tweaked parameter.
47  Default: +5 (corresponds to +5\sigma)
48  -s
49  Specifies the systematic param to tweak.
50  See $GENIE/src/ReWeight/GSyst.h for a list of parameters and
51  their corresponding label, which is what should be input here.
52  -p
53  If set, grwght1scan reweights *only* the specified neutrino
54  species. The input is a comma separated list of PDG codes.
55  This is an optional argument.
56  By default GENIE will reweight all neutrino species.
57  -o
58  Specifies the filename of the output weight file.
59  This is an optional argument.
60  By default filename is weights_<name_of_systematic_param>.root.
61  --seed
62  Random number seed.
63  --message-thresholds
64  Allows users to customize the message stream thresholds.
65  The thresholds are specified using an XML file.
66  See $GENIE/config/Messenger.xml for the XML schema.
67 
68 \author Jim Dobson
69  Imperial College London
70 
71  Costas Andreopoulos, Jelena Ilic, Nick Grant
72  University of Liverpool & STFC Rutherford Appleton Lab
73 
74 \created June 10, 2010
75 
76 \cpright Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
77  For the full text of the license visit http://copyright.genie-mc.org
78  or see $GENIE/LICENSE
79 */
80 //____________________________________________________________________________
81 
82 #include <string>
83 #include <sstream>
84 #include <cassert>
85 
86 #include <TSystem.h>
87 #include <TFile.h>
88 #include <TTree.h>
89 #include <TArrayF.h>
90 
91 #include "EVGCore/EventRecord.h"
92 #include "GHEP/GHepParticle.h"
93 #include "Ntuple/NtpMCFormat.h"
94 #include "Ntuple/NtpMCTreeHeader.h"
96 #include "Messenger/Messenger.h"
97 #include "Numerical/RandomGen.h"
98 #include "PDG/PDGCodes.h"
99 #include "PDG/PDGCodeList.h"
100 #include "ReWeight/GReWeightI.h"
101 #include "ReWeight/GSystSet.h"
102 #include "ReWeight/GSyst.h"
103 #include "ReWeight/GReWeight.h"
109 #include "ReWeight/GReWeightFGM.h"
112 #include "ReWeight/GReWeightFZone.h"
113 #include "ReWeight/GReWeightINuke.h"
114 #include "ReWeight/GReWeightAGKY.h"
119 #include "Utils/AppInit.h"
120 #include "Utils/RunOpt.h"
121 #include "Utils/CmdLnArgParser.h"
122 
123 using std::string;
124 using std::ostringstream;
125 
126 using namespace genie;
127 using namespace genie::rew;
128 
129 void GetCommandLineArgs (int argc, char ** argv);
130 void PrintSyntax (void);
131 void GetEventRange (Long64_t nev_in_file, Long64_t & nfirst, Long64_t & nlast);
132 
133 string gOptInpFilename; ///< name for input file (contains input event tree)
134 string gOptOutFilename; ///< name for output file (contains the output weight tree)
135 Long64_t gOptNEvt1; ///< range of events to process (1st input, if any)
136 Long64_t gOptNEvt2; ///< range of events to process (2nd input, if any)
137 GSyst_t gOptSyst; ///< input systematic param
138 int gOptInpNTwk; ///< # of tweaking dial values in the specified range
139 double gOptMinTwk; ///< Minimum value of tweaked dial
140 double gOptMaxTwk; ///< Maximum value of tweaked dial
141 PDGCodeList gOptNu(false); ///< neutrinos to consider
142 long int gOptRanSeed; ///< random number seed
143 
144 //___________________________________________________________________
145 int main(int argc, char ** argv)
146 {
147  GetCommandLineArgs (argc, argv);
148 
149  utils::app_init::MesgThresholds(RunOpt::Instance()->MesgThresholdFiles());
151  GHepRecord::SetPrintLevel(RunOpt::Instance()->EventRecordPrintLevel());
152 
153  // Get the input event sample
154  TTree * tree = 0;
155  NtpMCTreeHeader * thdr = 0;
156  TFile file(gOptInpFilename.c_str(),"READ");
157  tree = dynamic_cast <TTree *> ( file.Get("gtree") );
158  thdr = dynamic_cast <NtpMCTreeHeader *> ( file.Get("header") );
159  LOG("grwght1scan", pNOTICE) << "Input tree header: " << *thdr;
160  if(!tree){
161  LOG("grwght1scan", pFATAL)
162  << "Can't find a GHEP tree in input file: "<< file.GetName();
163  gAbortingInErr = true;
164  PrintSyntax();
165  exit(1);
166  }
167  NtpMCEventRecord * mcrec = 0;
168  tree->SetBranchAddress("gmcrec", &mcrec);
169 
170  Long64_t nev_in_file = tree->GetEntries();
171 
172  // The tweaking dial takes N values between [-1,1]
173 
174  const int n_points = gOptInpNTwk;
175  const float twk_dial_min = gOptMinTwk;
176  const float twk_dial_max = gOptMaxTwk;
177  const float twk_dial_step = (twk_dial_max - twk_dial_min) / (n_points-1);
178 
179  // Work-out the range of events to process
180  Long64_t nfirst = 0;
181  Long64_t nlast = 0;
182  GetEventRange(nev_in_file, nfirst, nlast);
183 
184  Long64_t nev = (nlast - nfirst + 1);
185 
186  //
187  // Summarize
188  //
189 
190  LOG("grwght1scan", pNOTICE)
191  << "\n"
192  << "\n** grwght1scan: Will start processing events promptly."
193  << "\nHere is a summary of inputs: "
194  << "\n - Input event file: " << gOptInpFilename
195  << "\n - Processing: " << nev << " events in the range [" << nfirst << ", " << nlast << "]"
196  << "\n - Systematic parameter to tweak: " << GSyst::AsString(gOptSyst)
197  << "\n - Number of tweak dial values in [" << gOptMinTwk << ", " << gOptMaxTwk << "] : " << gOptInpNTwk
198  << "\n - Neutrino species to reweight : " << gOptNu
199  << "\n - Output weights to be saved in : " << gOptOutFilename
200  << "\n - Specified random number seed : " << gOptRanSeed
201  << "\n\n";
202 
203 
204  // Declare the weights and twkdial arrays
205  const int n_events = (const int) nev;
206  float weights [n_events][n_points];
207  float twkdials [n_events][n_points];
208 
209  // Create a GReWeight object and add to it a set of weight calculators
210 
211  GReWeight rw;
212  rw.AdoptWghtCalc( "xsec_ncel", new GReWeightNuXSecNCEL );
213  rw.AdoptWghtCalc( "xsec_ccqe", new GReWeightNuXSecCCQE );
214  rw.AdoptWghtCalc( "xsec_ccqe_axial", new GReWeightNuXSecCCQEaxial );
215  rw.AdoptWghtCalc( "xsec_ccqe_vec", new GReWeightNuXSecCCQEvec );
216  rw.AdoptWghtCalc( "xsec_ccres", new GReWeightNuXSecCCRES );
217  rw.AdoptWghtCalc( "xsec_ncres", new GReWeightNuXSecNCRES );
218  rw.AdoptWghtCalc( "xsec_nonresbkg", new GReWeightNonResonanceBkg );
219  rw.AdoptWghtCalc( "xsec_coh", new GReWeightNuXSecCOH );
220  rw.AdoptWghtCalc( "xsec_dis", new GReWeightNuXSecDIS );
221  rw.AdoptWghtCalc( "nuclear_qe", new GReWeightFGM );
222  rw.AdoptWghtCalc( "nuclear_dis", new GReWeightDISNuclMod );
223  rw.AdoptWghtCalc( "hadro_res_decay", new GReWeightResonanceDecay );
224  rw.AdoptWghtCalc( "hadro_fzone", new GReWeightFZone );
225  rw.AdoptWghtCalc( "hadro_intranuke", new GReWeightINuke );
226  rw.AdoptWghtCalc( "hadro_agky", new GReWeightAGKY );
227 
228  // Get GSystSet and include the (single) input systematic parameter
229 
230  GSystSet & syst = rw.Systematics();
231  syst.Init(gOptSyst);
232 
233  // Fine-tune weight calculators
234 
235  if(gOptSyst == kXSecTwkDial_MaCCQE) {
236  // By default GReWeightNuXSecCCQE is in `NormAndMaShape' mode
237  // where Ma affects the shape of dsigma/dQ2 and a different param affects the normalization
238  // If the input is MaCCQE, switch the weight calculator to `Ma' mode
239  GReWeightNuXSecCCQE * rwccqe =
240  dynamic_cast<GReWeightNuXSecCCQE *> (rw.WghtCalc("xsec_ccqe"));
242  }
243  if(gOptSyst == kXSecTwkDial_MaCCRES || gOptSyst == kXSecTwkDial_MvCCRES) {
244  // As above, but for the GReWeightNuXSecCCRES weight calculator
245  GReWeightNuXSecCCRES * rwccres =
246  dynamic_cast<GReWeightNuXSecCCRES *> (rw.WghtCalc("xsec_ccres"));
248  }
249  if(gOptSyst == kXSecTwkDial_MaNCRES || gOptSyst == kXSecTwkDial_MvNCRES) {
250  // As above, but for the GReWeightNuXSecNCRES weight calculator
251  GReWeightNuXSecNCRES * rwncres =
252  dynamic_cast<GReWeightNuXSecNCRES *> (rw.WghtCalc("xsec_ncres"));
254  }
255  if(gOptSyst == kXSecTwkDial_AhtBYshape || gOptSyst == kXSecTwkDial_BhtBYshape ||
256  gOptSyst == kXSecTwkDial_CV1uBYshape || gOptSyst == kXSecTwkDial_CV2uBYshape ) {
257  // Similarly for the GReWeightNuXSecDIS weight calculator.
258  // There the default behaviour is for the Aht, Bht, CV1u and CV2u Bodek-Yang
259  // params to affects both normalization and dsigma/dxdy shape.
260  // Switch mode if a shape-only param is specified.
261  GReWeightNuXSecDIS * rwdis =
262  dynamic_cast<GReWeightNuXSecDIS *> (rw.WghtCalc("xsec_dis"));
264  }
265 
266  // Twk dial loop
267  for(int ith_dial = 0; ith_dial < n_points; ith_dial++){
268 
269  // Set non-default values and re-configure.
270  double twk_dial = twk_dial_min + ith_dial * twk_dial_step;
271  LOG("grwght1scan", pNOTICE)
272  << "\n\nReconfiguring systematic: " << GSyst::AsString(gOptSyst)
273  << " - Setting tweaking dial to: " << twk_dial;
274  syst.Set(gOptSyst, twk_dial);
275  rw.Reconfigure();
276 
277  // Event loop
278  for(int iev = nfirst; iev <= nlast; iev++) {
279 
280  if(iev%100 == 0) {
281  LOG("grwght1scan", pNOTICE)
282  << "***** Currently at event number: "<< iev;
283  }
284 
285  // Get next event
286  tree->GetEntry(iev);
287  EventRecord & event = *(mcrec->event);
288  LOG("grwght1scan", pINFO) << "Event: " << iev << "\n" << event;
289 
290  // Reset arrays
291  int idx = iev - nfirst;
292  weights [idx][ith_dial] = -99999.0;
293  twkdials [idx][ith_dial] = twk_dial;
294 
295  // Reweight this event?
296  int nupdg = event.Probe()->Pdg();
297  bool do_reweight = gOptNu.ExistsInPDGCodeList(nupdg);
298 
299  // Calculate weight
300  double wght=1.;
301  if(do_reweight) {
302  wght = rw.CalcWeight(event);
303  }
304 
305  // Print/store
306  LOG("grwght1scan", pDEBUG)
307  << "Overall weight = " << wght;
308  weights[idx][ith_dial] = wght;
309 
310  // Clean-up
311  mcrec->Clear();
312 
313  } // evt loop
314  } // twk_dial loop
315 
316  // Close event file
317  file.Close();
318 
319  //
320  // Save weights
321  //
322 
323  // Make an output tree for saving the weights. As only considering
324  // varying a single systematic use this for name of tree.
325  TFile * wght_file = new TFile(gOptOutFilename.c_str(), "RECREATE");
326  TTree * wght_tree = new TTree(GSyst::AsString(gOptSyst).c_str(), "GENIE weights tree");
327  int branch_eventnum = 0;
328  TArrayF * branch_weight_array = new TArrayF(n_points);
329  TArrayF * branch_twkdials_array = new TArrayF(n_points);
330  wght_tree->Branch("eventnum", &branch_eventnum);
331  wght_tree->Branch("weights", &branch_weight_array);
332  wght_tree->Branch("twkdials", &branch_twkdials_array);
333 
334  for(int iev = nfirst; iev <= nlast; iev++) {
335  int idx = iev - nfirst;
336  branch_eventnum = iev;
337  for(int ith_dial = 0; ith_dial < n_points; ith_dial++){
338  LOG("grwght1scan", pDEBUG)
339  << "Filling tree with wght = " << weights[idx][ith_dial]
340  << ", twk dial = "<< twkdials[idx][ith_dial];
341  branch_weight_array -> AddAt (weights [idx][ith_dial], ith_dial);
342  branch_twkdials_array -> AddAt (twkdials[idx][ith_dial], ith_dial);
343  } // twk_dial loop
344  wght_tree->Fill();
345  }
346 
347  wght_file->cd();
348  wght_tree->Write();
349  delete wght_tree;
350  wght_tree = 0;
351  wght_file->Close();
352 
353  LOG("grwght1scan", pNOTICE) << "Done!";
354 
355  return 0;
356 }
357 //___________________________________________________________________
358 void GetCommandLineArgs(int argc, char ** argv)
359 {
360  LOG("grwght1scan", pINFO)
361  << "*** Parsing command line arguments";
362 
363  LOG("grwght1scan", pINFO) << "Parsing command line arguments";
364 
365  // Common run options. Set defaults and read.
367 
368  // Parse run options for this app
369 
370  CmdLnArgParser parser(argc,argv);
371 
372  // get GENIE event sample
373  if(parser.OptionExists('f')) {
374  LOG("grwght1scan", pINFO) << "Reading event sample filename";
375  gOptInpFilename = parser.ArgAsString('f');
376  } else {
377  LOG("grwght1scan", pFATAL)
378  << "Unspecified input filename - Exiting";
379  gAbortingInErr = true;
380  PrintSyntax();
381  exit(1);
382  }
383 
384  // range of event numbers to process
385  if ( parser.OptionExists('n') ) {
386  //
387  LOG("grwght1scan", pINFO) << "Reading number of events to analyze";
388  string nev = parser.ArgAsString('n');
389  if (nev.find(",") != string::npos) {
390  vector<long> vecn = parser.ArgAsLongTokens('n',",");
391  if(vecn.size()!=2) {
392  LOG("grwght1scan", pFATAL) << "Invalid syntax";
393  gAbortingInErr = true;
394  PrintSyntax();
395  exit(1);
396  }
397  // User specified a comma-separated set of values n1,n2.
398  // Use [n1,n2] as the event range to process.
399  gOptNEvt1 = vecn[0];
400  gOptNEvt2 = vecn[1];
401  } else {
402  // User specified a single number n.
403  // Use [0,n] as the event range to process.
404  gOptNEvt1 = -1;
405  gOptNEvt2 = parser.ArgAsLong('n');
406  }
407  } else {
408  LOG("grwght1scan", pINFO)
409  << "Unspecified number of events to analyze - Use all";
410  gOptNEvt1 = -1;
411  gOptNEvt2 = -1;
412  }
413  LOG("grwght1scan", pDEBUG)
414  << "Input event range: " << gOptNEvt1 << ", " << gOptNEvt2;
415 
416  // get the number of tweak dials to scan
417  if(parser.OptionExists('t')) {
418  LOG("grwght1scan", pINFO)
419  << "Reading number of tweak dial values";
420  gOptInpNTwk = parser.ArgAsInt('t');
421  if(gOptInpNTwk % 2 == 0)
422  {
423  gOptInpNTwk+=1;
424  }
425  if(gOptInpNTwk < 3)
426  {
427  LOG("grwght1scan", pFATAL)
428  << "Specified number of tweak dial is too low, min value is 3 - Exiting";
429  gAbortingInErr = true;
430  PrintSyntax();
431  exit(1);
432  }
433  } else {
434  LOG("grwght1scan", pFATAL)
435  << "Unspecified number of tweak dials - Exiting";
436  gAbortingInErr = true;
437  PrintSyntax();
438  exit(1);
439  }
440 
441  // get the systematics
442  if(parser.OptionExists('s')) {
443  LOG("grwght1scan", pINFO)
444  << "Reading input systematic parameter";
445  string systematic = parser.ArgAsString('s');
446  gOptSyst = GSyst::FromString(systematic);
447  if(gOptSyst == kNullSystematic) {
448  LOG("grwght1scan", pFATAL) << "Unknown systematic: " << systematic;
449  gAbortingInErr = true;
450  PrintSyntax();
451  exit(1);
452  }
453  } else {
454  LOG("grwght1scan", pFATAL)
455  << "You need to specify a systematic param using -s";
456  gAbortingInErr = true;
457  PrintSyntax();
458  exit(1);
459  }
460 
461  // output weight file
462  if(parser.OptionExists('o')) {
463  LOG("grwght1scan", pINFO) << "Reading requested output filename";
464  gOptOutFilename = parser.ArgAsString('o');
465  } else {
466  LOG("grwght1scan", pINFO) << "Setting default output filename";
467  ostringstream nm;
468  nm << "weights_" << GSyst::AsString(gOptSyst) << ".root";
469  gOptOutFilename = nm.str();
470  }
471 
472  // which species to reweight?
473  if(parser.OptionExists('p')) {
474  LOG("grwght1scan", pINFO)
475  << "Reading input list of neutrino codes";
476  vector<int> vecpdg = parser.ArgAsIntTokens('p',",");
477  if(vecpdg.size()==0) {
478  LOG("grwght1scan", pFATAL)
479  << "Empty list of neutrino codes!?";
480  gAbortingInErr = true;
481  PrintSyntax();
482  exit(1);
483  }
484  vector<int>::const_iterator it = vecpdg.begin();
485  for( ; it!=vecpdg.end(); ++it) {
486  gOptNu.push_back(*it);
487  }
488  } else {
489  LOG("grwght1scan", pINFO)
490  << "Considering all neutrino species";
497  }
498 
499  // random number seed
500  if( parser.OptionExists("seed") ) {
501  LOG("grwght1scan", pINFO) << "Reading random number seed";
502  gOptRanSeed = parser.ArgAsLong("seed");
503  } else {
504  LOG("grwght1scan", pINFO) << "Unspecified random number seed - Using default";
505  gOptRanSeed = -1;
506  }
507 
508  // min and max tweak values
509  if( parser.OptionExists("min-tweak") ) {
510  gOptMinTwk = parser.ArgAsDouble("min-tweak");
511  } else {
512  gOptMinTwk = -5;
513  }
514  if( parser.OptionExists("max-tweak") ) {
515  gOptMaxTwk = parser.ArgAsDouble("max-tweak");
516  } else {
517  gOptMaxTwk = -5;
518  }
519 
520 }
521 //_________________________________________________________________________________
522 void GetEventRange(Long64_t nev_in_file, Long64_t & nfirst, Long64_t & nlast)
523 {
524  nfirst = 0;
525  nlast = 0;
526 
527  if(gOptNEvt1>=0 && gOptNEvt2>=0) {
528  // Input was `-n N1,N2'.
529  // Process events [N1,N2].
530  // Note: Incuding N1 and N2.
531  nfirst = gOptNEvt1;
532  nlast = TMath::Min(nev_in_file-1, gOptNEvt2);
533  }
534  else
535  if(gOptNEvt1<0 && gOptNEvt2>=0) {
536  // Input was `-n N'.
537  // Process first N events [0,N).
538  // Note: Event N is not included.
539  nfirst = 0;
540  nlast = TMath::Min(nev_in_file-1, gOptNEvt2-1);
541  }
542  else
543  if(gOptNEvt1<0 && gOptNEvt2<0) {
544  // No input. Process all events.
545  nfirst = 0;
546  nlast = nev_in_file-1;
547  }
548 
549  assert(nfirst < nlast && nfirst >= 0 && nlast <= nev_in_file-1);
550 }
551 //_________________________________________________________________________________
552 void PrintSyntax(void)
553 {
554  LOG("grwght1scan", pFATAL)
555  << "\n\n"
556  << "grwght1scan \n"
557  << " -f input_event_file \n"
558  << " [-n n1[,n2]] \n"
559  << " -s systematic \n"
560  << " -t n_twk_diall_values \n"
561  << " [--min-tweak minimum_tweak_value] \n"
562  << " [--max-tweak maximum_tweak_value] \n"
563  << " [-p neutrino_codes] \n"
564  << " [-o output_weights_file] \n"
565  << " [--seed random_number_seed] \n"
566  << " [--message-thresholds xml_file]\n"
567  << " [--event-record-print-level level]\n\n\n"
568  << " See the GENIE Physics and User manual for more details";
569 }
570 //_________________________________________________________________________________
571 
Reweighting GENIE DIS neutrino-nucleus cross sections.
void RandGen(long int seed)
Definition: AppInit.cxx:37
static void SetPrintLevel(int print_level)
Definition: GHepRecord.cxx:983
tweak Mv CCRES, affects d2sigma(CCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:59
long ArgAsLong(char opt)
double ArgAsDouble(char opt)
string gOptOutFilename
name for output file (contains the output weight tree)
const int kPdgNuE
Definition: PDGCodes.h:25
string ArgAsString(char opt)
#include "Numerical/GSFunc.h"
Definition: AlgCmp.h:26
std::string string
Definition: nybbler.cc:12
MINOS-style ntuple record. Each such ntuple record holds a generated EventRecord object. Ntuples of this type are intended for feeding GENIE events into other applications (for example the GEANT4 based MC generation framework of an experiment) if no direct interface exists.
void ReadFromCommandLine(int argc, char **argv)
Definition: RunOpt.cxx:81
Reweighting the GENIE AGKY (free-nucleon) hadronization model.
Definition: GReWeightAGKY.h:39
const int kPdgAntiNuE
Definition: PDGCodes.h:26
Reweighting CCQE GENIE neutrino cross sections.
long int gOptRanSeed
random number seed
void GetEventRange(Long64_t nev_in_file, Long64_t &nfirst, Long64_t &nlast)
#define pFATAL
Definition: Messenger.h:47
const int kPdgNuMu
Definition: PDGCodes.h:27
vector< long > ArgAsLongTokens(char opt, string delimeter)
tweak the Bodek-Yang model parameter B_{ht} - shape only effect to d2sigma(DIS)/dxdy ...
Definition: GSyst.h:91
Reweighting NCEL GENIE neutrino cross sections.
Reweight GENIE NC resonance neutrino-production cross section. Basically a clone of the corresponding...
bool ExistsInPDGCodeList(int pdg_code) const
void Reconfigure(void)
reconfigure weight calculators with new params
Definition: GReWeight.cxx:74
int main(int argc, char **argv)
GReWeightI * WghtCalc(string name)
access a weight calculator by name
Definition: GReWeight.cxx:61
A list of PDG codes.
Definition: PDGCodeList.h:33
void Set(GSyst_t syst, double current_value)
Definition: GSystSet.cxx:89
Reweighting vector form factors in GENIE CCQE neutrino cross section calculations.
static GSyst_t FromString(string syst)
Definition: GSyst.h:257
void Init(GSyst_t syst, double init=0., double min=-1., double max=+1., double step=0.05)
Definition: GSystSet.cxx:42
Long64_t gOptNEvt2
range of events to process (2nd input, if any)
Reweighting vector form factors in GENIE CCQE neutrino cross section calculations.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
intermediate_table::const_iterator const_iterator
void PrintSyntax(void)
Reweighting the Fermi Gas nuclear model.
Definition: GReWeightFGM.h:46
GSyst_t gOptSyst
input systematic param
MINOS-style Ntuple Class to hold an output MC Tree Header.
Reweighting the formation zone model.
An enumeration of systematic parameters.
#define pINFO
Definition: Messenger.h:53
const int kPdgAntiNuTau
Definition: PDGCodes.h:30
const int kPdgAntiNuMu
Definition: PDGCodes.h:28
double gOptMinTwk
Minimum value of tweaked dial.
void AdoptWghtCalc(string name, GReWeightI *wcalc)
add concrete weight calculator, transfers ownership
Definition: GReWeight.cxx:54
PDGCodeList gOptNu(false)
neutrinos to consider
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:38
void GetCommandLineArgs(int argc, char **argv)
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:64
const int kPdgNuTau
Definition: PDGCodes.h:29
tweak the Bodek-Yang model parameter A_{ht} - shape only effect to d2sigma(DIS)/dxdy ...
Definition: GSyst.h:90
static RunOpt * Instance(void)
Definition: RunOpt.cxx:55
tweak Ma CCRES, affects d2sigma(CCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:58
Reweighting the DIS nuclear modification model.
string gOptInpFilename
name for input file (contains input event tree)
tweak Ma CCQE, affects dsigma(CCQE)/dQ2 both in shape and normalization
Definition: GSyst.h:52
tweak the Bodek-Yang model parameter CV1u - shape only effect to d2sigma(DIS)/dxdy ...
Definition: GSyst.h:92
static string AsString(GSyst_t syst)
Definition: GSyst.h:175
Long64_t gOptNEvt1
range of events to process (1st input, if any)
double CalcWeight(const genie::EventRecord &event)
calculate weight for input event
Definition: GReWeight.cxx:99
Reweighting resonance decays.
void MesgThresholds(string inpfile)
Reweight GENIE CC resonance neutrino-production.
Command line argument parser.
#define pNOTICE
Definition: Messenger.h:52
GSystSet & Systematics(void)
set of enabled systematic params & values
Definition: GReWeight.cxx:69
void Clear(Option_t *opt="")
int gOptInpNTwk
of tweaking dial values in the specified range
bool gAbortingInErr
Definition: Messenger.cxx:56
tweak the Bodek-Yang model parameter CV2u - shape only effect to d2sigma(DIS)/dxdy ...
Definition: GSyst.h:93
Set of systematics to be considered by the reweighting package.
Definition: GSystSet.h:37
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
bool OptionExists(char opt)
was option set?
Interface to the GENIE event reweighting engines.
Definition: GReWeight.h:40
vector< int > ArgAsIntTokens(char opt, string delimeter)
EventRecord * event
event
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:67
Reweighting GENIE coherent neutrino-nucleus cross sections.
Reweighting non-resonance background level.
Reweighting GENIE INTRANUKE/hA hadron transport model.
#define pDEBUG
Definition: Messenger.h:54
double gOptMaxTwk
Maximum value of tweaked dial.
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:63