| 1 | = Run Delphes with external !FastJet = |
| 2 | |
| 3 | == Introduction == |
| 4 | |
| 5 | This section explains how you can run your own !FastJet code on Delphes particles. |
| 6 | We provide two working codes in the "examples" directory, [source:examples/ExternalFastJetBasic.cpp] and [source:examples/ExternalFastJetHepMC.cpp]. |
| 7 | |
| 8 | Both examples convert generated events into Delphes candidates, perform event reconstruction, and pass reconstructed particles to anti-kT clustering. {{{ExternalFastJetHepMC}}} takes as input an HepMC event file, while {{{ExternalFastJetBasic}}} has internally defined input particles. |
| 9 | |
| 10 | The [source:cards/delphes_card_CMS_NoFastJet.tcl] configuration detector card is a truncated version of the [source:cards/delphes_card_CMS.tcl], as the reconstruction is stopped after producing collections of calorimeter towers and particle-flow objects, before jet and high level object isolation and identification. Similar cards for the ATLAS and the FCC detectors can be easily produced by truncating [source:cards/delphes_card_ATLAS.tcl] and [source:cards/delphes_card_FCC_basic.tcl] likewise. |
| 11 | |
| 12 | The input particle collection to jet clustering are specified inside [source:examples/ExternalFastJetBasic.cpp] and [source:examples/ExternalFastJetHepMC.cpp] via: |
| 13 | |
| 14 | {{{ |
| 15 | inputArray = modularDelphes->ImportArray("ModuleInstanceName/arrayName"); |
| 16 | }}} |
| 17 | |
| 18 | By default the particle-flow collection {{{EFlowMerger/eflow}}} is taken. This can be easily changed to simple calorimeter towers, tracks, or stable generated particles (or any other collection defined in the configuration card) by defining instead: |
| 19 | |
| 20 | {{{ |
| 21 | inputArray = modularDelphes->ImportArray("EFlowMerger/eflow"); // particle-flow objects |
| 22 | }}} |
| 23 | or |
| 24 | |
| 25 | {{{ |
| 26 | inputArray = modularDelphes->ImportArray("Calorimeter/towers"); // calorimeter objects |
| 27 | }}} |
| 28 | or |
| 29 | |
| 30 | {{{ |
| 31 | inputArray = modularDelphes->ImportArray("TrackMerger/tracks"); // charged tracks |
| 32 | }}} |
| 33 | or |
| 34 | |
| 35 | {{{ |
| 36 | inputArray = modularDelphes->ImportArray("Delphes/stableParticles"); // all gen-level stable particles |
| 37 | }}} |
| 38 | |
| 39 | == Run == |
| 40 | |
| 41 | In order to run Delphes with your own !FastJet installation you first need to install Delphes and !FastJet (to install Delphes, see [wiki:WorkBook/QuickStart here], for !FastJet see [http://fastjet.fr/quickstart.html here]). |
| 42 | |
| 43 | Then set the paths to your Delphes, !FastJet and ROOT installations (DELPHES_DIR, FASTJET_DIR and ROOT_DIR): |
| 44 | |
| 45 | {{{ |
| 46 | DELPHES_DIR=<path to Delphes installation> # main Delphes directory |
| 47 | FASTJET_DIR=<path to FastJet installation> # by default should be xyz/fastjet-install |
| 48 | ROOT_DIR=<path to ROOT installation> |
| 49 | }}} |
| 50 | |
| 51 | Then run the following commands to build the executable: |
| 52 | |
| 53 | {{{ |
| 54 | DELPHES_LIB="-Wl,-rpath $DELPHES_DIR -L$DELPHES_DIR -lDelphesNoFastJet" |
| 55 | |
| 56 | FASTJET_INC=`$FASTJET_DIR/bin/fastjet-config --cxxflags` |
| 57 | FASTJET_LIB=`$FASTJET_DIR/bin/fastjet-config --libs` |
| 58 | |
| 59 | ROOT_INC=`$ROOT_DIR/bin/root-config --incdir` |
| 60 | ROOT_LIB=`$ROOT_DIR/bin/root-config --libs` |
| 61 | |
| 62 | CXXFLAGS="$FASTJET_INC -I$ROOT_INC -I$DELPHES_DIR -I$DELPHES_DIR/external" |
| 63 | LDFLAGS="$FASTJET_LIB $ROOT_LIB $DELPHES_LIB" |
| 64 | }}} |
| 65 | |
| 66 | The {{{libDelphesNoFastJet.so}}} library is automatically created when compiling Delphes the first time. This avoids conflict between your !FastJet installation and the one in Delphes. |
| 67 | |
| 68 | If you have a [http://fastjet.hepforge.org/contrib/ FastJet Contrib] installation, assuming you installed it in |
| 69 | the {{{CONTRIB_DIR}}} directory (by default !FastJet contrib will be installed in the !FastJet directory, in that case you can replace in what follows {{{CONTRIB_DIR}}} with {{{FASTJET_DIR}}}), you have to define: |
| 70 | |
| 71 | {{{ |
| 72 | CONTRIB_DIR=<path to contrib installation> |
| 73 | CONTRIB_INC=$CONTRIB_DIR/include |
| 74 | CONTRIB_LIB="-Wl,-rpath $CONTRIB_DIR -L$CONTRIB_DIR -lNsubjettiness -lSoftKiller" |
| 75 | }}} |
| 76 | |
| 77 | and add {{{CONTRIB_INC}}} and {{{CONTRIB_LIB}}} into {{{CXXFLAGS}}} and {{{LDFLAGS`: |
| 78 | |
| 79 | {{{ |
| 80 | CXXFLAGS="$FASTJET_INC -I$ROOT_INC -I$DELPHES_DIR -I$DELPHES_DIR/external -I$CONTRIB_INC" |
| 81 | LDFLAGS="$FASTJET_LIB $ROOT_LIB $DELPHES_LIB $CONTRIB_LIB" |
| 82 | }}} |
| 83 | |
| 84 | Compile: |
| 85 | |
| 86 | {{{ |
| 87 | g++ $CXXFLAGS $LDFLAGS examples/ExternalFastJetBasic.cpp -o examples/ExternalFastJetBasic |
| 88 | g++ $CXXFLAGS $LDFLAGS examples/ExternalFastJetHepMC.cpp -o examples/ExternalFastJetHepMC |
| 89 | }}} |
| 90 | |
| 91 | If you need a test HepMC file, you can take it from: |
| 92 | |
| 93 | {{{ |
| 94 | curl -O http://cp3.irmp.ucl.ac.be/~demin/test.hepmc.gz |
| 95 | gunzip test.hepmc.gz |
| 96 | }}} |
| 97 | |
| 98 | Then run one of the two examples {{{ExternalFastJetBasic}}} or {{{ExternalFastJetHepMC}}} (for {{{ExternalFastJetHepMC}}} you need an event file in HepMC format as input): |
| 99 | |
| 100 | {{{ |
| 101 | ./examples/ExternalFastJetBasic cards/delphes_card_CMS_NoFastJet.tcl |
| 102 | ./examples/ExternalFastJetHepMC cards/delphes_card_CMS_NoFastJet.tcl test.hepmc |
| 103 | }}} |