Dr Ian Korir | 14 Apr 10:41 2014
Picon

fitting in a loop "problem"

Dear Rooters,
Attached is a macro to reproduce a ”fitting in a loop problem” experienced in root v5.34.18 and v5.34.09  compiled with linuxx8664gc. If the worst cases are isolated singly (no looping) it works fine.
1) the script is a pol5  fit to six data points executed in a loop. The chi square should be 1 throughout but it is not; for both a Linear and Minuit fits; i.e. with/out the "f" option passed. How can this be fixed?
2) the root file written to disk is large due to data duplications, why isn’t flushing doing the job?
Ian

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Ignore what is below here

Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 




















































































































































Xxxxxxxxxxxxxccccccccccccccccccccccccccc

From: Dr. Ian KA Korir
Sent: ‎2014-‎04-‎12 11:03 AM
To: Dr Ian Korir
Subject: Fitting issue in a loop

 

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the National Nuclear Regulator on +27 12 674 7100 or email : Support <at> nnr.co.za. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the National Nuclear Regulator on +27 12 674 7100 or email : Support <at> nnr.co.za. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited
#include "TStopwatch.h"
#include "TTree.h"
#include "TGraph.h"
#include "TFile.h"
#include "TRandom3.h"
#include "TF1.h"
#include "TMath.h"

void test_fit () {
   Int_t chooser=0;
   cout <<"\nEnter 0 for Linear and 1 for Minuit fit; hit ENTER key then wait for some minutes:\n";
   cin >> chooser;
   cout <<"\nEntry accepted going forward!\n";
   TRandom3 gRan; //gRan.SetSeed(0);
   TStopwatch timer; timer.Start();
   const Int_t n_cols=6,mx=50, UWL=1000000;
   Int_t j,lnr,eke=0,sto1[n_cols],sto2[n_cols],sto3[n_cols],XX[n_cols],YY[n_cols];
   Double_t rt,ct,ST[n_cols];

   TFile *myfile = new TFile("test_fit.root","RECREATE");
   TTree *tr6 = new TTree("t3","sto1ed param data");
   tr6->Branch("ST",ST,"ST[6]/D");

   for (lnr=0; lnr<UWL; lnr++) { //lnr loop
   for (j=0; j<n_cols; j++) sto1[j]=1+gRan.Integer(mx-1);
   TMath::Sort(n_cols,sto1,sto2,false);
   for (j=0; j<n_cols; j++) sto3[j]=sto1[sto2[j]];
   if (sto3[0]<sto3[1] && sto3[1]<sto3[2] && sto3[2]<sto3[3] && sto3[3]<sto3[4] && sto3[4]<sto3[5]) {
//eliminate duplicate numbers
   for (j=0; j<n_cols; j++) {XX[j]=sto3[j]; YY[j]=mx-sto3[n_cols-j-1];}
   //===========================================================================VERIFICATION
START HERE
   TGraph gr(n_cols,XX,YY); TF1 *fd;
   if (chooser==0) {gr.Fit("pol5","Q0F"); fd=gr.GetFunction("pol5");} //Minuit fitting
   else {gr.Fit("pol5","Q0"); fd=gr.GetFunction("pol5");} //linear fitting
   for (j=0; j<n_cols; j++) ST[j]=fd->GetParameter(j);
   Double_t csq=gr.Chisquare(fd);
   //===========================================================================VERIFICATION
STOP HERE
   if (csq>999.) printf("\n%4i) Chisquare=%15.2f is unacceptable large ", eke, csq); eke++; //chisquare!=1!
   tr6->Fill();
   } //eliminate duplicates numbers
 } //lnr loop

tr6->SetAutoFlush(0); //this does not flush the extra buffers, why?
myfile->Write();
rt=timer.RealTime();ct=timer.CpuTime();
printf("\nRealTime=%8.3f seconds \nCpuTime=%8.3f seconds\n",rt,ct);
exit(0);
}
Dr Ian Korir | 12 Apr 11:32 2014
Picon

Fitting issue in a loop

Dear Rooters,
I have attached a short macro which attempts to reproduce the problems I encountered in root v5.34.18 and also v5.34.09  compiled in linuxx8664gc.

1) the script attempts to fit a 5 order polynomial to six data points in a loop. The chi square should be 1 throughout but it is not in both linear and Minuit fittings, i.e. with/out the "f" option. What is wrong with this?
2) the root file written to disk is also large due to data duplications, how do l purge extra buffers?

Regards,
Ian


















































































































































Xxxxxxxxxxxxxccccccccccccccccccccccccccc
From: Dr. Ian KA Korir
Sent: ‎2014-‎04-‎12 11:03 AM
To: Dr Ian Korir
Subject: Fitting issue in a loop


This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the National Nuclear Regulator on +27 12 674 7100 or email : Support <at> nnr.co.za. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited
Attachment (test_fit.C): text/x-csrc, 2601 bytes
Snyder, Arthur E. | 11 Apr 17:38 2014
Picon

RE: eps files corrupted ???

Hi Andrea,
 
Ah interesting ...
 
PDF and plain ps don't work either. And I should have mentioned that root does not complain, but makes a useless file.
 
I can make a 'eps' from 'gif', 'png', 'jpeg', and likely others using 'convert'. If I recall correctly these will be a little fuzzier than  directly made 'eps'.
 
So the problem appears to not be specific to me, but something about the root installation of Fermi ... helpsoft?
 
-Arthur
 
 
From: ama4483 <at> gmail.com [ama4483 <at> gmail.com] On Behalf Of Andrea Albert [aalbert <at> slac.stanford.edu]
Sent: Friday, April 11, 2014 6:25 AM
To: Olivier Couet
Cc: Snyder, Arthur E.; roottalk (Mailing list for ROOT users.)
Subject: Re: eps files corrupted ???

Hi Art and Olivier,

I think I misunderstood the original problem.  I was able to make the .eps file no problem (ROOT didn't crash or yell at me), but I think it had the same bug where the end was missing like Art was seeing.

Art - can you try saving the plots using the GUI (so in the canvas go into the menu and click save and choose EPS)?  Another thing you could try is saving as a pdf and then using pdf2eps to make an EPS file

-Andrea


On Fri, Apr 11, 2014 at 4:01 PM, Olivier Couet <Olivier.Couet <at> cern.ch> wrote:

Hi Arthur,

I just looked again at your eps file. Actually it is not empty .. it is just not finished.. The end is missing.
Just like something prevent to write in the file... That's really weird. I have never seen that before...


Cheers,
Olivier


On 11 Apr 2014, at 04:16, Snyder, Arthur E. <snyder <at> slac.stanford.edu> wrote:

Olivier,
 
Andrea has tried 'SaveAs' to 'eps' for me on other machines (rhel6-64) and it works for her. When I do it on them, it still doesn't work.
 
This would seem to imply in has something to do with my setup. However, a few weeks ago it did work for me; I don't know what changed ... or exactly when ...
 
-Arthur
 
From: Snyder, Arthur E. [snyder <at> slac.stanford.edu]
Sent: Wednesday, April 09, 2014 10:41 AM
To: Olivier Couet; Albert, Andrea M.
Cc: roottalk (Mailing list for ROOT users.)
Subject: RE: eps files corrupted ???

Andrea,
 
Could you try the following root macro from your account?
 
{
  h=new TH1D("h","testeps",100,-3,3);
  h->FillRandom("gaus");
  h->Draw();
  c1->SaveAs("testing.eps");
  c1->SaveAs("testing.gif");
  cout << "done" << endl;
}
This test writing out 'TCanvas' as eps which does not work for me. The 'testing.gif' looks fine, but 'testing.eps' has no plot in it! It works for Olivier on mac.
 
I'm trying to figure out if it's slac Linux specific or if it has something to do with my setup, so if 'eps' works or doesn't work for you that could tell us a lot ...
 
-Arthur
 
 
 
From: Olivier Couet [Olivier.Couet <at> cern.ch]
Sent: Wednesday, April 09, 2014 9:29 AM
To: Snyder, Arthur E.
Cc: roottalk (Mailing list for ROOT users.)
Subject: Re: eps files corrupted ???


Yes, printing EPS files is something very basic which is
done by 1000 of people every day... I am surprised it does
not work for you. What about PDF and PS ?

On 09 Apr 2014, at 18:19, Snyder, Arthur E. <snyder <at> slac.stanford.edu> wrote:

I disabled my 'RooLogon.C' so I'm running plain vanilla root; it has the same problem ...
 
From: Snyder, Arthur E. [snyder <at> slac.stanford.edu]

Sent: Wednesday, April 09, 2014 9:15 AM
To: Olivier Couet
Cc: roottalk (Mailing list for ROOT users.)
Subject: RE: eps files corrupted ???

Indeed your version looks fine! So what's wrong with root at SLAC? What could be wrong?
 
 
 
 
 
From: Olivier Couet [Olivier.Couet <at> cern.ch]

Sent: Wednesday, April 09, 2014 8:46 AM
To: Snyder, Arthur E.
Cc: roottalk (Mailing list for ROOT users.)
Subject: Re: eps files corrupted ???


On Mac Mavericks with 5.32.-patches This macro gives me the attached eps, which is ok.



On 09 Apr 2014, at 17:39, Snyder, Arthur E. <snyder <at> slac.stanford.edu> wrote:

{
 h=new TH1D("h","testeps",100,-3,3);
 h->FillRandom("gaus");
 h->Draw();
 c1->SaveAs("testing.eps");
 c1->SaveAs("testing.gif");
 cout << "done" << endl;
}




--
Andrea Albert
SLAC National Accelerator Lab
650-926-8773
Arthur E. Snyder | 9 Apr 09:24 2014
Picon

eps files corrupted ???


When I try to write out a canvas with 'SaveAs' it fails for 'eps', but 
works for 'gif'.

I do 'c1->SaveAs("toy.eps")' in one case and 'c1->SaveAs("toy.gif")' in 
the other. The results are attached.

I need 'eps' for inclusion in a 'tex' file

As far as I know I haven't changed anything.

I'm using 'v5.34-gr01' and have been for quite awhile ...

-Arthur

A.E. Snyder, The Former Group C/Kipac        \!c*p?/
SLAC Mail Stop #29                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder <at> slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:707-313-0250                          Collaboration
                                                 &
                                            Fermi/GLAST

Attachment (toy.eps): application/postscript, 10 KiB
Vicente Jose Rives Molina | 7 Apr 12:17 2014
Picon
Picon

RooFit createHistogram with weights

Hi,

I am using the method 'createHistogram' for RooAbsData.
When I do so, I know I have to write:
histo = data.createHistogram(variable, number_of_bins)
since I want a TH1 histogram.

My question is: how do I tell RooFit that I want to take into account the weights (they are saved in another variable)? or are they automatically taken into account?

Cheers,
--
Vicente Jose Rives-Molina
vicente.rives <at> cern.ch



Andrea Formica | 4 Apr 12:09 2014
Picon
Picon

Problems compiling on MACOSX 10.9.2 XCODE 5.1

Dear all, I do not know if you can help, but I'm having troubles with the linking step of Root.
I'm using MacOSX 10.9.2.
Last week I downloaded root sources from git, and compiled everything without troubles.
This week I did install an update on XCode.

Then I tried to use root version that I compiled last week, and it failed, with the following error(s)...

formica <at> Andreas-MacBook-Pro-4 [~/MyApp/Tools/root-cern/v5-99-05][98]$ ./bin/root -l
In file included from input_line_5:1:
In file included from /Users/formica/MyApp/Tools/root-cern/v5-99-05/etc/cling/Interpreter/DynamicLookupRuntimeUniverse.h:16:
In file included from /Users/formica/MyApp/Tools/root-cern/v5-99-05/etc/cling/Interpreter/Interpreter.h:15:
In file included from /Users/formica/MyApp/Tools/root-cern/v5-99-05/etc/cling/llvm/ADT/OwningPtr.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cassert:21:
/usr/include/assert.h:91:5: error: invalid suffix 'n' on integer constant
#if __DARWIN_UNIX03
   ^
/usr/include/sys/cdefs.h:362:66: note: expanded from macro '__DARWIN_UNIX03'
#      error "Can't define _NONSTD_SOURCE when only UNIX conformance is available."

Since I did suspect something related to Xcode update, I decided to re-compile it. For this I created a new rep. and then I repeated the configure and make steps.
The linking fails with something like:

clang++ -v -dynamiclib -single_module -Wl,-dead_strip_dylibs -install_name <at> rpath/libTree.so -O2 -m64 -mmacosx-version-min=10.9 -stdlib=libc++ -o lib/libTree.so tree/tree/src/TBasket.o tree/tree/src/TBasketSQL.o tree/tree/src/TBranch.o tree/tree/src/TBranchBrowsable.o tree/tree/src/TBranchClones.o tree/tree/src/TBranchElement.o tree/tree/src/TBranchObject.o tree/tree/src/TBranchRef.o tree/tree/src/TBranchSTL.o tree/tree/src/TBufferSQL.o tree/tree/src/TChain.o tree/tree/src/TChainElement.o tree/tree/src/TCut.o tree/tree/src/TEntryList.o tree/tree/src/TEntryListArray.o tree/tree/src/TEntryListBlock.o tree/tree/src/TEntryListFromFile.o tree/tree/src/TEventList.o tree/tree/src/TFriendElement.o tree/tree/src/TLeaf.o tree/tree/src/TLeafB.o tree/tree/src/TLeafC.o tree/tree/src/TLeafD.o tree/tree/src/TLeafElement.o tree/tree/src/TLeafF.o tree/tree/src/TLeafI.o tree/tree/src/TLeafL.o tree/tree/src/TLeafO.o tree/tree/src/TLeafObject.o tree/tree/src/TLeafS.o tree/tree/src/TNtuple.o tree/tree/src/TNtupleD.o tree/tree/src/TQueryResult.o tree/tree/src/TSelector.o tree/tree/src/TSelectorCint.o tree/tree/src/TSelectorList.o tree/tree/src/TSelectorScalar.o tree/tree/src/TTree.o tree/tree/src/TTreeCache.o tree/tree/src/TTreeCacheUnzip.o tree/tree/src/TTreeCloner.o tree/tree/src/TTreeResult.o tree/tree/src/TTreeRow.o tree/tree/src/TTreeSQL.o tree/tree/src/TVirtualIndex.o tree/tree/src/TVirtualTreePlayer.o tree/tree/src/TreeUtils.o tree/tree/src/G__Tree.o -ldl -Llib -lNet -lRIO -lThread -Llib -lCore
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -dylib -arch x86_64 -dylib_install_name <at> rpath/libTree.so -macosx_version_min 10.9.0 -single_module -o lib/libTree.so -Llib -Llib -dead_strip_dylibs tree/tree/src/TBasket.o tree/tree/src/TBasketSQL.o tree/tree/src/TBranch.o tree/tree/src/TBranchBrowsable.o tree/tree/src/TBranchClones.o tree/tree/src/TBranchElement.o tree/tree/src/TBranchObject.o tree/tree/src/TBranchRef.o tree/tree/src/TBranchSTL.o tree/tree/src/TBufferSQL.o tree/tree/src/TChain.o tree/tree/src/TChainElement.o tree/tree/src/TCut.o tree/tree/src/TEntryList.o tree/tree/src/TEntryListArray.o tree/tree/src/TEntryListBlock.o tree/tree/src/TEntryListFromFile.o tree/tree/src/TEventList.o tree/tree/src/TFriendElement.o tree/tree/src/TLeaf.o tree/tree/src/TLeafB.o tree/tree/src/TLeafC.o tree/tree/src/TLeafD.o tree/tree/src/TLeafElement.o tree/tree/src/TLeafF.o tree/tree/src/TLeafI.o tree/tree/src/TLeafL.o tree/tree/src/TLeafO.o tree/tree/src/TLeafObject.o tree/tree/src/TLeafS.o tree/tree/src/TNtuple.o tree/tree/src/TNtupleD.o tree/tree/src/TQueryResult.o tree/tree/src/TSelector.o tree/tree/src/TSelectorCint.o tree/tree/src/TSelectorList.o tree/tree/src/TSelectorScalar.o tree/tree/src/TTree.o tree/tree/src/TTreeCache.o tree/tree/src/TTreeCacheUnzip.o tree/tree/src/TTreeCloner.o tree/tree/src/TTreeResult.o tree/tree/src/TTreeRow.o tree/tree/src/TTreeSQL.o tree/tree/src/TVirtualIndex.o tree/tree/src/TVirtualTreePlayer.o tree/tree/src/TreeUtils.o tree/tree/src/G__Tree.o -ldl -lNet -lRIO -lThread -lCore -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
 "int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, int, int, int, int)", referenced from:
     TBranchElement::FillLeavesMemberCounter(TBuffer&) in TBranchElement.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


I tried to re-install the command line tools from the apple developer web site, but it did not change my output...
Do you have any suggestions ?

Andrea​

Danielle Martins Tostes | 4 Apr 11:53 2014
Picon

Simultaneous pdf pick only last component when using plotOn

<!-- p {margin-top:0; margin-bottom:0} .ms-cui-menu {background-color:#ffffff; border:1px rgb(171,171,171) solid; font-family:'Segoe UI WPC','Segoe UI',Tahoma,'Microsoft Sans Serif',Verdana,sans-serif; font-size:11pt; color:rgb(51,51,51)} .ms-cui-menusection-title {} .ms-cui-ctl {vertical-align:text-top; text-decoration:none; color:rgb(51,51,51)} .ms-cui-ctl-on {background-color:rgb(223,237,250)} .ms-cui-img-cont-float {display:inline-block; margin-top:2px} .ms-cui-smenu-inner {padding-top:0px} .ms-owa-paste-option-icon {margin:2px 4px 0px 4px; vertical-align:sub; padding-bottom:2px; display:inline-block} .ms-rtePasteFlyout-option {padding:8px 4px 8px 4px; outline:none} .ms-cui-menusection {float:left; width:85px; height:24px; overflow:hidden} -->

Dear ROOT users and experts,


I am performing a simultaneous fit to get assimetries. The fit itself is working fine but when I try to use plotOn() to create pulls and compute chi2 it only picks the pdf of the last type defined in the RooCategory.


I define the Category as follows:


  RooCategory r_kind("kind", "kind");
  r_kind.defineType("Dplus", 1);
  r_kind.defineType("Dminus", -1);

and the simultaneous pdf:

  RooSimultaneous* simPdf = new RooSimultaneous("simPdf", "test fit", *r_kind);
  simPdf->addPdf(*combinedPdfDplus,  "Dplus");
  simPdf->addPdf(*combinedPdfDminus, "Dminus");

Then I do:

  RooPlot* dframe2 = r_m->frame(Title(Form("Sample %d",samp)));
  hDmass->plotOn (dframe2, Cut("kind == kind::Dplus"), Name("Dplusdata"));
  simPdf->plotOn(dframe2, Slice(*r_kind,"Dplus"), ProjWData(*r_kind, *hDmass), Name("Dpluspdf"));

also plotting the components:

  simPdf->plotOn(dframe2, Slice(*r_kind,"Dplus"), Components("Bkg_Dplus"), ProjWData(*r_kind, *hDmass), LineStyle(kDashed),LineColor(kRed));
                                              (...)

and the same for Dminus.

One thing that indicates the problem is that for the type first defined, when trying to select the components they are not drawn in the plot and I get the error:
[#0] ERROR:Plotting -- RooAbsPdf::plotOn(combinedPdfDminus) ERROR: component selection expression 'Bkg_Dplus' does not select any components of p.d.f.


​If I change the order of r_kind.defineType(), the plot that is done correctly also changes.


Does anyone knows how can I solve this? Any advice is welcome.


Thanks in advance.

Danielle


Zafar Yasin | 3 Apr 15:55 2014
Picon
Picon

TSpectrum limit for finding peaks

Dear ROOT users and experts,

I am fitting a gamma ray spectrum from NaI detector. I am taking help from well known marco peaks.C, with some changes. But I am unable to find the number of peaks in the whole range i.e my spectrum covers the range from 0 to 50000 but I get peaks in the range from 0 to 18000 only, don't know as everything seems ok. I want the tspectrum should search the peaks in the whole axix range. Secondly, when I fit the peaks I got the STATUS instead of CONVERGED it  is CALL LIMIT also it indicates the abnormal termination of minimisation, what it means.?
I have attached my macro, peakfit2.C, main (extract.C) and data file (tmpconv) with this email. To run the macro: peakfit2.C ("tmpconv").


What I found in the rootalk lists, manuals, etc.  my problem is almost to the one available at:

  http://comments.gmane.org/gmane.comp.lang.c%2B%2B.root/8853

This problem was tackled by Rene Brun very easily by changing the sigma and might be to some extent the x-axis range. I am also trying different values of sigma and even changing the x-axis range too but all in vain. I think the correct range of the x-axis can be the solution or the experts know better?

I am using rootversion 5.34/14 on linux. I will happy if any expert can see it and reply.

Thank you in advance.

Best regards,
Zafar Yasin
UJV, Prague
Attachment (peakfit2.C): text/x-c++src, 1484 bytes
Attachment (tmpconv): application/octet-stream, 65 KiB
Attachment (extract.C): text/x-c++src, 965 bytes
Pengfei Ding | 28 Mar 16:20 2014

Re: how to load shared libs in ROOT in LXPLUS

HI Fernando,

Seems like your script load the library "calculate_variables_C.so" directly, and the library depends on "libconfig++.so.9".
Have you moved the "libconfig++.so.9" library to another path (e.g. "./")  after you compiled "calculate_variable_C.so"?

Could you use the command "ldd calculate_variables_C.so" to check in which path the "libconfig++.so.9" is dependent?
And use "gSystem->GetDynamicPath()" to check if the directory of "libconfig++.so.9" is included by ROOT. 

Cheers,
Pengfei

On Mar 28, 2014, at 10:55 AM, Antonio Augusto Alves Jr <aalvesju <at> cern.ch> wrote:

Hi all,

I intent to prepare some ROOT jobs to be submitted to GRID, so I am testing it in lxplus.

I need to load a shared library ( libconfig++.so.9 ) before to run my script.
I placed the corresponding file ( libconfig++.so.9 ) in the same directory where I put the ROOT script.
and then I added the directory to the dynamic path using

gSystem->AddDynamicPath("./")

When I try to load my script, I get the following error message:

gSystem->Load("calculate_variables_C.so")
dlopen error: libconfig++.so.9: cannot open shared object file: No such file or directory
Load Error: Failed to load Dynamic link library /afs/cern.ch/user/a/aalvesju/./calculate_variables_C.so

Please, does someone know how can I solve this problem?
If I do the same in my laptop the things run without any problem.

I using  latest version of ROOT:

SetupProject LCGCMT 68 ROOT

Thank you
A.A.
-- “The inventor of the mirror poisoned the human heart.” ― Fernando Pessoa

Antonio Augusto Alves Jr | 28 Mar 15:55 2014
Picon
Picon

how to load shared libs in ROOT in LXPLUS

Hi all,

I intent to prepare some ROOT jobs to be submitted to GRID, so I am testing it in lxplus.

I need to load a shared library ( libconfig++.so.9 ) before to run my script.
I placed the corresponding file ( libconfig++.so.9 ) in the same directory where I put the ROOT script.
and then I added the directory to the dynamic path using

gSystem->AddDynamicPath("./")

When I try to load my script, I get the following error message:

gSystem->Load("calculate_variables_C.so")
dlopen error: libconfig++.so.9: cannot open shared object file: No such file or directory
Load Error: Failed to load Dynamic link library /afs/cern.ch/user/a/aalvesju/./calculate_variables_C.so

Please, does someone know how can I solve this problem?
If I do the same in my laptop the things run without any problem.

I using  latest version of ROOT:

SetupProject LCGCMT 68 ROOT

Thank you
A.A.
-- “The inventor of the mirror poisoned the human heart.” ― Fernando Pessoa
Francesco Perfetto | 27 Mar 17:59 2014
Picon
Picon

How read multiple files

Hi Rooters,

I would like if there is a simply way to read a lot of different files to plot any variables.
For example, I do:

{
  gROOT->SetStyle("Plain");

   TCanvas *Canvas  = new TCanvas("Canvas", "Canvas",20,22,1265,771);
...
   Canvas->Divide(4,3);
   TFile *file = new TFile();
   TString f,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12;

   f1->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-201403062024.root");
   f2->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-201403062039.root");
   f3->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-at0deg-P3mb-HVon.root");

f4->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-at0deg-Pnorm-HVon.root");

   f5->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-s250-a250-n1000.root");
   f6->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-s250-a250-n2000.root");
   f7->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-statRun1-DAC250.root");
   f8->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-statRun2-DAC250.root");
   f9->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-statRun3-DAC250.root");
   f10->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-statRun4-DAC250.root");
   f11->Open("~/Desktop/Toulouse/packets/output_files/allpackets-BALLOON-T40P3mb.root");
......

   for(int i = 1; i <= 12; i++) {
     Canvas->cd(i);
     file->Open( f+Form("%d",i) );   
     tree->Draw("ltime", "ltime < 400 && ltime > 0");
     }
...
}

But this don't work.
Any hint ?

Thanks in advance.

Regards
Francesco.

Gmane