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;
161 bestCLCT =
clctProc->getBestCLCT(bx_clct);
162 secondCLCT =
clctProc->getSecondCLCT(bx_clct);
180 if (!clustersGEM.empty()) {
184 correlateLCTsGEM(secondALCT, secondCLCT, clustersGEM, LCTsecondAsecondCgem);
199 unsigned bx_gem = bx_alct;
213 if (!clustersGEM.empty()) {
223 std::vector<CSCCorrelatedLCTDigi> selectedLCTs;
226 if (bestALCT.
isValid() and !secondALCT.isValid() and !bestCLCT.
isValid() and !secondCLCT.
isValid()) {
227 if (LCTbestALCTgem.
isValid()) {
229 allLCTs_(bx_alct, matchingBX, 0) = LCTbestALCTgem;
234 if (!bestALCT.
isValid() and !secondALCT.isValid() and bestCLCT.
isValid() and !secondCLCT.
isValid()) {
235 if (LCTbestCLCTgem.
isValid()) {
237 allLCTs_(bx_alct, matchingBX, 0) = LCTbestCLCTgem;
243 if (LCTbestAbestCgem.
isValid()) {
245 allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestCgem;
246 }
else if (LCTbestAbestC.
isValid()) {
248 allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestC;
255 if (LCTbestAbestCgem.
isValid())
256 lctbb = LCTbestAbestCgem;
257 else if (LCTbestAbestC.
isValid())
258 lctbb = LCTbestAbestC;
259 if (LCTsecondAbestCgem.
isValid())
260 lctsb = LCTsecondAbestCgem;
261 else if (LCTsecondAbestC.
isValid())
262 lctsb = LCTsecondAbestC;
265 selectedLCTs.push_back(lctbb);
267 selectedLCTs.push_back(LCTsecondALCTgem);
268 else if (LCTsecondAbestC.
isValid())
269 selectedLCTs.push_back(LCTsecondAbestC);
271 selectedLCTs.push_back(lctsb);
273 selectedLCTs.push_back(LCTbestALCTgem);
274 else if (LCTbestAbestC.
isValid())
275 selectedLCTs.push_back(LCTbestAbestC);
282 if (selectedLCTs[iLCT].
isValid()) {
283 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
284 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
292 if (LCTbestAbestCgem.
isValid())
293 lctbb = LCTbestAbestCgem;
294 else if (LCTbestAbestC.
isValid())
295 lctbb = LCTbestAbestC;
296 if (LCTbestAsecondCgem.
isValid())
297 lctbs = LCTbestAsecondCgem;
298 else if (LCTbestAsecondC.
isValid())
299 lctbs = LCTbestAsecondC;
302 selectedLCTs.push_back(lctbb);
304 selectedLCTs.push_back(LCTsecondCLCTgem);
305 else if (LCTbestAsecondC.
isValid())
306 selectedLCTs.push_back(LCTbestAsecondC);
308 selectedLCTs.push_back(lctbs);
310 selectedLCTs.push_back(LCTbestCLCTgem);
311 else if (LCTbestAbestC.
isValid())
312 selectedLCTs.push_back(LCTbestAbestC);
319 if (selectedLCTs[iLCT].
isValid()) {
320 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
321 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
331 if (LCTbestAbestCgem.
isValid())
332 lctbb = LCTbestAbestCgem;
333 else if (LCTbestAbestC.
isValid())
334 lctbb = LCTbestAbestC;
337 if (LCTbestAsecondCgem.
isValid())
338 lctbs = LCTbestAsecondCgem;
339 else if (LCTbestAsecondC.
isValid())
340 lctbs = LCTbestAsecondC;
344 selectedLCTs.push_back(lctbb);
347 if (LCTsecondAsecondCgem.
isValid())
348 lctss = LCTsecondAsecondCgem;
349 else if (LCTsecondAsecondC.
isValid())
350 lctss = LCTsecondAsecondC;
353 selectedLCTs.push_back(lctss);
356 selectedLCTs.push_back(lctbs);
359 if (LCTsecondAbestCgem.
isValid())
360 lctsb = LCTsecondAbestCgem;
361 else if (LCTsecondAbestC.
isValid())
362 lctsb = LCTsecondAbestC;
365 selectedLCTs.push_back(lctsb);
372 if (selectedLCTs[iLCT].
isValid()) {
373 selectedLCTs[iLCT].setTrknmb(iLCT + 1);
374 allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
387 if (!
ALCT.isValid()) {
388 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
393 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
400 ValidClusters.push_back(
cl);
401 if (ValidClusters.empty())
418 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
427 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
447 LogTrace(
"CSCGEMMotherboard") <<
"Best CLCT invalid in correlateLCTsGEM";
454 ValidClusters.push_back(
cl);
455 if (ValidClusters.empty())
474 LogTrace(
"CSCGEMMotherboard") <<
"Best ALCT invalid in correlateLCTsGEM";
481 ValidClusters.push_back(
cl);
482 if (ValidClusters.empty())
501 if (
gem.isCoincidence())
503 else if (
gem.isValid())
637 else if (lct1.
getQuality() == lct2.getQuality())
638 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
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_