Fork me on GitHub

Changes between Initial Version and Version 1 of WorkBook/ExternalFastJet


Ignore:
Timestamp:
Dec 17, 2014, 8:42:27 AM (10 years ago)
Author:
Pavel Demin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WorkBook/ExternalFastJet

    v1 v1  
     1= Run Delphes with external !FastJet =
     2
     3== Introduction ==
     4
     5This section explains how you can run your own !FastJet code on Delphes particles. 
     6We provide two working codes in the "examples" directory, [source:examples/ExternalFastJetBasic.cpp] and [source:examples/ExternalFastJetHepMC.cpp].
     7
     8Both 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
     10The [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
     12The input particle collection to jet clustering are specified inside [source:examples/ExternalFastJetBasic.cpp] and [source:examples/ExternalFastJetHepMC.cpp] via:
     13
     14{{{
     15inputArray = modularDelphes->ImportArray("ModuleInstanceName/arrayName");
     16}}}
     17
     18By 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{{{
     21inputArray = modularDelphes->ImportArray("EFlowMerger/eflow");  // particle-flow objects
     22}}}
     23or
     24
     25{{{
     26inputArray = modularDelphes->ImportArray("Calorimeter/towers"); // calorimeter objects
     27}}}
     28or
     29
     30{{{
     31inputArray = modularDelphes->ImportArray("TrackMerger/tracks"); // charged tracks
     32}}}
     33or
     34
     35{{{
     36inputArray = modularDelphes->ImportArray("Delphes/stableParticles"); // all gen-level stable particles
     37}}}
     38
     39== Run ==
     40
     41In 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
     43Then set the paths to your Delphes, !FastJet and ROOT installations (DELPHES_DIR, FASTJET_DIR and ROOT_DIR):
     44
     45{{{
     46DELPHES_DIR=<path to Delphes installation>  # main Delphes directory
     47FASTJET_DIR=<path to FastJet installation>  # by default should be xyz/fastjet-install
     48ROOT_DIR=<path to ROOT installation>       
     49}}}
     50
     51Then run the following commands to build the executable:
     52
     53{{{
     54DELPHES_LIB="-Wl,-rpath $DELPHES_DIR -L$DELPHES_DIR -lDelphesNoFastJet"
     55
     56FASTJET_INC=`$FASTJET_DIR/bin/fastjet-config --cxxflags`
     57FASTJET_LIB=`$FASTJET_DIR/bin/fastjet-config --libs`
     58
     59ROOT_INC=`$ROOT_DIR/bin/root-config --incdir`
     60ROOT_LIB=`$ROOT_DIR/bin/root-config --libs`
     61
     62CXXFLAGS="$FASTJET_INC -I$ROOT_INC -I$DELPHES_DIR -I$DELPHES_DIR/external"
     63LDFLAGS="$FASTJET_LIB $ROOT_LIB $DELPHES_LIB"
     64}}}
     65
     66The {{{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
     68If you have a [http://fastjet.hepforge.org/contrib/ FastJet Contrib] installation, assuming you installed it in
     69the {{{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{{{
     72CONTRIB_DIR=<path to contrib installation>
     73CONTRIB_INC=$CONTRIB_DIR/include
     74CONTRIB_LIB="-Wl,-rpath $CONTRIB_DIR -L$CONTRIB_DIR -lNsubjettiness -lSoftKiller"
     75}}}
     76
     77and add {{{CONTRIB_INC}}} and {{{CONTRIB_LIB}}} into {{{CXXFLAGS}}} and {{{LDFLAGS`:
     78
     79{{{
     80CXXFLAGS="$FASTJET_INC -I$ROOT_INC -I$DELPHES_DIR -I$DELPHES_DIR/external -I$CONTRIB_INC"
     81LDFLAGS="$FASTJET_LIB $ROOT_LIB $DELPHES_LIB $CONTRIB_LIB"
     82}}}
     83
     84Compile:
     85
     86{{{
     87g++ $CXXFLAGS $LDFLAGS examples/ExternalFastJetBasic.cpp -o examples/ExternalFastJetBasic
     88g++ $CXXFLAGS $LDFLAGS examples/ExternalFastJetHepMC.cpp -o examples/ExternalFastJetHepMC
     89}}}
     90
     91If you need a test HepMC file, you can take it from:
     92
     93{{{
     94curl -O http://cp3.irmp.ucl.ac.be/~demin/test.hepmc.gz
     95gunzip test.hepmc.gz
     96}}}
     97
     98Then 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}}}