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)
 

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]
 

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 142 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.

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

233  :
234  theEndcap(1), theStation(1), theSector(1),
236  // Used for debugging. -JM
237  static std::atomic<bool> config_dumped{false};
238 
239  // ALCT parameters.
241  infoV = 2;
242 
243  isSLHC_ = false;
244  disableME1a = false;
245 
246  early_tbins = 4;
247 
248  // Check and print configuration parameters.
250  if (!config_dumped) {
251  //std::cout<<"**** ALCT default constructor parameters dump ****"<<std::endl;
253  config_dumped = true;
254  }
255 
257  MESelection = (theStation < 3) ? 0 : 1;
258 
262  isME11 = (theStation == 1 && theRing == 1);
263 
264  // Load pattern mask.
265  loadPatternMask();
266 }
const unsigned theTrigChamber
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 1431 of file CSCAnodeLCTProcessor.cc.

References accel_mode, infoV, LogTrace, and quality.

Referenced by lctSearch().

1431  {
1432  /* Function which gives a preference either to the collision patterns
1433  or accelerator patterns. The function uses the accel_mode parameter
1434  to decide. */
1435  int promotionBit = 1 << 2;
1436 
1437  switch(accel_mode) {
1438  default:
1439  case 0:
1440  // Ignore accelerator muons.
1441  if (quality[key_wire][0] > 0) {
1442  quality[key_wire][0] = 0;
1443  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1444  << "alctMode(): accelerator track " << key_wire << " ignored" << "\n";
1445  }
1446  break;
1447  case 1:
1448  // Prefer collision muons by adding promotion bit.
1449  if (quality[key_wire][1] > 0) {
1450  quality[key_wire][1] += promotionBit;
1451  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1452  << "alctMode(): collision track " << key_wire << " promoted" << "\n";
1453  }
1454  break;
1455  case 2:
1456  // Prefer accelerator muons by adding promotion bit.
1457  if (quality[key_wire][0] > 0) {
1458  quality[key_wire][0] += promotionBit;
1459  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1460  << "alctMode(): accelerator track " << key_wire << " promoted"<< "\n";
1461  }
1462  break;
1463  case 3:
1464  // Ignore collision muons.
1465  if (quality[key_wire][1] > 0) {
1466  quality[key_wire][1] = 0;
1467  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1468  << "alctMode(): collision track " << key_wire << " ignored" << "\n";
1469  }
1470  break;
1471  }
1472 }
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 1261 of file CSCAnodeLCTProcessor.cc.

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

Referenced by lctSearch().

1262  {
1263  /* Selects two collision and two accelerator ALCTs per time bin with
1264  the best quality. */
1266 
1267  if (infoV > 1) {
1268  LogTrace("CSCAnodeLCTProcessor") << all_alcts.size() <<
1269  " ALCTs at the input of best-track selector: ";
1270  for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1271  plct != all_alcts.end(); plct++) {
1272  if (!plct->isValid()) continue;
1273  LogTrace("CSCAnodeLCTProcessor") << (*plct);
1274  }
1275  }
1276 
1278  for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1279  plct != all_alcts.end(); plct++) {
1280  if (!plct->isValid()) continue;
1281 
1282  // Select two collision and two accelerator ALCTs with the highest
1283  // quality at every bx. The search for best ALCTs is done in parallel
1284  // for collision and accelerator patterns, and simultaneously for
1285  // two ALCTs, tA and tB. If two or more ALCTs have equal qualities,
1286  // the priority is given to the ALCT with larger wiregroup number
1287  // in the search for tA (collision and accelerator), and to the ALCT
1288  // with smaller wiregroup number in the search for tB.
1289  int bx = (*plct).getBX();
1290  int accel = (*plct).getAccelerator();
1291  int qual = (*plct).getQuality();
1292  int wire = (*plct).getKeyWG();
1293  bool vA = tA[bx][accel].isValid();
1294  bool vB = tB[bx][accel].isValid();
1295  int qA = tA[bx][accel].getQuality();
1296  int qB = tB[bx][accel].getQuality();
1297  int wA = tA[bx][accel].getKeyWG();
1298  int wB = tB[bx][accel].getKeyWG();
1299  if (!vA || qual > qA || (qual == qA && wire > wA)) {
1300  tA[bx][accel] = *plct;
1301  }
1302  if (!vB || qual > qB || (qual == qB && wire < wB)) {
1303  tB[bx][accel] = *plct;
1304  }
1305  }
1306 
1307  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
1308  for (int accel = 0; accel <= 1; accel++) {
1309  // Best ALCT is always tA.
1310  if (tA[bx][accel].isValid()) {
1311  if (infoV > 2) {
1312  LogTrace("CSCAnodeLCTProcessor") << "tA: " << tA[bx][accel];
1313  LogTrace("CSCAnodeLCTProcessor") << "tB: " << tB[bx][accel];
1314  }
1315  bestALCTs[bx][accel] = tA[bx][accel];
1316 
1317  // If tA exists, tB exists too.
1318  if (tA[bx][accel] != tB[bx][accel] &&
1319  tA[bx][accel].getQuality() == tB[bx][accel].getQuality()) {
1320  secondALCTs[bx][accel] = tB[bx][accel];
1321  }
1322  else {
1323  // Funny part: if tA and tB are the same, or the quality of tB
1324  // is inferior to the quality of tA, the second best ALCT is
1325  // not tB. Instead it is the largest-wiregroup ALCT among those
1326  // ALCT whose qualities are lower than the quality of the best one.
1327  for (std::vector <CSCALCTDigi>::const_iterator plct =
1328  all_alcts.begin(); plct != all_alcts.end(); plct++) {
1329  if ((*plct).isValid() &&
1330  (*plct).getAccelerator() == accel && (*plct).getBX() == bx &&
1331  (*plct).getQuality() < bestALCTs[bx][accel].getQuality() &&
1332  (*plct).getQuality() >= secondALCTs[bx][accel].getQuality() &&
1333  (*plct).getKeyWG() >= secondALCTs[bx][accel].getKeyWG()) {
1334  secondALCTs[bx][accel] = *plct;
1335  }
1336  }
1337  }
1338  }
1339  }
1340  }
1341 
1342  // Fill the vector with up to four best ALCTs per bx and return it.
1343  std::vector<CSCALCTDigi> fourBest;
1344  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
1345  for (int i = 0; i < 2; i++) {
1346  if (bestALCTs[bx][i].isValid()) fourBest.push_back(bestALCTs[bx][i]);
1347  }
1348  for (int i = 0; i < 2; i++) {
1349  if (secondALCTs[bx][i].isValid()) fourBest.push_back(secondALCTs[bx][i]);
1350  }
1351  }
1352 
1353  if (infoV > 1) {
1354  LogTrace("CSCAnodeLCTProcessor") << fourBest.size() << " ALCTs selected: ";
1355  for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1356  plct != fourBest.end(); plct++) {
1357  LogTrace("CSCAnodeLCTProcessor") << (*plct);
1358  }
1359  }
1360 
1361  return fourBest;
1362 }
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 322 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().

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

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

Referenced by ghostCancellationLogic(), and ghostCancellationLogicSLHC().

422  {
423  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
424  bestALCT[bx].clear();
425  secondALCT[bx].clear();
426  }
427 }
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 429 of file CSCAnodeLCTProcessor.cc.

References quality.

429  {
430  /* Clear the data off of selected pattern */
431  if (pattern == 0) quality[wire][0] = -999;
432  else {
433  quality[wire][1] = -999;
434  quality[wire][2] = -999;
435  }
436 }
int quality[CSCConstants::MAX_NUM_WIRES][3]
void CSCAnodeLCTProcessor::dumpConfigParams ( ) const
private

Dump ALCT configuration parameters.

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

1475  {
1476  std::ostringstream strm;
1477  strm << "\n";
1478  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1479  strm << "+ ALCT configuration parameters: +\n";
1480  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1481  strm << " fifo_tbins [total number of time bins in DAQ readout] = "
1482  << fifo_tbins << "\n";
1483  strm << " fifo_pretrig [start time of anode raw hits in DAQ readout] = "
1484  << fifo_pretrig << "\n";
1485  strm << " drift_delay [drift delay after pre-trigger, in 25 ns bins] = "
1486  << drift_delay << "\n";
1487  strm << " nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = "
1488  << nplanes_hit_pretrig << "\n";
1489  strm << " nplanes_hit_pattern [min. number of layers hit for trigger] = "
1490  << nplanes_hit_pattern << "\n";
1491  strm << " nplanes_hit_accel_pretrig [min. number of layers hit for accel."
1492  << " pre-trig.] = " << nplanes_hit_accel_pretrig << "\n";
1493  strm << " nplanes_hit_accel_pattern [min. number of layers hit for accel."
1494  << " trigger] = " << nplanes_hit_accel_pattern << "\n";
1495  strm << " trig_mode [enabling/disabling collision/accelerator tracks] = "
1496  << trig_mode << "\n";
1497  strm << " accel_mode [preference to collision/accelerator tracks] = "
1498  << accel_mode << "\n";
1499  strm << " l1a_window_width [L1Accept window width, in 25 ns bins] = "
1500  << l1a_window_width << "\n";
1501  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1502  LogDebug("CSCAnodeLCTProcessor") << strm.str();
1503  //std::cout<<strm.str()<<std::endl;
1504 }
#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 1507 of file CSCAnodeLCTProcessor.cc.

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

Referenced by pulseExtension().

1507  {
1508  LogDebug("CSCAnodeLCTProcessor")
1510  << " nWiregroups " << numWireGroups;
1511 
1512  std::ostringstream strstrm;
1513  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1514  if (i_wire%10 == 0) {
1515  if (i_wire < 100) strstrm << i_wire/10;
1516  else strstrm << (i_wire-100)/10;
1517  }
1518  else strstrm << " ";
1519  }
1520  strstrm << "\n";
1521  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1522  strstrm << i_wire%10;
1523  }
1524  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
1525  strstrm << "\n";
1526  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1527  if (!wire[i_layer][i_wire].empty()) {
1528  std::vector<int> bx_times = wire[i_layer][i_wire];
1529  strstrm << std::hex << bx_times[0] << std::dec;
1530  }
1531  else {
1532  strstrm << ".";
1533  }
1534  }
1535  }
1536  LogTrace("CSCAnodeLCTProcessor") << strstrm.str();
1537 }
#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 1617 of file CSCAnodeLCTProcessor.cc.

References bestALCT, CSCConstants::MAX_ALCT_TBINS, and secondALCT.

Referenced by readoutALCTs(), and run().

1617  {
1618  std::vector<CSCALCTDigi> tmpV;
1619  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
1620  if (bestALCT[bx].isValid()) tmpV.push_back(bestALCT[bx]);
1621  if (secondALCT[bx].isValid()) tmpV.push_back(secondALCT[bx]);
1622  }
1623  return tmpV;
1624 }
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 576 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().

576  {
577  // Routine for getting digis and filling digiV vector.
578  bool noDigis = true;
579 
580  // Loop over layers and save wire digis on each one into digiV[layer].
581  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
582  digiV[i_layer].clear();
583 
584  CSCDetId detid(theEndcap, theStation, theRing, theChamber, i_layer+1);
585  getDigis(wiredc, detid);
586 
587  // If this is ME1/1, fetch digis in corresponding ME1/A (ring=4) as well.
588  if (isME11 && !disableME1a) {
589  CSCDetId detid_me1a(theEndcap, theStation, 4, theChamber, i_layer+1);
590  getDigis(wiredc, detid_me1a);
591  }
592 
593  if (!digiV[i_layer].empty()) {
594  noDigis = false;
595  if (infoV > 1) {
596  LogTrace("CSCAnodeLCTProcessor")
597  << "found " << digiV[i_layer].size()
598  << " wire digi(s) in layer " << i_layer << " of " << detid.chamberName()
599  << " (trig. sector " << theSector
600  << " subsector " << theSubsector << " id " << theTrigChamber << ")";
601  for (std::vector<CSCWireDigi>::iterator pld = digiV[i_layer].begin();
602  pld != digiV[i_layer].end(); pld++) {
603  LogTrace("CSCAnodeLCTProcessor") << " " << (*pld);
604  }
605  }
606  }
607  }
608 
609  return noDigis;
610 }
bool getDigis(const CSCWireDigiCollection *wiredc)
const unsigned theTrigChamber
#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 612 of file CSCAnodeLCTProcessor.cc.

References digiV.

613  {
614  const CSCWireDigiCollection::Range rwired = wiredc->get(id);
615  for (CSCWireDigiCollection::const_iterator digiIt = rwired.first;
616  digiIt != rwired.second; ++digiIt) {
617  digiV[id.layer()-1].push_back(*digiIt);
618  }
619 }
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 951 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().

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

1046  {
1047  /* This function looks for LCTs on the previous and next wires. If one
1048  exists and it has a better quality and a bx_time up to
1049  ghost_cancellation_bx_depth clocks earlier than the present,
1050  then the present LCT is cancelled. The present LCT
1051  also gets cancelled if it has the same quality as the one on the
1052  previous wire (this has not been done in 2003 test beam). The
1053  cancellation is done separately for collision and accelerator patterns. */
1054 
1055  int ghost_cleared[CSCConstants::MAX_NUM_WIRES][2];
1056 
1057  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
1058  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
1059  ghost_cleared[key_wire][i_pattern] = 0;
1060 
1061  // Non-empty wire group.
1062  int qual_this = quality[key_wire][i_pattern];
1063  if (qual_this > 0) {
1064 
1065  if (runME21ILT_ or runME3141ILT_) qual_this = (qual_this & 0x03);
1066  // Previous wire.
1067  int dt = -1;
1068  int qual_prev = (key_wire > 0) ? quality[key_wire-1][i_pattern] : 0;
1069  if (qual_prev > 0) {
1070  if (use_corrected_bx)
1071  dt = first_bx_corrected[key_wire] - first_bx_corrected[key_wire-1];
1072  else
1073  dt = first_bx[key_wire] - first_bx[key_wire-1];
1074  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
1075  if (runME21ILT_ or runME3141ILT_) qual_prev = (qual_prev & 0x03);
1076 
1077  // Cancel this wire
1078  // 1) If the candidate at the previous wire is at the same bx
1079  // clock and has better quality (or equal? quality - this has
1080  // been implemented only in 2004).
1081  // 2) If the candidate at the previous wire is up to 4 clocks
1082  // earlier, regardless of quality.
1083  if (dt == 0) {
1084  if (qual_prev > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1085  }
1086  else if (dt > 0 && dt <= ghost_cancellation_bx_depth ) {
1087  // Next "if" check accounts for firmware bug and should be
1088  // removed once the next firmware version is used.
1089  // The bug is fixed in 5/5/2008 version of ALCT firmware,
1090  // which is used in all chambers starting with 26/05/2008.
1093  (qual_prev > qual_this) )
1094  ghost_cleared[key_wire][i_pattern] = 1;
1095  }
1096  }
1097 
1098  // Next wire.
1099  // Skip this step if this wire is already declared "ghost".
1100  if (ghost_cleared[key_wire][i_pattern] == 1) {
1101  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1102  << ((i_pattern == 0) ? "Accelerator" : "Collision")
1103  << " pattern ghost cancelled on key_wire " << key_wire <<" q="<<qual_this
1104  << " by wire " << key_wire-1<<" q="<<qual_prev<<" dt="<<dt;
1105  continue;
1106  }
1107 
1108  dt = -1;
1109  int qual_next =
1110  (key_wire < numWireGroups-1) ? quality[key_wire+1][i_pattern] : 0;
1111  if (qual_next > 0) {
1112  if (use_corrected_bx)
1113  dt = first_bx_corrected[key_wire] - first_bx_corrected[key_wire+1];
1114  else
1115  dt = first_bx[key_wire] - first_bx[key_wire+1];
1116  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
1117  if (runME21ILT_ or runME3141ILT_)
1118  qual_next = (qual_next & 0x03);
1119  // Same cancellation logic as for the previous wire.
1120  if (dt == 0) {
1121  if (qual_next >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1122  }
1123  else if (dt > 0 && dt <= ghost_cancellation_bx_depth ) {
1124  // Next "if" check accounts for firmware bug and should be
1125  // removed once the next firmware version is used.
1126  // The bug is fixed in 5/5/2008 version of ALCT firmware,
1127  // which is used in all chambers starting with 26/05/2008.
1130  (qual_next >= qual_this) )
1131  ghost_cleared[key_wire][i_pattern] = 1;
1132  }
1133  }
1134  if (ghost_cleared[key_wire][i_pattern] == 1) {
1135  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1136  << ((i_pattern == 0) ? "Accelerator" : "Collision")
1137  << " pattern ghost cancelled on key_wire " << key_wire <<" q="<<qual_this
1138  << " by wire " << key_wire+1<<" q="<<qual_next<<" dt="<<dt;
1139  continue;
1140  }
1141  }
1142  }
1143  }
1144 
1145  // All cancellation is done in parallel, so wiregroups do not know what
1146  // their neighbors are cancelling.
1147  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
1148  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
1149  if (ghost_cleared[key_wire][i_pattern] > 0) {
1150  clear(key_wire, i_pattern);
1151  }
1152  }
1153  }
1154 }
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 1364 of file CSCAnodeLCTProcessor.cc.

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

Referenced by lctSearch().

1365  {
1366  /* This method should have been an overloaded > operator, but we
1367  have to keep it here since need to check values in quality[][]
1368  array modified according to accel_mode parameter. */
1369  bool returnValue = false;
1370 
1371  if (lhsALCT.isValid() && !rhsALCT.isValid()) {return true;}
1372 
1373  // ALCTs found at earlier bx times are ranked higher than ALCTs found at
1374  // later bx times regardless of the quality.
1375  if (lhsALCT.getBX() < rhsALCT.getBX()) {returnValue = true;}
1376  if (lhsALCT.getBX() != rhsALCT.getBX()) {return returnValue;}
1377 
1378  // First check the quality of ALCTs.
1379  int qual1 = lhsALCT.getQuality();
1380  int qual2 = rhsALCT.getQuality();
1381  if (qual1 > qual2) {returnValue = true;}
1382  // If qualities are the same, check accelerator bits of both ALCTs.
1383  // If they are not the same, rank according to accel_mode value.
1384  // If they are the same, keep the track selector assignment.
1385  else if (qual1 == qual2 &&
1386  lhsALCT.getAccelerator() != rhsALCT.getAccelerator() &&
1387  quality[lhsALCT.getKeyWG()][1-lhsALCT.getAccelerator()] >
1388  quality[rhsALCT.getKeyWG()][1-rhsALCT.getAccelerator()])
1389  {returnValue = true;}
1390 
1391  return returnValue;
1392 }
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 1157 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().

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

270 {
271  // Load appropriate pattern mask.
272  for (int i_patt = 0; i_patt < CSCConstants::NUM_ALCT_PATTERNS; i_patt++) {
273  for (int i_wire = 0; i_wire < CSCConstants::MAX_WIRES_IN_PATTERN; i_wire++) {
274  pattern_mask[i_patt][i_wire] = pattern_mask_open[i_patt][i_wire];
275  if (narrow_mask_r1 && (theRing == 1 || theRing == 4))
276  pattern_mask[i_patt][i_wire] = pattern_mask_r1[i_patt][i_wire];
277  }
278  }
279 }
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 813 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().

813  {
814  /* See if there is a pattern that satisfies nplanes_hit_pattern number of
815  layers hit for either the accelerator or collision patterns. Use
816  the pattern with the best quality. */
817 
818  bool trigger = false;
819  bool hit_layer[CSCConstants::NUM_LAYERS];
820  unsigned int temp_quality;
821  int this_layer, this_wire, delta_wire;
822  // If nplanes_hit_accel_pattern is 0, the firmware uses the value
823  // of nplanes_hit_pattern instead.
824  const unsigned int nplanes_hit_pattern_acc =
827  const unsigned int pattern_thresh[CSCConstants::NUM_ALCT_PATTERNS] = {
828  nplanes_hit_pattern_acc, nplanes_hit_pattern, nplanes_hit_pattern
829  };
830  const std::string ptn_label[] = {"Accelerator", "CollisionA", "CollisionB"};
831 
832  for (int i_pattern = 0; i_pattern < CSCConstants::NUM_ALCT_PATTERNS; i_pattern++){
833  temp_quality = 0;
834  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
835  hit_layer[i_layer] = false;
836 
837  double num_pattern_hits=0., times_sum=0.;
838  std::multiset<int> mset_for_median;
839  mset_for_median.clear();
840 
841  for (int i_wire = 0; i_wire < CSCConstants::MAX_WIRES_IN_PATTERN; i_wire++){
842  if (pattern_mask[i_pattern][i_wire] != 0){
843  this_layer = pattern_envelope[0][i_wire];
844  delta_wire = pattern_envelope[1+MESelection][i_wire];
845  this_wire = delta_wire + key_wire;
846  if ((this_wire >= 0) && (this_wire < numWireGroups)){
847 
848  // Wait a drift_delay time later and look for layers hit in
849  // the pattern.
850  if ( ( (pulse[this_layer][this_wire] >>
851  (first_bx[key_wire] + drift_delay)) & 1) == 1) {
852 
853  // If layer has never had a hit before, then increment number
854  // of layer hits.
855  if (hit_layer[this_layer] == false){
856  temp_quality++;
857  // keep track of which layers already had hits.
858  hit_layer[this_layer] = true;
859  if (infoV > 1)
860  LogTrace("CSCAnodeLCTProcessor")
861  << "bx_time: " << first_bx[key_wire]
862  << " pattern: " << i_pattern << " keywire: " << key_wire
863  << " layer: " << this_layer
864  << " quality: " << temp_quality;
865  }
866 
867  // for averaged time use only the closest WGs around the key WG
868  if (abs(delta_wire)<2) {
869  // find at what bx did pulse on this wire&layer start
870  // use hit_pesrist constraint on how far back we can go
871  int first_bx_layer = first_bx[key_wire] + drift_delay;
872  for (unsigned int dbx=0; dbx<hit_persist; dbx++) {
873  if (((pulse[this_layer][this_wire] >> (first_bx_layer-1)) & 1) == 1) first_bx_layer--;
874  else break;
875  }
876  times_sum += (double)first_bx_layer;
877  num_pattern_hits += 1.;
878  mset_for_median.insert(first_bx_layer);
879  if (infoV > 2)
880  LogTrace("CSCAnodeLCTProcessor")
881  <<" 1st bx in layer: "<<first_bx_layer
882  <<" sum bx: "<<times_sum
883  <<" #pat. hits: "<<num_pattern_hits;
884  }
885  }
886  }
887  }
888  }
889 
890  // calculate median
891  const int sz = mset_for_median.size();
892  if (sz > 0) {
893  std::multiset<int>::iterator im = mset_for_median.begin();
894  if (sz > 1) std::advance(im,sz/2-1);
895  if (sz == 1) first_bx_corrected[key_wire] = *im;
896  else if ((sz % 2) == 1) first_bx_corrected[key_wire] = *(++im);
897  else first_bx_corrected[key_wire] = ((*im) + (*(++im)))/2;
898 
899 #if defined(EDM_ML_DEBUG)
900  if (infoV > 1) {
901  auto lt = LogTrace("CSCAnodeLCTProcessor") <<"bx="<<first_bx[key_wire]<<" bx_cor="<< first_bx_corrected[key_wire]<<" bxset=";
902  for (im = mset_for_median.begin(); im != mset_for_median.end(); im++) {
903  lt<<" "<<*im;
904  }
905  }
906 #endif
907  }
908 
909  if (temp_quality >= pattern_thresh[i_pattern]) {
910  trigger = true;
911 
912  // Quality definition changed on 22 June 2007: it no longer depends
913  // on pattern_thresh.
914  int Q;
915  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
916  if (temp_quality == 3 and (runME21ILT_ or runME3141ILT_)) Q = 4;
917  else if (temp_quality > 3) Q = temp_quality - 3;
918  else Q = 0; // quality code 0 is valid!
919  temp_quality = Q;
920 
921  if (i_pattern == 0) {
922  // Accelerator pattern
923  quality[key_wire][0] = temp_quality;
924  }
925  else {
926  // Only one collision pattern (of the best quality) is reported
927  if (static_cast<int>(temp_quality) > quality[key_wire][1]) {
928  quality[key_wire][1] = temp_quality;
929  quality[key_wire][2] = i_pattern-1;
930  }
931  }
932  if (infoV > 1) {
933  LogTrace("CSCAnodeLCTProcessor")
934  << "Pattern found; keywire: " << key_wire
935  << " type: " << ptn_label[i_pattern]
936  << " quality: " << temp_quality << "\n";
937  }
938  }
939  }
940  if (infoV > 1 && quality[key_wire][1] > 0) {
941  if (quality[key_wire][2] == 0)
942  LogTrace("CSCAnodeLCTProcessor")
943  << "Collision Pattern A is chosen" << "\n";
944  else if (quality[key_wire][2] == 1)
945  LogTrace("CSCAnodeLCTProcessor")
946  << "Collision Pattern B is chosen" << "\n";
947  }
948  return trigger;
949 }
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 750 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().

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

Referenced by run().

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

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

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

Referenced by run().

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

Referenced by setCSCGeometry().

439  {
440  // This is the main routine for normal running. It gets wire times
441  // from the wire digis and then passes them on to another run() function.
442 
443  static std::atomic<bool> config_dumped{false};
444  if ((infoV > 0 || isSLHC_) && !config_dumped) {
445  //std::cout<<"**** ALCT run parameters dump ****"<<std::endl;
447  config_dumped = true;
448  }
449 
450 
451  // Get the number of wire groups for the given chamber. Do it only once
452  // per chamber.
453  if (numWireGroups == 0) {
456  CSCDetId detid(theEndcap, theStation, ring, chid, 0);
457  const auto& chamber = csc_g->chamber(detid);
458  if (chamber) {
459  numWireGroups = chamber->layer(1)->geometry()->numberOfWireGroups();
461  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
462  << "+++ Number of wire groups, " << numWireGroups
463  << " found in " << detid.chamberName()
464  << " (sector " << theSector << " subsector " << theSubsector
465  << " trig id. " << theTrigChamber << ")"
466  << " exceeds max expected, " << CSCConstants::MAX_NUM_WIRES
467  << " +++\n"
468  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
469  numWireGroups = -1;
470  }
471  }
472  else {
473  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
474  << "+++ " << detid.chamberName()
475  << " (sector " << theSector << " subsector " << theSubsector
476  << " trig id. " << theTrigChamber << ")"
477  << " is not defined in current geometry! +++\n"
478  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
479  numWireGroups = -1;
480  }
481  }
482 
483  if (numWireGroups < 0) {
484  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
486  << " (sector " << theSector << " subsector " << theSubsector
487  << " trig id. " << theTrigChamber << "):"
488  << " numWireGroups = " << numWireGroups
489  << "; ALCT emulation skipped! +++";
490  std::vector<CSCALCTDigi> emptyV;
491  return emptyV;
492  }
493 
494  // Get wire digis in this chamber from wire digi collection.
495  bool noDigis = getDigis(wiredc);
496 
497  if (!noDigis) {
498  // First get wire times from the wire digis.
499  std::vector<int>
501  readWireDigis(wire);
502 
503  // Pass an array of wire times on to another run() doing the LCT search.
504  // If the number of layers containing digis is smaller than that
505  // required to trigger, quit right away.
506  const unsigned int min_layers =
512  );
513 
514  unsigned int layersHit = 0;
515  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
516  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
517  if (!wire[i_layer][i_wire].empty()) {layersHit++; break;}
518  }
519  }
520  if (layersHit >= min_layers) run(wire);
521  }
522 
523  // Return vector of all found ALCTs.
524  std::vector<CSCALCTDigi> tmpV = getALCTs();
525  return tmpV;
526 }
void readWireDigis(std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
bool getDigis(const CSCWireDigiCollection *wiredc)
const unsigned theTrigChamber
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 528 of file CSCAnodeLCTProcessor.cc.

References drift_delay, fifo_tbins, first_bx, ghostCancellationLogic(), ghostCancellationLogicSLHC(), infoV, isSLHC_, lctSearch(), numWireGroups, patternDetection(), pretrig_extra_deadtime, preTrigger(), pulseExtension(), and showPatterns().

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

299 {
300  static std::atomic<bool> config_dumped{false};
301 
302  fifo_tbins = conf->alctFifoTbins();
303  fifo_pretrig = conf->alctFifoPretrig();
304  drift_delay = conf->alctDriftDelay();
309  trig_mode = conf->alctTrigMode();
310  accel_mode = conf->alctAccelMode();
312 
313  // Check and print configuration parameters.
315  if (!config_dumped) {
316  //std::cout<<"**** ALCT setConfigParam parameters dump ****"<<std::endl;
318  config_dumped = true;
319  }
320 }
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, and run().

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 282 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().

283 {
284  // Set default values for configuration parameters.
295 }
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::showPatterns ( const int  key_wire)
private

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

1629  {
1630  /* Method to test the pretrigger */
1631  for (int i_pattern = 0; i_pattern < CSCConstants::NUM_ALCT_PATTERNS;
1632  i_pattern++) {
1633  std::ostringstream strstrm_header;
1634  LogTrace("CSCAnodeLCTProcessor")
1635  << "\n" << "Pattern: " << i_pattern << " Key wire: " << key_wire;
1636  for (int i = 1; i <= 32; i++) {
1637  strstrm_header << ((32-i)%10);
1638  }
1639  LogTrace("CSCAnodeLCTProcessor") << strstrm_header.str();
1640  for (int i_wire = 0; i_wire < CSCConstants::MAX_WIRES_IN_PATTERN; i_wire++) {
1641  if (pattern_mask[i_pattern][i_wire] != 0) {
1642  std::ostringstream strstrm_pulse;
1643  int this_layer = pattern_envelope[0][i_wire];
1644  int this_wire = pattern_envelope[1+MESelection][i_wire]+key_wire;
1645  if (this_wire >= 0 && this_wire < numWireGroups) {
1646  for (int i = 1; i <= 32; i++) {
1647  strstrm_pulse << ((pulse[this_layer][this_wire]>>(32-i)) & 1);
1648  }
1649  LogTrace("CSCAnodeLCTProcessor")
1650  << strstrm_pulse.str() << " on layer " << this_layer;
1651  }
1652  }
1653  }
1654  LogTrace("CSCAnodeLCTProcessor")
1655  << "-------------------------------------------";
1656  }
1657 }
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 1394 of file CSCAnodeLCTProcessor.cc.

References infoV, LogTrace, quality, and trig_mode.

Referenced by lctSearch().

1394  {
1395  /* Function which enables/disables either collision or accelerator tracks.
1396  The function uses the trig_mode parameter to decide. */
1397 
1398  switch(trig_mode) {
1399  default:
1400  case 0:
1401  // Enables both collision and accelerator tracks
1402  break;
1403  case 1:
1404  // Disables collision tracks
1405  if (quality[key_wire][1] > 0) {
1406  quality[key_wire][1] = 0;
1407  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1408  << "trigMode(): collision track " << key_wire << " disabled" << "\n";
1409  }
1410  break;
1411  case 2:
1412  // Disables accelerator tracks
1413  if (quality[key_wire][0] > 0) {
1414  quality[key_wire][0] = 0;
1415  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1416  << "trigMode(): accelerator track " << key_wire << " disabled" << "\n";
1417  }
1418  break;
1419  case 3:
1420  // Disables collision track if there is an accelerator track found
1421  // in the same wire group at the same time
1422  if (quality[key_wire][0] > 0 && quality[key_wire][1] > 0) {
1423  quality[key_wire][1] = 0;
1424  if (infoV > 1) LogTrace("CSCAnodeLCTProcessor")
1425  << "trigMode(): collision track " << key_wire << " disabled" << "\n";
1426  }
1427  break;
1428  }
1429 }
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 101 of file CSCAnodeLCTProcessor.h.

Referenced by run(), and setCSCGeometry().

const unsigned int CSCAnodeLCTProcessor::def_accel_mode = 0
staticprivate

Definition at line 165 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_drift_delay = 2
staticprivate

Definition at line 161 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_fifo_pretrig = 10
staticprivate

Definition at line 160 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 160 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_l1a_window_width = 7
staticprivate

Definition at line 166 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_accel_pattern = 4
staticprivate

Definition at line 164 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_accel_pretrig = 2
staticprivate

Definition at line 163 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_pattern = 4
staticprivate

Definition at line 162 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_pretrig = 2
staticprivate

Definition at line 162 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

const unsigned int CSCAnodeLCTProcessor::def_trig_mode = 2
staticprivate

Definition at line 165 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

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

Definition at line 116 of file CSCAnodeLCTProcessor.h.

Referenced by getDigis(), and readWireDigis().

bool CSCAnodeLCTProcessor::disableME1a
private

SLHC: special configuration parameters for ME1a treatment

Definition at line 132 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 135 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 138 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 142 of file CSCAnodeLCTProcessor.h.

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

unsigned int CSCAnodeLCTProcessor::hit_persist
private

SLHC: hit persistency length

Definition at line 129 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 92 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 108 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and getDigis().

bool CSCAnodeLCTProcessor::isSLHC_
private

Flag for SLHC studies.

Definition at line 120 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 151 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 83 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 169 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 84 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 85 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 145 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and run().

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

Definition at line 117 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 154 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 157 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 106 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 95 of file CSCAnodeLCTProcessor.h.

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

unsigned CSCAnodeLCTProcessor::theRing
private

ring number. Only matters for ME1a

Definition at line 104 of file CSCAnodeLCTProcessor.h.

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

const unsigned CSCAnodeLCTProcessor::theSector
private

Definition at line 97 of file CSCAnodeLCTProcessor.h.

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

const unsigned CSCAnodeLCTProcessor::theStation
private

Definition at line 96 of file CSCAnodeLCTProcessor.h.

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

const unsigned CSCAnodeLCTProcessor::theSubsector
private

Definition at line 98 of file CSCAnodeLCTProcessor.h.

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

const unsigned CSCAnodeLCTProcessor::theTrigChamber
private

Definition at line 99 of file CSCAnodeLCTProcessor.h.

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

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 148 of file CSCAnodeLCTProcessor.h.

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