NEU Guide to EMTF

What is the EMTF?

  • EMTF stands for Endcap Muon Track Finder
  • EMTF is the muon trigger for the endcaps
  • EMTF currently uses CSC and RPC information to create tracks
Screen_Shot_2017-12-04_at_10.29.18_AM.png

Cathode Strip Chambers ( CSC)

  • Cathode Strip Chambers are used in the endcaps for muon detection
  • Consists of arrays of positively charged anode wires crossed with negatively charged copper cathode strips
  • Muon will leave two position coordinates which will be used to reconstruct position
  • CSCs are fast detectors suitable for use in triggering

CSC Layout

  • 4 stations covering 360 degrees in phi
  • outer 3 stations have 2 rings. Inner ring has 18 chambers while outer ring has 36
  • Station 1 is split into 1/1a, 1/1b, 1/2 and 1/3
  • Each ring is split into 6 sectors shown below.
  • Sectors are further split into CSC_IDs shown below

CSC_Layout

Chamber_layout

Useful Twikis:

Resistive Plate Chambers ( RPC)

  • Resistive Plate Chambers are used in both the barrel and endcaps for muon detection
  • RPCs consist of two parallel plates, a positively-charged anode and a negatively-charged cathode
  • Both are made of a very high resistivity plastic material and separated by a gas volume
  • When a muon passes through tan avalanche of electrons occurs in the gas which is detected by external metallic strips after a time delay
  • RPCs are fast detectors with timing resolution ~1ns

RPC Layout

  • 4 stations covering 360 degrees in phi
  • Currently only rings 2 and 3 are incorporated into the EMTF
  • Each ring is split into 6 sectors shown below
  • Sectors are further split into CSC_IDs shown below

How to run EMTF online DQM

The DQM is performed online and offline. The Online DQM is: a subset of the data are reconstructed and monitored at P5 to give immediate feedback about the detector status.

How to visualize the DQM histograms:

  • First go to RunSummary page
  • Enter range of Run Numbers or range of dates or click the last 24 hours, then press SubmitQuery
  • Screen_Shot_2015-09-22_at_9.55.25_AM.png
  • The RunSummary page will display a list of runs as you requested (see above), click the run number in the first column, it will links to a summary page of that specific run.
  • Screen_Shot_2015-09-22_at_9.58.42_AM.png
  • find Other services, click the link of DQM GUI Online, it will take you to the CMS Online DQM GUI.
  • On the page of DQM GUI Online, click Summary, choose Everything, then go to L1T -> L1TStage2EMTF , you will see all Online DQM plots from EMTF.
  • Screen_Shot_2015-09-22_at_10.01.35_AM.png

How to check out the code for running online DQM GUI:

  • The code is in the package: DQM/L1TMonitor in github:
  • src/L1TStage2EMTF.cc and its header file: interface/L1TStage2EMTF.h are the main codes for EMTF DQM plots.
  • for how to run DQM plots locally, see L1CSCTrackFinderExpert

EMTF DQM Development

Overview

The Endcap Muon Track Finder (EMTF) data quality monitoring (DQM) is software that analyzes and plots data that the EMTF receives from CSCs. You can see it online at

https://cmsweb.cern.ch/dqm/online

by clicking on summary, changing it to Everything, then selecting L1T2016 /L1TStage2EMTF. The EMTF DQM uses 3 collections of information: Hits that detail the LCTs (local charge tracks) detected by CSCs, Tracks that represent several LCT hits reconstructed into a muon, and RegionalMuonCand output tracks that are the Tracks that the EMTF actually sends to the uGMT (micro global muon trigger). Hit plots contain information such as the individual strips and wires that were triggered in a CSC, as well as the station and ring (e.g. ME1/1). Track plots mostly show the coordinates of the reconstructed muon, such as eta, phi, and other values such as transverse momentum (Pt) and bunch crossing timing (BX). RegionalMuonCand Output tracks are very similar to normal tracks, except they contain hardware values (e.g. phi is measured in radians for normal tracks, but goes 0-575 for output tracks).

Getting the Code

The EMTF DQM can be run on lxplus for development use. On lxplus (ssh -Y youusername@lxplusNOSPAMPLEASE.cern.ch), check out an official CMSSW release:

cmsrel CMSSW_8_0_10_patch2
cd CMSSW_8_0_10_patch2/src

Then, set up the cmssw git environment:

cmsenv
git cms-init

Check out the relevant packages (not always necessary)

git cms-addpkg DQM/L1TMonitor DQM/L1TMonitorClient DQM/Integration EventFilter/L1TRawToDigi EventFilter/L1TXRawToDigi DataFormats/L1TMuon L1Trigger/L1TMuonEndCap

There should now be a few folders in /src. The most important code is in the DQM folder. L1Trigger contains the emulator. EventFilter and DataFormats contain the unpacker that converts the raw binary output from the EMTF into the 3 collections mentioned above.

Now get the most up-to-date DQM from the cms-l1t-offline github: git remote add cms-l1t-offline git@github.com/cmssw.git git cms-merge-topic -u cms-l1t-offline:l1t-dqm-CMSSW_8_0_10_patch2 (l1t-dqm-CMSSW_8_0_10_patch2 is the branch in the remote cms-l1t-offline that we're getting code from)

Then make sure the code compiles: in CMSSW_8_0_10_patch2/src, compile the code and use 8 cores with "scramv1 b -j8"

Configuring the DQM for lxplus

(Taken and edited from https://twiki.cern.ch/twiki/bin/view/Sandbox/L1TDQMModuleDev) 1. Within DQM/Integration/, create a new directory called "upload".

mkdir upload
  1. Modify fileinputsource_fi.py, located in /DQM/Integration/python/config/.
    • For the source configuration object, add your input file path(s) to the fileNames argument and comment out the rest.
    • Set the maximum number of events to process by changing the value of the maxEvents parameter's input argument. (e.g. 5000)
    • You can find run files on the eos drive. In lxplus, type "eos" and use "cd" and "ls" to navigate the folders. A good run, 275001, can be found in "/eos/cms/store/express/Run2016B/ExpressPhysics/FEVT/Express-v2/000/275/001/00000/"
  2. Modify l1tstage2_dqm_sourceclient-live_cfg.py, located in /DQM/Integration/python/clients/.
    • In the "Event Source and Condition" section, comment out the two lines beneath "Live Online DQM in P5" and uncomment the two lines beneath "Testing in lxplus".
    • In the "DQM Environment" section, comment out the line for the reference .root file as shown.
      #process.DQMStore.referenceFileName = "/dqmdata/dqm/reference/l1t_reference.root"
    • In the "Stage2 DQM Paths" section, uncomment any of the lines beneath "Remove Subsystem Modules" to exclude those subsystems from the online DQM path.
    • In the "Stage2 Unpacking Path" section, comment out any unpackers as shown to exclude them from the unpacking path.
      # For example, the following excludes all but the EMTF unpacker
      process.stage2UnpackPath = cms.Path(
          #process.l1tCaloLayer1Digis +
          #process.caloStage2Digis +
          #process.gmtStage2Digis +
          process.emtfStage2Digis #+
          # etc.
      )
  3. Execute the L1T Online DQM sequence from within the DQM/Integration/ directory.
    cmsRun python/clients/l1tstage2_dqm_sourceclient-live_cfg.py
    This should generate a .root file filled with your subsystem's DQM plots in the DQM/Integration/upload/ directory created in the first step.
  4. When the program has stopped, cd into the "upload" folder you created. Load the file into root with "root -l filename.root". Type "TBrowser b" to open a directory window that contains the root file, and double click through the folders until the plots are show.

Modifying the Code

The code that makes the EMTF DQM plots is in DQM/L1TMonitor/src/L1TStage2EMTF.cc. The program has 2 major sections: bookHistograms and analyze. bookHistograms defines the basic histogram values (1D or 2D, name, title, number of bins, first bin value, last bin value). The analyze section is the code that fills data into the histograms (via histogram->Fill(value)). It contains 3 "for loops" that correspond to the 3 collections (e.g. the LCT hit collection uses "for (std::vector::const_iterator Hit = HitCollection ->begin(); Hit = HitCollection ->end(); ++Hit)" ).

To add a new histogram to the DQM, first declare it in the header file, L1tMonitor /interface/L1TStage2EMTF.h, with "MonitorElement* histoname". Then, add it in the bookHistograms section with "histoname = ibooker.book1D(name, title, etc.)". Then fill it in the analyze section with histoname->Fill(variable). The analyze function is called on every event, and each event contains 0-10 LCT hits and 0-4 Tracks. To test the new histogram, recompile the code with "scramv1 b -j8", run the DQM with "cmsRun python/clients/l1tstage2_dqm_sourceclient-live_cfg.py" in DQM/Integration, and browse the root file.

Setting up the GUI

The plots shown in TBrowser don't look exactly like the online plots. This is because the online gui has render plugins for the DQM. See the instructions here https://twiki.cern.ch/twiki/bin/view/Sandbox/L1TDQMModuleDev for "Testing with the Online DQM GUI" Once the GUI is set up, the EMTF DQM render plugin can be found at /testGui/deployment/dqmgui/styleL1TStage2EMTFRenderPlugin.cc. Once changes have been made, stop the server, reinstall the gui with "$PWD/deployment/Deploy -A slc6_amd64_gcc493 -r "comp=comp" -R comp@<LATESTTAG> -t MYDEV -s "prep sw post" $PWD dqmgui/bare", and restart the server to update the changes. "DQM/

Integration

This section describes how the Integration code runs the L1TMonitor and L1TMonitorClient code, all the way from running Integration/python/clients/l1tstage2_dqm_sourceclient-live_cfg.py to executing L1TStage2EMTF.cc. l1tstage2_dqm_sourceclient-live_cfg.py loads a python file with "process.load("DQM.L1TMonitor.L1TStage2_cff")", then runs two processes defined in that file, l1tStage2Unpack and l1tStage2OnlineDQM, to be run. Looking in DQM/L1TMonitor/L1TStage2_cff.py, we can see that l1tStage2Unpack and l1tStage2OnlineDQM consist of python processes corresponding to the different DQM modules. The EMTF unpacker is added by the line "from L1TRawToDigi.emtfStage2Digis_cfi import *" and the "emtfStage2Digis" process in l1tStage2Unpack. The EMTF DQM process is loaded with "from DQM.L1TMonitor.L1TStage2EMTF_cfi import *" and "l1tStage2emtf" under l1tStage2OnlineDQM. The file DQM/L1TMonitor/L1TStage2EMTF_cfi.py defines the process l1tStage2Emtf, and contains arguments used by L1TStage2EMTF.cc, such as the tag that specifies which digis are used (emtfSource), the directory the histograms are placed in (monitorDir), two variables for the emulator DQM (isData and filterBX), and a verbose flag. The very first argument, "L1TStage2EMTF", is calling the process of that name in the SealModule (src/DQM/L1TMonitor/plugins/SealModule.cc), which specifies the header file (L1TMonitor /interface/L1TStage2EMTF.h) and runs L1TStage2EMTF.cc.

Running the Emulator DQM

The emulator is offline software that replicates what the actual EMTF hardware should be doing. The emulator receives digis (either "emtfStage2Digis" or "csctfDigis", specified in DQM/L1TMonitor/python/L1TStage2Emulator_cff.py) and uses them to make the three EMTF collections. By comparing the actual data collections with the emulated collections, errors in the hardware (such as a bit stuck at 0) can be found.

The current EMTF emulator DQM has several parts. It runs the normal DQM on data, but restricts bunch crossing (BX) timing to -1, 0, or 1 because the emulator is only accurate for those timings. It then runs the normal DQM on the emulated data collections, again with the BX restriction. Then it runs a joint data-emulator comparison DQM (L1TdeStage2EMTF.cc) that matches the closest tracks in each event. Last, it runs the monitor client, DQM/L1TMonitorClient/src/L1TStage2EMTFDEClient.cc, which makes ratio plots from 1D histograms out of the 1D data and emulated plots. The first 3 processes are called in DQM/L1TMonitor/python/L1TStage2Emulator_cff.py (l1tstage2emtfdata, l1tstage2emtfemul, and l1tdestage2emtf), and the render clients are called in DQM/L1TMonitorClient/python/L1TStage2EmulatorMonitorClient_cff.py

The most up-to-date emulator DQM is on my github, nhaubrich. Check out CMSSW_8_0_10_patch2, run cmsenv and git cms-init, checkout the packages, then add me as a remote with

git remote add nhaubrich git@github.com:nhaubrich/cmssw.git

Then merge into my branch with

 git cms-merge-topic nhaubrich:emtf8010emul 

To run the emulator DQM on lxplus: Make an upload folder and add run files in DQM/Integration, and edit Integration/python/clients/l1tstage2emulator_dqm_sourceclient-live_cfg.py. Comment out the lines under "Live Online DQM in P5", uncomment the lines under "Testing in lxplus" and comment out the reference file

#process.DQMStore.referenceFileName = "/dqmdata/dqm/reference/l1temu_reference.root"

. Also comment out hltFatEventFilter and selfFatEventFilter under l1tEmulatorMonitorPath. In DQM/L1TMonitor/python/L1TStage2Emulator_cff.py, comment out all non-EMTF processes under l1tStage2Unpack (i.e. the unpackers), Stage2L1HardwareValidation (the actual emulators), and l1tStage2EmulatorOnlineDQM (the emulator DQM modules). There should be 3 EMTF DQM processes, l1tStage2EmtfData + l1tStage2EmtfEmul + l1tdeStage2Emtf, which correspond to the normal data DQM with BX restriction, the normal DQM on emulated collections, and the data/emulator matching process.

Run everything with

cmsRun python/clients/l1tstage2emulator_dqm_sourceclient-live_cfg.py

Useful Twikis

https://twiki.cern.ch/twiki/bin/view/CMS/EMTFDQMShifter Contains descriptions of the EMTF plots

https://twiki.cern.ch/twiki/bin/view/CMS/L1TriggerDQMDev Instructions for developing DQM modules

CSCTF Non-physical Events Study

https://twiki.cern.ch/twiki/bin/view/Main/IspyCSCTFDisplay

How to Use ISpy

https://twiki.cern.ch/twiki/bin/view/Main/IspyCreateIg

How to Get Data

Topic attachments
I AttachmentSorted descending History Action Size Date Who Comment
PNGpng Screen_Shot_2017-12-04_at_2.40.27_PM.png r1 manage 229.2 K 2017-12-13 - 18:40 ChadFreer  
PNGpng Screen_Shot_2017-12-04_at_10.31.00_AM.png r1 manage 361.8 K 2017-12-13 - 18:40 ChadFreer  
PNGpng Screen_Shot_2017-12-04_at_10.29.18_AM.png r1 manage 779.8 K 2017-12-13 - 18:40 ChadFreer  
PNGpng Screen_Shot_2017-11-08_at_5.23.06_PM.png r1 manage 1079.0 K 2017-12-13 - 18:40 ChadFreer  
PNGpng Screen_Shot_2015-09-22_at_9.58.42_AM.png r1 manage 227.8 K 2015-09-22 - 09:59 RenJieWang  
PNGpng Screen_Shot_2015-09-22_at_9.55.25_AM.png r1 manage 473.0 K 2015-09-22 - 09:56 RenJieWang  
PNGpng Screen_Shot_2015-09-22_at_10.01.35_AM.png r1 manage 406.7 K 2015-09-22 - 10:01 RenJieWang  
PNGpng RPCSector.png r1 manage 278.6 K 2017-12-14 - 16:03 ChadFreer  
PNGpng RPCLayout.png r1 manage 413.1 K 2017-12-14 - 16:03 ChadFreer  
PNGpng MuonSystem.png r1 manage 779.8 K 2017-12-14 - 15:50 ChadFreer  
PDFpdf IN2007_024.pdf r1 manage 897.1 K 2016-03-18 - 14:14 NicholasJosephHaubrich More Recent CSC Numbering Conventions
PDFpdf in2007_024.pdf r1 manage 525.1 K 2015-06-30 - 18:16 RenJieWang  
PDFpdf diving_into_ROOT.pdf r1 manage 1588.3 K 2015-06-30 - 17:55 RenJieWang  
PNGpng CSCSector.png r1 manage 361.8 K 2017-12-14 - 15:50 ChadFreer  
PNGpng CSCLayout.png r1 manage 1079.0 K 2017-12-14 - 15:50 ChadFreer  
PNGpng CSC.png r1 manage 737.8 K 2015-06-30 - 18:12 RenJieWang  
Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r14 - 2019-11-25 - ChadFreer
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 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