1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 2 #define L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 101 template <
class S,
class T>
233 const matchesBX<T>&
getPads()
const;
253 const matchesBX<T>& lut = getPads<T>();
256 if (lut.count(alct.
getBX()) == 0)
259 for (
const auto&
p : lut.at(alct.
getBX())) {
285 (alctRoll.first - delta > padRoll
or padRoll > alctRoll.second))
305 const int lowPad(mymap[keyStrip].
first);
306 const int highPad(mymap[keyStrip].
second);
309 const matchesBX<T>& lut = getPads<T>();
312 if (lut.count(clct.
getBX()) == 0)
315 for (
const auto&
p : lut.at(clct.
getBX())) {
322 int padNumber(
getPad(
p.second));
329 template <
class S,
class T>
334 matchingPads<T>(d1,
p1);
337 matchingPads<T>(d2,
p2);
340 result.reserve(p1.size() + p2.size());
347 matches<T> padsClct, padsAlct;
350 matchingPads<T>(clct1, padsClct);
353 matchingPads<T>(alct1, padsAlct);
364 matches<T>&
result)
const {
365 matches<T> padsClct, padsAlct;
368 matchingPads<CSCCLCTDigi, T>(clct1, clct2, padsClct);
371 matchingPads<CSCALCTDigi, T>(alct1, alct2, padsAlct);
374 result.reserve(padsClct.size() + padsAlct.size());
387 for (
const auto&
p : pads) {
410 float averagePadNumberCSC =
getPad(clct,
part);
411 float minDeltaPad = 999;
412 for (
const auto&
p : pads) {
418 float averagePadNumberGEM =
getPad(
p.second);
419 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad) {
420 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
438 float averagePadNumberCSC =
getPad(clct1,
part);
439 float minDeltaPad = 999;
440 for (
const auto&
p : pads) {
445 float averagePadNumberGEM =
getPad(
p.second);
452 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad and
454 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
471 bool bestValid = bestLCT.
isValid();
472 bool secondValid = secondLCT.isValid();
476 if (bestValid and !secondValid)
478 if (!bestValid and secondValid)
482 const GEMCoPadDigi& bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads);
496 if ((getLctTrigEnable<T>() and bestLCT.isValid())
or (
match_trig_enable and bestLCT.isValid())) {
501 if ((getLctTrigEnable<T>() and secondLCT.isValid())
or void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
bool gemGeometryAvailable
match< GEMCoPadDigi > GEMCoPadDigiId
void correlateLCTsGEM(const T &best, const T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
bool isValid() const
check ALCT validity (1 - valid ALCT)
void setGEMGeometry(const GEMGeometry *g)
set CSC and GEM geometries for the matching needs
GEMCoPadDigiIdsBX coPads_
T bestMatchingPad(const CSCALCTDigi &, const matches< T > &) const
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
int getBX(const GEMPadDigi &p) const
bool useOldLCTDataFormat_
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 g
matches< GEMCoPadDigi > GEMCoPadDigiIds
virtual bool doesWiregroupCrossStrip(int key_wg, int key_strip) const
std::vector< GEMCoPadDigi > gemCoPadV
bool promoteALCTGEMpattern_
U second(std::pair< T, U > const &p)
bool promoteALCTGEMquality_
matchesBX< GEMPadDigi > GEMPadDigiIdsBX
match< GEMPadDigi > GEMPadDigiId
bool promoteCLCTGEMquality_
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)=0
unsigned int findQualityGEM(const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer) const
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
int getBX() const
return BX
Abs< T >::type abs(const T &t)
void printGEMTriggerCoPads(int bx_start, int bx_stop, enum CSCPart)
bool isValid() const
check CLCT validity (1 - valid CLCT)
int getRoll(const GEMPadDigiId &p) const
unsigned int match_trig_enable
int getLctTrigEnable() const
std::pair< int, int > getRolls(const CSCALCTDigi &) const
bool isGEMDetId(unsigned int) const
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
bool isPadInOverlap(int roll) const
float getPad(const GEMPadDigi &) const
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
matchesBX< GEMCoPadDigi > GEMCoPadDigiIdsBX
bool doLCTGhostBustingWithGEMs_
virtual const CSCGEMMotherboardLUT * getLUT() const =0
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
void intersection(const S &d1, const S &d2, S &result) const
virtual std::vector< std::pair< int, int > > get_csc_hs_to_gem_pad(Parity par, enum CSCPart) const =0
const matchesBX< T > & getPads() const
matches< GEMPadDigi > GEMPadDigiIds
void matchingPads(const CSCALCTDigi &alct, matches< T > &) const
~CSCGEMMotherboard() override
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
const GEMGeometry * gem_g
int getMaxDeltaBX() const
int getKeyWG() const
return key wire group
void printGEMTriggerPads(int bx_start, int bx_stop, enum CSCPart)
std::vector< std::pair< int, int > > get_csc_wg_to_gem_roll(Parity par, int layer=1) const
enum CSCPart getCSCPart(int keystrip) const