Skip to content

Commit

Permalink
Merge pull request #15 from nusense/master
Browse files Browse the repository at this point in the history
update gRwghtNCorrelatedParams.cxx to handle RunOpt and tune
  • Loading branch information
mroda88 authored Nov 15, 2021
2 parents a5136da + b9a7616 commit 104c950
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/Apps/gRwghtNCorrelatedParams.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
#include "Framework/Ntuple/NtpMCEventRecord.h"
#include "Framework/Numerical/RandomGen.h"
#include "Framework/Messenger/Messenger.h"
#include "Framework/Utils/AppInit.h"
#include "Framework/Utils/RunOpt.h"
#include "Framework/Utils/CmdLnArgParser.h"
#include "Framework/Numerical/MathUtils.h"
#include "Framework/Utils/StringUtils.h"
Expand Down Expand Up @@ -131,13 +133,23 @@ Long64_t gOptNEvt2;
int gOptRunKey= 0;
int gOptNSyst = 0;
int gOptNTwk = 0;
TRandom *tRnd = new TRandom(); // to access normal distribution
long int gOptRanSeed; ///< random number seed

//___________________________________________________________________
int main(int argc, char ** argv)
{
GetCommandLineArgs (argc, argv);

utils::app_init::MesgThresholds(RunOpt::Instance()->MesgThresholdFiles());
utils::app_init::RandGen(gOptRanSeed);
GHepRecord::SetPrintLevel(RunOpt::Instance()->EventRecordPrintLevel());

if ( ! RunOpt::Instance()->Tune() ) {
LOG("greweight", pFATAL) << " No TuneId in RunOption";
exit(-1);
}
RunOpt::Instance()->BuildTune();

// open the ROOT file and get the TTree & its header
TTree * tree = 0;
NtpMCTreeHeader * thdr = 0;
Expand Down Expand Up @@ -402,6 +414,9 @@ void GetCommandLineArgs(int argc, char ** argv)
{
LOG("grwghtnp", pINFO) << "*** Parsing command line arguments";

// Common run options. Set defaults and read.
RunOpt::Instance()->ReadFromCommandLine(argc,argv);

CmdLnArgParser parser(argc,argv);

// get GENIE event sample
Expand Down

0 comments on commit 104c950

Please sign in to comment.