Ah - you have the writing code attached. Good!
char sig_name[n_signals][6];
is one character too short: you write sprintf(sig_name[i],"SIG%03d",i);
into it and that’s 6 characters plus a trailing \0
char. Does that fix it already?
Ah - you have the writing code attached. Good!
char sig_name[n_signals][6];
is one character too short: you write sprintf(sig_name[i],"SIG%03d",i);
into it and that’s 6 characters plus a trailing \0
char. Does that fix it already?
Also, in the file ..._v1.cpp
, check the histogram names, e.g. his[br_loop]=new TH1F(nm,nm,16384,0.,16384.);
is nm
non-empty?
@Axel
Yeah. That is fixed already. It is written inside the for loop.
and nm is defined as char nm[30];
Thanks @Axel
I have two files uploaded here.
One is running correctly attached below:
other one which shows the above warning
Warning in <TFile::Append>: Replacing existing TH1: (Potential memory leak).
is attached below:
If you try to run the two attached files one by one you could be able to understand the error and can probably suggest me something out of it.
Well, I still have the same error that @couet had: missing COMMON.h
…
I don’t have the file called Names.dat
, and you’re not checking whether the reading into nm succeeds, so I get garbage names. Please fix your code to verify that infile>>nm
actually worked, e.g. if (!infile>>nm) { printf("CANNOT READ NAME\n"); exit(1); }
Sorry @Axel
and I think you’re right. infile>>nm is not responding correctly as it is only showing histograms upto CL16E4.
How could I resolve this part so that it shows all the histograms.
That I don’t know - that’s not a ROOT question I don’t know what those names are, where they come from, what you’re trying to do here. Maybe ask whoever provided you with Names.dat?
(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)