CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
CSCUpgradeCathodeLCTProcessor Class Reference

#include <CSCUpgradeCathodeLCTProcessor.h>

Inheritance diagram for CSCUpgradeCathodeLCTProcessor:
CSCCathodeLCTProcessor CSCBaseboard

Public Member Functions

 CSCUpgradeCathodeLCTProcessor ()
 
 CSCUpgradeCathodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
- Public Member Functions inherited from CSCCathodeLCTProcessor
void clear ()
 
 CSCCathodeLCTProcessor ()
 
 CSCCathodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
CSCCLCTDigi getBestCLCT (int bx) const
 
std::vector< CSCCLCTDigigetCLCTs (unsigned nMaxCLCTs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
 
CSCCLCTDigi getSecondCLCT (int bx) const
 
std::vector< int > preTriggerBXs () const
 
std::vector< CSCCLCTPreTriggerDigipreTriggerDigis () const
 
std::vector< CSCCLCTPreTriggerDigipreTriggerDigisME1a () const
 
std::vector< CSCCLCTPreTriggerDigipreTriggerDigisME1b () const
 
std::vector< CSCCLCTDigireadoutCLCTs (int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
 
std::vector< CSCCLCTDigireadoutCLCTsME1a (int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
 
std::vector< CSCCLCTDigireadoutCLCTsME1b (int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
 
std::vector< CSCCLCTDigirun (const CSCComparatorDigiCollection *compdc)
 
void run (const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard ()
 
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
std::string getCSCName () const
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCBaseboard ()=default
 

Protected Attributes

bool busyMap [CSCConstants::NUM_HALF_STRIPS_7CFEBS][CSCConstants::MAX_CLCT_TBINS]
 
- Protected Attributes inherited from CSCCathodeLCTProcessor
unsigned int best_pid [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
CSCCLCTDigi bestCLCT [CSCConstants::MAX_CLCT_TBINS]
 
CSCPatternBank::CLCTPatterns clct_pattern_ = {}
 
std::vector< CSCComparatorDigidigiV [CSCConstants::NUM_LAYERS]
 
unsigned int drift_delay
 
int early_tbins
 
unsigned int fifo_pretrig
 
unsigned int fifo_tbins
 
int first_bx_corrected [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
unsigned int hit_persist
 
PulseArray hitsCLCT [99]
 
bool ispretrig [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
unsigned int min_separation
 
unsigned int nhits [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
unsigned int nplanes_hit_pattern
 
unsigned int nplanes_hit_pretrig
 
int numStrips
 
unsigned int pid_thresh_pretrig
 
bool readout_earliest_2
 
CSCCLCTDigi secondCLCT [CSCConstants::MAX_CLCT_TBINS]
 
int stagger [CSCConstants::NUM_LAYERS]
 
int start_bx_shift
 
std::vector< int > thePreTriggerBXs
 
std::vector< CSCCLCTPreTriggerDigithePreTriggerDigis
 
unsigned int tmb_l1a_window_size
 
bool use_comparator_codes_
 
bool use_run3_patterns_
 
- Protected Attributes inherited from CSCBaseboard
unsigned int alctClctOffset_
 
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctSLHC_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isME21_
 
bool isSLHC_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
unsigned theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 

Private Member Functions

std::vector< CSCCLCTDigifindLCTs (const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]) override
 
bool preTrigger (const PulseArray pulse, const int start_bx, int &first_bx) override
 

Private Attributes

unsigned int clct_state_machine_zone
 
bool dynamic_state_machine_zone
 
unsigned int pretrig_trig_zone
 
bool use_corrected_bx
 
bool use_dead_time_zoning
 

Additional Inherited Members

- Protected Types inherited from CSCCathodeLCTProcessor
enum  CLCT_CompCode { INVALID_HALFSTRIP = 65535 }
 
enum  CLCT_INDICES {
  CLCT_PATTERN, CLCT_BEND, CLCT_STRIP, CLCT_BX,
  CLCT_STRIP_TYPE, CLCT_QUALITY, CLCT_CFEB, CLCT_NUM_QUANTITIES = 7
}
 
typedef unsigned int PulseArray[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
- Protected Member Functions inherited from CSCCathodeLCTProcessor
void checkConfigParameters ()
 
void checkValid (const CSCCLCTDigi &lct, unsigned max_stubs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
 
void cleanComparatorContainer (CSCCLCTDigi::ComparatorContainer &compHits) const
 
void dumpConfigParams () const
 
void dumpDigis (const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips) const
 
bool getDigis (const CSCComparatorDigiCollection *compdc)
 
void getDigis (const CSCComparatorDigiCollection *compdc, const CSCDetId &id)
 
void markBusyKeys (const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
bool patternFinding (const PulseArray pulse, const int nStrips, const unsigned int bx_time, std::map< int, std::map< int, CSCCLCTDigi::ComparatorContainer > > &hits_in_patterns)
 
void pulseExtension (const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, PulseArray pulse)
 
void readComparatorDigis (std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void setDefaultConfigParameters ()
 
- Protected Member Functions inherited from CSCBaseboard
void checkConfigParameters (unsigned int &var, const unsigned int var_max, const unsigned int var_def, const std::string &var_str)
 
- Static Protected Attributes inherited from CSCCathodeLCTProcessor
static const unsigned int def_drift_delay = 2
 
static const unsigned int def_fifo_pretrig = 7
 
static const unsigned int def_fifo_tbins = 12
 
static const unsigned int def_hit_persist = 6
 
static const unsigned int def_min_separation = 10
 
static const unsigned int def_nplanes_hit_pattern = 4
 
static const unsigned int def_nplanes_hit_pretrig = 2
 
static const unsigned int def_pid_thresh_pretrig = 2
 
static const unsigned int def_tmb_l1a_window_size = 7
 

Detailed Description

This class simulates the functionality of the cathode LCT card. It is run by the MotherBoard and returns up to two CathodeLCTs. It can be run either in a test mode, where it is passed arrays of halfstrip times, or in normal mode where it determines the time and comparator information from the comparator digis.

Updates for high pileup running by Vadim Khotilovich (TAMU), December 2012

Updates for integrated local trigger with GEMs by Sven Dildick (TAMU) and Tao Huang (TAMU), April 2015

Removing usage of outdated class CSCTriggerGeometry by Sven Dildick (TAMU)

Definition at line 24 of file CSCUpgradeCathodeLCTProcessor.h.

Constructor & Destructor Documentation

◆ CSCUpgradeCathodeLCTProcessor() [1/2]

CSCUpgradeCathodeLCTProcessor::CSCUpgradeCathodeLCTProcessor ( unsigned  endcap,
unsigned  station,
unsigned  sector,
unsigned  subsector,
unsigned  chamber,
const edm::ParameterSet conf 
)

Normal constructor.

Definition at line 6 of file CSCUpgradeCathodeLCTProcessor.cc.

12  : CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, conf) {
13  if (!isSLHC_)
14  edm::LogError("CSCUpgradeCathodeLCTProcessor|ConfigError")
15  << "+++ Upgrade CSCUpgradeCathodeLCTProcessor constructed while isSLHC_ is not set! +++\n";
16 
17  // use of localized dead-time zones
18  use_dead_time_zoning = clctParams_.getParameter<bool>("useDeadTimeZoning");
19  clct_state_machine_zone = clctParams_.getParameter<unsigned int>("clctStateMachineZone");
20  dynamic_state_machine_zone = clctParams_.getParameter<bool>("useDynamicStateMachineZone");
21 
22  // how far away may trigger happen from pretrigger
23  pretrig_trig_zone = clctParams_.getParameter<unsigned int>("clctPretriggerTriggerZone");
24 
25  // whether to calculate bx as corrected_bx instead of pretrigger one
26  use_corrected_bx = clctParams_.getParameter<bool>("clctUseCorrectedBx");
27 }

References clct_state_machine_zone, CSCBaseboard::clctParams_, dynamic_state_machine_zone, edm::ParameterSet::getParameter(), CSCBaseboard::isSLHC_, pretrig_trig_zone, use_corrected_bx, and use_dead_time_zoning.

◆ CSCUpgradeCathodeLCTProcessor() [2/2]

CSCUpgradeCathodeLCTProcessor::CSCUpgradeCathodeLCTProcessor ( )

Default constructor. Used for testing.

Definition at line 29 of file CSCUpgradeCathodeLCTProcessor.cc.

30  if (!isSLHC_)
31  edm::LogError("CSCUpgradeCathodeLCTProcessor|ConfigError")
32  << "+++ Upgrade CSCUpgradeCathodeLCTProcessor constructed while isSLHC_ is not set! +++\n";
33 }

References CSCBaseboard::isSLHC_.

Member Function Documentation

◆ findLCTs()

std::vector< CSCCLCTDigi > CSCUpgradeCathodeLCTProcessor::findLCTs ( const std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
overrideprivatevirtual

busyMap[hstrip][latch_bx] )

busyMap[hstrip][latch_bx] )

Reimplemented from CSCCathodeLCTProcessor.

Definition at line 141 of file CSCUpgradeCathodeLCTProcessor.cc.

142  {
143  // run the original algorithm in case we do not use dead time zoning
144  if (isSLHC_ and !use_dead_time_zoning) {
145  return CSCCathodeLCTProcessor::findLCTs(halfstrip);
146  }
147 
148  std::vector<CSCCLCTDigi> lctList;
149 
150  // Max. number of half-strips for this chamber.
151  const int maxHalfStrips = 2 * numStrips + 1;
152 
153  // initialize the ispretrig before doing pretriggering
154  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
155  ispretrig[hstrip] = false;
156  }
157 
158  if (infoV > 1)
159  dumpDigis(halfstrip, maxHalfStrips);
160 
161  // keeps dead-time zones around key halfstrips of triggered CLCTs
162  for (int i = 0; i < CSCConstants::NUM_HALF_STRIPS_7CFEBS; i++) {
163  for (int j = 0; j < CSCConstants::MAX_CLCT_TBINS; j++) {
164  busyMap[i][j] = false;
165  }
166  }
167 
168  std::vector<CSCCLCTDigi> lctListBX;
169 
171 
172  // Fire half-strip one-shots for hit_persist bx's (4 bx's by default).
173  pulseExtension(halfstrip, maxHalfStrips, pulse);
174 
175  unsigned int start_bx = start_bx_shift;
176  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
177  // not have a full set of hits to start pattern search anyway.
178  unsigned int stop_bx = fifo_tbins - drift_delay;
179 
180  // Allow for more than one pass over the hits in the time window.
181  // Do search in every BX
182  while (start_bx < stop_bx) {
183  lctListBX.clear();
184 
185  // All half-strip pattern envelopes are evaluated simultaneously, on every clock cycle.
186  int first_bx = 999;
187  bool pre_trig = CSCUpgradeCathodeLCTProcessor::preTrigger(pulse, start_bx, first_bx);
188 
189  // If any of half-strip envelopes has enough layers hit in it, TMB
190  // will pre-trigger.
191  if (pre_trig) {
192  if (infoV > 1)
193  LogTrace("CSCUpgradeCathodeLCTProcessor")
194  << "..... pretrigger at bx = " << first_bx << "; waiting drift delay .....";
195 
196  // TMB latches LCTs drift_delay clocks after pretrigger.
197  int latch_bx = first_bx + drift_delay;
198 
199  std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer> > hits_in_patterns;
200  hits_in_patterns.clear();
201 
202  bool hits_in_time = patternFinding(pulse, maxHalfStrips, latch_bx, hits_in_patterns);
203  if (infoV > 1) {
204  if (hits_in_time) {
205  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
206  if (nhits[hstrip] > 0) {
207  LogTrace("CSCUpgradeCathodeLCTProcessor")
208  << " bx = " << std::setw(2) << latch_bx << " --->"
209  << " halfstrip = " << std::setw(3) << hstrip << " best pid = " << std::setw(2) << best_pid[hstrip]
210  << " nhits = " << nhits[hstrip];
211  }
212  }
213  }
214  }
215 
216  // 2 possible LCTs per CSC x 7 LCT quantities per BX
218 
219  // Quality for sorting.
222  for (int ilct = 0; ilct < CSCConstants::MAX_CLCTS_PER_PROCESSOR; ilct++) {
223  best_halfstrip[ilct] = -1;
224  best_quality[ilct] = 0;
225  }
226 
227  bool pretrig_zone[CSCConstants::NUM_HALF_STRIPS_7CFEBS];
228 
229  // Calculate quality from pattern id and number of hits, and
230  // simultaneously select best-quality LCT.
231  if (hits_in_time) {
232  // first, mark half-strip zones around pretriggers
233  // that happened at the current first_bx
234  for (int hstrip = 0; hstrip < CSCConstants::NUM_HALF_STRIPS_7CFEBS; hstrip++)
235  pretrig_zone[hstrip] = false;
236  for (int hstrip = 0; hstrip < CSCConstants::NUM_HALF_STRIPS_7CFEBS; hstrip++) {
237  if (ispretrig[hstrip]) {
238  int min_hs = hstrip - pretrig_trig_zone;
239  int max_hs = hstrip + pretrig_trig_zone;
240  if (min_hs < 0)
241  min_hs = 0;
242  if (max_hs > CSCConstants::NUM_HALF_STRIPS_7CFEBS - 1)
244  for (int hs = min_hs; hs <= max_hs; hs++)
245  pretrig_zone[hs] = true;
246  if (infoV > 1)
247  LogTrace("CSCUpgradeCathodeLCTProcessor")
248  << " marked pretrigger halfstrip zone [" << min_hs << "," << max_hs << "]";
249  }
250  }
251 
252  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
253  // The bend-direction bit pid[0] is ignored (left and right bends have equal quality).
254  quality[hstrip] = (best_pid[hstrip] & 14) | (nhits[hstrip] << 5);
255  // do not consider halfstrips:
256  // - out of pretrigger-trigger zones
257  // - in busy zones from previous trigger
258  if (quality[hstrip] > best_quality[0] && pretrig_zone[hstrip] && !busyMap[hstrip][first_bx])
260  {
261  best_halfstrip[0] = hstrip;
262  best_quality[0] = quality[hstrip];
263  if (infoV > 1) {
264  LogTrace("CSCUpgradeCathodeLCTProcessor")
265  << " 1st CLCT: halfstrip = " << std::setw(3) << hstrip << " quality = " << std::setw(3)
266  << quality[hstrip] << " best halfstrip = " << std::setw(3) << best_halfstrip[0]
267  << " best quality = " << std::setw(3) << best_quality[0];
268  }
269  }
270  }
271  }
272 
273  // If 1st best CLCT is found, look for the 2nd best.
274  if (best_halfstrip[0] >= 0) {
275  // Mark keys near best CLCT as busy by setting their quality to zero, and repeat the search.
276  markBusyKeys(best_halfstrip[0], best_pid[best_halfstrip[0]], quality);
277 
278  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
279  if (quality[hstrip] > best_quality[1] && pretrig_zone[hstrip] && !busyMap[hstrip][first_bx])
281  {
282  best_halfstrip[1] = hstrip;
283  best_quality[1] = quality[hstrip];
284  if (infoV > 1) {
285  LogTrace("CSCUpgradeCathodeLCTProcessor")
286  << " 2nd CLCT: halfstrip = " << std::setw(3) << hstrip << " quality = " << std::setw(3)
287  << quality[hstrip] << " best halfstrip = " << std::setw(3) << best_halfstrip[1]
288  << " best quality = " << std::setw(3) << best_quality[1];
289  }
290  }
291  }
292 
293  // Pattern finder.
294  //bool ptn_trig = false;
295  for (int ilct = 0; ilct < CSCConstants::MAX_CLCTS_PER_PROCESSOR; ilct++) {
296  int best_hs = best_halfstrip[ilct];
297  if (best_hs >= 0 && nhits[best_hs] >= nplanes_hit_pattern) {
298  int bx = first_bx;
299  int fbx = first_bx_corrected[best_hs];
300  if (use_corrected_bx) {
301  bx = fbx;
302  fbx = first_bx;
303  }
304  //ptn_trig = true;
305  keystrip_data[ilct][CLCT_PATTERN] = best_pid[best_hs];
306  keystrip_data[ilct][CLCT_BEND] =
308  // Remove stagger if any.
309  keystrip_data[ilct][CLCT_STRIP] = best_hs - stagger[CSCConstants::KEY_CLCT_LAYER - 1];
310  keystrip_data[ilct][CLCT_BX] = bx;
311  keystrip_data[ilct][CLCT_STRIP_TYPE] = 1; // obsolete
312  keystrip_data[ilct][CLCT_QUALITY] = nhits[best_hs];
313  keystrip_data[ilct][CLCT_CFEB] = keystrip_data[ilct][CLCT_STRIP] / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
314  int halfstrip_in_cfeb = keystrip_data[ilct][CLCT_STRIP] -
315  CSCConstants::NUM_HALF_STRIPS_PER_CFEB * keystrip_data[ilct][CLCT_CFEB];
316 
317  CSCCLCTDigi thisLCT(1,
318  keystrip_data[ilct][CLCT_QUALITY],
319  keystrip_data[ilct][CLCT_PATTERN],
320  keystrip_data[ilct][CLCT_STRIP_TYPE],
321  keystrip_data[ilct][CLCT_BEND],
322  halfstrip_in_cfeb,
323  keystrip_data[ilct][CLCT_CFEB],
324  keystrip_data[ilct][CLCT_BX]);
325  if (infoV > 1) {
326  LogTrace("CSCCathodeLCTProcessor") << " Final selection: ilct " << ilct << " " << thisLCT << std::endl;
327  }
328  thisLCT.setFullBX(fbx);
329 
330  // get the comparator hits for this pattern
331  auto compHits = hits_in_patterns[best_hs][keystrip_data[ilct][CLCT_PATTERN]];
332 
333  // purge the comparator digi collection from the obsolete "65535" entries...
334  cleanComparatorContainer(compHits);
335 
336  // set the hit collection
337  thisLCT.setHits(compHits);
338 
339  // put the CLCT into the collection
340  lctList.push_back(thisLCT);
341  lctListBX.push_back(thisLCT);
342  }
343  }
344 
345  } //find CLCT, end of best_halfstrip[0] >= 0
346  } //pre_trig
347  // The pattern finder runs continuously, so another pre-trigger
348  // could occur already at the next bx.
349  start_bx = first_bx + 1;
350  }
351 
352  return lctList;
353 } // findLCTs -- SLHC version.

References CSCCathodeLCTProcessor::best_pid, busyMap, l1GtPatternGenerator_cfi::bx, CSCCathodeLCTProcessor::CLCT_BEND, CSCCathodeLCTProcessor::CLCT_BX, CSCCathodeLCTProcessor::CLCT_CFEB, CSCCathodeLCTProcessor::CLCT_NUM_QUANTITIES, CSCCathodeLCTProcessor::CLCT_PATTERN, CSCCathodeLCTProcessor::clct_pattern_, CSCConstants::CLCT_PATTERN_WIDTH, CSCCathodeLCTProcessor::CLCT_QUALITY, CSCCathodeLCTProcessor::CLCT_STRIP, CSCCathodeLCTProcessor::CLCT_STRIP_TYPE, CSCCathodeLCTProcessor::cleanComparatorContainer(), CSCCathodeLCTProcessor::drift_delay, CSCCathodeLCTProcessor::dumpDigis(), CSCCathodeLCTProcessor::fifo_tbins, CSCCathodeLCTProcessor::findLCTs(), CSCCathodeLCTProcessor::first_bx_corrected, mps_fire::i, CSCBaseboard::infoV, CSCCathodeLCTProcessor::ispretrig, CSCBaseboard::isSLHC_, dqmiolumiharvest::j, CSCConstants::KEY_CLCT_LAYER, LogTrace, CSCCathodeLCTProcessor::markBusyKeys(), CSCConstants::MAX_CLCT_TBINS, CSCConstants::MAX_CLCTS_PER_PROCESSOR, CSCCathodeLCTProcessor::nhits, CSCCathodeLCTProcessor::nplanes_hit_pattern, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_HALF_STRIPS_PER_CFEB, CSCConstants::NUM_LAYERS, CSCCathodeLCTProcessor::numStrips, CSCCathodeLCTProcessor::patternFinding(), pretrig_trig_zone, preTrigger(), pulse(), CSCCathodeLCTProcessor::pulseExtension(), qcdUeDQM_cfi::quality, CSCCLCTDigi::setFullBX(), CSCCLCTDigi::setHits(), CSCCathodeLCTProcessor::stagger, CSCCathodeLCTProcessor::start_bx_shift, use_corrected_bx, and use_dead_time_zoning.

◆ preTrigger()

bool CSCUpgradeCathodeLCTProcessor::preTrigger ( const PulseArray  pulse,
const int  start_bx,
int &  first_bx 
)
overrideprivatevirtual

Reimplemented from CSCCathodeLCTProcessor.

Definition at line 40 of file CSCUpgradeCathodeLCTProcessor.cc.

40  {
41  if (isSLHC_ and !use_dead_time_zoning) {
42  return CSCCathodeLCTProcessor::preTrigger(pulse, start_bx, first_bx);
43  }
44 
45  if (infoV > 1)
46  LogTrace("CSCUpgradeCathodeLCTProcessor")
47  << "....................PreTrigger, SLHC version with localized dead time zone...........................";
48 
49  // Max. number of half-strips for this chamber.
50  const int nStrips = 2 * numStrips + 1;
51 
52  int nPreTriggers = 0;
53 
54  bool pre_trig = false;
55  int delta_hs = clct_state_machine_zone; //dead time zone
56 
57  // Now do a loop over bx times to see (if/when) track goes over threshold
58  for (unsigned int bx_time = start_bx; bx_time < fifo_tbins; bx_time++) {
59  // For any given bunch-crossing, start at the lowest keystrip and look for
60  // the number of separate layers in the pattern for that keystrip that have
61  // pulses at that bunch-crossing time. Do the same for the next keystrip,
62  // etc. Then do the entire process again for the next bunch-crossing, etc
63  // until you find a pre-trigger.
64  std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer> > hits_in_patterns;
65  hits_in_patterns.clear();
66 
67  bool hits_in_time = patternFinding(pulse, nStrips, bx_time, hits_in_patterns);
68  if (hits_in_time) {
69  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < nStrips; hstrip++) {
70  if (infoV > 1) {
71  if (nhits[hstrip] > 0) {
72  LogTrace("CSCUpgradeCathodeLCTProcessor")
73  << " bx = " << std::setw(2) << bx_time << " --->"
74  << " halfstrip = " << std::setw(3) << hstrip << " best pid = " << std::setw(2) << best_pid[hstrip]
75  << " nhits = " << nhits[hstrip];
76  }
77  }
78  //ispretrig[hstrip] = false; it is initialzed in findLCT
79  if (nhits[hstrip] >= nplanes_hit_pretrig && best_pid[hstrip] >= pid_thresh_pretrig &&
80  !busyMap[hstrip][bx_time]) {
81  pre_trig = true;
82  ispretrig[hstrip] = true;
83 
84  // write each pre-trigger to output
85  nPreTriggers++;
86  const int bend =
88  const int halfstrip = hstrip % CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
89  const int cfeb = hstrip / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
91  1, nhits[hstrip], best_pid[hstrip], 1, bend, halfstrip, cfeb, bx_time, nPreTriggers, 0));
92 
93  } else if (nhits[hstrip] >= nplanes_hit_pretrig &&
94  best_pid[hstrip] >= pid_thresh_pretrig) { //busy zone, keep pretriggering,ignore this
95  ispretrig[hstrip] = true;
96  if (infoV > 1)
97  LogTrace("CSCUpgradeCathodeLCTProcessor")
98  << " halfstrip " << std::setw(3) << hstrip << " in dead zone and is pretriggerred";
99  } else if (nhits[hstrip] < nplanes_hit_pretrig || best_pid[hstrip] < pid_thresh_pretrig) {
100  // not pretriggered anyone, release dead zone
101  ispretrig[hstrip] = false;
102  }
103  } // find all pretriggers
104 
105  //update dead zone
106  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < nStrips; hstrip++) {
107  if (ispretrig[hstrip]) {
108  int min_hstrip = hstrip - delta_hs; //only fixed localized dead time zone is implemented
109  int max_hstrip = hstrip + delta_hs;
110  if (min_hstrip < stagger[CSCConstants::KEY_CLCT_LAYER - 1])
111  min_hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1];
112  if (max_hstrip >= nStrips)
113  max_hstrip = nStrips - 1;
114  for (int hs = min_hstrip; hs <= max_hstrip; hs++)
115  busyMap[hs][bx_time + 1] = true;
116  if (infoV > 1)
117  LogTrace("CSCUpgradeCathodeLCTProcessor")
118  << " marked zone around pretriggerred halfstrip " << hstrip << " as dead zone for pretriggering at bx"
119  << bx_time + 1 << " halfstrip: [" << min_hstrip << "," << max_hstrip << "]";
120  }
121  }
122  if (pre_trig) {
123  first_bx = bx_time; // bx at time of pretrigger
124  return true;
125  }
126  } else //no pattern found, remove all dead time zone
127  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < nStrips; hstrip++) {
128  if (ispretrig[hstrip])
129  ispretrig[hstrip] = false; //dead zone is gone by default
130  }
131 
132  } // end loop over bx times
133 
134  if (infoV > 1)
135  LogTrace("CSCUpgradeCathodeLCTProcessor") << "no pretrigger, returning \n";
136  first_bx = fifo_tbins;
137  return false;
138 } // preTrigger -- SLHC version.

References trklet::bend(), CSCCathodeLCTProcessor::best_pid, busyMap, CSCCathodeLCTProcessor::clct_pattern_, CSCConstants::CLCT_PATTERN_WIDTH, clct_state_machine_zone, CSCCathodeLCTProcessor::fifo_tbins, CSCBaseboard::infoV, CSCCathodeLCTProcessor::ispretrig, CSCBaseboard::isSLHC_, CSCConstants::KEY_CLCT_LAYER, LogTrace, CSCCathodeLCTProcessor::nhits, CSCCathodeLCTProcessor::nplanes_hit_pretrig, me0TriggerPseudoDigis_cff::nStrips, CSCConstants::NUM_HALF_STRIPS_PER_CFEB, CSCConstants::NUM_LAYERS, CSCCathodeLCTProcessor::numStrips, CSCCathodeLCTProcessor::patternFinding(), CSCCathodeLCTProcessor::pid_thresh_pretrig, CSCCathodeLCTProcessor::preTrigger(), pulse(), CSCCathodeLCTProcessor::stagger, CSCCathodeLCTProcessor::thePreTriggerDigis, and use_dead_time_zoning.

Referenced by findLCTs().

Member Data Documentation

◆ busyMap

bool CSCUpgradeCathodeLCTProcessor::busyMap[CSCConstants::NUM_HALF_STRIPS_7CFEBS][CSCConstants::MAX_CLCT_TBINS]
protected

Definition at line 39 of file CSCUpgradeCathodeLCTProcessor.h.

Referenced by findLCTs(), and preTrigger().

◆ clct_state_machine_zone

unsigned int CSCUpgradeCathodeLCTProcessor::clct_state_machine_zone
private

Definition at line 44 of file CSCUpgradeCathodeLCTProcessor.h.

Referenced by CSCUpgradeCathodeLCTProcessor(), and preTrigger().

◆ dynamic_state_machine_zone

bool CSCUpgradeCathodeLCTProcessor::dynamic_state_machine_zone
private

Definition at line 45 of file CSCUpgradeCathodeLCTProcessor.h.

Referenced by CSCUpgradeCathodeLCTProcessor().

◆ pretrig_trig_zone

unsigned int CSCUpgradeCathodeLCTProcessor::pretrig_trig_zone
private

VK: allow triggers only in +-pretrig_trig_zone around pretriggers

Definition at line 48 of file CSCUpgradeCathodeLCTProcessor.h.

Referenced by CSCUpgradeCathodeLCTProcessor(), and findLCTs().

◆ use_corrected_bx

bool CSCUpgradeCathodeLCTProcessor::use_corrected_bx
private

VK: whether to use corrected_bx instead of pretrigger BX

Definition at line 51 of file CSCUpgradeCathodeLCTProcessor.h.

Referenced by CSCUpgradeCathodeLCTProcessor(), and findLCTs().

◆ use_dead_time_zoning

bool CSCUpgradeCathodeLCTProcessor::use_dead_time_zoning
private

VK: use of localized dead-time zones

Definition at line 43 of file CSCUpgradeCathodeLCTProcessor.h.

Referenced by CSCUpgradeCathodeLCTProcessor(), findLCTs(), and preTrigger().

CSCCathodeLCTProcessor::markBusyKeys
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
Definition: CSCCathodeLCTProcessor.cc:990
mps_fire.i
i
Definition: mps_fire.py:355
CSCBaseboard::clctParams_
edm::ParameterSet clctParams_
Definition: CSCBaseboard.h:77
CSCCathodeLCTProcessor::stagger
int stagger[CSCConstants::NUM_LAYERS]
Definition: CSCCathodeLCTProcessor.h:180
CSCUpgradeCathodeLCTProcessor::pretrig_trig_zone
unsigned int pretrig_trig_zone
Definition: CSCUpgradeCathodeLCTProcessor.h:48
CSCBaseboard::isSLHC_
bool isSLHC_
Definition: CSCBaseboard.h:83
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCUpgradeCathodeLCTProcessor::dynamic_state_machine_zone
bool dynamic_state_machine_zone
Definition: CSCUpgradeCathodeLCTProcessor.h:45
CSCCathodeLCTProcessor::fifo_tbins
unsigned int fifo_tbins
Definition: CSCCathodeLCTProcessor.h:187
CSCCathodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips) const
Definition: CSCCathodeLCTProcessor.cc:1034
CSCUpgradeCathodeLCTProcessor::preTrigger
bool preTrigger(const PulseArray pulse, const int start_bx, int &first_bx) override
Definition: CSCUpgradeCathodeLCTProcessor.cc:40
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
pulse
double pulse(double x, double y, double z, double t)
Definition: SiStripPulseShape.cc:49
CSCCathodeLCTProcessor::CLCT_PATTERN
Definition: CSCCathodeLCTProcessor.h:166
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCConstants::MAX_CLCTS_PER_PROCESSOR
Definition: CSCConstants.h:67
CSCUpgradeCathodeLCTProcessor::busyMap
bool busyMap[CSCConstants::NUM_HALF_STRIPS_7CFEBS][CSCConstants::MAX_CLCT_TBINS]
Definition: CSCUpgradeCathodeLCTProcessor.h:39
CSCCathodeLCTProcessor::thePreTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCCathodeLCTProcessor.h:184
CSCCathodeLCTProcessor::pulseExtension
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, PulseArray pulse)
Definition: CSCCathodeLCTProcessor.cc:735
CSCCathodeLCTProcessor::ispretrig
bool ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:158
CSCCathodeLCTProcessor::findLCTs
virtual std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
Definition: CSCCathodeLCTProcessor.cc:523
CSCUpgradeCathodeLCTProcessor::use_dead_time_zoning
bool use_dead_time_zoning
Definition: CSCUpgradeCathodeLCTProcessor.h:43
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:46
CSCCathodeLCTProcessor::first_bx_corrected
int first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:155
CSCCLCTPreTriggerDigi
Definition: CSCCLCTPreTriggerDigi.h:15
CSCCathodeLCTProcessor::preTrigger
virtual bool preTrigger(const PulseArray pulse, const int start_bx, int &first_bx)
Definition: CSCCathodeLCTProcessor.cc:781
CSCCathodeLCTProcessor::nhits
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:153
CSCCathodeLCTProcessor::numStrips
int numStrips
Definition: CSCCathodeLCTProcessor.h:177
CSCCathodeLCTProcessor::CLCT_CFEB
Definition: CSCCathodeLCTProcessor.h:172
CSCCathodeLCTProcessor::CLCT_STRIP
Definition: CSCCathodeLCTProcessor.h:168
edm::LogError
Definition: MessageLogger.h:183
CSCCathodeLCTProcessor::CLCT_BEND
Definition: CSCCathodeLCTProcessor.h:167
CSCCathodeLCTProcessor::CLCT_QUALITY
Definition: CSCCathodeLCTProcessor.h:171
CSCUpgradeCathodeLCTProcessor::clct_state_machine_zone
unsigned int clct_state_machine_zone
Definition: CSCUpgradeCathodeLCTProcessor.h:44
CSCCathodeLCTProcessor::pid_thresh_pretrig
unsigned int pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:190
me0TriggerPseudoDigis_cff.nStrips
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
Definition: me0TriggerPseudoDigis_cff.py:26
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CSCCathodeLCTProcessor::best_pid
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:150
CSCCathodeLCTProcessor::start_bx_shift
int start_bx_shift
Definition: CSCCathodeLCTProcessor.h:194
CSCCathodeLCTProcessor::clct_pattern_
CSCPatternBank::CLCTPatterns clct_pattern_
Definition: CSCCathodeLCTProcessor.h:161
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
CSCCathodeLCTProcessor::CSCCathodeLCTProcessor
CSCCathodeLCTProcessor()
Definition: CSCCathodeLCTProcessor.cc:91
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
CSCUpgradeCathodeLCTProcessor::use_corrected_bx
bool use_corrected_bx
Definition: CSCUpgradeCathodeLCTProcessor.h:51
CSCCathodeLCTProcessor::patternFinding
bool patternFinding(const PulseArray pulse, const int nStrips, const unsigned int bx_time, std::map< int, std::map< int, CSCCLCTDigi::ComparatorContainer > > &hits_in_patterns)
Definition: CSCCathodeLCTProcessor.cc:843
CSCCathodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCCathodeLCTProcessor.h:189
CSCConstants::KEY_CLCT_LAYER
Definition: CSCConstants.h:46
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:61
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCConstants::NUM_HALF_STRIPS_7CFEBS
Definition: CSCConstants.h:28
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
CSCConstants::CLCT_PATTERN_WIDTH
Definition: CSCConstants.h:52
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CSCConstants::NUM_HALF_STRIPS_PER_CFEB
Definition: CSCConstants.h:32
CSCCathodeLCTProcessor::CLCT_STRIP_TYPE
Definition: CSCCathodeLCTProcessor.h:170
CSCCathodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCCathodeLCTProcessor.h:188
CSCCathodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:189
CSCCathodeLCTProcessor::CLCT_BX
Definition: CSCCathodeLCTProcessor.h:169
CSCCathodeLCTProcessor::cleanComparatorContainer
void cleanComparatorContainer(CSCCLCTDigi::ComparatorContainer &compHits) const
Definition: CSCCathodeLCTProcessor.cc:1003
CSCCathodeLCTProcessor::CLCT_NUM_QUANTITIES
Definition: CSCCathodeLCTProcessor.h:173
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:62