1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 2 #define L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 37 unsigned subsector,
unsigned chamber,
87 enum CSCPart part, matches<T>&)
const;
93 enum CSCPart part, matches<T>&)
const;
98 template <
class S,
class T>
100 enum CSCPart part, matches<T>&)
const;
106 enum CSCPart part, matches<T>&)
const;
113 enum CSCPart part, matches<T>&)
const;
129 const matches<T>&,
enum CSCPart)
const;
242 const matchesBX<T>&
getPads()
const;
259 if (not alct.
isValid())
return;
262 std::pair<int,int> alctRoll =
266 const matchesBX<T>&
lut = getPads<T>();
269 if (lut.count(alct.
getBX())==0)
return;
271 for (
const auto&
p: lut.at(alct.
getBX())){
279 if (
std::abs(alct.
getBX()-pad_bx)>getMaxDeltaBX<T>())
continue;
286 padRoll > alctRoll.second)
continue;
289 padRoll < alctRoll.first)
continue;
293 (alctRoll.first > padRoll
or padRoll > alctRoll.second))
continue;
305 if (not clct.
isValid())
return;
310 const int highPad(mymap[clct.
getKeyStrip()].second);
313 const matchesBX<T>&
lut = getPads<T>();
316 if (lut.count(clct.
getBX())==0)
return;
318 for (
const auto&
p: lut.at(clct.
getBX())){
322 if (
std::abs(clct.
getBX()-pad_bx)>getMaxDeltaBX<T>())
continue;
325 int padNumber(
getPad(
p.second));
334 template <
class S,
class T>
342 matchingPads<T>(d1,
part,
p1);
345 matchingPads<T>(d2,
part,
p2);
348 result.reserve(p1.size() + p2.size());
359 matches<T> padsClct, padsAlct;
362 matchingPads<T>(clct1,
part, padsClct);
365 matchingPads<T>(alct1,
part, padsAlct);
379 matches<T> padsClct, padsAlct;
382 matchingPads<CSCCLCTDigi, T>(clct1, clct2,
part, padsClct);
385 matchingPads<CSCALCTDigi, T>(alct1, alct2,
part, padsAlct);
388 result.reserve(padsClct.size() + padsAlct.size());
396 const matches<S>& pads,
401 if (not alct1.
isValid())
return result;
404 for (
const auto&
p: pads){
419 const matches<S>& pads,
424 if (not clct.
isValid())
return result;
427 float averagePadNumberCSC =
getPad(clct, part);
428 float minDeltaPad = 999;
429 for (
const auto&
p: pads){
435 float averagePadNumberGEM =
getPad(
p.second);
436 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad){
437 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
447 const matches<S>& pads,
455 float averagePadNumberCSC =
getPad(clct1, part);
456 float minDeltaPad = 999;
457 for (
const auto&
p: pads){
462 float averagePadNumberGEM =
getPad(
p.second);
464 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad and
466 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
482 bool bestValid = bestLCT.isValid();
483 bool secondValid = secondLCT.isValid();
487 if (bestValid and !secondValid) secondLCT = bestLCT;
488 if (!bestValid and secondValid) bestLCT =
secondLCT;
491 const GEMCoPadDigi& bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads,
p);
494 correlateLCTsGEM(bestLCT, secondLCT, bestCoPad, secondCoPad, lct1, lct2, p);
508 if ((getLctTrigEnable<T>() and bestLCT.isValid())
or 515 if ((getLctTrigEnable<T>() and secondLCT.isValid())
or void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
bool gemGeometryAvailable
match< GEMCoPadDigi > GEMCoPadDigiId
void matchingPads(const CSCALCTDigi &alct, enum CSCPart part, matches< T > &) 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_
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) 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
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
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart) const
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
matchesBX< GEMCoPadDigi > GEMCoPadDigiIdsBX
bool doLCTGhostBustingWithGEMs_
virtual const CSCGEMMotherboardLUT * getLUT() const =0
std::unique_ptr< CSCAnodeLCTProcessor > alct
void intersection(const S &d1, const S &d2, S &result) const
const matchesBX< T > & getPads() const
std::unique_ptr< CSCCathodeLCTProcessor > clct
T bestMatchingPad(const CSCALCTDigi &, const matches< T > &, enum CSCPart) const
matches< GEMPadDigi > GEMPadDigiIds
~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