Fork me on GitHub

Changes between Initial Version and Version 1 of OutDated/FAQ


Ignore:
Timestamp:
Jul 1, 2011, 10:24:57 AM (13 years ago)
Author:
cp3-support
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OutDated/FAQ

    v1 v1  
     1=Frequently Asked Questions=
     2
     3==Miscellaneous==
     4
     5(Q) How can I use the mother/daughter particles in the GEN branch?
     6
     7(A) Here is a sample code
     8
     9This code prints the kinematics of each central tau in the event, as well as the list of all its daughter particles.
     10
     11{{{
     12 {
     13 
     14   TIter itGen((TCollection*)GEN);
     15   TRootGenParticle *part;
     16
     17   // creates the array of particles
     18   TSimpleArray array;
     19   itGen.Reset();
     20   while( (part = (TRootGenParticle*) itGen.Next()) )
     21     {
     22       array.Add(part);
     23     }
     24
     25   itGen.Reset();
     26   while((part = (TRootGenParticle*) itGen.Next()))
     27     {
     28        // for tau leptons which are inside tracker:
     29        if(abs(part->PID)==15 &&
     30           fabs(part->Eta)<2.5 )
     31          {
     32             Int_t Qfille  = part->D1; // index of first daughter
     33             Int_t Qfille2 = part->D2; // index of second daughter
     34
     35             // if the index of first daughter is valid:
     36             if(Qfille < array.GetEntries() &&
     37                Qfille > 0)
     38               {
     39                 // prints the list of daughter particles coming from this tau lepton
     40                 cout << "it is a tau lepton(" << part->PID << ") with these daughters : ";
     41                 for(int i=Qfille; i<=Qfille2; i++)  // beware! it is less-or-equal !
     42                   {
     43                     cout << array[i]->PID << ", ";
     44                   }
     45
     46                 // prints the kinematics of the tau-lepton
     47                 cout << "\t eta= " << part->Eta
     48                      << ", phi= "  << part->Phi
     49                      << ", E= "    << part->E
     50                      << " pt= "    << part->PT
     51                      << endl;
     52                }
     53          }
     54      }
     55}}}   
     56         
     57To try this sample code, one can copy-and-paste it in line 160 of the file Examples/src/Analysis_Ex.cc
     58(Q) How can I delete information from a root file ?
     59
     60(A) Here is a sample code for deleting the GEN tree
     61
     62If you want to drop some information from the root files in order to make them lighter, here is the receipe
     63It is quite easy. First open your root file in write mode, then delete the object, save the file and then close the file.
     64
     65{{{
     66root [5]
     67TFile * myfile = new TFile("test.root","UPDATE");
     68.ls
     69myfile->Delete("GEN;1");
     70.ls
     71myfile->Save();
     72myfile->Close();
     73// opens the file in write-mode
     74// shows its contents
     75// deletes tree from memory
     76// deleted tree has disappeared
     77// writes changes on disk
     78// closes the file
     79}}}
     80
     81(Q) "Undefined symbol" error at run time
     82
     83(A) Some library specific to your ROOT installation should be added
     84
     85On 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)
     86{{{
     87        me@mylaptop:~$ ./Delphes
     88        dyld: Symbol not found: _hepevt_
     89        Referenced from: /usr/local/root/lib/libEG.dylib
     90        Expected in: dynamic lookup
     91}}}
     92In 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):
     93{{{
     94        LIBS = $(ROOTLIBS) -lEG $(SYSLIBS) -lEGPythia6
     95}}}
     96Then, you should clean and recompile Delphes, and it will run smoothly:
     97{{{
     98        me@mylaptop:~$ make clean
     99        me@mylaptop:~$ make
     100        me@mylaptop:~$ ./Delphes
     101}}}
     102In 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,
     103{{{
     104        me@mylaptop:~$ nm -a libEGPythia6.so | grep _hepevt_
     105        003a8a70 S _hepevt_
     106        me@mylaptop:~$ nm -a libEG.so | grep _hepevt_
     107                 U _hepevt_
     108}}}
     109
     110Here 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.
     111
     112(Q) I have got a strange distribution for the Phi of the jets
     113
     114(A) The default binning from ROOT used for plotting is not adequate
     115
     116When 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:
     117{{{
     118        root[0] TH1F * phi = new TH1F("phi","",80,-200,200);
     119        root[1] Analysis->Draw("(Jet.Phi)/acos(-1)*180. >> phi",
     120                                    "Jet.Eta<1.5 && Jet.Eta>-1.5");
     121        root[2] phi->GetXaxis()->SetTitle("Jet.Phi [degree]");
     122}}}
     123This gives a plot with the expected distribution like here or here.
     124
     125Delphes options:Convertors_Only LHCO_Only Trigger_Only
     126
     127(Q) Delphes complains that data/DataCardDet.dat is not found.
     128
     129(A) The default datacard names have been changed.
     130
     131In recent versions of the code (>1.4beta), the default names have been changed to DetectorCard.dat. Similarly, trigger cards are now called TriggerCard.dat
     132
     133(Q) May I run the convertor stage independently before running Delphes?
     134
     135(A) Yes, you can convert your generator-level input files
     136
     137Just by running the 'Convertors_Only' executable:
     138{{{
     139        me@mylaptop:~$ ./Convertors_Only
     140        Usage: ./Convertors_Only input_file output_file
     141        input_list - list of files in Ntpl, StdHep of LHEF format,
     142        output_file - output file.
     143        me@mylaptop:~$ ./Convertors_Only TEST.list converted.root
     144}}}
     145
     146(Q-options2) Can I easily convert my ROOT output to LHCO?
     147
     148I did not create a LHCO output file when I ran Delphes (FLAG_lhco=0). Can I do this on my ROOT output file?
     149(A) The LHCO output file can be easily created out-of your Delphes ROOT output file.
     150
     151Just by running the 'LHCO_Only' executable:
     152{{{
     153        me@mylaptop:~$ ./LHCO_Only
     154        Usage: ./LHCO_Only input_file [runlog_file]
     155        input_file - file in Delphes root format,
     156        [runlog_file] - the corresponding log file (optional)
     157        me@mylaptop:~$ ./LHCO_Only test.root
     158}}}
     159
     160(Q-options1) Can I easily reprocess the trigger stage?
     161
     162I did not run the triggers when I ran Delphes (FLAG_trigger=0). Can I reprocess this on my output file?
     163(A) There is no problem to re-run the trigger on a Delphes output-file.
     164
     165Just run the 'Trigger_Only' executable:
     166{{{
     167        me@mylaptop:~$ ./Trigger_Only
     168        Usage: ./Trigger_Only input_file output_file [detector_card] [trigger_card]
     169        input_file - file in Delphe root format,
     170        trigger_card - Datacard containing the trigger algorithms (optional)
     171        me@mylaptop:~$ ./Trigger_Only test_without_trigger.root test_with_trigger.root \
     172                        data/mydetector.dat data/mytrigger.dat
     173}}}
     174
     175== FROG related questions ==
     176
     177(Q-frog5) I do not remember how to run FROG
     178
     179(A) Just run the "frog" executable in Utilities/FROG
     180{{{
     181        me@mylaptop:~$ cd Utilities/FROG
     182        me@mylaptop:~$ ./frog
     183}}}
     184
     185(Q-frog4) frog executable is not found!
     186{{{
     187        me@mylaptop:~$ ./Utilities/FROG/frog
     188        ./Utilities/FROG/frog: No such file or directory
     189}}}
     190(A) you should have compiled FROG first.
     191{{{
     192        me@mylaptop:~$ cd Utilities/FROG
     193        me@mylaptop:~$ make
     194}}}
     195
     196(Q-frog3) How should I know which external libraries I need for FROG ?
     197
     198(A) Please refer to this page on the FROG website
     199
     200Look at the Getting started page. You will need OpenGL, GLUT, X11-devel, Curl.
     201For instance, here are the packages you could use in some Linux installation:
     202OpenGL:
     203{{{
     204    xorg-x11-Mesa-libGL-6.8.2-1.EL.33.0.2
     205    xorg-x11-Mesa-libGLU-6.8.2-1.EL.33.0.2
     206}}}
     207GLUT:
     208{{{
     209    freeglut-2.2.0-14
     210    freeglut-devel-2.2.0-14
     211}}}
     212X11-devel:
     213{{{
     214    xorg-x11-devel-6.8.2-1.EL.33.0.2
     215}}}
     216CURL:
     217{{{
     218    libcurl
     219}}}
     220For instance, to install these on Fedora 12: try
     221{{{
     222sudo yum install mesa-libGL mesa-libGL-devel mesa-libGLU freeglut freeglut-devel libX11-devel libcurl
     223}}}
     224
     225(Q-frog2) FROG complains that libcurl is missing. What should I do?
     226
     227(A) First, make sure the libcurl library is installed on your computer.
     228
     229locate it on your computer
     230{{{
     231        me@mylaptop:~$ locate libcurl.so
     232        /usr/lib/libcurl.so
     233}}}
     234
     235if 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)
     236if the libcurl.so is not found, juste make a symbolic link in Utilities/FROG/Lib:
     237{{{
     238        me@mylaptop:~$ cd Utilities/FROG/Lib
     239        me@mylaptop:~$ ln -s /usr/lib/libcurl.so
     240        me@mylaptop:~$ ls -l libcurl.so
     241        lrwxrwxrwx  1 me me 21 Jan  7 15:19 libcurl.so -> /usr/lib/libcurl.so.4.0.1
     242}}}
     243now it should work properly
     244
     245For instance, to install these on Fedora 12: try
     246sudo yum install libcurl
     247
     248(Q-frog1) (fixed) there are many lines printed at the end of the run of Delphes. Is it an error?
     249{{{
     25055555 D0
     251 - 20000 D0
     252 -  - 3000 (detId=900000000 Name=Delphes)
     253 -  -  - 3000 (detId=910000000 Name=Tracker)
     254 -  -  -  - 41040 (detId=9100010)
     255 -  -  -  - 41040 (detId=9100020)
     256 -  -  -  - 41040 (detId=9100030)
     257 -  -  -  - 41040 (detId=9100040)
     258...
     259}}}
     260(A) no, this is normal
     261
     262This 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
     263
     264Mac OS-X
     265
     266(Q-mac 2) Delphes is not compiling properly on Mac OS-X
     267
     268(A) One modification is required in the Makefile
     269
     270--- NOT needed anymore for Delphes V > 1.7 ---
     271In Delphes' genMakefile.tcl, you should add "-Dmacos " in the CXXFLAGS definition (line 219):
     272{{{
     273CXXFLAGS += $(ROOTCFLAGS) -Dmacos -DDROP_CGAL -I. -Iinterface ...
     274}}}
     275Check also that for your ROOT installation you have defined the following environment variables: ROOTSYS, PATH, LD_LIBRARY_PATH and DYLD_LIBRARY_PATH (see below).
     276
     277
     278(Q-mac 1) FROG is not compiling properly on Mac OS-X
     279
     280(A) One modification is required in FROG's Makefile
     281
     282Open Utilities/FROG/Makefile. There, you should link the libcurl library in the compilation line of libfrog:
     283{{{
     284Utilities/FROG/Makefile:
     285libfrog.dylib : $(OBJS)
     286        $(CXX) ... $(ARCHDEPENDENT) -lcurl -lX11 -lz -lpng -o $(LIBDIR)/$@
     287}}}
     288Do not forget to recompile FROG from its directory (Utilities/FROG)
     289{{{
     290        me@mylaptop:~$ cd Utilities/FROG
     291        me@mylaptop:~$ make
     292}}}
     293
     294== ROOT basics ==
     295
     296(Q-root 1) I am not familiar with ROOT, how can I start?
     297
     298(A) Refer to our online manual
     299
     300You will find basic commands here.
     301
     302(Q-root 2) ROOT does not seem to work properly, or Delphes complains about ROOT
     303
     304(A) It could be that the required environment variables are not declared
     305
     306ROOT will properly work only if environment variables such as ROOTSYS are properly defined. To check this, try the following command:
     307   echo $ROOTSYS
     308This 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.
     309Following 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).
     310if you are running a shell from the "sh family" (e.g. a bash shell):
     311{{{
     312export PATH=$ROOTSYS/bin:$PATH
     313export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
     314}}}
     315In addition, for MacOS X only:
     316{{{
     317export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH
     318}}}
     319
     320if your shell is from the "csh family":
     321{{{
     322setenv PATH ${ROOTSYS}/bin:${PATH}
     323setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${LD_LIBRARY_PATH}
     324rehash
     325In addition, for MacOS X only:
     326setenv DYLD_LIBRARY_PATH ${ROOTSYS}/lib:${DYLD_LIBRARY_PATH}
     327}}}