CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Attributes
CSCMotherboardME3141 Class Reference

#include <CSCMotherboardME3141.h>

Inheritance diagram for CSCMotherboardME3141:
CSCUpgradeMotherboard CSCMotherboard

Public Types

enum  Default_values { DEFAULT_MATCHING_VALUE = -99 }
 

Public Member Functions

void clear ()
 
void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
 CSCMotherboardME3141 (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboardME3141 ()
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
 ~CSCMotherboardME3141 () override
 
- Public Member Functions inherited from CSCUpgradeMotherboard
template<class S >
bool compare (const S &p, const S &q) const
 
 CSCUpgradeMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCUpgradeMotherboard ()
 
void debugLUTs ()
 
template<class S >
void intersection (const S &d1, const S &d2, S &result) const
 
void setCSCGeometry (const CSCGeometry *g)
 
void setupGeometry ()
 
void sortLCTs (std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
 
 ~CSCUpgradeMotherboard () override
 
- Public Member Functions inherited from CSCMotherboard
void clear ()
 
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboard ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs () const
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const
 
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)
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCMotherboard ()=default
 

Public Attributes

std::vector< CSCCLCTDigiclctV
 
- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralct
 
std::unique_ptr< CSCCathodeLCTProcessorclct
 

Private Attributes

LCTContainer allLCTs
 

Additional Inherited Members

- Static Public Member Functions inherited from CSCUpgradeMotherboard
static bool sortLCTsByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortLCTsByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
- Protected Types inherited from CSCMotherboard
enum  LCT_Quality {
  INVALID = 0, NO_CLCT = 1, NO_ALCT = 2, CLCT_LAYER_TRIGGER = 3,
  LOW_QUALITY = 4, MARGINAL_ANODE_CATHODE = 5, HQ_ANODE_MARGINAL_CATHODE = 6, HQ_CATHODE_MARGINAL_ANODE = 7,
  HQ_ACCEL_ALCT = 8, HQ_RESERVED_1 = 9, HQ_RESERVED_2 = 10, HQ_PATTERN_2_3 = 11,
  HQ_PATTERN_4_5 = 12, HQ_PATTERN_6_7 = 13, HQ_PATTERN_8_9 = 14, HQ_PATTERN_10 = 15
}
 
- Protected Member Functions inherited from CSCMotherboard
void checkConfigParameters ()
 
CSCCorrelatedLCTDigi constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
 
void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, int type)
 
void dumpConfigParams () const
 
unsigned int encodePattern (const int ptn, const int highPt) const
 
unsigned int findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
 
void testLCT ()
 
- Protected Attributes inherited from CSCUpgradeMotherboard
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
edm::ParameterSet commonParams_
 
const CSCGeometrycsc_g
 
const CSCChambercscChamber
 
bool debug_luts
 
bool debug_matching
 
bool drop_used_clcts
 
std::unique_ptr< CSCUpgradeMotherboardLUTGeneratorgenerator_
 
bool match_earliest_alct_only
 
bool match_earliest_clct_only
 
unsigned int max_lcts
 
Parity par
 
int pref [CSCConstants::MAX_LCT_TBINS]
 
unsigned theChamber
 
unsigned theRegion
 
unsigned int tmb_cross_bx_algo
 
edm::ParameterSet tmbParams_
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
const CSCGeometrycsc_g
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
int infoV
 
bool isMTCC
 
bool isSLHC
 
bool isTMB07
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
bool readout_earliest_2
 
CSCCorrelatedLCTDigi secondLCT [CSCConstants::MAX_LCT_TBINS]
 
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 inherited from CSCMotherboard
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

Definition at line 6 of file CSCMotherboardME3141.h.

Member Enumeration Documentation

Enumerator
DEFAULT_MATCHING_VALUE 

Definition at line 10 of file CSCMotherboardME3141.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file CSCMotherboardME3141.cc.

CSCMotherboardME3141::~CSCMotherboardME3141 ( )
override

Definition at line 19 of file CSCMotherboardME3141.cc.

20 {
21 }

Member Function Documentation

void CSCMotherboardME3141::clear ( void  )

Definition at line 23 of file CSCMotherboardME3141.cc.

References allLCTs, CSCMotherboard::clear(), mps_fire::i, CSCMotherboard::match_trig_window_size, CSCConstants::MAX_LCT_TBINS, and CSCConstants::MAX_LCTS_PER_CSC.

Referenced by run().

24 {
26 
27  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
28  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
29  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++) {
30  allLCTs(bx,mbx,i).clear();
31  }
32  }
33  }
34 }
unsigned int match_trig_window_size
void CSCMotherboardME3141::correlateLCTs ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const

Definition at line 177 of file CSCMotherboardME3141.cc.

References CSCMotherboard::alct_trig_enable, CSCCorrelatedLCTDigi::ALCTCLCT, CSCMotherboard::clct_trig_enable, CSCMotherboard::constructLCTs(), CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), CSCMotherboard::match_trig_enable, and or.

Referenced by run().

180 {
181  CSCALCTDigi bestALCT = bALCT;
182  CSCALCTDigi secondALCT = sALCT;
183  CSCCLCTDigi bestCLCT = bCLCT;
184  CSCCLCTDigi secondCLCT = sCLCT;
185 
186  const bool anodeBestValid = bestALCT.isValid();
187  const bool anodeSecondValid = secondALCT.isValid();
188  const bool cathodeBestValid = bestCLCT.isValid();
189  const bool cathodeSecondValid = secondCLCT.isValid();
190 
191  if (anodeBestValid and !anodeSecondValid) secondALCT = bestALCT;
192  if (!anodeBestValid and anodeSecondValid) bestALCT = secondALCT;
193  if (cathodeBestValid and !cathodeSecondValid) secondCLCT = bestCLCT;
194  if (!cathodeBestValid and cathodeSecondValid) bestCLCT = secondCLCT;
195 
196  // ALCT-CLCT matching conditions are defined by "trig_enable" configuration
197  // parameters.
198  if ((alct_trig_enable and bestALCT.isValid()) or
199  (clct_trig_enable and bestCLCT.isValid()) or
200  (match_trig_enable and bestALCT.isValid() and bestCLCT.isValid())){
201  lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
202  }
203 
204  if (((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) and
205  ((alct_trig_enable and secondALCT.isValid()) or
206  (clct_trig_enable and secondCLCT.isValid()) or
207  (match_trig_enable and secondALCT.isValid() and secondCLCT.isValid()))){
208  lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
209  }
210 }
unsigned int clct_trig_enable
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
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
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
unsigned int match_trig_enable
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
unsigned int alct_trig_enable
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME3141::readoutLCTs ( ) const

Definition at line 213 of file CSCMotherboardME3141.cc.

References allLCTs, CSCUpgradeMotherboard::LCTContainer::getMatched(), mps_fire::result, CSCUpgradeMotherboard::sortLCTs(), CSCUpgradeMotherboard::sortLCTsByQuality(), and CSCUpgradeMotherboard::tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build(), and run().

214 {
215  std::vector<CSCCorrelatedLCTDigi> result;
216  allLCTs.getMatched(result);
218  return result;
219 }
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
void CSCMotherboardME3141::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc 
)

Definition at line 38 of file CSCMotherboardME3141.cc.

References CSCMotherboard::alct, CSCUpgradeMotherboard::alctV, allLCTs, EnergyCorrector::c, CSCMotherboard::clct, clctV, clear(), correlateLCTs(), CSCUpgradeMotherboard::csc_g, CSCUpgradeMotherboard::cscChamber, CSCUpgradeMotherboard::debug_matching, CSCUpgradeMotherboard::drop_used_clcts, plotBeamSpotDB::first, mps_fire::i, CSCChamber::id(), CSCMotherboard::infoV, LogDebug, LogTrace, CSCUpgradeMotherboard::match_earliest_clct_only, CSCMotherboard::match_trig_window_size, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, CSCConstants::MAX_LCT_TBINS, CSCConstants::MAX_LCTS_PER_CSC, gen::n, AlCaHLTBitMon_ParallelJobs::p, CSCUpgradeMotherboard::pref, readoutLCTs(), and CSCUpgradeMotherboard::tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build().

40 {
41  clear();
42 
43  if (!( alct and clct))
44  {
45  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
46  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
47  return;
48  }
49 
50  alct->setCSCGeometry(csc_g);
51  clct->setCSCGeometry(csc_g);
52 
53  alctV = alct->run(wiredc); // run anodeLCT
54  clctV = clct->run(compdc); // run cathodeLCT
55 
56  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
57  if (alctV.empty() and clctV.empty()) return;
58 
59  int used_clct_mask[20];
60  for (int c=0;c<20;++c) used_clct_mask[c]=0;
61 
62  // ALCT centric matching
63  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++)
64  {
65  if (alct->bestALCT[bx_alct].isValid())
66  {
67  const int bx_clct_start(bx_alct - match_trig_window_size/2);
68  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
69 
70  if (debug_matching){
71  LogTrace("CSCMotherboardME3141") << "========================================================================" << std::endl;
72  LogTrace("CSCMotherboardME3141") << "ALCT-CLCT matching in ME34/1 chamber: " << cscChamber->id() << std::endl;
73  LogTrace("CSCMotherboardME3141") << "------------------------------------------------------------------------" << std::endl;
74  LogTrace("CSCMotherboardME3141") << "+++ Best ALCT Details: ";
75  alct->bestALCT[bx_alct].print();
76  LogTrace("CSCMotherboardME3141") << "+++ Second ALCT Details: ";
77  alct->secondALCT[bx_alct].print();
78 
79  LogTrace("CSCMotherboardME3141") << "------------------------------------------------------------------------" << std::endl;
80  LogTrace("CSCMotherboardME3141") << "Attempt ALCT-CLCT matching in ME34/13 in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
81  }
82 
83  // ALCT-to-CLCT
84  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
85  {
86  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
87  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
88  if (clct->bestCLCT[bx_clct].isValid())
89  {
90  if (debug_matching) LogTrace("CSCMotherboardME3141") << "++Valid ME21 CLCT: " << clct->bestCLCT[bx_clct] << std::endl;
91 
92  int mbx = bx_clct-bx_clct_start;
93  CSCMotherboardME3141::correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
94  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct],
95  allLCTs(bx_alct,mbx,0), allLCTs(bx_alct,mbx,1));
96  if (infoV > 1)
97  LogTrace("CSCMotherboardME3141") << "Successful ALCT-CLCT match in ME21: bx_alct = " << bx_alct
98  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
99  << "]; bx_clct = " << bx_clct << std::endl;
100  LogTrace("CSCMotherboardME3141") << "+++ Best CLCT Details: ";
101  clct->bestCLCT[bx_clct].print();
102  LogTrace("CSCMotherboardME3141") << "+++ Second CLCT Details: ";
103  clct->secondCLCT[bx_clct].print();
104  if (allLCTs(bx_alct,mbx,0).isValid()) {
105  used_clct_mask[bx_clct] += 1;
106  if (match_earliest_clct_only) break;
107  }
108  }
109  }
110  }
111  }
112 
113  // reduction of nLCTs per each BX
114  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++)
115  {
116  // counting
117  unsigned int n=0;
118  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
119  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
120  {
121  int cbx = bx + mbx - match_trig_window_size/2;
122  if (allLCTs(bx,mbx,i).isValid())
123  {
124  ++n;
125  if (infoV > 0) LogDebug("CSCMotherboardME3141")
126  << "LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs(bx,mbx,i)<<std::endl;
127  }
128  }
129 
130  // some simple cross-bx sorting algorithms
131  if (tmb_cross_bx_algo == 1 and (n>2))
132  {
133  n=0;
134  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
135  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
136  {
137  if (allLCTs(bx,pref[mbx],i).isValid())
138  {
139  n++;
140  if (n>2) allLCTs(bx,pref[mbx],i).clear();
141  }
142  }
143 
144  n=0;
145  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
146  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
147  {
148  int cbx = bx + mbx - match_trig_window_size/2;
149  if (allLCTs(bx,mbx,i).isValid())
150  {
151  n++;
152  if (infoV > 0) LogDebug("CSCMotherboardME3141")
153  << "LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs(bx,mbx,i)<< std::endl;
154  }
155  }
156  if (infoV > 0 and n>0) LogDebug("CSCMotherboardME3141")
157  <<"bx "<<bx<<" nnLCT:"<<n<<" "<<n<<std::endl;
158  } // x-bx sorting
159  }
160 
161  bool first = true;
162  unsigned int n=0;
163  for (const auto& p : readoutLCTs()) {
164  if (debug_matching and first){
165  LogTrace("CSCMotherboardME3141") << "========================================================================" << std::endl;
166  LogTrace("CSCMotherboardME3141") << "Counting the final LCTs" << std::endl;
167  LogTrace("CSCMotherboardME3141") << "========================================================================" << std::endl;
168  first = false;
169  LogTrace("CSCMotherboardME3141") << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
170  }
171  n++;
172  if (debug_matching)
173  LogTrace("CSCMotherboardME3141") << "LCT "<<n<<" " << p <<std::endl;
174  }
175 }
#define LogDebug(id)
unsigned int match_trig_window_size
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:37
int pref[CSCConstants::MAX_LCT_TBINS]
const CSCChamber * cscChamber
std::vector< CSCALCTDigi > alctV
const CSCGeometry * csc_g
#define LogTrace(id)
std::vector< CSCCLCTDigi > clctV
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const

Member Data Documentation

LCTContainer CSCMotherboardME3141::allLCTs
private

for the case when more than 2 LCTs/BX are allowed; maximum match window = 15

Definition at line 42 of file CSCMotherboardME3141.h.

Referenced by clear(), readoutLCTs(), and run().

std::vector<CSCCLCTDigi> CSCMotherboardME3141::clctV

Definition at line 37 of file CSCMotherboardME3141.h.

Referenced by run().