Version 2 (modified by 13 years ago) ( diff ) | ,
---|
Frequently Asked Questions
Miscellaneous
(Q) How can I use the mother/daughter particles in the GEN branch?
(A) Here is a sample code
This code prints the kinematics of each central tau in the event, as well as the list of all its daughter particles.
{ TIter itGen((TCollection*)GEN); TRootGenParticle *part; // creates the array of particles TSimpleArray array; itGen.Reset(); while( (part = (TRootGenParticle*) itGen.Next()) ) { array.Add(part); } itGen.Reset(); while((part = (TRootGenParticle*) itGen.Next())) { // for tau leptons which are inside tracker: if(abs(part->PID)==15 && fabs(part->Eta)<2.5 ) { Int_t Qfille = part->D1; // index of first daughter Int_t Qfille2 = part->D2; // index of second daughter // if the index of first daughter is valid: if(Qfille < array.GetEntries() && Qfille > 0) { // prints the list of daughter particles coming from this tau lepton cout << "it is a tau lepton(" << part->PID << ") with these daughters : "; for(int i=Qfille; i<=Qfille2; i++) // beware! it is less-or-equal ! { cout << array[i]->PID << ", "; } // prints the kinematics of the tau-lepton cout << "\t eta= " << part->Eta << ", phi= " << part->Phi << ", E= " << part->E << " pt= " << part->PT << endl; } } }
To try this sample code, one can copy-and-paste it in line 160 of the file Examples/src/Analysis_Ex.cc (Q) How can I delete information from a root file ?
(A) Here is a sample code for deleting the GEN tree
If you want to drop some information from the root files in order to make them lighter, here is the receipe It is quite easy. First open your root file in write mode, then delete the object, save the file and then close the file.
root [5] TFile * myfile = new TFile("test.root","UPDATE"); .ls myfile->Delete("GEN;1"); .ls myfile->Save(); myfile->Close(); // opens the file in write-mode // shows its contents // deletes tree from memory // deleted tree has disappeared // writes changes on disk // closes the file
(Q) "Undefined symbol" error at run time
(A) Some library specific to your ROOT installation should be added
On non-default installations of ROOT, such errors could happen. In particular if the _hepevt_ symbol is not defined, this reflects the use of libEGPythia6 in your ROOT installation. For instance (as an illustration, this error occured on a Mac OS X)
me@mylaptop:~$ ./Delphes dyld: Symbol not found: _hepevt_ Referenced from: /usr/local/root/lib/libEG.dylib Expected in: dynamic lookup
In order to solve this problem, just link the corresponding library (in this particular case, libEGPythia6 contains the definition of the _hepevt_ symbol) in the compilation command of Delphes. For this, edit the genMakefile.tcl file by adding -lEGPythia6 at the end of the LIBS line (it should be the line number 221):
LIBS = $(ROOTLIBS) -lEG $(SYSLIBS) -lEGPythia6
Then, you should clean and recompile Delphes, and it will run smoothly:
me@mylaptop:~$ make clean me@mylaptop:~$ make me@mylaptop:~$ ./Delphes
In addition, in order to find in which library a given variable is defined, it is worth knowing the command nm which lists the symbols defined in a library. For instance,
me@mylaptop:~$ nm -a libEGPythia6.so | grep _hepevt_ 003a8a70 S _hepevt_ me@mylaptop:~$ nm -a libEG.so | grep _hepevt_ U _hepevt_
Here the symbol _hepevt_ is defined in libEGPythia6 (as mentioned by the S character) but not in libEG.so (as meant by the U character). For more information, refer to the manpage of nm.
(Q) I have got a strange distribution for the Phi of the jets
(A) The default binning from ROOT used for plotting is not adequate
When the bin size is not correct when displaying a variable, it might be that you obtain distributions with periodic pikes, like here. In particular, for the azimuthal angle Phi, you might pay attention to have, say, 5-degree wide bins:
root[0] TH1F * phi = new TH1F("phi","",80,-200,200); root[1] Analysis->Draw("(Jet.Phi)/acos(-1)*180. >> phi", "Jet.Eta<1.5 && Jet.Eta>-1.5"); root[2] phi->GetXaxis()->SetTitle("Jet.Phi [degree]");
This gives a plot with the expected distribution like here or here.
Delphes options:Convertors_Only LHCO_Only Trigger_Only
(Q) Delphes complains that data/DataCardDet.dat is not found.
(A) The default datacard names have been changed.
In recent versions of the code (>1.4beta), the default names have been changed to DetectorCard.dat. Similarly, trigger cards are now called TriggerCard.dat
(Q) May I run the convertor stage independently before running Delphes?
(A) Yes, you can convert your generator-level input files
Just by running the 'Convertors_Only' executable:
me@mylaptop:~$ ./Convertors_Only Usage: ./Convertors_Only input_file output_file input_list - list of files in Ntpl, StdHep of LHEF format, output_file - output file. me@mylaptop:~$ ./Convertors_Only TEST.list converted.root
(Q-options2) Can I easily convert my ROOT output to LHCO?
I did not create a LHCO output file when I ran Delphes (FLAG_lhco=0). Can I do this on my ROOT output file? (A) The LHCO output file can be easily created out-of your Delphes ROOT output file.
Just by running the 'LHCO_Only' executable:
me@mylaptop:~$ ./LHCO_Only Usage: ./LHCO_Only input_file [runlog_file] input_file - file in Delphes root format, [runlog_file] - the corresponding log file (optional) me@mylaptop:~$ ./LHCO_Only test.root
(Q-options1) Can I easily reprocess the trigger stage?
I did not run the triggers when I ran Delphes (FLAG_trigger=0). Can I reprocess this on my output file? (A) There is no problem to re-run the trigger on a Delphes output-file.
Just run the 'Trigger_Only' executable:
me@mylaptop:~$ ./Trigger_Only Usage: ./Trigger_Only input_file output_file [detector_card] [trigger_card] input_file - file in Delphe root format, trigger_card - Datacard containing the trigger algorithms (optional) me@mylaptop:~$ ./Trigger_Only test_without_trigger.root test_with_trigger.root \ data/mydetector.dat data/mytrigger.dat
FROG related questions
(Q-frog5) I do not remember how to run FROG
(A) Just run the "frog" executable in Utilities/FROG
me@mylaptop:~$ cd Utilities/FROG me@mylaptop:~$ ./frog
(Q-frog4) frog executable is not found!
me@mylaptop:~$ ./Utilities/FROG/frog ./Utilities/FROG/frog: No such file or directory
(A) you should have compiled FROG first.
me@mylaptop:~$ cd Utilities/FROG me@mylaptop:~$ make
(Q-frog3) How should I know which external libraries I need for FROG ?
(A) Please refer to this page on the FROG website
Look at the Getting started page. You will need OpenGL, GLUT, X11-devel, Curl. For instance, here are the packages you could use in some Linux installation: OpenGL:
xorg-x11-Mesa-libGL-6.8.2-1.EL.33.0.2 xorg-x11-Mesa-libGLU-6.8.2-1.EL.33.0.2
GLUT:
freeglut-2.2.0-14 freeglut-devel-2.2.0-14
X11-devel:
xorg-x11-devel-6.8.2-1.EL.33.0.2
CURL:
libcurl
For instance, to install these on Fedora 12: try
sudo yum install mesa-libGL mesa-libGL-devel mesa-libGLU freeglut freeglut-devel libX11-devel libcurl
(Q-frog2) FROG complains that libcurl is missing. What should I do?
(A) First, make sure the libcurl library is installed on your computer.
locate it on your computer
me@mylaptop:~$ locate libcurl.so /usr/lib/libcurl.so
if the library is not present, take it from the internet (http://curl.haxx.se/) or via installers like "apt-get" (ubuntu systems) or "yum" (fedora systems) if the libcurl.so is not found, juste make a symbolic link in Utilities/FROG/Lib:
me@mylaptop:~$ cd Utilities/FROG/Lib me@mylaptop:~$ ln -s /usr/lib/libcurl.so me@mylaptop:~$ ls -l libcurl.so lrwxrwxrwx 1 me me 21 Jan 7 15:19 libcurl.so -> /usr/lib/libcurl.so.4.0.1
now it should work properly
For instance, to install these on Fedora 12: try sudo yum install libcurl
(Q-frog1) (fixed) there are many lines printed at the end of the run of Delphes. Is it an error?
55555 D0 - 20000 D0 - - 3000 (detId=900000000 Name=Delphes) - - - 3000 (detId=910000000 Name=Tracker) - - - - 41040 (detId=9100010) - - - - 41040 (detId=9100020) - - - - 41040 (detId=9100030) - - - - 41040 (detId=9100040) ...
(A) no, this is normal
This is just the output of FROG, showing that everything is ok. You should find your *vis and *geom files when it has ended. This output is not visible anymore, since Delphes-1.3beta
Mac OS-X
(Q-mac 2) Delphes is not compiling properly on Mac OS-X
(A) One modification is required in the Makefile
--- NOT needed anymore for Delphes V > 1.7 --- In Delphes' genMakefile.tcl, you should add "-Dmacos " in the CXXFLAGS definition (line 219):
CXXFLAGS += $(ROOTCFLAGS) -Dmacos -DDROP_CGAL -I. -Iinterface ...
Check also that for your ROOT installation you have defined the following environment variables: ROOTSYS, PATH, LD_LIBRARY_PATH and DYLD_LIBRARY_PATH (see below).
(Q-mac 1) FROG is not compiling properly on Mac OS-X
(A) One modification is required in FROG's Makefile
Open Utilities/FROG/Makefile. There, you should link the libcurl library in the compilation line of libfrog:
Utilities/FROG/Makefile: libfrog.dylib : $(OBJS) $(CXX) ... $(ARCHDEPENDENT) -lcurl -lX11 -lz -lpng -o $(LIBDIR)/$@
Do not forget to recompile FROG from its directory (Utilities/FROG)
me@mylaptop:~$ cd Utilities/FROG me@mylaptop:~$ make
ROOT basics
(Q-root 1) I am not familiar with ROOT, how can I start?
(A) Refer to our online manual
You will find basic commands here.
(Q-root 2) ROOT does not seem to work properly, or Delphes complains about ROOT
(A) It could be that the required environment variables are not declared
ROOT will properly work only if environment variables such as ROOTSYS are properly defined. To check this, try the following command:
echo $ROOTSYS
This should output the path to your ROOT installation folder (e.g. /usr/bin/root5.18). You must check and define all the following environment variables: ROOTSYS, LD_LIBRARY_PATH and PATH. In addition, for MacOSX, one must have DYLD_LIBRARY_PATH. Following ROOT website, here are the correct ways to define these variables. You must know which kind of shell you are running in your terminal (the command echo $SHELL will give you the answer to this question). if you are running a shell from the "sh family" (e.g. a bash shell):
export PATH=$ROOTSYS/bin:$PATH export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
In addition, for MacOS X only:
export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH
if your shell is from the "csh family":
setenv PATH ${ROOTSYS}/bin:${PATH} setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${LD_LIBRARY_PATH} rehash In addition, for MacOS X only: setenv DYLD_LIBRARY_PATH ${ROOTSYS}/lib:${DYLD_LIBRARY_PATH}