1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 2 #define L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 37 unsigned subsector,
unsigned chamber,
103 template <
class S,
class T>
134 const matches<T>&)
const;
239 const matchesBX<T>&
getPads()
const;
255 if (not alct.
isValid())
return;
258 std::pair<int,int> alctRoll =
262 const matchesBX<T>&
lut = getPads<T>();
265 if (lut.count(alct.
getBX())==0)
return;
267 for (
const auto&
p: lut.at(alct.
getBX())){
272 if (
std::abs(alct.
getBX()-pad_bx)>getMaxDeltaBX<T>())
continue;
279 padRoll > alctRoll.second)
continue;
282 padRoll < alctRoll.first)
continue;
286 (alctRoll.first > padRoll
or padRoll > alctRoll.second))
continue;
297 if (not clct.
isValid())
return;
306 const int lowPad(mymap[keyStrip].
first);
307 const int highPad(mymap[keyStrip].
second);
310 const matchesBX<T>&
lut = getPads<T>();
313 if (lut.count(clct.
getBX())==0)
return;
315 for (
const auto&
p: lut.at(clct.
getBX())){
319 if (
std::abs(clct.
getBX()-pad_bx)>getMaxDeltaBX<T>())
continue;
322 int padNumber(
getPad(
p.second));
331 template <
class S,
class T>
338 matchingPads<T>(d1,
p1);
341 matchingPads<T>(d2,
p2);
344 result.reserve(p1.size() + p2.size());
354 matches<T> padsClct, padsAlct;
357 matchingPads<T>(clct1, padsClct);
360 matchingPads<T>(alct1, padsAlct);
373 matches<T> padsClct, padsAlct;
376 matchingPads<CSCCLCTDigi, T>(clct1, clct2, padsClct);
379 matchingPads<CSCALCTDigi, T>(alct1, alct2, padsAlct);
382 result.reserve(padsClct.size() + padsAlct.size());
390 const matches<S>& pads)
const 394 if (not alct1.
isValid())
return result;
397 for (
const auto&
p: pads){
412 const matches<S>& pads)
const 416 if (not clct.
isValid())
return result;
421 float averagePadNumberCSC =
getPad(clct,
part);
422 float minDeltaPad = 999;
423 for (
const auto&
p: pads){
429 float averagePadNumberGEM =
getPad(
p.second);
430 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad){
431 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
441 const matches<S>& pads)
const 450 float averagePadNumberCSC =
getPad(clct1,
part);
451 float minDeltaPad = 999;
452 for (
const auto&
p: pads){
457 float averagePadNumberGEM =
getPad(
p.second);
459 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad and
461 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
476 bool bestValid = bestLCT.isValid();
477 bool secondValid = secondLCT.isValid();
481 if (bestValid and !secondValid) secondLCT = bestLCT;
482 if (!bestValid and secondValid) bestLCT =
secondLCT;
485 const GEMCoPadDigi& bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads);
501 if ((getLctTrigEnable<T>() and bestLCT.isValid())
or 508 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
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
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
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
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
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