11 drop_low_quality_alct_(tmbParams_.getParameter<
bool>(
"dropLowQualityALCTs")),
12 drop_low_quality_clct_(tmbParams_.getParameter<
bool>(
"dropLowQualityCLCTs")),
13 build_lct_from_alct_gem_(tmbParams_.getParameter<
bool>(
"buildLCTfromALCTandGEM")),
14 build_lct_from_clct_gem_(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!";
54 uint16_t Run2Pattern = 0;
59 Run2Pattern = 8 +
sign;
61 Run2Pattern = 6 +
sign;
63 Run2Pattern = 4 +
sign;
65 Run2Pattern = 2 +
sign;
77 if (
gem_g ==
nullptr) {
78 edm::LogError(
"CSCGEMMotherboard") <<
"run() called for GEM-CSC integrated trigger without valid GEM geometry! \n";
84 edm::LogError(
"CSCGEMMotherboard") <<
"run() called for non-existing ALCT/CLCT processor! \n";
97 const std::vector<CSCALCTDigi>&
alctV =
alctProc->run(wiredc);
98 const std::vector<CSCCLCTDigi>&
clctV =
clctProc->run(compdc);
138 CSCCorrelatedLCTDigi LCTbestAbestCgem, LCTbestAsecondCgem, LCTsecondAbestCgem, LCTsecondAsecondCgem;
154 unsigned matchingBX = 0;
155 unsigned matching_clctbx = 0;
156 unsigned bx_clct = 0;
158 std::vector<unsigned> clctBx_qualbend_match;
161 bool hasLocalShower =
false;
168 unsigned bx_clct_qualbend = clctBx_qualbend_match[mbx];
169 bx_clct = (
sort_clct_bx_ or not(hasLocalShower)) ? bx_clct_run2 : bx_clct_qualbend;
174 matching_clctbx = mbx;
180 bestCLCT =
clctProc->getBestCLCT(bx_clct);
181 secondCLCT =
clctProc->getSecondCLCT(bx_clct);
191 LogTrace(
"CSCGEMMotherboard") <<
"GEMCSCOTMB: Successful ALCT-CLCT match: bx_alct = " << bx_alct
192 <<
"; bx_clct = " << matching_clctbx <<
"; mbx = " << matchingBX <<
" bestALCT " 193 << bestALCT <<
" secondALCT " << secondALCT <<
" bestCLCT " << bestCLCT
194 <<
" secondCLCT " << secondCLCT;
200 if (!clustersGEM.empty()) {
204 correlateLCTsGEM(secondALCT, secondCLCT, clustersGEM, LCTsecondAsecondCgem);
219 unsigned bx_gem = bx_alct;
233 if (!clustersGEM.empty()) {
243 std::vector<CSCCorrelatedLCTDigi> selectedLCTs;
246 if (bestALCT.
isValid() and !secondALCT.isValid() and !bestCLCT.
isValid() and !secondCLCT.isValid()) {
247 if (LCTbestALCTgem.
isValid()) {
249 allLCTs_(bx_alct, matchingBX, 0) = LCTbestALCTgem;
254 if (!bestALCT.
isValid() and !secondALCT.isValid() and bestCLCT.
isValid() and !secondCLCT.isValid()) {
255 if (LCTbestCLCTgem.
isValid()) {
257 allLCTs_(bx_alct, matchingBX, 0) = LCTbestCLCTgem;
262 if (bestALCT.
isValid() and !secondALCT.isValid() and bestCLCT.
isValid() and !secondCLCT.isValid()) {
263 if (LCTbestAbestCgem.
isValid()) {
265 allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestCgem;
266 }
else if (LCTbestAbestC.
isValid()) {
268 allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestC;
273 if (bestALCT.
isValid() and secondALCT.isValid() and bestCLCT.
isValid() and !secondCLCT.isValid()) {
275 if (LCTbestAbestCgem.
isValid())
276 lctbb = LCTbestAbestCgem;
277 else if (LCTbestAbestC.
isValid())
278 lctbb = LCTbestAbestC;
279 if (LCTsecondAbestCgem.
isValid())
280 lctsb = LCTsecondAbestCgem;
281 else if (LCTsecondAbestC.
isValid())
282 lctsb = LCTsecondAbestC;
285 selectedLCTs.push_back(lctbb);
287 selectedLCTs.push_back(LCTsecondALCTgem);
288 else if (LCTsecondAbestC.
isValid())
289 selectedLCTs.push_back(LCTsecondAbestC);
291 selectedLCTs.push_back(lctsb);
293 selectedLCTs.push_back(LCTbestALCTgem);
294 else if (LCTbestAbestC.
isValid())
295 selectedLCTs.push_back(LCTbestAbestC);
302 if (selectedLCTs[iLCT].
isValid()) {
303 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
304 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
310 if (bestALCT.
isValid() and !secondALCT.isValid() and bestCLCT.
isValid() and secondCLCT.isValid()) {
312 if (LCTbestAbestCgem.
isValid())
313 lctbb = LCTbestAbestCgem;
314 else if (LCTbestAbestC.
isValid())
315 lctbb = LCTbestAbestC;
316 if (LCTbestAsecondCgem.
isValid())
317 lctbs = LCTbestAsecondCgem;
318 else if (LCTbestAsecondC.
isValid())
319 lctbs = LCTbestAsecondC;
322 selectedLCTs.push_back(lctbb);
324 selectedLCTs.push_back(LCTsecondCLCTgem);
325 else if (LCTbestAsecondC.
isValid())
326 selectedLCTs.push_back(LCTbestAsecondC);
328 selectedLCTs.push_back(lctbs);
330 selectedLCTs.push_back(LCTbestCLCTgem);
331 else if (LCTbestAbestC.
isValid())
332 selectedLCTs.push_back(LCTbestAbestC);
339 if (selectedLCTs[iLCT].
isValid()) {
340 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
341 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
347 if (bestALCT.
isValid() and secondALCT.isValid() and bestCLCT.
isValid() and secondCLCT.isValid()) {
351 if (LCTbestAbestCgem.
isValid())
352 lctbb = LCTbestAbestCgem;
353 else if (LCTbestAbestC.
isValid())
354 lctbb = LCTbestAbestC;
357 if (LCTbestAsecondCgem.
isValid())
358 lctbs = LCTbestAsecondCgem;
359 else if (LCTbestAsecondC.
isValid())
360 lctbs = LCTbestAsecondC;
364 selectedLCTs.push_back(lctbb);
367 if (LCTsecondAsecondCgem.
isValid())
368 lctss = LCTsecondAsecondCgem;
369 else if (LCTsecondAsecondC.
isValid())
370 lctss = LCTsecondAsecondC;
373 selectedLCTs.push_back(lctss);
376 selectedLCTs.push_back(lctbs);
379 if (LCTsecondAbestCgem.
isValid())
380 lctsb = LCTsecondAbestCgem;
381 else if (LCTsecondAbestC.
isValid())
382 lctsb = LCTsecondAbestC;
385 selectedLCTs.push_back(lctsb);
392 if (selectedLCTs[iLCT].
isValid()) {
393 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
394 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
407 if (!
ALCT.isValid()) {
408 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
413 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
420 ValidClusters.push_back(
cl);
421 if (ValidClusters.empty())
438 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
447 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
467 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
474 ValidClusters.push_back(
cl);
475 if (ValidClusters.empty())
494 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
501 ValidClusters.push_back(
cl);
502 if (ValidClusters.empty())
521 if (
gem.isCoincidence())
523 else if (
gem.isValid())
657 else if (lct1.
getQuality() == lct2.getQuality())
658 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
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
std::vector< CSCCLCTDigi > clctV
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_
unsigned int match_trig_window_size
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
bool build_lct_from_alct_gem_
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
void correlateLCTsGEM(const CSCALCTDigi &ALCT, const CSCCLCTDigi &CLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct) const
Log< level::Error, false > LogError
bool hasGE21Geometry16Partitions_
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
bool getQuartStripBit() const
get single quart strip bit
bool drop_low_quality_clct_
const unsigned theTrigChamber
std::vector< int > preferred_bx_match_
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
std::vector< CSCALCTDigi > alctV
uint16_t getKeyWG() const
return key wire group
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
Abs< T >::type abs(const T &t)
bool drop_low_quality_alct_
std::vector< GEMInternalCluster > GEMInternalClusters
unsigned int match_trig_enable
bool isValid() const
check CLCT validity (1 - valid CLCT)
const CSCGeometry * cscGeometry_
edm::ParameterSet tmbParams_
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts) const
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const
void sortCLCTByQualBend(int alct_bx, std::vector< unsigned > &clctBxVector)
constexpr uint32_t rawId() const
get the raw id
bool build_lct_from_clct_gem_
const unsigned theStation
uint16_t getPattern() const
return pattern
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads)
std::shared_ptr< GEMClusterProcessor > clusterProc_
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
uint16_t getSlope() const
return the slope
void encodeHighMultiplicityBits()
uint16_t getRun3Pattern() const
return pattern
CSCGEMMotherboard(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
unsigned clct_gem_bx_window_size_
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
~CSCGEMMotherboard() override
const GEMGeometry * gem_g
Power< A, B >::type pow(const A &a, const B &b)
std::unique_ptr< LCTQualityAssignment > qualityAssignment_