Level-1 CSC Trigger Primitives emulator TWiki
Complete:
Goal of this page
This page describes the CSC Trigger Primitives emulator in CMSSW. The code resides in directories
-
L1Trigger/CSCTriggerPrimitives
-
L1TriggerConfig/L1CSCTPConfigProducers
-
CondFormats/CSCObjects
-
DataFormats/CSCDigi
.
Description
The CSC local trigger uses the six-layer redundancy of the CSCs to measure precisely the phi coordinate and to find the correct bunch crossing for a track. Muon segments, also known as Local Charged Tracks (LCT), are found separately in the nearly orthogonal cathode and anode projections by somewhat different algorithms and by different electronics boards; the cathode electronics design is optimized to measure the phi value and the direction with high precision, while the anode electronics design is optimized to determine the muon bunch crossing and the eta value. Up to two cathode and two anode LCTs (referred to as ALCTs and CLCTs) can be found in each chamber during any bunch crossing. The two projections are then combined into three-dimensional LCTs (also referred to as "correlated" LCT) by a timing coincidence in the Trigger Mother Board (TMB). The Muon Port Card (MPC) receives the LCTs from all of the TMB cards in one 60-degree azimuthal sector of one endcap muon station (30-degree subsector in station 1) and relays them over optical fiber links to the Endcap Muon Track Finder and Overlap Muon Track Finder.
The CSC Trigger Primitives emulator simulates the functionalities of the anode and cathode LCT processors, of the TMB, and of the MPC.
Note that throughout the simulation, the central LCT BX is set to be 8 as in data.
Interface
- Emulator input are collections of the CSC wire and comparator digis (
CSCWireDigi
and CSCComparatorDigi
classes in DataFormats/CSCDigi
).
- Emulator produces four collections of CSC Trigger Primitives containing ALCTs, CLCTs, and correlated LCTs before and after the MPC sorting/selection (
CSCALCTDigi
, CSCCLCTDigi
, and CSCCorrelatedLCTDigi
classes in DataFormats/CSCDigi
).
The
CSCTriggerPrimitives
package has no public interface. The content of the objects produced and public methods to retrieve their members are defined in
DataFormats/CSCDigi/interface
.
Configuration
The list of configuration parameters was overhauled in summer 2008 as the result of an attempt to make names of online and offline parameters agree with each other and the documentation: many parameters were renamed; some parameters were added; some removed.
The following set of parameters is used starting with CMSSW_2_1_10:
Note (Slava Valuev): At Run 1, the CSC TP config. parameters were stored in the DB together with their interval of validity and were accessed by the emulator the way Tim described. The default values of the parameters stored in the python configuration file were thus overwritten at the beginning of each run and had not been used since the CSC conditions data objects were introduced (< 2010, perhaps << 2010). "Default value" in [2] means the default value of the config. parameter as described in the firmware specification docu of that time. "Current value" means the value of the config. parameter at the time of the last update of [2] (Run 1). ("Current values" correspond to the values in the DB with IOV of that time.)
Note (Sven Dildick): On top of Slava's note. "Current value" corresponds to what is in the L1 CSC trigger conditions DB starting
run 121196
! A dump of the entry in a text file (provided by Apichart Hortiangtham) can be found
here. "Default value" is much older.
Name |
PSet |
Type |
Current value |
Default value |
Range |
Description |
alctFifoTbins |
alctParam |
int |
16 |
7 |
[0-31] |
Total number of time bins in DAQ readout. |
alctFifoPretrig |
alctParam |
int |
10 |
7 |
[0-31] |
Anode raw hits in DAQ readout start fifo_pretrig-6 clocks before L1Accept. |
alctDriftDelay |
alctParam |
int |
2 |
3 |
[0-3] |
Drift delay after pretrigger, in 25 ns bins. |
alctNplanesHitPretrig |
alctParam |
int |
3 |
2 |
[0-7] |
Min. number of layers hit required for ALCT pre-trigger ("collision" pattern). |
alctNplanesHitPattern |
alctParam |
int |
4 |
4 |
[0-7] |
Min. number of layers hit after drift delay required for ALCT trigger ("collision" pattern). |
alctNplanesHitAccelPretrig |
alctParam |
int |
3 |
0 (=alctNplanesHitPretrig) |
[0-7] |
Min. number of layers hit required for ALCT pre-trigger ("accelerator" pattern). |
alctNplanesHitAccelPattern |
alctParam |
int |
4 |
0 (=alctNplanesHitPattern) |
[0-7] |
Min. number of layers hit after drift delay required for ALCT trigger ("accelerator" pattern). |
alctTrigMode |
alctParam |
int |
2 |
0 |
[0-3] |
Trigger mode; enables/disables either collision or accelerator tracks. |
alctAccelMode |
alctParam |
int |
0 |
0 |
[0-3] |
Accelerator-muon mode; gives preference either to collision or accelerator patterns. |
alctL1aWindowWidth |
alctParam |
int |
7 |
3 |
[0-15] |
L1Accept window width, in 25 ns bins. |
clctFifoTbins |
clctParam |
int |
12 |
7 |
[0-31] |
Total number of time bins in DAQ readout. |
clctFifoPretrig |
clctParam |
int |
7 |
2 |
[0-31] |
Start time of cathode raw hits in DAQ readout (not used yet). |
clctHitPersist |
clctParam |
int |
4 |
6 |
[0-15] |
Duration of the signal pulse, in 25 ns bins. |
clctDriftDelay |
clctParam |
int |
2 |
2 |
[0-3] |
Drift delay after pretrigger, in 25 ns bins. |
clctNplanesHitPretrig |
clctParam |
int |
3 |
4 |
[0-7] |
Min. number of layers hit required for CLCT pre-trigger. |
clctNplanesHitPattern |
clctParam |
int |
4 |
4 |
[0-7] |
Min. number of layers hit required for CLCT trigger. |
clctPidThreshPretrig |
clctParam |
int |
2 |
0 |
[0-15] |
Lower threshold on CLCT pattern id (TMB07 firmware only). |
clctMinSeparation |
clctParam |
int |
10 |
10 |
[0-256] |
Number of halfstrips to both sides from the best keystrip on which other CLCTs are vetoed (TMB07 firmware only). |
mpcBlockMe1a |
tmbParam |
int |
0 |
1 |
[0-1] |
Block/not block triggers which come from ME1/A (starting with CMSSW_3_1_0). |
alctTrigEnable |
tmbParam |
int |
0 |
0 |
[0-1] |
Allow or not ALCT-only triggers (starting with CMSSW_3_1_0). |
clctTrigEnable |
tmbParam |
int |
0 |
1 |
[0-1] |
Allow or not CLCT-only triggers (starting with CMSSW_3_1_0). |
matchTrigEnable |
tmbParam |
int |
1 |
1 |
[0-1] |
Allow or not matched ALCT-CLCT triggers (starting with CMSSW_3_1_0). |
matchTrigWindowSize |
tmbParam |
int |
7 |
3 |
[0-15] |
ALCT-CLCT match window size, in 25 ns bins (starting with CMSSW_3_1_0). |
tmbL1aWindowSize |
tmbParam |
int |
7 |
3 |
[0-15] |
L1Accept window width, in 25 ns bins (starting with CMSSW_3_1_0). |
To see the set of parameters used prior to CMSSW_2_1_10, click
here
hide
Name |
PSet |
Type |
Default value [range] |
Description |
alctFifoTbins |
alctParam |
int |
16 [0-31] |
Total number of time bins in DAQ readout. |
alctFifoPretrig |
alctParam |
int |
10 [0-31] |
Anode raw hits in DAQ readout start fifo_pretrig-6 clocks before L1Accept. |
alctBxWidth |
alctParam |
int |
6 [0-31] |
Duration of the signal pulse, in 25 ns bins. |
alctDriftDelay |
alctParam |
int |
3 [0-3] |
Drift delay after pretrigger, in 25 ns bins. |
alctNphThresh |
alctParam |
int |
2 [0-7] |
Min. number of layers hit required for ALCT pre-trigger. |
alctNphPattern |
alctParam |
int |
4 [0-7] |
Min. number of layers hit after drift delay required for ALCT trigger. |
alctTrigMode |
alctParam |
int |
3 [0-3] |
Trigger mode; enables/disables either collision or accelerator tracks. |
alctMode |
alctParam |
int |
1 [0-3] |
Accelerator muon mode; gives preference either to collision or accelerator patterns. |
alctL1aWindow |
alctParam |
int |
5 [0-15] |
L1Accept window, in 25 ns bins. |
clctFifoTbins |
clctParam |
int |
12 [0-31] |
Total number of time bins in DAQ readout (MTCC mode only). |
clctBxWidth |
clctParam |
int |
6 [0-15] |
Duration of the signal pulse, in 25 ns bins. |
clctDriftDelay |
clctParam |
int |
2 [0-3] |
Drift delay after pretrigger, in 25 ns bins. |
clctHsThresh |
clctParam |
int |
2 [0-7] |
Min. number of layers hit required for CLCT half-strip pre-trigger. |
clctDsThresh |
clctParam |
int |
2 [0-7] |
Min. number of layers hit required for CLCT di-strip pre-trigger. |
clctNphPattern |
clctParam |
int |
4 [0-7] |
Min. number of layers hit required for CLCT trigger. |
clctHitThresh |
clctParam |
int |
2 [0-7] |
Min. number of layers hit required for CLCT pre-trigger (TMB07 firmware only). |
clctPidThresh |
clctParam |
int |
2 [0-15] |
Lower threshold on CLCT pattern id (TMB07 firmware only). |
clctSepSrc |
clctParam |
int |
1 [0-1] |
Mode defining how the list of busy key strips is constructed (TMB07 firmware only). |
clctSepVme |
clctParam |
int |
10 [0-160] |
Region of busy halfstrips (TMB07 firmware only). |
Starting with CMSSW_3_1_0, the values of configuration parameters (and their intervals of validity) are stored in Offline Conditions Database (ORCOFF) and collected automatically via EventSetup mechanism from
Global Tags. The tag name is "CSCL1TPParameters". One exception is six parameters in the "tmbParam" PSet: they are not yet available in Global Tags and defined in
L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py
. Information on the implementation of configuration parameters in CMSSW versions prior to 3_1_0
can be found here
-- click here to hide
Prior to CMSSW_1_7_0, default values of the parameters were defined in the l1CscTpgEmulDigis.cfi
file residing in the data
directory of the L1Trigger/CSCTriggerPrimitives
package. Starting with CMSSW_1_7_0, the values of configuration parameters are retrieved from CSCL1TPParametersRcd:CSCL1TPParameters record via EventSetup mechanism. In CMSSW versions from 1_7_0 to 3_0_X, the parameters were provided by the "fake" producer in L1TriggerConfig/L1CSCTPConfigProducers
: to make use of it, one had to add
process.load("L1TriggerConfig.L1CSCTPConfigProducers.L1CSCTriggerPrimitivesConfig_cff")
to the cfg file.
Default settings could be overwritten in two different ways: 1) by replacing the whole set of values by another pre-defined set using switches in the table below, or 2) by replacing parameters one-by-one by hand. Two switches between the pre-defined sets of values of configuration parameters were available:
Name |
Type |
Default value |
Description |
isMTCC |
bool |
false |
If true, switch to the set of parameters used during MTCC-II. |
isTMB07 |
bool |
true |
If true, switch to the set of parameters used starting from the 2007 minus-endcap slice tests with the TMB07 firmware (first implemented in CMSSW_1_8_X; default since CMSSW_2_0_0). |
For example, one could switch to the MTCC-II set by adding process.l1csctpconf.isMTCC = true
to the cfg file.
Changes in the values of configuration parameters introduced since the beginning of 2009 are summarized in this table:
Two switches governing the emulator logic are defined in
L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py
:
Name |
PSet |
Type |
Default value |
Description |
isMTCC |
commonParam |
bool |
false |
If true, emulate the firmware which had been used during MTCC in 2006. |
isTMB07 |
commonParam |
bool |
true |
If true, emulate the firmware being used (with small updates) since the 2007 minus-endcap slice tests (notably 2007 version of CLCT/TMB firmware). First implemented in CMSSW_1_8_X. |
If both flags are set to "false", the emulator describes the idealized version of the trigger logic, which had been used in Monte Carlo studies since early ORCA days and until CMSSW_2_0_0 (March 2008) but was never realized in the firmware. Starting with CMSSW_3_1_0, it may no longer give the same results as before since corresponding (i.e., old) versions of overloaded < > == operators in
ALCTDigi
and
CLCTDigi
classes in
DataFormats/CSCDigi
were removed.
Since CMSSW_2_0_0, the default has been set to emulate the latest (2007) version of the firmware.
Finally, three parameters defining verbosity of log messages in various parts of algorithms are defined in the same
L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py
:
Name |
PSet |
Type |
Default value |
Description |
verbosity |
alctParam |
int |
0 [0-3] |
ALCT verbosity level. |
verbosity |
clctParam |
int |
0 [0-3] |
CLCT verbosity level. |
verbosity |
tmbParam |
int |
0 [0-3] |
TMB verbosity level. |
The larger the value, the more detailed print-out is produced. By default, only critical errors are reported (requirement for online usage).
Emulation of 2007 version of TMB firmware
Emulation of the new (2007) version of the CLCT/TMB firmware became the default in CMSSW_2_0_0, but was available for tests starting with CMSSW_1_7_0. Step-by-step instructions on how to enable the emulation of this firmware in CMSSW versions 1_7_X-1_9_X can be
obtained by clicking here
hidden by clicking here
Step-by-step instructions:
- Add
<flags CXXFLAGS=-DTB>
to DataFormats/CSCDigi/Buildfile
; (re-)compile CSCDigi library.
- Set
isTMB07
to true
in the constructor of L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc
(line # 253); (re-)compile CSCTriggerPrimitives library. (Starting with CMSSW_1_8_0, isTMB07
is a config. parameter, so add replace l1CscTpgEmulDigis.commonParam.isTMB07 = true
to your .cfg file instead.)
- Add
replace l1csctpconf.isTMB07 = true
and replace l1CscTpgEmulDigis.commonParam.isMTCC = true
to your .cfg file.
The resulting configuration also reproduces the ALCT firmware logic and ALCT configuration parameters used in the minus-endcap slice-test data in 2007.
In addition to items 1-3 above, the following steps need to be done in order to use the code and cfg files in the L1Trigger/CSCTriggerPrimitives/test
directory:
- Set
CSCAnodeLCTAnalyzer::isMTCCMask
to true
in test/CSCAnodeLCTAnalyzer.cc
(line # 29).
- Set
CSCCathodeLCTAnalyzer::isTMB07
to true
in test/CSCCathodeLCTAnalyzer.cc
(line # 29).
- Set
isTMB07
to true
in the constructor of test/CSCTriggerPrimitivesReader.cc
(line # 96).
.
More details about the TMB firmware and its emulation can be found in
a dedicated talk at the CERN Endcap muon meeting in September 2007, and in
the full TMB specification document.
Local Runs for CMSSW version >=3_5_X
The package CSCCommissioning was removed from the production starting with 3_5_X.
- For local runs one has to do:
- cd CMSSW_3_X_6/src/
- cvs checkout -P IORawData/CSCCommissioning
- cd IORawData/CSCCommissioning
- scramv1 b -r
Short release notes
- CMSSW_1_7_0:
- Add emulation of the 2007 version of the CLCT/TMB firmware (optional).
- Start retrieving configuration parameters via EventSetup mechanism, using "fake" producer.
- CMSSW_1_8_0:
- Introduce "isTMB07" parameter in the "fake" producer of parameters and in the emulator itself.
- CMSSW_2_0_0:
- Make emulation of the latest firmware the default for Monte Carlo studies.
- CMSSW_2_1_10:
- Substantial overhaul of configuration parameters in order to make names of online and offline parameters agree with each other and the documentation.
- CMSSW_2_2_7:
- Make emulator work in digi->raw->digi->emulator configuration (in addition to default digi->emulator): important bug fixes in digi->raw part of the CSC unpacker.
- CMSSW_3_1_0:
- Get configuration parameters from ORCOFF and Global Tags.
- Update the code to account for firmware changes related to ME1/A: LCTs generated (pseudo-strips 64-79) and can be reported to the Track Finder if
mpcBlockMe1a=0
.
- Introduce TMB parameters defining ALCT-CLCT matching criteria; disable CLCT-only triggers.
- Improve emulation of timing sequences of ALCT-CLCT match.
- Extend the search for CLCTs and correlated LCTs to bx's after the first successful find.
- Do not emulate triggers in chambers marked as bad in the CSC conditions data.
- CMSSW_3_5_0:
- Fix compiler warnings for gcc43.
- CMSSW_3_6_0_pre3:
- LCTs in ME1/A unblocked by default.
- Remove unnecessary dependencies in BuildFile's.
- Add missing input protection.
- Adjust number of read-out time bins to improve agreement with the firmware.
- Small improvements in validation code.
Tests and examples
The
test
directory of the package contains three configuration files which can be used for tests:
-
CSCTriggerPrimitivesProducerTest_cfg.py
runs an EDProducer
, which produces four LCT collections, as well as detailed dump of various steps of algorithms involved and of collections produced.
-
CSCTriggerPrimitivesReader_cfg.py
runs an EDAnalyzer
, which reads LCTs from the Event collection, dumps their content, makes plots of various LCT quantities, and saves the plots into postscript files.
-
CSCTPEmulator_cfg.py
unpacks CSC digis from global- or local-DAQ real-data file, runs Trigger Primitives emulator, and compares LCTs in the data with LCTs found by the emulator. Used for MTCC, minus-Z endcap slice-test, and CRAFT studies.
Useful links
See the code in the
CMSSW repository
at CERN.
Review Status
Responsible:
SlavaValuev
Last reviewed by: MostRecentReviewer and date