11 parser = optparse.OptionParser()
12 parser.add_option(
'-d',
'--data-type', dest =
'data_type',
13 action =
'store', type =
'string', default =
'data',
14 help =
'Type of data to run over. Valid options are data, mc, afii' )
15 parser.add_option(
'-s',
'--submission-dir', dest =
'submission_dir',
16 action =
'store', type =
'string', default =
'submitDir',
17 help =
'Submission directory for EventLoop' )
18 parser.add_option(
'-u',
'--unit-test', dest=
'unit_test',
19 action =
'store_true', default =
False,
20 help =
'Run the job in "unit test mode"' )
21 ( options, args ) = parser.parse_args()
30 dataType = options.data_type
32 inputfile = {
"data":
'ASG_TEST_FILE_DATA',
33 "mc":
'ASG_TEST_FILE_MC',
34 "afii":
'ASG_TEST_FILE_MC_AFII'}
36 if dataType
not in [
"data",
"mc",
"afii"] :
37 raise ValueError (
"invalid data type: " + dataType)
42 sh = ROOT.SH.SampleHandler()
43 sh.setMetaString(
'nc_tree',
'CollectionTree' )
44 sample = ROOT.SH.SampleLocal (dataType)
45 sample.add (os.getenv (inputfile[dataType]))
51 job.sampleHandler( sh )
52 job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
54 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest
import makeOverlapSequence
55 algSeq = makeOverlapSequence (dataType)
57 algSeq.addSelfToJob( job )
61 job.outputAdd( ROOT.EL.OutputStream(
'ANALYSIS' ) )
64 submitDir = options.submission_dir
68 submitDir = tempfile.mkdtemp( prefix =
'overlapTest_', dir = os.getcwd() )
73 driver = ROOT.EL.DirectDriver()
74 driver.submit( job, submitDir )