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.CaloClusterContainer()
29 ROOT.xAOD.MuonContainer()
30 ROOT.xAOD.TauJetContainer()
31 ROOT.xAOD.ParticleContainer()
36 dataType = options.data_type
38 if dataType
not in [
"data",
"mc",
"afii"] :
39 raise ValueError (
"invalid data type: " + dataType)
44 sh = ROOT.SH.SampleHandler()
45 sh.setMetaString(
'nc_tree',
'CollectionTree' )
46 sample = ROOT.SH.SampleLocal (dataType)
47 if dataType ==
"data" :
48 sample.add (os.getenv (
'ASG_TEST_FILE_DATA'))
51 sample.add (os.getenv (
'ASG_TEST_FILE_MC'))
53 if dataType ==
"afii" :
54 sample.add (os.getenv (
'ASG_TEST_FILE_MC_AFII'))
61 job.sampleHandler( sh )
62 job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 )
64 from TauAnalysisAlgorithms.TauAnalysisConfigTest
import makeSequence
65 algSeq = makeSequence (dataType)
67 algSeq.addSelfToJob( job )
70 submitDir = options.submission_dir
74 submitDir = tempfile.mkdtemp( prefix =
'tauTest_'+dataType+
'_', dir = os.getcwd() )
79 driver = ROOT.EL.DirectDriver()
80 driver.submit( job, submitDir )