CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
CSCUpgradeAnodeLCTProcessor Class Reference

#include <CSCUpgradeAnodeLCTProcessor.h>

Inheritance diagram for CSCUpgradeAnodeLCTProcessor:
CSCAnodeLCTProcessor CSCBaseboard

Public Member Functions

 CSCUpgradeAnodeLCTProcessor ()
 
 CSCUpgradeAnodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
- Public Member Functions inherited from CSCAnodeLCTProcessor
void clear ()
 
 CSCAnodeLCTProcessor ()
 
 CSCAnodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
std::vector< CSCALCTDigigetALCTs (unsigned nMaxALCTs=CSCConstants::MAX_ALCTS_READOUT) const
 
CSCALCTDigi getBestALCT (int bx) const
 
unsigned getHighMultiplictyBits () const
 
CSCALCTDigi getSecondALCT (int bx) const
 
std::vector< CSCALCTPreTriggerDigipreTriggerDigis () const
 
std::vector< CSCALCTDigireadoutALCTs (int nMaxALCTs=CSCConstants::MAX_ALCTS_READOUT) const
 
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)
 
 ~CSCAnodeLCTProcessor () override=default
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard ()
 
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
std::string getCSCName () const
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCBaseboard ()=default
 

Private Member Functions

int getTempALCTQuality (int temp_quality) const override
 
void ghostCancellationLogic () override
 
void ghostCancellationLogicOneWire (const int key_wire, int *ghost_cleared) override
 

Additional Inherited Members

- Protected Types inherited from CSCAnodeLCTProcessor
enum  ALCT_WireInfo { INVALID_WIRE = 65535 }
 
- Protected Member Functions inherited from CSCAnodeLCTProcessor
void accelMode (const int key_wire)
 
std::vector< CSCALCTDigibestTrackSelector (const std::vector< CSCALCTDigi > &all_alcts)
 
void checkConfigParameters ()
 
void cleanWireContainer (CSCALCTDigi::WireContainer &wireHits) const
 
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 encodeHighMultiplicityBits ()
 
bool getDigis (const CSCWireDigiCollection *wiredc)
 
void getDigis (const CSCWireDigiCollection *wiredc, const CSCDetId &id)
 
bool isBetterALCT (const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT) const
 
void lctSearch ()
 
void loadPatternMask ()
 
bool patternDetection (const int key_wire, std::map< int, std::map< int, CSCALCTDigi::WireContainer > > &hits_in_patterns)
 
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 setWireContainer (CSCALCTDigi &, CSCALCTDigi::WireContainer &wireHits) const
 
void showPatterns (const int key_wire)
 
void trigMode (const int key_wire)
 
- Protected Member Functions inherited from CSCBaseboard
void checkConfigParameters (unsigned int &var, const unsigned int var_max, const unsigned int var_def, const std::string &var_str)
 
- Protected Attributes inherited from CSCAnodeLCTProcessor
unsigned int accel_mode
 
CSCPatternBank::LCTPatterns alct_pattern_ = {}
 
std::vector< std::vector< CSCALCTDigi > > ALCTContainer_
 
CSCALCTDigi bestALCT [CSCConstants::MAX_ALCT_TBINS]
 
std::vector< CSCWireDigidigiV [CSCConstants::NUM_LAYERS]
 
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 highMultiplicityBits_
 
unsigned int hit_persist
 
unsigned int l1a_window_width
 
std::vector< CSCALCTDigilct_list
 
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
 
unsigned int pretrig_extra_deadtime
 
unsigned int pulse [CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
 
int quality [CSCConstants::MAX_NUM_WIRES][3]
 
std::unique_ptr< LCTQualityControlqualityControl_
 
CSCALCTDigi secondALCT [CSCConstants::MAX_ALCT_TBINS]
 
std::vector< CSCALCTPreTriggerDigithePreTriggerDigis
 
unsigned int trig_mode
 
bool use_corrected_bx
 
- Protected Attributes inherited from CSCBaseboard
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctPhase2_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isME21_
 
bool isME31_
 
bool isME41_
 
bool runCCLUT_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
bool runPhase2_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
unsigned theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 
- Static Protected Attributes inherited from CSCAnodeLCTProcessor
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.

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

Definition at line 16 of file CSCUpgradeAnodeLCTProcessor.h.

Constructor & Destructor Documentation

◆ CSCUpgradeAnodeLCTProcessor() [1/2]

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

Normal constructor.

Definition at line 3 of file CSCUpgradeAnodeLCTProcessor.cc.

9  : CSCAnodeLCTProcessor(endcap, station, sector, subsector, chamber, conf) {
10  if (!runPhase2_)
11  edm::LogError("CSCUpgradeAnodeLCTProcessor|ConfigError")
12  << "+++ Upgrade CSCUpgradeAnodeLCTProcessor constructed while runPhase2_ is not set! +++\n";
13 
14  if (!enableAlctPhase2_)
15  edm::LogError("CSCUpgradeAnodeLCTProcessor|ConfigError")
16  << "+++ Upgrade CSCUpgradeAnodeLCTProcessor constructed while enableAlctPhase2_ is not set! +++\n";
17 }

References CSCBaseboard::enableAlctPhase2_, and CSCBaseboard::runPhase2_.

◆ CSCUpgradeAnodeLCTProcessor() [2/2]

CSCUpgradeAnodeLCTProcessor::CSCUpgradeAnodeLCTProcessor ( )

Default constructor. Used for testing.

Definition at line 19 of file CSCUpgradeAnodeLCTProcessor.cc.

20  if (!runPhase2_)
21  edm::LogError("CSCUpgradeAnodeLCTProcessor|ConfigError")
22  << "+++ Upgrade CSCUpgradeAnodeLCTProcessor constructed while runPhase2_ is not set! +++\n";
23 
24  if (!enableAlctPhase2_)
25  edm::LogError("CSCUpgradeAnodeLCTProcessor|ConfigError")
26  << "+++ Upgrade CSCUpgradeAnodeLCTProcessor constructed while enableAlctPhase2_ is not set! +++\n";
27 }

References CSCBaseboard::enableAlctPhase2_, and CSCBaseboard::runPhase2_.

Member Function Documentation

◆ getTempALCTQuality()

int CSCUpgradeAnodeLCTProcessor::getTempALCTQuality ( int  temp_quality) const
overrideprivatevirtual

Reimplemented from CSCAnodeLCTProcessor.

Definition at line 193 of file CSCUpgradeAnodeLCTProcessor.cc.

193  {
194  // Quality definition changed on 22 June 2007: it no longer depends
195  // on pattern_thresh.
196  int Q;
197  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
198  if (temp_quality == 3 and runPhase2_ and runME21ILT_ and isME21_)
199  Q = 4;
200  else if (temp_quality > 3)
201  Q = temp_quality - 3;
202  else
203  Q = 0; // quality code 0 is valid!
204 
205  return Q;
206 }

References CSCBaseboard::isME21_, class-composition::Q, CSCBaseboard::runME21ILT_, and CSCBaseboard::runPhase2_.

◆ ghostCancellationLogic()

void CSCUpgradeAnodeLCTProcessor::ghostCancellationLogic ( )
overrideprivatevirtual

Reimplemented from CSCAnodeLCTProcessor.

Definition at line 29 of file CSCUpgradeAnodeLCTProcessor.cc.

29  {
30  int ghost_cleared[CSCConstants::MAX_NUM_WIRES][2];
31 
32  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
33  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
34  ghost_cleared[key_wire][i_pattern] = 0;
35 
36  // Non-empty wire group.
37  int qual_this = quality[key_wire][i_pattern];
38  if (qual_this > 0) {
39  if (runPhase2_ and runME21ILT_ and isME21_)
40  qual_this = (qual_this & 0x03);
41  // Previous wire.
42  int dt = -1;
43  int qual_prev = (key_wire > 0) ? quality[key_wire - 1][i_pattern] : 0;
44  if (qual_prev > 0) {
45  if (use_corrected_bx)
46  dt = first_bx_corrected[key_wire] - first_bx_corrected[key_wire - 1];
47  else
48  dt = first_bx[key_wire] - first_bx[key_wire - 1];
49  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
50  if (runPhase2_ and runME21ILT_ and isME21_)
51  qual_prev = (qual_prev & 0x03);
52 
53  // Cancel this wire
54  // 1) If the candidate at the previous wire is at the same bx
55  // clock and has better quality (or equal? quality - this has
56  // been implemented only in 2004).
57  // 2) If the candidate at the previous wire is up to 4 clocks
58  // earlier, regardless of quality.
59  if (dt == 0) {
60  if (qual_prev > qual_this)
61  ghost_cleared[key_wire][i_pattern] = 1;
62  } else if (dt > 0 && dt <= ghost_cancellation_bx_depth) {
63  if ((!ghost_cancellation_side_quality) || (qual_prev > qual_this))
64  ghost_cleared[key_wire][i_pattern] = 1;
65  }
66  }
67 
68  // Next wire.
69  // Skip this step if this wire is already declared "ghost".
70  if (ghost_cleared[key_wire][i_pattern] == 1) {
71  if (infoV > 1)
72  LogTrace("CSCUpgradeAnodeLCTProcessor")
73  << ((i_pattern == 0) ? "Accelerator" : "Collision") << " pattern ghost cancelled on key_wire "
74  << key_wire << " q=" << qual_this << " by wire " << key_wire - 1 << " q=" << qual_prev
75  << " dt=" << dt;
76  continue;
77  }
78 
79  dt = -1;
80  int qual_next = (key_wire < numWireGroups - 1) ? quality[key_wire + 1][i_pattern] : 0;
81  if (qual_next > 0) {
82  if (use_corrected_bx)
83  dt = first_bx_corrected[key_wire] - first_bx_corrected[key_wire + 1];
84  else
85  dt = first_bx[key_wire] - first_bx[key_wire + 1];
86  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
87  if (runPhase2_ and runME21ILT_ and isME21_)
88  qual_next = (qual_next & 0x03);
89  // Same cancellation logic as for the previous wire.
90  if (dt == 0) {
91  if (qual_next >= qual_this)
92  ghost_cleared[key_wire][i_pattern] = 1;
93  } else if (dt > 0 && dt <= ghost_cancellation_bx_depth) {
94  if ((!ghost_cancellation_side_quality) || (qual_next >= qual_this))
95  ghost_cleared[key_wire][i_pattern] = 1;
96  }
97  }
98  if (ghost_cleared[key_wire][i_pattern] == 1) {
99  if (infoV > 1)
100  LogTrace("CSCUpgradeAnodeLCTProcessor")
101  << ((i_pattern == 0) ? "Accelerator" : "Collision") << " pattern ghost cancelled on key_wire "
102  << key_wire << " q=" << qual_this << " by wire " << key_wire + 1 << " q=" << qual_next
103  << " dt=" << dt;
104  continue;
105  }
106  }
107  }
108  }
109 
110  // All cancellation is done in parallel, so wiregroups do not know what
111  // their neighbors are cancelling.
112  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
113  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
114  if (ghost_cleared[key_wire][i_pattern] > 0) {
115  clear(key_wire, i_pattern);
116  }
117  }
118  }
119 }

References CSCAnodeLCTProcessor::clear(), dt, CSCAnodeLCTProcessor::first_bx, CSCAnodeLCTProcessor::first_bx_corrected, CSCAnodeLCTProcessor::ghost_cancellation_bx_depth, CSCAnodeLCTProcessor::ghost_cancellation_side_quality, CSCBaseboard::infoV, CSCBaseboard::isME21_, LogTrace, CSCConstants::MAX_NUM_WIRES, CSCAnodeLCTProcessor::numWireGroups, CSCAnodeLCTProcessor::quality, CSCBaseboard::runME21ILT_, CSCBaseboard::runPhase2_, and CSCAnodeLCTProcessor::use_corrected_bx.

◆ ghostCancellationLogicOneWire()

void CSCUpgradeAnodeLCTProcessor::ghostCancellationLogicOneWire ( const int  key_wire,
int *  ghost_cleared 
)
overrideprivatevirtual

Reimplemented from CSCAnodeLCTProcessor.

Definition at line 121 of file CSCUpgradeAnodeLCTProcessor.cc.

121  {
122  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
123  ghost_cleared[i_pattern] = 0;
124  if (key_wire == 0)
125  continue;
126 
127  // Non-empty wire group.
128  int qual_this = quality[key_wire][i_pattern];
129  if (qual_this > 0) {
130  if (runPhase2_ and runME21ILT_ and isME21_)
131  qual_this = (qual_this & 0x03);
132  // Previous wire.
133  int dt = -1;
134  for (auto& p : lct_list) {
135  if (not(p.isValid() and p.getKeyWG() == key_wire - 1 and 1 - p.getAccelerator() == i_pattern))
136  continue;
137 
138  bool ghost_cleared_prev = false;
139  int qual_prev = p.getQuality();
140  int first_bx_prev = p.getBX();
141  if (infoV > 1)
142  LogTrace("CSCAnodeLCTProcessor")
143  << "ghost concellation logic " << ((i_pattern == 0) ? "Accelerator" : "Collision") << " key_wire "
144  << key_wire << " quality " << qual_this << " bx " << first_bx[key_wire] << " previous key_wire "
145  << key_wire - 1 << " quality " << qual_prev << " bx " << first_bx[key_wire - 1];
146 
147  //int dt = first_bx[key_wire] - first_bx[key_wire-1];
148  if (use_corrected_bx)
149  dt = first_bx_corrected[key_wire] - first_bx_prev;
150  else
151  dt = first_bx[key_wire] - first_bx_prev;
152  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
153  if (runPhase2_ and runME21ILT_ and isME21_)
154  qual_prev = (qual_prev & 0x03);
155 
156  // Cancel this wire
157  // 1) If the candidate at the previous wire is at the same bx
158  // clock and has better quality (or equal? quality - this has
159  // been implemented only in 2004).
160  // 2) If the candidate at the previous wire is up to 4 clocks
161  // earlier, regardless of quality.
162  if (dt == 0) {
163  if (qual_prev > qual_this)
164  ghost_cleared[i_pattern] = 1;
165  } else if (dt > 0 && dt <= ghost_cancellation_bx_depth) {
166  if ((!ghost_cancellation_side_quality) || (qual_prev > qual_this))
167  ghost_cleared[i_pattern] = 1;
168  } else if (dt < 0 && dt * (-1) <= ghost_cancellation_bx_depth) {
169  if ((!ghost_cancellation_side_quality) || (qual_prev < qual_this))
170  ghost_cleared_prev = true;
171  }
172 
173  if (ghost_cleared[i_pattern] == 1) {
174  if (infoV > 1)
175  LogTrace("CSCUpgradeAnodeLCTProcessor")
176  << ((i_pattern == 0) ? "Accelerator" : "Collision") << " pattern ghost cancelled on key_wire "
177  << key_wire << " q=" << qual_this << " by wire " << key_wire - 1 << " q=" << qual_prev
178  << " dt=" << dt;
179  //cancellation for key_wire is done when ALCT is created and pushed to lct_list
180  }
181  if (ghost_cleared_prev) {
182  if (infoV > 1)
183  LogTrace("CSCAnodeLCTProcessor")
184  << ((i_pattern == 0) ? "Accelerator" : "Collision") << " pattern ghost cancelled on key_wire "
185  << key_wire - 1 << " q=" << qual_prev << " by wire " << key_wire << " q=" << qual_this;
186  p.setValid(0); //clean prev ALCT
187  }
188  }
189  }
190  }
191 }

References dt, CSCAnodeLCTProcessor::first_bx, CSCAnodeLCTProcessor::first_bx_corrected, CSCAnodeLCTProcessor::ghost_cancellation_bx_depth, CSCAnodeLCTProcessor::ghost_cancellation_side_quality, CSCBaseboard::infoV, CSCBaseboard::isME21_, CSCAnodeLCTProcessor::lct_list, LogTrace, AlCaHLTBitMon_ParallelJobs::p, CSCAnodeLCTProcessor::quality, CSCBaseboard::runME21ILT_, CSCBaseboard::runPhase2_, and CSCAnodeLCTProcessor::use_corrected_bx.

CSCConstants::MAX_NUM_WIRES
Definition: CSCConstants.h:22
relativeConstraints.station
station
Definition: relativeConstraints.py:67
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCAnodeLCTProcessor::first_bx_corrected
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
Definition: CSCAnodeLCTProcessor.h:116
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
class-composition.Q
Q
Definition: class-composition.py:82
dt
float dt
Definition: AMPTWrapper.h:136
CSCAnodeLCTProcessor::quality
int quality[CSCConstants::MAX_NUM_WIRES][3]
Definition: CSCAnodeLCTProcessor.h:117
CSCAnodeLCTProcessor::lct_list
std::vector< CSCALCTDigi > lct_list
Definition: CSCAnodeLCTProcessor.h:121
CSCAnodeLCTProcessor::clear
void clear()
Definition: CSCAnodeLCTProcessor.cc:192
CSCBaseboard::runPhase2_
bool runPhase2_
Definition: CSCBaseboard.h:84
CSCAnodeLCTProcessor::CSCAnodeLCTProcessor
CSCAnodeLCTProcessor()
Definition: CSCAnodeLCTProcessor.cc:86
CSCBaseboard::enableAlctPhase2_
bool enableAlctPhase2_
Definition: CSCBaseboard.h:85
CSCAnodeLCTProcessor::use_corrected_bx
bool use_corrected_bx
Definition: CSCAnodeLCTProcessor.h:152
CSCAnodeLCTProcessor::numWireGroups
int numWireGroups
Definition: CSCAnodeLCTProcessor.h:112
CSCAnodeLCTProcessor::ghost_cancellation_side_quality
bool ghost_cancellation_side_quality
Definition: CSCAnodeLCTProcessor.h:146
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCBaseboard::runME21ILT_
bool runME21ILT_
Definition: CSCBaseboard.h:94
CSCBaseboard::isME21_
bool isME21_
Definition: CSCBaseboard.h:52
CSCAnodeLCTProcessor::first_bx
int first_bx[CSCConstants::MAX_NUM_WIRES]
Definition: CSCAnodeLCTProcessor.h:115
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
CSCAnodeLCTProcessor::ghost_cancellation_bx_depth
int ghost_cancellation_bx_depth
Definition: CSCAnodeLCTProcessor.h:142
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:63