ttZReprocessing_compatibility
Hello @skorn , I have implemented a couple of improvements to the code, so it can be now used with the ntuples reprocessed by ttZReprocessing framework:
- If variable name is not find in the keys of the dataframe, it will not crash, it will firstly check if it is an expression which can be built from these variables. In ttZReprocessing we use MeV everywhere, so in order to use a model trained with minittV, I have to use something like
pt_1lep*0.001
. Expressions like this caused a crash before. - Adding AnalysisTrackingTree into the list of trees to be copied.
- Changing a way how the trees in copy list are being copied. If -1 and "fast" are not specified, ROOT creates a "back-up copy" of the tree after reaching certain number of entries. This caused problems, since we had two "truth" trees in the output (we merge all signal samples together in ttZReprocessing and the number of events in truth tree was above this "back-up threshold")
-
do_ArchitecturePlot()
caused on our local cluster the following crash. We followed the guide on how to run the code on lxplus. It seems to be a problem with keras vs. pydot compatibility.
Traceback (most recent call last):
File "./scripts/Evaluate.py", line 40, in <module>
DH.do_Plots()
File "/home/dubovsky/Analysis/3L/mva-trainer/scripts/PlotterModules/ClassificationPlotHandler.py", line 42, in do_Plots
self.do_ArchitecturePlot()
File "/home/dubovsky/Analysis/3L/mva-trainer/scripts/PlotterModules/BasicPlotHandler.py", line 360, in do_ArchitecturePlot
plot_model(self.get_ModelObjects()[0], to_file=hf.ensure_trailing_slash(self.get_MVAPlotDirectory())+"Model."+file_extension)
File "/home/dubovsky/Analysis/3L/mva-trainer/py3_venv/lib/python3.7/site-packages/tensorflow/python/keras/utils/vis_utils.py", line 306, in plot_model
dpi=dpi)
File "/home/dubovsky/Analysis/3L/mva-trainer/py3_venv/lib/python3.7/site-packages/tensorflow/python/keras/utils/vis_utils.py", line 114, in model_to_dot
raise ImportError(message)
Now when the import error is raised, it will print out an error message, but it will not crash.