From 2941af4d6264ca16823ec1203ee2d0b30c777dae Mon Sep 17 00:00:00 2001 From: Cassie Reuter Date: Thu, 12 Jan 2017 15:35:01 -0500 Subject: [PATCH] Only one TTree per TFile, fixed memory leaks Added an option to the tree write command such that only the most recent revision to a TTree is written to disk. Also fixed some memory leaks caused byT Files not being deleted. Added an option to the tree write command such that only the most recent revision to a TTree is written to disk. Also fixed some memory leaks caused by TFiles not being deleted. --- MC_co60_modulation.root | 1 + MC_cs137_modulation.root | 1 + MC_ti44_modulation.root | 1 + daqana.cc | 1 + daqprocessor_single_calibrate.py | 7 +++---- python/processorlib.pyc | Bin 6148 -> 4850 bytes slowdaq.cc | 1 + src/event.cc | 1 + src/rootdriver.cc | 19 ++++++++++++++----- 9 files changed, 23 insertions(+), 9 deletions(-) create mode 120000 MC_co60_modulation.root create mode 120000 MC_cs137_modulation.root create mode 120000 MC_ti44_modulation.root mode change 100644 => 100755 daqprocessor_single_calibrate.py diff --git a/MC_co60_modulation.root b/MC_co60_modulation.root new file mode 120000 index 0000000..f12d4b5 --- /dev/null +++ b/MC_co60_modulation.root @@ -0,0 +1 @@ +/Users/cassiereuter/Documents/dev/mod/analysis/calibration/MC_co60_modulation.root \ No newline at end of file diff --git a/MC_cs137_modulation.root b/MC_cs137_modulation.root new file mode 120000 index 0000000..4b53ec0 --- /dev/null +++ b/MC_cs137_modulation.root @@ -0,0 +1 @@ +/Users/cassiereuter/Documents/dev/mod/analysis/calibration/MC_cs137_modulation.root \ No newline at end of file diff --git a/MC_ti44_modulation.root b/MC_ti44_modulation.root new file mode 120000 index 0000000..934874b --- /dev/null +++ b/MC_ti44_modulation.root @@ -0,0 +1 @@ +/Users/cassiereuter/Documents/dev/mod/analysis/calibration/MC_ti44_modulation.root \ No newline at end of file diff --git a/daqana.cc b/daqana.cc index 155b9b0..d0cd47e 100644 --- a/daqana.cc +++ b/daqana.cc @@ -4,6 +4,7 @@ #include #include #include +#include #include "driver.hh" #include "daq.hh" diff --git a/daqprocessor_single_calibrate.py b/daqprocessor_single_calibrate.py old mode 100644 new mode 100755 index 7bdc34d..9ea728f --- a/daqprocessor_single_calibrate.py +++ b/daqprocessor_single_calibrate.py @@ -22,12 +22,11 @@ # # A.P. Colijn - colijn@nikhef.nl # -modulation_basedir = "/Users/petman/Desktop/Modulation/" +modulation_basedir = "/Your/base/directory" # output_basedir to be set to directory where the output structure should be -#output_basedir = "/data/atlas/users/acolijn/Modulation" -output_basedir = "/Users/petman/Desktop/Modulation/Run2/processed" +output_basedir = "/Where/your/root/files/live" # run dir: where do you want all the scipts to live? -run_dir = modulation_basedir + "/stoomboot/scripts" +run_dir = modulation_basedir + "/daqana_scripts" ############################################################################################ import sys,os,argparse diff --git a/python/processorlib.pyc b/python/processorlib.pyc index 0e94064e805d1df129acc3a90647674067e5133c..6741f29f69f176a916afc435bbb6d7a60f83a90b 100644 GIT binary patch delta 776 zcmb7>OK;Oa5XZA^9`z$l3$;Vi2Ypa5s<2u>Y7iA_iJ~eMr0u#w6%w+7F}0Cnhj<}^ zOAnL_x3Cv(d;}z-d<&4c^@fDFa0V{inAxNiSG?Mv$N!nx$KOZGKNly5e`V#~*Y>`X z7(7GpUWXYUcP5WhLkY{sy(OjYR=Pxp#$RQ=lezA}$R;66{Dag>k3%Uv!=K1g%2^C2 z5E}2u7d0KjJmMUpfGF}$a+TcVy3$dmQJ6uT=N}c56!aEU$947%LYcvfE z=s)H7xd7-VF5u@PqQF0^n`DP;S+68kNP%j$qKN&+61{Ah+~a?;ucuFUWEoiJz-6)j z(q+RC`yu1+M!%2;T|bvh9Wp#%97Js<4}yoSdgyqDaAOKI3Nt~M5SI~ih)V#`8a3UJ zDkxn+X#`NM?b%lKeudsZ1@F;r`K-Tt%vuyrAx^ABtUZRcc~S8UVIMO(tB6U&P{qw1yQcSTP2;yRmQAZreL_yIirX zibZ!ZE$qNF75<$X*7r|1iPlgLV8BH1-^#)Yy0_Md9z6@(TjIZ9zfRVYDiK4HR7sY` Mq@0w7k&*I$0lF`ZZ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Gipv9P?Pvcsl$H*M$V6~ diff --git a/slowdaq.cc b/slowdaq.cc index 9cf6ff3..68f4601 100644 --- a/slowdaq.cc +++ b/slowdaq.cc @@ -2,6 +2,7 @@ #include #include #include +#include #include "driver.hh" #include "sdaq.hh" diff --git a/src/event.cc b/src/event.cc index 1be1ea8..929d5ea 100644 --- a/src/event.cc +++ b/src/event.cc @@ -1,6 +1,7 @@ #include "event.hh" #include #include +#include #include "TText.h" #include "TLatex.h" diff --git a/src/rootdriver.cc b/src/rootdriver.cc index 6b579fa..accf066 100644 --- a/src/rootdriver.cc +++ b/src/rootdriver.cc @@ -334,10 +334,19 @@ void rootdriver::writeParameters(driver *drv){ } void rootdriver::Close(){ - tree->Write(); - + f->cd(); + tree->Write(0, TObject::kWriteDelete, 0); + delete tree; f->Close(); - if(slowOn) fs->Close(); - - if(calFile != "NULL.root") _cal->Close(); + delete f; + + if(slowOn) { + temp_slowtree = NULL; + fs->Close(); + } + + if(calFile != "NULL.root") { + _cal_tree = NULL; + _cal->Close(); + } }