Skip to content

Commit

Permalink
fix bugs; add rereco submission script
Browse files Browse the repository at this point in the history
bugfix: prevent dat2root from filling an extra event at the end
bugfix: do not append local path to beginning of condor job input
  • Loading branch information
Dustin committed May 6, 2017
1 parent b484367 commit 5f06f7e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dat2root.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ int main(int argc, char **argv) {
int nGoodEvents = 0;
for( int iEvent = 0; iEvent < nEvents; iEvent++){

// check for end of file
if (feof(fpin)) break;

if ( iEvent % 100 == 0 ) std::cout << "Event " << iEvent << " of " << nEvents << std::endl;
event = nGoodEvents; // for output tree

Expand All @@ -232,6 +229,9 @@ int main(int argc, char **argv) {
// third and fourth header words
dummy = fread( &event_header, sizeof(uint), 1, fpin);
dummy = fread( &event_header, sizeof(uint), 1, fpin);

// check for end of file
if (feof(fpin)) break;

//*************************
// Parse group mask into channels
Expand Down
23 changes: 23 additions & 0 deletions rereco_submit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### Job submission script for all .dat files on EOS

import glob
from subprocess import call

if __name__ == '__main__':
dirs = [
"/eos/uscms/store/user/cmstestbeam/BTL/",
"/eos/uscms/store/user/cmstestbeam/ETL/05042017/",
"/eos/uscms/store/user/cmstestbeam/ETL/05052017/",
]
for d in dirs:
files = glob.glob(d+"/*.dat")
for f in files:
print "File: ",f
cmd = ['python', 'submit_condor.py', f,
#'--no-sub',
'--proxy', '/tmp/x509up_u48463',
'--out-dir', '/uscms_data/d1/djanders/05May2017',
'--config', '15may2017.config',
]
print ' '.join(cmd)
call(cmd)
2 changes: 1 addition & 1 deletion submit_condor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def submitCondorJob(executable, options, infile, outfile,
executable = local_dir+'/runDat2Root'

infiles = [
local_dir+args.infile,
args.infile,
local_dir+"config/"+args.config,
local_dir+"v1740_bd1_group_0_dV.txt",
local_dir+"v1740_bd1_group_0_offset.txt",
Expand Down

0 comments on commit 5f06f7e

Please sign in to comment.