CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
CSCAnodeLCTProcessor Class Reference

#include <CSCAnodeLCTProcessor.h>

Public Member Functions

void clear ()
 
 CSCAnodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf, const edm::ParameterSet &comm)
 
 CSCAnodeLCTProcessor ()
 
std::vector< CSCALCTDigigetALCTs ()
 
bool getDigis (const CSCWireDigiCollection *wiredc)
 
void getDigis (const CSCWireDigiCollection *wiredc, const CSCDetId &id)
 
std::vector< CSCALCTDigireadoutALCTs ()
 
std::vector< CSCALCTDigirun (const CSCWireDigiCollection *wiredc)
 
void run (const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setCSCGeometry (const CSCGeometry *g)
 
void setRing (unsigned r)
 

Public Attributes

CSCALCTDigi bestALCT [CSCConstants::MAX_ALCT_TBINS]
 
CSCALCTDigi secondALCT [CSCConstants::MAX_ALCT_TBINS]
 

Static Public Attributes

static const int pattern_envelope [CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
 
static const int pattern_mask_open [CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
 
static const int pattern_mask_r1 [CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
 
static const int time_weights [CSCConstants::MAX_WIRES_IN_PATTERN]
 

Private Member Functions

void accelMode (const int key_wire)
 
std::vector< CSCALCTDigibestTrackSelector (const std::vector< CSCALCTDigi > &all_alcts)
 
void checkConfigParameters ()
 
void clear (const int wire, const int pattern)
 
void dumpConfigParams () const
 
void dumpDigis (const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const
 
void ghostCancellationLogic ()
 
void ghostCancellationLogicSLHC ()
 
bool isBetterALCT (const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT)
 
void lctSearch ()
 
void loadPatternMask ()
 
bool patternDetection (const int key_wire)
 
bool preTrigger (const int key_wire, const int start_bx)
 
bool pulseExtension (const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
 
void readWireDigis (std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
 
void setDefaultConfigParameters ()
 
void showPatterns (const int key_wire)
 
void trigMode (const int key_wire)
 

Private Attributes

unsigned int accel_mode
 
const CSCGeometrycsc_g
 
std::vector< CSCWireDigidigiV [CSCConstants::NUM_LAYERS]
 
bool disableME1a
 
unsigned int drift_delay
 
int early_tbins
 
unsigned int fifo_pretrig
 
unsigned int fifo_tbins
 
int first_bx [CSCConstants::MAX_NUM_WIRES]
 
int first_bx_corrected [CSCConstants::MAX_NUM_WIRES]
 
int ghost_cancellation_bx_depth
 
bool ghost_cancellation_side_quality
 
unsigned int hit_persist
 
int infoV
 
bool isME11
 
bool isSLHC
 
unsigned int l1a_window_width
 
int MESelection
 
bool narrow_mask_r1
 
unsigned int nplanes_hit_accel_pattern
 
unsigned int nplanes_hit_accel_pretrig
 
unsigned int nplanes_hit_pattern
 
unsigned int nplanes_hit_pretrig
 
int numWireGroups
 
int pattern_mask [CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
 
unsigned int pretrig_extra_deadtime
 
unsigned int pulse [CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
 
int quality [CSCConstants::MAX_NUM_WIRES][3]
 
bool runME21ILT_
 
bool runME3141ILT_
 
unsigned theChamber
 
const unsigned theEndcap
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
unsigned int trig_mode
 
bool use_corrected_bx
 

Static Private Attributes

static const unsigned int def_accel_mode = 0
 
static const unsigned int def_drift_delay = 2
 
static const unsigned int def_fifo_pretrig = 10
 
static const unsigned int def_fifo_tbins = 16
 
static const unsigned int def_l1a_window_width = 7
 
static const unsigned int def_nplanes_hit_accel_pattern = 4
 
static const unsigned int def_nplanes_hit_accel_pretrig = 2
 
static const unsigned int def_nplanes_hit_pattern = 4
 
static const unsigned int def_nplanes_hit_pretrig = 2
 
static const unsigned int def_trig_mode = 2
 

Detailed Description

This class simulates the functionality of the anode LCT card. It is run by the MotherBoard and returns up to two AnodeLCTs. It can be run either in a test mode, where it is passed an array of wire times, or in normal mode where it determines the wire times from the wire digis.

Author
Benn Tannenbaum benn@.nosp@m.phys.nosp@m.ics.u.nosp@m.cla..nosp@m.edu 13 July 1999 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.

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

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

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

Definition at line 34 of file CSCAnodeLCTProcessor.h.

Constructor & Destructor Documentation

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

Normal constructor.

Definition at line 153 of file CSCAnodeLCTProcessor.cc.

References accel_mode, CSCConstants::ALCT_EMUL_TIME_OFFSET, CSCTriggerNumbering::chamberFromTriggerLabels(), checkConfigParameters(), disableME1a, drift_delay, dumpConfigParams(), early_tbins, edm::ParameterSet::existsAs(), fifo_pretrig, fifo_tbins, edm::ParameterSet::getParameter(), ghost_cancellation_bx_depth, ghost_cancellation_side_quality, hit_persist, infoV, isME11, isSLHC, l1a_window_width, loadPatternMask(), MESelection, narrow_mask_r1, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, numWireGroups, pretrig_extra_deadtime, CSCTriggerNumbering::ringFromTriggerLabels(), runME21ILT_, runME3141ILT_, theChamber, theRing, theSector, theStation, theSubsector, theTrigChamber, trig_mode, and use_corrected_bx.

157  :
159  theSubsector(subsector), theTrigChamber(chamber) {
160  static std::atomic<bool> config_dumped{false};
161 
162  // ALCT configuration parameters.
163  fifo_tbins = conf.getParameter<unsigned int>("alctFifoTbins");
164  fifo_pretrig = conf.getParameter<unsigned int>("alctFifoPretrig");
165  drift_delay = conf.getParameter<unsigned int>("alctDriftDelay");
167  conf.getParameter<unsigned int>("alctNplanesHitPretrig");
169  conf.getParameter<unsigned int>("alctNplanesHitPattern");
171  conf.getParameter<unsigned int>("alctNplanesHitAccelPretrig");
173  conf.getParameter<unsigned int>("alctNplanesHitAccelPattern");
174  trig_mode = conf.getParameter<unsigned int>("alctTrigMode");
175  accel_mode = conf.getParameter<unsigned int>("alctAccelMode");
176  l1a_window_width = conf.getParameter<unsigned int>("alctL1aWindowWidth");
177 
178  hit_persist = conf.getParameter<unsigned int>("alctHitPersist");
179 
180  // Verbosity level, set to 0 (no print) by default.
181  infoV = conf.getParameter<int>("verbosity");
182 
183  // Other parameters.
184 
185  // Flag for SLHC studies
186  isSLHC = comm.getParameter<bool>("isSLHC");
187 
188  // special configuration parameters for ME11 treatment
189  disableME1a = comm.getParameter<bool>("disableME1a");
190 
191  // separate handle for early time bins
192  early_tbins = conf.getParameter<int>("alctEarlyTbins");
193  if (early_tbins<0) early_tbins = fifo_pretrig - CSCConstants::ALCT_EMUL_TIME_OFFSET;
194 
195  // delta BX time depth for ghostCancellationLogic
196  ghost_cancellation_bx_depth = conf.getParameter<int>("alctGhostCancellationBxDepth");
197 
198  // whether to consider ALCT candidates' qualities while doing ghostCancellationLogic on +-1 wire groups
199  ghost_cancellation_side_quality = conf.getParameter<bool>("alctGhostCancellationSideQuality");
200 
201  // deadtime clocks after pretrigger (extra in addition to drift_delay)
202  pretrig_extra_deadtime = conf.getParameter<unsigned int>("alctPretrigDeadtime");
203 
204  // whether to use narrow pattern mask for the rings close to the beam
205  narrow_mask_r1 = conf.getParameter<bool>("alctNarrowMaskForR1");
206 
207  // Check and print configuration parameters.
209  if ((infoV > 0 || isSLHC) && !config_dumped) {
210  //std::cout<<"**** ALCT constructor parameters dump ****"<<std::endl;
212  config_dumped = true;
213  }
214 
215  numWireGroups = 0; // Will be set later.
216  MESelection = (theStation < 3) ? 0 : 1;
217 
219 
222 
223  // trigger numbering doesn't distinguish between ME1a and ME1b chambers:
224  isME11 = (theStation == 1 && theRing == 1);
225 
226  // whether to calculate bx as corrected_bx instead of pretrigger one
227  use_corrected_bx = false;
228  if (isSLHC && isME11) {
229  use_corrected_bx = conf.getParameter<bool>("alctUseCorrectedBx");
230  }
231 
232  // run the ALCT processor for the Phase-II ME2/1 integrated local trigger
233  runME21ILT_ = comm.existsAs<bool>("runME21ILT")?
234  comm.getParameter<bool>("runME21ILT"):false;
235 
236  // run the ALCT processor for the Phase-II ME3/1-ME4/1 integrated local trigger
237  runME3141ILT_ = comm.existsAs<bool>("runME3141ILT")?
238  comm.getParameter<bool>("runME3141ILT"):false;
239 
240  // Load appropriate pattern mask.
241  loadPatternMask();
242 }
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:185
static int ringFromTriggerLabels(int station, int triggerCSCID)
unsigned int nplanes_hit_accel_pattern
unsigned int pretrig_extra_deadtime
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
unsigned int nplanes_hit_accel_pretrig
CSCAnodeLCTProcessor::CSCAnodeLCTProcessor ( )

Default constructor. Used for testing.

Definition at line 244 of file CSCAnodeLCTProcessor.cc.

References CSCTriggerNumbering::chamberFromTriggerLabels(), checkConfigParameters(), disableME1a, dumpConfigParams(), early_tbins, infoV, isME11, isSLHC, loadPatternMask(), CSCConstants::MAX_NUM_WIRES, MESelection, numWireGroups, CSCTriggerNumbering::ringFromTriggerLabels(), setDefaultConfigParameters(), theChamber, theRing, theSector, theStation, theSubsector, and theTrigChamber.

244  :
245  theEndcap(1), theStation(1), theSector(1),
247  // Used for debugging. -JM
248  static std::atomic<bool> config_dumped{false};
249 
250  // ALCT parameters.
252  infoV = 2;
253 
254  isSLHC = false;
255  disableME1a = false;
256 
257  early_tbins = 4;
258 
259  // Check and print configuration parameters.
261  if (!config_dumped) {
262  //std::cout<<"**** ALCT default constructor parameters dump ****"<<std::endl;
264  config_dumped = true;
265  }
266 
268  MESelection = (theStation < 3) ? 0 : 1;
269 
273  isME11 = (theStation == 1 && theRing == 1);
274 
275  // Load pattern mask.
276  loadPatternMask();
277 }
static int ringFromTriggerLabels(int station, int triggerCSCID)
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)

Member Function Documentation

void CSCAnodeLCTProcessor::accelMode ( const int  key_wire)
private

Definition at line 1442 of file CSCAnodeLCTProcessor.cc.

References accel_mode, infoV, LogTrace, and quality.

Referenced by lctSearch().

1442  {
1443  /* Function which gives a preference either to the collision patterns
1444  or accelerator patterns. The function uses the accel_mode parameter
1445  to decide. */
1446  int promotionBit = 1 << 2;
1447 
1448  switch(accel_mode) {
1449  default:
1450  case 0:
1451  // Ignore accelerator muons.
1452  if (quality[key_wire][0] > 0) {
1453  quality[key_wire][0] = 0;
1454  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1455  << "alctMode(): accelerator track " << key_wire << " ignored" << "\n";
1456  }
1457  break;
1458  case 1:
1459  // Prefer collision muons by adding promotion bit.
1460  if (quality[key_wire][1] > 0) {
1461  quality[key_wire][1] += promotionBit;
1462  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1463  << "alctMode(): collision track " << key_wire << " promoted" << "\n";
1464  }
1465  break;
1466  case 2:
1467  // Prefer accelerator muons by adding promotion bit.
1468  if (quality[key_wire][0] > 0) {
1469  quality[key_wire][0] += promotionBit;
1470  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1471  << "alctMode(): accelerator track " << key_wire << " promoted"<< "\n";
1472  }
1473  break;
1474  case 3:
1475  // Ignore collision muons.
1476  if (quality[key_wire][1] > 0) {
1477  quality[key_wire][1] = 0;
1478  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1479  << "alctMode(): collision track " << key_wire << " ignored" << "\n";
1480  }
1481  break;
1482  }
1483 }
int quality[CSCConstants::MAX_NUM_WIRES][3]
#define LogTrace(id)
std::vector< CSCALCTDigi > CSCAnodeLCTProcessor::bestTrackSelector ( const std::vector< CSCALCTDigi > &  all_alcts)
private

Definition at line 1272 of file CSCAnodeLCTProcessor.cc.

References CSCALCTDigi::getBX(), CSCALCTDigi::getKeyWG(), CSCALCTDigi::getQuality(), mps_fire::i, infoV, CSCALCTDigi::isValid(), LogTrace, CSCConstants::MAX_ALCT_TBINS, and mixOne_premix_on_sim_cfi::wire.

Referenced by lctSearch().

1273  {
1274  /* Selects two collision and two accelerator ALCTs per time bin with
1275  the best quality. */
1277 
1278  if (infoV > 1) {
1279  LogTrace("CSCAnodeLCTProcessor") << all_alcts.size() <<
1280  " ALCTs at the input of best-track selector: ";
1281  for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1282  plct != all_alcts.end(); plct++) {
1283  if (!plct->isValid()) continue;
1284  LogTrace("CSCAnodeLCTProcessor") << (*plct);
1285  }
1286  }
1287 
1289  for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1290  plct != all_alcts.end(); plct++) {
1291  if (!plct->isValid()) continue;
1292 
1293  // Select two collision and two accelerator ALCTs with the highest
1294  // quality at every bx. The search for best ALCTs is done in parallel
1295  // for collision and accelerator patterns, and simultaneously for
1296  // two ALCTs, tA and tB. If two or more ALCTs have equal qualities,
1297  // the priority is given to the ALCT with larger wiregroup number
1298  // in the search for tA (collision and accelerator), and to the ALCT
1299  // with smaller wiregroup number in the search for tB.
1300  int bx = (*plct).getBX();
1301  int accel = (*plct).getAccelerator();
1302  int qual = (*plct).getQuality();
1303  int wire = (*plct).getKeyWG();
1304  bool vA = tA[bx][accel].isValid();
1305  bool vB = tB[bx][accel].isValid();
1306  int qA = tA[bx][accel].getQuality();
1307  int qB = tB[bx][accel].getQuality();
1308  int wA = tA[bx][accel].getKeyWG();
1309  int wB = tB[bx][accel].getKeyWG();
1310  if (!vA || qual > qA || (qual == qA && wire > wA)) {
1311  tA[bx][accel] = *plct;
1312  }
1313  if (!vB || qual > qB || (qual == qB && wire < wB)) {
1314  tB[bx][accel] = *plct;
1315  }
1316  }
1317 
1318  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
1319  for (int accel = 0; accel <= 1; accel++) {
1320  // Best ALCT is always tA.
1321  if (tA[bx][accel].isValid()) {
1322  if (infoV > 2) {
1323  LogTrace("CSCAnodeLCTProcessor") << "tA: " << tA[bx][accel];
1324  LogTrace("CSCAnodeLCTProcessor") << "tB: " << tB[bx][accel];
1325  }
1326  bestALCTs[bx][accel] = tA[bx][accel];
1327 
1328  // If tA exists, tB exists too.
1329  if (tA[bx][accel] != tB[bx][accel] &&
1330  tA[bx][accel].getQuality() == tB[bx][accel].getQuality()) {
1331  secondALCTs[bx][accel] = tB[bx][accel];
1332  }
1333  else {
1334  // Funny part: if tA and tB are the same, or the quality of tB
1335  // is inferior to the quality of tA, the second best ALCT is
1336  // not tB. Instead it is the largest-wiregroup ALCT among those
1337  // ALCT whose qualities are lower than the quality of the best one.
1338  for (std::vector <CSCALCTDigi>::const_iterator plct =
1339  all_alcts.begin(); plct != all_alcts.end(); plct++) {
1340  if ((*plct).isValid() &&
1341  (*plct).getAccelerator() == accel && (*plct).getBX() == bx &&
1342  (*plct).getQuality() < bestALCTs[bx][accel].getQuality() &&
1343  (*plct).getQuality() >= secondALCTs[bx][accel].getQuality() &&
1344  (*plct).getKeyWG() >= secondALCTs[bx][accel].getKeyWG()) {
1345  secondALCTs[bx][accel] = *plct;
1346  }
1347  }
1348  }
1349  }
1350  }
1351  }
1352 
1353  // Fill the vector with up to four best ALCTs per bx and return it.
1354  std::vector<CSCALCTDigi> fourBest;
1355  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
1356  for (int i = 0; i < 2; i++) {
1357  if (bestALCTs[bx][i].isValid()) fourBest.push_back(bestALCTs[bx][i]);
1358  }
1359  for (int i = 0; i < 2; i++) {
1360  if (secondALCTs[bx][i].isValid()) fourBest.push_back(secondALCTs[bx][i]);
1361  }
1362  }
1363 
1364  if (infoV > 1) {
1365  LogTrace("CSCAnodeLCTProcessor") << fourBest.size() << " ALCTs selected: ";
1366  for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1367  plct != fourBest.end(); plct++) {
1368  LogTrace("CSCAnodeLCTProcessor") << (*plct);
1369  }
1370  }
1371 
1372  return fourBest;
1373 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
#define LogTrace(id)
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:63
int getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:36
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:57
void CSCAnodeLCTProcessor::checkConfigParameters ( )
private

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

Definition at line 333 of file CSCAnodeLCTProcessor.cc.

References accel_mode, def_accel_mode, def_drift_delay, def_fifo_pretrig, def_fifo_tbins, def_l1a_window_width, def_nplanes_hit_accel_pattern, def_nplanes_hit_accel_pretrig, def_nplanes_hit_pattern, def_nplanes_hit_pretrig, def_trig_mode, drift_delay, fifo_pretrig, fifo_tbins, infoV, l1a_window_width, CSCConstants::MAX_ALCT_TBINS, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, and trig_mode.

Referenced by CSCAnodeLCTProcessor(), and setConfigParameters().

333  {
334  // Make sure that the parameter values are within the allowed range.
335 
336  // Max expected values.
337  static const unsigned int max_fifo_tbins = 1 << 5;
338  static const unsigned int max_fifo_pretrig = 1 << 5;
339  static const unsigned int max_drift_delay = 1 << 2;
340  static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
341  static const unsigned int max_nplanes_hit_pattern = 1 << 3;
342  static const unsigned int max_nplanes_hit_accel_pretrig = 1 << 3;
343  static const unsigned int max_nplanes_hit_accel_pattern = 1 << 3;
344  static const unsigned int max_trig_mode = 1 << 2;
345  static const unsigned int max_accel_mode = 1 << 2;
346  static const unsigned int max_l1a_window_width = CSCConstants::MAX_ALCT_TBINS; // 4 bits
347 
348  // Checks.
349  if (fifo_tbins >= max_fifo_tbins) {
350  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
351  << "+++ Value of fifo_tbins, " << fifo_tbins
352  << ", exceeds max allowed, " << max_fifo_tbins-1 << " +++\n"
353  << "+++ Try to proceed with the default value, fifo_tbins="
354  << def_fifo_tbins << " +++\n";
356  }
357  if (fifo_pretrig >= max_fifo_pretrig) {
358  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
359  << "+++ Value of fifo_pretrig, " << fifo_pretrig
360  << ", exceeds max allowed, " << max_fifo_pretrig-1 << " +++\n"
361  << "+++ Try to proceed with the default value, fifo_pretrig="
362  << def_fifo_pretrig << " +++\n";
364  }
365  if (drift_delay >= max_drift_delay) {
366  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
367  << "+++ Value of drift_delay, " << drift_delay
368  << ", exceeds max allowed, " << max_drift_delay-1 << " +++\n"
369  << "+++ Try to proceed with the default value, drift_delay="
370  << def_drift_delay << " +++\n";
372  }
373  if (nplanes_hit_pretrig >= max_nplanes_hit_pretrig) {
374  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
375  << "+++ Value of nplanes_hit_pretrig, " << nplanes_hit_pretrig
376  << ", exceeds max allowed, " << max_nplanes_hit_pretrig-1 << " +++\n"
377  << "+++ Try to proceed with the default value, nplanes_hit_pretrig="
378  << nplanes_hit_pretrig << " +++\n";
379  nplanes_hit_pretrig = def_nplanes_hit_pretrig;
380  }
381  if (nplanes_hit_pattern >= max_nplanes_hit_pattern) {
382  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
383  << "+++ Value of nplanes_hit_pattern, " << nplanes_hit_pattern
384  << ", exceeds max allowed, " << max_nplanes_hit_pattern-1 << " +++\n"
385  << "+++ Try to proceed with the default value, nplanes_hit_pattern="
386  << nplanes_hit_pattern << " +++\n";
387  nplanes_hit_pattern = def_nplanes_hit_pattern;
388  }
389  if (nplanes_hit_accel_pretrig >= max_nplanes_hit_accel_pretrig) {
390  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
391  << "+++ Value of nplanes_hit_accel_pretrig, "
392  << nplanes_hit_accel_pretrig << ", exceeds max allowed, "
393  << max_nplanes_hit_accel_pretrig-1 << " +++\n"
394  << "+++ Try to proceed with the default value, "
395  << "nplanes_hit_accel_pretrig=" << nplanes_hit_accel_pretrig << " +++\n";
396  nplanes_hit_accel_pretrig = def_nplanes_hit_accel_pretrig;
397  }
398  if (nplanes_hit_accel_pattern >= max_nplanes_hit_accel_pattern) {
399  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
400  << "+++ Value of nplanes_hit_accel_pattern, "
401  << nplanes_hit_accel_pattern << ", exceeds max allowed, "
402  << max_nplanes_hit_accel_pattern-1 << " +++\n"
403  << "+++ Try to proceed with the default value, "
404  << "nplanes_hit_accel_pattern=" << nplanes_hit_accel_pattern << " +++\n";
405  nplanes_hit_accel_pattern = def_nplanes_hit_accel_pattern;
406  }
407  if (trig_mode >= max_trig_mode) {
408  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
409  << "+++ Value of trig_mode, " << trig_mode
410  << ", exceeds max allowed, " << max_trig_mode-1 << " +++\n"
411  << "+++ Try to proceed with the default value, trig_mode="
412  << trig_mode << " +++\n";
413  trig_mode = def_trig_mode;
414  }
415  if (accel_mode >= max_accel_mode) {
416  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
417  << "+++ Value of accel_mode, " << accel_mode
418  << ", exceeds max allowed, " << max_accel_mode-1 << " +++\n"
419  << "+++ Try to proceed with the default value, accel_mode="
420  << accel_mode << " +++\n";
421  accel_mode = def_accel_mode;
422  }
423  if (l1a_window_width >= max_l1a_window_width) {
424  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
425  << "+++ Value of l1a_window_width, " << l1a_window_width
426  << ", exceeds max allowed, " << max_l1a_window_width-1 << " +++\n"
427  << "+++ Try to proceed with the default value, l1a_window_width="
428  << l1a_window_width << " +++\n";
429  l1a_window_width = def_l1a_window_width;
430  }
431 }
static const unsigned int def_drift_delay
static const unsigned int def_fifo_tbins
static const unsigned int def_accel_mode
static const unsigned int def_nplanes_hit_accel_pretrig
static const unsigned int def_fifo_pretrig
static const unsigned int def_nplanes_hit_pattern
static const unsigned int def_l1a_window_width
static const unsigned int def_trig_mode
static const unsigned int def_nplanes_hit_accel_pattern
unsigned int nplanes_hit_accel_pattern
static const unsigned int def_nplanes_hit_pretrig
unsigned int nplanes_hit_accel_pretrig
void CSCAnodeLCTProcessor::clear ( void  )

Clears the LCT containers.

Definition at line 433 of file CSCAnodeLCTProcessor.cc.

References bestALCT, CSCALCTDigi::clear(), CSCConstants::MAX_ALCT_TBINS, and secondALCT.

Referenced by ghostCancellationLogic(), and ghostCancellationLogicSLHC().

433  {
434  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
435  bestALCT[bx].clear();
436  secondALCT[bx].clear();
437  }
438 }
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:35
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS]
CSCALCTDigi bestALCT[CSCConstants::MAX_ALCT_TBINS]
void CSCAnodeLCTProcessor::clear ( const int  wire,
const int  pattern 
)
private

Clears the quality for a given wire and pattern if it is a ghost.

Definition at line 440 of file CSCAnodeLCTProcessor.cc.

References quality, and mixOne_premix_on_sim_cfi::wire.

440  {
441  /* Clear the data off of selected pattern */
442  if (pattern == 0) quality[wire][0] = -999;
443  else {
444  quality[wire][1] = -999;
445  quality[wire][2] = -999;
446  }
447 }
int quality[CSCConstants::MAX_NUM_WIRES][3]
void CSCAnodeLCTProcessor::dumpConfigParams ( ) const
private

Dump ALCT configuration parameters.

Definition at line 1486 of file CSCAnodeLCTProcessor.cc.

References accel_mode, drift_delay, fifo_pretrig, fifo_tbins, l1a_window_width, LogDebug, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, and trig_mode.

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

1486  {
1487  std::ostringstream strm;
1488  strm << "\n";
1489  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1490  strm << "+ ALCT configuration parameters: +\n";
1491  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1492  strm << " fifo_tbins [total number of time bins in DAQ readout] = "
1493  << fifo_tbins << "\n";
1494  strm << " fifo_pretrig [start time of anode raw hits in DAQ readout] = "
1495  << fifo_pretrig << "\n";
1496  strm << " drift_delay [drift delay after pre-trigger, in 25 ns bins] = "
1497  << drift_delay << "\n";
1498  strm << " nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = "
1499  << nplanes_hit_pretrig << "\n";
1500  strm << " nplanes_hit_pattern [min. number of layers hit for trigger] = "
1501  << nplanes_hit_pattern << "\n";
1502  strm << " nplanes_hit_accel_pretrig [min. number of layers hit for accel."
1503  << " pre-trig.] = " << nplanes_hit_accel_pretrig << "\n";
1504  strm << " nplanes_hit_accel_pattern [min. number of layers hit for accel."
1505  << " trigger] = " << nplanes_hit_accel_pattern << "\n";
1506  strm << " trig_mode [enabling/disabling collision/accelerator tracks] = "
1507  << trig_mode << "\n";
1508  strm << " accel_mode [preference to collision/accelerator tracks] = "
1509  << accel_mode << "\n";
1510  strm << " l1a_window_width [L1Accept window width, in 25 ns bins] = "
1511  << l1a_window_width << "\n";
1512  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1513  LogDebug("CSCAnodeLCTProcessor") << strm.str();
1514  //std::cout<<strm.str()<<std::endl;
1515 }
#define LogDebug(id)
unsigned int nplanes_hit_accel_pattern
unsigned int nplanes_hit_accel_pretrig
void CSCAnodeLCTProcessor::dumpDigis ( const std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const
private

Dump digis on wire groups.

Definition at line 1518 of file CSCAnodeLCTProcessor.cc.

References CSCDetId::chamberName(), TauDecayModes::dec, relativeConstraints::empty, LogDebug, LogTrace, CSCConstants::NUM_LAYERS, numWireGroups, theChamber, theEndcap, theRing, theStation, and mixOne_premix_on_sim_cfi::wire.

Referenced by pulseExtension().

1518  {
1519  LogDebug("CSCAnodeLCTProcessor")
1521  << " nWiregroups " << numWireGroups;
1522 
1523  std::ostringstream strstrm;
1524  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1525  if (i_wire%10 == 0) {
1526  if (i_wire < 100) strstrm << i_wire/10;
1527  else strstrm << (i_wire-100)/10;
1528  }
1529  else strstrm << " ";
1530  }
1531  strstrm << "\n";
1532  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1533  strstrm << i_wire%10;
1534  }
1535  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
1536  strstrm << "\n";
1537  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1538  if (!wire[i_layer][i_wire].empty()) {
1539  std::vector<int> bx_times = wire[i_layer][i_wire];
1540  strstrm << std::hex << bx_times[0] << std::dec;
1541  }
1542  else {
1543  strstrm << ".";
1544  }
1545  }
1546  }
1547  LogTrace("CSCAnodeLCTProcessor") << strstrm.str();
1548 }
#define LogDebug(id)
#define LogTrace(id)
std::string chamberName() const
Definition: CSCDetId.cc:71
std::vector< CSCALCTDigi > CSCAnodeLCTProcessor::getALCTs ( )

Returns vector of all found ALCTs, if any.

Definition at line 1628 of file CSCAnodeLCTProcessor.cc.

References bestALCT, CSCConstants::MAX_ALCT_TBINS, and secondALCT.

Referenced by readoutALCTs(), and run().

1628  {
1629  std::vector<CSCALCTDigi> tmpV;
1630  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
1631  if (bestALCT[bx].isValid()) tmpV.push_back(bestALCT[bx]);
1632  if (secondALCT[bx].isValid()) tmpV.push_back(secondALCT[bx]);
1633  }
1634  return tmpV;
1635 }
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS]
CSCALCTDigi bestALCT[CSCConstants::MAX_ALCT_TBINS]
bool CSCAnodeLCTProcessor::getDigis ( const CSCWireDigiCollection wiredc)

Access routines to wire digis.

Definition at line 587 of file CSCAnodeLCTProcessor.cc.

References begin, CSCDetId::chamberName(), digiV, disableME1a, relativeConstraints::empty, infoV, isME11, LogTrace, CSCConstants::NUM_LAYERS, theChamber, theEndcap, theRing, theSector, theStation, theSubsector, and theTrigChamber.

Referenced by run(), and setCSCGeometry().

587  {
588  // Routine for getting digis and filling digiV vector.
589  bool noDigis = true;
590 
591  // Loop over layers and save wire digis on each one into digiV[layer].
592  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
593  digiV[i_layer].clear();
594 
595  CSCDetId detid(theEndcap, theStation, theRing, theChamber, i_layer+1);
596  getDigis(wiredc, detid);
597 
598  // If this is ME1/1, fetch digis in corresponding ME1/A (ring=4) as well.
599  if (isME11 && !disableME1a) {
600  CSCDetId detid_me1a(theEndcap, theStation, 4, theChamber, i_layer+1);
601  getDigis(wiredc, detid_me1a);
602  }
603 
604  if (!digiV[i_layer].empty()) {
605  noDigis = false;
606  if (infoV > 1) {
607  LogTrace("CSCAnodeLCTProcessor")
608  << "found " << digiV[i_layer].size()
609  << " wire digi(s) in layer " << i_layer << " of " << detid.chamberName()
610  << " (trig. sector " << theSector
611  << " subsector " << theSubsector << " id " << theTrigChamber << ")";
612  for (std::vector<CSCWireDigi>::iterator pld = digiV[i_layer].begin();
613  pld != digiV[i_layer].end(); pld++) {
614  LogTrace("CSCAnodeLCTProcessor") << " " << (*pld);
615  }
616  }
617  }
618  }
619 
620  return noDigis;
621 }
bool getDigis(const CSCWireDigiCollection *wiredc)
#define LogTrace(id)
#define begin
Definition: vmac.h:32
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
void CSCAnodeLCTProcessor::getDigis ( const CSCWireDigiCollection wiredc,
const CSCDetId id 
)

Definition at line 623 of file CSCAnodeLCTProcessor.cc.

References digiV.

624  {
625  const CSCWireDigiCollection::Range rwired = wiredc->get(id);
626  for (CSCWireDigiCollection::const_iterator digiIt = rwired.first;
627  digiIt != rwired.second; ++digiIt) {
628  digiV[id.layer()-1].push_back(*digiIt);
629  }
630 }
std::vector< CSCWireDigi >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
void CSCAnodeLCTProcessor::ghostCancellationLogic ( )
private

Definition at line 962 of file CSCAnodeLCTProcessor.cc.

References clear(), dt, first_bx, ghost_cancellation_bx_depth, ghost_cancellation_side_quality, infoV, LogTrace, CSCConstants::MAX_NUM_WIRES, numWireGroups, and quality.

Referenced by run().

962  {
963  /* This function looks for LCTs on the previous and next wires. If one
964  exists and it has a better quality and a bx_time up to 4 clocks earlier
965  than the present, then the present LCT is cancelled. The present LCT
966  also gets cancelled if it has the same quality as the one on the
967  previous wire (this has not been done in 2003 test beam). The
968  cancellation is done separately for collision and accelerator patterns. */
969 
970  int ghost_cleared[CSCConstants::MAX_NUM_WIRES][2];
971 
972  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
973  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
974  ghost_cleared[key_wire][i_pattern] = 0;
975 
976  // Non-empty wire group.
977  int qual_this = quality[key_wire][i_pattern];
978  if (qual_this > 0) {
979 
980  // Previous wire.
981  int qual_prev = (key_wire > 0) ? quality[key_wire-1][i_pattern] : 0;
982  if (qual_prev > 0) {
983  int dt = first_bx[key_wire] - first_bx[key_wire-1];
984  // Cancel this wire
985  // 1) If the candidate at the previous wire is at the same bx
986  // clock and has better quality (or equal quality - this has
987  // been implemented only in 2004).
988  // 2) If the candidate at the previous wire is up to 4 clocks
989  // earlier, regardless of quality.
990  if (dt == 0) {
991  if (qual_prev >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
992  }
993  else if (dt > 0 && dt <= ghost_cancellation_bx_depth ) {
994  // Next "if" check accounts for firmware bug and should be
995  // removed once the next firmware version is used.
996  // The bug is fixed in 5/5/2008 version of ALCT firmware,
997  // which is used in all chambers starting with 26/05/2008.
1000  (qual_prev > qual_this) )
1001  ghost_cleared[key_wire][i_pattern] = 1;
1002  }
1003  }
1004 
1005  // Next wire.
1006  // Skip this step if this wire is already declared "ghost".
1007  if (ghost_cleared[key_wire][i_pattern] == 1) {
1008  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1009  << ((i_pattern == 0) ? "Accelerator" : "Collision")
1010  << " pattern ghost cancelled on key_wire " << key_wire <<" q="<<qual_this
1011  << " by wire " << key_wire-1<<" q="<<qual_prev;
1012  continue;
1013  }
1014 
1015  int qual_next =
1016  (key_wire < numWireGroups-1) ? quality[key_wire+1][i_pattern] : 0;
1017  if (qual_next > 0) {
1018  int dt = first_bx[key_wire] - first_bx[key_wire+1];
1019  // Same cancellation logic as for the previous wire.
1020  if (dt == 0) {
1021  if (qual_next > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1022  }
1023  else if (dt > 0 && dt <= ghost_cancellation_bx_depth ) {
1024  // Next "if" check accounts for firmware bug and should be
1025  // removed once the next firmware version is used.
1026  // The bug is fixed in 5/5/2008 version of ALCT firmware,
1027  // which is used in all chambers starting with 26/05/2008.
1030  (qual_next >= qual_this) )
1031  ghost_cleared[key_wire][i_pattern] = 1;
1032  }
1033  }
1034  if (ghost_cleared[key_wire][i_pattern] == 1) {
1035  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1036  << ((i_pattern == 0) ? "Accelerator" : "Collision")
1037  << " pattern ghost cancelled on key_wire " << key_wire <<" q="<<qual_this
1038  << " by wire " << key_wire+1<<" q="<<qual_next;
1039  continue;
1040  }
1041  }
1042  }
1043  }
1044 
1045  // All cancellation is done in parallel, so wiregroups do not know what
1046  // their neighbors are cancelling.
1047  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
1048  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
1049  if (ghost_cleared[key_wire][i_pattern] > 0) {
1050  clear(key_wire, i_pattern);
1051  }
1052  }
1053  }
1054 }
float dt
Definition: AMPTWrapper.h:126
int quality[CSCConstants::MAX_NUM_WIRES][3]
#define LogTrace(id)
int first_bx[CSCConstants::MAX_NUM_WIRES]
void CSCAnodeLCTProcessor::ghostCancellationLogicSLHC ( )
private

Definition at line 1057 of file CSCAnodeLCTProcessor.cc.

References clear(), dt, first_bx, first_bx_corrected, ghost_cancellation_bx_depth, ghost_cancellation_side_quality, infoV, LogTrace, CSCConstants::MAX_NUM_WIRES, numWireGroups, or, quality, runME21ILT_, runME3141ILT_, and use_corrected_bx.

Referenced by run().

1057  {
1058  /* This function looks for LCTs on the previous and next wires. If one
1059  exists and it has a better quality and a bx_time up to
1060  ghost_cancellation_bx_depth clocks earlier than the present,
1061  then the present LCT is cancelled. The present LCT
1062  also gets cancelled if it has the same quality as the one on the
1063  previous wire (this has not been done in 2003 test beam). The
1064  cancellation is done separately for collision and accelerator patterns. */
1065 
1066  int ghost_cleared[CSCConstants::MAX_NUM_WIRES][2];
1067 
1068  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
1069  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
1070  ghost_cleared[key_wire][i_pattern] = 0;
1071 
1072  // Non-empty wire group.
1073  int qual_this = quality[key_wire][i_pattern];
1074  if (qual_this > 0) {
1075 
1076  if (runME21ILT_ or runME3141ILT_) qual_this = (qual_this & 0x03);
1077  // Previous wire.
1078  int dt = -1;
1079  int qual_prev = (key_wire > 0) ? quality[key_wire-1][i_pattern] : 0;
1080  if (qual_prev > 0) {
1081  if (use_corrected_bx)
1082  dt = first_bx_corrected[key_wire] - first_bx_corrected[key_wire-1];
1083  else
1084  dt = first_bx[key_wire] - first_bx[key_wire-1];
1085  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
1086  if (runME21ILT_ or runME3141ILT_) qual_prev = (qual_prev & 0x03);
1087 
1088  // Cancel this wire
1089  // 1) If the candidate at the previous wire is at the same bx
1090  // clock and has better quality (or equal? quality - this has
1091  // been implemented only in 2004).
1092  // 2) If the candidate at the previous wire is up to 4 clocks
1093  // earlier, regardless of quality.
1094  if (dt == 0) {
1095  if (qual_prev > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1096  }
1097  else if (dt > 0 && dt <= ghost_cancellation_bx_depth ) {
1098  // Next "if" check accounts for firmware bug and should be
1099  // removed once the next firmware version is used.
1100  // The bug is fixed in 5/5/2008 version of ALCT firmware,
1101  // which is used in all chambers starting with 26/05/2008.
1104  (qual_prev > qual_this) )
1105  ghost_cleared[key_wire][i_pattern] = 1;
1106  }
1107  }
1108 
1109  // Next wire.
1110  // Skip this step if this wire is already declared "ghost".
1111  if (ghost_cleared[key_wire][i_pattern] == 1) {
1112  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1113  << ((i_pattern == 0) ? "Accelerator" : "Collision")
1114  << " pattern ghost cancelled on key_wire " << key_wire <<" q="<<qual_this
1115  << " by wire " << key_wire-1<<" q="<<qual_prev<<" dt="<<dt;
1116  continue;
1117  }
1118 
1119  dt = -1;
1120  int qual_next =
1121  (key_wire < numWireGroups-1) ? quality[key_wire+1][i_pattern] : 0;
1122  if (qual_next > 0) {
1123  if (use_corrected_bx)
1124  dt = first_bx_corrected[key_wire] - first_bx_corrected[key_wire+1];
1125  else
1126  dt = first_bx[key_wire] - first_bx[key_wire+1];
1127  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
1128  if (runME21ILT_ or runME3141ILT_)
1129  qual_next = (qual_next & 0x03);
1130  // Same cancellation logic as for the previous wire.
1131  if (dt == 0) {
1132  if (qual_next >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1133  }
1134  else if (dt > 0 && dt <= ghost_cancellation_bx_depth ) {
1135  // Next "if" check accounts for firmware bug and should be
1136  // removed once the next firmware version is used.
1137  // The bug is fixed in 5/5/2008 version of ALCT firmware,
1138  // which is used in all chambers starting with 26/05/2008.
1141  (qual_next >= qual_this) )
1142  ghost_cleared[key_wire][i_pattern] = 1;
1143  }
1144  }
1145  if (ghost_cleared[key_wire][i_pattern] == 1) {
1146  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1147  << ((i_pattern == 0) ? "Accelerator" : "Collision")
1148  << " pattern ghost cancelled on key_wire " << key_wire <<" q="<<qual_this
1149  << " by wire " << key_wire+1<<" q="<<qual_next<<" dt="<<dt;
1150  continue;
1151  }
1152  }
1153  }
1154  }
1155 
1156  // All cancellation is done in parallel, so wiregroups do not know what
1157  // their neighbors are cancelling.
1158  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
1159  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
1160  if (ghost_cleared[key_wire][i_pattern] > 0) {
1161  clear(key_wire, i_pattern);
1162  }
1163  }
1164  }
1165 }
float dt
Definition: AMPTWrapper.h:126
int quality[CSCConstants::MAX_NUM_WIRES][3]
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
#define LogTrace(id)
int first_bx[CSCConstants::MAX_NUM_WIRES]
bool CSCAnodeLCTProcessor::isBetterALCT ( const CSCALCTDigi lhsALCT,
const CSCALCTDigi rhsALCT 
)
private

Definition at line 1375 of file CSCAnodeLCTProcessor.cc.

References CSCALCTDigi::getAccelerator(), CSCALCTDigi::getBX(), CSCALCTDigi::getKeyWG(), CSCALCTDigi::getQuality(), CSCALCTDigi::isValid(), and quality.

Referenced by lctSearch().

1376  {
1377  /* This method should have been an overloaded > operator, but we
1378  have to keep it here since need to check values in quality[][]
1379  array modified according to accel_mode parameter. */
1380  bool returnValue = false;
1381 
1382  if (lhsALCT.isValid() && !rhsALCT.isValid()) {return true;}
1383 
1384  // ALCTs found at earlier bx times are ranked higher than ALCTs found at
1385  // later bx times regardless of the quality.
1386  if (lhsALCT.getBX() < rhsALCT.getBX()) {returnValue = true;}
1387  if (lhsALCT.getBX() != rhsALCT.getBX()) {return returnValue;}
1388 
1389  // First check the quality of ALCTs.
1390  int qual1 = lhsALCT.getQuality();
1391  int qual2 = rhsALCT.getQuality();
1392  if (qual1 > qual2) {returnValue = true;}
1393  // If qualities are the same, check accelerator bits of both ALCTs.
1394  // If they are not the same, rank according to accel_mode value.
1395  // If they are the same, keep the track selector assignment.
1396  else if (qual1 == qual2 &&
1397  lhsALCT.getAccelerator() != rhsALCT.getAccelerator() &&
1398  quality[lhsALCT.getKeyWG()][1-lhsALCT.getAccelerator()] >
1399  quality[rhsALCT.getKeyWG()][1-rhsALCT.getAccelerator()])
1400  {returnValue = true;}
1401 
1402  return returnValue;
1403 }
int quality[CSCConstants::MAX_NUM_WIRES][3]
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:63
int getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:36
int getAccelerator() const
Definition: CSCALCTDigi.h:43
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:57
void CSCAnodeLCTProcessor::lctSearch ( )
private

Definition at line 1168 of file CSCAnodeLCTProcessor.cc.

References accelMode(), bestALCT, bestTrackSelector(), CSCDetId::chamberName(), first_bx, first_bx_corrected, CSCALCTDigi::getFullBX(), infoV, isBetterALCT(), LogDebug, LogTrace, CSCConstants::MAX_ALCT_TBINS, numWireGroups, quality, secondALCT, CSCALCTDigi::setFullBX(), CSCALCTDigi::setTrknmb(), theChamber, theEndcap, theRing, theSector, theStation, theSubsector, theTrigChamber, trigMode(), and use_corrected_bx.

Referenced by run().

1168  {
1169  // First modify the quality according accel_mode, then store all
1170  // of the valid LCTs in an array.
1171  std::vector<CSCALCTDigi> lct_list;
1172 
1173  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1174  // If there is either accelerator or collision, perform trigMode
1175  // function before storing and sorting.
1176  if (quality[i_wire][0] > 0 || quality[i_wire][1] > 0) {
1177  trigMode(i_wire);
1178 
1179  int bx = first_bx[i_wire];
1180  int fbx = first_bx_corrected[i_wire];
1181  if (infoV>1) LogTrace("CSCAnodeLCTProcessor")<<" bx="<<bx<<" fbx="<<fbx;
1182  if (use_corrected_bx) {
1183  bx = fbx;
1184  fbx = first_bx[i_wire];
1185  }
1186  if (infoV>1) LogTrace("CSCAnodeLCTProcessor")<<" bx="<<bx<<" fbx="<<fbx;
1187  // Store any valid accelerator pattern LCTs.
1188  if (quality[i_wire][0] > 0) {
1189  int qual = (quality[i_wire][0] & 0x03); // 2 LSBs
1190  CSCALCTDigi lct_info(1, qual, 1, 0, i_wire, bx);
1191  lct_info.setFullBX(fbx);
1192  lct_list.push_back(lct_info);
1193  }
1194 
1195  // Store any valid collision pattern LCTs.
1196  if (quality[i_wire][1] > 0) {
1197  int qual = (quality[i_wire][1] & 0x03); // 2 LSBs
1198  CSCALCTDigi lct_info(1, qual, 0, quality[i_wire][2], i_wire, bx);
1199  //lct_info.setFullBX(fbx); // uncomment if one wants, e.g., to keep corrected time here
1200  lct_list.push_back(lct_info);
1201  if (infoV>1) LogTrace("CSCAnodeLCTProcessor")<<" got lct_info: "<<lct_info;
1202  }
1203 
1204  // Modify qualities according to accel_mode parameter.
1205  accelMode(i_wire);
1206  }
1207  }
1208 
1209  // Best track selector selects two collision and two accelerator ALCTs
1210  // with the best quality per time bin.
1211  std::vector<CSCALCTDigi> fourBest = bestTrackSelector(lct_list);
1212 
1213  if (infoV > 0) {
1214  int n_alct_all=0, n_alct=0;
1215  for (std::vector <CSCALCTDigi>::const_iterator plct = lct_list.begin(); plct != lct_list.end(); plct++)
1216  if (plct->isValid() && plct->getBX()==6) n_alct_all++;
1217  for (std::vector <CSCALCTDigi>::const_iterator plct = fourBest.begin(); plct != fourBest.end(); plct++)
1218  if (plct->isValid() && plct->getBX()==6) n_alct++;
1219 
1220  LogTrace("CSCAnodeLCTProcessor")<<"alct_count E:"<<theEndcap<<"S:"<<theStation<<"R:"<<theRing<<"C:"<<theChamber
1221  <<" all "<<n_alct_all<<" found "<<n_alct;
1222  }
1223 
1224  // Select two best of four per time bin, based on quality and
1225  // accel_mode parameter.
1226  for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1227  plct != fourBest.end(); plct++) {
1228 
1229  int bx = plct->getBX();
1230  if (bx >= CSCConstants::MAX_ALCT_TBINS) {
1231  if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeALCT")
1232  << "+++ Bx of ALCT candidate, " << bx << ", exceeds max allowed, "
1233  << CSCConstants::MAX_ALCT_TBINS-1 << "; skipping it... +++\n";
1234  continue;
1235  }
1236 
1237  if (isBetterALCT(*plct, bestALCT[bx])) {
1238  if (isBetterALCT(bestALCT[bx], secondALCT[bx])) {
1239  secondALCT[bx] = bestALCT[bx];
1240  }
1241  bestALCT[bx] = *plct;
1242  }
1243  else if (isBetterALCT(*plct, secondALCT[bx])) {
1244  secondALCT[bx] = *plct;
1245  }
1246  }
1247 
1248  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
1249  if (bestALCT[bx].isValid()) {
1250  bestALCT[bx].setTrknmb(1);
1251  if (infoV > 0) {
1252  LogDebug("CSCAnodeLCTProcessor")
1253  << "\n" << bestALCT[bx] << " fullBX = "<<bestALCT[bx].getFullBX()
1255  << " (sector " << theSector << " subsector " << theSubsector
1256  << " trig id. " << theTrigChamber << ")" << "\n";
1257  }
1258  if (secondALCT[bx].isValid()) {
1259  secondALCT[bx].setTrknmb(2);
1260  if (infoV > 0) {
1261  LogDebug("CSCAnodeLCTProcessor")
1262  << secondALCT[bx] << " fullBX = "<<secondALCT[bx].getFullBX()
1264  << " (sector " << theSector << " subsector " << theSubsector
1265  << " trig id. " << theTrigChamber << ")" << "\n";
1266  }
1267  }
1268  }
1269  }
1270 }
#define LogDebug(id)
int quality[CSCConstants::MAX_NUM_WIRES][3]
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
void trigMode(const int key_wire)
int getFullBX() const
return 12-bit full BX.
Definition: CSCALCTDigi.h:75
void accelMode(const int key_wire)
#define LogTrace(id)
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS]
std::string chamberName() const
Definition: CSCDetId.cc:71
bool isBetterALCT(const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT)
std::vector< CSCALCTDigi > bestTrackSelector(const std::vector< CSCALCTDigi > &all_alcts)
CSCALCTDigi bestALCT[CSCConstants::MAX_ALCT_TBINS]
int first_bx[CSCConstants::MAX_NUM_WIRES]
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting ALCTs.
Definition: CSCALCTDigi.h:72
void CSCAnodeLCTProcessor::loadPatternMask ( )
private

Load pattern mask defined by configuration into pattern_mask

Definition at line 280 of file CSCAnodeLCTProcessor.cc.

References CSCConstants::MAX_WIRES_IN_PATTERN, narrow_mask_r1, CSCConstants::NUM_ALCT_PATTERNS, pattern_mask, pattern_mask_open, pattern_mask_r1, and theRing.

Referenced by CSCAnodeLCTProcessor().

281 {
282  // Load appropriate pattern mask.
283  for (int i_patt = 0; i_patt < CSCConstants::NUM_ALCT_PATTERNS; i_patt++) {
284  for (int i_wire = 0; i_wire < CSCConstants::MAX_WIRES_IN_PATTERN; i_wire++) {
285  pattern_mask[i_patt][i_wire] = pattern_mask_open[i_patt][i_wire];
286  if (narrow_mask_r1 && (theRing == 1 || theRing == 4))
287  pattern_mask[i_patt][i_wire] = pattern_mask_r1[i_patt][i_wire];
288  }
289  }
290 }
int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
static const int pattern_mask_open[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
static const int pattern_mask_r1[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
bool CSCAnodeLCTProcessor::patternDetection ( const int  key_wire)
private

Definition at line 824 of file CSCAnodeLCTProcessor.cc.

References funct::abs(), drift_delay, first_bx, first_bx_corrected, hit_persist, infoV, LogTrace, CSCConstants::MAX_WIRES_IN_PATTERN, MESelection, nplanes_hit_accel_pattern, nplanes_hit_pattern, CSCConstants::NUM_ALCT_PATTERNS, CSCConstants::NUM_LAYERS, numWireGroups, or, pattern_envelope, pattern_mask, pulse, class-composition::Q, quality, runME21ILT_, runME3141ILT_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by run().

824  {
825  /* See if there is a pattern that satisfies nplanes_hit_pattern number of
826  layers hit for either the accelerator or collision patterns. Use
827  the pattern with the best quality. */
828 
829  bool trigger = false;
830  bool hit_layer[CSCConstants::NUM_LAYERS];
831  unsigned int temp_quality;
832  int this_layer, this_wire, delta_wire;
833  // If nplanes_hit_accel_pattern is 0, the firmware uses the value
834  // of nplanes_hit_pattern instead.
835  const unsigned int nplanes_hit_pattern_acc =
838  const unsigned int pattern_thresh[CSCConstants::NUM_ALCT_PATTERNS] = {
839  nplanes_hit_pattern_acc, nplanes_hit_pattern, nplanes_hit_pattern
840  };
841  const std::string ptn_label[] = {"Accelerator", "CollisionA", "CollisionB"};
842 
843  for (int i_pattern = 0; i_pattern < CSCConstants::NUM_ALCT_PATTERNS; i_pattern++){
844  temp_quality = 0;
845  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
846  hit_layer[i_layer] = false;
847 
848  double num_pattern_hits=0., times_sum=0.;
849  std::multiset<int> mset_for_median;
850  mset_for_median.clear();
851 
852  for (int i_wire = 0; i_wire < CSCConstants::MAX_WIRES_IN_PATTERN; i_wire++){
853  if (pattern_mask[i_pattern][i_wire] != 0){
854  this_layer = pattern_envelope[0][i_wire];
855  delta_wire = pattern_envelope[1+MESelection][i_wire];
856  this_wire = delta_wire + key_wire;
857  if ((this_wire >= 0) && (this_wire < numWireGroups)){
858 
859  // Wait a drift_delay time later and look for layers hit in
860  // the pattern.
861  if ( ( (pulse[this_layer][this_wire] >>
862  (first_bx[key_wire] + drift_delay)) & 1) == 1) {
863 
864  // If layer has never had a hit before, then increment number
865  // of layer hits.
866  if (hit_layer[this_layer] == false){
867  temp_quality++;
868  // keep track of which layers already had hits.
869  hit_layer[this_layer] = true;
870  if (infoV > 1)
871  LogTrace("CSCAnodeLCTProcessor")
872  << "bx_time: " << first_bx[key_wire]
873  << " pattern: " << i_pattern << " keywire: " << key_wire
874  << " layer: " << this_layer
875  << " quality: " << temp_quality;
876  }
877 
878  // for averaged time use only the closest WGs around the key WG
879  if (abs(delta_wire)<2) {
880  // find at what bx did pulse on this wire&layer start
881  // use hit_pesrist constraint on how far back we can go
882  int first_bx_layer = first_bx[key_wire] + drift_delay;
883  for (unsigned int dbx=0; dbx<hit_persist; dbx++) {
884  if (((pulse[this_layer][this_wire] >> (first_bx_layer-1)) & 1) == 1) first_bx_layer--;
885  else break;
886  }
887  times_sum += (double)first_bx_layer;
888  num_pattern_hits += 1.;
889  mset_for_median.insert(first_bx_layer);
890  if (infoV > 2)
891  LogTrace("CSCAnodeLCTProcessor")
892  <<" 1st bx in layer: "<<first_bx_layer
893  <<" sum bx: "<<times_sum
894  <<" #pat. hits: "<<num_pattern_hits;
895  }
896  }
897  }
898  }
899  }
900 
901  // calculate median
902  const int sz = mset_for_median.size();
903  if (sz > 0) {
904  std::multiset<int>::iterator im = mset_for_median.begin();
905  if (sz > 1) std::advance(im,sz/2-1);
906  if (sz == 1) first_bx_corrected[key_wire] = *im;
907  else if ((sz % 2) == 1) first_bx_corrected[key_wire] = *(++im);
908  else first_bx_corrected[key_wire] = ((*im) + (*(++im)))/2;
909 
910 #if defined(EDM_ML_DEBUG)
911  if (infoV > 1) {
912  auto lt = LogTrace("CSCAnodeLCTProcessor") <<"bx="<<first_bx[key_wire]<<" bx_cor="<< first_bx_corrected[key_wire]<<" bxset=";
913  for (im = mset_for_median.begin(); im != mset_for_median.end(); im++) {
914  lt<<" "<<*im;
915  }
916  }
917 #endif
918  }
919 
920  if (temp_quality >= pattern_thresh[i_pattern]) {
921  trigger = true;
922 
923  // Quality definition changed on 22 June 2007: it no longer depends
924  // on pattern_thresh.
925  int Q;
926  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
927  if (temp_quality == 3 and (runME21ILT_ or runME3141ILT_)) Q = 4;
928  else if (temp_quality > 3) Q = temp_quality - 3;
929  else Q = 0; // quality code 0 is valid!
930  temp_quality = Q;
931 
932  if (i_pattern == 0) {
933  // Accelerator pattern
934  quality[key_wire][0] = temp_quality;
935  }
936  else {
937  // Only one collision pattern (of the best quality) is reported
938  if (static_cast<int>(temp_quality) > quality[key_wire][1]) {
939  quality[key_wire][1] = temp_quality;
940  quality[key_wire][2] = i_pattern-1;
941  }
942  }
943  if (infoV > 1) {
944  LogTrace("CSCAnodeLCTProcessor")
945  << "Pattern found; keywire: " << key_wire
946  << " type: " << ptn_label[i_pattern]
947  << " quality: " << temp_quality << "\n";
948  }
949  }
950  }
951  if (infoV > 1 && quality[key_wire][1] > 0) {
952  if (quality[key_wire][2] == 0)
953  LogTrace("CSCAnodeLCTProcessor")
954  << "Collision Pattern A is chosen" << "\n";
955  else if (quality[key_wire][2] == 1)
956  LogTrace("CSCAnodeLCTProcessor")
957  << "Collision Pattern B is chosen" << "\n";
958  }
959  return trigger;
960 }
int quality[CSCConstants::MAX_NUM_WIRES][3]
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
static const int pattern_envelope[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
#define LogTrace(id)
int first_bx[CSCConstants::MAX_NUM_WIRES]
unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
unsigned int nplanes_hit_accel_pattern
bool CSCAnodeLCTProcessor::preTrigger ( const int  key_wire,
const int  start_bx 
)
private

Definition at line 761 of file CSCAnodeLCTProcessor.cc.

References drift_delay, fifo_tbins, first_bx, infoV, LogTrace, CSCConstants::MAX_WIRES_IN_PATTERN, MESelection, nplanes_hit_accel_pretrig, nplanes_hit_pretrig, CSCConstants::NUM_ALCT_PATTERNS, CSCConstants::NUM_LAYERS, numWireGroups, pattern_envelope, pattern_mask, and pulse.

Referenced by run().

761  {
762  /* Check that there are nplanes_hit_pretrig or more layers hit in collision
763  or accelerator patterns for a particular key_wire. If so, return
764  true and the PatternDetection process will start. */
765 
766  unsigned int layers_hit;
767  bool hit_layer[CSCConstants::NUM_LAYERS];
768  int this_layer, this_wire;
769  // If nplanes_hit_accel_pretrig is 0, the firmware uses the value
770  // of nplanes_hit_pretrig instead.
771  const unsigned int nplanes_hit_pretrig_acc =
774  const unsigned int pretrig_thresh[CSCConstants::NUM_ALCT_PATTERNS] = {
775  nplanes_hit_pretrig_acc, nplanes_hit_pretrig, nplanes_hit_pretrig
776  };
777 
778  // Loop over bx times, accelerator and collision patterns to
779  // look for pretrigger.
780  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
781  // not have a full set of hits to start pattern search anyway.
782  unsigned int stop_bx = fifo_tbins - drift_delay;
783  for (unsigned int bx_time = start_bx; bx_time < stop_bx; bx_time++) {
784  for (int i_pattern = 0; i_pattern < CSCConstants::NUM_ALCT_PATTERNS; i_pattern++) {
785  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
786  hit_layer[i_layer] = false;
787  layers_hit = 0;
788 
789  for (int i_wire = 0; i_wire < CSCConstants::MAX_WIRES_IN_PATTERN; i_wire++){
790  if (pattern_mask[i_pattern][i_wire] != 0){
791  this_layer = pattern_envelope[0][i_wire];
792  this_wire = pattern_envelope[1+MESelection][i_wire]+key_wire;
793  if ((this_wire >= 0) && (this_wire < numWireGroups)){
794  // Perform bit operation to see if pulse is 1 at a certain bx_time.
795  if (((pulse[this_layer][this_wire] >> bx_time) & 1) == 1) {
796  // Store number of layers hit.
797  if (hit_layer[this_layer] == false){
798  hit_layer[this_layer] = true;
799  layers_hit++;
800  }
801 
802  // See if number of layers hit is greater than or equal to
803  // pretrig_thresh.
804  if (layers_hit >= pretrig_thresh[i_pattern]) {
805  first_bx[key_wire] = bx_time;
806  if (infoV > 1) {
807  LogTrace("CSCAnodeLCTProcessor")
808  << "Pretrigger was satisfied for wire: " << key_wire
809  << " pattern: " << i_pattern
810  << " bx_time: " << bx_time;
811  }
812  return true;
813  }
814  }
815  }
816  }
817  }
818  }
819  }
820  // If the pretrigger was never satisfied, then return false.
821  return false;
822 }
static const int pattern_envelope[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
#define LogTrace(id)
int first_bx[CSCConstants::MAX_NUM_WIRES]
unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
unsigned int nplanes_hit_accel_pretrig
bool CSCAnodeLCTProcessor::pulseExtension ( const std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
private

Definition at line 691 of file CSCAnodeLCTProcessor.cc.

References dumpDigis(), relativeConstraints::empty, first_bx, first_bx_corrected, hit_persist, mps_fire::i, infoV, LogTrace, CSCConstants::NUM_LAYERS, numWireGroups, pulse, quality, and mixOne_premix_on_sim_cfi::wire.

Referenced by run().

691  {
692  /* A pulse array will be used as a bit representation of hit times.
693  For example: if a keywire has a bx_time of 3, then 1 shifted
694  left 3 will be bit pattern 0000000000001000. Bits are then added to
695  signify the duration of a signal (hit_persist, formerly bx_width). So
696  for the pulse with a hit_persist of 6 will look like 0000000111111000. */
697 
698  bool chamber_empty = true;
699  int i_wire, i_layer, digi_num;
700  const unsigned int bits_in_pulse = 8*sizeof(pulse[0][0]);
701 
702  for (i_wire = 0; i_wire < numWireGroups; i_wire++) {
703  for (i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
704  pulse[i_layer][i_wire] = 0;
705  }
706  first_bx[i_wire] = -999;
707  first_bx_corrected[i_wire] = -999;
708  for (int j = 0; j < 3; j++) quality[i_wire][j] = -999;
709  }
710 
711  for (i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++){
712  digi_num = 0;
713  for (i_wire = 0; i_wire < numWireGroups; i_wire++) {
714  if (!wire[i_layer][i_wire].empty()) {
715  std::vector<int> bx_times = wire[i_layer][i_wire];
716  for (unsigned int i = 0; i < bx_times.size(); i++) {
717  // Check that min and max times are within the allowed range.
718  if (bx_times[i] < 0 || bx_times[i] + hit_persist >= bits_in_pulse) {
719  if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeDigi")
720  << "+++ BX time of wire digi (wire = " << i_wire
721  << " layer = " << i_layer << ") bx = " << bx_times[i]
722  << " is not within the range (0-" << bits_in_pulse
723  << "] allowed for pulse extension. Skip this digi! +++\n";
724  continue;
725  }
726 
727  // Found at least one in-time digi; set chamber_empty to false
728  if (chamber_empty) chamber_empty = false;
729 
730  // make the pulse
731  for (unsigned int bx = bx_times[i];
732  bx < (bx_times[i] + hit_persist); bx++)
733  pulse[i_layer][i_wire] = pulse[i_layer][i_wire] | (1 << bx);
734 
735  // Debug information.
736  if (infoV > 1) {
737  LogTrace("CSCAnodeLCTProcessor")
738  << "Wire digi: layer " << i_layer
739  << " digi #" << ++digi_num << " wire group " << i_wire
740  << " time " << bx_times[i];
741  if (infoV > 2) {
742  std::ostringstream strstrm;
743  for (int i = 1; i <= 32; i++) {
744  strstrm << ((pulse[i_layer][i_wire]>>(32-i)) & 1);
745  }
746  LogTrace("CSCAnodeLCTProcessor") << " Pulse: " << strstrm.str();
747  }
748  }
749  }
750  }
751  }
752  }
753 
754  if (infoV > 1 && !chamber_empty) {
755  dumpDigis(wire);
756  }
757 
758  return chamber_empty;
759 }
int quality[CSCConstants::MAX_NUM_WIRES][3]
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
#define LogTrace(id)
int first_bx[CSCConstants::MAX_NUM_WIRES]
void dumpDigis(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const
unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
std::vector< CSCALCTDigi > CSCAnodeLCTProcessor::readoutALCTs ( )

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

Definition at line 1552 of file CSCAnodeLCTProcessor.cc.

References early_tbins, fifo_pretrig, getALCTs(), infoV, l1a_window_width, CSCConstants::LCT_CENTRAL_BX, LogDebug, CSCConstants::MAX_ALCT_TBINS, and AlCaHLTBitMon_ParallelJobs::p.

1552  {
1553  std::vector<CSCALCTDigi> tmpV;
1554 
1555  // The number of LCT bins in the read-out is given by the
1556  // l1a_window_width parameter, but made even by setting the LSB of
1557  // l1a_window_width to 0.
1558  const int lct_bins =
1559  // (l1a_window_width%2 == 0) ? l1a_window_width : l1a_window_width-1;
1561  static std::atomic<int> late_tbins{early_tbins + lct_bins};
1562 
1563  static std::atomic<int> ifois{0};
1564  if (ifois == 0) {
1565 
1566  //std::cout<<"ALCT early_tbins="<<early_tbins<<" lct_bins="<<lct_bins<<" l1a_window_width="<<l1a_window_width<<" late_tbins="<<late_tbins<<std::endl;
1567  //std::cout<<"**** ALCT readoutALCTs config dump ****"<<std::endl;
1568  //dumpConfigParams();
1569 
1570  if (infoV >= 0 && early_tbins < 0) {
1571  edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
1572  << "+++ fifo_pretrig = " << fifo_pretrig
1573  << "; in-time ALCTs are not getting read-out!!! +++" << "\n";
1574  }
1575 
1576  if (late_tbins > CSCConstants::MAX_ALCT_TBINS-1) {
1577  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
1578  << "+++ Allowed range of time bins, [0-" << late_tbins
1579  << "] exceeds max allowed, " << CSCConstants::MAX_ALCT_TBINS-1 << " +++\n"
1580  << "+++ Set late_tbins to max allowed +++\n";
1581  late_tbins = CSCConstants::MAX_ALCT_TBINS-1;
1582  }
1583  ifois = 1;
1584  }
1585 
1586  // Start from the vector of all found ALCTs and select those within
1587  // the ALCT*L1A coincidence window.
1588  std::vector<CSCALCTDigi> all_alcts = getALCTs();
1589  for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1590  plct != all_alcts.end(); plct++) {
1591  if (!plct->isValid()) continue;
1592 
1593  int bx = (*plct).getBX();
1594  // Skip ALCTs found too early relative to L1Accept.
1595  if (bx <= early_tbins) {
1596  if (infoV > 1) LogDebug("CSCAnodeLCTProcessor")
1597  << " Do not report ALCT on keywire " << plct->getKeyWG()
1598  << ": found at bx " << bx << ", whereas the earliest allowed bx is "
1599  << early_tbins+1;
1600  continue;
1601  }
1602 
1603  // Skip ALCTs found too late relative to L1Accept.
1604  if (bx > late_tbins) {
1605  if (infoV > 1) LogDebug("CSCAnodeLCTProcessor")
1606  << " Do not report ALCT on keywire " << plct->getKeyWG()
1607  << ": found at bx " << bx << ", whereas the latest allowed bx is "
1608  << late_tbins;
1609  continue;
1610  }
1611 
1612  tmpV.push_back(*plct);
1613  }
1614 
1615  // shift the BX from 8 to 3
1616  // ALCTs in real data have the central BX in bin 3
1617  // which is the middle of the 7BX wide L1A window
1618  // ALCTs used in the TMB emulator have central BX at bin 8
1619  // but right before we put emulated ALCTs in the event, we shift the BX
1620  // by -5 to make sure they are compatible with real data ALCTs!
1621  for (auto& p : tmpV){
1622  p.setBX(p.getBX() - (CSCConstants::LCT_CENTRAL_BX - l1a_window_width/2));
1623  }
1624  return tmpV;
1625 }
#define LogDebug(id)
std::vector< CSCALCTDigi > getALCTs()
void CSCAnodeLCTProcessor::readWireDigis ( std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
private

ALCT algorithm methods.

Definition at line 632 of file CSCAnodeLCTProcessor.cc.

References begin, digiV, fifo_tbins, mps_fire::i, infoV, LogTrace, CSCConstants::NUM_LAYERS, numWireGroups, and mixOne_premix_on_sim_cfi::wire.

Referenced by run().

632  {
633  /* Gets wire times from the wire digis and fills wire[][] vector */
634 
635  // Loop over all 6 layers.
636  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
637  // Loop over all digis in the layer and find the wireGroup and bx
638  // time for each.
639  for (std::vector<CSCWireDigi>::iterator pld = digiV[i_layer].begin();
640  pld != digiV[i_layer].end(); pld++) {
641  int i_wire = pld->getWireGroup()-1;
642  std::vector<int> bx_times = pld->getTimeBinsOn();
643 
644  // Check that the wires and times are appropriate.
645  if (i_wire < 0 || i_wire >= numWireGroups) {
646  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongInput")
647  << "+++ Found wire digi with wrong wire number = " << i_wire
648  << " (max wires = " << numWireGroups << "); skipping it... +++\n";
649  continue;
650  }
651  // Accept digis in expected time window. Total number of time
652  // bins in DAQ readout is given by fifo_tbins, which thus
653  // determines the maximum length of time interval. Anode raw
654  // hits in DAQ readout start (fifo_pretrig - 6) clocks before
655  // L1Accept. If times earlier than L1Accept were recorded, we
656  // use them since they can modify the ALCTs found later, via
657  // ghost-cancellation logic.
658  int last_time = -999;
659  if (bx_times.size() == fifo_tbins) {
660  wire[i_layer][i_wire].push_back(0);
661  wire[i_layer][i_wire].push_back(6);
662  }
663  else {
664  for (unsigned int i = 0; i < bx_times.size(); i++) {
665  // Find rising edge change
666  if (i > 0 && bx_times[i] == (bx_times[i-1]+1)) continue;
667  if (bx_times[i] < static_cast<int>(fifo_tbins)) {
668  if (infoV > 2) LogTrace("CSCAnodeLCTProcessor")
669  << "Digi on layer " << i_layer << " wire " << i_wire
670  << " at time " << bx_times[i];
671 
672  // Finally save times of hit wires. One shot module will
673  // not restart if a new pulse comes before the expiration
674  // of the 6-bx period.
675  if (last_time < 0 || ((bx_times[i]-last_time) >= 6) ) {
676  wire[i_layer][i_wire].push_back(bx_times[i]);
677  last_time = bx_times[i];
678  }
679  }
680  else {
681  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
682  << "+++ Skipping wire digi: wire = " << i_wire
683  << " layer = " << i_layer << ", bx = " << bx_times[i] << " +++";
684  }
685  }
686  }
687  }
688  }
689 }
#define LogTrace(id)
#define begin
Definition: vmac.h:32
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
std::vector< CSCALCTDigi > CSCAnodeLCTProcessor::run ( const CSCWireDigiCollection wiredc)

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

Definition at line 450 of file CSCAnodeLCTProcessor.cc.

References relativeConstraints::chamber, CSCGeometry::chamber(), CSCTriggerNumbering::chamberFromTriggerLabels(), CSCDetId::chamberName(), csc_g, dumpConfigParams(), relativeConstraints::empty, getALCTs(), getDigis(), infoV, isSLHC, CSCConstants::MAX_NUM_WIRES, nplanes_hit_accel_pattern, nplanes_hit_pattern, CSCConstants::NUM_LAYERS, numWireGroups, readWireDigis(), relativeConstraints::ring, CSCTriggerNumbering::ringFromTriggerLabels(), theChamber, theEndcap, theRing, theSector, theStation, theSubsector, theTrigChamber, and mixOne_premix_on_sim_cfi::wire.

Referenced by setCSCGeometry().

450  {
451  // This is the main routine for normal running. It gets wire times
452  // from the wire digis and then passes them on to another run() function.
453 
454  static std::atomic<bool> config_dumped{false};
455  if ((infoV > 0 || isSLHC) && !config_dumped) {
456  //std::cout<<"**** ALCT run parameters dump ****"<<std::endl;
458  config_dumped = true;
459  }
460 
461 
462  // Get the number of wire groups for the given chamber. Do it only once
463  // per chamber.
464  if (numWireGroups == 0) {
467  CSCDetId detid(theEndcap, theStation, ring, chid, 0);
468  const auto& chamber = csc_g->chamber(detid);
469  if (chamber) {
470  numWireGroups = chamber->layer(1)->geometry()->numberOfWireGroups();
472  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
473  << "+++ Number of wire groups, " << numWireGroups
474  << " found in " << detid.chamberName()
475  << " (sector " << theSector << " subsector " << theSubsector
476  << " trig id. " << theTrigChamber << ")"
477  << " exceeds max expected, " << CSCConstants::MAX_NUM_WIRES
478  << " +++\n"
479  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
480  numWireGroups = -1;
481  }
482  }
483  else {
484  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
485  << "+++ " << detid.chamberName()
486  << " (sector " << theSector << " subsector " << theSubsector
487  << " trig id. " << theTrigChamber << ")"
488  << " is not defined in current geometry! +++\n"
489  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
490  numWireGroups = -1;
491  }
492  }
493 
494  if (numWireGroups < 0) {
495  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
497  << " (sector " << theSector << " subsector " << theSubsector
498  << " trig id. " << theTrigChamber << "):"
499  << " numWireGroups = " << numWireGroups
500  << "; ALCT emulation skipped! +++";
501  std::vector<CSCALCTDigi> emptyV;
502  return emptyV;
503  }
504 
505  // Get wire digis in this chamber from wire digi collection.
506  bool noDigis = getDigis(wiredc);
507 
508  if (!noDigis) {
509  // First get wire times from the wire digis.
510  std::vector<int>
512  readWireDigis(wire);
513 
514  // Pass an array of wire times on to another run() doing the LCT search.
515  // If the number of layers containing digis is smaller than that
516  // required to trigger, quit right away.
517  const unsigned int min_layers =
523  );
524 
525  unsigned int layersHit = 0;
526  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
527  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
528  if (!wire[i_layer][i_wire].empty()) {layersHit++; break;}
529  }
530  }
531  if (layersHit >= min_layers) run(wire);
532  }
533 
534  // Return vector of all found ALCTs.
535  std::vector<CSCALCTDigi> tmpV = getALCTs();
536  return tmpV;
537 }
void readWireDigis(std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
bool getDigis(const CSCWireDigiCollection *wiredc)
static int ringFromTriggerLabels(int station, int triggerCSCID)
std::string chamberName() const
Definition: CSCDetId.cc:71
const CSCGeometry * csc_g
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:133
unsigned int nplanes_hit_accel_pattern
std::vector< CSCALCTDigi > run(const CSCWireDigiCollection *wiredc)
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
std::vector< CSCALCTDigi > getALCTs()
void CSCAnodeLCTProcessor::run ( const std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])

Runs the LCT processor code. Called in normal running or in testing mode.

Definition at line 539 of file CSCAnodeLCTProcessor.cc.

References drift_delay, fifo_tbins, first_bx, ghostCancellationLogic(), ghostCancellationLogicSLHC(), infoV, isSLHC, lctSearch(), numWireGroups, patternDetection(), pretrig_extra_deadtime, preTrigger(), pulseExtension(), showPatterns(), and mixOne_premix_on_sim_cfi::wire.

539  {
540  // This version of the run() function can either be called in a standalone
541  // test, being passed the time array, or called by the run() function above.
542  // It gets wire times from an input array and then loops over the keywires.
543  // All found LCT candidates are sorted and the best two are retained.
544 
545  bool trigger = false;
546 
547  // Check if there are any in-time hits and do the pulse extension.
548  bool chamber_empty = pulseExtension(wire);
549 
550  // Only do the rest of the processing if chamber is not empty.
551  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
552  // not have a full set of hits to start pattern search anyway.
553  unsigned int stop_bx = fifo_tbins - drift_delay;
554  if (!chamber_empty) {
555  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
556  unsigned int start_bx = 0;
557  // Allow for more than one pass over the hits in the time window.
558  while (start_bx < stop_bx) {
559  if (preTrigger(i_wire, start_bx)) {
560  if (infoV > 2) showPatterns(i_wire);
561  if (patternDetection(i_wire)) {
562  trigger = true;
563  break;
564  }
565  else {
566  // Assume that the earliest time when another pre-trigger can
567  // occur in case pattern detection failed is bx_pretrigger+4:
568  // this seems to match the data.
569  start_bx = first_bx[i_wire] + drift_delay + pretrig_extra_deadtime;
570  }
571  }
572  else {
573  break;
574  }
575  }
576  }
577  }
578 
579  // Do the rest only if there is at least one trigger candidate.
580  if (trigger) {
582  else ghostCancellationLogic();
583  lctSearch();
584  }
585 }
void showPatterns(const int key_wire)
bool preTrigger(const int key_wire, const int start_bx)
bool pulseExtension(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
int first_bx[CSCConstants::MAX_NUM_WIRES]
bool patternDetection(const int key_wire)
unsigned int pretrig_extra_deadtime
void CSCAnodeLCTProcessor::setConfigParameters ( const CSCDBL1TPParameters conf)

Sets configuration parameters obtained via EventSetup mechanism.

Definition at line 309 of file CSCAnodeLCTProcessor.cc.

References accel_mode, CSCDBL1TPParameters::alctAccelMode(), CSCDBL1TPParameters::alctDriftDelay(), CSCDBL1TPParameters::alctFifoPretrig(), CSCDBL1TPParameters::alctFifoTbins(), CSCDBL1TPParameters::alctL1aWindowWidth(), CSCDBL1TPParameters::alctNplanesHitAccelPattern(), CSCDBL1TPParameters::alctNplanesHitAccelPretrig(), CSCDBL1TPParameters::alctNplanesHitPattern(), CSCDBL1TPParameters::alctNplanesHitPretrig(), CSCDBL1TPParameters::alctTrigMode(), checkConfigParameters(), drift_delay, dumpConfigParams(), fifo_pretrig, fifo_tbins, l1a_window_width, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, and trig_mode.

310 {
311  static std::atomic<bool> config_dumped{false};
312 
313  fifo_tbins = conf->alctFifoTbins();
314  fifo_pretrig = conf->alctFifoPretrig();
315  drift_delay = conf->alctDriftDelay();
320  trig_mode = conf->alctTrigMode();
321  accel_mode = conf->alctAccelMode();
323 
324  // Check and print configuration parameters.
326  if (!config_dumped) {
327  //std::cout<<"**** ALCT setConfigParam parameters dump ****"<<std::endl;
329  config_dumped = true;
330  }
331 }
unsigned int alctDriftDelay() const
unsigned int alctNplanesHitPretrig() const
unsigned int alctL1aWindowWidth() const
unsigned int alctTrigMode() const
unsigned int alctAccelMode() const
unsigned int alctFifoPretrig() const
unsigned int alctNplanesHitAccelPretrig() const
unsigned int alctNplanesHitAccelPattern() const
unsigned int alctNplanesHitPattern() const
unsigned int nplanes_hit_accel_pattern
unsigned int nplanes_hit_accel_pretrig
unsigned int alctFifoTbins() const
void CSCAnodeLCTProcessor::setCSCGeometry ( const CSCGeometry g)
inline

Definition at line 52 of file CSCAnodeLCTProcessor.h.

References csc_g, g, getDigis(), CSCConstants::MAX_NUM_WIRES, CSCConstants::NUM_LAYERS, run(), and mixOne_premix_on_sim_cfi::wire.

52 { csc_g = g; }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
const CSCGeometry * csc_g
void CSCAnodeLCTProcessor::setDefaultConfigParameters ( )
private

Set default values for configuration parameters.

Definition at line 293 of file CSCAnodeLCTProcessor.cc.

References accel_mode, def_accel_mode, def_drift_delay, def_fifo_pretrig, def_fifo_tbins, def_l1a_window_width, def_nplanes_hit_accel_pattern, def_nplanes_hit_accel_pretrig, def_nplanes_hit_pattern, def_nplanes_hit_pretrig, def_trig_mode, drift_delay, fifo_pretrig, fifo_tbins, l1a_window_width, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, and trig_mode.

Referenced by CSCAnodeLCTProcessor().

294 {
295  // Set default values for configuration parameters.
306 }
static const unsigned int def_drift_delay
static const unsigned int def_fifo_tbins
static const unsigned int def_accel_mode
static const unsigned int def_nplanes_hit_accel_pretrig
static const unsigned int def_fifo_pretrig
static const unsigned int def_nplanes_hit_pattern
static const unsigned int def_l1a_window_width
static const unsigned int def_trig_mode
static const unsigned int def_nplanes_hit_accel_pattern
unsigned int nplanes_hit_accel_pattern
static const unsigned int def_nplanes_hit_pretrig
unsigned int nplanes_hit_accel_pretrig
void CSCAnodeLCTProcessor::setRing ( unsigned  r)
inline

set ring number. Important only for ME1a

Definition at line 83 of file CSCAnodeLCTProcessor.h.

References alignCSCRings::r, and theRing.

void CSCAnodeLCTProcessor::showPatterns ( const int  key_wire)
private

Definition at line 1640 of file CSCAnodeLCTProcessor.cc.

References mps_fire::i, LogTrace, CSCConstants::MAX_WIRES_IN_PATTERN, MESelection, CSCConstants::NUM_ALCT_PATTERNS, numWireGroups, pattern_envelope, and pattern_mask.

Referenced by run().

1640  {
1641  /* Method to test the pretrigger */
1642  for (int i_pattern = 0; i_pattern < CSCConstants::NUM_ALCT_PATTERNS;
1643  i_pattern++) {
1644  std::ostringstream strstrm_header;
1645  LogTrace("CSCAnodeLCTProcessor")
1646  << "\n" << "Pattern: " << i_pattern << " Key wire: " << key_wire;
1647  for (int i = 1; i <= 32; i++) {
1648  strstrm_header << ((32-i)%10);
1649  }
1650  LogTrace("CSCAnodeLCTProcessor") << strstrm_header.str();
1651  for (int i_wire = 0; i_wire < CSCConstants::MAX_WIRES_IN_PATTERN; i_wire++) {
1652  if (pattern_mask[i_pattern][i_wire] != 0) {
1653  std::ostringstream strstrm_pulse;
1654  int this_layer = pattern_envelope[0][i_wire];
1655  int this_wire = pattern_envelope[1+MESelection][i_wire]+key_wire;
1656  if (this_wire >= 0 && this_wire < numWireGroups) {
1657  for (int i = 1; i <= 32; i++) {
1658  strstrm_pulse << ((pulse[this_layer][this_wire]>>(32-i)) & 1);
1659  }
1660  LogTrace("CSCAnodeLCTProcessor")
1661  << strstrm_pulse.str() << " on layer " << this_layer;
1662  }
1663  }
1664  }
1665  LogTrace("CSCAnodeLCTProcessor")
1666  << "-------------------------------------------";
1667  }
1668 }
static const int pattern_envelope[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
#define LogTrace(id)
void CSCAnodeLCTProcessor::trigMode ( const int  key_wire)
private

Definition at line 1405 of file CSCAnodeLCTProcessor.cc.

References infoV, LogTrace, quality, and trig_mode.

Referenced by lctSearch().

1405  {
1406  /* Function which enables/disables either collision or accelerator tracks.
1407  The function uses the trig_mode parameter to decide. */
1408 
1409  switch(trig_mode) {
1410  default:
1411  case 0:
1412  // Enables both collision and accelerator tracks
1413  break;
1414  case 1:
1415  // Disables collision tracks
1416  if (quality[key_wire][1] > 0) {
1417  quality[key_wire][1] = 0;
1418  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1419  << "trigMode(): collision track " << key_wire << " disabled" << "\n";
1420  }
1421  break;
1422  case 2:
1423  // Disables accelerator tracks
1424  if (quality[key_wire][0] > 0) {
1425  quality[key_wire][0] = 0;
1426  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1427  << "trigMode(): accelerator track " << key_wire << " disabled" << "\n";
1428  }
1429  break;
1430  case 3:
1431  // Disables collision track if there is an accelerator track found
1432  // in the same wire group at the same time
1433  if (quality[key_wire][0] > 0 && quality[key_wire][1] > 0) {
1434  quality[key_wire][1] = 0;
1435  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1436  << "trigMode(): collision track " << key_wire << " disabled" << "\n";
1437  }
1438  break;
1439  }
1440 }
int quality[CSCConstants::MAX_NUM_WIRES][3]
#define LogTrace(id)

Member Data Documentation

unsigned int CSCAnodeLCTProcessor::accel_mode
private
CSCALCTDigi CSCAnodeLCTProcessor::bestALCT[CSCConstants::MAX_ALCT_TBINS]

Best LCTs in this chamber, as found by the processor. In old ALCT algorithms, up to two best ALCT per Level-1 accept window had been reported. In the ALCT-2006 algorithms, up to two best ALCTs PER EVERY TIME BIN in Level-1 accept window are reported.

Definition at line 71 of file CSCAnodeLCTProcessor.h.

Referenced by clear(), getALCTs(), and lctSearch().

const CSCGeometry* CSCAnodeLCTProcessor::csc_g
private

Definition at line 105 of file CSCAnodeLCTProcessor.h.

Referenced by run(), and setCSCGeometry().

const unsigned int CSCAnodeLCTProcessor::def_accel_mode = 0
staticprivate

Definition at line 169 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_drift_delay = 2
staticprivate

Definition at line 165 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_fifo_pretrig = 10
staticprivate

Definition at line 164 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_fifo_tbins = 16
staticprivate

Default values of configuration parameters.

Definition at line 164 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_l1a_window_width = 7
staticprivate

Definition at line 170 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_accel_pattern = 4
staticprivate

Definition at line 168 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_accel_pretrig = 2
staticprivate

Definition at line 167 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_pattern = 4
staticprivate

Definition at line 166 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_pretrig = 2
staticprivate

Definition at line 166 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_trig_mode = 2
staticprivate

Definition at line 169 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

std::vector<CSCWireDigi> CSCAnodeLCTProcessor::digiV[CSCConstants::NUM_LAYERS]
private

Definition at line 120 of file CSCAnodeLCTProcessor.h.

Referenced by getDigis(), and readWireDigis().

bool CSCAnodeLCTProcessor::disableME1a
private

SLHC: special configuration parameters for ME1a treatment

Definition at line 136 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and getDigis().

unsigned int CSCAnodeLCTProcessor::drift_delay
private
int CSCAnodeLCTProcessor::early_tbins
private

SLHC: separate handle for early time bins

Definition at line 139 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and readoutALCTs().

unsigned int CSCAnodeLCTProcessor::fifo_pretrig
private
unsigned int CSCAnodeLCTProcessor::fifo_tbins
private
int CSCAnodeLCTProcessor::first_bx[CSCConstants::MAX_NUM_WIRES]
private
int CSCAnodeLCTProcessor::first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
private
int CSCAnodeLCTProcessor::ghost_cancellation_bx_depth
private

SLHC: delta BX time depth for ghostCancellationLogic

Definition at line 142 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), ghostCancellationLogic(), and ghostCancellationLogicSLHC().

bool CSCAnodeLCTProcessor::ghost_cancellation_side_quality
private

SLHC: whether to consider ALCT candidates' qualities while doing ghostCancellationLogic on +-1 wire groups

Definition at line 146 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), ghostCancellationLogic(), and ghostCancellationLogicSLHC().

unsigned int CSCAnodeLCTProcessor::hit_persist
private

SLHC: hit persistency length

Definition at line 133 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), patternDetection(), and pulseExtension().

int CSCAnodeLCTProcessor::infoV
private

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

Definition at line 96 of file CSCAnodeLCTProcessor.h.

Referenced by accelMode(), bestTrackSelector(), checkConfigParameters(), CSCAnodeLCTProcessor(), getDigis(), ghostCancellationLogic(), ghostCancellationLogicSLHC(), lctSearch(), patternDetection(), preTrigger(), pulseExtension(), readoutALCTs(), readWireDigis(), run(), and trigMode().

bool CSCAnodeLCTProcessor::isME11
private

Definition at line 112 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and getDigis().

bool CSCAnodeLCTProcessor::isSLHC
private

Flag for SLHC studies.

Definition at line 124 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and run().

unsigned int CSCAnodeLCTProcessor::l1a_window_width
private
int CSCAnodeLCTProcessor::MESelection
private
bool CSCAnodeLCTProcessor::narrow_mask_r1
private

SLHC: whether to use narrow pattern mask for the rings close to the beam

Definition at line 155 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and loadPatternMask().

unsigned int CSCAnodeLCTProcessor::nplanes_hit_accel_pattern
private
unsigned int CSCAnodeLCTProcessor::nplanes_hit_accel_pretrig
private
unsigned int CSCAnodeLCTProcessor::nplanes_hit_pattern
private
unsigned int CSCAnodeLCTProcessor::nplanes_hit_pretrig
private
int CSCAnodeLCTProcessor::numWireGroups
private
const int CSCAnodeLCTProcessor::pattern_envelope
static
Initial value:
= {
{ 0, 0, 0,
1, 1,
2,
3, 3,
4, 4, 4,
5, 5, 5},
{-2, -1, 0,
-1, 0,
0,
0, 1,
0, 1, 2,
0, 1, 2},
{2, 1, 0,
1, 0,
0,
0, -1,
0, -1, -2,
0, -1, -2}
}

Pre-defined patterns.

Definition at line 86 of file CSCAnodeLCTProcessor.h.

Referenced by patternDetection(), preTrigger(), and showPatterns().

int CSCAnodeLCTProcessor::pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
private

Chosen pattern mask.

Definition at line 173 of file CSCAnodeLCTProcessor.h.

Referenced by loadPatternMask(), patternDetection(), preTrigger(), and showPatterns().

const int CSCAnodeLCTProcessor::pattern_mask_open
static
Initial value:
= {
{0, 0, 1,
0, 1,
1,
1, 0,
1, 0, 0,
1, 0, 0},
{1, 1, 1,
1, 1,
1,
1, 1,
1, 1, 1,
1, 1, 1},
{1, 1, 1,
1, 1,
1,
1, 1,
1, 1, 1,
1, 1, 1}
}

Definition at line 87 of file CSCAnodeLCTProcessor.h.

Referenced by loadPatternMask().

const int CSCAnodeLCTProcessor::pattern_mask_r1
static
Initial value:
= {
{0, 0, 1,
0, 1,
1,
1, 0,
1, 0, 0,
1, 0, 0},
{0, 1, 1,
1, 1,
1,
1, 0,
1, 1, 0,
1, 1, 0},
{0, 1, 1,
1, 1,
1,
1, 0,
1, 1, 0,
1, 1, 0}
}

Definition at line 88 of file CSCAnodeLCTProcessor.h.

Referenced by loadPatternMask().

unsigned int CSCAnodeLCTProcessor::pretrig_extra_deadtime
private

SLHC: deadtime clocks after pretrigger (extra in addition to drift_delay)

Definition at line 149 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and run().

unsigned int CSCAnodeLCTProcessor::pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
private

Definition at line 121 of file CSCAnodeLCTProcessor.h.

Referenced by patternDetection(), preTrigger(), and pulseExtension().

int CSCAnodeLCTProcessor::quality[CSCConstants::MAX_NUM_WIRES][3]
private
bool CSCAnodeLCTProcessor::runME21ILT_
private

SLHC: run the ALCT processor for the Phase-II ME2/1 integrated local trigger

Definition at line 158 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), ghostCancellationLogicSLHC(), and patternDetection().

bool CSCAnodeLCTProcessor::runME3141ILT_
private

SLHC: run the ALCT processor for the Phase-II ME3/1(ME4/1) integrated local trigger

Definition at line 161 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), ghostCancellationLogicSLHC(), and patternDetection().

CSCALCTDigi CSCAnodeLCTProcessor::secondALCT[CSCConstants::MAX_ALCT_TBINS]

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

Definition at line 74 of file CSCAnodeLCTProcessor.h.

Referenced by clear(), getALCTs(), and lctSearch().

unsigned CSCAnodeLCTProcessor::theChamber
private

Definition at line 110 of file CSCAnodeLCTProcessor.h.

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

const unsigned CSCAnodeLCTProcessor::theEndcap
private

Chamber id (trigger-type labels).

Definition at line 99 of file CSCAnodeLCTProcessor.h.

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

unsigned CSCAnodeLCTProcessor::theRing
private

ring number. Only matters for ME1a

Definition at line 108 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), dumpDigis(), getDigis(), lctSearch(), loadPatternMask(), run(), and setRing().

const unsigned CSCAnodeLCTProcessor::theSector
private

Definition at line 101 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), getDigis(), lctSearch(), and run().

const unsigned CSCAnodeLCTProcessor::theStation
private

Definition at line 100 of file CSCAnodeLCTProcessor.h.

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

const unsigned CSCAnodeLCTProcessor::theSubsector
private

Definition at line 102 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), getDigis(), lctSearch(), and run().

const unsigned CSCAnodeLCTProcessor::theTrigChamber
private

Definition at line 103 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), getDigis(), lctSearch(), and run().

const int CSCAnodeLCTProcessor::time_weights
static
Initial value:
=
{ 0, 1, 1,
1, 2,
2,
2, 1,
2, 1, 0,
1, 1, 0}

Definition at line 89 of file CSCAnodeLCTProcessor.h.

unsigned int CSCAnodeLCTProcessor::trig_mode
private
bool CSCAnodeLCTProcessor::use_corrected_bx
private

SLHC: whether to use corrected_bx instead of pretrigger BX

Definition at line 152 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), ghostCancellationLogicSLHC(), and lctSearch().