-
When I tried to recompile root-v5-34-00-patches I had this error
Error: cannot open file "AvailabilityMacros.h" include/RConfig.h:376: Warning: Error occurred during reading source files Warning: Error occurred during dictionary source generation !!!Removing core/base/src/G__Base1.cxx core/base/src/G__Base1.h !!! Error: core/utils/src/rootcint_tmp: error loading headers... make: *** [core/base/src/G__Base1.cxx] Error 1 |
- Some root flags compilation
./configure --enable-reflex --enable-qt --with-qt-incdir=/usr/local/Trolltech/Qt-4.6.0//include --with-qt-libdir=/usr/local/Trolltech/Qt-4.6.0/lib |
- Find the maximum x abscissa of a variable from a tuple:
Sampler0->Draw("E") (event if there is no display) double *b = Sampler0->GetV1() TMath::MaxElement(#entries,b) |
- You have a 3D histo and you are looking at which bins correspond the global bin N :
int x,y,z ; histo->GetBinXYZ(N,x,y,z) |
- I was fed up to put the variables of my TNtuple (and specially when there are a lot of variables).
So I (finally) decided to make a small program to avoid that
Here the newntuple.C
int ntuple(TString file) { int col = ComptCol(file); cout<<"In file " << file << " there is " << col <<endl; char var[256]; for(int i=0;i<7;i++){ if(i==0) sprintf(var,"var%d",i); else sprintf(var,"%s:var%d",var,i); } cout << var << endl; TNtuple *nt = new TNtuple("nt","nt",var); nt->ReadFile(file); return 0; } int ComptCol(TString file_name) { ifstream file; int columns=0; char charac; file.open(file_name, ios::binary); if(!file) { cout<<" Error while opening "<< file_name << endl; exit(1); } while(file.get(charac)){ if(charac==' ')columns++; if(charac=='\n') return columns;} file.close(); } |
run root. and then do
.L newntuple.C |
and then
ntuple("THE_NAME_OF_FILE") |
The variable are calling var1:var2…:vary (n=nb of columns of your file).
Then you can do :
nt->Draw("var1:var2") |
enjoy !!!
hope it could help.