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, 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 thetaWindowRPC, bool useSingleHits, bool bugSt2PhDiff, bool bugME11Dupes, int maxRoadsPerZone, int maxTracks, bool useSecondEarliest, bool bugSameSectorPt0, int ptLUTVersion, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt, bool bugGMTPhi, bool promoteMode7)
 
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 ()
 
void set_pt_lut_version (unsigned pt_lut_version)
 
 ~SectorProcessor ()
 

Private Attributes

bool bug9BitDPhi_
 
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_
 
bool fixME11Edges_
 
bool fixMode15HighPt_
 
bool fixZonePhi_
 
bool includeNeighbor_
 
const SectorProcessorLUTlut_
 
int maxBX_
 
int maxRoadsPerZone_
 
int maxTracks_
 
int minBX_
 
std::vector< std::string > pattDefinitions_
 
bool promoteMode7_
 
PtAssignmentEngine ** pt_assign_engine_
 
int ptLUTVersion_
 
bool readPtLUTFile_
 
int sector_
 
std::vector< std::string > symPattDefinitions_
 
int thetaWindow_
 
int thetaWindowRPC_
 
const GeometryTranslatortp_geom_
 
bool useNewZones_
 
bool useSecondEarliest_
 
bool useSingleHits_
 
bool useSymPatterns_
 
int verbose_
 
std::vector< int > zoneBoundaries_
 
int zoneOverlap_
 

Detailed Description

Definition at line 27 of file SectorProcessor.h.

Member Typedef Documentation

typedef unsigned long long SectorProcessor::EventNumber_t

Definition at line 32 of file SectorProcessor.h.

Definition at line 33 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,
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  thetaWindowRPC,
bool  useSingleHits,
bool  bugSt2PhDiff,
bool  bugME11Dupes,
int  maxRoadsPerZone,
int  maxTracks,
bool  useSecondEarliest,
bool  bugSameSectorPt0,
int  ptLUTVersion,
bool  readPtLUTFile,
bool  fixMode15HighPt,
bool  bug9BitDPhi,
bool  bugMode7CLCT,
bool  bugNegPt,
bool  bugGMTPhi,
bool  promoteMode7 
)

Definition at line 12 of file SectorProcessor.cc.

References bug9BitDPhi_, bugGMTPhi_, bugME11Dupes_, bugMode7CLCT_, bugNegPt_, bugSameSectorPt0_, bugSt2PhDiff_, bxShiftCSC_, bxShiftGEM_, bxShiftRPC_, bxWindow_, cond_, duplicateTheta_, makeMuonMisalignmentScenario::endcap, endcap_, 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_, pattDefinitions_, promoteMode7_, pt_assign_engine_, ptLUTVersion_, readPtLUTFile_, sector_, symPattDefinitions_, thetaWindow_, thetaWindowRPC_, tp_geom_, useNewZones_, useSecondEarliest_, useSingleHits_, useSymPatterns_, verbose, verbose_, zoneBoundaries_, and zoneOverlap_.

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

Definition at line 98 of file SectorProcessor.cc.

References bug9BitDPhi_, bugGMTPhi_, bugME11Dupes_, bugMode7CLCT_, bugNegPt_, bugSameSectorPt0_, bugSt2PhDiff_, bxShiftCSC_, bxWindow_, duplicateTheta_, fixME11Edges_, fixMode15HighPt_, fixZonePhi_, includeNeighbor_, maxBX_, maxRoadsPerZone_, maxTracks_, minBX_, pattDefinitions_, promoteMode7_, symPattDefinitions_, thetaWindow_, useNewZones_, useSecondEarliest_, useSingleHits_, useSymPatterns_, zoneBoundaries_, and zoneOverlap_.

98  {
99 
100  // std::cout << "Running configure_by_fw_version with version " << fw_version << std::endl;
101 
102  if (fw_version == 0 || fw_version == 123456) // fw_version '123456' is from the fake conditions
103  return;
104 
105  // For now, no switches later than FW version 47864 (end-of-year 2016)
106  // Beggining in late 2016, "fw_version" in O2O populated with timestamp, rather than FW version
107  // tm fw_time = gmtime(fw_version); (See https://linux.die.net/man/3/gmtime)
108 
109  // Settings for 2017 (by default just use settings in simEmtfDigis_cfi.py)
110  if (fw_version >= 50000) {
111 
112  // ___________________________________________________________________________
113  // Versions in 2017 - no full documentation, can refer to https://twiki.cern.ch/twiki/bin/viewauth/CMS/L1KnownIssues
114 
115  // Before July 9th (runs < 298653), all mode 7 tracks (station 2-3-4) assigned quality 11
116  // July 9th - 29th (runs 298653 - 300087), mode 7 tracks with |eta| > 1.6 in sector -6 assigned quality 12
117  // After July 29th (runs >= 300088), mode 7 track promotion applied in all sectors
118  // For some reason, the FW version in the database is 1496792995, at least for runs >= 298034 (July 4),
119  // which is towards the end of run 2017B (could not check earlier runs). This corresponds to the date "June 6th",
120  // which is a month earlier than the first firmware update to apply this promotion. So something's screwey.
121  // Since July 18 is in the middle of the single-sector-fix period, would like to use a firmware version with
122  // roughly that date. But this may require an intervention in the database. - AWB 04.08.17
123  if (fw_version < 1496792995)
124  promoteMode7_ = false; // Assign station 2-3-4 tracks with |eta| > 1.6 SingleMu quality
125 
126  return;
127  }
128 
129  // Settings for all of 2016 (following order in simEmtfDigis_cfi.py)
130  else {
131  minBX_ = -3; // Minimum BX considered
132  bxWindow_ = 3; // Number of BX whose primitives can be included in the same track
133  bxShiftCSC_ = -6; // Shift applied to input CSC LCT primitives, to center at BX = 0
134 
135  zoneBoundaries_ = {0,41,49,87,127}; // Vertical boundaries of track-building zones, in integer theta
136  zoneOverlap_ = 2; // Overlap between zones
137  includeNeighbor_ = true; // Include primitives from neighbor chambers in track-building
138  duplicateTheta_ = true; // Use up to 4 theta/phi positions for two LCTs in the same chamber
139  useNewZones_ = false;
140  fixME11Edges_ = false;
141 
142  pattDefinitions_ = { "4,15:15,7:7,7:7,7:7",
143  "3,16:16,7:7,7:6,7:6",
144  "3,14:14,7:7,8:7,8:7",
145  "2,18:17,7:7,7:5,7:5", // Should be 7:4 in ME3,4 (FW bug)
146  "2,13:12,7:7,10:7,10:7",
147  "1,22:19,7:7,7:0,7:0",
148  "1,11:8,7:7,14:7,14:7",
149  "0,30:23,7:7,7:0,7:0",
150  "0,7:0,7:7,14:7,14:7" };
151  // Straightness, hits in ME1, hits in ME2, hits in ME3, hits in ME4
152  symPattDefinitions_ = { "4,15:15:15:15,7:7:7:7,7:7:7:7,7:7:7:7",
153  "3,16:16:14:14,7:7:7:7,8:7:7:6,8:7:7:6",
154  "2,18:17:13:12,7:7:7:7,10:7:7:4,10:7:7:4",
155  "1,22:19:11:8,7:7:7:7,14:7:7:0,14:7:7:0",
156  "0,30:23:7:0,7:7:7:7,14:7:7:0,14:7:7:0" };
157 
158  thetaWindow_ = 4; // Maximum dTheta between primitives in the same track
159  useSingleHits_ = false; // Build "tracks" from single LCTs in ME1/1
160 
161  maxRoadsPerZone_ = 3; // Number of patterns that can be built per theta zone
162  maxTracks_ = 3; // Number of tracks that can be sent from each sector
163 
164  bugGMTPhi_ = true;
165  promoteMode7_ = false; // Assign station 2-3-4 tracks with |eta| > 1.6 SingleMu quality
166  } // End default settings for 2016
167 
168 
169  // ___________________________________________________________________________
170  // Versions in 2016 - refer to docs/EMTF_FW_LUT_versions_2016_draft2.xlsx
171 
172  // 1st_LCT_BX / 2nd_LCT_BX (should also make unpacker configurable - AWB 21.07.17)
173  // FW: Before: Earliest LCT used to assign BX, tracks only cancel within same BX
174  // After: Second-earliest LCT used to assign BX, tracks cancel over 3 BX, improved LCT recovery
175  useSecondEarliest_ = (fw_version < 46773) ? false : true; // Changed Sept. 5
176 
177  // 8_BX_readout / 7_BX_readout
178  // SW: DAQ readout changed from to [-3, +4] BX to [-3, +3] BX
179  maxBX_ = (fw_version < 47109) ? +4 : +3; // Changed Sept. 28
180 
181  // Asymm_patterns / Symm_patterns
182  // FW: Changed from 9 asymmetric patterns to 5 symmetric patterns for track building
183  useSymPatterns_ = (fw_version < 47214) ? false : true; // Changed Oct. 6
184 
185  // HiPt_outlier
186  // LUT: High-pT fix puts outlier LCTs in mode 15 tracks back in a straight line
187  fixMode15HighPt_ = (fw_version < 46650) ? false : true; // Changed July 25
188 
189  // Link_monitor (unpacker only)
190  // FW: Added MPC link monitoring
191 
192  // ___________________________________________________________________________
193  // Bugs
194 
195  // DAQ_ID (unpacker only; should make configurable - AWB 21.07.17)
196  // FW: DAQ ME with output CSC ID range 0 - 8 instead of 1 - 9
197  // SP output ME2_ID, 3_ID, and 4_ID filled with 4, 5, or 6 when they should have been 7, 8, or 9.
198 
199  // ME_ID_FR
200  // FW: Incorrect ME_ID fields in DAQ, wrong FR bits and some dPhi wrap-around in pT LUT address
201  // - Unpacker only, or not worth emulating
202 
203  // DAQ_miss_LCT (unpacker only)
204  // FW: LCTs only output if there was a track in the sector
205 
206  // Sector_pT_0
207  // FW: Only highest-quality track in a sector assigned pT; others assigned pT = 0
208  bugSameSectorPt0_ = (fw_version < 46650) ? true : false; // Fixed July 22
209 
210  // Sector_bad_pT
211  // FW: Tracks sometimes assigned pT of track in previous BX
212  // - This is an ongoing (very rare) bug which occurs when 2 tracks try to access the same "bank" in the pT LUT
213  // It would be very difficult to emulate exactly, but the logic from Alex Madorsky is below
214  // ## macro for detecting same bank address
215  // ## bank and chip must match, and valid flags must be set
216  // ## a and b are indexes 0,1,2
217  // ## [X:Y] are bit portions from ptlut address words
218  // `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])
219  // ## This macro is used like this:
220  // if (`sb(0,2) || `sb(1,2)) {disable PT readout for track 2}
221 
222 
223  // DAQ_BX_3_LCT (unpacker only)
224  // SW: LCTs in BX -3 only reported if there was a track in the sector
225  // - not applicable
226 
227  // DAQ_BX_23_LCT (unpacker only)
228  // SW: LCTs in BX -2 and -3 only reported if there was a track in the sector
229  // - not applicable
230 
231  // pT_dPhi_bits
232  // FW: dPhi wrap-around in modes 3, 5, 6, 9, 10, 12
233  bug9BitDPhi_ = (fw_version < 47214) ? true : false; // Fixed Oct. 6
234 
235  // Pattern_phi / ME1_neigh_phi
236  // FW: Pattern phi slightly offset from true LCT phi; also ME3/4 pattern width off
237  // Pattern phi of neighbor hits in ME1 miscalculated
238  fixZonePhi_ = (fw_version < 47214) ? false : true; // Fixed Oct. 6
239 
240  // LCT_station_2
241  // FW: Reduced LCT matching window in station 2, resulting in demoted tracks and inefficiency
242  bugSt2PhDiff_ = (47109 <= fw_version && fw_version < 47249) ? true : false; // Bug introduced Oct. 6, fixed Oct. 19
243 
244  // LCT_theta_dup
245  // FW: LCTs matched to track may take theta value from other LCT in the same chamber
246  bugME11Dupes_ = (fw_version < 47423) ? true : false; // Fixed Nov. 1
247 
248  // LCT_7_10_neg_pT (E)
249  // LUT: Written with incorrect values for mode 7 CLCT, mode 10 random offset, all modes negative (1/pT) set to 3 instead of 511
250  bugMode7CLCT_ = (fw_version < 47864) ? true : false; // Fixed sometime after Nov. 1
251  bugNegPt_ = (fw_version < 47864) ? true : false; // Fixed sometime after Nov. 1
252 
253 
254 }
std::vector< std::string > pattDefinitions_
std::vector< int > zoneBoundaries_
std::vector< std::string > symPattDefinitions_
void SectorProcessor::process ( EventNumber_t  ievent,
const TriggerPrimitiveCollection muon_primitives,
EMTFHitCollection out_hits,
EMTFTrackCollection out_tracks 
) const

Definition at line 256 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().

261  {
262 
263  // List of converted hits, extended from previous BXs
264  // deque (double-ended queue) is similar to a vector, but allows insertion or deletion of elements at both beginning and end
265  std::deque<EMTFHitCollection> extended_conv_hits;
266 
267  // List of best track candidates, extended from previous BXs
268  std::deque<EMTFTrackCollection> extended_best_track_cands;
269 
270  // Map of pattern detector --> lifetime, tracked across BXs
271  std::map<pattern_ref_t, int> patt_lifetime_map;
272 
273  // ___________________________________________________________________________
274  // Run each sector processor for every BX, taking into account the BX window
275 
276  int delayBX = bxWindow_ - 1;
277 
278  for (int bx = minBX_; bx <= maxBX_ + delayBX; ++bx) {
279  if (verbose_ > 0) { // debug
280  std::cout << "Endcap: " << endcap_ << " Sector: " << sector_ << " Event: " << ievent << " BX: " << bx << std::endl;
281  }
282 
284  bx,
285  muon_primitives,
286  out_hits,
287  out_tracks,
288  extended_conv_hits,
289  extended_best_track_cands,
290  patt_lifetime_map
291  );
292 
293  // Drop earliest BX outside of BX window
294  if (bx >= minBX_ + delayBX) {
295  extended_conv_hits.pop_front();
296 
297  int n = emtf::zone_array<int>().size();
298  extended_best_track_cands.erase(extended_best_track_cands.end()-n, extended_best_track_cands.end()); // pop_back
299  }
300  } // end loop over bx
301 
302  return;
303 }
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:68
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 305 of file SectorProcessor.cc.

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

Referenced by process().

313  {
314 
315  // ___________________________________________________________________________
316  // Configure
317 
318  PrimitiveSelection prim_sel;
319  prim_sel.configure(
320  verbose_, endcap_, sector_, bx,
324  );
325 
326  PrimitiveConversion prim_conv;
327  prim_conv.configure(
328  tp_geom_, lut_,
329  verbose_, endcap_, sector_, bx,
334  );
335 
336  PatternRecognition patt_recog;
337  patt_recog.configure(
338  verbose_, endcap_, sector_, bx,
339  bxWindow_,
342  );
343 
344  PrimitiveMatching prim_match;
345  prim_match.configure(
346  verbose_, endcap_, sector_, bx,
349  );
350 
351  AngleCalculation angle_calc;
352  angle_calc.configure(
353  verbose_, endcap_, sector_, bx,
354  bxWindow_,
357  );
358 
359  BestTrackSelection btrack_sel;
360  btrack_sel.configure(
361  verbose_, endcap_, sector_, bx,
362  bxWindow_,
365  );
366 
367  SingleHitTrack single_hit;
368  single_hit.configure(
369  verbose_, endcap_, sector_, bx,
370  maxTracks_,
372  );
373 
374  PtAssignment pt_assign;
375  pt_assign.configure(
377  verbose_, endcap_, sector_, bx,
381  );
382 
383  std::map<int, TriggerPrimitiveCollection> selected_csc_map;
384  std::map<int, TriggerPrimitiveCollection> selected_rpc_map;
385  std::map<int, TriggerPrimitiveCollection> selected_gem_map;
386  std::map<int, TriggerPrimitiveCollection> selected_prim_map;
387  std::map<int, TriggerPrimitiveCollection> inclusive_selected_prim_map;
388 
389  EMTFHitCollection conv_hits; // "converted" hits converted by primitive converter
390  EMTFHitCollection inclusive_conv_hits;
391 
392  emtf::zone_array<EMTFRoadCollection> zone_roads; // each zone has its road collection
393 
394  emtf::zone_array<EMTFTrackCollection> zone_tracks; // each zone has its track collection
395 
396  EMTFTrackCollection best_tracks; // "best" tracks selected from all the zones
397 
398  // ___________________________________________________________________________
399  // Process
400 
401  // Select muon primitives that belong to this sector and this BX.
402  // Put them into maps with an index that roughly corresponds to
403  // each input link.
404  // From src/PrimitiveSelection.cc
405  prim_sel.process(CSCTag(), muon_primitives, selected_csc_map);
406  prim_sel.process(RPCTag(), muon_primitives, selected_rpc_map);
407  prim_sel.process(GEMTag(), muon_primitives, selected_gem_map);
408  prim_sel.merge(selected_csc_map, selected_rpc_map, selected_gem_map, selected_prim_map);
409 
410  // Convert trigger primitives into "converted" hits
411  // A converted hit consists of integer representations of phi, theta, and zones
412  // From src/PrimitiveConversion.cc
413  prim_conv.process(selected_prim_map, conv_hits);
414  extended_conv_hits.push_back(conv_hits);
415 
416  {
417  // Keep all the converted hits for the use of data-emulator comparisons.
418  // They include the extra ones that are not used in track building and the subsequent steps.
419  prim_sel.merge_no_truncate(selected_csc_map, selected_rpc_map, selected_gem_map, inclusive_selected_prim_map);
420  prim_conv.process(inclusive_selected_prim_map, inclusive_conv_hits);
421  }
422 
423  // Detect patterns in all zones, find 3 best roads in each zone
424  // From src/PatternRecognition.cc
425  patt_recog.process(extended_conv_hits, patt_lifetime_map, zone_roads);
426 
427  // Match the trigger primitives to the roads, create tracks
428  // From src/PrimitiveMatching.cc
429  prim_match.process(extended_conv_hits, zone_roads, zone_tracks);
430 
431  // Calculate deflection angles for each track and fill track variables
432  // From src/AngleCalculation.cc
433  angle_calc.process(zone_tracks);
434  extended_best_track_cands.insert(extended_best_track_cands.begin(), zone_tracks.begin(), zone_tracks.end()); // push_front
435 
436  // Select 3 "best" tracks from all the zones
437  // From src/BestTrackSelection.cc
438  btrack_sel.process(extended_best_track_cands, best_tracks);
439 
440  // Insert single LCTs from station 1 as tracks
441  // From src/SingleHitTracks.cc
442  single_hit.process(conv_hits, best_tracks);
443 
444  // Construct pT address, assign pT, calculate other GMT quantities
445  // From src/PtAssignment.cc
446  pt_assign.process(best_tracks);
447 
448  // ___________________________________________________________________________
449  // Output
450 
451  out_hits.insert(out_hits.end(), inclusive_conv_hits.begin(), inclusive_conv_hits.end());
452  out_tracks.insert(out_tracks.end(), best_tracks.begin(), best_tracks.end());
453 
454  return;
455 }
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:36
void process(const EMTFHitCollection &conv_hits, EMTFTrackCollection &best_tracks) const
void configure(int verbose, int endcap, int sector, int bx, int bxWindow, int thetaWindow, int thetaWindowRPC, bool bugME11Dupes)
std::vector< std::string > symPattDefinitions_
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:25
emtf::RPCTag RPCTag
Definition: Common.h:37
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
const SectorProcessorLUT * lut_
std::array< T, NUM_ZONES > zone_array
Definition: Common.h:68
void process(T tag, const TriggerPrimitiveCollection &muon_primitives, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
void merge_no_truncate(std::map< int, TriggerPrimitiveCollection > &selected_csc_map, std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, std::map< int, TriggerPrimitiveCollection > &selected_gem_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
l1t::EMTFHitCollection EMTFHitCollection
Definition: Common.h:21
emtf::GEMTag GEMTag
Definition: Common.h:38
PtAssignmentEngine ** pt_assign_engine_
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)
void configure(int verbose, int endcap, int sector, int bx, int bxWindow, int maxRoadsPerZone, int maxTracks, bool useSecondEarliest, bool bugSameSectorPt0)
void process(const std::map< int, TriggerPrimitiveCollection > &selected_prim_map, EMTFHitCollection &conv_hits) const
void process(EMTFTrackCollection &best_tracks)
Definition: PtAssignment.cc:33
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 merge(std::map< int, TriggerPrimitiveCollection > &selected_csc_map, std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, 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, bool fixZonePhi, bool useNewZones, bool bugSt2PhDiff, bool bugME11Dupes)
void configure(const PtAssignmentEngine *pt_assign_engine, int verbose, int endcap, int sector, int bx, int ptLUTVersion, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt, bool bugGMTPhi, bool promoteMode7)
Definition: PtAssignment.cc:6
void SectorProcessor::set_pt_lut_version ( unsigned  pt_lut_version)

Definition at line 92 of file SectorProcessor.cc.

References ptLUTVersion_.

92  {
93  ptLUTVersion_ = pt_lut_version;
94  // std::cout << " * In endcap " << endcap_ << ", sector " << sector_ << ", set ptLUTVersion_ to " << ptLUTVersion_ << std::endl;
95 }

Member Data Documentation

bool SectorProcessor::bug9BitDPhi_
private

Definition at line 110 of file SectorProcessor.h.

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

bool SectorProcessor::bugGMTPhi_
private

Definition at line 110 of file SectorProcessor.h.

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

bool SectorProcessor::bugME11Dupes_
private

Definition at line 100 of file SectorProcessor.h.

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

bool SectorProcessor::bugMode7CLCT_
private

Definition at line 110 of file SectorProcessor.h.

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

bool SectorProcessor::bugNegPt_
private

Definition at line 110 of file SectorProcessor.h.

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

bool SectorProcessor::bugSameSectorPt0_
private

Definition at line 105 of file SectorProcessor.h.

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

bool SectorProcessor::bugSt2PhDiff_
private

Definition at line 100 of file SectorProcessor.h.

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

int SectorProcessor::bxShiftCSC_
private

Definition at line 86 of file SectorProcessor.h.

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

int SectorProcessor::bxShiftGEM_
private

Definition at line 86 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::bxShiftRPC_
private

Definition at line 86 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::bxWindow_
private

Definition at line 86 of file SectorProcessor.h.

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

const ConditionHelper* SectorProcessor::cond_
private

Definition at line 78 of file SectorProcessor.h.

Referenced by configure().

bool SectorProcessor::duplicateTheta_
private

Definition at line 91 of file SectorProcessor.h.

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

int SectorProcessor::endcap_
private

Definition at line 84 of file SectorProcessor.h.

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

bool SectorProcessor::fixME11Edges_
private

Definition at line 91 of file SectorProcessor.h.

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

bool SectorProcessor::fixMode15HighPt_
private

Definition at line 109 of file SectorProcessor.h.

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

bool SectorProcessor::fixZonePhi_
private

Definition at line 91 of file SectorProcessor.h.

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

bool SectorProcessor::includeNeighbor_
private

Definition at line 91 of file SectorProcessor.h.

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

const SectorProcessorLUT* SectorProcessor::lut_
private

Definition at line 80 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::maxBX_
private

Definition at line 86 of file SectorProcessor.h.

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

int SectorProcessor::maxRoadsPerZone_
private

Definition at line 103 of file SectorProcessor.h.

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

int SectorProcessor::maxTracks_
private

Definition at line 103 of file SectorProcessor.h.

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

int SectorProcessor::minBX_
private

Definition at line 86 of file SectorProcessor.h.

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

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

Definition at line 94 of file SectorProcessor.h.

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

bool SectorProcessor::promoteMode7_
private

Definition at line 110 of file SectorProcessor.h.

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

PtAssignmentEngine** SectorProcessor::pt_assign_engine_
private

Definition at line 82 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::ptLUTVersion_
private

Definition at line 108 of file SectorProcessor.h.

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

bool SectorProcessor::readPtLUTFile_
private

Definition at line 109 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

int SectorProcessor::sector_
private

Definition at line 84 of file SectorProcessor.h.

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

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

Definition at line 94 of file SectorProcessor.h.

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

int SectorProcessor::thetaWindow_
private

Definition at line 98 of file SectorProcessor.h.

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

int SectorProcessor::thetaWindowRPC_
private

Definition at line 98 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

const GeometryTranslator* SectorProcessor::tp_geom_
private

Definition at line 76 of file SectorProcessor.h.

Referenced by configure(), and process_single_bx().

bool SectorProcessor::useNewZones_
private

Definition at line 91 of file SectorProcessor.h.

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

bool SectorProcessor::useSecondEarliest_
private

Definition at line 104 of file SectorProcessor.h.

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

bool SectorProcessor::useSingleHits_
private

Definition at line 99 of file SectorProcessor.h.

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

bool SectorProcessor::useSymPatterns_
private

Definition at line 95 of file SectorProcessor.h.

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

int SectorProcessor::verbose_
private

Definition at line 84 of file SectorProcessor.h.

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

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

Definition at line 89 of file SectorProcessor.h.

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

int SectorProcessor::zoneOverlap_
private

Definition at line 90 of file SectorProcessor.h.

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