Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/re add gridstuff #83

Merged
merged 4 commits into from
Mar 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ by default when doing a test, where TEST_OUTPUTNAME is set in your submission sc
You can run on the grid with

```
python RJigsawTools/util/run_lvlv.py --doOverwrite --inputDS RJigsawTools/data/mc15_13TeV_25ns_SM_p2419.ds --gridTag 012516_lvlv
python RJigsawTools/util/run_lvlv.py --doOverwrite --driver grid --inputDS RJigsawTools/data/mc15_13TeV_25ns_SM_p2419.ds --gridTag 012516_lvlv
```

This default assumes your system username is the same as your grid/NICE name. If not, you can change it with --gridUser, and the --gridTag defaults to just the date.
Expand Down
4 changes: 2 additions & 2 deletions Root/RegionVarCalculator_zl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ EL::StatusCode RegionVarCalculator_zl::doAllCalculations(std::map<std::string, d
RegionVars["actualInteractionsPerCrossing"] = eventInfo->actualInteractionsPerCrossing();
RegionVars["averageInteractionsPerCrossing"] = eventInfo->averageInteractionsPerCrossing();

RegionVars["mcEventWeight"] = eventInfo->auxdecor< int >("mcEventWeight");
RegionVars["pileupWeight"] = eventInfo->auxdecor< float >("PileupWeight");
RegionVars["mcEventWeight"] = eventInfo->auxdecor< float >("mcEventWeight");
RegionVars["pileupWeight"] = eventInfo->auxdecor< float >("PileupWeight");

//
/////////////////////////////////////////////////////////////////////
Expand Down
14 changes: 10 additions & 4 deletions util/commonOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def parseCommonOptions() :
parser.add_option("--submitDir", help = "dir to store the output", default="submit_dir")
parser.add_option("--inputDS", help = "You can pass either the directory locally, the file containing the list of grid datasets, or directly the name of a grid dataset. ", default="/afs/cern.ch/work/r/rsmith/lvlv_datasets/")

parser.add_option("--gridUser", help = "gridUser" , default=os.environ.get("USER") )
parser.add_option("--gridTag", help = "gridTag", default=date.today().strftime("%m%d%y"))
parser.add_option("--gridUser", help = "gridUser" , default= '')
parser.add_option("--gridTag", help = "gridTag" , default= '')

parser.add_option("--driver", help = "select where to run", choices=("direct", "prooflite", "LSF","grid"), default="direct")
parser.add_option('--doOverwrite', help = "Overwrite submit dir if it already exists",action="store_true", default=False)
Expand All @@ -44,7 +44,7 @@ def setVerbosity ( alg , levelString ) :
commonOptions.quiet_exit()
alg.setMsgLevel(level)

def fillSampleHandler ( sh_all, inp , gridUser = os.environ.get("USER") , gridTag = date.today().strftime("%m%d%y")) :
def fillSampleHandler ( sh_all, inp ) :
"""You can pass either the directory locally, the file containing the list of grid datasets, or directly the name of a grid dataset. """
if os.path.isfile(inp) :
with open(inp) as f :
Expand Down Expand Up @@ -73,7 +73,11 @@ def overwriteSubmitDir (submitDir, doOverwrite) :
logging.info( "Exiting. If you want to overwrite the previous submitDir, use --doOverwrite")
quiet_exit()

def submitJob (job , driverName , submitDir, gridUser = os.environ.get("USER") , gridTag = date.today().strftime("%m%d%y")) :
def submitJob (job , driverName , submitDir, gridUser = "" , gridTag = "") :
if (gridUser or gridTag) and driverName != "grid" :
logging.error("You have specified a gridUser or gridTag but are not using the grid driver. Exiting without submitting.")
quiet_exit()

logging.info("creating driver")
driver = None
if (driverName == "direct"):
Expand All @@ -88,6 +92,8 @@ def submitJob (job , driverName , submitDir, gridUser = os.environ.get("USER") ,
driver.submit(job, submitDir)
elif (driverName == "grid"):
logging.info( "grid driver")
if not gridUser : gridUser = os.environ.get("USER")
if not gridTag : gridTag = date.today().strftime("%m%d%y")
driver = ROOT.EL.PrunDriver()
driver.options().setString("nc_outputSampleName", "user.%s.%%in:name[2]%%.%%in:name[3]%%.%s"%(gridUser,gridTag) );
driver.options().setDouble(ROOT.EL.Job.optGridMergeOutput, 1);
Expand Down
2 changes: 1 addition & 1 deletion util/run_b4j.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
logging.info("creating new sample handler")
sh_all = ROOT.SH.SampleHandler()

commonOptions.fillSampleHandler(sh_all, options.inputDS, options.gridUser, options.gridTag)
commonOptions.fillSampleHandler(sh_all, options.inputDS)

sh_all.setMetaString ("nc_tree", "CollectionTree");
#sh_all.printContent();
Expand Down
2 changes: 1 addition & 1 deletion util/run_compressed.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
logging.info("creating new sample handler")
sh_all = ROOT.SH.SampleHandler()

commonOptions.fillSampleHandler(sh_all, options.inputDS, options.gridUser, options.gridTag)
commonOptions.fillSampleHandler(sh_all, options.inputDS)

sh_all.setMetaString ("nc_tree", "CollectionTree");
#sh_all.printContent();
Expand Down
2 changes: 1 addition & 1 deletion util/run_lvlv.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
logging.info("creating new sample handler")
sh_all = ROOT.SH.SampleHandler()

commonOptions.fillSampleHandler(sh_all, options.inputDS, options.gridUser, options.gridTag)
commonOptions.fillSampleHandler(sh_all, options.inputDS)

sh_all.setMetaString ("nc_tree", "CollectionTree");
#sh_all.printContent();
Expand Down
2 changes: 1 addition & 1 deletion util/run_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
logging.info("creating new sample handler")
sh_all = ROOT.SH.SampleHandler()

commonOptions.fillSampleHandler(sh_all, options.inputDS, options.gridUser, options.gridTag)
commonOptions.fillSampleHandler(sh_all, options.inputDS)

sh_all.setMetaString ("nc_tree", "CollectionTree");
#sh_all.printContent();
Expand Down
6 changes: 3 additions & 3 deletions util/run_zl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
logging.info("creating new sample handler")
sh_all = ROOT.SH.SampleHandler()

commonOptions.fillSampleHandler(sh_all, options.inputDS, options.gridUser, options.gridTag)
commonOptions.fillSampleHandler(sh_all, options.inputDS)

sh_all.setMetaString ("nc_tree", "CollectionTree");
#sh_all.printContent();
Expand All @@ -43,8 +43,8 @@
commonOptions.configBasicEventSelection(algsToRun["basicEventSelection"] )

algsToRun["calibrateST"] = ROOT.CalibrateST()
algsToRun["calibrateST" ].systName = ""
algsToRun["preselectDileptonicWW"] = ROOT.PreselectDileptonicWWEvents()#todo change this if we need it
algsToRun["calibrateST" ].systName = ""
algsToRun["preselectDileptonicWW"] = ROOT.PreselectDileptonicWWEvents()#todo change this if we need it
algsToRun["selectZeroLepton"] = ROOT.SelectZeroLeptonEvents()
# algsToRun["postselectDileptonicWW"] = ROOT.PostselectDileptonicWWEvents()

Expand Down