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()
28 ROOT.xAOD.TauJetContainer()
33 dataType = options.data_type
35 if dataType
not in [
"data",
"mc",
"afii"] :
36 raise Exception (
"invalid data type: " + dataType)
41 sh = ROOT.SH.SampleHandler()
42 sh.setMetaString(
'nc_tree',
'CollectionTree' )
43 sample = ROOT.SH.SampleLocal (dataType)
44 if dataType ==
"data" :
45 sample.add (os.getenv (
'ASG_TEST_FILE_DATA'))
48 sample.add (os.getenv (
'ASG_TEST_FILE_MC'))
50 if dataType ==
"afii" :
51 sample.add (os.getenv (
'ASG_TEST_FILE_MC_AFII'))
58 job.sampleHandler( sh )
59 job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
62 from MuonAnalysisAlgorithms.MuonAnalysisConfigTest
import makeSequence
63 algSeq = makeSequence (dataType)
65 algSeq.addSelfToJob( job )
68 job.outputAdd( ROOT.EL.OutputStream(
'ANALYSIS' ) )
71 submitDir = options.submission_dir
75 submitDir = tempfile.mkdtemp( prefix =
'muonTest_'+dataType+
'_', dir = os.getcwd() )
83 driver = ROOT.EL.LocalDriver()
84 driver.submit( job, submitDir )