CMS 3D CMS Logo

List of all members | Public Member Functions
CSCMotherboardME3141 Class Reference

#include <CSCMotherboardME3141.h>

Inheritance diagram for CSCMotherboardME3141:
CSCUpgradeMotherboard CSCMotherboard

Public Member Functions

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
void clear ()
 
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 ()
 
enum CSCPart getCSCPart (int keystrip) const
 
template<class S >
void intersection (const S &d1, const S &d2, S &result) const
 
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 CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCMotherboard ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from CSCUpgradeMotherboard
static bool sortLCTsByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortLCTsByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralctProc
 
std::unique_ptr< CSCCathodeLCTProcessorclctProc
 
- 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 CSCUpgradeMotherboard
void setPrefIndex ()
 
- 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 clctPattern) const
 
unsigned int findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) const
 
- Protected Attributes inherited from CSCUpgradeMotherboard
LCTContainer allLCTs
 
const CSCChambercscChamber
 
bool debug_luts
 
bool debug_matching
 
bool disableME1a
 
bool gangedME1a
 
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
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
unsigned int alctClctOffset
 
edm::ParameterSet alctParams_
 
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
edm::ParameterSet clctParams_
 
std::vector< CSCCLCTDigiclctV
 
edm::ParameterSet commonParams_
 
const CSCGeometrycsc_g
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
int infoV
 
bool isSLHC_
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
bool readout_earliest_2
 
bool runME11ILT_
 
bool runME21ILT_
 
bool runME3141ILT_
 
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
 
edm::ParameterSet tmbParams_
 
- 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.

Constructor & Destructor Documentation

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

Definition at line 3 of file CSCMotherboardME3141.cc.

References CSCMotherboard::isSLHC_, or, and CSCMotherboard::runME3141ILT_.

6  :
7  CSCUpgradeMotherboard(endcap, station, sector, subsector, chamber, conf)
8 {
9  if (!isSLHC_ or !runME3141ILT_) edm::LogError("CSCMotherboardME3141|ConfigError")
10  << "+++ Upgrade CSCMotherboardME3141 constructed while isSLHC is not set! +++\n";
11 }
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
CSCMotherboardME3141::CSCMotherboardME3141 ( )

Definition at line 13 of file CSCMotherboardME3141.cc.

References CSCMotherboard::isSLHC_, or, and CSCMotherboard::runME3141ILT_.

15 {
16  if (!isSLHC_ or !runME3141ILT_) edm::LogError("CSCMotherboardME3141|ConfigError")
17  << "+++ Upgrade CSCMotherboardME3141 constructed while isSLHC is not set! +++\n";
18 }
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
CSCMotherboardME3141::~CSCMotherboardME3141 ( )
override

Definition at line 20 of file CSCMotherboardME3141.cc.

21 {
22 }

Member Function Documentation

void CSCMotherboardME3141::correlateLCTs ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const

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

167 {
168  CSCALCTDigi bestALCT = bALCT;
169  CSCALCTDigi secondALCT = sALCT;
170  CSCCLCTDigi bestCLCT = bCLCT;
171  CSCCLCTDigi secondCLCT = sCLCT;
172 
173  const bool anodeBestValid = bestALCT.isValid();
174  const bool anodeSecondValid = secondALCT.isValid();
175  const bool cathodeBestValid = bestCLCT.isValid();
176  const bool cathodeSecondValid = secondCLCT.isValid();
177 
178  if (anodeBestValid and !anodeSecondValid) secondALCT = bestALCT;
179  if (!anodeBestValid and anodeSecondValid) bestALCT = secondALCT;
180  if (cathodeBestValid and !cathodeSecondValid) secondCLCT = bestCLCT;
181  if (!cathodeBestValid and cathodeSecondValid) bestCLCT = secondCLCT;
182 
183  // ALCT-CLCT matching conditions are defined by "trig_enable" configuration
184  // parameters.
185  if ((alct_trig_enable and bestALCT.isValid()) or
186  (clct_trig_enable and bestCLCT.isValid()) or
187  (match_trig_enable and bestALCT.isValid() and bestCLCT.isValid())){
188  lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
189  }
190 
191  if (((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) and
192  ((alct_trig_enable and secondALCT.isValid()) or
193  (clct_trig_enable and secondCLCT.isValid()) or
194  (match_trig_enable and secondALCT.isValid() and secondCLCT.isValid()))){
195  lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
196  }
197 }
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 200 of file CSCMotherboardME3141.cc.

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

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

201 {
202  std::vector<CSCCorrelatedLCTDigi> result;
203  allLCTs.getMatched(result);
205  return result;
206 }
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 25 of file CSCMotherboardME3141.cc.

References CSCMotherboard::alctClctOffset, CSCMotherboard::alctProc, CSCMotherboard::alctV, CSCUpgradeMotherboard::allLCTs, EnergyCorrector::c, CSCMotherboard::clctProc, CSCMotherboard::clctV, CSCUpgradeMotherboard::LCTContainer::clear(), CSCUpgradeMotherboard::clear(), correlateLCTs(), CSCMotherboard::csc_g, CSCUpgradeMotherboard::cscChamber, CSCUpgradeMotherboard::debug_matching, CSCMotherboard::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().

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