13 <input>MCvalidationCharged.root</input>
14 <output>EventShapePlotsCharged.root</output>
15 <contact>Swagato Banerjee; swagato.banerjee@gmail.com</contact>
16 <description>Comparing event shape variables</description>
24def get_argument_parser():
26 Parses the command line options and returns the corresponding arguments.
29 parser = argparse.ArgumentParser(
30 description=__doc__.split("--examples--")[0],
32 formatter_class=argparse.RawDescriptionHelpFormatter,
36 parser.add_argument(
'--input', type=str, default=
'MCvalidationCharged.root', help=
'The name of the input root file')
37 parser.add_argument(
'--output', type=str, default=
'EventShapePlotsCharged.root', help=
'The name of the output root file')
42def PlottingHistos(var):
43 ''' Plotting function'''
45 hist = rdf.Histo1D((var, var, 25, range_dic[var][0], range_dic[var][1]), var)
46 hist.SetTitle(f
";{axis_dic[var]}; Events")
47 hist.GetListOfFunctions().Add(ROOT.TNamed(
'Description', axis_dic[var]))
48 hist.GetListOfFunctions().Add(ROOT.TNamed(
'Check',
'Shape should not change drastically.'))
49 hist.GetListOfFunctions().Add(ROOT.TNamed(
'Contact',
'swagato.banerjee@gmail.com'))
50 hist.GetListOfFunctions().Add(ROOT.TNamed(
'MetaOptions',
'nostats'))
54if __name__ ==
'__main__':
56 parser = get_argument_parser()
57 args = parser.parse_args()
59 rdf = ROOT.RDataFrame(
"EventShape", args.input)
62 colnames = rdf.GetColumnNames()
63 all_list = [str(x)
for x
in colnames
if x[0] !=
"_"]
66 range_dic = {
'foxWolframR1': [0, 0.15],
67 'foxWolframR2': [0, 0.4],
68 'foxWolframR3': [0, 0.25],
69 'foxWolframR4': [0, 0.3],
70 'cleoConeThrust0': [0, 2.5],
71 'cleoConeThrust1': [0, 5],
72 'cleoConeThrust2': [0, 6],
73 'cleoConeThrust3': [0, 6],
74 'cleoConeThrust4': [0, 6],
75 'cleoConeThrust5': [0, 6],
76 'cleoConeThrust6': [0, 5],
77 'cleoConeThrust7': [0, 4],
78 'cleoConeThrust8': [0, 2],
80 'aplanarity': [0, 0.5],
82 'thrustAxisCosTheta': [0, 1],
83 'harmonicMomentThrust0': [0.5, 1.5],
84 'harmonicMomentThrust1': [-0.4, 0.4],
85 'harmonicMomentThrust2': [0, 0.8],
86 'harmonicMomentThrust3': [-0.4, 0.4],
87 'harmonicMomentThrust4': [-0.3, 0.5],
90 axis_dic = {
'foxWolframR1':
'R_{1}',
91 'foxWolframR2':
'R_{2}',
92 'foxWolframR3':
'R_{3}',
93 'foxWolframR4':
'R_{4}',
94 'cleoConeThrust0':
"Cleo Cone 0",
95 'cleoConeThrust1':
"Cleo Cone 1",
96 'cleoConeThrust2':
"Cleo Cone 2",
97 'cleoConeThrust3':
"Cleo Cone 3",
98 'cleoConeThrust4':
"Cleo Cone 4",
99 'cleoConeThrust5':
"Cleo Cone 5",
100 'cleoConeThrust6':
"Cleo Cone 6",
101 'cleoConeThrust7':
"Cleo Cone 7",
102 'cleoConeThrust8':
"Cleo Cone 8",
103 'sphericity':
"Sphericity",
104 'aplanarity':
"Aplanarity",
106 'thrustAxisCosTheta':
"ThrustAxisCosTheta",
107 'harmonicMomentThrust0':
"harmonicMomentThrust0",
108 'harmonicMomentThrust1':
"harmonicMomentThrust1",
109 'harmonicMomentThrust2':
"harmonicMomentThrust2",
110 'harmonicMomentThrust3':
"harmonicMomentThrust3",
111 'harmonicMomentThrust4':
"harmonicMomentThrust4"
114 outputFile = ROOT.TFile(args.output,
"RECREATE")
115 ROOT.gROOT.SetBatch(
True)