| 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 | |
| 9 | This 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 | |
| 57 | To 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 | |
| 62 | If you want to drop some information from the root files in order to make them lighter, here is the receipe |
| 63 | It 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 | {{{ |
| 66 | root [5] |
| 67 | TFile * myfile = new TFile("test.root","UPDATE"); |
| 68 | .ls |
| 69 | myfile->Delete("GEN;1"); |
| 70 | .ls |
| 71 | myfile->Save(); |
| 72 | myfile->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 | |
| 85 | 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) |
| 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 | }}} |
| 92 | 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): |
| 93 | {{{ |
| 94 | LIBS = $(ROOTLIBS) -lEG $(SYSLIBS) -lEGPythia6 |
| 95 | }}} |
| 96 | Then, 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 | }}} |
| 102 | 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, |
| 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 | |
| 110 | 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. |
| 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 | |
| 116 | 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: |
| 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 | }}} |
| 123 | This gives a plot with the expected distribution like here or here. |
| 124 | |
| 125 | Delphes 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 | |
| 131 | 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 |
| 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 | |
| 137 | Just 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 | |
| 148 | I 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 | |
| 151 | Just 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 | |
| 162 | I 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 | |
| 165 | Just 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 | |
| 200 | Look at the Getting started page. You will need OpenGL, GLUT, X11-devel, Curl. |
| 201 | For instance, here are the packages you could use in some Linux installation: |
| 202 | OpenGL: |
| 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 | }}} |
| 207 | GLUT: |
| 208 | {{{ |
| 209 | freeglut-2.2.0-14 |
| 210 | freeglut-devel-2.2.0-14 |
| 211 | }}} |
| 212 | X11-devel: |
| 213 | {{{ |
| 214 | xorg-x11-devel-6.8.2-1.EL.33.0.2 |
| 215 | }}} |
| 216 | CURL: |
| 217 | {{{ |
| 218 | libcurl |
| 219 | }}} |
| 220 | For instance, to install these on Fedora 12: try |
| 221 | {{{ |
| 222 | sudo 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 | |
| 229 | locate it on your computer |
| 230 | {{{ |
| 231 | me@mylaptop:~$ locate libcurl.so |
| 232 | /usr/lib/libcurl.so |
| 233 | }}} |
| 234 | |
| 235 | 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) |
| 236 | if 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 | }}} |
| 243 | now it should work properly |
| 244 | |
| 245 | For instance, to install these on Fedora 12: try |
| 246 | sudo 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 | {{{ |
| 250 | 55555 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 | |
| 262 | 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 |
| 263 | |
| 264 | Mac 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 --- |
| 271 | In Delphes' genMakefile.tcl, you should add "-Dmacos " in the CXXFLAGS definition (line 219): |
| 272 | {{{ |
| 273 | CXXFLAGS += $(ROOTCFLAGS) -Dmacos -DDROP_CGAL -I. -Iinterface ... |
| 274 | }}} |
| 275 | 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). |
| 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 | |
| 282 | Open Utilities/FROG/Makefile. There, you should link the libcurl library in the compilation line of libfrog: |
| 283 | {{{ |
| 284 | Utilities/FROG/Makefile: |
| 285 | libfrog.dylib : $(OBJS) |
| 286 | $(CXX) ... $(ARCHDEPENDENT) -lcurl -lX11 -lz -lpng -o $(LIBDIR)/$@ |
| 287 | }}} |
| 288 | Do 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 | |
| 300 | You 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 | |
| 306 | ROOT will properly work only if environment variables such as ROOTSYS are properly defined. To check this, try the following command: |
| 307 | echo $ROOTSYS |
| 308 | 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. |
| 309 | 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). |
| 310 | if you are running a shell from the "sh family" (e.g. a bash shell): |
| 311 | {{{ |
| 312 | export PATH=$ROOTSYS/bin:$PATH |
| 313 | export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH |
| 314 | }}} |
| 315 | In addition, for MacOS X only: |
| 316 | {{{ |
| 317 | export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH |
| 318 | }}} |
| 319 | |
| 320 | if your shell is from the "csh family": |
| 321 | {{{ |
| 322 | setenv PATH ${ROOTSYS}/bin:${PATH} |
| 323 | setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${LD_LIBRARY_PATH} |
| 324 | rehash |
| 325 | In addition, for MacOS X only: |
| 326 | setenv DYLD_LIBRARY_PATH ${ROOTSYS}/lib:${DYLD_LIBRARY_PATH} |
| 327 | }}} |