CMS 3D CMS Logo

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

#include <SectorProcessor.h>

Public Types

typedef PatternRecognition::pattern_ref_t pattern_ref_t
 

Public Member Functions

void configure (const EMTFSetup *setup, int verbose, int endcap, int sector)
 
void process (const edm::EventID &event_id, 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

int endcap_
 
int sector_
 
const EMTFSetupsetup_
 
int verbose_
 

Detailed Description

Definition at line 23 of file SectorProcessor.h.

Member Typedef Documentation

◆ pattern_ref_t

Definition at line 28 of file SectorProcessor.h.

Constructor & Destructor Documentation

◆ SectorProcessor()

SectorProcessor::SectorProcessor ( )
explicit

Definition at line 3 of file SectorProcessor.cc.

3 {}

◆ ~SectorProcessor()

SectorProcessor::~SectorProcessor ( )

Definition at line 5 of file SectorProcessor.cc.

5 {}

Member Function Documentation

◆ configure()

void SectorProcessor::configure ( const EMTFSetup setup,
int  verbose,
int  endcap,
int  sector 
)

◆ process()

void SectorProcessor::process ( const edm::EventID event_id,
const TriggerPrimitiveCollection muon_primitives,
EMTFHitCollection out_hits,
EMTFTrackCollection out_tracks 
) const

Definition at line 18 of file SectorProcessor.cc.

21  {
22  auto cfg = setup_->getVersionControl();
23 
24  // List of converted hits, extended from previous BXs
25  // deque (double-ended queue) is similar to a vector, but allows insertion or deletion of elements at both beginning and end
26  std::deque<EMTFHitCollection> extended_conv_hits;
27 
28  // List of best track candidates, extended from previous BXs
29  std::deque<EMTFTrackCollection> extended_best_track_cands;
30 
31  // Map of pattern detector --> lifetime, tracked across BXs
32  std::map<pattern_ref_t, int> patt_lifetime_map;
33 
34  // ___________________________________________________________________________
35  // Run each sector processor for every BX, taking into account the BX window
36 
37  int delayBX = cfg.bxWindow_ - 1;
38 
39  for (int bx = cfg.minBX_; bx <= cfg.maxBX_ + delayBX; ++bx) {
40  if (verbose_ > 0) { // debug
41  std::cout << "Event: " << event_id << " Endcap: " << endcap_ << " Sector: " << sector_ << " BX: " << bx
42  << std::endl;
43  }
44 
46  bx, muon_primitives, out_hits, out_tracks, extended_conv_hits, extended_best_track_cands, patt_lifetime_map);
47 
48  // Drop earliest BX outside of BX window
49  if (bx >= cfg.minBX_ + delayBX) {
50  extended_conv_hits.pop_front();
51 
52  int n = emtf::zone_array<int>().size();
53  extended_best_track_cands.erase(extended_best_track_cands.end() - n,
54  extended_best_track_cands.end()); // pop_back
55  }
56  } // end loop over bx
57 
58  return;
59 }

References l1GtPatternGenerator_cfi::bx, looper::cfg, gather_cfg::cout, endcap_, EMTFSetup::getVersionControl(), dqmiodumpmetadata::n, process_single_bx(), sector_, setup_, and verbose_.

◆ process_single_bx()

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 61 of file SectorProcessor.cc.

67  {
68  auto cfg = setup_->getVersionControl();
69 
70  auto tp_geom_ = &(setup_->getGeometryTranslator());
71  auto pc_lut_ = &(setup_->getSectorProcessorLUT());
72  auto pt_assign_engine_ = setup_->getPtAssignmentEngine();
73  auto pt_assign_engine_dxy_ = setup_->getPtAssignmentEngineDxy();
74 
75  // ___________________________________________________________________________
76  // Configure
77 
78  PrimitiveSelection prim_sel;
79  prim_sel.configure(verbose_,
80  endcap_,
81  sector_,
82  bx,
83  cfg.bxShiftCSC_,
84  cfg.bxShiftRPC_,
85  cfg.bxShiftGEM_,
86  cfg.bxShiftME0_,
87  cfg.includeNeighbor_,
88  cfg.duplicateTheta_,
89  cfg.bugME11Dupes_);
90 
91  PrimitiveConversion prim_conv;
92  prim_conv.configure(tp_geom_,
93  pc_lut_,
94  verbose_,
95  endcap_,
96  sector_,
97  bx,
98  cfg.bxShiftCSC_,
99  cfg.bxShiftRPC_,
100  cfg.bxShiftGEM_,
101  cfg.bxShiftME0_,
102  cfg.zoneBoundaries_,
103  cfg.zoneOverlap_,
104  cfg.duplicateTheta_,
105  cfg.fixZonePhi_,
106  cfg.useNewZones_,
107  cfg.fixME11Edges_,
108  cfg.bugME11Dupes_,
109  cfg.useRun3CCLUT_);
110 
111  PatternRecognition patt_recog;
112  patt_recog.configure(verbose_,
113  endcap_,
114  sector_,
115  bx,
116  cfg.bxWindow_,
117  cfg.pattDefinitions_,
118  cfg.symPattDefinitions_,
119  cfg.useSymPatterns_,
120  cfg.maxRoadsPerZone_,
121  cfg.useSecondEarliest_);
122 
123  PrimitiveMatching prim_match;
124  prim_match.configure(
125  verbose_, endcap_, sector_, bx, cfg.fixZonePhi_, cfg.useNewZones_, cfg.bugSt2PhDiff_, cfg.bugME11Dupes_);
126 
127  AngleCalculation angle_calc;
128  angle_calc.configure(verbose_,
129  endcap_,
130  sector_,
131  bx,
132  cfg.bxWindow_,
133  cfg.thetaWindow_,
134  cfg.thetaWindowZone0_,
135  cfg.bugME11Dupes_,
136  cfg.bugAmbigThetaWin_,
137  cfg.twoStationSameBX_);
138 
139  BestTrackSelection btrack_sel;
140  btrack_sel.configure(verbose_,
141  endcap_,
142  sector_,
143  bx,
144  cfg.bxWindow_,
145  cfg.maxRoadsPerZone_,
146  cfg.maxTracks_,
147  cfg.useSecondEarliest_,
148  cfg.bugSameSectorPt0_);
149 
150  SingleHitTrack single_hit;
151  single_hit.configure(verbose_, endcap_, sector_, bx, cfg.maxTracks_, cfg.useSingleHits_);
152 
153  PtAssignment pt_assign;
154  pt_assign.configure(pt_assign_engine_,
155  pt_assign_engine_dxy_,
156  verbose_,
157  endcap_,
158  sector_,
159  bx,
160  cfg.readPtLUTFile_,
161  cfg.fixMode15HighPt_,
162  cfg.bug9BitDPhi_,
163  cfg.bugMode7CLCT_,
164  cfg.bugNegPt_,
165  cfg.bugGMTPhi_,
166  cfg.promoteMode7_,
167  cfg.modeQualVer_,
168  cfg.pbFileName_);
169 
170  std::map<int, TriggerPrimitiveCollection> selected_dt_map;
171  std::map<int, TriggerPrimitiveCollection> selected_csc_map;
172  std::map<int, TriggerPrimitiveCollection> selected_rpc_map;
173  std::map<int, TriggerPrimitiveCollection> selected_gem_map;
174  std::map<int, TriggerPrimitiveCollection> selected_me0_map;
175  std::map<int, TriggerPrimitiveCollection> selected_prim_map;
176  std::map<int, TriggerPrimitiveCollection> inclusive_selected_prim_map;
177 
178  EMTFHitCollection conv_hits; // "converted" hits converted by primitive converter
179  EMTFHitCollection inclusive_conv_hits;
180 
181  emtf::zone_array<EMTFRoadCollection> zone_roads; // each zone has its road collection
182 
183  emtf::zone_array<EMTFTrackCollection> zone_tracks; // each zone has its track collection
184 
185  EMTFTrackCollection best_tracks; // "best" tracks selected from all the zones
186 
187  // ___________________________________________________________________________
188  // Process
189 
190  // Select muon primitives that belong to this sector and this BX.
191  // Put them into maps with an index that roughly corresponds to
192  // each input link.
193  // From src/PrimitiveSelection.cc
194  prim_sel.process(emtf::DTTag(), muon_primitives, selected_dt_map);
195  prim_sel.process(emtf::CSCTag(), muon_primitives, selected_csc_map);
196  prim_sel.process(emtf::RPCTag(), muon_primitives, selected_rpc_map);
197  prim_sel.process(emtf::GEMTag(), muon_primitives, selected_gem_map);
198  prim_sel.process(emtf::ME0Tag(), muon_primitives, selected_me0_map);
199  prim_sel.merge(
200  selected_dt_map, selected_csc_map, selected_rpc_map, selected_gem_map, selected_me0_map, selected_prim_map);
201 
202  // Convert trigger primitives into "converted" hits
203  // A converted hit consists of integer representations of phi, theta, and zones
204  // From src/PrimitiveConversion.cc
205  prim_conv.process(selected_prim_map, conv_hits);
206  extended_conv_hits.push_back(conv_hits);
207 
208  {
209  // Keep all the converted hits for the use of data-emulator comparisons.
210  // They include the extra ones that are not used in track building and the subsequent steps.
211  prim_sel.merge_no_truncate(selected_dt_map,
212  selected_csc_map,
213  selected_rpc_map,
214  selected_gem_map,
215  selected_me0_map,
216  inclusive_selected_prim_map);
217  prim_conv.process(inclusive_selected_prim_map, inclusive_conv_hits);
218 
219  // Clear the input maps to save memory
220  selected_dt_map.clear();
221  selected_csc_map.clear();
222  selected_rpc_map.clear();
223  selected_gem_map.clear();
224  selected_me0_map.clear();
225  }
226 
227  // Detect patterns in all zones, find 3 best roads in each zone
228  // From src/PatternRecognition.cc
229  patt_recog.process(extended_conv_hits, patt_lifetime_map, zone_roads);
230 
231  // Match the trigger primitives to the roads, create tracks
232  // From src/PrimitiveMatching.cc
233  prim_match.process(extended_conv_hits, zone_roads, zone_tracks);
234 
235  // Calculate deflection angles for each track and fill track variables
236  // From src/AngleCalculation.cc
237  angle_calc.process(zone_tracks);
238  extended_best_track_cands.insert(
239  extended_best_track_cands.begin(), zone_tracks.begin(), zone_tracks.end()); // push_front
240 
241  // Select 3 "best" tracks from all the zones
242  // From src/BestTrackSelection.cc
243  btrack_sel.process(extended_best_track_cands, best_tracks);
244 
245  // Insert single LCTs from station 1 as tracks
246  // From src/SingleHitTracks.cc
247  single_hit.process(conv_hits, best_tracks);
248 
249  // Construct pT address, assign pT, calculate other GMT quantities
250  // From src/PtAssignment.cc
251  pt_assign.process(best_tracks);
252 
253  // ___________________________________________________________________________
254  // Output
255 
256  out_hits.insert(out_hits.end(), inclusive_conv_hits.begin(), inclusive_conv_hits.end());
257  out_tracks.insert(out_tracks.end(), best_tracks.begin(), best_tracks.end());
258 
259  return;
260 }

References l1GtPatternGenerator_cfi::bx, looper::cfg, PrimitiveSelection::configure(), AngleCalculation::configure(), BestTrackSelection::configure(), SingleHitTrack::configure(), PrimitiveConversion::configure(), PrimitiveMatching::configure(), PtAssignment::configure(), PatternRecognition::configure(), endcap_, EMTFSetup::getGeometryTranslator(), EMTFSetup::getPtAssignmentEngine(), EMTFSetup::getPtAssignmentEngineDxy(), EMTFSetup::getSectorProcessorLUT(), EMTFSetup::getVersionControl(), PrimitiveSelection::merge(), PrimitiveSelection::merge_no_truncate(), SingleHitTrack::process(), BestTrackSelection::process(), AngleCalculation::process(), PrimitiveMatching::process(), PrimitiveSelection::process(), PatternRecognition::process(), PtAssignment::process(), PrimitiveConversion::process(), sector_, setup_, and verbose_.

Referenced by process().

Member Data Documentation

◆ endcap_

int SectorProcessor::endcap_
private

Definition at line 55 of file SectorProcessor.h.

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

◆ sector_

int SectorProcessor::sector_
private

Definition at line 55 of file SectorProcessor.h.

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

◆ setup_

const EMTFSetup* SectorProcessor::setup_
private

◆ verbose_

int SectorProcessor::verbose_
private

Definition at line 55 of file SectorProcessor.h.

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

SingleHitTrack
Definition: SingleHitTrack.h:6
PrimitiveMatching
Definition: PrimitiveMatching.h:6
emtf::CSCTag
Definition: EMTFSubsystemTag.h:31
PatternRecognition::configure
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)
Definition: PatternRecognition.cc:12
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
SectorProcessor::sector_
int sector_
Definition: SectorProcessor.h:55
emtf::MIN_TRIGSECTOR
constexpr int MIN_TRIGSECTOR
Definition: Common.h:49
EMTFSetup::getVersionControl
const VersionControl & getVersionControl() const
Definition: EMTFSetup.h:33
EMTFSetup::getSectorProcessorLUT
const SectorProcessorLUT & getSectorProcessorLUT() const
Definition: EMTFSetup.h:35
emtf::GEMTag
Definition: EMTFSubsystemTag.h:57
AngleCalculation
Definition: AngleCalculation.h:6
PatternRecognition
Definition: PatternRecognition.h:7
AngleCalculation::process
void process(emtf::zone_array< EMTFTrackCollection > &zone_tracks) const
Definition: AngleCalculation.cc:35
gather_cfg.cout
cout
Definition: gather_cfg.py:144
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
PtAssignment::configure
void configure(PtAssignmentEngine *pt_assign_engine, PtAssignmentEngineDxy *pt_assign_engine_dxy, int verbose, int endcap, int sector, int bx, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt, bool bugGMTPhi, bool promoteMode7, int modeQualVer, std::string pbFileName)
Definition: PtAssignment.cc:6
emtf::MAX_ENDCAP
constexpr int MAX_ENDCAP
Definition: Common.h:46
SingleHitTrack::process
void process(const EMTFHitCollection &conv_hits, EMTFTrackCollection &best_tracks) const
Definition: SingleHitTrack.cc:14
PrimitiveConversion::process
void process(const std::map< int, TriggerPrimitiveCollection > &selected_prim_map, EMTFHitCollection &conv_hits) const
Definition: PrimitiveConversion.cc:53
PrimitiveConversion
Definition: PrimitiveConversion.h:8
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
PrimitiveSelection::process
void process(T tag, const TriggerPrimitiveCollection &muon_primitives, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
emtf::MAX_TRIGSECTOR
constexpr int MAX_TRIGSECTOR
Definition: Common.h:50
EMTFTrackCollection
l1t::EMTFTrackCollection EMTFTrackCollection
Definition: Common.h:27
EMTFSetup::getGeometryTranslator
const GeometryTranslator & getGeometryTranslator() const
Definition: EMTFSetup.h:29
BestTrackSelection::configure
void configure(int verbose, int endcap, int sector, int bx, int bxWindow, int maxRoadsPerZone, int maxTracks, bool useSecondEarliest, bool bugSameSectorPt0)
Definition: BestTrackSelection.cc:5
BestTrackSelection
Definition: BestTrackSelection.h:6
emtf::MIN_ENDCAP
constexpr int MIN_ENDCAP
Definition: Common.h:45
EMTFHitCollection
l1t::EMTFHitCollection EMTFHitCollection
Definition: Common.h:23
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
emtf::ME0Tag
Definition: EMTFSubsystemTag.h:62
SectorProcessor::setup_
const EMTFSetup * setup_
Definition: SectorProcessor.h:53
emtf::RPCTag
Definition: EMTFSubsystemTag.h:38
SectorProcessor::process_single_bx
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
Definition: SectorProcessor.cc:61
SectorProcessor::verbose_
int verbose_
Definition: SectorProcessor.h:55
SingleHitTrack::configure
void configure(int verbose, int endcap, int sector, int bx, int maxTracks, bool useSingleHits)
Definition: SingleHitTrack.cc:3
EMTFSetup::getPtAssignmentEngineDxy
PtAssignmentEngineDxy * getPtAssignmentEngineDxy() const
Definition: EMTFSetup.h:39
PrimitiveSelection
Definition: PrimitiveSelection.h:6
EMTFSetup::getPtAssignmentEngine
PtAssignmentEngine * getPtAssignmentEngine() const
Definition: EMTFSetup.h:37
PrimitiveConversion::configure
void configure(const GeometryTranslator *tp_geom, const SectorProcessorLUT *pc_lut, int verbose, int endcap, int sector, int bx, int bxShiftCSC, int bxShiftRPC, int bxShiftGEM, int bxShiftME0, const std::vector< int > &zoneBoundaries, int zoneOverlap, bool duplicateTheta, bool fixZonePhi, bool useNewZones, bool fixME11Edges, bool bugME11Dupes, bool useRun3CCLUT)
Definition: PrimitiveConversion.cc:7
emtf::DTTag
Definition: EMTFSubsystemTag.h:24
AngleCalculation::configure
void configure(int verbose, int endcap, int sector, int bx, int bxWindow, int thetaWindow, int thetaWindowZone0, bool bugME11Dupes, bool bugAmbigThetaWin, bool twoStationSameBX)
Definition: AngleCalculation.cc:12
looper.cfg
cfg
Definition: looper.py:296
PrimitiveMatching::configure
void configure(int verbose, int endcap, int sector, int bx, bool fixZonePhi, bool useNewZones, bool bugSt2PhDiff, bool bugME11Dupes)
Definition: PrimitiveMatching.cc:12
PtAssignment
Definition: PtAssignment.h:10
PrimitiveSelection::merge_no_truncate
void merge_no_truncate(const std::map< int, TriggerPrimitiveCollection > &selected_dt_map, const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, const std::map< int, TriggerPrimitiveCollection > &selected_me0_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
Definition: PrimitiveSelection.cc:562
PrimitiveSelection::merge
void merge(const std::map< int, TriggerPrimitiveCollection > &selected_dt_map, const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, const std::map< int, TriggerPrimitiveCollection > &selected_me0_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
Definition: PrimitiveSelection.cc:483
emtf_assert
#define emtf_assert(expr)
Definition: DebugTools.h:18
PtAssignment::process
void process(EMTFTrackCollection &best_tracks)
Definition: PtAssignment.cc:42
PrimitiveSelection::configure
void configure(int verbose, int endcap, int sector, int bx, int bxShiftCSC, int bxShiftRPC, int bxShiftGEM, int bxShiftME0, bool includeNeighbor, bool duplicateTheta, bool bugME11Dupes)
Definition: PrimitiveSelection.cc:18
emtf::zone_array
std::array< T, NUM_ZONES > zone_array
Definition: Common.h:65
BestTrackSelection::process
void process(const std::deque< EMTFTrackCollection > &extended_best_track_cands, EMTFTrackCollection &best_tracks) const
Definition: BestTrackSelection.cc:26
PrimitiveMatching::process
void process(const std::deque< EMTFHitCollection > &extended_conv_hits, const emtf::zone_array< EMTFRoadCollection > &zone_roads, emtf::zone_array< EMTFTrackCollection > &zone_tracks) const
Definition: PrimitiveMatching.cc:31
SectorProcessor::endcap_
int endcap_
Definition: SectorProcessor.h:55
PatternRecognition::process
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
Definition: PatternRecognition.cc:181