Trigger Code

How to run the HLT?

  • Environment:
    • The LHCb software is organized in projects and each project is divided into packages. In order to be able to run the HLT, your application needs to get access to the HLT project. The DaVinci application has access to the HLT project, so you can run the HLT in DaVinci.
    • You need to set the environment of your application, that is, to define the paths where to find the include files and the libraries. The paths are in CMTPROJECTPATH environment variable. The following command does it for DaVinci version v19r8
      • setenvDaVinci v19r8
  • Applications:
    • There are several applications in LHCb. The one used for physics analysis is DaVinci and runs in DST files.
    • With the following commands you can get and compile the DaVinci application
      • getpack Phys/DaVinci v19r8
      • cd Phys/DaVinci/v19r8/cmt
      • cmt config
      • source setup.csh
      • gmake
  • Options:
    • Options define the configuration of your application, that is, what algorithms to execute, in which order and with which properties. The main option file to run the DaVinci application is DaVinci.opts and it is located in the Phys/DaVinci/v19r3/options directory.
    • To run the HLT you need to activate the HLT options. To do so, you need to uncomment the following lines in your DaVinci.opts. They emulate the L0 and run the HLT generic (also called alleys) and the HLT exclusive (also called selections). You can browse the options files of the trigger in the following directory: $HLTSYSROOT/options.
      • #include "$HLTSYSROOT/options/L0.opts"
      • #include "$HLTSYSROOT/options/Hlt.opts"
      • #include "$HLTSYSROOT/options/HltSelections.opts"
    • To run the DaVinci application with the DaVinci options do (in your platform/compiler directory i.e at Phys/DaVinci/v19r3/slc4_ia32_gcc34):
      • ./DaVinci.exe ../options/DaVinci.opts
    • To run the HLT standarlone you only need the HltJob.opts file located at $HLTSYSROOT/options.
      • see for example the python script hltexamples.py at Hlt/HltPython/v*/python/examples

How to run the HLT reconstrucion?

    • You need to add to you driver options file

How to get information from the HltSummary?

  • The output of the HLT is an HltSummary object with the summary of the HLT. For each event you will find a summary located in the Transient Event Store (TES) in following location (LHCb::HltSummaryLocation::Default).
  • You can check if an event has passed the HLT by applying to the summary object the method decision() that returns true or false. Only the HLT in/exclusive selections set a final HLT decision yes.
  • A HltSummary has a list of selections. A selection is the output of a HltAlgorithm, and contains the list of candidates that have passed that selection. Each selection is identified by a name and by an integer ID. For example, the selection HadPreTriggerSingle has as candidates a list of long tracks that have passed the cuts on impact parameter and PT.
  • If you want to know what selections have been passed in an event, and their candidates, you should use (in Python or C++) the following tool:
    • IHltConfSummaryTool hltsum = tool<IHltConfSummaryTool>("HltSummaryTool");* C++
    • hltsum = gaudi.toolsvc().create("HltSummaryTool",interface="IHltConfSummaryTool") ; in Python, see example at Hlt/Python/v*/python/examples hltexamples.py
    • You can get for the list with the names of the selections that passed the event with the method:
      • std::vector<std::string> names = hltsum->selections()
    • You can get the candidates of any selection, i.e, tracks for the HadPreTriggerSingle, via the method:
      • std::vector<LHCb::Track*> tracks = hltsum->selectionTraks("HadPreTrigger")

How to get information about the HLT Configuration?

  • The HLT is configured via a unique key, named Trigger Configuration Key (TCK), that defines the sequence of algorithms, and the cuts (we refer to them as filters of a selection)
  • The HLT configuration stores:
    • map of selection name <-> integer ID
    • map of extraInfo name <-> integer ID
    • input selections given a selection
    • type of candidates of a selection (i.e Tracks, Vertices,...)
    • filters names applied in a selection , they are a list of names indicating the filter, i.e. "PT,>,2000 ", is the filter to apply a PT cut above 2000 MeV.
  • You can acces the HltConfiguration, it in Python, or C++ via the IHltConfSummaryTool (see how above):
    • to get the string name <-> integer ID of a selection use the method:
      • int id = hltsum->confInt("SelectionID/HadPreTriggerSingle"),
      • std::string name = hltsum->confString("SelectionID/304")
    • to get the string name <-> integer ID of a quantity stored as extraInfo in the candidate use the method:
      • int id = hltsum->confInt("InfoID/IP")
      • std::string name = hltsum->confString("InfoID/2")
    • to get the input selections used in a give selection, use the method:
      • std::vector<std::string> inputSelections = hltsum->confStringVector("HadPreTriggerSingle/InputSelections")
    • to get the list with the names of the filters applied in a selection use:
      • std::vector<std::string> filterNames = hltsum->confStringVector("HadPreTriggerSingle/Filters")
    • to get the type of the candidates use:
      • std::string candidateType = hltsum->confString("HadPreTriggerSingle/SelectionType"), with candidateType = Track,Vertex,Particle
    • Please look at the python script hltexamples.py at Hlt/HltPython/v*/python/examples

How to define an HLT alley?

  • The HLT alleys are defined via options, see for example HltHadConfAlleySequence.opts at HltSys/v*/options. The alley is a sequencer, that contains different HltAlgorithms. Most of the HLT alleys uses the HLT generic code, that is, a collection of few generic algorithms that deals with the reconstruction and the filtering. Usually a reconstruction algorithm is followed by a filtering one.
  • An HltAlgorithm takes as input selections and produce an output selection. Note that the selections can be stored or taken from the HltSummary, so, in oder words, the HLT code runs in the HltSummary.
  • These are the generic HLT algorithms:
    • HltTrackFilter: filter a selection of tracks using a list of filters for tracks.
      • some examples of filter: "PT,>,2000", or "IP_PV2D,||>,0.1", the second filter represents the minimum absolut impact parameter with respect any vertices in the selection "PV2D", that is, the primary vertices made with 2D Velo tracks, greater than 0.1 mm.
      • The options are:
    • HltVertexFilter: filter a selection of vertices, using a list of filters for vertices, similar to HltTrackFilter.
      • The options are:
        • InputSelection = "Vertex0"
        • FilterDescriptor = {"VertexDimuonMass,>,500."} (the invariant mass, assumming they are muons, of the two tracks should be greather than 500 MeV)
        • OutputSelection = "Vertex1" (if, no option, by default, it takes the name of the algorithm)
    • HltTrackUpgrade: Takes as input a selection of tracks and call the reconstruction to "upgrade" them adding information from another tracking detector.
      • Types of reconstruction accepted:
        • TConf : a muon track, or calo, adding T stations, normally called "L0 Confirmation"
        • Velo: RZVelo tracks to Velo 3D
        • VeloTT: Velo 3D to VeloTT tracks
        • Forward: Velo to Long tracks
      • If a track was previously "upgraded", the reconstruction is not run twice.
      • The options are:
    • HltTrackMatch: match two track segments into a track
    • HltVertexMaker: makes a 2 track vertex.
      • It combines two selections of tracks, into one selection of vertices
      • the vertices will have one track at least from the first selection of tracks!, so track1+track1, and track1+track2, vertices will be procuded, were track1 belong to the first selection of tracks, and track2 belongs to the second selection of tracks.
      • The vertices will be created if they pass a list of filters based on two tracks. One example of filter is "DOCA,<,0.2", that is the two tracks should have a Distance Of Closest Approach smaller than 0.2 mm.
      • The options are:
    • HltVertexUpgrade: "upgrade" the 2 tracks of the vertex, adding to them information from another tracking detector
      • It one of the tracks has been already "upgraded", the reconstruction it is not run again.
      • The possible "upgrades" are the same as the HltTrackUpgrade.
      • The options are:
    • HltXXXPrepare: uses a container of objects of type XXX (L0Muon,L0Calo,Track,Vertex), in the TES, as a selection
      • These algorithms are the entry points of the HLT
      • All the L0 candidates are converted into object of type Track, for convenience.
      • In the case of XXX as Track or Vertex, this algorithm is identical as HltTrackFilter, except that the input comes from the TES
      • The options are (as the HltTrackFilter) except:

How to save a Selection in the HltSummary?

How to get the monitor histogram of the HLT?

How to write a new C++ filter for the HLT?

How to write a new C++ HLT Algorithm?

-- MiriamGandelman - 16 Oct 2006

Topic attachments
I Attachment History Action Size Date Who Comment
PDFpdf Structure_and_guidelines.pdf r1 manage 22.7 K 2006-10-16 - 18:47 MiriamGandelman Code structure and guidelines
Edit | Attach | Watch | Print version | History: r27 < r26 < r25 < r24 < r23 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r27 - 2007-12-13 - JoseHernando
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb 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