11 drop_low_quality_alct_(conf.
tmbParams().getParameter<
bool>(
"dropLowQualityALCTs")),
12 drop_low_quality_clct_(conf.
tmbParams().getParameter<
bool>(
"dropLowQualityCLCTs")),
13 build_lct_from_alct_gem_(conf.
tmbParams().getParameter<
bool>(
"buildLCTfromALCTandGEM")),
14 build_lct_from_clct_gem_(conf.
tmbParams().getParameter<
bool>(
"buildLCTfromCLCTandGEM")) {
28 edm::LogError(
"CSCGEMMotherboard") <<
"TMB constructed while runME11ILT_ is not set!";
32 edm::LogError(
"CSCGEMMotherboard") <<
"TMB constructed while runME21ILT_ is not set!";
51 uint16_t Run2Pattern = 0;
56 Run2Pattern = 8 +
sign;
58 Run2Pattern = 6 +
sign;
60 Run2Pattern = 4 +
sign;
62 Run2Pattern = 2 +
sign;
75 if (
context.gemGeometry_ ==
nullptr) {
76 edm::LogError(
"CSCGEMMotherboard") <<
"run() called for GEM-CSC integrated trigger without valid GEM geometry! \n";
86 auto [alctV, clctV] =
runCommon(wiredc, compdc, mbc);
89 if (alctV.empty() and clctV.empty())
114 CSCCorrelatedLCTDigi LCTbestAbestCgem, LCTbestAsecondCgem, LCTsecondAbestCgem, LCTsecondAsecondCgem;
130 unsigned matchingBX = 0;
131 unsigned matching_clctbx = 0;
132 unsigned bx_clct = 0;
134 std::vector<unsigned> clctBx_qualbend_match;
137 bool hasLocalShower =
false;
144 unsigned bx_clct_qualbend = clctBx_qualbend_match[mbx];
145 bx_clct = (
sort_clct_bx()
or not(hasLocalShower)) ? bx_clct_run2 : bx_clct_qualbend;
150 matching_clctbx = mbx;
156 bestCLCT =
clctProc->getBestCLCT(bx_clct);
157 secondCLCT =
clctProc->getSecondCLCT(bx_clct);
167 LogTrace(
"CSCGEMMotherboard") <<
"GEMCSCOTMB: Successful ALCT-CLCT match: bx_alct = " << bx_alct
168 <<
"; bx_clct = " << matching_clctbx <<
"; mbx = " << matchingBX <<
" bestALCT " 169 << bestALCT <<
" secondALCT " << secondALCT <<
" bestCLCT " << bestCLCT
170 <<
" secondCLCT " << secondCLCT;
176 if (!clustersGEM.empty()) {
177 correlateLCTsGEM(bestALCT, bestCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTbestAbestCgem);
178 correlateLCTsGEM(bestALCT, secondCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTbestAsecondCgem);
179 correlateLCTsGEM(secondALCT, bestCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTsecondAbestCgem);
181 secondALCT, secondCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTsecondAsecondCgem);
196 unsigned bx_gem = bx_alct;
199 correlateLCTsGEM(bestCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTbestCLCTgem);
201 correlateLCTsGEM(secondCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTsecondCLCTgem);
210 if (!clustersGEM.empty()) {
220 std::vector<CSCCorrelatedLCTDigi> selectedLCTs;
223 if (bestALCT.
isValid() and !secondALCT.isValid() and !bestCLCT.
isValid() and !secondCLCT.isValid()) {
224 if (LCTbestALCTgem.
isValid()) {
226 allLCTs_(bx_alct, matchingBX, 0) = LCTbestALCTgem;
231 if (!bestALCT.
isValid() and !secondALCT.isValid() and bestCLCT.
isValid() and !secondCLCT.isValid()) {
232 if (LCTbestCLCTgem.
isValid()) {
234 allLCTs_(bx_alct, matchingBX, 0) = LCTbestCLCTgem;
239 if (bestALCT.
isValid() and !secondALCT.isValid() and bestCLCT.
isValid() and !secondCLCT.isValid()) {
240 if (LCTbestAbestCgem.
isValid()) {
242 allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestCgem;
243 }
else if (LCTbestAbestC.
isValid()) {
245 allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestC;
250 if (bestALCT.
isValid() and secondALCT.isValid() and bestCLCT.
isValid() and !secondCLCT.isValid()) {
252 if (LCTbestAbestCgem.
isValid())
253 lctbb = LCTbestAbestCgem;
254 else if (LCTbestAbestC.
isValid())
255 lctbb = LCTbestAbestC;
256 if (LCTsecondAbestCgem.
isValid())
257 lctsb = LCTsecondAbestCgem;
258 else if (LCTsecondAbestC.
isValid())
259 lctsb = LCTsecondAbestC;
262 selectedLCTs.push_back(lctbb);
264 selectedLCTs.push_back(LCTsecondALCTgem);
265 else if (LCTsecondAbestC.
isValid())
266 selectedLCTs.push_back(LCTsecondAbestC);
268 selectedLCTs.push_back(lctsb);
270 selectedLCTs.push_back(LCTbestALCTgem);
271 else if (LCTbestAbestC.
isValid())
272 selectedLCTs.push_back(LCTbestAbestC);
279 if (selectedLCTs[iLCT].
isValid()) {
280 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
281 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
287 if (bestALCT.
isValid() and !secondALCT.isValid() and bestCLCT.
isValid() and secondCLCT.isValid()) {
289 if (LCTbestAbestCgem.
isValid())
290 lctbb = LCTbestAbestCgem;
291 else if (LCTbestAbestC.
isValid())
292 lctbb = LCTbestAbestC;
293 if (LCTbestAsecondCgem.
isValid())
294 lctbs = LCTbestAsecondCgem;
295 else if (LCTbestAsecondC.
isValid())
296 lctbs = LCTbestAsecondC;
299 selectedLCTs.push_back(lctbb);
301 selectedLCTs.push_back(LCTsecondCLCTgem);
302 else if (LCTbestAsecondC.
isValid())
303 selectedLCTs.push_back(LCTbestAsecondC);
305 selectedLCTs.push_back(lctbs);
307 selectedLCTs.push_back(LCTbestCLCTgem);
308 else if (LCTbestAbestC.
isValid())
309 selectedLCTs.push_back(LCTbestAbestC);
316 if (selectedLCTs[iLCT].
isValid()) {
317 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
318 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
324 if (bestALCT.
isValid() and secondALCT.isValid() and bestCLCT.
isValid() and secondCLCT.isValid()) {
328 if (LCTbestAbestCgem.
isValid())
329 lctbb = LCTbestAbestCgem;
330 else if (LCTbestAbestC.
isValid())
331 lctbb = LCTbestAbestC;
334 if (LCTbestAsecondCgem.
isValid())
335 lctbs = LCTbestAsecondCgem;
336 else if (LCTbestAsecondC.
isValid())
337 lctbs = LCTbestAsecondC;
341 selectedLCTs.push_back(lctbb);
344 if (LCTsecondAsecondCgem.
isValid())
345 lctss = LCTsecondAsecondCgem;
346 else if (LCTsecondAsecondC.
isValid())
347 lctss = LCTsecondAsecondC;
350 selectedLCTs.push_back(lctss);
353 selectedLCTs.push_back(lctbs);
356 if (LCTsecondAbestCgem.
isValid())
357 lctsb = LCTsecondAbestCgem;
358 else if (LCTsecondAbestC.
isValid())
359 lctsb = LCTsecondAbestC;
362 selectedLCTs.push_back(lctsb);
369 if (selectedLCTs[iLCT].
isValid()) {
370 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
371 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
386 if (!
ALCT.isValid()) {
387 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
392 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
399 ValidClusters.push_back(
cl);
400 if (ValidClusters.empty())
406 cscGEMMatcher_->bestClusterLoc(
ALCT, CLCT, ValidClusters, lookupTableME11ILT, lookupTableME21ILT, bestCluster);
417 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
426 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
448 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
455 ValidClusters.push_back(
cl);
456 if (ValidClusters.empty())
461 cscGEMMatcher_->bestClusterLoc(CLCT, ValidClusters, lookupTableME11ILT, lookupTableME21ILT, bestCluster);
465 constructLCTsGEM(CLCT, bestCluster, lookupTableME11ILT, lookupTableME21ILT, lct);
475 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
482 ValidClusters.push_back(
cl);
483 if (ValidClusters.empty())
504 if (
gem.isCoincidence())
506 else if (
gem.isValid())
642 else if (lct1.
getQuality() == lct2.getQuality())
643 return lct1.
getSlope() < lct2.getSlope();
bool isCoincidence() const
uint16_t Run2PatternConverter(const int slope) const
bool isValid() const
check ALCT validity (1 - valid ALCT)
T getParameter(std::string const &) const
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
int preferred_bx_match(unsigned int index) const
bool assign_gem_csc_bending_
unsigned int encodePattern(const int clctPattern) const
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
unsigned alct_gem_bx_window_size_
std::tuple< std::vector< CSCALCTDigi >, std::vector< CSCCLCTDigi > > runCommon(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const RunContext &context)
static const double slope[3]
bool drop_low_quality_clct_me1a_
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
uint16_t getKeyStrip(const uint16_t n=2) const
bool getEighthStripBit() const
get single eighth strip bit
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads, RunContext const &)
bool build_lct_from_alct_gem_
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Log< level::Error, false > LogError
bool hasGE21Geometry16Partitions_
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
void correlateLCTsGEM(const CSCALCTDigi &ALCT, const CSCCLCTDigi &CLCT, const GEMInternalClusters &clusters, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT, CSCCorrelatedLCTDigi &lct) const
bool getQuartStripBit() const
get single quart strip bit
bool drop_low_quality_clct_
const unsigned theTrigChamber
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
uint16_t getKeyWG() const
return key wire group
edm::ParameterSet const & tmbParams() const
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT, CSCCorrelatedLCTDigi &lct) const
Abs< T >::type abs(const T &t)
bool drop_low_quality_alct_
std::vector< GEMInternalCluster > GEMInternalClusters
bool isValid() const
check CLCT validity (1 - valid CLCT)
unsigned int match_trig_window_size() const
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts) const
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const
void sortCLCTByQualBend(int alct_bx, std::vector< unsigned > &clctBxVector)
unsigned int match_trig_enable() const
constexpr uint32_t rawId() const
get the raw id
bool build_lct_from_clct_gem_
const unsigned theStation
static constexpr int MAX_HALF_STRIP_ME1B
uint16_t getPattern() const
return pattern
std::shared_ptr< GEMClusterProcessor > clusterProc_
bool sort_clct_bx() const
edm::ParameterSet const & conf() const
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
uint16_t getSlope() const
return the slope
void matchALCTCLCTGEM(const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT)
uint16_t getRun3Pattern() const
return pattern
unsigned clct_gem_bx_window_size_
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
~CSCGEMMotherboard() override
CSCGEMMotherboard(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, CSCBaseboard::Parameters &conf)
Power< A, B >::type pow(const A &a, const B &b)
std::unique_ptr< LCTQualityAssignment > qualityAssignment_