I am concerned by a warning that I get when trying to run a multithreaded analysis.
The warning is:
Warning in <TOutputListSelectorDataMap::SetDataMembers()>: potential memory leak: replacing data member `h_ar1_bar_dts' != 0. Please initialize h_ar1_bar_dts to 0 in constructor PDune_MuLifeV20::PDune_MuLifeV20()
I am doing an analysis with a TSelector and TPROOF.
The obvious answer is to do what it says in the warning and initalize the histogram pointer with null, which I do.
class PDune_MuLifeV20 : public TSelector {
public :
TTreeReader fReader; //!the tree reader
TTree *fChain = 0; //!pointer to the analyzed TTree or TChain
// Readers to access the data (delete the ones you do not need).
TTreeReaderArray<ana::smtrec> tracks = {fReader, "tracks"};
TH1D* h_dts;
TH1D* h_bar_dts;
TH1D* h_ar1_bar_dts;
TH1D* h_ar2_bar_dts;
TH1D* h_ham_bar_dts;
TH1D* h_sens_bar_dts;
TH1D* h_firstHitJitter;
TH1D* h_dts_differentBars;
TH1D* h_dts_differentBarsPESpectrum;
TH1D* h_dts_failed;
TH1D* h_dts_failedSpectrum;
TH1D* h_dts_spectrum;
//std::map<int, TH1D*> map_bar_hists;
/* TList* map_bar_hists; */
TObjArray* map_bar_hists;
//TH1D* h_dts=0;
//TH1D* h_bar_dts=0;
//TH1D* h_ar1_bar_dts=0;
//TH1D* h_ar2_bar_dts=0;
//TH1D* h_ham_bar_dts=0;
//TH1D* h_sens_bar_dts=0;
//TH1D* h_firstHitJitter=0;
//TH1D* h_dts_differentBars=0;
//TH1D* h_dts_differentBarsPESpectrum=0;
//TH1D* h_dts_failed=0;
//TH1D* h_dts_failedSpectrum=0;
//TH1D* h_dts_spectrum=0;
////std::map<int, TH1D*> map_bar_hists;
///* TList* map_bar_hists=0; */
//TObjArray* map_bar_hists=0;
PDune_MuLifeV20(TTree * /*tree*/ =0):
h_dts(0), h_bar_dts(0), h_ar1_bar_dts(0),
h_ar2_bar_dts(0), h_ham_bar_dts(0),
h_sens_bar_dts(0), h_firstHitJitter(0),
h_dts_differentBars(0), h_dts_differentBarsPESpectrum(0),
h_dts_failed(0), h_dts_failedSpectrum(0),
h_dts_spectrum(0), map_bar_hists(0)
{ }
The histogram definitions occure in SlaveBegin()
. am very unsure how this could show up as non-null to the nodes, and any advice from someone with more experience with TPROOF than me would be very welcome.
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.18/04
Platform: Fedora
Compiler: Not Provided