CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SectorProcessor Class Reference

#include <SectorProcessor.h>

Public Types

typedef unsigned long long EventNumber_t
 
typedef PatternRecognition::pattern_ref_t pattern_ref_t
 

Public Member Functions

void configure (const GeometryTranslator *tp_geom, const ConditionHelper *cond, const SectorProcessorLUT *lut, PtAssignmentEngine *pt_assign_engine, int verbose, int endcap, int sector, int minBX, int maxBX, int bxWindow, int bxShiftCSC, int bxShiftRPC, int bxShiftGEM, std::string era, const std::vector< int > &zoneBoundaries, int zoneOverlap, bool includeNeighbor, bool duplicateTheta, bool fixZonePhi, bool useNewZones, bool fixME11Edges, const std::vector< std::string > &pattDefinitions, const std::vector< std::string > &symPattDefinitions, bool useSymPatterns, int thetaWindow, int thetaWindowZone0, bool useRPC, bool useSingleHits, bool bugSt2PhDiff, bool bugME11Dupes, bool bugAmbigThetaWin, bool twoStationSameBX, int maxRoadsPerZone, int maxTracks, bool useSecondEarliest, bool bugSameSectorPt0, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt, bool bugGMTPhi, bool promoteMode7, int modeQualVer)
 
void configure_by_fw_version (unsigned fw_version)
 
void process (EventNumber_t ievent, const TriggerPrimitiveCollection &muon_primitives, EMTFHitCollection &out_hits, EMTFTrackCollection &out_tracks) const
 
void process_single_bx (int bx, const TriggerPrimitiveCollection &muon_primitives, EMTFHitCollection &out_hits, EMTFTrackCollection &out_tracks, std::deque< EMTFHitCollection > &extended_conv_hits, std::deque< EMTFTrackCollection > &extended_best_track_cands, std::map< pattern_ref_t, int > &patt_lifetime_map) const
 
 SectorProcessor ()
 
 ~SectorProcessor ()
 

Private Attributes

bool bug9BitDPhi_
 
bool bugAmbigThetaWin_
 
bool bugGMTPhi_
 
bool bugME11Dupes_
 
bool bugMode7CLCT_
 
bool bugNegPt_
 
bool bugSameSectorPt0_
 
bool bugSt2PhDiff_
 
int bxShiftCSC_
 
int bxShiftGEM_
 
int bxShiftRPC_
 
int bxWindow_
 
const ConditionHelpercond_
 
bool duplicateTheta_
 
int endcap_
 
std::string era_
 
bool fixME11Edges_
 
bool fixMode15HighPt_
 
bool fixZonePhi_
 
bool includeNeighbor_
 
const SectorProcessorLUTlut_
 
int maxBX_
 
int maxRoadsPerZone_
 
int maxTracks_
 
int minBX_
 
int modeQualVer_
 
std::vector< std::string > pattDefinitions_
 
bool promoteMode7_
 
PtAssignmentEnginept_assign_engine_
 
bool readPtLUTFile_
 
int sector_
 
std::vector< std::string > symPattDefinitions_
 
int thetaWindow_
 
int thetaWindowZone0_
 
const GeometryTranslatortp_geom_
 
bool twoStationSameBX_
 
bool useNewZones_
 
bool useRPC_
 
bool useSecondEarliest_
 
bool useSingleHits_
 
bool useSymPatterns_
 
int verbose_
 
std::vector< int > zoneBoundaries_
 
int zoneOverlap_
 

Detailed Description

Definition at line 29 of file SectorProcessor.h.

Member Typedef Documentation

typedef unsigned long long SectorProcessor::EventNumber_t

Definition at line 34 of file SectorProcessor.h.

Definition at line 35 of file SectorProcessor.h.

Constructor & Destructor Documentation

SectorProcessor::SectorProcessor ( )
explicit

Definition at line 4 of file SectorProcessor.cc.

4  {
5 
6 }
SectorProcessor::~SectorProcessor ( )

Definition at line 8 of file SectorProcessor.cc.

8  {
9 
10 }

Member Function Documentation

void SectorProcessor::configure ( const GeometryTranslator tp_geom,
const ConditionHelper cond,
const SectorProcessorLUT lut,
PtAssignmentEngine pt_assign_engine,
int  verbose,
int  endcap,
int  sector,
int  minBX,
int  maxBX,
int  bxWindow,
int  bxShiftCSC,
int  bxShiftRPC,
int  bxShiftGEM,
std::string  era,
const std::vector< int > &  zoneBoundaries,
int  zoneOverlap,
bool  includeNeighbor,
bool  duplicateTheta,
bool  fixZonePhi,
bool  useNewZones,
bool  fixME11Edges,
const std::vector< std::string > &  pattDefinitions,
const std::vector< std::string > &  symPattDefinitions,
bool  useSymPatterns,
int  thetaWindow,
int  thetaWindowZone0,
bool  useRPC,
bool  useSingleHits,
bool  bugSt2PhDiff,
bool  bugME11Dupes,
bool  bugAmbigThetaWin,
bool  twoStationSameBX,
int  maxRoadsPerZone,
int  maxTracks,
bool  useSecondEarliest,
bool  bugSameSectorPt0,
bool  readPtLUTFile,
bool  fixMode15HighPt,
bool  bug9BitDPhi,
bool  bugMode7CLCT,
bool  bugNegPt,
bool  bugGMTPhi,
bool  promoteMode7,
int  modeQualVer 
)

Definition at line 12 of file SectorProcessor.cc.

References bug9BitDPhi_, bugAmbigThetaWin_, bugGMTPhi_, bugME11Dupes_, bugMode7CLCT_, bugNegPt_, bugSameSectorPt0_, bugSt2PhDiff_, bxShiftCSC_, bxShiftGEM_, bxShiftRPC_, bxWindow_, cond_, duplicateTheta_, makeMuonMisalignmentScenario::endcap, endcap_, era_, fixME11Edges_, fixMode15HighPt_, fixZonePhi_, includeNeighbor_, lumiPlot::lut, lut_, emtf::MAX_ENDCAP, emtf::MAX_TRIGSECTOR, simTrackMatching_cfi::maxBX, maxBX_, maxRoadsPerZone_, RecoTauCombinatoricProducer_cfi::maxTracks, maxTracks_, emtf::MIN_ENDCAP, emtf::MIN_TRIGSECTOR, simTrackMatching_cfi::minBX, minBX_, modeQualVer_, pattDefinitions_, promoteMode7_, pt_assign_engine_, readPtLUTFile_, sector_, symPattDefinitions_, thetaWindow_, thetaWindowZone0_, tp_geom_, twoStationSameBX_, useNewZones_, useRPC_, useSecondEarliest_, useSingleHits_, useSymPatterns_, verbose, verbose_, zoneBoundaries_, and zoneOverlap_.

26  {
28  { edm::LogError("L1T") << "emtf::MIN_ENDCAP = " << emtf::MIN_ENDCAP
29  << ", emtf::MAX_ENDCAP = " << emtf::MAX_ENDCAP
30  << ", endcap = " << endcap; return; }
31  if (not(emtf::MIN_TRIGSECTOR <= sector && sector <= emtf::MAX_TRIGSECTOR))
32  { edm::LogError("L1T") << "emtf::MIN_TRIGSECTOR = " << emtf::MIN_TRIGSECTOR
33  << ", emtf::MAX_TRIGSECTOR = " << emtf::MAX_TRIGSECTOR
34  << ", endcap = " << sector; return; }
35  if (not(tp_geom != nullptr))
36  { edm::LogError("L1T") << "tp_geom = nullptr"; return; }
37  if (not(cond != nullptr))
38  { edm::LogError("L1T") << "cond = nullptr"; return; }
39  if (not(lut != nullptr))
40  { edm::LogError("L1T") << "lut = nullptr"; return; }
41  if (not(pt_assign_engine != nullptr))
42  { edm::LogError("L1T") << "pt_assign_engine = nullptr"; return; }
43 
44  tp_geom_ = tp_geom;
45  cond_ = cond;
46  lut_ = lut;
47  pt_assign_engine_ = pt_assign_engine;
48 
49  verbose_ = verbose;
50  endcap_ = endcap;
51  sector_ = sector;
52 
53  minBX_ = minBX;
54  maxBX_ = maxBX;
55  bxWindow_ = bxWindow;
56  bxShiftCSC_ = bxShiftCSC;
57  bxShiftRPC_ = bxShiftRPC;
58  bxShiftGEM_ = bxShiftGEM;
59 
60  era_ = era;
61 
62  zoneBoundaries_ = zoneBoundaries;
63  zoneOverlap_ = zoneOverlap;
64  includeNeighbor_ = includeNeighbor;
65  duplicateTheta_ = duplicateTheta;
66  fixZonePhi_ = fixZonePhi;
67  useNewZones_ = useNewZones;
68  fixME11Edges_ = fixME11Edges;
69 
70  pattDefinitions_ = pattDefinitions;
71  symPattDefinitions_ = symPattDefinitions;
72  useSymPatterns_ = useSymPatterns;
73 
74  thetaWindow_ = thetaWindow;
75  thetaWindowZone0_ = thetaWindowZone0;
76  useRPC_ = useRPC;
77  useSingleHits_ = useSingleHits;
78  bugSt2PhDiff_ = bugSt2PhDiff;
79  bugME11Dupes_ = bugME11Dupes;
80  bugAmbigThetaWin_ = bugAmbigThetaWin;
81  twoStationSameBX_ = twoStationSameBX;
82 
83  maxRoadsPerZone_ = maxRoadsPerZone;
85  useSecondEarliest_ = useSecondEarliest;
86  bugSameSectorPt0_ = bugSameSectorPt0;
87 
88  readPtLUTFile_ = readPtLUTFile;
89  fixMode15HighPt_ = fixMode15HighPt;
90  bug9BitDPhi_ = bug9BitDPhi;
91  bugMode7CLCT_ = bugMode7CLCT;
92  bugNegPt_ = bugNegPt;
93  bugGMTPhi_ = bugGMTPhi;
94  promoteMode7_ = promoteMode7;
95  modeQualVer_ = modeQualVer;
96 }
std::vector< std::string > pattDefinitions_
int MAX_TRIGSECTOR
Definition: Common.h:61
std::vector< int > zoneBoundaries_
const ConditionHelper * cond_
bool verbose
int MIN_ENDCAP
Definition: Common.h:56
std::string era_
std::vector< std::string > symPattDefinitions_
const GeometryTranslator * tp_geom_
int MIN_TRIGSECTOR
Definition: Common.h:60
const SectorProcessorLUT * lut_
PtAssignmentEngine * pt_assign_engine_
int MAX_ENDCAP
Definition: Common.h:57
void SectorProcessor::configure_by_fw_version ( unsigned  fw_version)

Settings for 2018 (by default just use settings in simEmtfDigis_cfi.py) ///

Settings for 2017 (by default just use settings in simEmtfDigis_cfi.py) ///

Settings for all of 2016 (following order in simEmtfDigis_cfi.py) ///

Definition at line 99 of file SectorProcessor.cc.

References bug9BitDPhi_, bugAmbigThetaWin_, bugGMTPhi_, bugME11Dupes_, bugMode7CLCT_, bugNegPt_, bugSameSectorPt0_, bugSt2PhDiff_, bxWindow_, gather_cfg::cout, era_, fixME11Edges_, fixMode15HighPt_, fixZonePhi_, maxBX_, modeQualVer_, promoteMode7_, thetaWindow_, thetaWindowZone0_, twoStationSameBX_, useRPC_, useSecondEarliest_, useSymPatterns_, and verbose_.

99  {
100  if (verbose_ > 0) {
101  std::cout << "Configure SectorProcessor with fw_version: " << fw_version << std::endl;
102  }
103 
104  if (fw_version == 0 || fw_version == 123456) // fw_version '123456' is from the fake conditions
105  return;
106 
107  // For now, no switches later than FW version 47864 (end-of-year 2016)
108  // Beggining in late 2016, "fw_version" in O2O populated with timestamp, rather than FW version
109  // tm fw_time = gmtime(fw_version); (See https://linux.die.net/man/3/gmtime, https://www.epochconverter.com)
110 
114  if (fw_version >= 1514764800) { // January 1, 2018
115 
116  // Settings for all of 2018 (following order in simEmtfDigis_cfi.py)
117  // BXWindow(2) and BugAmbigThetaWin(F) deployed sometime before stable beams on March 20, not quite sure when - AWB 26.04.18
118  // TwoStationSameBX(T), ThetaWindowZone0(4), and ModeQualVer(2) to be deployed sometime between May 17 and May 31 - AWB 14.05.18
119 
120  // Global parameters
121  // Defaults : CSCEnable(T), RPCEnable(T), GEMEnable(F), Era("Run2_2018"), MinBX(-3), MaxBX(+3), BXWindow(2)
122  // --------------------------------------------------------------------------------------------------------
123 
124  // spTBParams16 : Sector processor track-building parameters
125  // Defaults : PrimConvLUT(1), ZoneBoundaries(0,41,49,87,127), ZoneOverlap(2), IncludeNeighbor(T),
126  // DuplicateThteta(T), FixZonePhi(T), UseNewZones(F), FixME11Edges(T)
127  // ------------------------------------------------------------------------------
128 
129  // spPRParams16 : Sector processor pattern-recognition parameters
130  // Defaults : PatternDefinitions(...), SymPatternDefinitions(...), UseSymmetricalPatterns(T)
131  // -----------------------------------------------------------------------------------------
132 
133  // spTBParams16 : Sector processor track-building parameters
134  // Defaults : ThetaWindow(8), ThetaWindowZone0(4), UseSingleHits(F), BugSt2PhDiff(F),
135  // BugME11Dupes(F), BugAmbigThetaWin(F), TwoStationSameBX(T)
136  // ----------------------------------------------------------------------------------
137 
138  // spGCParams16 : Sector processor ghost-cancellation parameters
139  // Defaults : MaxRoadsPerZone(3), MaxTracks(3), UseSecondEarliest(T), BugSameSectorPt0(F)
140  // --------------------------------------------------------------------------------------
141 
142  // spPAParams16 : Sector processor pt-assignment parameters
143  // Defaults : ReadPtLUTFile(F), FixMode15HighPt(T), Bug9BitDPhi(F), BugMode7CLCT(F),
144  // BugNegPt(F), BugGMTPhi(F), PromoteMode7(F), ModeQualVer(2)
145  // ---------------------------------------------------------------------------------
146 
147 
148  // ___________________________________________________________________________
149  // Versions in 2018 - no documentation
150  // As of the beginning of 2018 EMTF O2O is broken, not updating the database with online conditions
151  // Firmware version reported for runs as late as April 30 is 1504018578 (Aug. 29, 2017) even though
152  // updates occured in February and March of 2018. Hopefully will fix soon, may need to re-write
153  // history in the database. - AWB 30.04.18
154 
155  return;
156  }
157 
161  else if (fw_version >= 50000) {
162 
163  // Settings for all of 2017 (following order in simEmtfDigis_cfi.py)
164 
165  // Global parameters
166  // Defaults : CSCEnable(T), RPCEnable(T), GEMEnable(F), Era("Run2_2018"), MinBX(-3), MaxBX(+3), BXWindow(2)
167  // --------------------------------------------------------------------------------------------------------
168  era_ = "Run2_2017"; // Era for CMSSW customization
169  bxWindow_ = 3; // Number of BX whose primitives can be included in the same track
170 
171  // spTBParams16 : Sector processor track-building parameters
172  // Defaults : PrimConvLUT(1), ZoneBoundaries(0,41,49,87,127), ZoneOverlap(2), IncludeNeighbor(T),
173  // DuplicateThteta(T), FixZonePhi(T), UseNewZones(F), FixME11Edges(T)
174  // ------------------------------------------------------------------------------
175 
176  // spPRParams16 : Sector processor pattern-recognition parameters
177  // Defaults : PatternDefinitions(...), SymPatternDefinitions(...), UseSymmetricalPatterns(T)
178  // -----------------------------------------------------------------------------------------
179 
180  // spTBParams16 : Sector processor track-building parameters
181  // Defaults : ThetaWindow(8), ThetaWindowZone0(4), UseSingleHits(F), BugSt2PhDiff(F),
182  // BugME11Dupes(F), BugAmbigThetaWin(F), TwoStationSameBX(T)
183  // ----------------------------------------------------------------------------------
184  thetaWindow_ = 8; // Maximum dTheta between primitives in the same track
185  thetaWindowZone0_ = 8; // Maximum dTheta between primitives in the same track in Zone 0 (ring 1)
186  bugAmbigThetaWin_ = true; // Can allow dThetas outside window when there are 2 LCTs in the same chamber
187  twoStationSameBX_ = false; // Requires the hits in two-station tracks to have the same BX
188 
189  // spGCParams16 : Sector processor ghost-cancellation parameters
190  // Defaults : MaxRoadsPerZone(3), MaxTracks(3), UseSecondEarliest(T), BugSameSectorPt0(F)
191  // --------------------------------------------------------------------------------------
192 
193  // spPAParams16 : Sector processor pt-assignment parameters
194  // Defaults : ReadPtLUTFile(F), FixMode15HighPt(T), Bug9BitDPhi(F), BugMode7CLCT(F),
195  // BugNegPt(F), BugGMTPhi(F), PromoteMode7(F)
196  // ---------------------------------------------------------------------------------
197  modeQualVer_ = 1; // Version 2 contains modified mode-quality mapping for 2018
198 
199  // ___________________________________________________________________________
200  // Versions in 2017 - no full documentation, can refer to https://twiki.cern.ch/twiki/bin/viewauth/CMS/L1KnownIssues
201 
202  // Before July 9th (runs < 298653), all mode 7 tracks (station 2-3-4) assigned quality 11
203  // July 9th - 29th (runs 298653 - 300087), mode 7 tracks with |eta| > 1.6 in sector -6 assigned quality 12
204  // After July 29th (runs >= 300088), mode 7 track promotion applied in all sectors
205  // For some reason, the FW version in the database is 1496792995, at least for runs >= 298034 (July 4),
206  // which is towards the end of run 2017B (could not check earlier runs). This corresponds to the date "June 6th",
207  // which is a month earlier than the first firmware update to apply this promotion. So something's screwey.
208  // Since July 18 is in the middle of the single-sector-fix period, would like to use a firmware version with
209  // roughly that date. But this may require an intervention in the database. - AWB 04.08.17
210  // Last firmware version in 2017 was 1504018578 (Aug. 29, 2017).
211  if (fw_version >= 1496792995)
212  promoteMode7_ = true; // Assign station 2-3-4 tracks with |eta| > 1.6 SingleMu quality
213 
214  return;
215  }
216 
220  else {
221 
222  // Global parameters
223  // Defaults : CSCEnable(T), RPCEnable(T), GEMEnable(F), Era("Run2_2018"), MinBX(-3), MaxBX(+3), BXWindow(2)
224  // --------------------------------------------------------------------------------------------------------
225  useRPC_ = false; // Use clustered RPC hits from CPPF in track-building
226  era_ = "Run2_2016"; // Era for CMSSW customization
227  // maxBX_ // Depends on FW version, see below
228  bxWindow_ = 3; // Number of BX whose primitives can be included in the same track
229 
230  // spTBParams16 : Sector processor track-building parameters
231  // Defaults : PrimConvLUT(1), ZoneBoundaries(0,41,49,87,127), ZoneOverlap(2), IncludeNeighbor(T),
232  // DuplicateThteta(T), FixZonePhi(T), UseNewZones(F), FixME11Edges(T)
233  // ------------------------------------------------------------------------------
234  // primConvLUT_ // Should be 0 for 2016, set using get_pc_lut_version() from ConditionsHelper.cc
235  // fixZonePhi_ // Depends on FW version, see below
236  fixME11Edges_ = false; // Improved small fraction of buggy LCT coordinate transformations
237 
238  // spPRParams16 : Sector processor pattern-recognition parameters
239  // Defaults : PatternDefinitions(...), SymPatternDefinitions(...), UseSymmetricalPatterns(T)
240  // -----------------------------------------------------------------------------------------
241  // useSymPatterns_ // Depends on FW version, see below
242 
243  // spTBParams16 : Sector processor track-building parameters
244  // Defaults : ThetaWindow(8), ThetaWindowZone0(4), UseSingleHits(F), BugSt2PhDiff(F),
245  // BugME11Dupes(F), BugAmbigThetaWin(F), TwoStationSameBX(T)
246  // ----------------------------------------------------------------------------------
247  thetaWindow_ = 4; // Maximum dTheta between primitives in the same track
248  thetaWindowZone0_ = 4; // Maximum dTheta between primitives in the same track in Zone 0 (ring 1)
249  // bugSt2PhDiff_ // Depends on FW version, see below
250  // bugME11Dupes_ // Depends on FW version, see below
251  bugAmbigThetaWin_ = true; // Can allow dThetas outside window when there are 2 LCTs in the same chamber
252  twoStationSameBX_ = false; // Requires the hits in two-station tracks to have the same BX
253 
254  // spGCParams16 : Sector processor ghost-cancellation parameters
255  // Defaults : MaxRoadsPerZone(3), MaxTracks(3), UseSecondEarliest(T), BugSameSectorPt0(F)
256  // --------------------------------------------------------------------------------------
257  // useSecondEarliest_ // Depends on FW version, see below
258  // bugSameSectorPt0_ // Depends on FW version, see below
259 
260  // spPAParams16 : Sector processor pt-assignment parameters
261  // Defaults : ReadPtLUTFile(F), FixMode15HighPt(T), Bug9BitDPhi(F), BugMode7CLCT(F),
262  // BugNegPt(F), BugGMTPhi(F), PromoteMode7(F)
263  // ---------------------------------------------------------------------------------
264  // fixMode15HighPt_ // Depends on FW version, see below
265  // bug9BitDPhi_ // Depends on FW version, see below
266  // bugMode7CLCT_ // Depends on FW version, see below
267  // bugNegPt_ // Depends on FW version, see below
268  bugGMTPhi_ = true; // Some drift in uGMT phi conversion, off by up to a few degrees
269  modeQualVer_ = 1; // Version 2 contains modified mode-quality mapping for 2018
270 
271  } // End default settings for 2016
272 
273 
274  // ___________________________________________________________________________
275  // Versions in 2016 - refer to docs/EMTF_FW_LUT_versions_2016_draft2.xlsx
276 
277  // 1st_LCT_BX / 2nd_LCT_BX (should also make unpacker configurable - AWB 21.07.17)
278  // FW: Before: Earliest LCT used to assign BX, tracks only cancel within same BX
279  // After: Second-earliest LCT used to assign BX, tracks cancel over 3 BX, improved LCT recovery
280  useSecondEarliest_ = (fw_version < 46773) ? false : true; // Changed Sept. 5
281 
282  // 8_BX_readout / 7_BX_readout
283  // SW: DAQ readout changed from to [-3, +4] BX to [-3, +3] BX
284  maxBX_ = (fw_version < 47109) ? +4 : +3; // Changed Sept. 28
285 
286  // Asymm_patterns / Symm_patterns
287  // FW: Changed from 9 asymmetric patterns to 5 symmetric patterns for track building
288  useSymPatterns_ = (fw_version < 47214) ? false : true; // Changed Oct. 6
289 
290  // HiPt_outlier
291  // LUT: High-pT fix puts outlier LCTs in mode 15 tracks back in a straight line
292  fixMode15HighPt_ = (fw_version < 46650) ? false : true; // Changed July 25
293 
294  // Link_monitor (unpacker only)
295  // FW: Added MPC link monitoring
296 
297  // ___________________________________________________________________________
298  // Bugs
299 
300  // DAQ_ID (unpacker only; should make configurable - AWB 21.07.17)
301  // FW: DAQ ME with output CSC ID range 0 - 8 instead of 1 - 9
302  // SP output ME2_ID, 3_ID, and 4_ID filled with 4, 5, or 6 when they should have been 7, 8, or 9.
303 
304  // ME_ID_FR
305  // FW: Incorrect ME_ID fields in DAQ, wrong FR bits and some dPhi wrap-around in pT LUT address
306  // - Unpacker only, or not worth emulating
307 
308  // DAQ_miss_LCT (unpacker only)
309  // FW: LCTs only output if there was a track in the sector
310 
311  // Sector_pT_0
312  // FW: Only highest-quality track in a sector assigned pT; others assigned pT = 0
313  bugSameSectorPt0_ = (fw_version < 46650) ? true : false; // Fixed July 22
314 
315  // Sector_bad_pT
316  // FW: Tracks sometimes assigned pT of track in previous BX
317  // - This is an ongoing (very rare) bug which occurs when 2 tracks try to access the same "bank" in the pT LUT
318  // It would be very difficult to emulate exactly, but the logic from Alex Madorsky is below
319  // ## macro for detecting same bank address
320  // ## bank and chip must match, and valid flags must be set
321  // ## a and b are indexes 0,1,2
322  // ## [X:Y] are bit portions from ptlut address words
323  // `define sb(a,b) (ptlut_addr[a][29:26] == ptlut_addr[b][29:26] && ptlut_addr[a][5:2] == ptlut_addr[b][5:2] && ptlut_addr_val[a] && ptlut_addr_val[b])
324  // ## This macro is used like this:
325  // if (`sb(0,2) || `sb(1,2)) {disable PT readout for track 2}
326 
327 
328  // DAQ_BX_3_LCT (unpacker only)
329  // SW: LCTs in BX -3 only reported if there was a track in the sector
330  // - not applicable
331 
332  // DAQ_BX_23_LCT (unpacker only)
333  // SW: LCTs in BX -2 and -3 only reported if there was a track in the sector
334  // - not applicable
335 
336  // pT_dPhi_bits
337  // FW: dPhi wrap-around in modes 3, 5, 6, 9, 10, 12
338  bug9BitDPhi_ = (fw_version < 47214) ? true : false; // Fixed Oct. 6
339 
340  // Pattern_phi / ME1_neigh_phi
341  // FW: Pattern phi slightly offset from true LCT phi; also ME3/4 pattern width off
342  // Pattern phi of neighbor hits in ME1 miscalculated
343  fixZonePhi_ = (fw_version < 47214) ? false : true; // Fixed Oct. 6
344 
345  // LCT_station_2
346  // FW: Reduced LCT matching window in station 2, resulting in demoted tracks and inefficiency
347  bugSt2PhDiff_ = (47109 <= fw_version && fw_version < 47249) ? true : false; // Bug introduced Oct. 6, fixed Oct. 19
348 
349  // LCT_theta_dup
350  // FW: LCTs matched to track may take theta value from other LCT in the same chamber
351  bugME11Dupes_ = (fw_version < 47423) ? true : false; // Fixed Nov. 1
352 
353  // LCT_7_10_neg_pT (E)
354  // LUT: Written with incorrect values for mode 7 CLCT, mode 10 random offset, all modes negative (1/pT) set to 3 instead of 511
355  bugMode7CLCT_ = (fw_version < 47864) ? true : false; // Fixed sometime after Nov. 1
356  bugNegPt_ = (fw_version < 47864) ? true : false; // Fixed sometime after Nov. 1
357 
358 
359 }
std::string era_
void SectorProcessor::process ( EventNumber_t  ievent,
const TriggerPrimitiveCollection muon_primitives,
EMTFHitCollection out_hits,
EMTFTrackCollection out_tracks 
) const

Definition at line 361 of file SectorProcessor.cc.

References bxWindow_, gather_cfg::cout, endcap_, maxBX_, minBX_, gen::n, process_single_bx(), sector_, findQualityFiles::size, and verbose_.

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

366  {
367 
368  // if (endcap_ == 1 && sector_ == 1) {
369  // std::cout << "\nConfigured with era " << era_ << ", thetaWindowZone0 = " << thetaWindowZone0_ << ", bugAmbigThetaWin = "
370  // << bugAmbigThetaWin_ << ", twoStationSameBX = " << twoStationSameBX_ << ", promoteMode7_ = " << promoteMode7_ << std::endl;
371  // }
372 
373  // List of converted hits, extended from previous BXs
374  // deque (double-ended queue) is similar to a vector, but allows insertion or deletion of elements at both beginning and end
375  std::deque<EMTFHitCollection> extended_conv_hits;
376 
377  // List of best track candidates, extended from previous BXs
378  std::deque<EMTFTrackCollection> extended_best_track_cands;
379 
380  // Map of pattern detector --> lifetime, tracked across BXs
381  std::map<pattern_ref_t, int> patt_lifetime_map;
382 
383  // ___________________________________________________________________________
384  // Run each sector processor for every BX, taking into account the BX window
385 
386  int delayBX = bxWindow_ - 1;
387 
388  for (int bx = minBX_; bx <= maxBX_ + delayBX; ++bx) {
389  if (verbose_ > 0) { // debug
390  std::cout << "Endcap: " << endcap_ << " Sector: " << sector_ << " Event: " << ievent << " BX: " << bx << std::endl;
391  }
392 
394  bx,
395  muon_primitives,
396  out_hits,
397  out_tracks,
398  extended_conv_hits,
399  extended_best_track_cands,
400  patt_lifetime_map
401  );
402 
403  // Drop earliest BX outside of BX window
404  if (bx >= minBX_ + delayBX) {
405  extended_conv_hits.pop_front();
406 
407  int n = emtf::zone_array<int>().size();
408  extended_best_track_cands.erase(extended_best_track_cands.end()-n, extended_best_track_cands.end()); // pop_back
409  }
410  } // end loop over bx
411 
412  return;
413 }
size
Write out results.
void process_single_bx(int bx, const TriggerPrimitiveCollection &muon_primitives, EMTFHitCollection &out_hits, EMTFTrackCollection &out_tracks, std::deque< EMTFHitCollection > &extended_conv_hits, std::deque< EMTFTrackCollection > &extended_best_track_cands, std::map< pattern_ref_t, int > &patt_lifetime_map) const
std::array< T, NUM_ZONES > zone_array
Definition: Common.h:76
void SectorProcessor::process_single_bx ( int  bx,
const TriggerPrimitiveCollection muon_primitives,
EMTFHitCollection out_hits,
EMTFTrackCollection out_tracks,
std::deque< EMTFHitCollection > &  extended_conv_hits,
std::deque< EMTFTrackCollection > &  extended_best_track_cands,
std::map< pattern_ref_t, int > &  patt_lifetime_map 
) const

Definition at line 415 of file SectorProcessor.cc.

References bug9BitDPhi_, bugAmbigThetaWin_, bugGMTPhi_, bugME11Dupes_, bugMode7CLCT_, bugNegPt_, bugSameSectorPt0_, bugSt2PhDiff_, bxShiftCSC_, bxShiftGEM_, bxShiftRPC_, bxWindow_, BestTrackSelection::configure(), SingleHitTrack::configure(), PrimitiveSelection::configure(), AngleCalculation::configure(), PrimitiveConversion::configure(), PtAssignment::configure(), PrimitiveMatching::configure(), PatternRecognition::configure(), duplicateTheta_, endcap_, fixME11Edges_, fixMode15HighPt_, fixZonePhi_, includeNeighbor_, lut_, maxRoadsPerZone_, maxTracks_, PrimitiveSelection::merge(), PrimitiveSelection::merge_no_truncate(), modeQualVer_, pattDefinitions_, SingleHitTrack::process(), AngleCalculation::process(), BestTrackSelection::process(), PrimitiveSelection::process(), PrimitiveMatching::process(), PtAssignment::process(), PrimitiveConversion::process(), PatternRecognition::process(), promoteMode7_, pt_assign_engine_, readPtLUTFile_, sector_, symPattDefinitions_, thetaWindow_, thetaWindowZone0_, tp_geom_, twoStationSameBX_, useNewZones_, useRPC_, useSecondEarliest_, useSingleHits_, useSymPatterns_, verbose_, zoneBoundaries_, and zoneOverlap_.

Referenced by process().

423  {
424 
425  // ___________________________________________________________________________
426  // Configure
427 
428  PrimitiveSelection prim_sel;
429  prim_sel.configure(
430  verbose_, endcap_, sector_, bx,
434  );
435 
436  PrimitiveConversion prim_conv;
437  prim_conv.configure(
438  tp_geom_, lut_,
439  verbose_, endcap_, sector_, bx,
444  );
445 
446  PatternRecognition patt_recog;
447  patt_recog.configure(
448  verbose_, endcap_, sector_, bx,
449  bxWindow_,
452  );
453 
454  PrimitiveMatching prim_match;
455  prim_match.configure(
456  verbose_, endcap_, sector_, bx,
459  );
460 
461  AngleCalculation angle_calc;
462  angle_calc.configure(
463  verbose_, endcap_, sector_, bx,
464  bxWindow_,
467  );
468 
469  BestTrackSelection btrack_sel;
470  btrack_sel.configure(
471  verbose_, endcap_, sector_, bx,
472  bxWindow_,
475  );
476 
477  SingleHitTrack single_hit;
478  single_hit.configure(
479  verbose_, endcap_, sector_, bx,
480  maxTracks_,
482  );
483 
484  PtAssignment pt_assign;
485  pt_assign.configure(
487  verbose_, endcap_, sector_, bx,
491  );
492 
493  std::map<int, TriggerPrimitiveCollection> selected_csc_map;
494  std::map<int, TriggerPrimitiveCollection> selected_rpc_map;
495  std::map<int, TriggerPrimitiveCollection> selected_gem_map;
496  std::map<int, TriggerPrimitiveCollection> selected_prim_map;
497  std::map<int, TriggerPrimitiveCollection> inclusive_selected_prim_map;
498 
499  EMTFHitCollection conv_hits; // "converted" hits converted by primitive converter
500  EMTFHitCollection inclusive_conv_hits;
501 
502  emtf::zone_array<EMTFRoadCollection> zone_roads; // each zone has its road collection
503 
504  emtf::zone_array<EMTFTrackCollection> zone_tracks; // each zone has its track collection
505 
506  EMTFTrackCollection best_tracks; // "best" tracks selected from all the zones
507 
508  // ___________________________________________________________________________
509  // Process
510 
511  // Select muon primitives that belong to this sector and this BX.
512  // Put them into maps with an index that roughly corresponds to
513  // each input link.
514  // From src/PrimitiveSelection.cc
515  prim_sel.process(CSCTag(), muon_primitives, selected_csc_map);
516  if (useRPC_) {
517  prim_sel.process(RPCTag(), muon_primitives, selected_rpc_map);
518  }
519  prim_sel.process(GEMTag(), muon_primitives, selected_gem_map);
520  prim_sel.merge(selected_csc_map, selected_rpc_map, selected_gem_map, selected_prim_map);
521 
522  // Convert trigger primitives into "converted" hits
523  // A converted hit consists of integer representations of phi, theta, and zones
524  // From src/PrimitiveConversion.cc
525  prim_conv.process(selected_prim_map, conv_hits);
526  extended_conv_hits.push_back(conv_hits);
527 
528  {
529  // Keep all the converted hits for the use of data-emulator comparisons.
530  // They include the extra ones that are not used in track building and the subsequent steps.
531  prim_sel.merge_no_truncate(selected_csc_map, selected_rpc_map, selected_gem_map, inclusive_selected_prim_map);
532  prim_conv.process(inclusive_selected_prim_map, inclusive_conv_hits);
533 
534  // Clear the input maps to save memory
535  selected_csc_map.clear();
536  selected_rpc_map.clear();
537  selected_gem_map.clear();
538  }
539 
540  // Detect patterns in all zones, find 3 best roads in each zone
541  // From src/PatternRecognition.cc
542  patt_recog.process(extended_conv_hits, patt_lifetime_map, zone_roads);
543 
544  // Match the trigger primitives to the roads, create tracks
545  // From src/PrimitiveMatching.cc
546  prim_match.process(extended_conv_hits, zone_roads, zone_tracks);
547 
548  // Calculate deflection angles for each track and fill track variables
549  // From src/AngleCalculation.cc
550  angle_calc.process(zone_tracks);
551  extended_best_track_cands.insert(extended_best_track_cands.begin(), zone_tracks.begin(), zone_tracks.end()); // push_front
552 
553  // Select 3 "best" tracks from all the zones
554  // From src/BestTrackSelection.cc
555  btrack_sel.process(extended_best_track_cands, best_tracks);
556 
557  // Insert single LCTs from station 1 as tracks
558  // From src/SingleHitTracks.cc
559  single_hit.process(conv_hits, best_tracks);
560 
561  // Construct pT address, assign pT, calculate other GMT quantities
562  // From src/PtAssignment.cc
563  pt_assign.process(best_tracks);
564 
565  // ___________________________________________________________________________
566  // Output
567 
568  out_hits.insert(out_hits.end(), inclusive_conv_hits.begin(), inclusive_conv_hits.end());
569  out_tracks.insert(out_tracks.end(), best_tracks.begin(), best_tracks.end());
570 
571  return;
572 }
std::vector< std::string > pattDefinitions_
void process(const std::deque< EMTFTrackCollection > &extended_best_track_cands, EMTFTrackCollection &best_tracks) const
std::vector< int > zoneBoundaries_
void configure(const GeometryTranslator *tp_geom, const SectorProcessorLUT *lut, int verbose, int endcap, int sector, int bx, int bxShiftCSC, int bxShiftRPC, int bxShiftGEM, const std::vector< int > &zoneBoundaries, int zoneOverlap, bool duplicateTheta, bool fixZonePhi, bool useNewZones, bool fixME11Edges, bool bugME11Dupes)
void process(emtf::zone_array< EMTFTrackCollection > &zone_tracks) const
emtf::CSCTag CSCTag
Definition: Common.h:44
void process(const EMTFHitCollection &conv_hits, EMTFTrackCollection &best_tracks) const
std::vector< std::string > symPattDefinitions_
void merge_no_truncate(const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
void configure(int verbose, int endcap, int sector, int bx, int bxShiftCSC, int bxShiftRPC, int bxShiftGEM, bool includeNeighbor, bool duplicateTheta, bool bugME11Dupes)
const GeometryTranslator * tp_geom_
l1t::EMTFTrackCollection EMTFTrackCollection
Definition: Common.h:28
emtf::RPCTag RPCTag
Definition: Common.h:45
void process(const std::deque< EMTFHitCollection > &extended_conv_hits, std::map< pattern_ref_t, int > &patt_lifetime_map, emtf::zone_array< EMTFRoadCollection > &zone_roads) const
void configure(int verbose, int endcap, int sector, int bx, int bxWindow, int thetaWindow, int thetaWindowZone0, bool bugME11Dupes, bool bugAmbigThetaWin, bool twoStationSameBX)
const SectorProcessorLUT * lut_
std::array< T, NUM_ZONES > zone_array
Definition: Common.h:76
void process(T tag, const TriggerPrimitiveCollection &muon_primitives, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
l1t::EMTFHitCollection EMTFHitCollection
Definition: Common.h:24
emtf::GEMTag GEMTag
Definition: Common.h:46
void configure(PtAssignmentEngine *pt_assign_engine, int verbose, int endcap, int sector, int bx, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt, bool bugGMTPhi, bool promoteMode7, int modeQualVer)
Definition: PtAssignment.cc:6
void configure(int verbose, int endcap, int sector, int bx, int bxWindow, const std::vector< std::string > &pattDefinitions, const std::vector< std::string > &symPattDefinitions, bool useSymPatterns, int maxRoadsPerZone, bool useSecondEarliest)
PtAssignmentEngine * pt_assign_engine_
void configure(int verbose, int endcap, int sector, int bx, int bxWindow, int maxRoadsPerZone, int maxTracks, bool useSecondEarliest, bool bugSameSectorPt0)
void merge(const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
void process(const std::map< int, TriggerPrimitiveCollection > &selected_prim_map, EMTFHitCollection &conv_hits) const
void process(EMTFTrackCollection &best_tracks)
Definition: PtAssignment.cc:34
void configure(int verbose, int endcap, int sector, int bx, int maxTracks, bool useSingleHits)
void process(const std::deque< EMTFHitCollection > &extended_conv_hits, const emtf::zone_array< EMTFRoadCollection > &zone_roads, emtf::zone_array< EMTFTrackCollection > &zone_tracks) const
void configure(int verbose, int endcap, int sector, int bx, bool fixZonePhi, bool useNewZones, bool bugSt2PhDiff, bool bugME11Dupes)

Member Data Documentation

bool SectorProcessor::bug9BitDPhi_
private

Definition at line 113 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::bugAmbigThetaWin_
private

Definition at line 104 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::bugGMTPhi_
private

Definition at line 113 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::bugME11Dupes_
private

Definition at line 104 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::bugMode7CLCT_
private

Definition at line 113 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::bugNegPt_
private

Definition at line 113 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::bugSameSectorPt0_
private

Definition at line 109 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::bugSt2PhDiff_
private

Definition at line 104 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

int SectorProcessor::bxShiftCSC_
private

Definition at line 88 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::bxShiftGEM_
private

Definition at line 88 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::bxShiftRPC_
private

Definition at line 88 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::bxWindow_
private

Definition at line 88 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), process(), and process_single_bx().

const ConditionHelper* SectorProcessor::cond_
private

Definition at line 80 of file SectorProcessor.h.

Referenced by configure().

bool SectorProcessor::duplicateTheta_
private

Definition at line 95 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::endcap_
private

Definition at line 86 of file SectorProcessor.h.

Referenced by configure(), process(), and process_single_bx().

std::string SectorProcessor::era_
private

Definition at line 90 of file SectorProcessor.h.

Referenced by configure(), and configure_by_fw_version().

bool SectorProcessor::fixME11Edges_
private

Definition at line 95 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::fixMode15HighPt_
private

Definition at line 112 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::fixZonePhi_
private

Definition at line 95 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::includeNeighbor_
private

Definition at line 95 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

const SectorProcessorLUT* SectorProcessor::lut_
private

Definition at line 82 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::maxBX_
private

Definition at line 88 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process().

int SectorProcessor::maxRoadsPerZone_
private

Definition at line 107 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::maxTracks_
private

Definition at line 107 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::minBX_
private

Definition at line 88 of file SectorProcessor.h.

Referenced by configure(), and process().

int SectorProcessor::modeQualVer_
private

Definition at line 114 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

std::vector<std::string> SectorProcessor::pattDefinitions_
private

Definition at line 98 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

bool SectorProcessor::promoteMode7_
private

Definition at line 113 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

PtAssignmentEngine* SectorProcessor::pt_assign_engine_
private

Definition at line 84 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

bool SectorProcessor::readPtLUTFile_
private

Definition at line 112 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::sector_
private

Definition at line 86 of file SectorProcessor.h.

Referenced by configure(), process(), and process_single_bx().

std::vector<std::string> SectorProcessor::symPattDefinitions_
private

Definition at line 98 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::thetaWindow_
private

Definition at line 102 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

int SectorProcessor::thetaWindowZone0_
private

Definition at line 102 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

const GeometryTranslator* SectorProcessor::tp_geom_
private

Definition at line 78 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

bool SectorProcessor::twoStationSameBX_
private

Definition at line 104 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::useNewZones_
private

Definition at line 95 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

bool SectorProcessor::useRPC_
private

Definition at line 103 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::useSecondEarliest_
private

Definition at line 108 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

bool SectorProcessor::useSingleHits_
private

Definition at line 103 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

bool SectorProcessor::useSymPatterns_
private

Definition at line 99 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), and process_single_bx().

int SectorProcessor::verbose_
private

Definition at line 86 of file SectorProcessor.h.

Referenced by configure(), configure_by_fw_version(), process(), and process_single_bx().

std::vector<int> SectorProcessor::zoneBoundaries_
private

Definition at line 93 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::zoneOverlap_
private

Definition at line 94 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().