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 (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCUpgradeAnodeLCTProcessor ()
 
- Public Member Functions inherited from CSCAnodeLCTProcessor
void clear ()
 
 CSCAnodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCAnodeLCTProcessor ()
 
std::vector< CSCALCTDigigetALCTs ()
 
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)
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCBaseboard ()
 
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

- Public Attributes inherited from CSCAnodeLCTProcessor
CSCALCTDigi bestALCT [CSCConstants::MAX_ALCT_TBINS]
 
CSCALCTDigi secondALCT [CSCConstants::MAX_ALCT_TBINS]
 
- Static Public Attributes inherited from CSCAnodeLCTProcessor
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]
 
- Protected Member Functions inherited from CSCAnodeLCTProcessor
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
 
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)
 
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)
 
- Protected Attributes inherited from CSCAnodeLCTProcessor
unsigned int accel_mode
 
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 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
 
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]
 
unsigned int trig_mode
 
bool use_corrected_bx
 
- Protected Attributes inherited from CSCBaseboard
unsigned int alctClctOffset_
 
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctSLHC_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isSLHC_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
unsigned theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 
- 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::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.

References CSCBaseboard::enableAlctSLHC_, and CSCBaseboard::isSLHC_.

6  :
7  CSCAnodeLCTProcessor(endcap, station, sector, subsector, chamber, conf)
8 {
9  if (!isSLHC_) edm::LogError("CSCUpgradeAnodeLCTProcessor|ConfigError")
10  << "+++ Upgrade CSCUpgradeAnodeLCTProcessor constructed while isSLHC_ is not set! +++\n";
11 
12  if (!enableAlctSLHC_) edm::LogError("CSCUpgradeAnodeLCTProcessor|ConfigError")
13  << "+++ Upgrade CSCUpgradeAnodeLCTProcessor constructed while enableAlctSLHC_ is not set! +++\n";
14 }
bool enableAlctSLHC_
Definition: CSCBaseboard.h:74
CSCUpgradeAnodeLCTProcessor::CSCUpgradeAnodeLCTProcessor ( )

Default constructor. Used for testing.

Definition at line 16 of file CSCUpgradeAnodeLCTProcessor.cc.

References CSCBaseboard::enableAlctSLHC_, and CSCBaseboard::isSLHC_.

16  :
18 {
19  if (!isSLHC_) edm::LogError("CSCUpgradeAnodeLCTProcessor|ConfigError")
20  << "+++ Upgrade CSCUpgradeAnodeLCTProcessor constructed while isSLHC_ is not set! +++\n";
21 
22  if (!enableAlctSLHC_) edm::LogError("CSCUpgradeAnodeLCTProcessor|ConfigError")
23  << "+++ Upgrade CSCUpgradeAnodeLCTProcessor constructed while enableAlctSLHC_ is not set! +++\n";
24 }
bool enableAlctSLHC_
Definition: CSCBaseboard.h:74

Member Function Documentation

int CSCUpgradeAnodeLCTProcessor::getTempALCTQuality ( int  temp_quality) const
overrideprivatevirtual

Reimplemented from CSCAnodeLCTProcessor.

Definition at line 202 of file CSCUpgradeAnodeLCTProcessor.cc.

References CSCBaseboard::isSLHC_, or, class-composition::Q, CSCBaseboard::runME21ILT_, CSCBaseboard::runME31Up_, and CSCBaseboard::runME41Up_.

203 {
204  // Quality definition changed on 22 June 2007: it no longer depends
205  // on pattern_thresh.
206  int Q;
207  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
208  if (temp_quality == 3 and isSLHC_ and (runME21ILT_ or runME31Up_ or runME41Up_)) Q = 4;
209  else if (temp_quality > 3) Q = temp_quality - 3;
210  else Q = 0; // quality code 0 is valid!
211 
212  return Q;
213 }
bool runME21ILT_
Definition: CSCBaseboard.h:92
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
void CSCUpgradeAnodeLCTProcessor::ghostCancellationLogic ( )
overrideprivatevirtual

Reimplemented from CSCAnodeLCTProcessor.

Definition at line 26 of file CSCUpgradeAnodeLCTProcessor.cc.

References CSCAnodeLCTProcessor::clear(), dt, CSCAnodeLCTProcessor::first_bx, CSCAnodeLCTProcessor::first_bx_corrected, CSCAnodeLCTProcessor::ghost_cancellation_bx_depth, CSCAnodeLCTProcessor::ghost_cancellation_side_quality, CSCBaseboard::infoV, CSCBaseboard::isSLHC_, LogTrace, CSCConstants::MAX_NUM_WIRES, CSCAnodeLCTProcessor::numWireGroups, or, CSCAnodeLCTProcessor::quality, CSCBaseboard::runME21ILT_, CSCBaseboard::runME31Up_, CSCBaseboard::runME41Up_, and CSCAnodeLCTProcessor::use_corrected_bx.

27 {
28  int ghost_cleared[CSCConstants::MAX_NUM_WIRES][2];
29 
30  for (int key_wire = 0; key_wire < numWireGroups; key_wire++) {
31  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
32  ghost_cleared[key_wire][i_pattern] = 0;
33 
34  // Non-empty wire group.
35  int qual_this = quality[key_wire][i_pattern];
36  if (qual_this > 0) {
37 
39  qual_this = (qual_this & 0x03);
40  // Previous wire.
41  int dt = -1;
42  int qual_prev = (key_wire > 0) ? quality[key_wire-1][i_pattern] : 0;
43  if (qual_prev > 0) {
44  if (use_corrected_bx)
45  dt = first_bx_corrected[key_wire] - first_bx_corrected[key_wire-1];
46  else
47  dt = first_bx[key_wire] - first_bx[key_wire-1];
48  // hack to run the Phase-II ME2/1, ME3/1 and ME4/1 ILT
49  if (isSLHC_ and (runME21ILT_ or runME31Up_ or runME41Up_))
50  qual_prev = (qual_prev & 0x03);
51 
52  // Cancel this wire
53  // 1) If the candidate at the previous wire is at the same bx
54  // clock and has better quality (or equal? quality - this has
55  // been implemented only in 2004).
56  // 2) If the candidate at the previous wire is up to 4 clocks
57  // earlier, regardless of quality.
58  if (dt == 0) {
59  if (qual_prev > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
60  }
61  else if (dt > 0 && dt <= ghost_cancellation_bx_depth ) {
63  (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) LogTrace("CSCUpgradeAnodeLCTProcessor")
72  << ((i_pattern == 0) ? "Accelerator" : "Collision")
73  << " pattern ghost cancelled on key_wire " << key_wire <<" q="<<qual_this
74  << " by wire " << key_wire-1<<" q="<<qual_prev<<" dt="<<dt;
75  continue;
76  }
77 
78  dt = -1;
79  int qual_next =
80  (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 (isSLHC_ and (runME21ILT_ or runME31Up_ or runME41Up_))
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) ghost_cleared[key_wire][i_pattern] = 1;
92  }
93  else if (dt > 0 && dt <= ghost_cancellation_bx_depth ) {
95  (qual_next >= qual_this) )
96  ghost_cleared[key_wire][i_pattern] = 1;
97  }
98  }
99  if (ghost_cleared[key_wire][i_pattern] == 1) {
100  if (infoV > 1) LogTrace("CSCUpgradeAnodeLCTProcessor")
101  << ((i_pattern == 0) ? "Accelerator" : "Collision")
102  << " pattern ghost cancelled on key_wire " << key_wire <<" q="<<qual_this
103  << " by wire " << key_wire+1<<" q="<<qual_next<<" 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 }
float dt
Definition: AMPTWrapper.h:126
int quality[CSCConstants::MAX_NUM_WIRES][3]
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
bool runME21ILT_
Definition: CSCBaseboard.h:92
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]
void CSCUpgradeAnodeLCTProcessor::ghostCancellationLogicOneWire ( const int  key_wire,
int *  ghost_cleared 
)
overrideprivatevirtual

Reimplemented from CSCAnodeLCTProcessor.

Definition at line 123 of file CSCUpgradeAnodeLCTProcessor.cc.

References dt, CSCAnodeLCTProcessor::first_bx, CSCAnodeLCTProcessor::first_bx_corrected, CSCAnodeLCTProcessor::ghost_cancellation_bx_depth, CSCAnodeLCTProcessor::ghost_cancellation_side_quality, CSCBaseboard::infoV, CSCBaseboard::isSLHC_, CSCAnodeLCTProcessor::lct_list, LogTrace, or, AlCaHLTBitMon_ParallelJobs::p, CSCAnodeLCTProcessor::quality, CSCBaseboard::runME21ILT_, CSCBaseboard::runME31Up_, CSCBaseboard::runME41Up_, and CSCAnodeLCTProcessor::use_corrected_bx.

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