1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 2 #define L1Trigger_CSCTriggerPrimitives_CSCGEMMotherboard_h 25 unsigned subsector,
unsigned chamber,
81 template <
class S,
class T>
166 if (not alct1.
isValid())
return result;
169 for (
const auto&
p: pads){
181 if (not clct.
isValid())
return result;
184 float averagePadNumberCSC =
getAvePad(clct, part);
185 float minDeltaPad = 999;
186 for (
const auto&
p: pads){
187 float averagePadNumberGEM =
getAvePad(
p.second);
188 if (
std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad){
189 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
204 float averagePadNumberCSC =
getAvePad(clct1, part);
205 float minDeltaPad = 999;
206 for (
const auto&
p: pads){
207 float averagePadNumberGEM =
getAvePad(
p.second);
210 minDeltaPad =
std::abs(averagePadNumberCSC - averagePadNumberGEM);
221 bool bestValid = bestLCT.isValid();
222 bool secondValid = secondLCT.isValid();
225 if (bestValid and !secondValid) secondLCT = bestLCT;
226 if (!bestValid and secondValid) bestLCT =
secondLCT;
229 GEMCoPadDigi bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads,
p);
232 correlateLCTsGEM(bestLCT, secondLCT, bestCoPad, secondCoPad, lct1, lct2, p);
277 matches<GEMPadDigi>
result;
278 if (not alct.
isValid())
return result;
280 std::pair<int,int> alctRoll = (
getLUT()->CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(
par))[alct.
getKeyWG()];
289 if (alctRoll.first == -99 and alctRoll.second == -99)
continue;
290 else if (alctRoll.first == -99 and !(padRoll <= alctRoll.second))
continue;
291 else if (alctRoll.second == -99 and !(padRoll >= alctRoll.first))
continue;
292 else if ((alctRoll.first != -99 and alctRoll.second != -99) and
293 (alctRoll.first > padRoll
or padRoll > alctRoll.second))
continue;
302 matches<GEMCoPadDigi>
result;
303 if (not alct.
isValid())
return result;
305 std::pair<int,int> alctRoll = (
getLUT()->CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(
par))[alct.
getKeyWG()];
314 if (alctRoll.first == -99 and alctRoll.second == -99)
continue;
315 else if (alctRoll.first == -99 and !(padRoll <= alctRoll.second))
continue;
316 else if (alctRoll.second == -99 and !(padRoll >= alctRoll.first))
continue;
317 else if ((alctRoll.first != -99 and alctRoll.second != -99) and
318 (alctRoll.first > padRoll
or padRoll > alctRoll.second))
continue;
328 matches<GEMPadDigi>
result;
329 if (not clct.
isValid())
return result;
333 const int highPad(mymap[clct.
getKeyStrip()].second);
349 matches<GEMCoPadDigi>
result;
350 if (not clct.
isValid())
return result;
354 const int highPad(mymap[clct.
getKeyStrip()].second);
367 template <
class S,
class T>
371 p1 = matchingPads<T>(d1,
part);
372 p2 = matchingPads<T>(d2,
part);
373 result.reserve(p1.size() + p2.size());
382 matches<T> padsClct(matchingPads<T>(clct1, part));
383 matches<T> padsAlct(matchingPads<T>(alct1, part));
392 matches<T> padsClct(matchingPads<CSCCLCTDigi,T>(clct1, clct2, part));
393 matches<T> padsAlct(matchingPads<CSCALCTDigi,T>(alct1, alct2, part));
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
bool gemGeometryAvailable
match< GEMCoPadDigi > GEMCoPadDigiId
T bestMatchingPad(const CSCALCTDigi &, const matches< T > &, enum CSCPart)
unsigned int clct_trig_enable
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i)
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_
int getRoll(const GEMPadDigiId &p)
int getBX(const GEMPadDigi &p)
bool useOldLCTDataFormat_
virtual ~CSCGEMMotherboard()
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
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart)
std::vector< GEMCoPadDigi > gemCoPadV
bool promoteALCTGEMpattern_
U second(std::pair< T, U > const &p)
bool promoteALCTGEMquality_
S intersection(const S &d1, const S &d2)
matchesBX< GEMPadDigi > GEMPadDigiIdsBX
match< GEMPadDigi > GEMPadDigiId
bool promoteCLCTGEMquality_
CSCCorrelatedLCTDigi secondLCT[MAX_LCT_BINS]
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)=0
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)
unsigned int match_trig_enable
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
matches< T > matchingPads(const CSCALCTDigi &alct, enum CSCPart part)
matchesBX< GEMCoPadDigi > GEMCoPadDigiIdsBX
bool doLCTGhostBustingWithGEMs_
double S(const TLorentzVector &, const TLorentzVector &)
unsigned int alct_trig_enable
virtual const CSCGEMMotherboardLUT * getLUT() const =0
unsigned int findQualityGEM(const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer)
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
matches< GEMPadDigi > GEMPadDigiIds
bool isPadInOverlap(int roll)
const GEMGeometry * gem_g
float getAvePad(const GEMPadDigi &)
int getKeyWG() const
return key wire group
void printGEMTriggerPads(int bx_start, int bx_stop, enum CSCPart)