1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 2 #define L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 37 unsigned subsector,
unsigned chamber,
98 template <
class S,
class T>
129 const matches<T>&)
const;
234 const matchesBX<T>&
getPads()
const;
250 if (not alct.
isValid())
return;
253 std::pair<int,int> alctRoll =
257 const matchesBX<T>&
lut = getPads<T>();
260 if (lut.count(alct.
getBX())==0)
return;
262 for (
const auto&
p: lut.at(alct.
getBX())){
267 if (
std::abs(alct.
getBX()-pad_bx)>getMaxDeltaBX<T>())
continue;
274 padRoll > alctRoll.second)
continue;
277 padRoll < alctRoll.first)
continue;
281 (alctRoll.first > padRoll
or padRoll > alctRoll.second))
continue;
292 if (not clct.
isValid())
return;
298 const int highPad(mymap[clct.
getKeyStrip()].second);
301 const matchesBX<T>&
lut = getPads<T>();
304 if (lut.count(clct.
getBX())==0)
return;
306 for (
const auto&
p: lut.at(clct.
getBX())){
310 if (
std::abs(clct.
getBX()-pad_bx)>getMaxDeltaBX<T>())
continue;
313 int padNumber(
getPad(
p.second));
322 template <
class S,
class T>
329 matchingPads<T>(d1,
p1);
332 matchingPads<T>(d2,
p2);
335 result.reserve(p1.size() + p2.size());
345 matches<T> padsClct, padsAlct;
348 matchingPads<T>(clct1, padsClct);
351 matchingPads<T>(alct1, padsAlct);
364 matches<T> padsClct, padsAlct;
367 matchingPads<CSCCLCTDigi, T>(clct1, clct2, padsClct);
370 matchingPads<CSCALCTDigi, T>(alct1, alct2, padsAlct);
373 result.reserve(padsClct.size() + padsAlct.size());
381 const matches<S>& pads)
const 385 if (not alct1.
isValid())
return result;
388 for (
const auto&
p: pads){
403 const matches<S>& pads)
const 407 if (not clct.
isValid())
return result;
412 float averagePadNumberCSC =
getPad(clct,
part);
413 float minDeltaPad = 999;
414 for (
const auto&
p: pads){
420 float averagePadNumberGEM =
getPad(
p.second);
421 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad){
422 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
432 const matches<S>& pads)
const 441 float averagePadNumberCSC =
getPad(clct1,
part);
442 float minDeltaPad = 999;
443 for (
const auto&
p: pads){
448 float averagePadNumberGEM =
getPad(
p.second);
450 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad and
452 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
467 bool bestValid = bestLCT.isValid();
468 bool secondValid = secondLCT.isValid();
472 if (bestValid and !secondValid) secondLCT = bestLCT;
473 if (!bestValid and secondValid) bestLCT =
secondLCT;
476 const GEMCoPadDigi& bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads);
492 if ((getLctTrigEnable<T>() and bestLCT.isValid())
or 499 if ((getLctTrigEnable<T>() and secondLCT.isValid())
or void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
bool gemGeometryAvailable
match< GEMCoPadDigi > GEMCoPadDigiId
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
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
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
unsigned int findQualityGEM(const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer) const
virtual std::vector< std::pair< int, int > > get_csc_hs_to_gem_pad(Parity par, enum CSCPart) const =0
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
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
void intersection(const S &d1, const S &d2, S &result) const
const matchesBX< T > & getPads() const
matches< GEMPadDigi > GEMPadDigiIds
void matchingPads(const CSCALCTDigi &alct, matches< T > &) const
~CSCGEMMotherboard() 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