HLT Documentation

Complete: 3

Runing Fast Simulation with HLT

Since CMSSW_1_8_0, HLT is fully integrated in Fast Simulation. In the 18X series, the HLT configuration is taken from the configuration file HLTrigger/Configuration/data/main/HLTpaths.cff. From CMSSW204 onwards, the HLT configuration is taken from the configuration database (hereafter called confDB). General documentation about the HLT (which Fast Simulation runs with specific interface) can be found here

From CMSSW31X onwards

The situation is similar to that of CMSSW20X, with the main difference that there are two different trigger tables maintained: 8E29(default) and 1E31, while the old large table is not mantained anymore. The HLT paths are taken from the ConfDb and in the FastSimulation package there is duplication of the various files and scripts necessary to run the HLT.

  • 8E29 Table is the default. It means that it is explicitely loaded in the standard FastSimulation test files
ExampleWithHLT_cfg.py
IntegrationTestIdealWithHLT_cfg.py
IntegrationTestWithHLT_cfg.py

In order to load a new table when changes are made on the ConfDB we run the following procedure:

./ExampleWithHLT_py.csh
or
./IntegrationTestWithHLT_py.csh
These scripts create the files:
 /FastSimulation/Configuration/python/HLT_XXXX_cff.py (where XXXX=8E29, 1E31) 
that can be called also by the cmsDriver command.

From CMSSW20X onwards

The situation is very similar to that of CMSSW18X, except that the HLT paths are now taken from the confDB instead of HLTpaths.cff. The exact same integration tests as above can be run with two scripts:

FastSimulation/Configuration/test/ExampleWithHLT.csh
FastSimulation/Configuration/test/IntegrationWithHLT.csh
The first step of these two scripts consists in getting a flat configuration file equivalent to HLTpaths.cff (called HLT.cff) through a python script, and the second step just invokes cmsRun as explained above. Because you may want to use a different version of the confDB, a different L1 menu and a different list of HLT paths, you can do these two steps separately:

  • Getting the flat HLT.cff file, with the following python command
FastSimulation/Configuration/test/getFastSimHLTcff.py [Version from ConfDB] [Name of the cff file] [Optional L1 Menu] [Optional subset of paths]
the arguments of which are explained now.
  1. The [Version of the confDB] of your choice can be obtained from the HLT config broswer. The appropriate syntax is, for example, /dev/CMSSW_2_1_0_pre4/HLT/V7.
  2. The [Name of the cff file] ought to be FastSimulation/Configuration/test/HLT.cff, to allow the integration tests to run
  3. The default [Optional L1 Menu] is "L1Menu2008_2E30", but you can choose the one you wish, if compatible with the chosen confDB version content. Other options are "L1Menu2008_2E31" and "L1Menu2007". Always check in ExampleWithHLT.cfg or IntegrationTestWithHLT.cfg (or the cfg of your choice) that the adqueate L1 trigger menu is also set, with the adequate prescale factors. The default is L1Menu2008_2E30, with no prescale factors.
  4. The default [Optional subset of paths] is "All", but can be any list of paths you wish to test (provided they exist in the list of HLT paths, of course), e.g., "HLT1MuonIso,HLT1MuonNonIso"

  • Running the job can be then done in the exact same way as in CMSSW18X. (See above.)

In CMSSW18X

In CMSSW18X, two integration tests demonstrates how to use HLT:

cmsRun FastSimulation/Configuration/test/ExampleWithHLT.cfg
cmsRun FastSimulation/Configuration/test/IntegrationWithHLT.cfg
In the first test, t tbar events are generated without pile-up events, and processed through the Fast-Simulation step. Only the HLT is run after Fast Simulation. This is achieved by adding the Fast Simulation sequence, followed by the L1 emulation, in the hltBegin sequence, which starts each of the HLT paths from HLTpaths.cff. The hltEnd sequence (which ends each of the HLT paths) is dummy in this example. Note that this test uses fake conditions. The second test differs from the first test as follows, (i) frontier conditions are used instead of fake conditions; and (ii) the hltEnd sequence contains the complete reconstruction step. The latter means that each event accepted by at least one of the HLT paths will be reconstructed (tracking, muons, electrons, photons, particle flow, b tagging, tau tagging, jets, MET, etc.). In both tests, the output file contains the AOD event content.

Changing the HLT/L1 menu

It may happen that one wants to test a different HLT menu with respect to the one that corresponds to the conditions in the DB (either MC or STARTUP). Here follows an example on how to run a STARTUP HLT menu together with a MC CMS.GlobalTag, starting from your config file which run the MC with the conditions as given by the corresponding MC CMS.GlobalTag.

To change the HLT menu itself is easy, just include In your fast sim config file:

process.load("FastSimulation.Configuration.HLT_GRun_cff")
or
process.load("FastSimulation.Configuration.HLT_8E29_cff")

Then you have to feed the HLT with its L1 seeds. The L1 menu is taken from the configuration loaded in ConfDB, and you have to tell yoiur script that it must be taken from a different configuration with respect to the one you are using for the other detector conditions In order to do that, add,

process.Level1MenuOverride = cms.ESSource("PoolDBESSource",
                                          appendToDataLabel = cms.string(''),
                                          siteLocalConfig = cms.untracked.bool(False),
                                          globaltag = cms.string(''),
                                          RefreshEachRun = cms.untracked.bool(True),
                                          toGet = cms.VPSet(cms.PSet(
    record = cms.string('L1GtTriggerMenuRcd'),
    tag = cms.string('L1GtTriggerMenu_L1Menu_Commissioning2010_v2_mc')
    )),
                                          label = cms.untracked.string(''),
                                          messagelevel = cms.untracked.uint32(0),
                                          DBParameters = cms.PSet(
    authenticationPath = cms.untracked.string('.'),
    connectionRetrialTimeOut = cms.untracked.int32(60),
    idleConnectionCleanupPeriod = cms.untracked.int32(10),
    messageLevel = cms.untracked.int32(0),
    enablePoolAutomaticCleanUp = cms.untracked.bool(False),
    enableConnectionSharing = cms.untracked.bool(True),
    enableReadOnlySessionOnUpdateConnection = cms.untracked.bool(False),
    connectionTimeOut = cms.untracked.int32(0),
    connectionRetrialPeriod = cms.untracked.int32(10)
    ),
                                          timetype = cms.string('runnumber'),
                                          connect =
cms.string('frontier://FrontierProd/CMS_COND_31X_L1T'),
                                          BlobStreamerName =
cms.untracked.string('TBufferBlobStreamingService'),
                                          tag = cms.untracked.string('')
                                          )

and finally tell the framework which one to use, with:

process.es_prefer_Level1MenuOverride = cms.ESPrefer( "PoolDBESSource",
"Level1MenuOverride" )

Running Fast Simulation with HLT Open (in CMSSW18X only)

Introduction

The fast simulation version of "HLT Open" will be fully available in CMSSW_1_8_4 in view of creating, tuning and validating trigger menus with superior efficiency. It is meant to be fast-sim equivalent to the "complete" version of HLTrigger/HLTanalyzers. The latter functions with Raw data as input, while the former simply starts from generation of the events of your choice, followed by MC filtering, fast simulation, L1 emulation, HLT simulation, reconstruction of photons, electrons, muons (and what you'd like), and HLT open analysis.

For impatient trigger-menu creators, a working version of HLTopen can also be tried in CMSSW_1_8_3 (or even in 1_8_1), with the following add'l tags.

scramv1 project CMSSW CMSSW_1_8_3
eval `scramv1 runtime -csh`
cvs co -r V00-00-27-04 FastSimulation/HighLevelTrigger
cvs co -r V01-04-09-04 FastSimulation/Configuration
cvs co -r V02-05-01-04 FastSimulation/Event
cvs co -r V02-02-00 FastSimulation/ParticleDecay
cvs co -r V01-04-00-02  FastSimulation/TrajectoryManager
cvs co -r V00-02-30-02 HLTrigger/HLTanalyzers
scramv1 b
cmsRun FastSimulation/HighLevelTrigger/test/HLTAnalysis.cfg

The above configuration file generates, simulates, emulates, reconstructs and HLT-opens 20 H -> ZZ -> llll events, and produces a TEST.root file with the root tree awaited by the trigger-menu creators. You'll immediately notice, however, a warning message issued for each events, saying that no muon candidates are found. This is because the InputTag of parametrized muons produced by Fast Simulation is paramMuons:ParamGlobalMuons, while the analyser (HLTrigger/HLTAnalyzers/src/HLTAnalyzer.cc) does not accept InputTag's as input, but strings instead, for the module labels only. As a consequence, the user (until strings are changed to InputTags: Pedram, could you please do that?) has to modify the following line in the source code

134c134
<   iEvent.getByLabel(muon_,muon);
by
>   iEvent.getByLabel(muon_,"ParamGlobalMuons",muon);
and to scramv1 b once more, before lauching cmsRun successfully.

Let us now examine HLTAnalysis.cfg in details, so as to allow the trigger-menu creators to play with it and create menus with pleasure and joy.

Initialization of the cmsRun job

The cfg file starts with the usual initialization magic.

process ANALYSIS  = {

    untracked PSet maxEvents = {untracked int32 input = 20}

    ######################################################################
    # Random number generator service for the simulation step
    service =  RandomNumberGeneratorService {
        # This is to initialize the random engine of the source
        untracked uint32 sourceSeed = 123456789
        # This is to initialize the random engines of Famos
        PSet moduleSeeds =
        {
            untracked uint32 VtxSmeared = 123456789
            untracked uint32 famosPileUp = 918273
            untracked uint32 famosSimHits = 13579
            untracked uint32 siTrackerGaussianSmearingRecHits = 24680
            untracked uint32 caloRecHits = 654321
            untracked uint32 paramMuons = 54525
            untracked uint32 l1ParamMuons = 4389
            untracked uint32 MuonSimHits = 97531
            untracked uint32 muonDTDigis = 67673876
            untracked uint32 muonCSCDigis = 525432
            untracked uint32 muonRPCDigis = 524964
        }
    }
    ######################################################################

The name of the process (the third field of the InputTag's) is "ANALYSIS", the number of events to be produced (maxEvents) in 20, and the various modules that need random initialization (in the fast simulation step) are taken care of by the random number generator service.

Event generation

You can generate (or read) any kind of events you'd like. A variety of sources are included in HLTAnlysis.cfg:

   ######################################################################
    #           SOURCE TO GENERATE EVENTS
    ######################################################################
    # Put here your source
    # Several examples follow, just add the one you'd like if it's
    # not in this list below.
    # Generate H -> ZZ -> l+l- l'+l'- (l,l'=e or mu), with mH=180GeV/c2
    include "FastSimulation/Configuration/data/HZZllll.cfi"
    # Generate ttbar events
    #  include "FastSimulation/Configuration/data/ttbar.cfi"
    # Generate multijet events with different ptHAT bins
    #  include "FastSimulation/Configuration/data/QCDpt80-120.cfi"
    #  include "FastSimulation/Configuration/data/QCDpt600-800.cfi"
    # Generate Minimum Bias Events
    #  include "FastSimulation/Configuration/data/MinBiasEvents.cfi"
    # Generate muons with a flat pT particle gun, and with pT=10 GeV.
    # include "FastSimulation/Configuration/data/FlatPtMuonGun.cfi"
    # replace FlatRandomPtGunSource.PGunParameters.PartID={130}
    # Generate di-electrons with pT=35 GeV
    # include "FastSimulation/Configuration/data/DiElectrons.cfi"
    ######################################################################
to allow you to generate Higgs into four leptons events (current default), ttbar events, multijet events, minimum bias events, or even single particles with particle guns. You can of course include whatever cfi file you'd like in the above list, should you wish to generate other kinds of events.

Generator-level event filters

To save time, you may want to filter events at generator level (e.g., to keep only events with a lepton with a pT in excess of 10 GeV/c, or God knows what). To this aim, the sequence MCfilter has been prepared for you.

    ######################################################################
    #        GENERATOR-LEVEL EVENT FILTER
    ######################################################################
    # Put your generator-level filter(s) at the end of this sequence
    # GenParticles, etc, are needed for genJets, GenMet, etc...
    include "CMS.PhysicsTools/HepMCCandAlgos/data/genEventWeight.cfi"
    include "CMS.PhysicsTools/HepMCCandAlgos/data/genEventScale.cfi"
    include "CMS.PhysicsTools/HepMCCandAlgos/data/genParticles.cfi"
    sequence MCfilter = {
        genParticles &
        genParticleCandidates &
        genParticlesAllStable &
        genCandidatesForMET &
        iterativeCone5GenJets &
        genMet &
        genEventScale &
        genEventWeight
    }
    ######################################################################
As it is now, it does not filter anything, but just prepare all what is needed for any filter to work (genParticles, genJets, genMet). All what you have to do is to add a filter of your choice, after "genEventWeight". This filter will then act before the simulation path, the HLT paths and the reconstruction paths.

Simulation step

The simulation step is executed with (surprise, surprise!) Fast Simulation, as follows:

    ######################################################################
    #        SIMULATION WITH FAST SIMULATION
    ######################################################################
    # (Fast) Simulation step
    include "FastSimulation/Configuration/data/CommonInputsFake.cff"
    include "FastSimulation/Configuration/data/FamosSequences.cff"
    sequence simulation = {
        MCfilter &
        simulationWithFamos
    }
    ######################################################################
As can be seen, only events which satisfy the aforementioned filter will be processed through the simulation. Note that this sequence "simulation" is included in the "hltBegin" sequence, where it is actually executed (i.e., when emulating the L1, see below).

Emulation of Level-1 and High-Level trigger paths.

The L1 and HLT are processed as follows.

    ######################################################################
    #        EMULATION OF LEVEL-1 TRIGGER, FOLLOWED BT ALL HLT PATHS
    ######################################################################
    # L1 Emulator and HLT Setup
    sequence hltEnd = { dummyModule }
    include "FastSimulation/HighLevelTrigger/data/common/HLTSetup.cff"
    include "HLTrigger/Configuration/data/main/HLTpaths.cff"
    replace hltTrigReport.HLTriggerResults = TriggerResults::ANALYSIS
    ######################################################################
The hltBegin sequence, defined in HLTSetup.cff, contains the MC filter, the simulation step and the L1 emulation. It is the first step of each of the HLT paths, described in HLTpaths.cff.

Reconstruction

The HLTAnalyser.cc code also make use (in its present form) of offline electrons, photons and muons. An offline reconstruction sequence, limited to electron, photon and muon reconstruction, was therefore added in another path (also preceeded by the generator-level filter), as exemplified below.
    ######################################################################
    #        RECONSTRUCTION OF PHOTONS, ELECTRONS, MUONS
    ######################################################################
    # Reconstruction of all events, including those rejected at L1/HLT
    # Note: if you don't need reconstruction of electrons, comment
    # famosElectronSequence, if you don't need reconstructed photons,
    # comment famosPhotonSequence, if you don't need reconstructed muons,
    # comment paramMuons. If you need more reconstructed objects, just
    # ask Patrick.Janot@cern.ch
    sequence reconstruction = {
        ctfGSTracking &
        towerMaker &
        caloTowers &
        ecalClusteringSequence &
        famosElectronSequence &
        famosPhotonSequence &
        paramMuons
    }
    # If you don't need reconstruction at all, comment the Reconstruction path
    path Reconstruction = {
        MCfilter &
        doCalo &
        towerMakerForAll &
        reconstruction
    }
    ######################################################################

HLT-open analysis

Finally, the HLT-open analysis is included as follows

    ######################################################################
    #           HLT OPEN, FINALLY !
    ######################################################################
    # And here, finally, we do the HLTOpen thing.
    # Trigger seequences are defined here (without filters)
    # It is a simplified copy of the same file in HLTrigger/HLTanalyzers
    # to avoid duplicate definitions of triggers
    include "FastSimulation/HighLevelTrigger/test/HLTopen.cff"
    # Here the HLT analyser module is defined. It's copied from a
    # similar file in HLTrigger/HLTanalyzers, where both the module
    # definition and other things were merged (bad practice)
    include "FastSimulation/HighLevelTrigger/test/HLTAnalyser.cfi"
    # Here the analysis step for HLTOpen
    # It has to be in an endpath, because it need the TriggerResults,
    # themselves produced in the precious endpath.
    endpath AnalyzeThis = {hltanalysis}
    ######################################################################
Several important comments are made in the cfg file, and should be repeated here.
  1. The hltanalysis source code is in HLTrigger/HLTanalyzers, and hence has not been modified: it works identically with fast simulation and raw data.
  2. The htlanalysis configuration has been copied for HLTrigger/HLTanalyzers/test/HLTAnalysis.cfg to FastSimulation/HighLevelTrigger/test/HLTAnalyser.cfi. Indeed, having a module defined directly in a cfg file is not only bad practice, but not practical for adding replace statements (instead of having to copy the entire module configuration). Pedram, could you please (i) put the hltanalysis configuration in a spearate cfi file that both fast simulation and raw data could use; and (ii) change all "string"s to "!InputTag"'s?
  3. The HLT-open paths (which are essentially HLT paths without filters) have been copied from HLTrigger/HLTanalyzers/test/HLTopen.cfi, without any modifications but the removal of essentially all include files. Pedram, could you move these include statement to a separate file, in include this file in the raw-data version of HLTAnlysis.cfg, so that both fast simulation and raw data could use the same HLTopen.cfi (actually a cff, as sequences are defined therein).
  4. I noticed that HLTopen.cfi disappeared in the latest tags (V00-02-30-04) of HLTrigger/HLTanalysers - which by the way does not even compile. Please let me know what to do with this latest tags !
  5. The htlanalysis module is added in an endpath rather than in a path, because it need the Trigger Results to be available. The latter does not happen before the HLT endpath is run. As a consequence, as no filter is allowed in an endpath, the MCfilter sequence cannot be added before hltanalysis, which in turn will force all events to be processed through hltanalysis. I haven't tried, but I guess that the filtered events will simply be ignored (with a number of warning messages) as the necessary inputs won't be available for these events.

Message logger

The message logger currently spits its output in a file name "detailedInfo.txt":

    ######################################################################
    #          MESSAGE LOGGER
    ######################################################################
    # Keep the logging output in a file named "detailedInfo.txt"
    include "FWCore/CMS.MessageService/data/MessageLogger.cfi"
    replace MessageLogger.destinations = {"detailedInfo.txt"}
    ######################################################################
You can comment the last line to have the output on your terminal.

Price/Retribution

Because I managed to make HLT open available (and working from the first iteration!) in Fast Simulation in less than half a day, Pedram is supposed to offer an iranian dinner to me (and to the person of my choice, right?).

Review Status

Reviewer/Editor and Date Comments
PatrickJanot - 20 May 2008 Add generic HLT documentation
PatrickJanot - 04 April 2008 Template page + HLT open

Responsible: AndreaPerrotta
Last reviewed by:

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2011-05-03 - AndreaPerrotta



 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

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