10 print "processing " + dirname
11 for filename
in filenames:
12 fullname = dirname +
"/" + filename
17 if (
"4mu" in dirname):
19 if (
"2mu2e" in dirname)
or (
"2e2mu" in dirname):
22 if (
"data" in dirname)
and (
"DoubleEle" in filename):
24 if (
"data" in dirname)
and (
"DoubleMu" in filename):
26 if (
"data" in dirname)
and (
"DoubleOr" in filename):
29 if (
"CR" in dirname)
and (
"DoubleEle" in filename):
31 if (
"CR" in dirname)
and (
"DoubleMu" in filename):
33 if (
"CR" in dirname)
and (
"DoubleOr" in filename):
36 if (
"CR" in dirname)
and (
"EEEE" in filename):
38 if (
"CR" in dirname)
and (
"MMMM" in filename):
40 if (
"CR" in dirname)
and (
"EEMM" in filename):
42 if (
"CR" in dirname)
and (
"MMEE" in filename):
46 if (
"withProbabilities" in filename):
49 if not(
".root" in filename):
53 if (
"8TeV" in dirname):
58 print " " * 4 + filename +
" with flavor " + str(flavor) +
" and sqrts = " + str(sqrts)
63 command =
"root -q -b addProbtoTree.C\\(\\\"" + fullname[:-5] +
"\\\","+str(flavor)+
",-1,"+str(sqrts)+
"\\)\n"
65 commands.getstatusoutput(
"cp batchscript.csh batchscript_tmp.csh")
66 file =
open(
'batchscript_tmp.csh',
'a')
69 commands.getstatusoutput(
"bsub -q 8nh < batchscript_tmp.csh" )
76 base_dir = sys.argv[1]
77 file =
open(
'./batchscript.csh',
'w')
78 file.write(
"cd " + sys.argv[2] +
"\n")
80 file.write(
"eval `scramv1 runtime -sh`\n")
82 file.write(
"cp " + sys.argv[2] +
"/addProbtoTree.C . \n")
85 os.path.walk( base_dir, processDirectory,
None )
87 if __name__ ==
"__main__":