VBS Sample Production with H7/VBFNLO

Generating HEPMC

Installing Herwig

  1. Get the H7 install script here: https://herwig.hepforge.org/downloads.html
  2.  ./herwig-bootstrap --help 
    and check the suggested compiler version. If this is available on the build-system the compiler doesn't need to be bootstrapped.
  3. Install with
     ./herwig-bootstrap --vbfnlo-processes=all --add-pdf=NNPDF30_nlo_as_0118 -j 8 --build-gcc H7 
    • add pdfs as desired (also possible after installation by executing the lhapdf scripts in the install directory)
    • only use "--build-gcc" if the recommended one is not available
    • the "-j" flag determines the number of parallel compile-threads, as usual, adjust to taste
  4. set environment variables/paths with
     source H7/bin/activate 

Generating Events

  1. Write a suitable H7 configuration. This is where the magic happens. For an example (VBS WZ) see WZ_OF.in
  2. Parse the text-configuration into the binary configuration with
     Herwig build --max-jobs=5000 WZ_OF.in 
    the "build/maxjobs" option allows for the parallel integration of subprocesses, greatly speeding up this step. The parameter can be chosen high, this will result in one subprocess per job.
  3. Integrate the subprocesses with
     Herwig integrate --jobid=$NJOB WZ.run 
    ideally with some batch-system. The files that needs to be transferred back are the subdirectory "Herwig-scratch/\<CONFIGNAME\>/integrationJob\<JOBNR\>".
  4. Merge the resulting grids with
     Herwig mergegrids WZ.run 
  5. Run a small test-production to gauge the amount of time it takes to produce events. It's possible to set the event-generation options at this step with an extra file, see for example numev. (this example is for batch-running, so edit the number of events and output file name to something useful)
    Herwig run -N 50 -x numev WZ.run
  6. Based on that test decide on the number of events you want in each batch-submission. For the batch-submission it's important to have a different random seed for each job i.e.
     Herwig run -N 50 -x numev -s $JOBNUM WZ.run 
    The file to be transfered back from the batch-node is the hepmc file that's set up in the "numev" file.
  7. The resulting files typically have few events per file and each file has events with event numbers starting from 1. Both are not particularly ideal for further processing with CMSSW, so the files can be merged into larger files with ascending event numbers using merge_hepmc.py

Computing the Cross Section

  1. Take the Event-Generation config and switch to fixed-order mode (see for example WZ_OF_XSEC.in)
    • switch off the shower
    • set to weighted events
  2. Perform the integration step as for the event generation
  3. run interactively with
     Herwig run -N 50000000 WZ.run
    adjust the number of events as necessary to reach the desired accuracy. Simpler processes can get away with less.

CMSSW Workflow

GEN-SIM step

This step is the most tricky one because the HEPMC reader of CMSSW is not really supported. Even with the fixes of Luca Perrozzi, the HEPMC reader still has the problem that it will only read the first file in the input list and does not support the skip-events functionality. Things can still be cludged together in the following way:
  1. Install Luca Perrozzis fix to the HEPMC reader discussed here [https://hypernews.cern.ch/HyperNews/CMS/get/generators/3184/1.html] so that the GenEventInfo Product gets filled properly.
  2. Get the hepmc.tar file attached here and install it in you CMSSW release. This provides two things:
    1. a module that just copies the hepmc product in CMSSW. This is necessary due to some assumptions in CMSSW workflows about module namings, i.e. that files are always read from a module called "source" and the hepmc product always being created by a module called "generator", so we get around that by reading the hepmc file with a module called source and copy it with a module called generator.
    2. some python snippets that set up this copy mechanism and allow a proper config to be created with cmsDriver.
  3. Create the HEPMC reader config with cmsDriver (example here is for the Moriond17 setup, check with MCM for the proper commands for other campaigns)
     cmsDriver.py IOMC/Input/hepmcGenerator_cfi.py -s GEN,SIM --datatier GEN-SIM -n 10 --eventcontent RAWSIM --filein=file:Events_0.hepmc --filetype=LHE --customise IOMC/Input/hepmccustoms.customiseHepmc,SLHCUpgradeSimulations/Configuration/postLS1Customs.customisePostLS1,Configuration/DataProcessing/Utils.addMonitoring --fileout file:testWZ.root --mc --conditions MCRUN2_71_V1::All --beamspot Realistic50ns13TeVCollision --magField 38T_PostLS1 --python_filename testWZ.py --no_exec
    note the hepmc specific customization command.
  4. Due to the shortcomings of the hepmc-reder module, it's tricky to get this running in crab over the full dataset. This can be worked around by configuring crab to submit jobs such that each job will run on one input file and then setup up the file in a custom execution script. userscript.sh has an example for such a userscript which will copy the appropriate hepmc file to the grid note and adjust the config before running it.

Other CMSSW steps

After the GEN-SIM step the cmssw files should be registered in the database and further steps don't require custom setups. Just look at MCM for the cmsDriver commands needed for you campaign.

-- MatthiasMozer - 2017-01-04

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatin WZ_OF.in r3 r2 r1 manage 6.5 K 2017-01-04 - 12:27 MatthiasMozer example xsec config
Unknown file formatin WZ_OF_XSEC.in r1 manage 6.5 K 2017-01-04 - 12:27 MatthiasMozer example xsec config
Compressed Zip archivetar hepmc.tar r1 manage 10.0 K 2017-01-04 - 13:34 MatthiasMozer  
Texttxt merge_hepmc.py.txt r1 manage 2.4 K 2017-01-04 - 13:27 MatthiasMozer  
Unknown file formatext numev r1 manage 0.5 K 2017-01-04 - 13:17 MatthiasMozer  
Unix shell scriptsh userscript.sh r1 manage 0.4 K 2017-01-04 - 13:46 MatthiasMozer  
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2017-01-04 - MatthiasMozer
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback