test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
CSCCathodeLCTProcessor Class Reference

#include <CSCCathodeLCTProcessor.h>

Public Types

enum  { MAX_CLCT_BINS = 16 }
 
enum  { NUM_PATTERN_STRIPS = 26 }
 
enum  { NUM_PATTERN_HALFSTRIPS = 42 }
 
enum  { MAX_CFEBS = 5 }
 
enum  CLCT_INDICES {
  CLCT_PATTERN, CLCT_BEND, CLCT_STRIP, CLCT_BX,
  CLCT_STRIP_TYPE, CLCT_QUALITY, CLCT_CFEB
}
 

Public Member Functions

void clear ()
 
 CSCCathodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf, const edm::ParameterSet &comm, const edm::ParameterSet &ctmb)
 
 CSCCathodeLCTProcessor ()
 
std::vector< CSCCLCTDigigetCLCTs ()
 
bool getDigis (const CSCComparatorDigiCollection *compdc)
 
void getDigis (const CSCComparatorDigiCollection *compdc, const CSCDetId &id)
 
std::vector< int > preTriggerBXs () const
 
std::vector< CSCCLCTDigireadoutCLCTs ()
 
std::vector< CSCCLCTDigirun (const CSCComparatorDigiCollection *compdc)
 
void run (const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const std::vector< int > distrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setRing (unsigned r)
 

Static Public Member Functions

static void distripStagger (int stag_triad[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int stag_time[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int stag_digi[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int i_distrip, bool debug=false)
 

Public Attributes

CSCCLCTDigi bestCLCT [MAX_CLCT_BINS]
 
CSCCLCTDigi secondCLCT [MAX_CLCT_BINS]
 

Static Public Attributes

static const int pattern [CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07][NUM_PATTERN_STRIPS+1]
 
static const int pattern2007 [CSCConstants::NUM_CLCT_PATTERNS][NUM_PATTERN_HALFSTRIPS+2]
 
static const int pattern2007_offset [NUM_PATTERN_HALFSTRIPS]
 
static const int pre_hit_pattern [2][NUM_PATTERN_STRIPS]
 

Private Member Functions

void checkConfigParameters ()
 
void dumpConfigParams () const
 
void dumpDigis (const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips) const
 
std::vector< CSCCLCTDigifindLCTs (const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int stripType)
 
std::vector< CSCCLCTDigifindLCTs (const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const std::vector< int > distrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
std::vector< CSCCLCTDigifindLCTs (const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
std::vector< CSCCLCTDigifindLCTsSLHC (const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
int findNumLayersHit (std::vector< int > stripsHit[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void getKeyStripData (const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int keystrip_data[CSCConstants::NUM_HALF_STRIPS_7CFEBS][7], int nStrips, int first_bx, int &best_strip, int stripType)
 
void getKeyStripData (const unsigned int h_pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const unsigned int d_pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int keystrip_data[2][7], const int first_bx)
 
void getPattern (int pattern_num, int strip_value[NUM_PATTERN_STRIPS], int bx_time, int &quality, int &bend)
 
void getPattern (unsigned int pattern_num, const int strip_value[NUM_PATTERN_STRIPS], unsigned int &quality, unsigned int &bend)
 
bool hitIsGood (int hitTime, int BX)
 
void latchLCTs (const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int keyStrip[MAX_CFEBS], unsigned int nhits[MAX_CFEBS], const int stripType, const int nStrips, const int bx_time)
 
void markBusyKeys (const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
bool preTrigger (const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips, int &first_bx)
 
bool preTrigger (const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips, const int start_bx, int &first_bx)
 
bool preTrigger (const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int start_bx, int &first_bx)
 
bool preTrigLookUp (const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips, const unsigned int bx_time)
 
void printPatterns ()
 
void priorityEncode (const int h_keyStrip[MAX_CFEBS], const unsigned int h_nhits[MAX_CFEBS], const int d_keyStrip[MAX_CFEBS], const unsigned int d_nhits[MAX_CFEBS], int keystrip_data[2][7])
 
bool ptnFinding (const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, const unsigned int bx_time)
 
void pulseExtension (const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void readComparatorDigis (std::vector< int >halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], std::vector< int > distrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void readComparatorDigis (std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void setDefaultConfigParameters ()
 
void testDistripStagger ()
 
void testLCTs ()
 
void testPatterns ()
 

Private Attributes

unsigned int best_pid [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
unsigned int clct_state_machine_zone
 
std::vector< CSCComparatorDigidigiV [CSCConstants::NUM_LAYERS]
 
bool disableME1a
 
unsigned int drift_delay
 
bool dynamic_state_machine_zone
 
int early_tbins
 
unsigned int fifo_pretrig
 
unsigned int fifo_tbins
 
int first_bx_corrected [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
bool gangedME1a
 
unsigned int hit_persist
 
int infoV
 
bool isME11
 
bool isMTCC
 
bool ispretrig [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
bool isSLHC
 
bool isTMB07
 
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
 
unsigned int pretrig_trig_zone
 
bool readout_earliest_2
 
bool smartME1aME1b
 
int stagger [CSCConstants::NUM_LAYERS]
 
int start_bx_shift
 
unsigned int theChamber
 
const unsigned theEndcap
 
std::vector< int > thePreTriggerBXs
 
unsigned int theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
unsigned int tmb_l1a_window_size
 
bool use_corrected_bx
 
bool use_dead_time_zoning
 

Static Private Attributes

static const int cfeb_strips [2] = { 8, 32}
 
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 and distrip times, or in normal mode where it determines the time and comparator information from the comparator digis.

The CathodeLCTs come in distrip and halfstrip flavors; they are sorted (from best to worst) as follows: 6/6H, 5/6H, 6/6D, 4/6H, 5/6D, 4/6D.

Date
May 2001 Removed the card boundaries. Changed the Pretrigger to emulate the hardware electronic logic. Also changed the keylayer to be the 4th layer in a chamber instead of the 3rd layer from the interaction region. The code is a more realistic simulation of hardware LCT logic now. -Jason Mumford.
Author
Benn Tannenbaum UCLA 13 July 1999 benn@.nosp@m.phys.nosp@m.ics.u.nosp@m.cla..nosp@m.edu Numerous later improvements by Jason Mumford and Slava Valuev (see cvs in ORCA). Porting from ORCA by S. Valuev (Slava.nosp@m..Val.nosp@m.uev@c.nosp@m.ern..nosp@m.ch), May 2006.

Definition at line 37 of file CSCCathodeLCTProcessor.h.

Member Enumeration Documentation

anonymous enum

Maximum number of time bins.

Enumerator
MAX_CLCT_BINS 

Definition at line 70 of file CSCCathodeLCTProcessor.h.

anonymous enum

Pre-defined patterns.

Enumerator
NUM_PATTERN_STRIPS 

Definition at line 97 of file CSCCathodeLCTProcessor.h.

anonymous enum
Enumerator
NUM_PATTERN_HALFSTRIPS 

Definition at line 101 of file CSCCathodeLCTProcessor.h.

anonymous enum

Maximum number of cathode front-end boards (move to CSCConstants?).

Enumerator
MAX_CFEBS 

Definition at line 106 of file CSCCathodeLCTProcessor.h.

Constructor & Destructor Documentation

CSCCathodeLCTProcessor::CSCCathodeLCTProcessor ( unsigned  endcap,
unsigned  station,
unsigned  sector,
unsigned  subsector,
unsigned  chamber,
const edm::ParameterSet conf,
const edm::ParameterSet comm,
const edm::ParameterSet ctmb 
)

Normal constructor.

Definition at line 236 of file CSCCathodeLCTProcessor.cc.

References CSCTriggerNumbering::chamberFromTriggerLabels(), checkConfigParameters(), clct_state_machine_zone, disableME1a, drift_delay, dumpConfigParams(), dynamic_state_machine_zone, early_tbins, edm::ParameterSet::existsAs(), fifo_pretrig, fifo_tbins, gangedME1a, edm::ParameterSet::getParameter(), hit_persist, infoV, isME11, isMTCC, isSLHC, isTMB07, min_separation, nplanes_hit_pattern, nplanes_hit_pretrig, CSCConstants::NUM_LAYERS, numStrips, pid_thresh_pretrig, pretrig_trig_zone, readout_earliest_2, CSCTriggerNumbering::ringFromTriggerLabels(), smartME1aME1b, stagger, start_bx_shift, theChamber, theRing, theSector, theStation, theSubsector, theTrigChamber, tmb_l1a_window_size, use_corrected_bx, and use_dead_time_zoning.

243  :
245  theSubsector(subsector), theTrigChamber(chamber) {
246  static std::atomic<bool> config_dumped{false};
247 
248  // CLCT configuration parameters.
249  fifo_tbins = conf.getParameter<unsigned int>("clctFifoTbins");
250  hit_persist = conf.getParameter<unsigned int>("clctHitPersist");
251  drift_delay = conf.getParameter<unsigned int>("clctDriftDelay");
253  conf.getParameter<unsigned int>("clctNplanesHitPretrig");
255  conf.getParameter<unsigned int>("clctNplanesHitPattern");
256 
257  // Not used yet.
258  fifo_pretrig = conf.getParameter<unsigned int>("clctFifoPretrig");
259 
260  // Defines pre-2007 version of the CLCT algorithm used in test beams and
261  // MTCC.
262  isMTCC = comm.getParameter<bool>("isMTCC");
263 
264  // TMB07 firmware used since 2007: switch and config. parameters.
265  isTMB07 = comm.getParameter<bool>("isTMB07");
266 
267  // Flag for SLHC studies
268  isSLHC = comm.getParameter<bool>("isSLHC");
269 
270  // special configuration parameters for ME11 treatment
271  smartME1aME1b = comm.getParameter<bool>("smartME1aME1b");
272  disableME1a = comm.getParameter<bool>("disableME1a");
273  gangedME1a = comm.getParameter<bool>("gangedME1a");
274 
275  if (isSLHC && !smartME1aME1b) edm::LogError("L1CSCTPEmulatorConfigError")
276  << "+++ SLHC upgrade configuration is used (isSLHC=True) but smartME1aME1b=False!\n"
277  << "Only smartME1aME1b algorithm is so far supported for upgrade! +++\n";
278 
279  if (isTMB07) {
281  conf.getParameter<unsigned int>("clctPidThreshPretrig");
283  conf.getParameter<unsigned int>("clctMinSeparation");
284 
285  start_bx_shift = conf.getParameter<int>("clctStartBxShift");
286  }
287 
288  if (smartME1aME1b) {
289  // use of localized dead-time zones
290  use_dead_time_zoning = conf.existsAs<bool>("useDeadTimeZoning")?conf.getParameter<bool>("useDeadTimeZoning"):true;
291  clct_state_machine_zone = conf.existsAs<unsigned int>("clctStateMachineZone")?conf.getParameter<unsigned int>("clctStateMachineZone"):8;
292  dynamic_state_machine_zone = conf.existsAs<bool>("useDynamicStateMachineZone")?conf.getParameter<bool>("useDynamicStateMachineZone"):true;
293 
294  // how far away may trigger happen from pretrigger
295  pretrig_trig_zone = conf.existsAs<unsigned int>("clctPretriggerTriggerZone")?conf.getParameter<unsigned int>("clctPretriggerTriggerZone"):5;
296 
297  // whether to calculate bx as corrected_bx instead of pretrigger one
298  use_corrected_bx = conf.existsAs<bool>("clctUseCorrectedBx")?conf.getParameter<bool>("clctUseCorrectedBx"):true;
299  }
300 
301  // Motherboard parameters: common for all configurations.
302  tmb_l1a_window_size = // Common to CLCT and TMB
303  ctmb.getParameter<unsigned int>("tmbL1aWindowSize");
304 
305  // separate handle for early time bins
306  early_tbins = ctmb.getParameter<int>("tmbEarlyTbins");
307  static int fpga_latency = 3;
308  if (early_tbins<0) early_tbins = fifo_pretrig - fpga_latency;
309 
310  // wether to readout only the earliest two LCTs in readout window
311  readout_earliest_2 = ctmb.getParameter<bool>("tmbReadoutEarliest2");
312 
313  // Verbosity level, set to 0 (no print) by default.
314  infoV = conf.getParameter<int>("verbosity");
315 
316  // Check and print configuration parameters.
318  if ((infoV > 0 || isSLHC) && !config_dumped) {
319  //std::cerr<<"**** CLCT constructor parameters dump ****"<<std::endl;
321  config_dumped = true;
322  }
323 
324  numStrips = 0; // Will be set later.
325  // Provisional, but should be OK for all stations except ME1.
326  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
327  if ((i_layer+1)%2 == 0) stagger[i_layer] = 0;
328  else stagger[i_layer] = 1;
329  }
330 
332 
335 
336  // trigger numbering doesn't distinguish between ME1a and ME1b chambers:
337  isME11 = (theStation == 1 && theRing == 1);
338 
339  //if (theStation==1 && theRing==2) infoV = 3;
340 
342  //if (theStation == 2 && theSector == 1 &&
343  // theRing == 1 &&
344  // theChamber == 1) {
346  // testPatterns();
348  // testLCTs();
350  // printPatterns();
351  //}
352 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
static int ringFromTriggerLabels(int station, int triggerCSCID)
int stagger[CSCConstants::NUM_LAYERS]
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
CSCCathodeLCTProcessor::CSCCathodeLCTProcessor ( )

Default constructor. Used for testing.

Definition at line 354 of file CSCCathodeLCTProcessor.cc.

References checkConfigParameters(), clct_state_machine_zone, disableME1a, dumpConfigParams(), early_tbins, gangedME1a, infoV, isME11, isMTCC, isTMB07, CSCConstants::MAX_NUM_STRIPS, CSCConstants::NUM_LAYERS, numStrips, CSCTriggerNumbering::ringFromTriggerLabels(), setDefaultConfigParameters(), smartME1aME1b, stagger, start_bx_shift, theRing, theStation, theTrigChamber, and use_dead_time_zoning.

354  :
355  theEndcap(1), theStation(1), theSector(1),
357  // constructor for debugging.
358  static std::atomic<bool> config_dumped{false};
359 
360  // CLCT configuration parameters.
362  infoV = 2;
363  isMTCC = false;
364  isTMB07 = true;
365 
366  smartME1aME1b = false;
367  disableME1a = false;
368  gangedME1a = true;
369 
370  early_tbins = 4;
371 
372  start_bx_shift = 0;
375 
376  // Check and print configuration parameters.
378  if (!config_dumped) {
379  //std::cerr<<"**** CLCT default constructor parameters dump ****"<<std::endl;
381  config_dumped = true;
382  }
383 
385  // Should be OK for all stations except ME1.
386  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
387  if ((i_layer+1)%2 == 0) stagger[i_layer] = 0;
388  else stagger[i_layer] = 1;
389  }
390 
392  isME11 = (theStation == 1 && theRing == 1);
393 }
static int ringFromTriggerLabels(int station, int triggerCSCID)
int stagger[CSCConstants::NUM_LAYERS]

Member Function Documentation

void CSCCathodeLCTProcessor::checkConfigParameters ( )
private

Make sure that the parameter values are within the allowed range.

Definition at line 442 of file CSCCathodeLCTProcessor.cc.

References def_drift_delay, def_fifo_pretrig, def_fifo_tbins, def_hit_persist, def_min_separation, def_nplanes_hit_pattern, def_nplanes_hit_pretrig, def_pid_thresh_pretrig, def_tmb_l1a_window_size, drift_delay, fifo_pretrig, fifo_tbins, hit_persist, infoV, isTMB07, min_separation, nplanes_hit_pattern, nplanes_hit_pretrig, CSCConstants::NUM_HALF_STRIPS_7CFEBS, pid_thresh_pretrig, and tmb_l1a_window_size.

Referenced by CSCCathodeLCTProcessor(), and setConfigParameters().

442  {
443  // Make sure that the parameter values are within the allowed range.
444 
445  // Max expected values.
446  static const unsigned int max_fifo_tbins = 1 << 5;
447  static const unsigned int max_fifo_pretrig = 1 << 5;
448  static const unsigned int max_hit_persist = 1 << 4;
449  static const unsigned int max_drift_delay = 1 << 2;
450  static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
451  static const unsigned int max_nplanes_hit_pattern = 1 << 3;
452  static const unsigned int max_pid_thresh_pretrig = 1 << 4;
453  static const unsigned int max_min_separation = CSCConstants::NUM_HALF_STRIPS_7CFEBS;
454  static const unsigned int max_tmb_l1a_window_size = 1 << 4;
455 
456  // Checks.
457  if (fifo_tbins >= max_fifo_tbins) {
458  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
459  << "+++ Value of fifo_tbins, " << fifo_tbins
460  << ", exceeds max allowed, " << max_fifo_tbins-1 << " +++\n"
461  << "+++ Try to proceed with the default value, fifo_tbins="
462  << def_fifo_tbins << " +++\n";
464  }
465  if (fifo_pretrig >= max_fifo_pretrig) {
466  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
467  << "+++ Value of fifo_pretrig, " << fifo_pretrig
468  << ", exceeds max allowed, " << max_fifo_pretrig-1 << " +++\n"
469  << "+++ Try to proceed with the default value, fifo_pretrig="
470  << def_fifo_pretrig << " +++\n";
472  }
473  if (hit_persist >= max_hit_persist) {
474  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
475  << "+++ Value of hit_persist, " << hit_persist
476  << ", exceeds max allowed, " << max_hit_persist-1 << " +++\n"
477  << "+++ Try to proceed with the default value, hit_persist="
478  << def_hit_persist << " +++\n";
480  }
481  if (drift_delay >= max_drift_delay) {
482  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
483  << "+++ Value of drift_delay, " << drift_delay
484  << ", exceeds max allowed, " << max_drift_delay-1 << " +++\n"
485  << "+++ Try to proceed with the default value, drift_delay="
486  << def_drift_delay << " +++\n";
488  }
489  if (nplanes_hit_pretrig >= max_nplanes_hit_pretrig) {
490  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
491  << "+++ Value of nplanes_hit_pretrig, " << nplanes_hit_pretrig
492  << ", exceeds max allowed, " << max_nplanes_hit_pretrig-1 << " +++\n"
493  << "+++ Try to proceed with the default value, nplanes_hit_pretrig="
494  << def_nplanes_hit_pretrig << " +++\n";
496  }
497  if (nplanes_hit_pattern >= max_nplanes_hit_pattern) {
498  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
499  << "+++ Value of nplanes_hit_pattern, " << nplanes_hit_pattern
500  << ", exceeds max allowed, " << max_nplanes_hit_pattern-1 << " +++\n"
501  << "+++ Try to proceed with the default value, nplanes_hit_pattern="
502  << def_nplanes_hit_pattern << " +++\n";
504  }
505 
506  if (isTMB07) {
507  if (pid_thresh_pretrig >= max_pid_thresh_pretrig) {
508  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
509  << "+++ Value of pid_thresh_pretrig, " << pid_thresh_pretrig
510  << ", exceeds max allowed, " << max_pid_thresh_pretrig-1 << " +++\n"
511  << "+++ Try to proceed with the default value, pid_thresh_pretrig="
512  << def_pid_thresh_pretrig << " +++\n";
514  }
515  if (min_separation >= max_min_separation) {
516  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
517  << "+++ Value of min_separation, " << min_separation
518  << ", exceeds max allowed, " << max_min_separation-1 << " +++\n"
519  << "+++ Try to proceed with the default value, min_separation="
520  << def_min_separation << " +++\n";
522  }
523  }
524 
525  if (tmb_l1a_window_size >= max_tmb_l1a_window_size) {
526  if (infoV > 0) edm::LogError("L1CSCTPEmulatorConfigError")
527  << "+++ Value of tmb_l1a_window_size, " << tmb_l1a_window_size
528  << ", exceeds max allowed, " << max_tmb_l1a_window_size-1 << " +++\n"
529  << "+++ Try to proceed with the default value, tmb_l1a_window_size="
530  << def_tmb_l1a_window_size << " +++\n";
532  }
533 }
static const unsigned int def_drift_delay
static const unsigned int def_fifo_tbins
static const unsigned int def_min_separation
static const unsigned int def_nplanes_hit_pretrig
static const unsigned int def_pid_thresh_pretrig
static const unsigned int def_tmb_l1a_window_size
static const unsigned int def_nplanes_hit_pattern
static const unsigned int def_fifo_pretrig
static const unsigned int def_hit_persist
void CSCCathodeLCTProcessor::clear ( void  )

Clears the LCT containers.

Definition at line 535 of file CSCCathodeLCTProcessor.cc.

References bestCLCT, CSCCLCTDigi::clear(), MAX_CLCT_BINS, secondCLCT, and thePreTriggerBXs.

535  {
536  thePreTriggerBXs.clear();
537  for (int bx = 0; bx < MAX_CLCT_BINS; bx++) {
538  bestCLCT[bx].clear();
539  secondCLCT[bx].clear();
540  }
541 }
CSCCLCTDigi secondCLCT[MAX_CLCT_BINS]
CSCCLCTDigi bestCLCT[MAX_CLCT_BINS]
std::vector< int > thePreTriggerBXs
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:58
void CSCCathodeLCTProcessor::distripStagger ( int  stag_triad[CSCConstants::MAX_NUM_STRIPS_7CFEBS],
int  stag_time[CSCConstants::MAX_NUM_STRIPS_7CFEBS],
int  stag_digi[CSCConstants::MAX_NUM_STRIPS_7CFEBS],
int  i_distrip,
bool  debug = false 
)
static

Definition at line 1077 of file CSCCathodeLCTProcessor.cc.

References LogDebug, and CSCConstants::MAX_NUM_STRIPS.

Referenced by readComparatorDigis(), and testDistripStagger().

1080  {
1081  // Author: Jason Mumford (mumford@physics.ucla.edu)
1082  // This routine takes care of the stagger situation where there is a hit
1083  // on the right half-strip of a di-strip. If there is a stagger, then
1084  // we must associate that distrip with the next distrip. The situation
1085  // gets more complicated if the next distrip also has a hit on its right
1086  // half-strip. One could imagine a whole chain of these in which case
1087  // we need to go into this routine recursively. The formula is that
1088  // while this condition is satisfied, we enquire the next distrip,
1089  // until we have a hit on any other halfstrip (or triad!=3). Then we
1090  // must compare the 2 different bx times and take the smallest one.
1091  // Afterwards, we must cycle out of the routine assigning the bx times
1092  // to the one strip over.
1093 
1094  // Used only for pre-TMB07 firmware.
1095 
1096  if (i_strip >= CSCConstants::MAX_NUM_STRIPS) {
1097  if (debug) edm::LogWarning("L1CSCTPEmulatorWrongInput")
1098  << "+++ Found wrong strip number = " << i_strip
1099  << "; cannot apply distrip staggering... +++\n";
1100  return;
1101  }
1102 
1103  if (debug)
1104  LogDebug("CSCCathodeLCTProcessor")
1105  << " Enter distripStagger: i_strip = " << i_strip
1106  << " stag_triad[i_strip] = " << stag_triad[i_strip]
1107  << " stag_time[i_strip] = " << stag_time[i_strip]
1108  << " stag_triad[i_strip+2] = " << stag_triad[i_strip+2]
1109  << " stag_time[i_strip+2] = " << stag_time[i_strip+2];
1110 
1111  // So if the next distrip has a stagger hit, go into the routine again
1112  // for the next distrip.
1113  if (i_strip+2 < CSCConstants::MAX_NUM_STRIPS && stag_triad[i_strip+2] == 1)
1114  distripStagger(stag_triad, stag_time, stag_digi, i_strip+2);
1115 
1116  // When we have reached a distrip that does not have a staggered hit,
1117  // if it has a hit, we compare the bx times of the
1118  // staggered distrip with the non-staggered distrip and we take the
1119  // smallest of the two and assign it to the shifted distrip time.
1120  if (stag_time[i_strip+2] >= 0) {
1121  if (stag_time[i_strip] < stag_time[i_strip+2]) {
1122  stag_time[i_strip+2] = stag_time[i_strip];
1123  stag_digi[i_strip+2] = stag_digi[i_strip];
1124  }
1125  }
1126  // If the next distrip did not have a hit, then we merely assign the
1127  // shifted time to the time associated with the staggered distrip.
1128  else {
1129  stag_time[i_strip+2] = stag_time[i_strip];
1130  stag_digi[i_strip+2] = stag_digi[i_strip];
1131  }
1132 
1133  // Then to prevent previous staggers from being overwritten, we assign
1134  // the unshifted time to -999, and then mark the triads that were shifted
1135  // so that we don't go into the routine ever again (such as when making
1136  // the next loop over strips).
1137  stag_time[i_strip] = -999;
1138  stag_triad[i_strip] = 4;
1139  stag_digi[i_strip] = -999;
1140 
1141  if (debug)
1142  LogDebug("CSCCathodeLCTProcessor")
1143  << " Exit distripStagger: i_strip = " << i_strip
1144  << " stag_triad[i_strip] = " << stag_triad[i_strip]
1145  << " stag_time[i_strip] = " << stag_time[i_strip]
1146  << " stag_triad[i_strip+2] = " << stag_triad[i_strip+2]
1147  << " stag_time[i_strip+2] = " << stag_time[i_strip+2];
1148 }
#define LogDebug(id)
static void distripStagger(int stag_triad[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int stag_time[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int stag_digi[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int i_distrip, bool debug=false)
#define debug
Definition: HDRShower.cc:19
void CSCCathodeLCTProcessor::dumpConfigParams ( ) const
private

Dump CLCT configuration parameters.

Definition at line 2766 of file CSCCathodeLCTProcessor.cc.

References drift_delay, fifo_pretrig, fifo_tbins, hit_persist, isTMB07, LogDebug, min_separation, nplanes_hit_pattern, nplanes_hit_pretrig, and pid_thresh_pretrig.

Referenced by CSCCathodeLCTProcessor(), run(), and setConfigParameters().

2766  {
2767  std::ostringstream strm;
2768  strm << "\n";
2769  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
2770  strm << "+ CLCT configuration parameters: +\n";
2771  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
2772  strm << " fifo_tbins [total number of time bins in DAQ readout] = "
2773  << fifo_tbins << "\n";
2774  strm << " fifo_pretrig [start time of cathode raw hits in DAQ readout] = "
2775  << fifo_pretrig << "\n";
2776  strm << " hit_persist [duration of signal pulse, in 25 ns bins] = "
2777  << hit_persist << "\n";
2778  strm << " drift_delay [time after pre-trigger before TMB latches LCTs] = "
2779  << drift_delay << "\n";
2780  strm << " nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = "
2781  << nplanes_hit_pretrig << "\n";
2782  strm << " nplanes_hit_pattern [min. number of layers hit for trigger] = "
2783  << nplanes_hit_pattern << "\n";
2784  if (isTMB07) {
2785  strm << " pid_thresh_pretrig [lower threshold on pattern id] = "
2786  << pid_thresh_pretrig << "\n";
2787  strm << " min_separation [region of busy key strips] = "
2788  << min_separation << "\n";
2789  }
2790  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
2791  LogDebug("CSCCathodeLCTProcessor") << strm.str();
2792  //std::cerr<<strm.str()<<std::endl;
2793 }
#define LogDebug(id)
void CSCCathodeLCTProcessor::dumpDigis ( const std::vector< int >  strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  stripType,
const int  nStrips 
) const
private

Dump digis on half-strips and di-strips.

Definition at line 2796 of file CSCCathodeLCTProcessor.cc.

References cfeb_strips, TauDecayModes::dec, relativeConstraints::empty, LogDebug, LogTrace, CSCConstants::NUM_LAYERS, theChamber, theEndcap, theRing, and theStation.

Referenced by findLCTs(), and findLCTsSLHC().

2797 {
2798  LogDebug("CSCCathodeLCTProcessor")
2799  << "ME" << ((theEndcap == 1) ? "+" : "-")
2800  << theStation << "/" << theRing << "/" << theChamber
2801  << " strip type " << stripType << " nStrips " << nStrips;
2802 
2803  std::ostringstream strstrm;
2804  for (int i_strip = 0; i_strip < nStrips; i_strip++) {
2805  if (i_strip%10 == 0) {
2806  if (i_strip < 100) strstrm << i_strip/10;
2807  else strstrm << (i_strip-100)/10;
2808  }
2809  else strstrm << " ";
2810  if ((i_strip+1)%cfeb_strips[stripType] == 0) strstrm << " ";
2811  }
2812  strstrm << "\n";
2813  for (int i_strip = 0; i_strip < nStrips; i_strip++) {
2814  strstrm << i_strip%10;
2815  if ((i_strip+1)%cfeb_strips[stripType] == 0) strstrm << " ";
2816  }
2817  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
2818  strstrm << "\n";
2819  for (int i_strip = 0; i_strip < nStrips; i_strip++) {
2820  if (!strip[i_layer][i_strip].empty()) {
2821  std::vector<int> bx_times = strip[i_layer][i_strip];
2822  // Dump only the first in time.
2823  strstrm << std::hex << bx_times[0] << std::dec;
2824  }
2825  else {
2826  strstrm << "-";
2827  }
2828  if ((i_strip+1)%cfeb_strips[stripType] == 0) strstrm << " ";
2829  }
2830  }
2831  LogTrace("CSCCathodeLCTProcessor") << strstrm.str();
2832 }
#define LogDebug(id)
static const int cfeb_strips[2]
#define LogTrace(id)
std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::findLCTs ( const std::vector< int >  strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
int  stripType 
)
private

Definition at line 1160 of file CSCCathodeLCTProcessor.cc.

References funct::abs(), CLCT_BEND, CLCT_BX, CLCT_CFEB, CLCT_PATTERN, CLCT_QUALITY, CLCT_STRIP, CLCT_STRIP_TYPE, dumpDigis(), getKeyStripData(), infoV, j, LogTrace, nplanes_hit_pattern, CSCConstants::NUM_HALF_STRIPS_7CFEBS, numStrips, and preTrigger().

Referenced by run(), and testPatterns().

1161 {
1162  int j;
1163  int best_strip = 0;
1164  int first_bx = 999;
1165  const int max_lct_num = 2;
1166  const int adjacent_strips = 2;
1167  // Distrip, halfstrip pattern threshold.
1168  const unsigned int ptrn_thrsh[2] = {nplanes_hit_pattern, nplanes_hit_pattern};
1169  int highest_quality = 0;
1170 
1171  int keystrip_data[CSCConstants::NUM_HALF_STRIPS_7CFEBS][7];
1172  int final_lcts[max_lct_num];
1173 
1174  std::vector <CSCCLCTDigi> lctList;
1175 
1176  int nStrips = 0;
1177  if (stripType == 1) nStrips = 2*numStrips + 1;
1178  else if (stripType == 0) nStrips = numStrips/2 + 1;
1179 
1180  if (infoV > 1) dumpDigis(strip, stripType, nStrips);
1181 
1182  // Send data to a pretrigger so that we don't excessively look at data
1183  // that won't give an LCT. If there is a pretrigger, then get all quality
1184  // and bend for all keystrips.
1185  if (preTrigger(strip, stripType, nStrips, first_bx)){
1186  getKeyStripData(strip, keystrip_data, nStrips, first_bx, best_strip, stripType);
1187 
1188  /* Set all final_lcts to impossible key_strip numbers */
1189  for (j = 0; j < max_lct_num; j++)
1190  final_lcts[j] = -999;
1191 
1192  // Now take the keystrip with the best quality, and do a search over the
1193  // rest of the strips for the next highest quality. Do the search over a
1194  // range excluding a certain number of keystrips adjacent to the original
1195  // best key_strip.
1196  final_lcts[0] = best_strip;
1197 
1198  for (int key_strip = 0; key_strip < (nStrips-stripType); key_strip++){
1199  // If indexed strip does not fall within excluded range, then continue
1200  if (abs(best_strip - key_strip) > adjacent_strips){
1201  // Match with highest quality
1202  if (keystrip_data[key_strip][CLCT_QUALITY] > highest_quality){
1203  highest_quality = keystrip_data[key_strip][CLCT_QUALITY];
1204  final_lcts[1] = key_strip;
1205  }
1206  }
1207  }
1208 
1209  for (j = 0; j < max_lct_num; j++){
1210  // Only report LCTs if the number of layers hit is greater than or
1211  // equal to the (variable) valid pattern threshold ptrn_thrsh.
1212  int keystrip = final_lcts[j];
1213  if (keystrip >= 0 &&
1214  keystrip_data[keystrip][CLCT_QUALITY] >= static_cast<int>(ptrn_thrsh[stripType])) {
1215  // assign the stripType here. 1 = halfstrip, 0 = distrip.
1216  keystrip_data[keystrip][CLCT_STRIP_TYPE] = stripType;
1217  // Now make the LCT words for the 2 highest, and store them in a list
1218  int theHalfStrip = (keystrip_data[keystrip][CLCT_STRIP_TYPE] ?
1219  keystrip_data[keystrip][CLCT_STRIP] :
1220  4*keystrip_data[keystrip][CLCT_STRIP]);
1221  keystrip_data[keystrip][CLCT_CFEB] = theHalfStrip/32;
1222  int halfstrip_in_cfeb =
1223  theHalfStrip - 32*keystrip_data[keystrip][CLCT_CFEB];
1224 
1225  CSCCLCTDigi thisLCT(1, keystrip_data[keystrip][CLCT_QUALITY],
1226  keystrip_data[keystrip][CLCT_PATTERN],
1227  keystrip_data[keystrip][CLCT_STRIP_TYPE],
1228  keystrip_data[keystrip][CLCT_BEND],
1229  halfstrip_in_cfeb,
1230  keystrip_data[keystrip][CLCT_CFEB],
1231  keystrip_data[keystrip][CLCT_BX]);
1232  if (infoV > 2) {
1233  char stripType =
1234  (keystrip_data[keystrip][CLCT_STRIP_TYPE] == 0) ? 'D' : 'H';
1235  char bend =
1236  (keystrip_data[keystrip][CLCT_BEND] == 0) ? 'L' : 'R';
1237  LogTrace("CSCCathodeLCTProcessor")
1238  << " Raw Find: "
1239  << "Key Strip: " << std::setw(3)
1240  << keystrip_data[keystrip][CLCT_STRIP]
1241  << " Pattern: " << std::setw(2)
1242  << keystrip_data[keystrip][CLCT_PATTERN]
1243  << " Bend: " << std::setw(1) << bend
1244  << " Quality: " << std::setw(1)
1245  << keystrip_data[keystrip][CLCT_QUALITY]
1246  << " stripType: " << std::setw(1) << stripType
1247  << " BX: " << std::setw(1)
1248  << keystrip_data[keystrip][CLCT_BX];
1249  }
1250  lctList.push_back(thisLCT);
1251  }
1252  }
1253  }
1254 
1255  return lctList;
1256 } // findLCTs -- idealized version for MC studies.
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
bool preTrigger(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips, int &first_bx)
#define LogTrace(id)
void getKeyStripData(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int keystrip_data[CSCConstants::NUM_HALF_STRIPS_7CFEBS][7], int nStrips, int first_bx, int &best_strip, int stripType)
std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::findLCTs ( const std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const std::vector< int >  distrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS] 
)
private

Definition at line 1455 of file CSCCathodeLCTProcessor.cc.

References CLCT_BEND, CLCT_BX, CLCT_CFEB, CLCT_PATTERN, CLCT_QUALITY, CLCT_STRIP, CLCT_STRIP_TYPE, drift_delay, dumpDigis(), getKeyStripData(), infoV, latchLCTs(), LogTrace, MAX_CFEBS, CSCConstants::NUM_DI_STRIPS, CSCConstants::NUM_HALF_STRIPS, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_LAYERS, numStrips, preTrigger(), and priorityEncode().

1457  {
1458  std::vector <CSCCLCTDigi> lctList;
1459  int _bx[2] = {999, 999};
1460  int first_bx = 999;
1461 
1462  const int nhStrips = 2*numStrips + 1;
1463  const int ndStrips = numStrips/2 + 1;
1464 
1465  if (infoV > 1) {
1466  dumpDigis(halfstrip, 1, nhStrips);
1467  dumpDigis(distrip, 0, ndStrips);
1468  }
1469 
1470  // Test beam version of TMB pretrigger and LCT sorting
1471  int h_keyStrip[MAX_CFEBS]; // one key per CFEB
1472  unsigned int h_nhits[MAX_CFEBS]; // number of hits in envelope for each key
1473  int d_keyStrip[MAX_CFEBS]; // one key per CFEB
1474  unsigned int d_nhits[MAX_CFEBS]; // number of hits in envelope for each key
1475  int keystrip_data[2][7]; // 2 possible LCTs per CSC x 7 LCT quantities
1476  unsigned int h_pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]; // simulate digital one-shot
1477  unsigned int d_pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]; // simulate digital one-shot
1478  bool pre_trig[2] = {false, false};
1479 
1480  // All half-strip and di-strip pattern envelopes are evaluated
1481  // simultaneously, on every clock cycle.
1482  pre_trig[0] = preTrigger(halfstrip, h_pulse, 1, nhStrips, 0, _bx[0]);
1483  pre_trig[1] = preTrigger( distrip, d_pulse, 0, ndStrips, 0, _bx[1]);
1484 
1485  // If any of 200 half-strip and di-strip envelopes has enough layers hit in
1486  // it, TMB will pre-trigger.
1487  if (pre_trig[0] || pre_trig[1]) {
1488  first_bx = (_bx[0] < _bx[1]) ? _bx[0] : _bx[1];
1489  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1490  << "half bx " << _bx[0] << " di bx " << _bx[1] << " first " << first_bx
1491  << "\n ..... waiting drift delay ..... ";
1492 
1493  // Empirically-found trick allowing to dramatically improve agreement
1494  // with MTCC-II data.
1495  // The trick is to ignore hits in a few first time bins when latching
1496  // hits for priority encode envelopes. For MTCC-II, we need to ignore
1497  // hits in time bins 0-3 inclusively.
1498  //
1499  // Firmware configuration has been fixed for most of 2007 runs, so
1500  // this trick should NOT be used when emulating 2007 trigger.
1501  /*
1502  int max_bx = 4;
1503  for (int ilayer = 0; ilayer < CSCConstants::NUM_LAYERS; ilayer++) {
1504  for (int istrip = 0; istrip < CSCConstants::NUM_HALF_STRIPS; istrip++) {
1505  for (int bx = 0; bx < max_bx; bx++) {
1506  if (((h_pulse[ilayer][istrip] >> bx) & 1) == 1) {
1507  h_pulse[ilayer][istrip] = 0;
1508  }
1509  }
1510  }
1511  for (int istrip = 0; istrip < CSCConstants::NUM_DI_STRIPS; istrip++) {
1512  for (int bx = 0; bx < max_bx; bx++) {
1513  if (((d_pulse[ilayer][istrip] >> bx) & 1) == 1) {
1514  d_pulse[ilayer][istrip] = 0;
1515  }
1516  }
1517  }
1518  }
1519  */
1520 
1521  // TMB latches LCTs drift_delay clocks after pretrigger.
1522  int latch_bx = first_bx + drift_delay;
1523  latchLCTs(h_pulse, h_keyStrip, h_nhits, 1, CSCConstants::NUM_HALF_STRIPS,
1524  latch_bx);
1525  latchLCTs(d_pulse, d_keyStrip, d_nhits, 0, CSCConstants::NUM_DI_STRIPS,
1526  latch_bx);
1527 
1528  if (infoV > 1) {
1529  LogTrace("CSCCathodeLCTProcessor")
1530  << "...............................\n"
1531  << "Final halfstrip hits and keys (after drift delay) ...";
1532  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1533  LogTrace("CSCCathodeLCTProcessor")
1534  << "cfeb " << icfeb << " key: " << h_keyStrip[icfeb]
1535  << " hits " << h_nhits[icfeb];
1536  }
1537  LogTrace("CSCCathodeLCTProcessor")
1538  << "Final distrip hits and keys (after drift delay) ...";
1539  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1540  LogTrace("CSCCathodeLCTProcessor")
1541  << "cfeb " << icfeb << " key: " << d_keyStrip[icfeb]
1542  << " hits " << d_nhits[icfeb];
1543  }
1544  }
1545  priorityEncode(h_keyStrip, h_nhits, d_keyStrip, d_nhits, keystrip_data);
1546  getKeyStripData(h_pulse, d_pulse, keystrip_data, first_bx);
1547 
1548  for (int ilct = 0; ilct < 2; ilct++) {
1549  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1550  << "found lcts: ilct " << ilct
1551  << " key strip " << keystrip_data[ilct][CLCT_STRIP];
1552  if (keystrip_data[ilct][CLCT_STRIP] != -1) {
1553  int halfstrip_in_cfeb = 0;
1554  if (keystrip_data[ilct][CLCT_STRIP_TYPE] == 0)
1555  halfstrip_in_cfeb = 4*keystrip_data[ilct][CLCT_STRIP] -
1556  32*keystrip_data[ilct][CLCT_CFEB];
1557  else
1558  halfstrip_in_cfeb = keystrip_data[ilct][CLCT_STRIP] -
1559  32*keystrip_data[ilct][CLCT_CFEB];
1560 
1561  CSCCLCTDigi thisLCT(1, keystrip_data[ilct][CLCT_QUALITY],
1562  keystrip_data[ilct][CLCT_PATTERN],
1563  keystrip_data[ilct][CLCT_STRIP_TYPE],
1564  keystrip_data[ilct][CLCT_BEND],
1565  halfstrip_in_cfeb,
1566  keystrip_data[ilct][CLCT_CFEB],
1567  keystrip_data[ilct][CLCT_BX]);
1568  lctList.push_back(thisLCT);
1569  }
1570  }
1571  }
1572 
1573  return lctList;
1574 
1575 } // findLCTs -- pre-2007 version.
void latchLCTs(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int keyStrip[MAX_CFEBS], unsigned int nhits[MAX_CFEBS], const int stripType, const int nStrips, const int bx_time)
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips) const
bool preTrigger(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips, int &first_bx)
#define LogTrace(id)
void priorityEncode(const int h_keyStrip[MAX_CFEBS], const unsigned int h_nhits[MAX_CFEBS], const int d_keyStrip[MAX_CFEBS], const unsigned int d_nhits[MAX_CFEBS], int keystrip_data[2][7])
void getKeyStripData(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int keystrip_data[CSCConstants::NUM_HALF_STRIPS_7CFEBS][7], int nStrips, int first_bx, int &best_strip, int stripType)
std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::findLCTs ( const std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
private

Definition at line 2064 of file CSCCathodeLCTProcessor.cc.

References best_pid, cfeb_strips, CLCT_BEND, CLCT_BX, CLCT_CFEB, CLCT_PATTERN, CLCT_QUALITY, CLCT_STRIP, CLCT_STRIP_TYPE, drift_delay, dumpDigis(), fifo_tbins, infoV, CSCConstants::KEY_CLCT_LAYER, LogTrace, markBusyKeys(), nhits, nplanes_hit_pattern, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_LAYERS, NUM_PATTERN_HALFSTRIPS, numStrips, pattern2007, preTrigger(), ptnFinding(), pulseExtension(), HLT_25ns10e33_v2_cff::quality, stagger, start_bx_shift, and thePreTriggerBXs.

2064  {
2065  std::vector<CSCCLCTDigi> lctList;
2066 
2067  // Max. number of half-strips for this chamber.
2068  const int maxHalfStrips = 2*numStrips + 1;
2069 
2070  if (infoV > 1) dumpDigis(halfstrip, 1, maxHalfStrips);
2071 
2072  // Test beam version of TMB pretrigger and LCT sorting
2073  enum {max_lcts = 2};
2074  // 2 possible LCTs per CSC x 7 LCT quantities
2075  int keystrip_data[max_lcts][7] = {{0}};
2077 
2078  // Fire half-strip one-shots for hit_persist bx's (4 bx's by default).
2079  pulseExtension(halfstrip, maxHalfStrips, pulse);
2080 
2081  unsigned int start_bx = start_bx_shift;
2082  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
2083  // not have a full set of hits to start pattern search anyway.
2084  unsigned int stop_bx = fifo_tbins - drift_delay;
2085  // Allow for more than one pass over the hits in the time window.
2086  while (start_bx < stop_bx) {
2087  // All half-strip pattern envelopes are evaluated simultaneously, on every
2088  // clock cycle.
2089  int first_bx = 999;
2090  bool pre_trig = preTrigger(pulse, start_bx, first_bx);
2091 
2092  // If any of half-strip envelopes has enough layers hit in it, TMB
2093  // will pre-trigger.
2094  if (pre_trig) {
2095  thePreTriggerBXs.push_back(first_bx);
2096  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
2097  << "..... pretrigger at bx = " << first_bx
2098  << "; waiting drift delay .....";
2099 
2100  // TMB latches LCTs drift_delay clocks after pretrigger.
2101  int latch_bx = first_bx + drift_delay;
2102  bool hits_in_time = ptnFinding(pulse, maxHalfStrips, latch_bx);
2103  if (infoV > 1) {
2104  if (hits_in_time) {
2105  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER-1];
2106  hstrip < maxHalfStrips; hstrip++) {
2107  if (nhits[hstrip] > 0) {
2108  LogTrace("CSCCathodeLCTProcessor")
2109  << " bx = " << std::setw(2) << latch_bx << " --->"
2110  << " halfstrip = " << std::setw(3) << hstrip
2111  << " best pid = " << std::setw(2) << best_pid[hstrip]
2112  << " nhits = " << nhits[hstrip];
2113  }
2114  }
2115  }
2116  }
2117  // The pattern finder runs continuously, so another pre-trigger
2118  // could occur already at the next bx.
2119  start_bx = first_bx + 1;
2120 
2121  // Quality for sorting.
2123  int best_halfstrip[max_lcts], best_quality[max_lcts];
2124  for (int ilct = 0; ilct < max_lcts; ilct++) {
2125  best_halfstrip[ilct] = -1;
2126  best_quality[ilct] = 0;
2127  }
2128 
2129  // Calculate quality from pattern id and number of hits, and
2130  // simultaneously select best-quality LCT.
2131  if (hits_in_time) {
2132  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER-1];
2133  hstrip < maxHalfStrips; hstrip++) {
2134  // The bend-direction bit pid[0] is ignored (left and right
2135  // bends have equal quality).
2136  quality[hstrip] = (best_pid[hstrip] & 14) | (nhits[hstrip] << 5);
2137  if (quality[hstrip] > best_quality[0]) {
2138  best_halfstrip[0] = hstrip;
2139  best_quality[0] = quality[hstrip];
2140  }
2141  if (infoV > 1 && quality[hstrip] > 0) {
2142  LogTrace("CSCCathodeLCTProcessor")
2143  << " 1st CLCT: halfstrip = " << std::setw(3) << hstrip
2144  << " quality = " << std::setw(3) << quality[hstrip]
2145  << " best halfstrip = " << std::setw(3) << best_halfstrip[0]
2146  << " best quality = " << std::setw(3) << best_quality[0];
2147  }
2148  }
2149  }
2150 
2151  // If 1st best CLCT is found, look for the 2nd best.
2152  if (best_halfstrip[0] >= 0) {
2153  // Mark keys near best CLCT as busy by setting their quality to
2154  // zero, and repeat the search.
2155  markBusyKeys(best_halfstrip[0], best_pid[best_halfstrip[0]], quality);
2156 
2157  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER-1];
2158  hstrip < maxHalfStrips; hstrip++) {
2159  if (quality[hstrip] > best_quality[1]) {
2160  best_halfstrip[1] = hstrip;
2161  best_quality[1] = quality[hstrip];
2162  }
2163  if (infoV > 1 && quality[hstrip] > 0) {
2164  LogTrace("CSCCathodeLCTProcessor")
2165  << " 2nd CLCT: halfstrip = " << std::setw(3) << hstrip
2166  << " quality = " << std::setw(3) << quality[hstrip]
2167  << " best halfstrip = " << std::setw(3) << best_halfstrip[1]
2168  << " best quality = " << std::setw(3) << best_quality[1];
2169  }
2170  }
2171 
2172  // Pattern finder.
2173  bool ptn_trig = false;
2174  for (int ilct = 0; ilct < max_lcts; ilct++) {
2175  int best_hs = best_halfstrip[ilct];
2176  if (best_hs >= 0 && nhits[best_hs] >= nplanes_hit_pattern) {
2177  ptn_trig = true;
2178  keystrip_data[ilct][CLCT_PATTERN] = best_pid[best_hs];
2179  keystrip_data[ilct][CLCT_BEND] =
2181  // Remove stagger if any.
2182  keystrip_data[ilct][CLCT_STRIP] =
2184  keystrip_data[ilct][CLCT_BX] = first_bx;
2185  keystrip_data[ilct][CLCT_STRIP_TYPE] = 1; // obsolete
2186  keystrip_data[ilct][CLCT_QUALITY] = nhits[best_hs];
2187  keystrip_data[ilct][CLCT_CFEB] =
2188  keystrip_data[ilct][CLCT_STRIP]/cfeb_strips[1];
2189  int halfstrip_in_cfeb = keystrip_data[ilct][CLCT_STRIP] -
2190  cfeb_strips[1]*keystrip_data[ilct][CLCT_CFEB];
2191 
2192  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
2193  << " Final selection: ilct " << ilct
2194  << " key halfstrip " << keystrip_data[ilct][CLCT_STRIP]
2195  << " quality " << keystrip_data[ilct][CLCT_QUALITY]
2196  << " pattern " << keystrip_data[ilct][CLCT_PATTERN]
2197  << " bx " << keystrip_data[ilct][CLCT_BX];
2198 
2199  CSCCLCTDigi thisLCT(1, keystrip_data[ilct][CLCT_QUALITY],
2200  keystrip_data[ilct][CLCT_PATTERN],
2201  keystrip_data[ilct][CLCT_STRIP_TYPE],
2202  keystrip_data[ilct][CLCT_BEND],
2203  halfstrip_in_cfeb,
2204  keystrip_data[ilct][CLCT_CFEB],
2205  keystrip_data[ilct][CLCT_BX]);
2206  lctList.push_back(thisLCT);
2207  }
2208  }
2209 
2210  if (ptn_trig) {
2211  // Once there was a trigger, CLCT pre-trigger state machine
2212  // checks the number of hits that lie on a pattern template
2213  // at every bx, and waits for it to drop below threshold.
2214  // The search for CLCTs resumes only when the number of hits
2215  // drops below threshold.
2216  start_bx = fifo_tbins;
2217  // Stop checking drift_delay bx's short of fifo_tbins since
2218  // at later bx's we won't have a full set of hits for a
2219  // pattern search anyway.
2220  unsigned int stop_time = fifo_tbins - drift_delay;
2221  for (unsigned int bx = latch_bx + 1; bx < stop_time; bx++) {
2222  bool return_to_idle = true;
2223  bool hits_in_time = ptnFinding(pulse, maxHalfStrips, bx);
2224  if (hits_in_time) {
2225  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER-1];
2226  hstrip < maxHalfStrips; hstrip++) {
2227  if (nhits[hstrip] >= nplanes_hit_pattern) {
2228  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
2229  << " State machine busy at bx = " << bx;
2230  return_to_idle = false;
2231  break;
2232  }
2233  }
2234  }
2235  if (return_to_idle) {
2236  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
2237  << " State machine returns to idle state at bx = " << bx;
2238  start_bx = bx;
2239  break;
2240  }
2241  }
2242  }
2243  }
2244  }
2245  else {
2246  start_bx = first_bx + 1; // no dead time
2247  }
2248  }
2249 
2250  return lctList;
2251 } // findLCTs -- TMB-07 version.
static const int cfeb_strips[2]
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips) const
static const int pattern2007[CSCConstants::NUM_CLCT_PATTERNS][NUM_PATTERN_HALFSTRIPS+2]
bool preTrigger(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips, int &first_bx)
#define LogTrace(id)
bool ptnFinding(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, const unsigned int bx_time)
std::vector< int > thePreTriggerBXs
int stagger[CSCConstants::NUM_LAYERS]
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::findLCTsSLHC ( const std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
private

Definition at line 2502 of file CSCCathodeLCTProcessor.cc.

References best_pid, cfeb_strips, CLCT_BEND, CLCT_BX, CLCT_CFEB, CLCT_PATTERN, CLCT_QUALITY, clct_state_machine_zone, CLCT_STRIP, CLCT_STRIP_TYPE, drift_delay, dumpDigis(), dynamic_state_machine_zone, fifo_tbins, first_bx_corrected, i, infoV, ispretrig, j, CSCConstants::KEY_CLCT_LAYER, LogTrace, markBusyKeys(), MAX_CLCT_BINS, nhits, nplanes_hit_pattern, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_LAYERS, NUM_PATTERN_HALFSTRIPS, numStrips, pattern2007, pretrig_trig_zone, preTrigger(), ptnFinding(), pulseExtension(), HLT_25ns10e33_v2_cff::quality, CSCCLCTDigi::setFullBX(), stagger, start_bx_shift, and use_corrected_bx.

Referenced by run().

2503 {
2504  std::vector<CSCCLCTDigi> lctList;
2505 
2506  // Max. number of half-strips for this chamber.
2507  const int maxHalfStrips = 2 * numStrips + 1;
2508 
2509  if (infoV > 1) dumpDigis(halfstrip, 1, maxHalfStrips);
2510 
2511  enum { max_lcts = 2 };
2512 
2513  // keeps dead-time zones around key halfstrips of triggered CLCTs
2515  for (int i = 0; i < CSCConstants::NUM_HALF_STRIPS_7CFEBS; i++)
2516  for (int j = 0; j < MAX_CLCT_BINS; j++)
2517  busyMap[i][j] = false;
2518 
2519  std::vector<CSCCLCTDigi> lctListBX;
2520 
2522 
2523  // Fire half-strip one-shots for hit_persist bx's (4 bx's by default).
2524  pulseExtension(halfstrip, maxHalfStrips, pulse);
2525 
2526  unsigned int start_bx = start_bx_shift;
2527  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
2528  // not have a full set of hits to start pattern search anyway.
2529  unsigned int stop_bx = fifo_tbins - drift_delay;
2530 
2531  // Allow for more than one pass over the hits in the time window.
2532  // Do search in every BX
2533  while (start_bx < stop_bx)
2534  {
2535  lctListBX.clear();
2536 
2537  // All half-strip pattern envelopes are evaluated simultaneously, on every clock cycle.
2538  int first_bx = 999;
2539  bool pre_trig = preTrigger(pulse, start_bx, first_bx);
2540 
2541  // If any of half-strip envelopes has enough layers hit in it, TMB
2542  // will pre-trigger.
2543  if (pre_trig)
2544  {
2545  if (infoV > 1)
2546  LogTrace("CSCCathodeLCTProcessor") << "..... pretrigger at bx = " << first_bx << "; waiting drift delay .....";
2547 
2548  // TMB latches LCTs drift_delay clocks after pretrigger.
2549  int latch_bx = first_bx + drift_delay;
2550  bool hits_in_time = ptnFinding(pulse, maxHalfStrips, latch_bx);
2551  if (infoV > 1)
2552  {
2553  if (hits_in_time)
2554  {
2555  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++)
2556  {
2557  if (nhits[hstrip] > 0)
2558  {
2559  LogTrace("CSCCathodeLCTProcessor") << " bx = " << std::setw(2) << latch_bx << " --->" << " halfstrip = "
2560  << std::setw(3) << hstrip << " best pid = " << std::setw(2) << best_pid[hstrip] << " nhits = " << nhits[hstrip];
2561  }
2562  }
2563  }
2564  }
2565  // The pattern finder runs continuously, so another pre-trigger
2566  // could occur already at the next bx.
2567  start_bx = first_bx + 1;
2568 
2569  // 2 possible LCTs per CSC x 7 LCT quantities per BX
2570  int keystrip_data[max_lcts][7] = {{0}};
2571 
2572  // Quality for sorting.
2574  int best_halfstrip[max_lcts], best_quality[max_lcts];
2575  for (int ilct = 0; ilct < max_lcts; ilct++)
2576  {
2577  best_halfstrip[ilct] = -1;
2578  best_quality[ilct] = 0;
2579  }
2580 
2581  bool pretrig_zone[CSCConstants::NUM_HALF_STRIPS_7CFEBS];
2582 
2583  // Calculate quality from pattern id and number of hits, and
2584  // simultaneously select best-quality LCT.
2585  if (hits_in_time)
2586  {
2587  // first, mark half-strip zones around pretriggers
2588  // that happened at the current first_bx
2589  for (int hstrip = 0; hstrip < CSCConstants::NUM_HALF_STRIPS_7CFEBS; hstrip++)
2590  pretrig_zone[hstrip] = 0;
2591  for (int hstrip = 0; hstrip < CSCConstants::NUM_HALF_STRIPS_7CFEBS; hstrip++)
2592  {
2593  if (ispretrig[hstrip])
2594  {
2595  int min_hs = hstrip - pretrig_trig_zone;
2596  int max_hs = hstrip + pretrig_trig_zone;
2597  if (min_hs < 0)
2598  min_hs = 0;
2599  if (max_hs > CSCConstants::NUM_HALF_STRIPS_7CFEBS - 1)
2600  max_hs = CSCConstants::NUM_HALF_STRIPS_7CFEBS - 1;
2601  for (int hs = min_hs; hs <= max_hs; hs++)
2602  pretrig_zone[hs] = 1;
2603  if (infoV > 1)
2604  LogTrace("CSCCathodeLCTProcessor") << " marked pretrigger halfstrip zone [" << min_hs << "," << max_hs << "]";
2605  }
2606  }
2607 
2608  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++)
2609  {
2610  // The bend-direction bit pid[0] is ignored (left and right bends have equal quality).
2611  quality[hstrip] = (best_pid[hstrip] & 14) | (nhits[hstrip] << 5);
2612  // do not consider halfstrips:
2613  // - out of pretrigger-trigger zones
2614  // - in busy zones from previous trigger
2615  if (quality[hstrip] > best_quality[0] &&
2616  pretrig_zone[hstrip] &&
2617  !busyMap[hstrip][first_bx] )
2618  {
2619  best_halfstrip[0] = hstrip;
2620  best_quality[0] = quality[hstrip];
2621  if (infoV > 1)
2622  {
2623  LogTrace("CSCCathodeLCTProcessor") << " 1st CLCT: halfstrip = " << std::setw(3) << hstrip << " quality = "
2624  << std::setw(3) << quality[hstrip] << " best halfstrip = " << std::setw(3) << best_halfstrip[0]
2625  << " best quality = " << std::setw(3) << best_quality[0];
2626  }
2627  }
2628  }
2629  }
2630 
2631  // If 1st best CLCT is found, look for the 2nd best.
2632  if (best_halfstrip[0] >= 0)
2633  {
2634  // Mark keys near best CLCT as busy by setting their quality to zero, and repeat the search.
2635  markBusyKeys(best_halfstrip[0], best_pid[best_halfstrip[0]], quality);
2636 
2637  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++)
2638  {
2639  if (quality[hstrip] > best_quality[1] &&
2640  pretrig_zone[hstrip] &&
2641  !busyMap[hstrip][first_bx] )
2642  {
2643  best_halfstrip[1] = hstrip;
2644  best_quality[1] = quality[hstrip];
2645  if (infoV > 1)
2646  {
2647  LogTrace("CSCCathodeLCTProcessor") << " 2nd CLCT: halfstrip = " << std::setw(3) << hstrip << " quality = "
2648  << std::setw(3) << quality[hstrip] << " best halfstrip = " << std::setw(3) << best_halfstrip[1]
2649  << " best quality = " << std::setw(3) << best_quality[1];
2650  }
2651  }
2652  }
2653 
2654  // Pattern finder.
2655  bool ptn_trig = false;
2656  for (int ilct = 0; ilct < max_lcts; ilct++)
2657  {
2658  int best_hs = best_halfstrip[ilct];
2659  if (best_hs >= 0 && nhits[best_hs] >= nplanes_hit_pattern)
2660  {
2661  int bx = first_bx;
2662  int fbx = first_bx_corrected[best_hs];
2663  if (use_corrected_bx) {
2664  bx = fbx;
2665  fbx = first_bx;
2666  }
2667  ptn_trig = true;
2668  keystrip_data[ilct][CLCT_PATTERN] = best_pid[best_hs];
2669  keystrip_data[ilct][CLCT_BEND] = pattern2007[best_pid[best_hs]][NUM_PATTERN_HALFSTRIPS];
2670  // Remove stagger if any.
2671  keystrip_data[ilct][CLCT_STRIP] = best_hs - stagger[CSCConstants::KEY_CLCT_LAYER - 1];
2672  keystrip_data[ilct][CLCT_BX] = bx;
2673  keystrip_data[ilct][CLCT_STRIP_TYPE] = 1; // obsolete
2674  keystrip_data[ilct][CLCT_QUALITY] = nhits[best_hs];
2675  keystrip_data[ilct][CLCT_CFEB] = keystrip_data[ilct][CLCT_STRIP] / cfeb_strips[1];
2676  int halfstrip_in_cfeb = keystrip_data[ilct][CLCT_STRIP] - cfeb_strips[1] * keystrip_data[ilct][CLCT_CFEB];
2677 
2678  if (infoV > 1)
2679  LogTrace("CSCCathodeLCTProcessor") << " Final selection: ilct " << ilct << " key halfstrip "
2680  << keystrip_data[ilct][CLCT_STRIP] << " quality " << keystrip_data[ilct][CLCT_QUALITY] << " pattern "
2681  << keystrip_data[ilct][CLCT_PATTERN] << " bx " << keystrip_data[ilct][CLCT_BX];
2682 
2683  CSCCLCTDigi thisLCT(1, keystrip_data[ilct][CLCT_QUALITY], keystrip_data[ilct][CLCT_PATTERN],
2684  keystrip_data[ilct][CLCT_STRIP_TYPE], keystrip_data[ilct][CLCT_BEND], halfstrip_in_cfeb,
2685  keystrip_data[ilct][CLCT_CFEB], keystrip_data[ilct][CLCT_BX]);
2686  thisLCT.setFullBX(fbx);
2687  lctList.push_back(thisLCT);
2688  lctListBX.push_back(thisLCT);
2689  }
2690  }
2691 
2692  // state-machine
2693  if (ptn_trig)
2694  {
2695  // Once there was a trigger, CLCT pre-trigger state machine checks the number of hits
2696  // that lie on a key halfstrip pattern template at every bx, and waits for it to drop below threshold.
2697  // During that time no CLCTs could be found with its key halfstrip in the area of
2698  // [clct_key-clct_state_machine_zone, clct_key+clct_state_machine_zone]
2699  // starting from first_bx+1.
2700  // The search for CLCTs resumes only when the number of hits on key halfstrip drops below threshold.
2701  for (unsigned int ilct = 0; ilct < lctListBX.size(); ilct++)
2702  {
2703  int key_hstrip = lctListBX[ilct].getKeyStrip() + stagger[CSCConstants::KEY_CLCT_LAYER - 1];
2704 
2705  int delta_hs = clct_state_machine_zone;
2707  delta_hs = pattern2007[lctListBX[ilct].getPattern()][NUM_PATTERN_HALFSTRIPS + 1] - 1;
2708 
2709  int min_hstrip = key_hstrip - delta_hs;
2710  int max_hstrip = key_hstrip + delta_hs;
2711 
2712  if (min_hstrip < stagger[CSCConstants::KEY_CLCT_LAYER - 1])
2713  min_hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1];
2714  if (max_hstrip > maxHalfStrips)
2715  max_hstrip = maxHalfStrips;
2716 
2717  if (infoV > 2)
2718  LogTrace("CSCCathodeLCTProcessor") << " marking post-trigger zone after bx=" << lctListBX[ilct].getBX() << " ["
2719  << min_hstrip << "," << max_hstrip << "]";
2720 
2721  // Stop checking drift_delay bx's short of fifo_tbins since
2722  // at later bx's we won't have a full set of hits for a
2723  // pattern search anyway.
2724  //int stop_time = fifo_tbins - drift_delay;
2725  // -- no, need to extend busyMap over fifo_tbins - drift_delay
2726  for (size_t bx = first_bx + 1; bx < fifo_tbins; bx++)
2727  {
2728  bool busy_bx = false;
2729  if (bx <= (size_t)latch_bx)
2730  busy_bx = true; // always busy before drift time
2731  if (!busy_bx)
2732  {
2733  bool hits_in_time = ptnFinding(pulse, maxHalfStrips, bx);
2734  if (hits_in_time && nhits[key_hstrip] >= nplanes_hit_pattern)
2735  busy_bx = true;
2736  if (infoV > 2)
2737  LogTrace("CSCCathodeLCTProcessor") << " at bx=" << bx << " hits_in_time=" << hits_in_time << " nhits="
2738  << nhits[key_hstrip];
2739  }
2740  if (infoV > 2)
2741  LogTrace("CSCCathodeLCTProcessor") << " at bx=" << bx << " busy=" << busy_bx;
2742  if (busy_bx)
2743  for (int hstrip = min_hstrip; hstrip <= max_hstrip; hstrip++)
2744  busyMap[hstrip][bx] = true;
2745  else
2746  break;
2747  }
2748  }
2749  } // if (ptn_trig)
2750  }
2751  }
2752  else
2753  {
2754  start_bx = first_bx + 1; // no dead time
2755  }
2756  }
2757 
2758  return lctList;
2759 } // findLCTs -- SLHC version.
int i
Definition: DBlmapReader.cc:9
bool ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
static const int cfeb_strips[2]
int first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips) const
static const int pattern2007[CSCConstants::NUM_CLCT_PATTERNS][NUM_PATTERN_HALFSTRIPS+2]
int j
Definition: DBlmapReader.cc:9
bool preTrigger(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips, int &first_bx)
#define LogTrace(id)
bool ptnFinding(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, const unsigned int bx_time)
int stagger[CSCConstants::NUM_LAYERS]
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
int CSCCathodeLCTProcessor::findNumLayersHit ( std::vector< int >  stripsHit[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
private

Definition at line 3162 of file CSCCathodeLCTProcessor.cc.

References relativeConstraints::empty, CSCConstants::NUM_LAYERS, and contentValuesFiles::number.

Referenced by testPatterns().

3163  {
3164  int number = 0;
3165  for (int layer = 0; layer < CSCConstants::NUM_LAYERS; layer++) {
3166  if ((!stripsHit[layer][ 9].empty()) ||
3167  (!stripsHit[layer][10].empty()) ||
3168  (!stripsHit[layer][11].empty()) ) number++;
3169  }
3170  return number;
3171 }
std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::getCLCTs ( )

Returns vector of all found CLCTs, if any.

Definition at line 2917 of file CSCCathodeLCTProcessor.cc.

References bestCLCT, MAX_CLCT_BINS, and secondCLCT.

Referenced by readoutCLCTs(), and run().

2917  {
2918  std::vector<CSCCLCTDigi> tmpV;
2919  for (int bx = 0; bx < MAX_CLCT_BINS; bx++) {
2920  if (bestCLCT[bx].isValid()) tmpV.push_back(bestCLCT[bx]);
2921  if (secondCLCT[bx].isValid()) tmpV.push_back(secondCLCT[bx]);
2922  }
2923  return tmpV;
2924 }
CSCCLCTDigi secondCLCT[MAX_CLCT_BINS]
CSCCLCTDigi bestCLCT[MAX_CLCT_BINS]
bool CSCCathodeLCTProcessor::getDigis ( const CSCComparatorDigiCollection compdc)

Access routines to comparator digis.

Definition at line 753 of file CSCCathodeLCTProcessor.cc.

References digiV, disableME1a, relativeConstraints::empty, infoV, LogTrace, CSCConstants::NUM_LAYERS, smartME1aME1b, theChamber, theEndcap, theRing, theSector, theStation, theSubsector, and theTrigChamber.

Referenced by run().

753  {
754  bool noDigis = true;
755 
756  // Loop over layers and save comparator digis on each one into digiV[layer].
757  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
758  digiV[i_layer].clear();
759 
760  CSCDetId detid(theEndcap, theStation, theRing, theChamber, i_layer+1);
761  getDigis(compdc, detid);
762 
763  // If this is ME1/1, fetch digis in corresponding ME1/A (ring=4) as well.
764  if (theStation == 1 && theRing == 1 && !disableME1a && !smartME1aME1b) {
765  CSCDetId detid_me1a(theEndcap, theStation, 4, theChamber, i_layer+1);
766  getDigis(compdc, detid_me1a);
767  }
768 
769  // If this is ME1/1, fetch digis in corresponding ME1/B (ring=1) as well.
770  // needed only for the "smart" A/B case; and, actually, only for data
771  if (theStation == 1 && theRing == 4 && !disableME1a && smartME1aME1b
772  && digiV[i_layer].empty()) {
773  CSCDetId detid_me1b(theEndcap, theStation, 1, theChamber, i_layer+1);
774  getDigis(compdc, detid_me1b);
775  }
776 
777  if (!digiV[i_layer].empty()) {
778  noDigis = false;
779  if (infoV > 1) {
780  LogTrace("CSCCathodeLCTProcessor")
781  << "found " << digiV[i_layer].size()
782  << " comparator digi(s) in layer " << i_layer << " of ME"
783  << ((theEndcap == 1) ? "+" : "-") << theStation << "/" << theRing
784  << "/" << theChamber << " (trig. sector " << theSector
785  << " subsector " << theSubsector << " id " << theTrigChamber << ")";
786  }
787  }
788  }
789 
790  return noDigis;
791 }
bool getDigis(const CSCComparatorDigiCollection *compdc)
#define LogTrace(id)
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
void CSCCathodeLCTProcessor::getDigis ( const CSCComparatorDigiCollection compdc,
const CSCDetId id 
)

Definition at line 793 of file CSCCathodeLCTProcessor.cc.

References digiV, disableME1a, gangedME1a, relativeConstraints::ring, smartME1aME1b, theRing, and theStation.

794  {
795  bool me1bProc = theStation == 1 && theRing == 1;
796  bool me1aProc = theStation == 1 && theRing == 4;
797  bool me1b = (id.station() == 1) && (id.ring() == 1);
798  bool me1a = (id.station() == 1) && (id.ring() == 4);
799  const CSCComparatorDigiCollection::Range rcompd = compdc->get(id);
800  for (CSCComparatorDigiCollection::const_iterator digiIt = rcompd.first;
801  digiIt != rcompd.second; ++digiIt) {
802  unsigned int origStrip = digiIt->getStrip();
803  unsigned int maxStripsME1a = gangedME1a ? 16 : 48;
804  if (me1a && origStrip <= maxStripsME1a && !disableME1a && !smartME1aME1b) {
805  // Move ME1/A comparators from CFEB=0 to CFEB=4 if this has not
806  // been done already.
807  CSCComparatorDigi digi_corr(origStrip+64,
808  digiIt->getComparator(),
809  digiIt->getTimeBinWord());
810  digiV[id.layer()-1].push_back(digi_corr);
811  }
812  else if (smartME1aME1b && (me1bProc || me1aProc)){
813  //stay within bounds; in data all comps are in ME11B DetId
814 
815  if (me1aProc && me1b && origStrip > 64){//this is data
816  //shift back to start from 1
817  CSCComparatorDigi digi_corr(origStrip-64,
818  digiIt->getComparator(),
819  digiIt->getTimeBinWord());
820  digiV[id.layer()-1].push_back(digi_corr);
821  } else if ((me1bProc && me1b && origStrip <= 64)
822  || ((me1aProc && me1a))//this is MC for ME11a
823  ){
824  digiV[id.layer()-1].push_back(*digiIt);
825  }
826  }
827  else {
828  digiV[id.layer()-1].push_back(*digiIt);
829  }
830  }
831 }
std::vector< CSCComparatorDigi >::const_iterator const_iterator
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
std::pair< const_iterator, const_iterator > Range
void CSCCathodeLCTProcessor::getKeyStripData ( const std::vector< int >  strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
int  keystrip_data[CSCConstants::NUM_HALF_STRIPS_7CFEBS][7],
int  nStrips,
int  first_bx,
int &  best_strip,
int  stripType 
)
private

Definition at line 1322 of file CSCCathodeLCTProcessor.cc.

References CLCT_BEND, CLCT_BX, CLCT_PATTERN, CLCT_QUALITY, CLCT_STRIP, drift_delay, getPattern(), i, infoV, LogTrace, CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07, NUM_PATTERN_STRIPS, pre_hit_pattern, and HLT_25ns10e33_v2_cff::quality.

Referenced by findLCTs().

1324  {
1325  int lct_pattern[NUM_PATTERN_STRIPS];
1326  int key_strip, this_layer, this_strip;
1327  int quality, best_quality;
1328  int bend = 0;
1329  int highest_quality = 0;
1330  bool nullPattern;
1331 
1332  for (key_strip = 0; key_strip < nStrips; key_strip++)
1333  for (int i = 0; i < 7; i++)
1334  keystrip_data[key_strip][i] = 0;
1335 
1336  // Now we need to look at all the keystrips and take the best pattern
1337  // for each. There are multiple patterns available for each keystrip.
1338 
1339  for (key_strip = 0; key_strip < (nStrips-stripType); key_strip++){
1340  nullPattern = true;
1341  for (int pattern_strip = 0; pattern_strip < NUM_PATTERN_STRIPS; pattern_strip++){
1342  this_layer = pre_hit_pattern[0][pattern_strip];
1343  this_strip = pre_hit_pattern[1][pattern_strip] + key_strip;
1344  // This conditional statement prevents us from looking at strips
1345  // that don't exist along the chamber boundaries.
1346  if ((this_strip >= 0 && this_strip < nStrips) &&
1347  !strip[this_layer][this_strip].empty()) {
1348  if (nullPattern) nullPattern = false;
1349  std::vector<int> bx_times = strip[this_layer][this_strip];
1350  lct_pattern[pattern_strip] = bx_times[0];
1351  }
1352  else
1353  lct_pattern[pattern_strip] = -999;
1354  }
1355  // do the rest only if there is at least one DIGI in the pattern for
1356  // this keystrip
1357  if (nullPattern) continue;
1358 
1359  // Initialize best_quality to zero so that we can look for best pattern
1360  // within a keystrip.
1361  best_quality = 0;
1362 
1363  // Loop over all possible patterns.
1364  // Loop in reverse order, in order to give priority to a straighter
1365  // pattern (larger pattern_num) in case of equal qualities.
1366  // Exclude pattern 0 since it is not defined.
1367  for (int pattern_num = CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07-1; pattern_num > 0; pattern_num--) {
1368  // Get the pattern quality from lct_pattern.
1369  // TMB latches LCTs drift_delay clocks after pretrigger.
1370  int latch_bx = first_bx + drift_delay;
1371  getPattern(pattern_num, lct_pattern, latch_bx, quality, bend);
1372  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1373  << "Key_strip " << key_strip << " quality of pattern_num "
1374  << pattern_num << ": " << quality;
1375  if (quality > best_quality){
1376  // Store the best pattern, quality, etc., for each key_strip.
1377  keystrip_data[key_strip][CLCT_PATTERN] = pattern_num;
1378  keystrip_data[key_strip][CLCT_BEND] = bend;
1379  keystrip_data[key_strip][CLCT_STRIP] = key_strip;
1380  keystrip_data[key_strip][CLCT_BX] = first_bx;
1381  // keystrip_data[key_strip][CLCT_STRIP_TYPE] = stripType; //assign the stripType elsewhere
1382  keystrip_data[key_strip][CLCT_QUALITY] = quality;
1383  if (quality > highest_quality){
1384  // Keep track of which strip had the highest quality.
1385  // highest_quality refers to the overall highest quality for all
1386  // key strips. This is different than best_quality which refers
1387  // to the best quality in a keystrip from different patterns.
1388  best_strip = key_strip;
1389  highest_quality = quality;
1390  }
1391  best_quality = quality;
1392  }
1393  }
1394  }
1395 } // getKeyStripData -- idealized version for MC studies.
void getPattern(int pattern_num, int strip_value[NUM_PATTERN_STRIPS], int bx_time, int &quality, int &bend)
int i
Definition: DBlmapReader.cc:9
#define LogTrace(id)
static const int pre_hit_pattern[2][NUM_PATTERN_STRIPS]
void CSCCathodeLCTProcessor::getKeyStripData ( const unsigned int  h_pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const unsigned int  d_pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
int  keystrip_data[2][7],
const int  first_bx 
)
private

Definition at line 1910 of file CSCCathodeLCTProcessor.cc.

References CLCT_BEND, CLCT_BX, CLCT_PATTERN, CLCT_QUALITY, CLCT_STRIP, CLCT_STRIP_TYPE, drift_delay, getPattern(), infoV, LogTrace, nplanes_hit_pattern, CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07, CSCConstants::NUM_DI_STRIPS, CSCConstants::NUM_HALF_STRIPS, NUM_PATTERN_STRIPS, pre_hit_pattern, and HLT_25ns10e33_v2_cff::quality.

1913  {
1914 
1915  int lct_pattern[NUM_PATTERN_STRIPS];
1916  int this_layer, this_strip;
1917  unsigned int quality = 0, bend = 0;
1918  unsigned int best_quality, best_pattern;
1919  bool valid[2] = {false,false};
1920 
1921  // Time at which TMB latches LCTs.
1922  int latch_bx = first_bx + drift_delay;
1923 
1924  // Look at keystrips determined from priorityEncode and find their best
1925  // pattern based on number of hits matching that pattern (quality). Also
1926  // find bend angle. There are multiple patterns available for each keystrip.
1927 
1928  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1929  << "...............getKeyStripData....................";
1930 
1931  for (int ilct = 0; ilct < 2; ilct++) {
1932  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1933  << "lct " << ilct << " keystrip " << keystrip_data[ilct][CLCT_STRIP]
1934  << " type " << keystrip_data[ilct][CLCT_STRIP_TYPE];
1935  if (keystrip_data[ilct][CLCT_STRIP] == -1) {// flag set in priorityEncode()
1936  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1937  << "no lct at ilct " << ilct;
1938  continue;
1939  }
1940  for (int pattern_strip = 0; pattern_strip < NUM_PATTERN_STRIPS;
1941  pattern_strip++) {
1942  lct_pattern[pattern_strip] = -999;
1943  this_layer = pre_hit_pattern[0][pattern_strip];
1944  this_strip = pre_hit_pattern[1][pattern_strip] +
1945  keystrip_data[ilct][CLCT_STRIP];
1946  // This conditional statement prevents us from looking at strips
1947  // that don't exist along the chamber boundaries.
1948  if (keystrip_data[ilct][CLCT_STRIP_TYPE] == 1) {
1949  if (this_strip >= 0 && this_strip < CSCConstants::NUM_HALF_STRIPS) {
1950  // Now look at one-shots in bx where TMB latches the LCTs
1951  if (((h_pulse[this_layer][this_strip] >> latch_bx) & 1) == 1)
1952  lct_pattern[pattern_strip] = 1;
1953  }
1954  }
1955  else {
1956  if (this_strip >= 0 && this_strip < CSCConstants::NUM_DI_STRIPS) {
1957  // Now look at one-shots in bx where TMB latches the LCTs
1958  if (((d_pulse[this_layer][this_strip] >> latch_bx) & 1) == 1)
1959  lct_pattern[pattern_strip] = 1;
1960  }
1961  }
1962  }
1963 
1964  // Find best pattern and quality associated with key by looping over all
1965  // possible patterns
1966  best_quality = 0;
1967  best_pattern = 0;
1968 
1969  for (unsigned int pattern_num = 0;
1970  pattern_num < CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07; pattern_num++) {
1971  getPattern(pattern_num, lct_pattern, quality, bend);
1972  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1973  << "pattern " << pattern_num << " quality " << quality
1974  << " bend " << bend;
1975  // Number of layers hit matching a pattern template is compared
1976  // to nplanes_hit_pattern. The threshold is the same for both half- and
1977  // di-strip patterns.
1978  if (quality >= nplanes_hit_pattern) {
1979  // If the number of matches is the same for two pattern templates,
1980  // the higher pattern-template number is selected.
1981  if ((quality == best_quality && pattern_num > best_pattern) ||
1982  (quality > best_quality)) {
1983  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1984  << "valid = true at quality " << quality
1985  << " thresh " << nplanes_hit_pattern;
1986  valid[ilct] = true;
1987  keystrip_data[ilct][CLCT_PATTERN] = pattern_num;
1988  keystrip_data[ilct][CLCT_BEND] = bend;
1989  keystrip_data[ilct][CLCT_BX] = first_bx;
1990  //keystrip_data[ilct][CLCT_STRIP_TYPE] = stripType;
1991  keystrip_data[ilct][CLCT_QUALITY] = quality;
1992  best_quality = quality;
1993  best_pattern = pattern_num;
1994  }
1995  }
1996  }
1997 
1998  if (!valid[ilct]) {
1999  keystrip_data[ilct][CLCT_STRIP] = -1; // delete lct
2000  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
2001  << "lct " << ilct << " not over threshold: deleting";
2002  }
2003  else {
2004  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
2005  << "\n" << "--------- final LCT: " << ilct << " -------------\n"
2006  << " key strip " << keystrip_data[ilct][CLCT_STRIP]
2007  << " pattern_num " << keystrip_data[ilct][CLCT_PATTERN]
2008  << " quality " << keystrip_data[ilct][CLCT_QUALITY]
2009  << " bend " << keystrip_data[ilct][CLCT_BEND]
2010  << " bx " << keystrip_data[ilct][CLCT_BX]
2011  << " type " << keystrip_data[ilct][CLCT_STRIP_TYPE] << "\n";
2012  }
2013  } // end loop over lcts
2014 } // getKeyStripData -- pre-2007 version.
void getPattern(int pattern_num, int strip_value[NUM_PATTERN_STRIPS], int bx_time, int &quality, int &bend)
#define LogTrace(id)
static const int pre_hit_pattern[2][NUM_PATTERN_STRIPS]
void CSCCathodeLCTProcessor::getPattern ( int  pattern_num,
int  strip_value[NUM_PATTERN_STRIPS],
int  bx_time,
int &  quality,
int &  bend 
)
private

Definition at line 1399 of file CSCCathodeLCTProcessor.cc.

References hitIsGood(), CSCConstants::NUM_LAYERS, NUM_PATTERN_STRIPS, and pattern.

Referenced by getKeyStripData(), and testPatterns().

1401  {
1402  // This function takes strip values and bx_time to find out which hits fall
1403  // within a certain pattern. Quality, and bend are then calculated based on
1404  // which strip pattern and how many layers were hit within the pattern.
1405  int layers_hit = 0;
1406  bool hit_layer[CSCConstants::NUM_LAYERS];
1407 
1408  // Clear hit_layer array to keep track of number of layers hit.
1409  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
1410  hit_layer[i_layer] = false;
1411 
1412  // Loop over all designated patterns.
1413  for (int strip_num = 0; strip_num < NUM_PATTERN_STRIPS; strip_num++){
1414  if (hitIsGood(strip_value[strip_num], bx_time)){
1415  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++){
1416  // Loop over layer and see if corresponding strip is on same layer
1417  // If so then increment number of hits.
1418  if (i_layer == pattern[pattern_num][strip_num]){
1419  // If layer has no hits, then increment number of layers hit.
1420  if (hit_layer[i_layer] == false){
1421  layers_hit++;
1422  hit_layer[i_layer] = true;
1423  }
1424  }
1425  }
1426  }
1427  }
1428  // Get bend value from pattern.
1429  bend = pattern[pattern_num][NUM_PATTERN_STRIPS];
1430  quality = layers_hit;
1431 } // getPattern -- idealized version for MC studies.
static const int pattern[CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07][NUM_PATTERN_STRIPS+1]
bool hitIsGood(int hitTime, int BX)
void CSCCathodeLCTProcessor::getPattern ( unsigned int  pattern_num,
const int  strip_value[NUM_PATTERN_STRIPS],
unsigned int &  quality,
unsigned int &  bend 
)
private

Definition at line 2018 of file CSCCathodeLCTProcessor.cc.

References CSCConstants::NUM_LAYERS, NUM_PATTERN_STRIPS, and pattern.

2020  {
2021 
2022  // This function takes strip "one-shots" at the correct bx to find out
2023  // which hits fall within a certain pattern. Quality and bend are then
2024  // calculated based on which strip pattern and how many layers were hit
2025  // within the pattern.
2026 
2027  unsigned int layers_hit = 0;
2028  bool hit_layer[CSCConstants::NUM_LAYERS];
2029 
2030  // Clear hit_layer array to keep track of number of layers hit.
2031  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
2032  hit_layer[i_layer] = false;
2033 
2034  // Loop over all designated patterns.
2035  for (int strip_num = 0; strip_num < NUM_PATTERN_STRIPS; strip_num++){
2036  if (strip_value[strip_num] == 1){
2037  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++){
2038  // Loop over layer and see if corresponding strip is on same layer
2039  // If so then increment number of hits.
2040  if (i_layer == pattern[pattern_num][strip_num]){
2041  // If layer has no hits, then increment number of layers hit.
2042  if (hit_layer[i_layer] == false){
2043  layers_hit++;
2044  hit_layer[i_layer] = true;
2045  }
2046  }
2047  }
2048  }
2049  }
2050  // Get bend value from pattern.
2051  bend = pattern[pattern_num][NUM_PATTERN_STRIPS];
2052  quality = layers_hit;
2053 
2054 } // getPattern -- pre-2007 version.
static const int pattern[CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07][NUM_PATTERN_STRIPS+1]
bool CSCCathodeLCTProcessor::hitIsGood ( int  hitTime,
int  BX 
)
private

Definition at line 1435 of file CSCCathodeLCTProcessor.cc.

References dt, and hit_persist.

Referenced by getPattern().

1435  {
1436  // Find out if hit time is good. Hit should have occurred no more than
1437  // hit_persist clocks before the latching time.
1438  int dt = BX - hitTime;
1439  if (dt >= 0 && dt <= static_cast<int>(hit_persist)) {return true;}
1440  else {return false;}
1441 } // hitIsGood -- idealized version for MC studies.
float dt
Definition: AMPTWrapper.h:126
void CSCCathodeLCTProcessor::latchLCTs ( const unsigned int  pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
int  keyStrip[MAX_CFEBS],
unsigned int  nhits[MAX_CFEBS],
const int  stripType,
const int  nStrips,
const int  bx_time 
)
private

Definition at line 1674 of file CSCCathodeLCTProcessor.cc.

References cfeb_strips, infoV, LogTrace, MAX_CFEBS, CSCConstants::NUM_LAYERS, NUM_PATTERN_STRIPS, and pre_hit_pattern.

Referenced by findLCTs().

1677  {
1678 
1679  bool hit_layer[CSCConstants::NUM_LAYERS];
1680  int key_strip, this_layer, this_strip;
1681  int layers_hit, prev_hits;
1682 
1683  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1684  keyStrip[icfeb] = -1;
1685  n_hits[icfeb] = 0;
1686  }
1687 
1688  if (stripType != 0 && stripType != 1) {
1689  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
1690  << "+++ latchLCTs: stripType = " << stripType
1691  << " does not correspond to half-strip/di-strip patterns! +++\n";
1692  return;
1693  }
1694 
1695  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) { // loop over CFEBs
1696  prev_hits = 0;
1697  // Loop over (di-/half-)strips in CFEB.
1698  for (int istrip = 0; istrip < cfeb_strips[stripType]; istrip++) {
1699  // Calculate candidate key.
1700  key_strip = icfeb*cfeb_strips[stripType] + istrip;
1701  layers_hit = 0;
1702  for (int ilayer = 0; ilayer < CSCConstants::NUM_LAYERS; ilayer++)
1703  hit_layer[ilayer] = false;
1704 
1705  // Loop over strips in pretrigger pattern mask and look for hits.
1706  for (int pstrip = 0; pstrip < NUM_PATTERN_STRIPS; pstrip++) {
1707  this_layer = pre_hit_pattern[0][pstrip];
1708  this_strip = pre_hit_pattern[1][pstrip]+key_strip;
1709 
1710  if (this_strip >= 0 && this_strip < nStrips) {
1711  // Determine if "one shot" is high at this bx_time
1712  if (((pulse[this_layer][this_strip] >> bx_time) & 1) == 1) {
1713  if (hit_layer[this_layer] == false) {
1714  hit_layer[this_layer] = true;
1715  layers_hit++; // number of layers hit
1716  }
1717  }
1718  }
1719  } // end loop over strips in pretrigger pattern
1720  if (infoV > 1) {
1721  if (layers_hit > 0) LogTrace("CSCCathodeLCTProcessor")
1722  << "cfeb: " << icfeb << " key_strip: " << key_strip
1723  << " n_hits: " << layers_hit;
1724  }
1725  // If two or more keys have an equal number of hits, the lower number
1726  // key is taken. Hence, replace the previous key only if this key has
1727  // more hits.
1728  if (layers_hit > prev_hits) {
1729  prev_hits = layers_hit;
1730  keyStrip[icfeb] = key_strip; // key with highest hits is LCT key strip
1731  n_hits[icfeb] = layers_hit; // corresponding hits in envelope
1732  }
1733  } // end loop over candidate key strips in cfeb
1734  } // end loop over cfebs
1735 } // latchLCTs -- pre-2007 version.
static const int cfeb_strips[2]
#define LogTrace(id)
static const int pre_hit_pattern[2][NUM_PATTERN_STRIPS]
void CSCCathodeLCTProcessor::markBusyKeys ( const int  best_hstrip,
const int  best_patid,
int  quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS] 
)
private

Definition at line 2478 of file CSCCathodeLCTProcessor.cc.

References min_separation, and HLT_25ns10e33_v2_cff::quality.

Referenced by findLCTs(), and findLCTsSLHC().

2480  {
2481  int nspan = min_separation;
2482  int pspan = min_separation;
2483 
2484  // if dynamic spacing is enabled, separation is defined by pattern width
2485  //if (dynamic_spacing)
2486  // nspan = pspan = pattern2007[best_patid][NUM_PATTERN_HALFSTRIPS+1]-1;
2487 
2488  for (int hstrip = best_hstrip-nspan; hstrip <= best_hstrip+pspan; hstrip++) {
2489  if (hstrip >= 0 && hstrip < CSCConstants::NUM_HALF_STRIPS_7CFEBS) {
2490  quality[hstrip] = 0;
2491  }
2492  }
2493 } // markBusyKeys -- TMB-07 version.
bool CSCCathodeLCTProcessor::preTrigger ( const std::vector< int >  strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  stripType,
const int  nStrips,
int &  first_bx 
)
private

Definition at line 1260 of file CSCCathodeLCTProcessor.cc.

References fifo_tbins, nplanes_hit_pretrig, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_LAYERS, NUM_PATTERN_STRIPS, pre_hit_pattern, and pulseExtension().

Referenced by findLCTs(), and findLCTsSLHC().

1263 {
1264  static const int hs_thresh = nplanes_hit_pretrig;
1265  static const int ds_thresh = nplanes_hit_pretrig;
1266 
1268  int i_layer, i_strip, this_layer, this_strip;
1269  int hits, layers_hit;
1270  bool hit_layer[CSCConstants::NUM_LAYERS];
1271 
1272  const int pre_trigger_layer_min = (stripType == 1) ? hs_thresh : ds_thresh;
1273 
1274  // Fire half-strip/di-strip one-shots for hit_persist bx's (6 bx's by
1275  // default).
1276  pulseExtension(strip, nStrips, pulse);
1277 
1278  // Now do a loop over different bunch-crossing times.
1279  for (unsigned int bx_time = 0; bx_time < fifo_tbins; bx_time++) {
1280  // For any given bunch-crossing, start at the lowest keystrip and look for
1281  // the number of separate layers in the pattern for that keystrip that have
1282  // pulses at that bunch-crossing time. Do the same for the next keystrip,
1283  // etc. Then do the entire process again for the next bunch-crossing, etc
1284  // until you find a pre-trigger.
1285  for (int key_strip = 0; key_strip < nStrips; key_strip++){
1286  // Clear variables
1287  hits = 0;
1288  layers_hit = 0;
1289  for (i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
1290  hit_layer[i_layer] = false;
1291  // Loop over pattern strips and look for hits.
1292  for (i_strip = 0; i_strip < NUM_PATTERN_STRIPS; i_strip++){
1293  this_layer = pre_hit_pattern[0][i_strip];
1294  this_strip = pre_hit_pattern[1][i_strip]+key_strip;
1295  if (this_strip >= 0 && this_strip < nStrips) {
1296  // Perform bit operation to see if pulse is 1 at a certain bx_time.
1297  if (((pulse[this_layer][this_strip] >> bx_time) & 1) == 1) {
1298  hits++;
1299  // Store number of layers hit.
1300  if (hit_layer[this_layer] == false) {
1301  hit_layer[this_layer] = true;
1302  layers_hit++;
1303 
1304  // Look if number of layers hit is greater or equal than some
1305  // pre-defined threshold.
1306  if (layers_hit >= pre_trigger_layer_min) {
1307  first_bx = bx_time;
1308  return true;
1309  }
1310  }
1311  }
1312  }
1313  }
1314  }
1315  }
1316  // If the pretrigger was never satisfied, then return false.
1317  return false;
1318 } // preTrigger -- idealized version for MC studies.
static const int pre_hit_pattern[2][NUM_PATTERN_STRIPS]
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
bool CSCCathodeLCTProcessor::preTrigger ( const std::vector< int >  strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
unsigned int  pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  stripType,
const int  nStrips,
const int  start_bx,
int &  first_bx 
)
private

Definition at line 1579 of file CSCCathodeLCTProcessor.cc.

References fifo_tbins, infoV, LogTrace, preTrigLookUp(), and pulseExtension().

1583  {
1584  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1585  << "....................PreTrigger...........................";
1586 
1587  if (start_bx == 0) {
1588  // Fire one-shots for hit_persist bx's (6 bx's by default).
1589  pulseExtension(strip, nStrips, pulse);
1590  }
1591 
1592  bool pre_trig = false;
1593  // Now do a loop over bx times to see (if/when) track goes over threshold
1594  for (unsigned int bx_time = start_bx; bx_time < fifo_tbins; bx_time++) {
1595  // For any given bunch-crossing, start at the lowest keystrip and look for
1596  // the number of separate layers in the pattern for that keystrip that have
1597  // pulses at that bunch-crossing time. Do the same for the next keystrip,
1598  // etc. Then do the entire process again for the next bunch-crossing, etc
1599  // until you find a pre-trigger.
1600  pre_trig = preTrigLookUp(pulse, stripType, nStrips, bx_time);
1601  if (pre_trig) {
1602  first_bx = bx_time; // bx at time of pretrigger
1603  return true;
1604  }
1605  } // end loop over bx times
1606 
1607  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1608  << "no pretrigger for strip type " << stripType << ", returning \n";
1609  first_bx = fifo_tbins;
1610  return false;
1611 } // preTrigger -- pre-2007 version.
bool preTrigLookUp(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int stripType, const int nStrips, const unsigned int bx_time)
#define LogTrace(id)
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
bool CSCCathodeLCTProcessor::preTrigger ( const unsigned int  pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  start_bx,
int &  first_bx 
)
private

Definition at line 2303 of file CSCCathodeLCTProcessor.cc.

References best_pid, fifo_tbins, infoV, ispretrig, CSCConstants::KEY_CLCT_LAYER, LogTrace, nhits, nplanes_hit_pretrig, numStrips, pid_thresh_pretrig, ptnFinding(), and stagger.

2305  {
2306  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
2307  << "....................PreTrigger...........................";
2308 
2309  // Max. number of half-strips for this chamber.
2310  const int nStrips = 2*numStrips + 1;
2311 
2312  bool pre_trig = false;
2313  // Now do a loop over bx times to see (if/when) track goes over threshold
2314  for (unsigned int bx_time = start_bx; bx_time < fifo_tbins; bx_time++) {
2315  // For any given bunch-crossing, start at the lowest keystrip and look for
2316  // the number of separate layers in the pattern for that keystrip that have
2317  // pulses at that bunch-crossing time. Do the same for the next keystrip,
2318  // etc. Then do the entire process again for the next bunch-crossing, etc
2319  // until you find a pre-trigger.
2320  bool hits_in_time = ptnFinding(pulse, nStrips, bx_time);
2321  if (hits_in_time) {
2322  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER-1];
2323  hstrip < nStrips; hstrip++) {
2324  if (infoV > 1) {
2325  if (nhits[hstrip] > 0) {
2326  LogTrace("CSCCathodeLCTProcessor")
2327  << " bx = " << std::setw(2) << bx_time << " --->"
2328  << " halfstrip = " << std::setw(3) << hstrip
2329  << " best pid = " << std::setw(2) << best_pid[hstrip]
2330  << " nhits = " << nhits[hstrip];
2331  }
2332  }
2333  ispretrig[hstrip] = 0;
2334  if (nhits[hstrip] >= nplanes_hit_pretrig &&
2335  best_pid[hstrip] >= pid_thresh_pretrig) {
2336  pre_trig = true;
2337  ispretrig[hstrip] = 1;
2338  }
2339  }
2340 
2341  if (pre_trig) {
2342  first_bx = bx_time; // bx at time of pretrigger
2343  return true;
2344  }
2345  }
2346  } // end loop over bx times
2347 
2348  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor") <<
2349  "no pretrigger, returning \n";
2350  first_bx = fifo_tbins;
2351  return false;
2352 } // preTrigger -- TMB-07 version.
bool ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
#define LogTrace(id)
bool ptnFinding(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, const unsigned int bx_time)
int stagger[CSCConstants::NUM_LAYERS]
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
std::vector<int> CSCCathodeLCTProcessor::preTriggerBXs ( ) const
inline

Definition at line 84 of file CSCCathodeLCTProcessor.h.

References thePreTriggerBXs.

84 {return thePreTriggerBXs;}
std::vector< int > thePreTriggerBXs
bool CSCCathodeLCTProcessor::preTrigLookUp ( const unsigned int  pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  stripType,
const int  nStrips,
const unsigned int  bx_time 
)
private

Definition at line 1615 of file CSCCathodeLCTProcessor.cc.

References cfeb_strips, infoV, LogTrace, MAX_CFEBS, nplanes_hit_pretrig, CSCConstants::NUM_LAYERS, NUM_PATTERN_STRIPS, and pre_hit_pattern.

Referenced by preTrigger().

1618  {
1619  static const int hs_thresh = nplanes_hit_pretrig;
1620  static const int ds_thresh = nplanes_hit_pretrig;
1621 
1622  bool hit_layer[CSCConstants::NUM_LAYERS];
1623  int key_strip, this_layer, this_strip, layers_hit;
1624 
1625  // Layers hit threshold for pretrigger
1626  const int pre_trigger_layer_min = (stripType == 1) ? hs_thresh : ds_thresh;
1627 
1628  if (stripType != 0 && stripType != 1) {
1629  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
1630  << "+++ preTrigLookUp: stripType = " << stripType
1631  << " does not correspond to half-strip/di-strip patterns! +++\n";
1632  return false;
1633  }
1634 
1635  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) { // loop over cfebs
1636  // Loop over (di-/half-)strips in CFEB.
1637  for (int istrip = 0; istrip < cfeb_strips[stripType]; istrip++) {
1638  // Calculate candidate key.
1639  key_strip = icfeb*cfeb_strips[stripType] + istrip;
1640  layers_hit = 0;
1641  for (int ilayer = 0; ilayer < CSCConstants::NUM_LAYERS; ilayer++)
1642  hit_layer[ilayer] = false;
1643 
1644  // Loop over strips in pretrigger pattern mask and look for hits.
1645  for (int pstrip = 0; pstrip < NUM_PATTERN_STRIPS; pstrip++) {
1646  this_layer = pre_hit_pattern[0][pstrip];
1647  this_strip = pre_hit_pattern[1][pstrip]+key_strip;
1648 
1649  if (this_strip >= 0 && this_strip < nStrips) {
1650  // Determine if "one shot" is high at this bx_time
1651  if (((pulse[this_layer][this_strip] >> bx_time) & 1) == 1) {
1652  if (hit_layer[this_layer] == false) {
1653  hit_layer[this_layer] = true;
1654  layers_hit++; // determines number of layers hit
1655  if (layers_hit >= pre_trigger_layer_min) {
1656  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1657  << "pretrigger at bx: " << bx_time
1658  << ", cfeb " << icfeb << ", returning";
1659  return true;
1660  }
1661  }
1662  }
1663  }
1664  } // end loop over strips in pretrigger pattern
1665  } // end loop over candidate key strips in cfeb
1666  } // end loop over cfebs, if pretrigger is found, stop looking and return
1667 
1668  return false;
1669 
1670 } // preTrigLookUp -- pre-2007 version.
static const int cfeb_strips[2]
#define LogTrace(id)
static const int pre_hit_pattern[2][NUM_PATTERN_STRIPS]
void CSCCathodeLCTProcessor::printPatterns ( )
private

Definition at line 3024 of file CSCCathodeLCTProcessor.cc.

References gather_cfg::cout, isTMB07, CSCConstants::KEY_CLCT_LAYER, CSCConstants::KEY_CLCT_LAYER_PRE_TMB07, CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07, CSCConstants::NUM_LAYERS, NUM_PATTERN_STRIPS, and pattern.

3024  {
3025  // @@
3026  std::cout<<" Printing patterns for Cathode LCT"<<std::endl;
3027  std::cout<<" ";
3028  for (int patternNum = 0; patternNum < CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07; patternNum++) {
3029  std::cout<<" Pattern "<<patternNum<<" ";
3030  }
3031  std::cout<<std::endl;
3032  std::cout<<" Layer ";
3033  for (int patternNum = 0; patternNum < CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07; patternNum++) {
3034  std::cout<<" Bend "<<(pattern[patternNum][NUM_PATTERN_STRIPS]==0 ? "L": "R")<<" ";
3035  }
3036  std::cout<<std::endl;
3037  for (int layer = 0; layer < CSCConstants::NUM_LAYERS; layer++) {
3038  for (int patternNum = 0; patternNum < CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07; patternNum++) {
3039  if (patternNum == 0) std::cout<<" "<<layer<<" ";
3040  if ((isTMB07 && layer != CSCConstants::KEY_CLCT_LAYER-1) ||
3041  (!isTMB07 && layer != CSCConstants::KEY_CLCT_LAYER_PRE_TMB07-1)) {//that old counting from 1 vs 0 thing.
3042  int minStrip =0;
3043  if ((isTMB07 && layer < CSCConstants::KEY_CLCT_LAYER-1) ||
3045  minStrip = 3*layer;
3046  } else {
3047  minStrip = 3*layer - 2;// since on the key layer we only have 1 strip
3048  }
3049  for (int strip = minStrip; strip < minStrip + 3; strip++) {
3050  if (layer == pattern[patternNum][strip]) {
3051  std::cout<<"X";
3052  } else {
3053  std::cout<<"_";
3054  }
3055  }
3056  } else {// on the key layer we always have a hit, right?
3057  std::cout<<" X ";
3058  }
3059  std::cout<<" ";
3060  }
3061  std::cout<<std::endl;
3062  }
3063 }
static const int pattern[CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07][NUM_PATTERN_STRIPS+1]
tuple cout
Definition: gather_cfg.py:145
void CSCCathodeLCTProcessor::priorityEncode ( const int  h_keyStrip[MAX_CFEBS],
const unsigned int  h_nhits[MAX_CFEBS],
const int  d_keyStrip[MAX_CFEBS],
const unsigned int  d_nhits[MAX_CFEBS],
int  keystrip_data[2][7] 
)
private

Definition at line 1739 of file CSCCathodeLCTProcessor.cc.

References cfeb_strips, CLCT_CFEB, CLCT_STRIP, CLCT_STRIP_TYPE, infoV, j, relval_steps::key, LogTrace, MAX_CFEBS, and nplanes_hit_pretrig.

Referenced by findLCTs().

1742  {
1743  static const unsigned int hs_thresh = nplanes_hit_pretrig;
1744  //static const unsigned int ds_thresh = nplanes_hit_pretrig;
1745 
1746  int ihits[2]; // hold hits for sorting
1747  int cfebs[2]; // holds CFEB numbers corresponding to highest hits
1748  const int nlcts = 2;
1749  int key_strip[MAX_CFEBS], key_phits[MAX_CFEBS], strip_type[MAX_CFEBS];
1750 
1751  // initialize arrays
1752  for (int ilct = 0; ilct < nlcts; ilct++) {
1753  for (int j = 0; j < 7; j++) keystrip_data[ilct][j] = -1;
1754  ihits[ilct] = 0;
1755  cfebs[ilct] = -1;
1756  }
1757  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1758  key_strip[icfeb] = -1;
1759  key_phits[icfeb] = -1;
1760  strip_type[icfeb] = -1;
1761  }
1762 
1763  if (infoV > 1) {
1764  LogTrace("CSCCathodeLCTProcessor")
1765  << ".....................PriorityEncode.......................";
1766  std::ostringstream strstrm;
1767  strstrm << "hkeys:";
1768  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1769  strstrm << std::setw(4) << h_keyStrip[icfeb];
1770  }
1771  strstrm << "\ndkeys:";
1772  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1773  strstrm << std::setw(4) << d_keyStrip[icfeb];
1774  }
1775  LogTrace("CSCCathodeLCTProcessor") << strstrm.str();
1776  }
1777 
1778  // Loop over CFEBs and determine better of half- or di- strip pattern.
1779  // If select halfstrip, promote it by adding an extra bit to its hits.
1780  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1781  if (h_keyStrip[icfeb] != -1 && d_keyStrip[icfeb] != -1) {
1782  if (h_nhits[icfeb] >= hs_thresh) {
1783  key_strip[icfeb] = h_keyStrip[icfeb];
1784  key_phits[icfeb] = h_nhits[icfeb] + 8; // halfstrip promotion
1785  strip_type[icfeb]= 1;
1786  }
1787  // For di-strip envelope there is no requirement that the number of
1788  // layers hit is >= ds_thresh!!!
1789  // else if (d_nhits[icfeb] >= ds_thresh) {
1790  else {
1791  key_strip[icfeb] = d_keyStrip[icfeb];
1792  key_phits[icfeb] = d_nhits[icfeb];
1793  strip_type[icfeb]= 0;
1794  }
1795  }
1796  else if (h_keyStrip[icfeb] != -1) {
1797  if (h_nhits[icfeb] >= hs_thresh) {
1798  key_strip[icfeb] = h_keyStrip[icfeb];
1799  key_phits[icfeb] = h_nhits[icfeb] + 8; // halfstrip promotion
1800  strip_type[icfeb]= 1;
1801  }
1802  }
1803  else if (d_keyStrip[icfeb] != -1) {
1804  // if (d_nhits[icfeb] >= ds_thresh) {
1805  key_strip[icfeb] = d_keyStrip[icfeb];
1806  key_phits[icfeb] = d_nhits[icfeb];
1807  strip_type[icfeb]= 0;
1808  // }
1809  }
1810  if (infoV > 1 && strip_type[icfeb] != -1) {
1811  if (strip_type[icfeb] == 0)
1812  LogTrace("CSCCathodeLCTProcessor")
1813  << " taking distrip pattern on cfeb " << icfeb;
1814  else if (strip_type[icfeb] == 1)
1815  LogTrace("CSCCathodeLCTProcessor")
1816  << " taking halfstrip pattern on cfeb " << icfeb;
1817  LogTrace("CSCCathodeLCTProcessor")
1818  << " cfeb " << icfeb << " key " << key_strip[icfeb]
1819  << " hits " << key_phits[icfeb] << " type " << strip_type[icfeb];
1820  }
1821  }
1822 
1823  // Remove duplicate LCTs at boundaries -- it is possilbe to have key[0]
1824  // be the higher of the two key strips, take this into account, but
1825  // preserve rank of lcts.
1826  int key[MAX_CFEBS];
1827  int loedge, hiedge;
1828 
1829  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1830  << "...... Remove Duplicates ......";
1831  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1832  if(strip_type[icfeb] == 0) key[icfeb] = key_strip[icfeb]*4;
1833  else key[icfeb] = key_strip[icfeb];
1834  }
1835  for (int icfeb = 0; icfeb < MAX_CFEBS-1; icfeb++) {
1836  if (key[icfeb] >= 0 && key[icfeb+1] >= 0) {
1837  loedge = cfeb_strips[1]*(icfeb*8+7)/8;
1838  hiedge = cfeb_strips[1]*(icfeb*8+9)/8 - 1;
1839  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1840  << " key 1: " << key[icfeb] << " key 2: " << key[icfeb+1]
1841  << " low edge: " << loedge << " high edge: " << hiedge;
1842  if (key[icfeb] >= loedge && key[icfeb+1] <= hiedge) {
1843  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1844  << "Duplicate LCTs found at boundary of CFEB " << icfeb << " ...";
1845  if (key_phits[icfeb+1] > key_phits[icfeb]) {
1846  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1847  << " deleting LCT on CFEB " << icfeb;
1848  key_strip[icfeb] = -1;
1849  key_phits[icfeb] = -1;
1850  }
1851  else {
1852  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1853  << " deleting LCT on CFEB " << icfeb+1;
1854  key_strip[icfeb+1] = -1;
1855  key_phits[icfeb+1] = -1;
1856  }
1857  }
1858  }
1859  }
1860 
1861  // Now loop over CFEBs and pick best two lcts based on no. hits in envelope.
1862  // In case of equal quality, select the one on lower-numbered CFEBs.
1863  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1864  << "\n...... Select best LCTs ......";
1865  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1866  if (key_phits[icfeb] > ihits[0]) {
1867  ihits[1] = ihits[0];
1868  cfebs[1] = cfebs[0];
1869  ihits[0] = key_phits[icfeb];
1870  cfebs[0] = icfeb;
1871  if (infoV > 1) {
1872  std::ostringstream strstrm;
1873  for (int icfeb = 0; icfeb < MAX_CFEBS; icfeb++) {
1874  strstrm << std::setw(4) << strip_type[icfeb];
1875  }
1876  LogTrace("CSCCathodeLCTProcessor")
1877  << "strip_type" << strstrm.str()
1878  << "\n best: ihits " << ihits[0] << " cfeb " << cfebs[0]
1879  << " strip_type " << ((cfebs[0] >= 0) ? strip_type[cfebs[0]] : -1)
1880  << "\n next: ihits " << ihits[1] << " cfeb " << cfebs[1]
1881  << " strip_type " << ((cfebs[1] >= 0) ? strip_type[cfebs[1]] : -1);
1882  }
1883  }
1884  else if (key_phits[icfeb] > ihits[1]) {
1885  ihits[1] = key_phits[icfeb];
1886  cfebs[1] = icfeb;
1887  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1888  << "\n next: ihits " << ihits[1] << " cfeb " << cfebs[1]
1889  << " strip_type " << ((cfebs[1] >= 0) ? strip_type[cfebs[1]] : -1);
1890  }
1891  }
1892 
1893  // fill lct data array key strip with 2 highest hit lcts (if they exist)
1894  int jlct = 0;
1895  for (int ilct = 0; ilct < nlcts; ilct++) {
1896  if (cfebs[ilct] != -1) {
1897  keystrip_data[jlct][CLCT_CFEB] = cfebs[ilct];
1898  keystrip_data[jlct][CLCT_STRIP] = key_strip[cfebs[ilct]];
1899  keystrip_data[jlct][CLCT_STRIP_TYPE] = strip_type[cfebs[ilct]];
1900  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1901  << "filling key: " << key_strip[cfebs[ilct]]
1902  << " type: " << strip_type[cfebs[ilct]];
1903  jlct++;
1904  }
1905  }
1906 } // priorityEncode -- pre-2007 version.
static const int cfeb_strips[2]
int j
Definition: DBlmapReader.cc:9
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
#define LogTrace(id)
bool CSCCathodeLCTProcessor::ptnFinding ( const unsigned int  pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  nStrips,
const unsigned int  bx_time 
)
private

Definition at line 2356 of file CSCCathodeLCTProcessor.cc.

References best_pid, fifo_tbins, first_bx_corrected, hit_persist, infoV, CSCConstants::KEY_CLCT_LAYER, LogTrace, nhits, nplanes_hit_pretrig, CSCConstants::NUM_CLCT_PATTERNS, CSCConstants::NUM_LAYERS, NUM_PATTERN_HALFSTRIPS, pattern2007, pattern2007_offset, sysUtil::pid, pid_thresh_pretrig, and stagger.

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

2359 {
2360  if (bx_time >= fifo_tbins) return false;
2361 
2362  // This loop is a quick check of a number of layers hit at bx_time: since
2363  // most of the time it is 0, this check helps to speed-up the execution
2364  // substantially.
2365  unsigned int layers_hit = 0;
2366  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
2367  {
2368  for (int i_hstrip = 0; i_hstrip < nStrips; i_hstrip++)
2369  {
2370  if (((pulse[i_layer][i_hstrip] >> bx_time) & 1) == 1)
2371  {
2372  layers_hit++;
2373  break;
2374  }
2375  }
2376  }
2377  if (layers_hit < nplanes_hit_pretrig) return false;
2378 
2379  for (int key_hstrip = 0; key_hstrip < nStrips; key_hstrip++)
2380  {
2381  best_pid[key_hstrip] = 0;
2382  nhits[key_hstrip] = 0;
2383  first_bx_corrected[key_hstrip] = -999;
2384  }
2385 
2386  // Loop over candidate key strips.
2387  bool hit_layer[CSCConstants::NUM_LAYERS];
2388  for (int key_hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; key_hstrip < nStrips; key_hstrip++)
2389  {
2390  // Loop over patterns and look for hits matching each pattern.
2391  for (unsigned int pid = CSCConstants::NUM_CLCT_PATTERNS - 1; pid >= pid_thresh_pretrig; pid--)
2392  {
2393  layers_hit = 0;
2394  for (int ilayer = 0; ilayer < CSCConstants::NUM_LAYERS; ilayer++)
2395  hit_layer[ilayer] = false;
2396 
2397  double num_pattern_hits=0., times_sum=0.;
2398  std::multiset<int> mset_for_median;
2399  mset_for_median.clear();
2400 
2401  // Loop over halfstrips in trigger pattern mask and calculate the
2402  // "absolute" halfstrip number for each.
2403  for (int strip_num = 0; strip_num < NUM_PATTERN_HALFSTRIPS; strip_num++)
2404  {
2405  int this_layer = pattern2007[pid][strip_num];
2406  if (this_layer >= 0 && this_layer < CSCConstants::NUM_LAYERS)
2407  {
2408  int this_strip = pattern2007_offset[strip_num] + key_hstrip;
2409  if (this_strip >= 0 && this_strip < nStrips) {
2410  if (infoV > 3) LogTrace("CSCCathodeLCTProcessor")
2411  << " In ptnFinding: key_strip = " << key_hstrip
2412  << " pid = " << pid << " strip_num = " << strip_num
2413  << " layer = " << this_layer << " strip = " << this_strip;
2414  // Determine if "one shot" is high at this bx_time
2415  if (((pulse[this_layer][this_strip] >> bx_time) & 1) == 1)
2416  {
2417  if (hit_layer[this_layer] == false)
2418  {
2419  hit_layer[this_layer] = true;
2420  layers_hit++; // determines number of layers hit
2421  }
2422 
2423  // find at what bx did pulse on this halsfstrip&layer have started
2424  // use hit_pesrist constraint on how far back we can go
2425  int first_bx_layer = bx_time;
2426  for (unsigned int dbx = 0; dbx < hit_persist; dbx++)
2427  {
2428  if (((pulse[this_layer][this_strip] >> (first_bx_layer - 1)) & 1) == 1)
2429  first_bx_layer--;
2430  else
2431  break;
2432  }
2433  times_sum += (double) first_bx_layer;
2434  num_pattern_hits += 1.;
2435  mset_for_median.insert(first_bx_layer);
2436  if (infoV > 2)
2437  LogTrace("CSCCathodeLCTProcessor") << " 1st bx in layer: " << first_bx_layer << " sum bx: " << times_sum
2438  << " #pat. hits: " << num_pattern_hits;
2439  }
2440  }
2441  }
2442  } // end loop over strips in pretrigger pattern
2443 
2444  if (layers_hit > nhits[key_hstrip])
2445  {
2446  best_pid[key_hstrip] = pid;
2447  nhits[key_hstrip] = layers_hit;
2448 
2449  // calculate median
2450  const int sz = mset_for_median.size();
2451  if (sz>0){
2452  std::multiset<int>::iterator im = mset_for_median.begin();
2453  if (sz>1) std::advance(im,sz/2-1);
2454  if (sz==1) first_bx_corrected[key_hstrip] = *im;
2455  else if ((sz % 2) == 1) first_bx_corrected[key_hstrip] = *(++im);
2456  else first_bx_corrected[key_hstrip] = ((*im) + (*(++im)))/2;
2457 
2458  if (infoV > 1) {
2459  char bxs[300]="";
2460  for (im = mset_for_median.begin(); im != mset_for_median.end(); im++)
2461  sprintf(bxs,"%s %d", bxs, *im);
2462  LogTrace("CSCCathodeLCTProcessor")
2463  <<"bx="<<bx_time<<" bx_cor="<< first_bx_corrected[key_hstrip]<<" bxset="<<bxs;
2464  }
2465  }
2466 
2467  // Do not loop over the other (worse) patterns if max. numbers of
2468  // hits is found.
2469  if (nhits[key_hstrip] == CSCConstants::NUM_LAYERS) break;
2470  }
2471  } // end loop over pid
2472  } // end loop over candidate key strips
2473  return true;
2474 } // ptnFinding -- TMB-07 version.
int first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
static const int pattern2007[CSCConstants::NUM_CLCT_PATTERNS][NUM_PATTERN_HALFSTRIPS+2]
#define LogTrace(id)
tuple pid
Definition: sysUtil.py:22
int stagger[CSCConstants::NUM_LAYERS]
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
static const int pattern2007_offset[NUM_PATTERN_HALFSTRIPS]
void CSCCathodeLCTProcessor::pulseExtension ( const std::vector< int >  time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  nStrips,
unsigned int  pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS] 
)
private

Definition at line 2255 of file CSCCathodeLCTProcessor.cc.

References hit_persist, i, infoV, CSCConstants::NUM_LAYERS, findQualityFiles::size, and start_bx_shift.

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

2258  {
2259 
2260  static const unsigned int bits_in_pulse = 8*sizeof(pulse[0][0]);
2261 
2262  // Clear pulse array. This array will be used as a bit representation of
2263  // hit times. For example: if strip[1][2] has a value of 3, then 1 shifted
2264  // left 3 will be bit pattern of pulse[1][2]. This would make the pattern
2265  // look like 0000000000001000. Then add on additional bits to signify
2266  // the duration of a signal (hit_persist, formerly bx_width) to simulate
2267  // the TMB's drift delay. So for the same pulse[1][2] with a hit_persist
2268  // of 3 would look like 0000000000111000. This is similating the digital
2269  // one-shot in the TMB.
2270  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
2271  for (int i_strip = 0; i_strip < nStrips; i_strip++)
2272  pulse[i_layer][i_strip] = 0;
2273 
2274  // Loop over all layers and halfstrips.
2275  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
2276  for (int i_strip = 0; i_strip < nStrips; i_strip++) {
2277  // If there is a hit, simulate digital one-shot persistence starting
2278  // in the bx of the initial hit. Fill this into pulse[][].
2279  if (time[i_layer][i_strip].size() > 0) {
2280  std::vector<int> bx_times = time[i_layer][i_strip];
2281  for (unsigned int i = 0; i < bx_times.size(); i++) {
2282  // Check that min and max times are within the allowed range.
2283  if (bx_times[i] < 0 || bx_times[i] + hit_persist >= bits_in_pulse) {
2284  if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeDigi")
2285  << "+++ BX time of comparator digi (halfstrip = " << i_strip
2286  << " layer = " << i_layer << ") bx = " << bx_times[i]
2287  << " is not within the range (0-" << bits_in_pulse
2288  << "] allowed for pulse extension. Skip this digi! +++\n";
2289  continue;
2290  }
2291  if (bx_times[i] >= start_bx_shift) {
2292  for (unsigned int bx = bx_times[i]; bx < bx_times[i] + hit_persist; ++bx)
2293  pulse[i_layer][i_strip] = pulse[i_layer][i_strip] | (1 << bx);
2294  }
2295  }
2296  }
2297  }
2298  }
2299 } // pulseExtension.
int i
Definition: DBlmapReader.cc:9
tuple size
Write out results.
void CSCCathodeLCTProcessor::readComparatorDigis ( std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
std::vector< int >  distrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS] 
)
private

Definition at line 931 of file CSCCathodeLCTProcessor.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, digiV, distripStagger(), fifo_tbins, CSCComparatorDigi::getComparator(), CSCComparatorDigi::getStrip(), CSCComparatorDigi::getTimeBin(), i, infoV, isTMB07, j, LogTrace, CSCConstants::MAX_NUM_STRIPS, CSCConstants::MAX_NUM_STRIPS_7CFEBS, CSCConstants::NUM_LAYERS, numStrips, stagger, and testDistripStagger().

Referenced by run().

933  {
934  // Two-argument version for pre-TMB07 (halfstrip and distrips) firmware.
935  // Takes the comparator & time info and stuffs it into halfstrip and (and
936  // possibly distrip) vector.
937 
941  for (int i = 0; i < CSCConstants::NUM_LAYERS; i++){
942  for (int j = 0; j < CSCConstants::MAX_NUM_STRIPS_7CFEBS; j++) {
943  time[i][j] = -999;
944  comp[i][j] = 0;
945  digiNum[i][j] = -999;
946  }
947  }
948 
949  for (int i = 0; i < CSCConstants::NUM_LAYERS; i++) {
950  std::vector <CSCComparatorDigi> layerDigiV = digiV[i];
951  for (unsigned int j = 0; j < layerDigiV.size(); j++) {
952  // Get one digi at a time for the layer. -Jm
953  CSCComparatorDigi thisDigi = layerDigiV[j];
954 
955  // Dump raw digi info
956  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
957  << "Comparator digi: comparator = " << thisDigi.getComparator()
958  << " strip #" << thisDigi.getStrip()
959  << " time bin = " << thisDigi.getTimeBin();
960 
961  // Get comparator: 0/1 for left/right halfstrip for each comparator
962  // that fired.
963  int thisComparator = thisDigi.getComparator();
964  if (thisComparator != 0 && thisComparator != 1) {
965  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
966  << "+++ Comparator digi with wrong comparator value: digi #" << j
967  << ", comparator = " << thisComparator << "; skipping it... +++\n";
968  continue;
969  }
970 
971  // Get strip number.
972  int thisStrip = thisDigi.getStrip() - 1; // count from 0
973  if (thisStrip < 0 || thisStrip >= numStrips) {
974  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
975  << "+++ Comparator digi with wrong strip number: digi #" << j
976  << ", strip = " << thisStrip
977  << ", max strips = " << numStrips << "; skipping it... +++\n";
978  continue;
979  }
980 
981  // Get Bx of this Digi and check that it is within the bounds
982  int thisDigiBx = thisDigi.getTimeBin();
983 
984  // Total number of time bins in DAQ readout is given by fifo_tbins,
985  // which thus determines the maximum length of time interval.
986  if (thisDigiBx >= 0 && thisDigiBx < static_cast<int>(fifo_tbins)) {
987 
988  // If there is more than one hit in the same strip, pick one
989  // which occurred earlier.
990  // In reality, the second hit on the same distrip is ignored only
991  // during the number of clocks defined by the "hit_persist"
992  // parameter (i.e., 6 bx's by default). So if one simulates
993  // a large number of bx's in a crowded environment, this
994  // approximation here may not be sufficiently good.
995  if (time[i][thisStrip] == -999 || time[i][thisStrip] > thisDigiBx) {
996  digiNum[i][thisStrip] = j;
997  time[i][thisStrip] = thisDigiBx;
998  comp[i][thisStrip] = thisComparator;
999  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1000  << "Comp digi: layer " << i+1
1001  << " digi #" << j+1
1002  << " strip " << thisStrip
1003  << " halfstrip " << 2*thisStrip + comp[i][thisStrip] + stagger[i]
1004  << " distrip " << thisStrip/2 + // [0-39]
1005  ((thisStrip%2 == 1 && comp[i][thisStrip] == 1 && stagger[i] == 1) ? 1 : 0)
1006  << " time " << time[i][thisStrip]
1007  << " comparator " << comp[i][thisStrip]
1008  << " stagger " << stagger[i];
1009  }
1010  }
1011  else {
1012  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
1013  << "+++ Skipping comparator digi: strip = " << thisStrip
1014  << ", layer = " << i+1 << ", bx = " << thisDigiBx << " +++";
1015  }
1016  }
1017  }
1018 
1019  // Take the comparator & time info and stuff it into half- and di-strip
1020  // arrays.
1021  for (int i = 0; i < CSCConstants::NUM_LAYERS; i++) {
1022  // Use the comparator info to setup the halfstrips and distrips. -BT
1023  // This loop is only for halfstrips.
1024  for (int j = 0; j < CSCConstants::MAX_NUM_STRIPS_7CFEBS; j++) {
1025  if (time[i][j] >= 0) {
1026  int i_halfstrip = 2*j + comp[i][j] + stagger[i];
1027  // 2*j : convert strip to 1/2 strip
1028  // comp : comparator output
1029  // stagger: stagger for this layer
1030  if (i_halfstrip >= 2*numStrips + 1) {
1031  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
1032  << "+++ Found wrong halfstrip number = " << i_halfstrip
1033  << "; skipping this digi... +++\n";
1034  continue;
1035  }
1036  halfstrip[i][i_halfstrip].push_back(time[i][j]);
1037  }
1038  }
1039 
1040  // There are no di-strips in the 2007 version of the TMB firmware.
1041  if (!isTMB07) {
1042  // This loop is only for distrips. We have to separate the routines
1043  // because triad and time arrays can be changed by the distripStagger
1044  // routine which could mess up the halfstrips.
1045  static std::atomic<int> test_iteration{0};
1046  for (int j = 0; j < CSCConstants::MAX_NUM_STRIPS; j++){
1047  if (time[i][j] >= 0) {
1048  int i_distrip = j/2;
1049  if (j%2 == 1 && comp[i][j] == 1 && stagger[i] == 1) {
1050  // @@ Needs to be checked.
1051  bool stagger_debug = (infoV > 2);
1052  distripStagger(comp[i], time[i], digiNum[i], j, stagger_debug);
1053  }
1054  // comp[i][j] == 1 : hit on right half-strip.
1055  // stagger[i] == 1 : half-strips are shifted by 1.
1056  // if these conditions are met add 1; otherwise add 0.
1057  // So if there is a hit on the far right half-strip, and the
1058  // half-strips have been staggered to the right, then the di-strip
1059  // would actually correspond to the next highest di-strip. -JM
1060  if (infoV > 2 && test_iteration == 1) {
1062  test_iteration++;
1063  }
1064  if (i_distrip >= numStrips/2 + 1) {
1065  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
1066  << "+++ Found wrong distrip number = " << i_distrip
1067  << "; skipping this digi... +++\n";
1068  continue;
1069  }
1070  distrip[i][i_distrip].push_back(time[i][j]);
1071  }
1072  }
1073  }
1074  }
1075 }
int i
Definition: DBlmapReader.cc:9
static void distripStagger(int stag_triad[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int stag_time[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int stag_digi[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int i_distrip, bool debug=false)
int getStrip() const
Get the strip number.
int getComparator() const
Get Comparator readings.
int getTimeBin() const
Return bin number of first time bin which is ON. Counts from 0.
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
int stagger[CSCConstants::NUM_LAYERS]
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
void CSCCathodeLCTProcessor::readComparatorDigis ( std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
private

Definition at line 833 of file CSCCathodeLCTProcessor.cc.

References begin, digiV, fifo_tbins, hit_persist, i, infoV, LogTrace, CSCConstants::NUM_LAYERS, numStrips, and stagger.

834  {
835  // Single-argument version for TMB07 (halfstrip-only) firmware.
836  // Takes the comparator & time info and stuffs it into halfstrip vector.
837  // Multiple hits on the same strip are allowed.
838 
839  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
840  int i_digi = 0; // digi counter, for dumps.
841  for (std::vector<CSCComparatorDigi>::iterator pld = digiV[i_layer].begin();
842  pld != digiV[i_layer].end(); pld++, i_digi++) {
843  // Dump raw digi info.
844  if (infoV > 1) {
845  std::ostringstream strstrm;
846  strstrm << "Comparator digi: comparator = " << pld->getComparator()
847  << " strip #" << pld->getStrip()
848  << " time bins on:";
849  std::vector<int> bx_times = pld->getTimeBinsOn();
850  for (unsigned int tbin = 0; tbin < bx_times.size(); tbin++)
851  strstrm << " " << bx_times[tbin];
852  LogTrace("CSCCathodeLCTProcessor") << strstrm.str();
853  }
854 
855  // Get comparator: 0/1 for left/right halfstrip for each comparator
856  // that fired.
857  int thisComparator = pld->getComparator();
858  if (thisComparator != 0 && thisComparator != 1) {
859  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
860  << "+++ Found comparator digi with wrong comparator value = "
861  << thisComparator << "; skipping it... +++\n";
862  continue;
863  }
864 
865  // Get strip number.
866  int thisStrip = pld->getStrip() - 1; // count from 0
867  if (thisStrip < 0 || thisStrip >= numStrips) {
868  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
869  << "+++ Found comparator digi with wrong strip number = "
870  << thisStrip
871  << " (max strips = " << numStrips << "); skipping it... +++\n";
872  continue;
873  }
874  // 2*strip: convert strip to 1/2 strip
875  // comp : comparator output
876  // stagger: stagger for this layer
877  int thisHalfstrip = 2*thisStrip + thisComparator + stagger[i_layer];
878  if (thisHalfstrip >= 2*numStrips + 1) {
879  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
880  << "+++ Found wrong halfstrip number = " << thisHalfstrip
881  << "; skipping this digi... +++\n";
882  continue;
883  }
884 
885  // Get bx times on this digi and check that they are within the bounds.
886  std::vector<int> bx_times = pld->getTimeBinsOn();
887  for (unsigned int i = 0; i < bx_times.size(); i++) {
888  // Total number of time bins in DAQ readout is given by fifo_tbins,
889  // which thus determines the maximum length of time interval.
890  //
891  // In TMB07 version, better data-emulator agreement is
892  // achieved when hits in the first 2 time bins are excluded.
893  // As of May 2009, the reasons for this are not fully
894  // understood yet (the work is on-going).
895  if (bx_times[i] > 1 && bx_times[i] < static_cast<int>(fifo_tbins)) {
896 
897  if (i == 0 || (i > 0 && bx_times[i]-bx_times[i-1] >=
898  static_cast<int>(hit_persist))) {
899  // A later hit on the same strip is ignored during the
900  // number of clocks defined by the "hit_persist" parameter
901  // (i.e., 6 bx's by default).
902  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
903  << "Comp digi: layer " << i_layer+1
904  << " digi #" << i_digi+1
905  << " strip " << thisStrip
906  << " halfstrip " << thisHalfstrip
907  << " distrip " << thisStrip/2 + // [0-39]
908  ((thisStrip%2 == 1 && thisComparator == 1 && stagger[i_layer] == 1) ? 1 : 0)
909  << " time " << bx_times[i]
910  << " comparator " << thisComparator
911  << " stagger " << stagger[i_layer];
912  halfstrip[i_layer][thisHalfstrip].push_back(bx_times[i]);
913  }
914  else if (i > 0) {
915  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
916  << " Skipping comparator digi: strip = " << thisStrip
917  << ", layer = " << i_layer+1 << ", bx = " << bx_times[i]
918  << ", bx of previous hit = " << bx_times[i-1];
919  }
920  }
921  else {
922  if (infoV > 1) LogTrace("CSCCathodeLCTProcessor")
923  << "+++ Skipping comparator digi: strip = " << thisStrip
924  << ", layer = " << i_layer+1 << ", bx = " << bx_times[i] << " +++";
925  }
926  }
927  }
928  }
929 }
int i
Definition: DBlmapReader.cc:9
#define LogTrace(id)
int stagger[CSCConstants::NUM_LAYERS]
#define begin
Definition: vmac.h:30
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::readoutCLCTs ( )

Returns vector of CLCTs in the read-out time window, if any.

Definition at line 2836 of file CSCCathodeLCTProcessor.cc.

References early_tbins, getCLCTs(), infoV, LogDebug, MAX_CLCT_BINS, readout_earliest_2, and tmb_l1a_window_size.

2836  {
2837  std::vector<CSCCLCTDigi> tmpV;
2838 
2839  // The start time of the L1A*CLCT coincidence window should be
2840  // related to the fifo_pretrig parameter, but I am not completely
2841  // sure how. For now, just choose it such that the window is
2842  // centered at bx=7. This may need further tweaking if the value of
2843  // tmb_l1a_window_size changes.
2844  // static int fpga_latency = 3;
2845  // static int early_tbins = fifo_pretrig - fpga_latency;
2846  // static int early_tbins = 4;
2847 
2848  // The number of CLCT bins in the read-out is given by the
2849  // tmb_l1a_window_size parameter, but made even by setting the LSB
2850  // of tmb_l1a_window_size to 0.
2851  //
2852  static std::atomic<int> lct_bins;
2854  static std::atomic<int> late_tbins;
2855  late_tbins = early_tbins + lct_bins;
2856 
2857  static std::atomic<int> ifois{0};
2858  if (ifois == 0) {
2859  if (infoV >= 0 && early_tbins < 0) {
2860  edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
2861  << "+++ early_tbins = " << early_tbins
2862  << "; in-time CLCTs are not getting read-out!!! +++" << "\n";
2863  }
2864 
2865  if (late_tbins > MAX_CLCT_BINS-1) {
2866  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
2867  << "+++ Allowed range of time bins, [0-" << late_tbins
2868  << "] exceeds max allowed, " << MAX_CLCT_BINS-1 << " +++\n"
2869  << "+++ Set late_tbins to max allowed +++\n";
2870  late_tbins = MAX_CLCT_BINS-1;
2871  }
2872  ifois = 1;
2873  }
2874 
2875  // Start from the vector of all found CLCTs and select those within
2876  // the CLCT*L1A coincidence window.
2877  int bx_readout = -1;
2878  std::vector<CSCCLCTDigi> all_lcts = getCLCTs();
2879  for (std::vector <CSCCLCTDigi>::const_iterator plct = all_lcts.begin();
2880  plct != all_lcts.end(); plct++) {
2881  if (!plct->isValid()) continue;
2882 
2883  int bx = (*plct).getBX();
2884  // Skip CLCTs found too early relative to L1Accept.
2885  if (bx <= early_tbins) {
2886  if (infoV > 1) LogDebug("CSCCathodeLCTProcessor")
2887  << " Do not report CLCT on key halfstrip " << plct->getKeyStrip()
2888  << ": found at bx " << bx << ", whereas the earliest allowed bx is "
2889  << early_tbins+1;
2890  continue;
2891  }
2892 
2893  // Skip CLCTs found too late relative to L1Accept.
2894  if (bx > late_tbins) {
2895  if (infoV > 1) LogDebug("CSCCathodeLCTProcessor")
2896  << " Do not report CLCT on key halfstrip " << plct->getKeyStrip()
2897  << ": found at bx " << bx << ", whereas the latest allowed bx is "
2898  << late_tbins;
2899  continue;
2900  }
2901 
2902  // If (readout_earliest_2) take only CLCTs in the earliest bx in the read-out window:
2903  // in digi->raw step, LCTs have to be packed into the TMB header, and
2904  // currently there is room just for two.
2905  if (readout_earliest_2) {
2906  if (bx_readout == -1 || bx == bx_readout) {
2907  tmpV.push_back(*plct);
2908  if (bx_readout == -1) bx_readout = bx;
2909  }
2910  }
2911  else tmpV.push_back(*plct);
2912  }
2913  return tmpV;
2914 }
#define LogDebug(id)
std::vector< CSCCLCTDigi > getCLCTs()
std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::run ( const CSCComparatorDigiCollection compdc)

Runs the LCT processor code. Called in normal running – gets info from a collection of comparator digis.

Definition at line 544 of file CSCCathodeLCTProcessor.cc.

References CSCTriggerGeomManager::chamber(), disableME1a, dumpConfigParams(), relativeConstraints::empty, gangedME1a, CSCLayer::geometry(), CSCTriggerGeometry::get(), getCLCTs(), getDigis(), infoV, isME11, isSLHC, isTMB07, CSCChamber::layer(), CSCConstants::MAX_NUM_STRIPS_7CFEBS, nplanes_hit_pretrig, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_LAYERS, CSCLayerGeometry::numberOfStrips(), numStrips, readComparatorDigis(), smartME1aME1b, CSCLayerGeometry::stagger(), stagger, theChamber, theEndcap, theRing, theSector, theStation, theSubsector, and theTrigChamber.

544  {
545  // This is the version of the run() function that is called when running
546  // over the entire detector. It gets the comparator & timing info from the
547  // comparator digis and then passes them on to another run() function.
548 
549  // clear(); // redundant; called by L1MuCSCMotherboard.
550 
551  static std::atomic<bool> config_dumped{false};
552  if ((infoV > 0 || isSLHC) && !config_dumped) {
553  //std::cerr<<"**** CLCT run parameters dump ****"<<std::endl;
555  config_dumped = true;
556  }
557 
558  // Get the number of strips and stagger of layers for the given chamber.
559  // Do it only once per chamber.
560  if (numStrips == 0) {
562  CSCChamber* chamber = theGeom->chamber(theEndcap, theStation, theSector,
564  if (chamber) {
565  numStrips = chamber->layer(1)->geometry()->numberOfStrips();
566  // ME1/a is known to the readout hardware as strips 65-80 of ME1/1.
567  // Still need to decide whether we do any special adjustments to
568  // reconstruct LCTs in this region (3:1 ganged strips); for now, we
569  // simply allow for hits in ME1/a and apply standard reconstruction
570  // to them.
571  // For SLHC ME1/1 is set to have 4 CFEBs in ME1/b and 3 CFEBs in ME1/a
572  if (isME11) {
573  if (!smartME1aME1b && !disableME1a && theRing == 1 && !gangedME1a) numStrips = 112;
574  if (!smartME1aME1b && !disableME1a && theRing == 1 && gangedME1a) numStrips = 80;
575  if (!smartME1aME1b && disableME1a && theRing == 1 ) numStrips = 64;
576  if ( smartME1aME1b && !disableME1a && theRing == 1 ) numStrips = 64;
577  if ( smartME1aME1b && !disableME1a && theRing == 4 ) {
578  if (gangedME1a) numStrips = 16;
579  else numStrips = 48;
580  }
581  }
582 
584  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
585  << "+++ Number of strips, " << numStrips
586  << " found in ME" << ((theEndcap == 1) ? "+" : "-")
587  << theStation << "/" << theRing << "/" << theChamber
588  << " (sector " << theSector << " subsector " << theSubsector
589  << " trig id. " << theTrigChamber << ")"
590  << " exceeds max expected, " << CSCConstants::MAX_NUM_STRIPS_7CFEBS
591  << " +++\n"
592  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
593  numStrips = -1;
594  }
595  // The strips for a given layer may be offset from the adjacent layers.
596  // This was done in order to improve resolution. We need to find the
597  // 'staggering' for each layer and make necessary conversions in our
598  // arrays. -JM
599  // In the TMB-07 firmware, half-strips in odd layers (layers are
600  // counted as ly0-ly5) are shifted by -1 half-strip, whereas in
601  // the previous firmware versions half-strips in even layers
602  // were shifted by +1 half-strip. This difference is due to a
603  // change from ly3 to ly2 in the choice of the key layer, and
604  // the intention to keep half-strips in the key layer unchanged.
605  // In the emulator, we use the old way for both cases, to avoid
606  // negative half-strip numbers. This will necessitate a
607  // subtraction of 1 half-strip for TMB-07 later on. -SV.
608  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
609  stagger[i_layer] =
610  (chamber->layer(i_layer+1)->geometry()->stagger() + 1) / 2;
611  }
612  }
613  else {
614  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
615  << " ME" << ((theEndcap == 1) ? "+" : "-")
616  << theStation << "/" << theRing << "/" << theChamber
617  << " (sector " << theSector << " subsector " << theSubsector
618  << " trig id. " << theTrigChamber << ")"
619  << " is not defined in current geometry! +++\n"
620  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
621  numStrips = -1;
622  }
623  }
624 
625  if (numStrips < 0) {
626  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
627  << " ME" << ((theEndcap == 1) ? "+" : "-")
628  << theStation << "/" << theRing << "/" << theChamber
629  << " (sector " << theSector << " subsector " << theSubsector
630  << " trig id. " << theTrigChamber << "):"
631  << " numStrips = " << numStrips << "; CLCT emulation skipped! +++";
632  std::vector<CSCCLCTDigi> emptyV;
633  return emptyV;
634  }
635 
636  // Get comparator digis in this chamber.
637  bool noDigis = getDigis(compdc);
638 
639  if (!noDigis) {
640  // Get halfstrip (and possibly distrip) times from comparator digis.
641  std::vector<int>
643  std::vector<int>
645  if (isTMB07) { // TMB07 (latest) version: halfstrips only.
646  readComparatorDigis(halfstrip);
647  }
648  else { // Earlier versions: halfstrips and distrips.
649  readComparatorDigis(halfstrip, distrip);
650  }
651 
652  // Pass arrays of halfstrips and distrips on to another run() doing the
653  // LCT search.
654  // If the number of layers containing digis is smaller than that
655  // required to trigger, quit right away. (If LCT-based digi suppression
656  // is implemented one day, this condition will have to be changed
657  // to the number of planes required to pre-trigger.)
658  unsigned int layersHit = 0;
659  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
660  for (int i_hstrip = 0; i_hstrip < CSCConstants::NUM_HALF_STRIPS_7CFEBS;
661  i_hstrip++) {
662  if (!halfstrip[i_layer][i_hstrip].empty()) {layersHit++; break;}
663  }
664  }
665  // Run the algorithm only if the probability for the pre-trigger
666  // to fire is not null. (Pre-trigger decisions are used for the
667  // strip read-out conditions in DigiToRaw.)
668  if (layersHit >= nplanes_hit_pretrig) run(halfstrip, distrip);
669  }
670 
671  // Return vector of CLCTs.
672  std::vector<CSCCLCTDigi> tmpV = getCLCTs();
673  return tmpV;
674 }
CSCChamber * chamber(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned tcscid) const
Return the CSCChamber for a corresponding endcap/station/sector/subsector/trigger cscid...
int numberOfStrips() const
static CSCTriggerGeomManager * get()
bool getDigis(const CSCComparatorDigiCollection *compdc)
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:39
int stagger() const
int stagger[CSCConstants::NUM_LAYERS]
std::vector< CSCCLCTDigi > run(const CSCComparatorDigiCollection *compdc)
void readComparatorDigis(std::vector< int >halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], std::vector< int > distrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
std::vector< CSCCLCTDigi > getCLCTs()
void CSCCathodeLCTProcessor::run ( const std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const std::vector< int >  distrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS] 
)

Called in test mode and by the run(compdc) function; does the actual LCT finding.

Definition at line 676 of file CSCCathodeLCTProcessor.cc.

References bestCLCT, findLCTs(), findLCTsSLHC(), i, infoV, isME11, isMTCC, isSLHC, isTMB07, LogDebug, MAX_CLCT_BINS, secondCLCT, CSCCLCTDigi::setTrknmb(), smartME1aME1b, theChamber, theEndcap, theRing, theSector, theStation, theSubsector, theTrigChamber, and use_dead_time_zoning.

678  {
679  // This version of the run() function can either be called in a standalone
680  // test, being passed the halfstrip and distrip times, or called by the
681  // run() function above. It uses the findLCTs() method to find vectors
682  // of LCT candidates. These candidates are sorted and the best two per bx
683  // are returned.
684  std::vector<CSCCLCTDigi> LCTlist;
685 
686  if (isTMB07) {
687  // Upgrade version for ME11 with better dead-time handling
688  if (isSLHC && smartME1aME1b && isME11 && use_dead_time_zoning) LCTlist = findLCTsSLHC(halfstrip);
689  // TMB07 version of the CLCT algorithm.
690  else LCTlist = findLCTs(halfstrip);
691  }
692  else if (isMTCC) { // MTCC version.
693  LCTlist = findLCTs(halfstrip, distrip);
694  }
695  else { // Idealized algorithm of many years ago.
696  std::vector<CSCCLCTDigi> halfStripLCTs = findLCTs(halfstrip, 1);
697  std::vector<CSCCLCTDigi> diStripLCTs = findLCTs(distrip, 0);
698  // Put all the candidates into a single vector and sort them.
699  for (unsigned int i = 0; i < halfStripLCTs.size(); i++)
700  LCTlist.push_back(halfStripLCTs[i]);
701  for (unsigned int i = 0; i < diStripLCTs.size(); i++)
702  LCTlist.push_back(diStripLCTs[i]);
703  }
704 
705  // LCT sorting.
706  if (LCTlist.size() > 1)
707  sort(LCTlist.begin(), LCTlist.end(), std::greater<CSCCLCTDigi>());
708 
709  // Take the best two candidates per bx.
710  for (std::vector<CSCCLCTDigi>::const_iterator plct = LCTlist.begin();
711  plct != LCTlist.end(); plct++) {
712  int bx = plct->getBX();
713  if (bx >= MAX_CLCT_BINS) {
714  if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeCLCT")
715  << "+++ Bx of CLCT candidate, " << bx << ", exceeds max allowed, "
716  << MAX_CLCT_BINS-1 << "; skipping it... +++\n";
717  continue;
718  }
719 
720  if (!bestCLCT[bx].isValid()) bestCLCT[bx] = *plct;
721  else if (!secondCLCT[bx].isValid()) {
722  // Ignore CLCT if it is the same as the best (i.e. if the same
723  // CLCT was found in both half- and di-strip pattern search).
724  // This can never happen in the test beam and MTCC
725  // implementations.
726  if (!isMTCC && !isTMB07 && *plct == bestCLCT[bx]) continue;
727  secondCLCT[bx] = *plct;
728  }
729  }
730 
731  for (int bx = 0; bx < MAX_CLCT_BINS; bx++) {
732  if (bestCLCT[bx].isValid()) {
733  bestCLCT[bx].setTrknmb(1);
734  if (infoV > 0) LogDebug("CSCCathodeLCTProcessor")
735  << bestCLCT[bx] << " found in ME" << ((theEndcap == 1) ? "+" : "-")
736  << theStation << "/" << theRing << "/" << theChamber
737  << " (sector " << theSector << " subsector " << theSubsector
738  << " trig id. " << theTrigChamber << ")" << "\n";
739  }
740  if (secondCLCT[bx].isValid()) {
741  secondCLCT[bx].setTrknmb(2);
742  if (infoV > 0) LogDebug("CSCCathodeLCTProcessor")
743  << secondCLCT[bx] << " found in ME" << ((theEndcap == 1) ? "+" : "-")
744  << theStation << "/" << theRing << "/" << theChamber
745  << " (sector " << theSector << " subsector " << theSubsector
746  << " trig id. " << theTrigChamber << ")" << "\n";
747  }
748  }
749  // Now that we have our best CLCTs, they get correlated with the best
750  // ALCTs and then get sent to the MotherBoard. -JM
751 }
#define LogDebug(id)
CSCCLCTDigi secondCLCT[MAX_CLCT_BINS]
int i
Definition: DBlmapReader.cc:9
CSCCLCTDigi bestCLCT[MAX_CLCT_BINS]
std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int stripType)
std::vector< CSCCLCTDigi > findLCTsSLHC(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting CLCTs.
Definition: CSCCLCTDigi.h:71
void CSCCathodeLCTProcessor::setConfigParameters ( const CSCDBL1TPParameters conf)

Sets configuration parameters obtained via EventSetup mechanism.

Definition at line 417 of file CSCCathodeLCTProcessor.cc.

References checkConfigParameters(), CSCDBL1TPParameters::clctDriftDelay(), CSCDBL1TPParameters::clctFifoPretrig(), CSCDBL1TPParameters::clctFifoTbins(), CSCDBL1TPParameters::clctHitPersist(), CSCDBL1TPParameters::clctMinSeparation(), CSCDBL1TPParameters::clctNplanesHitPattern(), CSCDBL1TPParameters::clctNplanesHitPretrig(), CSCDBL1TPParameters::clctPidThreshPretrig(), drift_delay, dumpConfigParams(), fifo_pretrig, fifo_tbins, hit_persist, isTMB07, min_separation, nplanes_hit_pattern, nplanes_hit_pretrig, and pid_thresh_pretrig.

417  {
418  static std::atomic<bool> config_dumped{false};
419 
420  fifo_tbins = conf->clctFifoTbins();
421  fifo_pretrig = conf->clctFifoPretrig();
422  hit_persist = conf->clctHitPersist();
423  drift_delay = conf->clctDriftDelay();
426 
427  // TMB07 parameters.
428  if (isTMB07) {
431  }
432 
433  // Check and print configuration parameters.
435  if (!config_dumped) {
436  //std::cerr<<"**** CLCT setConfigParams parameters dump ****"<<std::endl;
438  config_dumped = true;
439  }
440 }
unsigned int clctHitPersist() const
unsigned int clctNplanesHitPattern() const
unsigned int clctMinSeparation() const
unsigned int clctNplanesHitPretrig() const
unsigned int clctDriftDelay() const
unsigned int clctPidThreshPretrig() const
unsigned int clctFifoPretrig() const
unsigned int clctFifoTbins() const
void CSCCathodeLCTProcessor::setDefaultConfigParameters ( )
private

Set default values for configuration parameters.

Definition at line 395 of file CSCCathodeLCTProcessor.cc.

References def_drift_delay, def_fifo_pretrig, def_fifo_tbins, def_hit_persist, def_min_separation, def_nplanes_hit_pattern, def_nplanes_hit_pretrig, def_pid_thresh_pretrig, def_tmb_l1a_window_size, drift_delay, fifo_pretrig, fifo_tbins, hit_persist, isMTCC, isTMB07, min_separation, nplanes_hit_pattern, nplanes_hit_pretrig, pid_thresh_pretrig, and tmb_l1a_window_size.

Referenced by CSCCathodeLCTProcessor().

395  {
396  // Set default values for configuration parameters.
403 
404  isMTCC = false;
405 
406  // New TMB07 parameters.
407  isTMB07 = true;
408  if (isTMB07) {
411  }
412 
414 }
static const unsigned int def_drift_delay
static const unsigned int def_fifo_tbins
static const unsigned int def_min_separation
static const unsigned int def_nplanes_hit_pretrig
static const unsigned int def_pid_thresh_pretrig
static const unsigned int def_tmb_l1a_window_size
static const unsigned int def_nplanes_hit_pattern
static const unsigned int def_fifo_pretrig
static const unsigned int def_hit_persist
void CSCCathodeLCTProcessor::setRing ( unsigned  r)
inline

Set ring number Has to be done for upgrade ME1a!

Definition at line 94 of file CSCCathodeLCTProcessor.h.

References alignCSCRings::r, and theRing.

void CSCCathodeLCTProcessor::testDistripStagger ( )
private

Definition at line 2930 of file CSCCathodeLCTProcessor.cc.

References gather_cfg::cout, debug, distripStagger(), i, and CSCConstants::NUM_DI_STRIPS.

Referenced by readComparatorDigis().

2930  {
2931  // Author: Jason Mumford (mumford@physics.ucla.edu)
2932  // This routine tests the distripStagger routine.
2933  // @@
2934  bool debug = true;
2935  int test_triad[CSCConstants::NUM_DI_STRIPS], test_time[CSCConstants::NUM_DI_STRIPS];
2936  int test_digi[CSCConstants::NUM_DI_STRIPS];
2937  int distrip = 0;
2938  test_triad[distrip] = 3; //After routine, I expect 4
2939  test_triad[distrip+1] = 3; // 4
2940  test_triad[distrip+2] = 3; // 4
2941  test_triad[distrip+3] = 3; // 4
2942  test_triad[distrip+4] = 3; // 4
2943  test_triad[distrip+5] = 3; // 4
2944  test_triad[distrip+6] = 3; // 4
2945  test_triad[distrip+7] = 3; // 4
2946  test_triad[distrip+8] = 3; // 4
2947  test_triad[distrip+9] = 3; // 4
2948  test_triad[distrip+10] = 2; // 2
2949 
2950  test_time[distrip] = 4; // "" "" 0
2951  test_time[distrip+1] = 10; // 4
2952  test_time[distrip+2] = 2; // 10
2953  test_time[distrip+3] = 0; // 2
2954  test_time[distrip+4] = 6; // 2
2955  test_time[distrip+5] = 8; // 2
2956  test_time[distrip+6] = 10; // 2
2957  test_time[distrip+7] = 1; // 2
2958  test_time[distrip+8] = 8; // 2
2959  test_time[distrip+9] = 5; // 2
2960  test_time[distrip+10] = 6; // 2
2961 
2962  std::cout << "\n ------------------------------------------------- \n";
2963  std::cout << "!!!!!!Testing distripStagger routine!!!!!!" << std::endl;
2964  std::cout << "Values before distripStagger routine:" << std::endl;
2965  for (int i=distrip; i<distrip+11; i++){
2966  test_digi[i] = 999;
2967  std::cout << "test_triad[" << i << "] = " << test_triad[i];
2968  std::cout << " test_time[" << i << "] = " << test_time[i] << std::endl;
2969  }
2970  distripStagger(test_triad, test_time, test_digi, distrip, debug);
2971  std::cout << "Values after distripStagger routine:" << std::endl;
2972  for (int i=distrip; i<distrip+11; i++){
2973  std::cout << "test_triad[" << i << "] = " << test_triad[i];
2974  std::cout << " test_time[" << i << "] = " << test_time[i] << std::endl;
2975  }
2976  std::cout << "\n ------------------------------------------------- \n \n";
2977 }
int i
Definition: DBlmapReader.cc:9
static void distripStagger(int stag_triad[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int stag_time[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int stag_digi[CSCConstants::MAX_NUM_STRIPS_7CFEBS], int i_distrip, bool debug=false)
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:145
void CSCCathodeLCTProcessor::testLCTs ( )
private

Definition at line 2979 of file CSCCathodeLCTProcessor.cc.

References CSCCLCTDigi::getBend(), CSCCLCTDigi::getBX(), CSCCLCTDigi::getCFEB(), CSCCLCTDigi::getKeyStrip(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuality(), CSCCLCTDigi::getStripType(), LogTrace, MAX_CFEBS, and HLT_25ns10e33_v2_cff::quality.

2979  {
2980  // test to make sure what goes into an LCT is what comes out.
2981  for (int ptn = 0; ptn < 8; ptn++) {
2982  for (int bend = 0; bend < 2; bend++) {
2983  for (int cfeb = 0; cfeb < MAX_CFEBS; cfeb++) {
2984  for (int key_strip = 0; key_strip < 32; key_strip++) {
2985  for (int bx = 0; bx < 7; bx++) {
2986  for (int stripType = 0; stripType < 2; stripType++) {
2987  for (int quality = 3; quality < 6; quality++) {
2988  CSCCLCTDigi thisLCT(1, quality, ptn, stripType, bend,
2989  key_strip, cfeb, bx);
2990  if (ptn != thisLCT.getPattern())
2991  LogTrace("CSCCathodeLCTProcessor")
2992  << "pattern mismatch: " << ptn << " "
2993  << thisLCT.getPattern();
2994  if (bend != thisLCT.getBend())
2995  LogTrace("CSCCathodeLCTProcessor")
2996  << "bend mismatch: " << bend << " " << thisLCT.getBend();
2997  if (cfeb != thisLCT.getCFEB())
2998  LogTrace("CSCCathodeLCTProcessor")
2999  << "cfeb mismatch: " << cfeb << " " << thisLCT.getCFEB();
3000  if (key_strip != thisLCT.getKeyStrip())
3001  LogTrace("CSCCathodeLCTProcessor")
3002  << "strip mismatch: " << key_strip << " "
3003  << thisLCT.getKeyStrip();
3004  if (bx != thisLCT.getBX())
3005  LogTrace("CSCCathodeLCTProcessor")
3006  << "bx mismatch: " << bx << " " << thisLCT.getBX();
3007  if (stripType != thisLCT.getStripType())
3008  LogTrace("CSCCathodeLCTProcessor")
3009  << "Strip Type mismatch: " << stripType << " "
3010  << thisLCT.getStripType();
3011  if (quality != thisLCT.getQuality())
3012  LogTrace("CSCCathodeLCTProcessor")
3013  << "quality mismatch: " << quality << " "
3014  << thisLCT.getQuality();
3015  }
3016  }
3017  }
3018  }
3019  }
3020  }
3021  }
3022 }
#define LogTrace(id)
void CSCCathodeLCTProcessor::testPatterns ( )
private

Definition at line 3065 of file CSCCathodeLCTProcessor.cc.

References gather_cfg::cout, relativeConstraints::empty, findLCTs(), findNumLayersHit(), getPattern(), isTMB07, CSCConstants::KEY_CLCT_LAYER, CSCConstants::KEY_CLCT_LAYER_PRE_TMB07, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_LAYERS, convertSQLitetoXML_cfg::output, pattern, and mps_update::results.

3065  {
3066 //generate all possible combinations of hits in a given area and see what we find.
3067 // Benn Tannenbaum 21 June 2001
3068 
3069  //there are 16 strips in our uber-pattern, each of which can be on or off.
3070  // 2^16 = 65536
3071  for (int possibleHits = 0; possibleHits < 65536; possibleHits++) {
3073  //assign one bit to each strip in an array. I'll start centered around strip 10.
3074  stripsHit[0][ 9].push_back(( possibleHits & 1 ) != 0); // 2^0
3075  stripsHit[0][10].push_back(( possibleHits & 2 ) != 0); // 2^1
3076  stripsHit[0][11].push_back(( possibleHits & 4 ) != 0); // 2^2
3077  stripsHit[1][ 9].push_back(( possibleHits & 8 ) != 0); // 2^3
3078  stripsHit[1][10].push_back(( possibleHits & 16 ) != 0); // 2^4
3079  stripsHit[1][11].push_back(( possibleHits & 32 ) != 0); // 2^5
3080  stripsHit[2][ 9].push_back(( possibleHits & 64 ) != 0); // 2^6
3081  stripsHit[2][10].push_back(( possibleHits & 128 ) != 0); // 2^7
3082  stripsHit[2][11].push_back(( possibleHits & 256 ) != 0); // 2^8
3083  stripsHit[3][10].push_back(( possibleHits & 512 ) != 0); // 2^9
3084  stripsHit[4][ 9].push_back(( possibleHits & 1024 ) != 0); // 2^10
3085  stripsHit[4][10].push_back(( possibleHits & 2048 ) != 0); // 2^11
3086  stripsHit[4][11].push_back(( possibleHits & 4096 ) != 0); // 2^12
3087  stripsHit[5][ 9].push_back(( possibleHits & 8192 ) != 0); // 2^13
3088  stripsHit[5][10].push_back(( possibleHits & 16384 ) != 0); // 2^14
3089  stripsHit[5][11].push_back(( possibleHits & 32768 ) != 0); // 2^15
3090  int numLayersHit = findNumLayersHit(stripsHit);
3091  std::vector <CSCCLCTDigi> results = findLCTs(stripsHit, 1);
3092 // print out whatever we find-- but only ones where 4 or more layers are hit
3093 // OR ones where we find something
3094 // key: X a hit there and was used to find pattern
3095 // x a hit not involved in pattern
3096 // _ empty strip
3097 // o a hit was there, but no pattern was found
3098  if (numLayersHit > 3 || results.size() > 0) {
3099  std::cout<<"Input "<<possibleHits<<"/"<< 65536 <<" # Found Patterns "<<results.size()<<std::endl<<" ";
3100  for (int layer = 0; layer < CSCConstants::NUM_LAYERS; layer++) {
3101  if ((isTMB07 && layer != CSCConstants::KEY_CLCT_LAYER - 1) ||
3102  (!isTMB07 && layer != CSCConstants::KEY_CLCT_LAYER_PRE_TMB07 - 1)) {
3103  for (int strip = 9; strip < 12; strip++) {
3104  if (!stripsHit[layer][strip].empty()) {
3105  if (results.size() > 0) {
3106  int thePatternStrip = strip - (results[0].getKeyStrip() - 2) + 3*layer;
3107  if ((isTMB07 && layer>=CSCConstants::KEY_CLCT_LAYER) ||
3109  thePatternStrip -= 2;
3110 
3111  if (pattern[results[0].getPattern()][thePatternStrip] == layer)
3112  {
3113  std::cout<<"X";
3114  } else {
3115  std::cout<<"x";
3116  }
3117  } else {
3118  std::cout<<"o";
3119  }
3120  } else {
3121  std::cout<<"_";
3122  }
3123  }
3124  std::cout<<" ";
3125  for (unsigned int output = 0; output < results.size(); output++) {
3126  int minStrip;
3127  if ((isTMB07 && layer < CSCConstants::KEY_CLCT_LAYER-1) ||
3129  minStrip = 3*layer;
3130  } else {
3131  minStrip = 3*layer - 2;// since on the key layer we only have 1 strip
3132  }
3133  for (int strip = minStrip; strip < minStrip + 3; strip++) {
3134  if (layer == pattern[results[output].getPattern()][strip]) {
3135  std::cout<<"X";
3136  } else {
3137  std::cout<<"_";
3138  }
3139  }
3140  std::cout<<" ";
3141  }
3142  } else {
3143  if (!stripsHit[layer][10].empty()) {
3144  std::cout<<" X ";
3145  } else {
3146  std::cout<<" _ ";
3147  }
3148  for (unsigned int output = 0; output < results.size(); output++)
3149  std::cout<<" X ";
3150  }
3151  if (layer < static_cast<int>(results.size()) ) {
3152  std::cout<<results[layer];
3153  std::cout<<" ";
3154  } else {
3155  std::cout<<" "<<std::endl<<" ";
3156  }
3157  }
3158  }
3159  }
3160 }
void getPattern(int pattern_num, int strip_value[NUM_PATTERN_STRIPS], int bx_time, int &quality, int &bend)
static const int pattern[CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07][NUM_PATTERN_STRIPS+1]
tuple results
Definition: mps_update.py:44
std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], int stripType)
int findNumLayersHit(std::vector< int > stripsHit[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

unsigned int CSCCathodeLCTProcessor::best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
private

Definition at line 257 of file CSCCathodeLCTProcessor.h.

Referenced by findLCTs(), findLCTsSLHC(), preTrigger(), and ptnFinding().

CSCCLCTDigi CSCCathodeLCTProcessor::bestCLCT[MAX_CLCT_BINS]

Best LCT in this chamber, as found by the processor.

Definition at line 73 of file CSCCathodeLCTProcessor.h.

Referenced by clear(), getCLCTs(), and run().

const int CSCCathodeLCTProcessor::cfeb_strips = { 8, 32}
staticprivate

Number of di-strips/half-strips per CFEB.

Definition at line 192 of file CSCCathodeLCTProcessor.h.

Referenced by dumpDigis(), findLCTs(), findLCTsSLHC(), latchLCTs(), preTrigLookUp(), and priorityEncode().

unsigned int CSCCathodeLCTProcessor::clct_state_machine_zone
private

Definition at line 165 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and findLCTsSLHC().

const unsigned int CSCCathodeLCTProcessor::def_drift_delay = 2
staticprivate

Definition at line 179 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCCathodeLCTProcessor::def_fifo_pretrig = 7
staticprivate

Definition at line 178 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCCathodeLCTProcessor::def_fifo_tbins = 12
staticprivate

Default values of configuration parameters.

Definition at line 178 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCCathodeLCTProcessor::def_hit_persist = 6
staticprivate

Definition at line 179 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCCathodeLCTProcessor::def_min_separation = 10
staticprivate

Definition at line 182 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCCathodeLCTProcessor::def_nplanes_hit_pattern = 4
staticprivate

Definition at line 181 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCCathodeLCTProcessor::def_nplanes_hit_pretrig = 2
staticprivate

Definition at line 180 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCCathodeLCTProcessor::def_pid_thresh_pretrig = 2
staticprivate

Definition at line 182 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCCathodeLCTProcessor::def_tmb_l1a_window_size = 7
staticprivate

Definition at line 183 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

std::vector<CSCComparatorDigi> CSCCathodeLCTProcessor::digiV[CSCConstants::NUM_LAYERS]
private

Definition at line 135 of file CSCCathodeLCTProcessor.h.

Referenced by getDigis(), and readComparatorDigis().

bool CSCCathodeLCTProcessor::disableME1a
private

Definition at line 158 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), getDigis(), and run().

unsigned int CSCCathodeLCTProcessor::drift_delay
private
bool CSCCathodeLCTProcessor::dynamic_state_machine_zone
private

Definition at line 166 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and findLCTsSLHC().

int CSCCathodeLCTProcessor::early_tbins
private

VK: separate handle for early time bins

Definition at line 161 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and readoutCLCTs().

unsigned int CSCCathodeLCTProcessor::fifo_pretrig
private
unsigned int CSCCathodeLCTProcessor::fifo_tbins
private
int CSCCathodeLCTProcessor::first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
private

Definition at line 259 of file CSCCathodeLCTProcessor.h.

Referenced by findLCTsSLHC(), and ptnFinding().

bool CSCCathodeLCTProcessor::gangedME1a
private

Definition at line 158 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), getDigis(), and run().

unsigned int CSCCathodeLCTProcessor::hit_persist
private
int CSCCathodeLCTProcessor::infoV
private

Verbosity level: 0: no print (default). 1: print only CLCTs found. 2: info at every step of the algorithm. 3: add special-purpose prints.

Definition at line 118 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), CSCCathodeLCTProcessor(), findLCTs(), findLCTsSLHC(), getDigis(), getKeyStripData(), latchLCTs(), preTrigger(), preTrigLookUp(), priorityEncode(), ptnFinding(), pulseExtension(), readComparatorDigis(), readoutCLCTs(), and run().

bool CSCCathodeLCTProcessor::isME11
private

Definition at line 130 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and run().

bool CSCCathodeLCTProcessor::isMTCC
private

Flag for "real" - not idealized - version of the algorithm.

Definition at line 139 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), run(), and setDefaultConfigParameters().

bool CSCCathodeLCTProcessor::ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
private

Definition at line 266 of file CSCCathodeLCTProcessor.h.

Referenced by findLCTsSLHC(), and preTrigger().

bool CSCCathodeLCTProcessor::isSLHC
private

Flag for SLHC studies.

Definition at line 145 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and run().

bool CSCCathodeLCTProcessor::isTMB07
private
unsigned int CSCCathodeLCTProcessor::min_separation
private
unsigned int CSCCathodeLCTProcessor::nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
private

Definition at line 258 of file CSCCathodeLCTProcessor.h.

Referenced by findLCTs(), findLCTsSLHC(), preTrigger(), and ptnFinding().

unsigned int CSCCathodeLCTProcessor::nplanes_hit_pattern
private
unsigned int CSCCathodeLCTProcessor::nplanes_hit_pretrig
private
int CSCCathodeLCTProcessor::numStrips
private
const int CSCCathodeLCTProcessor::pattern
static
const int CSCCathodeLCTProcessor::pattern2007
static

Definition at line 103 of file CSCCathodeLCTProcessor.h.

Referenced by findLCTs(), findLCTsSLHC(), and ptnFinding().

const int CSCCathodeLCTProcessor::pattern2007_offset
static
Initial value:
=
{ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5,
-2, -1, 0, 1, 2,
0,
-2, -1, 0, 1, 2,
-4, -3, -2, -1, 0, 1, 2, 3, 4,
-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 }

Definition at line 102 of file CSCCathodeLCTProcessor.h.

Referenced by ptnFinding().

unsigned int CSCCathodeLCTProcessor::pid_thresh_pretrig
private
const int CSCCathodeLCTProcessor::pre_hit_pattern
static
Initial value:
= {
{ 999, 0, 0, 0, 999,
999, 1, 1, 1, 999,
999, 2, 2, 2, 999,
3,
999, 4, 4, 4, 999,
999, 5, 5, 5, 999},
{ 999, -1, 0, 1, 999,
999, -1, 0, 1, 999,
999, -1, 0, 1, 999,
0,
999, -1, 0, 1, 999,
999, -1, 0, 1, 999}
}

Definition at line 98 of file CSCCathodeLCTProcessor.h.

Referenced by getKeyStripData(), latchLCTs(), preTrigger(), and preTrigLookUp().

unsigned int CSCCathodeLCTProcessor::pretrig_trig_zone
private

VK: allow triggers only in +-pretrig_trig_zone around pretriggers

Definition at line 169 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and findLCTsSLHC().

bool CSCCathodeLCTProcessor::readout_earliest_2
private

VK: whether to readout only the earliest two LCTs in readout window

Definition at line 175 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and readoutCLCTs().

CSCCLCTDigi CSCCathodeLCTProcessor::secondCLCT[MAX_CLCT_BINS]

Second best LCT in this chamber, as found by the processor.

Definition at line 76 of file CSCCathodeLCTProcessor.h.

Referenced by clear(), getCLCTs(), and run().

bool CSCCathodeLCTProcessor::smartME1aME1b
private

VK: special configuration parameters for ME1a treatment

Definition at line 158 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), getDigis(), and run().

int CSCCathodeLCTProcessor::stagger[CSCConstants::NUM_LAYERS]
private
int CSCCathodeLCTProcessor::start_bx_shift
private

VK: some quick and dirty fix to reduce CLCT deadtime

Definition at line 155 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), findLCTs(), findLCTsSLHC(), and pulseExtension().

unsigned int CSCCathodeLCTProcessor::theChamber
private

Definition at line 129 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), dumpDigis(), getDigis(), and run().

const unsigned CSCCathodeLCTProcessor::theEndcap
private

Chamber id (trigger-type labels).

Definition at line 121 of file CSCCathodeLCTProcessor.h.

Referenced by dumpDigis(), getDigis(), and run().

std::vector<int> CSCCathodeLCTProcessor::thePreTriggerBXs
private

Definition at line 136 of file CSCCathodeLCTProcessor.h.

Referenced by clear(), findLCTs(), and preTriggerBXs().

unsigned int CSCCathodeLCTProcessor::theRing
private

Definition at line 128 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), dumpDigis(), getDigis(), run(), and setRing().

const unsigned CSCCathodeLCTProcessor::theSector
private

Definition at line 123 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), getDigis(), and run().

const unsigned CSCCathodeLCTProcessor::theStation
private

Definition at line 122 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), dumpDigis(), getDigis(), and run().

const unsigned CSCCathodeLCTProcessor::theSubsector
private

Definition at line 124 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), getDigis(), and run().

const unsigned CSCCathodeLCTProcessor::theTrigChamber
private

Definition at line 125 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), getDigis(), and run().

unsigned int CSCCathodeLCTProcessor::tmb_l1a_window_size
private
bool CSCCathodeLCTProcessor::use_corrected_bx
private

VK: whether to use corrected_bx instead of pretrigger BX

Definition at line 172 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and findLCTsSLHC().

bool CSCCathodeLCTProcessor::use_dead_time_zoning
private

VK: use of localized dead-time zones

Definition at line 164 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and run().