CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
CSCMotherboard Class Reference

#include <CSCMotherboard.h>

Inheritance diagram for CSCMotherboard:
CSCMotherboardME11 CSCMotherboardME11GEM CSCMotherboardME21GEM CSCMotherboardME3141RPC

Public Member Functions

void clear ()
 
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboard ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs ()
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs ()
 
void run (const std::vector< int > w_time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES], const std::vector< int > hs_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const std::vector< int > ds_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
virtual ~CSCMotherboard ()=default
 

Public Attributes

std::unique_ptr< CSCAnodeLCTProcessoralct
 
std::unique_ptr< CSCCathodeLCTProcessorclct
 

Protected Types

enum  { MAX_LCT_BINS = 16 }
 

Protected Member Functions

void checkConfigParameters ()
 
CSCCorrelatedLCTDigi constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
 
void correlateLCTs (CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT)
 
void dumpConfigParams () const
 
unsigned int encodePattern (const int ptn, const int highPt)
 
unsigned int findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
 
void testLCT ()
 

Static Protected Member Functions

static bool sortByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 

Protected Attributes

unsigned int alct_trig_enable
 
unsigned int clct_trig_enable
 
bool drop_used_alcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [MAX_LCT_BINS]
 
int infoV
 
bool isMTCC
 
bool isSLHC
 
bool isTMB07
 
int lct_central_bx
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
bool readout_earliest_2
 
CSCCorrelatedLCTDigi secondLCT [MAX_LCT_BINS]
 
const unsigned theEndcap
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
unsigned int tmb_l1a_window_size
 

Static Protected Attributes

static const unsigned int def_alct_trig_enable = 0
 
static const unsigned int def_clct_trig_enable = 0
 
static const unsigned int def_match_trig_enable = 1
 
static const unsigned int def_match_trig_window_size = 7
 
static const unsigned int def_mpc_block_me1a = 1
 
static const unsigned int def_tmb_l1a_window_size = 7
 

Detailed Description

Correlates anode and cathode LCTs from the same chamber.

When the Trigger MotherBoard (TMB) is instantiated it instantiates an ALCT and CLCT board. The MotherBoard takes up to two LCTs from each anode and cathode LCT card and combines them into a single Correlated LCT. The output is up to two Correlated LCTs.

It can be run in either a test mode, where the arguments are a collection of wire times and arrays of halfstrip and distrip times, or for general use, with wire digi and comparator digi collections as arguments. In the latter mode, the wire & strip info is passed on the LCTProcessors, where it is decoded and converted into a convenient form. After running the anode and cathode LCTProcessors, TMB correlates the anode and cathode LCTs. At present, it simply matches the best CLCT with the best ALCT; perhaps a better algorithm will be determined in the future. The MotherBoard then determines a few more numbers (such as quality and pattern) from the ALCT and CLCT information, and constructs two correlated LCT "digis".

Author
Benn Tannenbaum 28 August 1999 benn@.nosp@m.phys.nosp@m.ics.u.nosp@m.cla..nosp@m.edu

Based on code by Nick Wisniewski (nw@it.nosp@m.s.ca.nosp@m.ltech.nosp@m..edu) and a framework by Darin Acosta (acost.nosp@m.a@ph.nosp@m.ys.uf.nosp@m.l.ed.nosp@m.u).

Numerous later improvements by Jason Mumford and Slava Valuev (see cvs in ORCA). Porting from ORCA by S. Valuev (Slava.nosp@m..Val.nosp@m.uev@c.nosp@m.ern..nosp@m.ch), May 2006.

Definition at line 41 of file CSCMotherboard.h.

Member Enumeration Documentation

anonymous enum
protected

Maximum number of time bins.

Enumerator
MAX_LCT_BINS 

Definition at line 131 of file CSCMotherboard.h.

Constructor & Destructor Documentation

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

Normal constructor.

Definition at line 49 of file CSCMotherboard.cc.

References alct, alct_trig_enable, checkConfigParameters(), clct, clct_trig_enable, drop_used_alcts, dumpConfigParams(), early_tbins, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), infoV, isMTCC, isSLHC, isTMB07, lct_central_bx, match_trig_enable, match_trig_window_size, mpc_block_me1a, or, readout_earliest_2, CSCTriggerNumbering::ringFromTriggerLabels(), theRing, theStation, theTrigChamber, and tmb_l1a_window_size.

52  :
54  theSubsector(subsector), theTrigChamber(chamber) {
55 
57 
58  // Normal constructor. -JM
59  // Pass ALCT, CLCT, and common parameters on to ALCT and CLCT processors.
60  static bool config_dumped = false;
61 
62  // Some configuration parameters and some details of the emulator
63  // algorithms depend on whether we want to emulate the trigger logic
64  // used in TB/MTCC or its idealized version (the latter was used in MC
65  // studies since early ORCA days until (and including) CMSSW_2_1_X).
66  edm::ParameterSet commonParams =
67  conf.getParameter<edm::ParameterSet>("commonParam");
68  isMTCC = commonParams.getParameter<bool>("isMTCC");
69 
70  // Switch for a new (2007) version of the TMB firmware.
71  isTMB07 = commonParams.getParameter<bool>("isTMB07");
72 
73  // is it (non-upgrade algorithm) run along with upgrade one?
74  isSLHC = commonParams.getParameter<bool>("isSLHC");
75 
76  // Choose the appropriate set of configuration parameters depending on
77  // isTMB07 and isMTCC flags.
78  // Starting with CMSSW_3_1_X, these settings are overwritten by the
79  // ones delivered by the EventSetup mechanism.
80  edm::ParameterSet alctParams, clctParams;
81  if (isTMB07) {
82  alctParams = conf.getParameter<edm::ParameterSet>("alctParam07");
83  clctParams = conf.getParameter<edm::ParameterSet>("clctParam07");
84  }
85  else if (isMTCC) {
86  alctParams = conf.getParameter<edm::ParameterSet>("alctParamMTCC");
87  clctParams = conf.getParameter<edm::ParameterSet>("clctParamMTCC");
88  }
89  else {
90  alctParams = conf.getParameter<edm::ParameterSet>("alctParamOldMC");
91  clctParams = conf.getParameter<edm::ParameterSet>("clctParamOldMC");
92  }
93 
94  // Motherboard parameters:
95  edm::ParameterSet tmbParams = conf.getParameter<edm::ParameterSet>("tmbParam");
96  const edm::ParameterSet me11tmbGemParams(conf.existsAs<edm::ParameterSet>("me11tmbSLHCGEM")?
97  conf.getParameter<edm::ParameterSet>("me11tmbSLHCGEM"):edm::ParameterSet());
98  const edm::ParameterSet me21tmbGemParams(conf.existsAs<edm::ParameterSet>("me21tmbSLHCGEM")?
99  conf.getParameter<edm::ParameterSet>("me21tmbSLHCGEM"):edm::ParameterSet());
100  const edm::ParameterSet me3141tmbRpcParams(conf.existsAs<edm::ParameterSet>("me3141tmbSLHCRPC")?
101  conf.getParameter<edm::ParameterSet>("me3141tmbSLHCRPC"):edm::ParameterSet());
102 
103  const bool runME11ILT(commonParams.existsAs<bool>("runME11ILT")?commonParams.getParameter<bool>("runME11ILT"):false);
104  const bool runME21ILT(commonParams.existsAs<bool>("runME21ILT")?commonParams.getParameter<bool>("runME21ILT"):false);
105  const bool runME3141ILT(commonParams.existsAs<bool>("runME3141ILT")?commonParams.getParameter<bool>("runME3141ILT"):false);
106 
107  // run upgrade TMBs for all MEX/1 stations
108  if (isSLHC and theRing == 1){
109  if (theStation == 1) {
110  tmbParams = conf.getParameter<edm::ParameterSet>("tmbSLHC");
111  alctParams = conf.getParameter<edm::ParameterSet>("alctSLHC");
112  clctParams = conf.getParameter<edm::ParameterSet>("clctSLHC");
113  if (runME11ILT) {
114  tmbParams = me11tmbGemParams;
115  }
116  }
117  else if (theStation == 2 and runME21ILT) {
118  tmbParams = me21tmbGemParams;
119  alctParams = conf.getParameter<edm::ParameterSet>("alctSLHCME21");
120  clctParams = conf.getParameter<edm::ParameterSet>("clctSLHCME21");
121  }
122  else if ((theStation == 3 or theStation == 4) and runME3141ILT) {
123  tmbParams = me3141tmbRpcParams;
124  alctParams = conf.getParameter<edm::ParameterSet>("alctSLHCME3141");
125  clctParams = conf.getParameter<edm::ParameterSet>("clctSLHCME3141");
126  }
127  }
128 
129  mpc_block_me1a = tmbParams.getParameter<unsigned int>("mpcBlockMe1a");
130  alct_trig_enable = tmbParams.getParameter<unsigned int>("alctTrigEnable");
131  clct_trig_enable = tmbParams.getParameter<unsigned int>("clctTrigEnable");
132  match_trig_enable = tmbParams.getParameter<unsigned int>("matchTrigEnable");
134  tmbParams.getParameter<unsigned int>("matchTrigWindowSize");
135  tmb_l1a_window_size = // Common to CLCT and TMB
136  tmbParams.getParameter<unsigned int>("tmbL1aWindowSize");
137 
138  lct_central_bx = 6;
139 
140  // configuration handle for number of early time bins
141  early_tbins = tmbParams.getParameter<int>("tmbEarlyTbins");
142 
143  // whether to not reuse ALCTs that were used by previous matching CLCTs
144  drop_used_alcts = tmbParams.getParameter<bool>("tmbDropUsedAlcts");
145 
146  // whether to readout only the earliest two LCTs in readout window
147  readout_earliest_2 = tmbParams.getParameter<bool>("tmbReadoutEarliest2");
148 
149  infoV = tmbParams.getParameter<int>("verbosity");
150 
151  alct.reset( new CSCAnodeLCTProcessor(endcap, station, sector, subsector, chamber, alctParams, commonParams) );
152  clct.reset( new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams, tmbParams) );
153 
154  //if (theStation==1 && CSCTriggerNumbering::ringFromTriggerLabels(theStation, theTrigChamber)==2) infoV = 3;
155 
156  // Check and print configuration parameters.
158  if (infoV > 0 && !config_dumped) {
160  config_dumped = true;
161  }
162 
163  // test to make sure that what goes into a correlated LCT is also what
164  // comes back out.
165  // testLCT();
166 }
T getParameter(std::string const &) const
const unsigned theSector
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
unsigned int clct_trig_enable
unsigned int match_trig_window_size
const unsigned theTrigChamber
const unsigned theEndcap
static int ringFromTriggerLabels(int station, int triggerCSCID)
unsigned int mpc_block_me1a
const unsigned theStation
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
const unsigned theSubsector
unsigned int tmb_l1a_window_size
void checkConfigParameters()
unsigned int match_trig_enable
unsigned int alct_trig_enable
std::unique_ptr< CSCAnodeLCTProcessor > alct
void dumpConfigParams() const
std::unique_ptr< CSCCathodeLCTProcessor > clct
unsigned theRing
CSCMotherboard::CSCMotherboard ( )

Constructor for use during testing.

Definition at line 168 of file CSCMotherboard.cc.

References alct, alct_trig_enable, checkConfigParameters(), clct, clct_trig_enable, def_alct_trig_enable, def_clct_trig_enable, def_match_trig_enable, def_match_trig_window_size, def_mpc_block_me1a, def_tmb_l1a_window_size, dumpConfigParams(), early_tbins, infoV, isMTCC, isTMB07, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.

168  :
169  theEndcap(1), theStation(1), theSector(1),
171  // Constructor used only for testing. -JM
172  static bool config_dumped = false;
173 
174  isMTCC = false;
175  isTMB07 = true;
176 
177  early_tbins = 4;
178 
179  alct.reset( new CSCAnodeLCTProcessor() );
180  clct.reset( new CSCCathodeLCTProcessor() );
187 
188  infoV = 2;
189 
190  // Check and print configuration parameters.
192  if (infoV > 0 && !config_dumped) {
194  config_dumped = true;
195  }
196 }
const unsigned theSector
unsigned int clct_trig_enable
unsigned int match_trig_window_size
const unsigned theTrigChamber
static const unsigned int def_alct_trig_enable
const unsigned theEndcap
static const unsigned int def_mpc_block_me1a
static const unsigned int def_clct_trig_enable
unsigned int mpc_block_me1a
const unsigned theStation
static const unsigned int def_tmb_l1a_window_size
const unsigned theSubsector
unsigned int tmb_l1a_window_size
void checkConfigParameters()
unsigned int match_trig_enable
static const unsigned int def_match_trig_window_size
unsigned int alct_trig_enable
std::unique_ptr< CSCAnodeLCTProcessor > alct
void dumpConfigParams() const
std::unique_ptr< CSCCathodeLCTProcessor > clct
static const unsigned int def_match_trig_enable
virtual CSCMotherboard::~CSCMotherboard ( )
virtualdefault

Default destructor.

Member Function Documentation

void CSCMotherboard::checkConfigParameters ( )
protected

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

Definition at line 231 of file CSCMotherboard.cc.

References alct_trig_enable, clct_trig_enable, def_alct_trig_enable, def_clct_trig_enable, def_match_trig_enable, def_match_trig_window_size, def_mpc_block_me1a, def_tmb_l1a_window_size, infoV, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.

Referenced by CSCMotherboard(), and setConfigParameters().

231  {
232  // Make sure that the parameter values are within the allowed range.
233 
234  // Max expected values.
235  static const unsigned int max_mpc_block_me1a = 1 << 1;
236  static const unsigned int max_alct_trig_enable = 1 << 1;
237  static const unsigned int max_clct_trig_enable = 1 << 1;
238  static const unsigned int max_match_trig_enable = 1 << 1;
239  static const unsigned int max_match_trig_window_size = 1 << 4;
240  static const unsigned int max_tmb_l1a_window_size = 1 << 4;
241 
242  // Checks.
243  if (mpc_block_me1a >= max_mpc_block_me1a) {
244  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
245  << "+++ Value of mpc_block_me1a, " << mpc_block_me1a
246  << ", exceeds max allowed, " << max_mpc_block_me1a-1 << " +++\n"
247  << "+++ Try to proceed with the default value, mpc_block_me1a="
248  << def_mpc_block_me1a << " +++\n";
250  }
251  if (alct_trig_enable >= max_alct_trig_enable) {
252  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
253  << "+++ Value of alct_trig_enable, " << alct_trig_enable
254  << ", exceeds max allowed, " << max_alct_trig_enable-1 << " +++\n"
255  << "+++ Try to proceed with the default value, alct_trig_enable="
256  << def_alct_trig_enable << " +++\n";
258  }
259  if (clct_trig_enable >= max_clct_trig_enable) {
260  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
261  << "+++ Value of clct_trig_enable, " << clct_trig_enable
262  << ", exceeds max allowed, " << max_clct_trig_enable-1 << " +++\n"
263  << "+++ Try to proceed with the default value, clct_trig_enable="
264  << def_clct_trig_enable << " +++\n";
266  }
267  if (match_trig_enable >= max_match_trig_enable) {
268  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
269  << "+++ Value of match_trig_enable, " << match_trig_enable
270  << ", exceeds max allowed, " << max_match_trig_enable-1 << " +++\n"
271  << "+++ Try to proceed with the default value, match_trig_enable="
272  << def_match_trig_enable << " +++\n";
274  }
275  if (match_trig_window_size >= max_match_trig_window_size) {
276  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
277  << "+++ Value of match_trig_window_size, " << match_trig_window_size
278  << ", exceeds max allowed, " << max_match_trig_window_size-1 << " +++\n"
279  << "+++ Try to proceed with the default value, match_trig_window_size="
280  << def_match_trig_window_size << " +++\n";
282  }
283  if (tmb_l1a_window_size >= max_tmb_l1a_window_size) {
284  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError")
285  << "+++ Value of tmb_l1a_window_size, " << tmb_l1a_window_size
286  << ", exceeds max allowed, " << max_tmb_l1a_window_size-1 << " +++\n"
287  << "+++ Try to proceed with the default value, tmb_l1a_window_size="
288  << def_tmb_l1a_window_size << " +++\n";
290  }
291 }
unsigned int clct_trig_enable
unsigned int match_trig_window_size
static const unsigned int def_alct_trig_enable
static const unsigned int def_mpc_block_me1a
static const unsigned int def_clct_trig_enable
unsigned int mpc_block_me1a
static const unsigned int def_tmb_l1a_window_size
unsigned int tmb_l1a_window_size
unsigned int match_trig_enable
static const unsigned int def_match_trig_window_size
unsigned int alct_trig_enable
static const unsigned int def_match_trig_enable
void CSCMotherboard::clear ( void  )

Clears correlated LCT and passes clear signal on to cathode and anode LCT processors.

Definition at line 198 of file CSCMotherboard.cc.

References alct, clct, CSCCorrelatedLCTDigi::clear(), firstLCT, MAX_LCT_BINS, and secondLCT.

Referenced by CSCMotherboardME21GEM::clear(), CSCMotherboardME3141RPC::clear(), CSCMotherboardME11::clear(), CSCMotherboardME11GEM::clear(), and run().

198  {
199  if (alct) alct->clear();
200  if (clct) clct->clear();
201  for (int bx = 0; bx < MAX_LCT_BINS; bx++) {
202  firstLCT[bx].clear();
203  secondLCT[bx].clear();
204  }
205 }
CSCCorrelatedLCTDigi secondLCT[MAX_LCT_BINS]
CSCCorrelatedLCTDigi firstLCT[MAX_LCT_BINS]
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
CSCCorrelatedLCTDigi CSCMotherboard::constructLCTs ( const CSCALCTDigi aLCT,
const CSCCLCTDigi cLCT 
)
protected

Definition at line 596 of file CSCMotherboard.cc.

References encodePattern(), findQuality(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCCLCTDigi::getBX(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), CSCALCTDigi::isValid(), listBenchmarks::pattern, btvTracks_cfi::quality, and theTrigChamber.

Referenced by CSCMotherboardME11::correlateLCTs(), CSCMotherboardME11GEM::correlateLCTs(), and correlateLCTs().

597  {
598  // CLCT pattern number
599  unsigned int pattern = encodePattern(cLCT.getPattern(), cLCT.getStripType());
600 
601  // LCT quality number
602  unsigned int quality = findQuality(aLCT, cLCT);
603 
604  // Bunch crossing: get it from cathode LCT if anode LCT is not there.
605  int bx = aLCT.isValid() ? aLCT.getBX() : cLCT.getBX();
606 
607  // construct correlated LCT; temporarily assign track number of 0.
608  int trknmb = 0;
609  CSCCorrelatedLCTDigi thisLCT(trknmb, 1, quality, aLCT.getKeyWG(),
610  cLCT.getKeyStrip(), pattern, cLCT.getBend(),
611  bx, 0, 0, 0, theTrigChamber);
612  return thisLCT;
613 }
const unsigned theTrigChamber
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
unsigned int findQuality(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
int getStripType() const
return striptype
Definition: CSCCLCTDigi.h:39
int getBend() const
return bend
Definition: CSCCLCTDigi.h:42
int getBX() const
return BX
Definition: CSCCLCTDigi.h:51
unsigned int encodePattern(const int ptn, const int highPt)
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:48
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:36
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
void CSCMotherboard::correlateLCTs ( CSCALCTDigi  bestALCT,
CSCALCTDigi  secondALCT,
CSCCLCTDigi  bestCLCT,
CSCCLCTDigi  secondCLCT 
)
protected

Definition at line 541 of file CSCMotherboard.cc.

References alct_trig_enable, clct_trig_enable, constructLCTs(), firstLCT, CSCCorrelatedLCTDigi::getBX(), infoV, CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), match_trig_enable, MAX_LCT_BINS, secondLCT, and CSCCorrelatedLCTDigi::setTrknmb().

Referenced by run().

544  {
545 
546  bool anodeBestValid = bestALCT.isValid();
547  bool anodeSecondValid = secondALCT.isValid();
548  bool cathodeBestValid = bestCLCT.isValid();
549  bool cathodeSecondValid = secondCLCT.isValid();
550 
551  if (anodeBestValid && !anodeSecondValid) secondALCT = bestALCT;
552  if (!anodeBestValid && anodeSecondValid) bestALCT = secondALCT;
553  if (cathodeBestValid && !cathodeSecondValid) secondCLCT = bestCLCT;
554  if (!cathodeBestValid && cathodeSecondValid) bestCLCT = secondCLCT;
555 
556  // ALCT-CLCT matching conditions are defined by "trig_enable" configuration
557  // parameters.
558  if ((alct_trig_enable && bestALCT.isValid()) ||
559  (clct_trig_enable && bestCLCT.isValid()) ||
560  (match_trig_enable && bestALCT.isValid() && bestCLCT.isValid())) {
561  CSCCorrelatedLCTDigi lct = constructLCTs(bestALCT, bestCLCT);
562  int bx = lct.getBX();
563  if (bx >= 0 && bx < MAX_LCT_BINS) {
564  firstLCT[bx] = lct;
565  firstLCT[bx].setTrknmb(1);
566  }
567  else {
568  if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeLCT")
569  << "+++ Bx of first LCT candidate, " << bx
570  << ", is not within the allowed range, [0-" << MAX_LCT_BINS-1
571  << "); skipping it... +++\n";
572  }
573  }
574 
575  if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
576  ((alct_trig_enable && secondALCT.isValid()) ||
577  (clct_trig_enable && secondCLCT.isValid()) ||
578  (match_trig_enable && secondALCT.isValid() && secondCLCT.isValid()))) {
579  CSCCorrelatedLCTDigi lct = constructLCTs(secondALCT, secondCLCT);
580  int bx = lct.getBX();
581  if (bx >= 0 && bx < MAX_LCT_BINS) {
582  secondLCT[bx] = lct;
583  secondLCT[bx].setTrknmb(2);
584  }
585  else {
586  if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeLCT")
587  << "+++ Bx of second LCT candidate, " << bx
588  << ", is not within the allowed range, [0-" << MAX_LCT_BINS-1
589  << "); skipping it... +++\n";
590  }
591  }
592 }
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
unsigned int clct_trig_enable
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
CSCCorrelatedLCTDigi secondLCT[MAX_LCT_BINS]
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
unsigned int match_trig_enable
int getBX() const
return BX
CSCCorrelatedLCTDigi firstLCT[MAX_LCT_BINS]
unsigned int alct_trig_enable
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
void CSCMotherboard::dumpConfigParams ( ) const
protected

Dump TMB/MPC configuration parameters.

Definition at line 816 of file CSCMotherboard.cc.

References alct_trig_enable, clct_trig_enable, LogDebug, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.

Referenced by CSCMotherboard(), and setConfigParameters().

816  {
817  std::ostringstream strm;
818  strm << "\n";
819  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
820  strm << "+ TMB configuration parameters: +\n";
821  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
822  strm << " mpc_block_me1a [block/not block triggers which come from ME1/A] = "
823  << mpc_block_me1a << "\n";
824  strm << " alct_trig_enable [allow ALCT-only triggers] = "
825  << alct_trig_enable << "\n";
826  strm << " clct_trig_enable [allow CLCT-only triggers] = "
827  << clct_trig_enable << "\n";
828  strm << " match_trig_enable [allow matched ALCT-CLCT triggers] = "
829  << match_trig_enable << "\n";
830  strm << " match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = "
831  << match_trig_window_size << "\n";
832  strm << " tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = "
833  << tmb_l1a_window_size << "\n";
834  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
835  LogDebug("CSCMotherboard") << strm.str();
836 }
#define LogDebug(id)
unsigned int clct_trig_enable
unsigned int match_trig_window_size
unsigned int mpc_block_me1a
unsigned int tmb_l1a_window_size
unsigned int match_trig_enable
unsigned int alct_trig_enable
unsigned int CSCMotherboard::encodePattern ( const int  ptn,
const int  highPt 
)
protected

Definition at line 617 of file CSCMotherboard.cc.

References funct::abs(), isTMB07, and listBenchmarks::pattern.

Referenced by constructLCTs(), CSCMotherboardME21GEM::constructLCTsGEM(), CSCMotherboardME11GEM::constructLCTsGEM(), CSCMotherboardME3141RPC::constructLCTsRPC(), and testLCT().

618  {
619  const int kPatternBitWidth = 4;
620  unsigned int pattern;
621 
622  if (!isTMB07) {
623  // Cathode pattern number is a kPatternBitWidth-1 bit word.
624  pattern = (abs(ptn) & ((1<<(kPatternBitWidth-1))-1));
625 
626  // The pattern has the MSB (4th bit in the default version) set if it
627  // consists of half-strips.
628  if (stripType) {
629  pattern = pattern | (1<<(kPatternBitWidth-1));
630  }
631  }
632  else {
633  // In the TMB07 firmware, LCT pattern is just a 4-bit CLCT pattern.
634  pattern = (abs(ptn) & ((1<<kPatternBitWidth)-1));
635  }
636 
637  return pattern;
638 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int CSCMotherboard::findQuality ( const CSCALCTDigi aLCT,
const CSCCLCTDigi cLCT 
)
protected

Definition at line 643 of file CSCMotherboard.cc.

References CSCALCTDigi::getAccelerator(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuality(), CSCALCTDigi::getQuality(), CSCCLCTDigi::getStripType(), infoV, isTMB07, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), PFRecoTauDiscriminationByIsolation_cfi::offset, listBenchmarks::pattern, and btvTracks_cfi::quality.

Referenced by constructLCTs(), and testLCT().

644  {
645  unsigned int quality = 0;
646 
647  if (!isTMB07) {
648  bool isDistrip = (cLCT.getStripType() == 0);
649 
650  if (aLCT.isValid() && !(cLCT.isValid())) { // no CLCT
651  if (aLCT.getAccelerator()) {quality = 1;}
652  else {quality = 3;}
653  }
654  else if (!(aLCT.isValid()) && cLCT.isValid()) { // no ALCT
655  if (isDistrip) {quality = 4;}
656  else {quality = 5;}
657  }
658  else if (aLCT.isValid() && cLCT.isValid()) { // both ALCT and CLCT
659  if (aLCT.getAccelerator()) {quality = 2;} // accelerator muon
660  else { // collision muon
661  // CLCT quality is, in fact, the number of layers hit, so subtract 3
662  // to get quality analogous to ALCT one.
663  int sumQual = aLCT.getQuality() + (cLCT.getQuality()-3);
664  if (sumQual < 1 || sumQual > 6) {
665  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
666  << "+++ findQuality: sumQual = " << sumQual << "+++ \n";
667  }
668  if (isDistrip) { // distrip pattern
669  if (sumQual == 2) {quality = 6;}
670  else if (sumQual == 3) {quality = 7;}
671  else if (sumQual == 4) {quality = 8;}
672  else if (sumQual == 5) {quality = 9;}
673  else if (sumQual == 6) {quality = 10;}
674  }
675  else { // halfstrip pattern
676  if (sumQual == 2) {quality = 11;}
677  else if (sumQual == 3) {quality = 12;}
678  else if (sumQual == 4) {quality = 13;}
679  else if (sumQual == 5) {quality = 14;}
680  else if (sumQual == 6) {quality = 15;}
681  }
682  }
683  }
684  }
685 #ifdef OLD
686  else {
687  // Temporary definition, used until July 2008.
688  // First if statement is fictitious, just to help the CSC TF emulator
689  // handle such cases (one needs to make sure they will be accounted for
690  // in the new quality definition.
691  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
692  if (aLCT.isValid() && !(cLCT.isValid())) quality = 1; // no CLCT
693  else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT
694  else quality = 0; // both absent; should never happen.
695  }
696  else {
697  // Sum of ALCT and CLCT quality bits. CLCT quality is, in fact, the
698  // number of layers hit, so subtract 3 to put it to the same footing as
699  // the ALCT quality.
700  int sumQual = aLCT.getQuality() + (cLCT.getQuality()-3);
701  if (sumQual < 1 || sumQual > 6) {
702  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
703  << "+++ findQuality: Unexpected sumQual = " << sumQual << "+++\n";
704  }
705 
706  // LCT quality is basically the sum of ALCT and CLCT qualities, but split
707  // in two groups depending on the CLCT pattern id (higher quality for
708  // straighter patterns).
709  int offset = 0;
710  if (cLCT.getPattern() <= 7) offset = 4;
711  else offset = 9;
712  quality = offset + sumQual;
713  }
714  }
715 #endif
716  else {
717  // 2008 definition.
718  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
719  if (aLCT.isValid() && !(cLCT.isValid())) quality = 1; // no CLCT
720  else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT
721  else quality = 0; // both absent; should never happen.
722  }
723  else {
724  int pattern = cLCT.getPattern();
725  if (pattern == 1) quality = 3; // layer-trigger in CLCT
726  else {
727  // CLCT quality is the number of layers hit minus 3.
728  // CLCT quality is the number of layers hit.
729  bool a4 = (aLCT.getQuality() >= 1);
730  bool c4 = (cLCT.getQuality() >= 4);
731  // quality = 4; "reserved for low-quality muons in future"
732  if (!a4 && !c4) quality = 5; // marginal anode and cathode
733  else if ( a4 && !c4) quality = 6; // HQ anode, but marginal cathode
734  else if (!a4 && c4) quality = 7; // HQ cathode, but marginal anode
735  else if ( a4 && c4) {
736  if (aLCT.getAccelerator()) quality = 8; // HQ muon, but accel ALCT
737  else {
738  // quality = 9; "reserved for HQ muons with future patterns
739  // quality = 10; "reserved for HQ muons with future patterns
740  if (pattern == 2 || pattern == 3) quality = 11;
741  else if (pattern == 4 || pattern == 5) quality = 12;
742  else if (pattern == 6 || pattern == 7) quality = 13;
743  else if (pattern == 8 || pattern == 9) quality = 14;
744  else if (pattern == 10) quality = 15;
745  else {
746  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
747  << "+++ findQuality: Unexpected CLCT pattern id = "
748  << pattern << "+++\n";
749  }
750  }
751  }
752  }
753  }
754  }
755  return quality;
756 }
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:33
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
int getStripType() const
return striptype
Definition: CSCCLCTDigi.h:39
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
int getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:33
int getAccelerator() const
Definition: CSCALCTDigi.h:37
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:36
std::vector< CSCCorrelatedLCTDigi > CSCMotherboard::getLCTs ( )

Returns vector of all found correlated LCTs, if any.

Definition at line 522 of file CSCMotherboard.cc.

References firstLCT, MAX_LCT_BINS, mpc_block_me1a, CSCTriggerNumbering::ringFromTriggerLabels(), secondLCT, theStation, and theTrigChamber.

Referenced by readoutLCTs().

522  {
523  std::vector<CSCCorrelatedLCTDigi> tmpV;
524 
525  bool me11 = (theStation == 1 &&
527  theTrigChamber)==1);
528 
529  // Do not report LCTs found in ME1/A if mpc_block_me1/a is set.
530  for (int bx = 0; bx < MAX_LCT_BINS; bx++) {
531  if (firstLCT[bx].isValid())
532  if (!mpc_block_me1a || (!me11 || firstLCT[bx].getStrip() <= 127))
533  tmpV.push_back(firstLCT[bx]);
534  if (secondLCT[bx].isValid())
535  if (!mpc_block_me1a || (!me11 || secondLCT[bx].getStrip() <= 127))
536  tmpV.push_back(secondLCT[bx]);
537  }
538  return tmpV;
539 }
const unsigned theTrigChamber
static int ringFromTriggerLabels(int station, int triggerCSCID)
unsigned int mpc_block_me1a
const unsigned theStation
CSCCorrelatedLCTDigi secondLCT[MAX_LCT_BINS]
CSCCorrelatedLCTDigi firstLCT[MAX_LCT_BINS]
std::vector< CSCCorrelatedLCTDigi > CSCMotherboard::readoutLCTs ( )

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

Definition at line 446 of file CSCMotherboard.cc.

References early_tbins, getLCTs(), infoV, LogDebug, MAX_LCT_BINS, readout_earliest_2, and tmb_l1a_window_size.

Referenced by CSCTriggerPrimitivesBuilder::build(), CSCMotherboardME11::readoutLCTs1a(), CSCMotherboardME11GEM::readoutLCTs1a(), CSCMotherboardME11::readoutLCTs1b(), and CSCMotherboardME11GEM::readoutLCTs1b().

446  {
447  std::vector<CSCCorrelatedLCTDigi> tmpV;
448 
449  // The start time of the L1A*LCT coincidence window should be related
450  // to the fifo_pretrig parameter, but I am not completely sure how.
451  // Just choose it such that the window is centered at bx=7. This may
452  // need further tweaking if the value of tmb_l1a_window_size changes.
453  //static int early_tbins = 4;
454 
455  // Empirical correction to match 2009 collision data (firmware change?)
456  static int lct_bins = tmb_l1a_window_size;
457  static int late_tbins = early_tbins + lct_bins;
458 
459  static int ifois = 0;
460  if (ifois == 0) {
461  if (infoV >= 0 && early_tbins < 0) {
462  edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
463  << "+++ early_tbins = " << early_tbins
464  << "; in-time LCTs are not getting read-out!!! +++" << "\n";
465  }
466 
467  if (late_tbins > MAX_LCT_BINS-1) {
468  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
469  << "+++ Allowed range of time bins, [0-" << late_tbins
470  << "] exceeds max allowed, " << MAX_LCT_BINS-1 << " +++\n"
471  << "+++ Set late_tbins to max allowed +++\n";
472  late_tbins = MAX_LCT_BINS-1;
473  }
474  ifois = 1;
475  }
476 
477  // Start from the vector of all found correlated LCTs and select
478  // those within the LCT*L1A coincidence window.
479  int bx_readout = -1;
480  std::vector<CSCCorrelatedLCTDigi> all_lcts = getLCTs();
481  for (std::vector <CSCCorrelatedLCTDigi>::const_iterator plct =
482  all_lcts.begin(); plct != all_lcts.end(); plct++) {
483  if (!plct->isValid()) continue;
484 
485  int bx = (*plct).getBX();
486  // Skip LCTs found too early relative to L1Accept.
487  if (bx <= early_tbins) {
488  if (infoV > 1) LogDebug("CSCMotherboard")
489  << " Do not report correlated LCT on key halfstrip "
490  << plct->getStrip() << " and key wire " << plct->getKeyWG()
491  << ": found at bx " << bx << ", whereas the earliest allowed bx is "
492  << early_tbins+1;
493  continue;
494  }
495 
496  // Skip LCTs found too late relative to L1Accept.
497  if (bx > late_tbins) {
498  if (infoV > 1) LogDebug("CSCMotherboard")
499  << " Do not report correlated LCT on key halfstrip "
500  << plct->getStrip() << " and key wire " << plct->getKeyWG()
501  << ": found at bx " << bx << ", whereas the latest allowed bx is "
502  << late_tbins;
503  continue;
504  }
505 
506  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
507  // in digi->raw step, LCTs have to be packed into the TMB header, and
508  // currently there is room just for two.
509  if (readout_earliest_2) {
510  if (bx_readout == -1 || bx == bx_readout) {
511  tmpV.push_back(*plct);
512  if (bx_readout == -1) bx_readout = bx;
513  }
514  }
515  // if readout_earliest_2 == false, save all LCTs
516  else tmpV.push_back(*plct);
517  }
518  return tmpV;
519 }
#define LogDebug(id)
std::vector< CSCCorrelatedLCTDigi > getLCTs()
unsigned int tmb_l1a_window_size
void CSCMotherboard::run ( const std::vector< int >  w_time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES],
const std::vector< int >  hs_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const std::vector< int >  ds_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS] 
)

Test version of run function.

Definition at line 293 of file CSCMotherboard.cc.

References alct, clct, clear(), correlateLCTs(), isSLHC, match_trig_window_size, CSCAnodeLCTProcessor::MAX_ALCT_BINS, and CSCCathodeLCTProcessor::MAX_CLCT_BINS.

Referenced by CSCTriggerPrimitivesBuilder::build().

296  {
297  // Debug version. -JM
298  clear();
299  alct->run(w_times); // run anode LCT
300  clct->run(hs_times, ds_times); // run cathodeLCT
301 
302  int bx_alct_matched = 0;
303  for (int bx_clct = 0; bx_clct < CSCCathodeLCTProcessor::MAX_CLCT_BINS;
304  bx_clct++) {
305  if (clct->bestCLCT[bx_clct].isValid()) {
306  bool is_matched = false;
307  int bx_alct_start = bx_clct - match_trig_window_size/2;
308  int bx_alct_stop = bx_clct + match_trig_window_size/2;
309  // Empirical correction to match 2009 collision data (firmware change?)
310  if (!isSLHC) bx_alct_stop += match_trig_window_size%2;
311 
312  for (int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
313  if (bx_alct < 0 || bx_alct >= CSCAnodeLCTProcessor::MAX_ALCT_BINS)
314  continue;
315  if (alct->bestALCT[bx_alct].isValid()) {
316  correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
317  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]);
318  is_matched = true;
319  bx_alct_matched = bx_alct;
320  break;
321  }
322  }
323  // No ALCT within the match time interval found: report CLCT-only LCT
324  // (use dummy ALCTs).
325  if (!is_matched) {
326  correlateLCTs(alct->bestALCT[bx_clct], alct->secondALCT[bx_clct],
327  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]);
328  }
329  }
330  // No valid CLCTs; attempt to make ALCT-only LCT (use dummy CLCTs).
331  else {
332  int bx_alct = bx_clct - match_trig_window_size/2;
333  if (bx_alct >= 0 && bx_alct > bx_alct_matched) {
334  if (alct->bestALCT[bx_alct].isValid()) {
335  correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
336  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]);
337  }
338  }
339  }
340  }
341 }
unsigned int match_trig_window_size
void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT)
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
void CSCMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc 
)

Run function for normal usage. Runs cathode and anode LCT processors, takes results and correlates into CorrelatedLCT.

Definition at line 344 of file CSCMotherboard.cc.

References a, alct, clct, clear(), correlateLCTs(), drop_used_alcts, firstLCT, infoV, isSLHC, LogDebug, LogTrace, match_trig_window_size, CSCAnodeLCTProcessor::MAX_ALCT_BINS, CSCCathodeLCTProcessor::MAX_CLCT_BINS, MAX_LCT_BINS, and secondLCT.

345  {
346  clear();
347  if (alct && clct) {
348  {
349  std::vector<CSCALCTDigi> alctV = alct->run(wiredc); // run anodeLCT
350  }
351  {
352  std::vector<CSCCLCTDigi> clctV = clct->run(compdc); // run cathodeLCT
353  }
354 
355  int used_alct_mask[20];
356  for (int a=0;a<20;++a) used_alct_mask[a]=0;
357 
358  int bx_alct_matched = 0; // bx of last matched ALCT
359  for (int bx_clct = 0; bx_clct < CSCCathodeLCTProcessor::MAX_CLCT_BINS;
360  bx_clct++) {
361  // There should be at least one valid ALCT or CLCT for a
362  // correlated LCT to be formed. Decision on whether to reject
363  // non-complete LCTs (and if yes of which type) is made further
364  // upstream.
365  if (clct->bestCLCT[bx_clct].isValid()) {
366  // Look for ALCTs within the match-time window. The window is
367  // centered at the CLCT bx; therefore, we make an assumption
368  // that anode and cathode hits are perfectly synchronized. This
369  // is always true for MC, but only an approximation when the
370  // data is analyzed (which works fairly good as long as wide
371  // windows are used). To get rid of this assumption, one would
372  // need to access "full BX" words, which are not readily
373  // available.
374  bool is_matched = false;
375  int bx_alct_start = bx_clct - match_trig_window_size/2;
376  int bx_alct_stop = bx_clct + match_trig_window_size/2;
377  // Empirical correction to match 2009 collision data (firmware change?)
378  // (but don't do it for SLHC case, assume it would not be there)
379  if (!isSLHC) bx_alct_stop += match_trig_window_size%2;
380 
381  for (int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
382  if (bx_alct < 0 || bx_alct >= CSCAnodeLCTProcessor::MAX_ALCT_BINS)
383  continue;
384  // default: do not reuse ALCTs that were used with previous CLCTs
385  if (drop_used_alcts && used_alct_mask[bx_alct]) continue;
386  if (alct->bestALCT[bx_alct].isValid()) {
387  if (infoV > 1) LogTrace("CSCMotherboard")
388  << "Successful ALCT-CLCT match: bx_clct = " << bx_clct
389  << "; match window: [" << bx_alct_start << "; " << bx_alct_stop
390  << "]; bx_alct = " << bx_alct;
391  correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
392  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]);
393  used_alct_mask[bx_alct] += 1;
394  is_matched = true;
395  bx_alct_matched = bx_alct;
396  break;
397  }
398  }
399  // No ALCT within the match time interval found: report CLCT-only LCT
400  // (use dummy ALCTs).
401  if (!is_matched) {
402  if (infoV > 1) LogTrace("CSCMotherboard")
403  << "Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = "
404  << bx_clct << "; match window: [" << bx_alct_start
405  << "; " << bx_alct_stop << "]";
406  correlateLCTs(alct->bestALCT[bx_clct], alct->secondALCT[bx_clct],
407  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]);
408  }
409  }
410  // No valid CLCTs; attempt to make ALCT-only LCT. Use only ALCTs
411  // which have zeroth chance to be matched at later cathode times.
412  // (I am not entirely sure this perfectly matches the firmware logic.)
413  // Use dummy CLCTs.
414  else {
415  int bx_alct = bx_clct - match_trig_window_size/2;
416  if (bx_alct >= 0 && bx_alct > bx_alct_matched) {
417  if (alct->bestALCT[bx_alct].isValid()) {
418  if (infoV > 1) LogTrace("CSCMotherboard")
419  << "Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = "
420  << bx_alct;
421  correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
422  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]);
423  }
424  }
425  }
426  }
427 
428  if (infoV > 0) {
429  for (int bx = 0; bx < MAX_LCT_BINS; bx++) {
430  if (firstLCT[bx].isValid())
431  LogDebug("CSCMotherboard") << firstLCT[bx];
432  if (secondLCT[bx].isValid())
433  LogDebug("CSCMotherboard") << secondLCT[bx];
434  }
435  }
436  }
437  else {
438  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
439  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
440  }
441 }
#define LogDebug(id)
unsigned int match_trig_window_size
void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT)
CSCCorrelatedLCTDigi secondLCT[MAX_LCT_BINS]
#define LogTrace(id)
CSCCorrelatedLCTDigi firstLCT[MAX_LCT_BINS]
std::unique_ptr< CSCAnodeLCTProcessor > alct
double a
Definition: hdecay.h:121
std::unique_ptr< CSCCathodeLCTProcessor > clct
void CSCMotherboard::setConfigParameters ( const CSCDBL1TPParameters conf)

Set configuration parameters obtained via EventSetup mechanism.

Definition at line 208 of file CSCMotherboard.cc.

References alct, alct_trig_enable, checkConfigParameters(), clct, clct_trig_enable, dumpConfigParams(), match_trig_enable, match_trig_window_size, mpc_block_me1a, tmb_l1a_window_size, CSCDBL1TPParameters::tmbAlctTrigEnable(), CSCDBL1TPParameters::tmbClctTrigEnable(), CSCDBL1TPParameters::tmbMatchTrigEnable(), CSCDBL1TPParameters::tmbMatchTrigWindowSize(), CSCDBL1TPParameters::tmbMpcBlockMe1a(), and CSCDBL1TPParameters::tmbTmbL1aWindowSize().

208  {
209  static bool config_dumped = false;
210 
211  // Config. parameters for the TMB itself.
218 
219  // Config. paramteres for ALCT and CLCT processors.
220  alct->setConfigParameters(conf);
221  clct->setConfigParameters(conf);
222 
223  // Check and print configuration parameters.
225  if (!config_dumped) {
227  config_dumped = true;
228  }
229 }
unsigned int clct_trig_enable
unsigned int match_trig_window_size
unsigned int tmbClctTrigEnable() const
unsigned int mpc_block_me1a
unsigned int tmbTmbL1aWindowSize() const
unsigned int tmbMatchTrigWindowSize() const
unsigned int tmbAlctTrigEnable() const
unsigned int tmb_l1a_window_size
void checkConfigParameters()
unsigned int match_trig_enable
unsigned int tmbMpcBlockMe1a() const
unsigned int alct_trig_enable
std::unique_ptr< CSCAnodeLCTProcessor > alct
void dumpConfigParams() const
std::unique_ptr< CSCCathodeLCTProcessor > clct
unsigned int tmbMatchTrigEnable() const
bool CSCMotherboard::sortByGEMDphi ( const CSCCorrelatedLCTDigi lct1,
const CSCCorrelatedLCTDigi lct2 
)
staticprotected

Definition at line 846 of file CSCMotherboard.cc.

Referenced by CSCMotherboardME11GEM::sortLCTsByGEMDPhi(), and CSCMotherboardME21GEM::sortLCTsByGEMDPhi().

847 {
848  // return lct1.getGEMDPhi() < lct2.getGEMDPhi();
849  return true;
850 }
bool CSCMotherboard::sortByQuality ( const CSCCorrelatedLCTDigi lct1,
const CSCCorrelatedLCTDigi lct2 
)
staticprotected

Definition at line 840 of file CSCMotherboard.cc.

References CSCCorrelatedLCTDigi::getQuality().

Referenced by CSCMotherboardME11GEM::sortLCTsByQuality(), CSCMotherboardME3141RPC::sortLCTsByQuality(), and CSCMotherboardME21GEM::sortLCTsByQuality().

841 {
842  return lct1.getQuality() > lct2.getQuality();
843 }
int getQuality() const
return the 4 bit Correlated LCT Quality
void CSCMotherboard::testLCT ( )
protected

Definition at line 758 of file CSCMotherboard.cc.

References encodePattern(), findQuality(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), LogTrace, listBenchmarks::pattern, btvTracks_cfi::quality, and digi_MixPreMix_cfi::strip.

758  {
759  unsigned int lctPattern, lctQuality;
760  for (int pattern = 0; pattern < 8; pattern++) {
761  for (int bend = 0; bend < 2; bend++) {
762  for (int cfeb = 0; cfeb < 5; cfeb++) {
763  for (int strip = 0; strip < 32; strip++) {
764  for (int bx = 0; bx < 7; bx++) {
765  for (int stripType = 0; stripType < 2; stripType++) {
766  for (int quality = 3; quality < 7; quality++) {
767  CSCCLCTDigi cLCT(1, quality, pattern, stripType, bend,
768  strip, cfeb, bx);
769  lctPattern = encodePattern(cLCT.getPattern(),
770  cLCT.getStripType());
771  for (int aQuality = 0; aQuality < 4; aQuality++) {
772  for (int wireGroup = 0; wireGroup < 120; wireGroup++) {
773  for (int abx = 0; abx < 7; abx++) {
774  CSCALCTDigi aLCT(1, aQuality, 0, 1, wireGroup, abx);
775  lctQuality = findQuality(aLCT, cLCT);
777  thisLCT(0, 1, lctQuality, aLCT.getKeyWG(),
778  cLCT.getKeyStrip(), lctPattern, cLCT.getBend(),
779  aLCT.getBX());
780  if (lctPattern != static_cast<unsigned int>(thisLCT.getPattern()) )
781  LogTrace("CSCMotherboard")
782  << "pattern mismatch: " << lctPattern
783  << " " << thisLCT.getPattern();
784  if (bend != thisLCT.getBend())
785  LogTrace("CSCMotherboard")
786  << "bend mismatch: " << bend
787  << " " << thisLCT.getBend();
788  int key_strip = 32*cfeb + strip;
789  if (key_strip != thisLCT.getStrip())
790  LogTrace("CSCMotherboard")
791  << "strip mismatch: " << key_strip
792  << " " << thisLCT.getStrip();
793  if (wireGroup != thisLCT.getKeyWG())
794  LogTrace("CSCMotherboard")
795  << "wire group mismatch: " << wireGroup
796  << " " << thisLCT.getKeyWG();
797  if (abx != thisLCT.getBX())
798  LogTrace("CSCMotherboard")
799  << "bx mismatch: " << abx << " " << thisLCT.getBX();
800  if (lctQuality != static_cast<unsigned int>(thisLCT.getQuality()))
801  LogTrace("CSCMotherboard")
802  << "quality mismatch: " << lctQuality
803  << " " << thisLCT.getQuality();
804  }
805  }
806  }
807  }
808  }
809  }
810  }
811  }
812  }
813  }
814 }
unsigned int findQuality(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
unsigned int encodePattern(const int ptn, const int highPt)
#define LogTrace(id)

Member Data Documentation

std::unique_ptr<CSCAnodeLCTProcessor> CSCMotherboard::alct
unsigned int CSCMotherboard::alct_trig_enable
protected
std::unique_ptr<CSCCathodeLCTProcessor> CSCMotherboard::clct
unsigned int CSCMotherboard::clct_trig_enable
protected
const unsigned int CSCMotherboard::def_alct_trig_enable = 0
staticprotected

Definition at line 126 of file CSCMotherboard.h.

Referenced by checkConfigParameters(), and CSCMotherboard().

const unsigned int CSCMotherboard::def_clct_trig_enable = 0
staticprotected

Definition at line 126 of file CSCMotherboard.h.

Referenced by checkConfigParameters(), and CSCMotherboard().

const unsigned int CSCMotherboard::def_match_trig_enable = 1
staticprotected

Definition at line 127 of file CSCMotherboard.h.

Referenced by checkConfigParameters(), and CSCMotherboard().

const unsigned int CSCMotherboard::def_match_trig_window_size = 7
staticprotected

Definition at line 127 of file CSCMotherboard.h.

Referenced by checkConfigParameters(), and CSCMotherboard().

const unsigned int CSCMotherboard::def_mpc_block_me1a = 1
staticprotected

Default values of configuration parameters.

Definition at line 125 of file CSCMotherboard.h.

Referenced by checkConfigParameters(), and CSCMotherboard().

const unsigned int CSCMotherboard::def_tmb_l1a_window_size = 7
staticprotected

Definition at line 128 of file CSCMotherboard.h.

Referenced by checkConfigParameters(), and CSCMotherboard().

bool CSCMotherboard::drop_used_alcts
protected

SLHC: whether to not reuse ALCTs that were used by previous matching CLCTs

Definition at line 116 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), CSCMotherboardME11::run(), and run().

int CSCMotherboard::early_tbins
protected

SLHC: separate handle for early time bins

Definition at line 119 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), CSCMotherboardME11::readoutLCTs(), readoutLCTs(), and CSCMotherboardME11GEM::readoutLCTs().

CSCCorrelatedLCTDigi CSCMotherboard::firstLCT[MAX_LCT_BINS]
protected

Container for first correlated LCT.

Definition at line 134 of file CSCMotherboard.h.

Referenced by clear(), correlateLCTs(), getLCTs(), and run().

int CSCMotherboard::infoV
protected
bool CSCMotherboard::isMTCC
protected

Flag for MTCC data.

Definition at line 99 of file CSCMotherboard.h.

Referenced by CSCMotherboard().

bool CSCMotherboard::isSLHC
protected
bool CSCMotherboard::isTMB07
protected
int CSCMotherboard::lct_central_bx
protected
unsigned int CSCMotherboard::match_trig_enable
protected
unsigned int CSCMotherboard::match_trig_window_size
protected
unsigned int CSCMotherboard::mpc_block_me1a
protected
bool CSCMotherboard::readout_earliest_2
protected

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

Definition at line 122 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), CSCMotherboardME11::readoutLCTs(), readoutLCTs(), and CSCMotherboardME11GEM::readoutLCTs().

CSCCorrelatedLCTDigi CSCMotherboard::secondLCT[MAX_LCT_BINS]
protected

Container for second correlated LCT.

Definition at line 137 of file CSCMotherboard.h.

Referenced by clear(), correlateLCTs(), getLCTs(), and run().

const unsigned CSCMotherboard::theEndcap
protected
unsigned CSCMotherboard::theRing
protected

Definition at line 96 of file CSCMotherboard.h.

Referenced by CSCMotherboard().

const unsigned CSCMotherboard::theSector
protected
const unsigned CSCMotherboard::theStation
protected
const unsigned CSCMotherboard::theSubsector
protected
const unsigned CSCMotherboard::theTrigChamber
protected
unsigned int CSCMotherboard::tmb_l1a_window_size
protected