CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
CSCGEMMotherboard Class Referenceabstract

#include <CSCGEMMotherboard.h>

Inheritance diagram for CSCGEMMotherboard:
CSCUpgradeMotherboard CSCMotherboard CSCBaseboard CSCGEMMotherboardME11 CSCGEMMotherboardME21

Public Types

enum  Default_values { DEFAULT_MATCHING_VALUE = -99 }
 

Public Member Functions

template<class S >
S bestMatchingPad (const CSCALCTDigi &alct1, const matches< S > &pads) const
 
template<class S >
S bestMatchingPad (const CSCCLCTDigi &clct, const matches< S > &pads) const
 
template<class S >
S bestMatchingPad (const CSCALCTDigi &alct1, const CSCCLCTDigi &clct1, const matches< S > &pads) const
 
void clear ()
 
 CSCGEMMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCGEMMotherboard ()
 
virtual void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)=0
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads)
 
void setGEMGeometry (const GEMGeometry *g)
 set CSC and GEM geometries for the matching needs More...
 
 ~CSCGEMMotherboard () override
 
- Public Member Functions inherited from CSCUpgradeMotherboard
void clear ()
 
template<class S >
bool compare (const S &p, const S &q) const
 
 CSCUpgradeMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCUpgradeMotherboard ()
 
void debugLUTs ()
 
enum CSCPart getCSCPart (int keystrip) const
 
template<class S >
void intersection (const S &d1, const S &d2, S &result) const
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const override
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
 
void setupGeometry ()
 
void sortLCTs (std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
 
 ~CSCUpgradeMotherboard () override
 
- Public Member Functions inherited from CSCMotherboard
void clear ()
 
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboard ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs () const
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
 ~CSCMotherboard () override=default
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCBaseboard ()
 
std::string getCSCName () const
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCBaseboard ()=default
 

Public Attributes

std::unique_ptr< GEMCoPadProcessorcoPadProcessor
 
- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralctProc
 
std::unique_ptr< CSCCathodeLCTProcessorclctProc
 

Protected Member Functions

template<class T >
T bestMatchingPad (const CSCALCTDigi &, const matches< T > &) const
 
template<class T >
T bestMatchingPad (const CSCCLCTDigi &, const matches< T > &) const
 
template<class T >
T bestMatchingPad (const CSCALCTDigi &, const CSCCLCTDigi &, const matches< T > &) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem1, const GEMCoPadDigi &gem2, int i) const
 
template<class T >
void correlateLCTsGEM (const T &best, const T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
template<class T >
void correlateLCTsGEM (const T &best, const T &second, const GEMCoPadDigi &, const GEMCoPadDigi &, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
virtual bool doesWiregroupCrossStrip (int key_wg, int key_strip) const
 
unsigned int findQualityGEM (const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer) const
 
int getBX (const GEMPadDigi &p) const
 
int getBX (const GEMCoPadDigi &p) const
 
virtual const CSCGEMMotherboardLUTgetLUT () const =0
 
float getPad (const GEMPadDigi &) const
 
float getPad (const GEMCoPadDigi &) const
 
float getPad (const CSCCLCTDigi &, enum CSCPart par) const
 
int getRoll (const GEMPadDigiId &p) const
 
int getRoll (const GEMCoPadDigiId &p) const
 
std::pair< int, int > getRolls (const CSCALCTDigi &) const
 
bool isGEMDetId (unsigned int) const
 
bool isPadInOverlap (int roll) const
 
template<class T >
void matchingPads (const CSCALCTDigi &alct, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &alct, matches< T > &) const
 
template<class S , class T >
void matchingPads (const S &d1, const S &d2, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &clct1, const CSCALCTDigi &alct1, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &clct1, const CSCCLCTDigi &clct2, const CSCALCTDigi &alct1, const CSCALCTDigi &alct2, matches< T > &) const
 
void printGEMTriggerCoPads (int bx_start, int bx_stop, enum CSCPart)
 
void printGEMTriggerPads (int bx_start, int bx_stop, enum CSCPart)
 
void retrieveGEMCoPads ()
 
void retrieveGEMPads (const GEMPadDigiCollection *pads, unsigned id)
 
void setupGeometry ()
 
- Protected Member Functions inherited from CSCUpgradeMotherboard
void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
void setPrefIndex ()
 
- Protected Member Functions inherited from CSCMotherboard
void checkConfigParameters ()
 
CSCCorrelatedLCTDigi constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
 
void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, int type)
 
void dumpConfigParams () const
 
unsigned int encodePattern (const int clctPattern) const
 
unsigned int findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) const
 
CSCCLCTDigi getBXShiftedCLCT (const CSCCLCTDigi &) const
 

Protected Attributes

GEMCoPadDigiIdsBX coPads_
 
bool doLCTGhostBustingWithGEMs_
 
const GEMGeometrygem_g
 
std::vector< GEMCoPadDigigemCoPadV
 
bool gemGeometryAvailable
 
unsigned gemId
 
int maxDeltaBXCoPad_
 
int maxDeltaBXPad_
 
int maxDeltaPadL1_
 
int maxDeltaPadL2_
 
GEMPadDigiIdsBX pads_
 
bool promoteALCTGEMpattern_
 
bool promoteALCTGEMquality_
 
bool promoteCLCTGEMquality_
 
bool useOldLCTDataFormat_
 
- Protected Attributes inherited from CSCUpgradeMotherboard
LCTContainer allLCTs
 
bool debug_luts
 
bool debug_matching
 
std::unique_ptr< CSCUpgradeMotherboardLUTGeneratorgenerator_
 
bool match_earliest_alct_only
 
bool match_earliest_clct_only
 
unsigned int max_lcts
 
int pref [CSCConstants::MAX_LCT_TBINS]
 
Parity theParity
 
unsigned int tmb_cross_bx_algo
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
std::vector< CSCCLCTDigiclctV
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
bool readout_earliest_2
 
CSCCorrelatedLCTDigi secondLCT [CSCConstants::MAX_LCT_TBINS]
 
unsigned int tmb_l1a_window_size
 
- Protected Attributes inherited from CSCBaseboard
unsigned int alctClctOffset_
 
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctSLHC_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isSLHC_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
unsigned theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 

Private Member Functions

template<class T >
int getLctTrigEnable () const
 
template<>
int getLctTrigEnable () const
 
template<>
int getLctTrigEnable () const
 
template<class T >
int getMaxDeltaBX () const
 
template<>
int getMaxDeltaBX () const
 
template<>
int getMaxDeltaBX () const
 
template<class T >
const matchesBX< T > & getPads () const
 
template<>
const matchesBX< GEMPadDigi > & getPads () const
 
template<>
const matchesBX< GEMCoPadDigi > & getPads () const
 

Additional Inherited Members

- Static Public Member Functions inherited from CSCUpgradeMotherboard
static bool sortLCTsByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortLCTsByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
- Protected Types inherited from CSCMotherboard
enum  LCT_Quality {
  INVALID = 0, NO_CLCT = 1, NO_ALCT = 2, CLCT_LAYER_TRIGGER = 3,
  LOW_QUALITY = 4, MARGINAL_ANODE_CATHODE = 5, HQ_ANODE_MARGINAL_CATHODE = 6, HQ_CATHODE_MARGINAL_ANODE = 7,
  HQ_ACCEL_ALCT = 8, HQ_RESERVED_1 = 9, HQ_RESERVED_2 = 10, HQ_PATTERN_2_3 = 11,
  HQ_PATTERN_4_5 = 12, HQ_PATTERN_6_7 = 13, HQ_PATTERN_8_9 = 14, HQ_PATTERN_10 = 15
}
 
- Static Protected Attributes inherited from CSCMotherboard
static const unsigned int def_alct_trig_enable = 0
 
static const unsigned int def_clct_trig_enable = 0
 
static const unsigned int def_match_trig_enable = 1
 
static const unsigned int def_match_trig_window_size = 7
 
static const unsigned int def_mpc_block_me1a = 1
 
static const unsigned int def_tmb_l1a_window_size = 7
 

Detailed Description

Base class for TMBs for the GEM-CSC integrated local trigger. Inherits from CSCUpgradeMotherboard. Provides common functionality to match ALCT/CLCT to GEM pads or copads. Matching functions are templated so they work both for GEMPadDigi and GEMCoPadDigi

Author
Sven Dildick (TAMU)

Definition at line 29 of file CSCGEMMotherboard.h.

Member Enumeration Documentation

Enumerator
DEFAULT_MATCHING_VALUE 

Definition at line 31 of file CSCGEMMotherboard.h.

Constructor & Destructor Documentation

CSCGEMMotherboard::CSCGEMMotherboard ( unsigned  endcap,
unsigned  station,
unsigned  sector,
unsigned  subsector,
unsigned  chamber,
const edm::ParameterSet conf 
)

Definition at line 3 of file CSCGEMMotherboard.cc.

References coPadProcessor, gemId, edm::ParameterSet::getParameter(), maxDeltaPadL1_, maxDeltaPadL2_, DetId::rawId(), CSCBaseboard::theChamber, CSCUpgradeMotherboard::theParity, CSCBaseboard::theRegion, CSCBaseboard::theStation, and CSCBaseboard::tmbParams_.

9  : CSCUpgradeMotherboard(endcap, station, sector, subsector, chamber, conf),
10  maxDeltaBXPad_(tmbParams_.getParameter<int>("maxDeltaBXPad")),
11  maxDeltaBXCoPad_(tmbParams_.getParameter<int>("maxDeltaBXCoPad")),
12  useOldLCTDataFormat_(tmbParams_.getParameter<bool>("useOldLCTDataFormat")),
13  promoteALCTGEMpattern_(tmbParams_.getParameter<bool>("promoteALCTGEMpattern")),
14  promoteALCTGEMquality_(tmbParams_.getParameter<bool>("promoteALCTGEMquality")),
15  doLCTGhostBustingWithGEMs_(tmbParams_.getParameter<bool>("doLCTGhostBustingWithGEMs")) {
16  // super chamber has layer=0!
18 
19  const edm::ParameterSet coPadParams(station == 1 ? conf.getParameter<edm::ParameterSet>("copadParamGE11")
20  : conf.getParameter<edm::ParameterSet>("copadParamGE21"));
22 
23  maxDeltaPadL1_ = (theParity ? tmbParams_.getParameter<int>("maxDeltaPadL1Even")
24  : tmbParams_.getParameter<int>("maxDeltaPadL1Odd"));
25  maxDeltaPadL2_ = (theParity ? tmbParams_.getParameter<int>("maxDeltaPadL2Even")
26  : tmbParams_.getParameter<int>("maxDeltaPadL2Odd"));
27 }
T getParameter(std::string const &) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
unsigned theChamber
Definition: CSCBaseboard.h:44
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:65
unsigned theRegion
Definition: CSCBaseboard.h:42
const unsigned theStation
Definition: CSCBaseboard.h:38
CSCGEMMotherboard::CSCGEMMotherboard ( )

Definition at line 29 of file CSCGEMMotherboard.cc.

CSCGEMMotherboard::~CSCGEMMotherboard ( )
override

Definition at line 31 of file CSCGEMMotherboard.cc.

31 {}

Member Function Documentation

template<class T >
T CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi ,
const matches< T > &   
) const
protected

Referenced by doesWiregroupCrossStrip().

template<class T >
T CSCGEMMotherboard::bestMatchingPad ( const CSCCLCTDigi ,
const matches< T > &   
) const
protected
template<class T >
T CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi ,
const CSCCLCTDigi ,
const matches< T > &   
) const
protected
template<class S >
S CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi alct1,
const matches< S > &  pads 
) const

Definition at line 380 of file CSCGEMMotherboard.h.

References getRoll(), getRolls(), isGEMDetId(), CSCALCTDigi::isValid(), AlCaHLTBitMon_ParallelJobs::p, and mps_fire::result.

380  {
381  S result;
382  // no matching pads for invalid stub
383  if (not alct1.isValid()) {
384  return result;
385  }
386  // return the first one with the same roll number
387  for (const auto& p : pads) {
388  // protection against corrupted DetIds
389  if (not isGEMDetId(p.first))
390  continue;
391 
392  // roll number of pad and ALCT must match
393  if (getRolls(alct1).first <= getRoll(p) and getRoll(p) <= getRolls(alct1).second) {
394  return p.second;
395  }
396  }
397  return result;
398 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
U second(std::pair< T, U > const &p)
int getRoll(const GEMPadDigiId &p) const
std::pair< int, int > getRolls(const CSCALCTDigi &) const
bool isGEMDetId(unsigned int) const
template<class S >
S CSCGEMMotherboard::bestMatchingPad ( const CSCCLCTDigi clct,
const matches< S > &  pads 
) const

Definition at line 401 of file CSCGEMMotherboard.h.

References funct::abs(), CSCUpgradeMotherboard::getCSCPart(), CSCCLCTDigi::getKeyStrip(), getPad(), isGEMDetId(), CSCCLCTDigi::isValid(), AlCaHLTBitMon_ParallelJobs::p, and mps_fire::result.

401  {
402  S result;
403  // no matching pads for invalid stub
404  if (not clct.isValid())
405  return result;
406 
407  auto part(getCSCPart(clct.getKeyStrip()));
408 
409  // return the pad with the smallest bending angle
410  float averagePadNumberCSC = getPad(clct, part);
411  float minDeltaPad = 999;
412  for (const auto& p : pads) {
413  // protection against corrupted DetIds
414  if (not isGEMDetId(p.first))
415  continue;
416 
417  // best pad is closest to CLCT in number of halfstrips
418  float averagePadNumberGEM = getPad(p.second);
419  if (std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad) {
420  minDeltaPad = std::abs(averagePadNumberCSC - averagePadNumberGEM);
421  result = p.second;
422  }
423  }
424  return result;
425 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
bool isGEMDetId(unsigned int) const
float getPad(const GEMPadDigi &) const
part
Definition: HCALResponse.h:20
int getKeyStrip() const
Definition: CSCCLCTDigi.h:94
enum CSCPart getCSCPart(int keystrip) const
template<class S >
S CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi alct1,
const CSCCLCTDigi clct1,
const matches< S > &  pads 
) const

Definition at line 428 of file CSCGEMMotherboard.h.

References funct::abs(), dumpMFGeometry_cfg::delta, CSCUpgradeMotherboard::getCSCPart(), CSCCLCTDigi::getKeyStrip(), getPad(), getRoll(), getRolls(), isGEMDetId(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), or, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and GEMDetId::station().

428  {
429  S result;
430  // no matching pads for invalid stub
431  if (not alct1.isValid() or not clct1.isValid()) {
432  return result;
433  }
434 
435  auto part(getCSCPart(clct1.getKeyStrip()));
436 
437  // return the pad with the smallest bending angle
438  float averagePadNumberCSC = getPad(clct1, part);
439  float minDeltaPad = 999;
440  for (const auto& p : pads) {
441  // protection against corrupted DetIds
442  if (not isGEMDetId(p.first))
443  continue;
444 
445  float averagePadNumberGEM = getPad(p.second);
446 
447  int delta;
448  if (GEMDetId(p.first).station() == 2)
449  delta = 1;
450 
451  // add another safety to make sure that the deltaPad is not larger than max value!!!
452  if (std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad and
453  getRolls(alct1).first - delta <= getRoll(p) and getRoll(p) <= getRolls(alct1).second) {
454  minDeltaPad = std::abs(averagePadNumberCSC - averagePadNumberGEM);
455  result = p.second;
456  }
457  }
458  return result;
459 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
U second(std::pair< T, U > const &p)
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
Definition: Activities.doc:12
int station() const
Definition: GEMDetId.h:173
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
int getRoll(const GEMPadDigiId &p) const
std::pair< int, int > getRolls(const CSCALCTDigi &) const
bool isGEMDetId(unsigned int) const
float getPad(const GEMPadDigi &) const
part
Definition: HCALResponse.h:20
int getKeyStrip() const
Definition: CSCCLCTDigi.h:94
enum CSCPart getCSCPart(int keystrip) const
void CSCGEMMotherboard::clear ( void  )

Definition at line 33 of file CSCGEMMotherboard.cc.

References CSCUpgradeMotherboard::clear(), coPads_, and pads_.

Referenced by CSCGEMMotherboardME11::run(), and CSCGEMMotherboardME21::run().

33  {
35  pads_.clear();
36  coPads_.clear();
37 }
GEMCoPadDigiIdsBX coPads_
GEMPadDigiIdsBX pads_
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const GEMCoPadDigi gem,
int  i 
) const
protected

Definition at line 74 of file CSCGEMMotherboard.cc.

Referenced by constructLCTsGEM(), CSCGEMMotherboardME21::correlateLCTsGEM(), CSCGEMMotherboardME11::correlateLCTsGEM(), correlateLCTsGEM(), and doesWiregroupCrossStrip().

76  {
77  return constructLCTsGEM(alct, CSCCLCTDigi(), GEMPadDigi(), gem, trknmb);
78 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCCLCTDigi clct,
const GEMCoPadDigi gem,
int  i 
) const
protected

Definition at line 80 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

82  {
83  return constructLCTsGEM(CSCALCTDigi(), clct, GEMPadDigi(), gem, trknmb);
84 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMCoPadDigi gem,
int  i 
) const
protected

Definition at line 86 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

89  {
90  return constructLCTsGEM(alct, clct, GEMPadDigi(), gem, trknmb);
91 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMPadDigi gem,
int  i 
) const
protected

Definition at line 93 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

96  {
97  return constructLCTsGEM(alct, clct, gem, GEMCoPadDigi(), trknmb);
98 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMPadDigi gem1,
const GEMCoPadDigi gem2,
int  i 
) const
protected

Definition at line 100 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::ALCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCTGEM, l1GtPatternGenerator_cfi::bx, GEMCoPadDigi::bx(), CSCCorrelatedLCTDigi::CLCT2GEM, CSCBaseboard::cscId_, doesWiregroupCrossStrip(), CSCMotherboard::encodePattern(), findQualityGEM(), GEMCoPadDigi::first(), CSCGEMMotherboardLUT::get_gem_pad_to_csc_hs(), CSCGEMMotherboardLUT::get_gem_roll_to_csc_wg(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCMotherboard::getBXShiftedALCT(), CSCMotherboard::getBXShiftedCLCT(), CSCUpgradeMotherboard::getCSCPart(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), getLUT(), CSCCLCTDigi::getPattern(), GEMCoPadDigi::isValid(), GEMPadDigi::isValid(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, LogTrace, CSCConstants::MAX_HALF_STRIP_ME1B, ME11, ME1A, ME1B, AlCaHLTBitMon_ParallelJobs::p, GEMCoPadDigi::pad(), topSingleLeptonDQM_PU_cfi::pattern, promoteALCTGEMpattern_, promoteALCTGEMquality_, promoteCLCTGEMquality_, qcdUeDQM_cfi::quality, GEMCoPadDigi::roll(), GEMCoPadDigi::second(), CSCCorrelatedLCTDigi::setALCT(), CSCCorrelatedLCTDigi::setBend(), CSCCorrelatedLCTDigi::setBX(), CSCCorrelatedLCTDigi::setBX0(), CSCCorrelatedLCTDigi::setCLCT(), CSCCorrelatedLCTDigi::setCSCID(), CSCCorrelatedLCTDigi::setGEM1(), CSCCorrelatedLCTDigi::setGEM2(), CSCCorrelatedLCTDigi::setMPCLink(), CSCCorrelatedLCTDigi::setPattern(), CSCCorrelatedLCTDigi::setQuality(), CSCCorrelatedLCTDigi::setStrip(), CSCCorrelatedLCTDigi::setSyncErr(), CSCCorrelatedLCTDigi::setTrknmb(), CSCCorrelatedLCTDigi::setType(), CSCCorrelatedLCTDigi::setValid(), CSCCorrelatedLCTDigi::setWireGroup(), CSCUpgradeMotherboard::theParity, CSCBaseboard::theTrigChamber, and validateGeometry_cfg::valid.

104  {
105  int pattern = 0, quality = 0, bx = 0, keyStrip = 0, keyWG = 0, bend = 0, valid = 0;
106 
107  // make a new LCT
108  CSCCorrelatedLCTDigi thisLCT;
109  if (not alct.isValid() and not clct.isValid()) {
110  LogTrace("CSCGEMCMotherboard") << "Warning!!! either ALCT or CLCT not valid, return invalid LCT \n";
111  return thisLCT;
112  }
113 
114  // Determine the case and assign properties depending on the LCT dataformat (old/new)
115  if (alct.isValid() and clct.isValid() and gem1.isValid() and not gem2.isValid()) {
116  pattern = encodePattern(clct.getPattern());
117  quality = findQualityGEM(alct, clct, 1);
118  bx = alct.getBX();
119  keyStrip = clct.getKeyStrip();
120  keyWG = alct.getKeyWG();
121  bend = clct.getBend();
122  thisLCT.setALCT(getBXShiftedALCT(alct));
123  thisLCT.setCLCT(getBXShiftedCLCT(clct));
124  thisLCT.setGEM1(gem1);
126  valid = doesWiregroupCrossStrip(keyWG, keyStrip) ? 1 : 0;
127  } else if (alct.isValid() and clct.isValid() and not gem1.isValid() and gem2.isValid()) {
128  pattern = encodePattern(clct.getPattern());
129  quality = findQualityGEM(alct, clct, 2);
130  bx = alct.getBX();
131  keyStrip = clct.getKeyStrip();
132  keyWG = alct.getKeyWG();
133  bend = clct.getBend();
134  thisLCT.setALCT(getBXShiftedALCT(alct));
135  thisLCT.setCLCT(getBXShiftedCLCT(clct));
136  thisLCT.setGEM1(gem2.first());
137  thisLCT.setGEM2(gem2.second());
139  valid = doesWiregroupCrossStrip(keyWG, keyStrip) ? 1 : 0;
140  } else if (alct.isValid() and gem2.isValid() and not clct.isValid()) {
141  //in ME11
142  //ME1b: keyWG >15,
143  //ME1a and ME1b overlap: 10<=keyWG<=15
144  //ME1a: keyWG < 10
145  //in overlap region, firstly try a match in ME1b
146 
147  auto p(getCSCPart(-1)); //use -1 as fake halfstrip, it returns ME11 if station==1 && (ring==1 or ring==4)
148  if (p == CSCPart::ME11) {
149  if (alct.getKeyWG() >= 10)
150  p = CSCPart::ME1B;
151  else
152  p = CSCPart::ME1A;
153  }
154 
155  const auto& mymap1 = getLUT()->get_gem_pad_to_csc_hs(theParity, p);
156  // GEM pad number is counting from 1
157  // keyStrip from mymap: for ME1b 0-127 and for ME1a 0-95
158  // keyStrip for CLCT: for ME1b 0-127 and for ME1a 128-223
159  keyStrip = mymap1[gem2.pad(2) - 1];
160  if (p == CSCPart::ME1A and keyStrip <= CSCConstants::MAX_HALF_STRIP_ME1B)
161  keyStrip += CSCConstants::MAX_HALF_STRIP_ME1B + 1;
162  keyWG = alct.getKeyWG();
163 
164  if ((not doesWiregroupCrossStrip(keyWG, keyStrip)) and p == CSCPart::ME1B and keyWG <= 15) {
165  //try ME1A as strip and WG do not cross
166  p = CSCPart::ME1A;
167  const auto& mymap2 = getLUT()->get_gem_pad_to_csc_hs(theParity, p);
168  keyStrip = mymap2[gem2.pad(2) - 1] + CSCConstants::MAX_HALF_STRIP_ME1B + 1;
169  }
170 
171  pattern = promoteALCTGEMpattern_ ? 10 : 0;
172  quality = promoteALCTGEMquality_ ? 15 : 11;
173  bx = alct.getBX();
174  thisLCT.setALCT(getBXShiftedALCT(alct));
175  thisLCT.setGEM1(gem2.first());
176  thisLCT.setGEM2(gem2.second());
178  valid = true;
179  } else if (clct.isValid() and gem2.isValid() and not alct.isValid()) {
180  const auto& mymap2 = getLUT()->get_gem_roll_to_csc_wg(theParity);
181  pattern = encodePattern(clct.getPattern());
182  quality = promoteCLCTGEMquality_ ? 15 : 11;
183  bx = gem2.bx(1) + CSCConstants::LCT_CENTRAL_BX;
184  keyStrip = clct.getKeyStrip();
185  // choose the corresponding wire-group in the middle of the partition
186  keyWG = mymap2[gem2.roll()];
187  bend = clct.getBend();
188  thisLCT.setCLCT(clct);
189  thisLCT.setGEM1(gem2.first());
190  thisLCT.setGEM2(gem2.second());
192  valid = true;
193  }
194 
195  if (valid == 0)
196  LogTrace("CSCGEMCMotherboard") << "Warning!!! wiregroup and strip pair are not crossing each other"
197  << " detid " << cscId_ << " with wiregroup " << keyWG << "keyStrip " << keyStrip
198  << " \n";
199 
200  // fill the rest of the properties
201  thisLCT.setTrknmb(trknmb);
202  thisLCT.setValid(valid);
203  thisLCT.setQuality(quality);
204  thisLCT.setWireGroup(keyWG);
205  thisLCT.setStrip(keyStrip);
206  thisLCT.setPattern(pattern);
207  thisLCT.setBend(bend);
208  thisLCT.setBX(bx);
209  thisLCT.setMPCLink(0);
210  thisLCT.setBX0(0);
211  thisLCT.setSyncErr(0);
212  thisLCT.setCSCID(theTrigChamber);
213 
214  // future work: add a section that produces LCTs according
215  // to the new LCT dataformat (not yet defined)
216 
217  // return new LCT
218  return thisLCT;
219 }
bool isValid() const
Definition: GEMPadDigi.cc:22
void setALCT(const CSCALCTDigi &alct)
void setGEM2(const GEMPadDigi &gem)
void setWireGroup(unsigned int wiregroup)
set wiregroup number
void setBend(unsigned int b)
set bend
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
void setBX0(unsigned int b)
set bx0
void setQuality(unsigned int q)
set quality code
int pad(int l) const
Definition: GEMCoPadDigi.cc:20
virtual bool doesWiregroupCrossStrip(int key_wg, int key_strip) const
CSCDetId cscId_
Definition: CSCBaseboard.h:50
int getBend() const
return bend
Definition: CSCCLCTDigi.h:59
void setMPCLink(const uint16_t &link)
Set mpc link number after MPC sorting.
bool isValid() const
Definition: GEMCoPadDigi.cc:18
const unsigned theTrigChamber
Definition: CSCBaseboard.h:41
void setPattern(unsigned int p)
set pattern
void setValid(unsigned int v)
set valid
void setSyncErr(unsigned int s)
set syncErr
int bx(int l) const
Definition: GEMCoPadDigi.cc:29
void setStrip(unsigned int s)
set strip
unsigned int findQualityGEM(const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer) const
std::vector< int > get_gem_roll_to_csc_wg(Parity par) const
unsigned int encodePattern(const int clctPattern) const
GEMPadDigi first() const
Definition: GEMCoPadDigi.h:29
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
void setCSCID(unsigned int c)
set cscID
int roll() const
Definition: GEMCoPadDigi.h:25
#define LogTrace(id)
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:65
virtual std::vector< int > get_gem_pad_to_csc_hs(Parity par, enum CSCPart) const =0
void setBX(unsigned int b)
set bx
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:47
GEMPadDigi second() const
Definition: GEMCoPadDigi.h:30
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyStrip() const
Definition: CSCCLCTDigi.h:94
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
void setCLCT(const CSCCLCTDigi &clct)
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:59
void setGEM1(const GEMPadDigi &gem)
enum CSCPart getCSCPart(int keystrip) const
template<class T >
void CSCGEMMotherboard::correlateLCTsGEM ( const T best,
const T second,
const GEMCoPadDigiIds coPads,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
protected

Definition at line 462 of file CSCGEMMotherboard.h.

References CSCCorrelatedLCTDigi::isValid(), and CSCMotherboard::secondLCT.

Referenced by doesWiregroupCrossStrip(), CSCGEMMotherboardME21::run(), and CSCGEMMotherboardME11::run().

466  {
467  T bestLCT = bLCT;
468  T secondLCT = sLCT;
469 
470  // Check which LCTs are valid
471  bool bestValid = bestLCT.isValid();
472  bool secondValid = secondLCT.isValid();
473 
474  // At this point, set both LCTs valid if they are invalid
475  // Duplicate LCTs are taken into account later
476  if (bestValid and !secondValid)
477  secondLCT = bestLCT;
478  if (!bestValid and secondValid)
479  bestLCT = secondLCT;
480 
481  // get best matching copad1
482  const GEMCoPadDigi& bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads);
483  const GEMCoPadDigi& secondCoPad = bestMatchingPad<GEMCoPadDigi>(secondLCT, coPads);
484 
485  correlateLCTsGEM(bestLCT, secondLCT, bestCoPad, secondCoPad, lct1, lct2);
486 }
void correlateLCTsGEM(const T &best, const T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
bool isValid() const
return valid pattern bit
long double T
template<class T >
void CSCGEMMotherboard::correlateLCTsGEM ( const T best,
const T second,
const GEMCoPadDigi bestCoPad,
const GEMCoPadDigi secondCoPad,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
protected

Definition at line 489 of file CSCGEMMotherboard.h.

References constructLCTsGEM(), CSCMotherboard::match_trig_enable, and or.

494  {
495  // construct the first LCT from ALCT(CLCT) and a GEM Copad
496  if ((getLctTrigEnable<T>() and bestLCT.isValid()) or (match_trig_enable and bestLCT.isValid())) {
497  lct1 = constructLCTsGEM(bestLCT, bestCoPad, 1);
498  }
499 
500  // construct the second LCT from ALCT(CLCT) and a GEM Copad
501  if ((getLctTrigEnable<T>() and secondLCT.isValid()) or
502  (match_trig_enable and secondLCT.isValid() and secondLCT != bestLCT)) {
503  lct2 = constructLCTsGEM(secondLCT, secondCoPad, 2);
504  }
505 }
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
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
Definition: Activities.doc:12
unsigned int match_trig_enable
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
bool isValid() const
return valid pattern bit
virtual bool CSCGEMMotherboard::doesWiregroupCrossStrip ( int  key_wg,
int  key_strip 
) const
inlineprotectedvirtual
unsigned int CSCGEMMotherboard::findQualityGEM ( const CSCALCTDigi aLCT,
const CSCCLCTDigi cLCT,
int  gemlayer 
) const
protected

Definition at line 314 of file CSCGEMMotherboard.cc.

References CSCALCTDigi::getAccelerator(), CSCCLCTDigi::getPattern(), CSCALCTDigi::getQuality(), CSCCLCTDigi::getQuality(), CSCBaseboard::infoV, cond::time::INVALID, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), or, topSingleLeptonDQM_PU_cfi::pattern, and CSCBaseboard::theStation.

Referenced by constructLCTsGEM(), and doesWiregroupCrossStrip().

314  {
315  // Either ALCT or CLCT is invalid
316  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
317  // No CLCT
318  if (aLCT.isValid() && !(cLCT.isValid()))
319  return LCT_Quality::NO_CLCT;
320 
321  // No ALCT
322  else if (!(aLCT.isValid()) && cLCT.isValid())
323  return LCT_Quality::NO_ALCT;
324 
325  // No ALCT and no CLCT
326  else
327  return LCT_Quality::INVALID;
328  }
329  // Both ALCT and CLCT are valid
330  else {
331  const int pattern(cLCT.getPattern());
332 
333  // Layer-trigger in CLCT
334  if (pattern == 1)
335  return LCT_Quality::CLCT_LAYER_TRIGGER;
336 
337  // Multi-layer pattern in CLCT
338  else {
339  // ALCT quality is the number of layers hit minus 3.
340  bool a4 = false;
341 
342  // Case of ME11 with GEMs: require 4 layers for ALCT
343  if (theStation == 1)
344  a4 = aLCT.getQuality() >= 1;
345 
346  // Case of ME21 with GEMs: require 4 layers for ALCT+GEM
347  if (theStation == 2)
348  a4 = aLCT.getQuality() + gemlayers >= 1;
349 
350  // CLCT quality is the number of layers hit.
351  const bool c4((cLCT.getQuality() >= 4) or (cLCT.getQuality() >= 3 and gemlayers >= 1));
352 
353  // quality = 4; "reserved for low-quality muons in future"
354 
355  // marginal anode and cathode
356  if (!a4 && !c4)
357  return LCT_Quality::MARGINAL_ANODE_CATHODE;
358 
359  // HQ anode, but marginal cathode
360  else if (a4 && !c4)
361  return LCT_Quality::HQ_ANODE_MARGINAL_CATHODE;
362 
363  // HQ cathode, but marginal anode
364  else if (!a4 && c4)
365  return LCT_Quality::HQ_CATHODE_MARGINAL_ANODE;
366 
367  // HQ muon, but accelerator ALCT
368  else if (a4 && c4) {
369  if (aLCT.getAccelerator())
370  return LCT_Quality::HQ_ACCEL_ALCT;
371 
372  else {
373  // quality = 9; "reserved for HQ muons with future patterns
374  // quality = 10; "reserved for HQ muons with future patterns
375 
376  // High quality muons are determined by their CLCT pattern
377  if (pattern == 2 || pattern == 3)
378  return LCT_Quality::HQ_PATTERN_2_3;
379 
380  else if (pattern == 4 || pattern == 5)
381  return LCT_Quality::HQ_PATTERN_4_5;
382 
383  else if (pattern == 6 || pattern == 7)
384  return LCT_Quality::HQ_PATTERN_6_7;
385 
386  else if (pattern == 8 || pattern == 9)
387  return LCT_Quality::HQ_PATTERN_8_9;
388 
389  else if (pattern == 10)
390  return LCT_Quality::HQ_PATTERN_10;
391 
392  else {
393  if (infoV >= 0)
394  edm::LogWarning("L1CSCTPEmulatorWrongValues")
395  << "+++ findQuality: Unexpected CLCT pattern id = " << pattern << "+++\n";
396  return LCT_Quality::INVALID;
397  }
398  }
399  }
400  }
401  }
402  return LCT_Quality::INVALID;
403 }
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:41
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
static constexpr TimeType INVALID
Definition: Time.h:33
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
Definition: Activities.doc:12
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
int getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:38
int getAccelerator() const
Definition: CSCALCTDigi.h:45
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:47
const unsigned theStation
Definition: CSCBaseboard.h:38
int CSCGEMMotherboard::getBX ( const GEMPadDigi p) const
protected

Definition at line 238 of file CSCGEMMotherboard.cc.

References GEMPadDigi::bx().

Referenced by doesWiregroupCrossStrip(), and matchingPads().

238 { return p.bx(); }
int bx() const
Definition: GEMPadDigi.h:27
int CSCGEMMotherboard::getBX ( const GEMCoPadDigi p) const
protected

Definition at line 240 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::bx().

240 { return p.bx(1); }
int bx(int l) const
Definition: GEMCoPadDigi.cc:29
template<class T >
int CSCGEMMotherboard::getLctTrigEnable ( ) const
private
template<>
int CSCGEMMotherboard::getLctTrigEnable ( ) const
private

Definition at line 426 of file CSCGEMMotherboard.cc.

References CSCMotherboard::alct_trig_enable.

426  {
427  return alct_trig_enable;
428 }
unsigned int alct_trig_enable
template<>
int CSCGEMMotherboard::getLctTrigEnable ( ) const
private

Definition at line 431 of file CSCGEMMotherboard.cc.

References CSCMotherboard::clct_trig_enable.

431  {
432  return clct_trig_enable;
433 }
unsigned int clct_trig_enable
virtual const CSCGEMMotherboardLUT* CSCGEMMotherboard::getLUT ( ) const
protectedpure virtual
template<class T >
int CSCGEMMotherboard::getMaxDeltaBX ( ) const
private
template<>
int CSCGEMMotherboard::getMaxDeltaBX ( ) const
private

Definition at line 416 of file CSCGEMMotherboard.cc.

References maxDeltaBXPad_.

416  {
417  return maxDeltaBXPad_;
418 }
template<>
int CSCGEMMotherboard::getMaxDeltaBX ( ) const
private

Definition at line 421 of file CSCGEMMotherboard.cc.

References maxDeltaBXCoPad_.

421  {
422  return maxDeltaBXCoPad_;
423 }
float CSCGEMMotherboard::getPad ( const GEMPadDigi p) const
protected

Definition at line 251 of file CSCGEMMotherboard.cc.

References GEMPadDigi::pad().

Referenced by bestMatchingPad(), doesWiregroupCrossStrip(), and matchingPads().

251 { return p.pad(); }
int pad() const
Definition: GEMPadDigi.h:26
float CSCGEMMotherboard::getPad ( const GEMCoPadDigi p) const
protected

Definition at line 253 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::pad().

253  {
254  // average pad number for a GEMCoPad
255  return 0.5 * (p.pad(1) + p.pad(2));
256 }
int pad(int l) const
Definition: GEMCoPadDigi.cc:20
float CSCGEMMotherboard::getPad ( const CSCCLCTDigi clct,
enum CSCPart  par 
) const
protected

Definition at line 258 of file CSCGEMMotherboard.cc.

References CSCGEMMotherboardLUT::get_csc_hs_to_gem_pad(), CSCCLCTDigi::getKeyStrip(), getLUT(), CSCConstants::MAX_HALF_STRIP_ME1B, ME1A, and CSCUpgradeMotherboard::theParity.

258  {
259  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(theParity, part));
260  int keyStrip = clct.getKeyStrip();
261  //ME1A part, convert halfstrip from 128-223 to 0-95
263  keyStrip = keyStrip - CSCConstants::MAX_HALF_STRIP_ME1B - 1;
264  return 0.5 * (mymap[keyStrip].first + mymap[keyStrip].second);
265 }
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
virtual std::vector< std::pair< int, int > > get_csc_hs_to_gem_pad(Parity par, enum CSCPart) const =0
int getKeyStrip() const
Definition: CSCCLCTDigi.h:94
template<class T >
const matchesBX<T>& CSCGEMMotherboard::getPads ( ) const
private
template<>
const matchesBX<GEMPadDigi>& CSCGEMMotherboard::getPads ( ) const
private

Definition at line 406 of file CSCGEMMotherboard.cc.

References pads_.

406  {
407  return pads_;
408 }
GEMPadDigiIdsBX pads_
template<>
const matchesBX<GEMCoPadDigi>& CSCGEMMotherboard::getPads ( ) const
private

Definition at line 411 of file CSCGEMMotherboard.cc.

References coPads_.

411  {
412  return coPads_;
413 }
GEMCoPadDigiIdsBX coPads_
int CSCGEMMotherboard::getRoll ( const GEMPadDigiId p) const
protected

Definition at line 242 of file CSCGEMMotherboard.cc.

References GEMDetId::roll().

Referenced by bestMatchingPad(), doesWiregroupCrossStrip(), and matchingPads().

242 { return GEMDetId(p.first).roll(); }
int roll() const
Definition: GEMDetId.h:188
int CSCGEMMotherboard::getRoll ( const GEMCoPadDigiId p) const
protected

Definition at line 244 of file CSCGEMMotherboard.cc.

244 { return p.second.roll(); }
std::pair< int, int > CSCGEMMotherboard::getRolls ( const CSCALCTDigi alct) const
protected

Definition at line 246 of file CSCGEMMotherboard.cc.

References CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(), CSCALCTDigi::getKeyWG(), getLUT(), and CSCUpgradeMotherboard::theParity.

Referenced by bestMatchingPad(), and doesWiregroupCrossStrip().

246  {
247  return std::make_pair((getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.getKeyWG()].first,
248  (getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.getKeyWG()].second);
249 }
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:59
std::vector< std::pair< int, int > > get_csc_wg_to_gem_roll(Parity par, int layer=1) const
bool CSCGEMMotherboard::isGEMDetId ( unsigned int  p) const
protected

Definition at line 234 of file CSCGEMMotherboard.cc.

References MuonSubdetId::GEM, and DetId::Muon.

Referenced by bestMatchingPad(), and doesWiregroupCrossStrip().

234  {
235  return (DetId(p).subdetId() == MuonSubdetId::GEM and DetId(p).det() == DetId::Muon);
236 }
static constexpr int GEM
Definition: MuonSubdetId.h:14
Definition: DetId.h:17
bool CSCGEMMotherboard::isPadInOverlap ( int  roll) const
protected

Definition at line 221 of file CSCGEMMotherboard.cc.

References dqmdumpme::first, CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(), getLUT(), mps_fire::i, or, edm::second(), and CSCUpgradeMotherboard::theParity.

Referenced by doesWiregroupCrossStrip(), printGEMTriggerCoPads(), and printGEMTriggerPads().

221  {
222  // this only works for ME1A!
223  const auto& mymap = (getLUT()->get_csc_wg_to_gem_roll(theParity));
224  for (unsigned i = 0; i < mymap.size(); i++) {
225  // overlap region are WGs 10-15
226  if ((i < 10) or (i > 15))
227  continue;
228  if ((mymap[i].first <= roll) and (roll <= mymap[i].second))
229  return true;
230  }
231  return false;
232 }
U second(std::pair< T, U > const &p)
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
Definition: Activities.doc:12
virtual const CSCGEMMotherboardLUT * getLUT() const =0
std::vector< std::pair< int, int > > get_csc_wg_to_gem_roll(Parity par, int layer=1) const
template<class T >
void CSCGEMMotherboard::matchingPads ( const CSCALCTDigi alct,
matches< T > &  result 
) const
protected

Definition at line 243 of file CSCGEMMotherboard.h.

References funct::abs(), DEFAULT_MATCHING_VALUE, dumpMFGeometry_cfg::delta, CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(), CSCALCTDigi::getBX(), getBX(), CSCALCTDigi::getKeyWG(), getLUT(), getRoll(), CSCALCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, or, AlCaHLTBitMon_ParallelJobs::p, GEMDetId::station(), and CSCUpgradeMotherboard::theParity.

Referenced by doesWiregroupCrossStrip().

243  {
244  result.clear();
245  // Invalid ALCTs have no matching pads
246  if (not alct.isValid())
247  return;
248 
249  // Get the corresponding roll numbers for a given ALCT
250  std::pair<int, int> alctRoll = (getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.getKeyWG()];
251 
252  // Get the pads in the ALCT bx
253  const matchesBX<T>& lut = getPads<T>();
254 
255  // If no pads in that bx...
256  if (lut.count(alct.getBX()) == 0)
257  return;
258 
259  for (const auto& p : lut.at(alct.getBX())) {
260  auto padRoll(getRoll(p));
261 
262  int delta;
263  if (GEMDetId(p.first).station() == 2)
264  delta = 1;
265 
266  // pad bx needs to match to ALCT bx
267  int pad_bx = getBX(p.second) + CSCConstants::LCT_CENTRAL_BX;
268 
269  if (std::abs(alct.getBX() - pad_bx) > getMaxDeltaBX<T>())
270  continue;
271 
272  // gem roll number if invalid
273  if (alctRoll.first == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
275  continue;
276  // ALCTs at the top of the chamber
277  else if (alctRoll.first == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and padRoll > alctRoll.second)
278  continue;
279  // ALCTs at the bottom of the chamber
280  else if (alctRoll.second == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and padRoll < alctRoll.first)
281  continue;
282  // ignore pads that are too far away in roll number
283  else if ((alctRoll.first != CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
284  alctRoll.second != CSCGEMMotherboard::DEFAULT_MATCHING_VALUE) and
285  (alctRoll.first - delta > padRoll or padRoll > alctRoll.second))
286  continue;
287  result.push_back(p);
288  }
289 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
int getBX(const GEMPadDigi &p) 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
Definition: Activities.doc:12
int station() const
Definition: GEMDetId.h:173
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int getRoll(const GEMPadDigiId &p) const
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:65
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:59
std::vector< std::pair< int, int > > get_csc_wg_to_gem_roll(Parity par, int layer=1) const
template<class T >
void CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi alct,
matches< T > &  result 
) const
protected

Definition at line 292 of file CSCGEMMotherboard.h.

References funct::abs(), dqmdumpme::first, CSCGEMMotherboardLUT::get_csc_hs_to_gem_pad(), CSCCLCTDigi::getBX(), getBX(), CSCUpgradeMotherboard::getCSCPart(), CSCCLCTDigi::getKeyStrip(), getLUT(), getPad(), CSCCLCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, CSCConstants::MAX_HALF_STRIP_ME1B, maxDeltaPadL1_, ME1A, or, AlCaHLTBitMon_ParallelJobs::p, edm::second(), and CSCUpgradeMotherboard::theParity.

292  {
293  result.clear();
294  // Invalid ALCTs have no matching pads
295  if (not clct.isValid())
296  return;
297 
298  auto part(getCSCPart(clct.getKeyStrip()));
299  // Get the corresponding pad numbers for a given CLCT
300  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(theParity, part));
301  int keyStrip = clct.getKeyStrip();
302  //ME1A part, convert halfstrip from 128-223 to 0-95
304  keyStrip = keyStrip - CSCConstants::MAX_HALF_STRIP_ME1B - 1;
305  const int lowPad(mymap[keyStrip].first);
306  const int highPad(mymap[keyStrip].second);
307 
308  // Get the pads in the CLCT bx
309  const matchesBX<T>& lut = getPads<T>();
310 
311  // If no pads in that bx...
312  if (lut.count(clct.getBX()) == 0)
313  return;
314 
315  for (const auto& p : lut.at(clct.getBX())) {
316  // pad bx needs to match to CLCT bx
317  int pad_bx = getBX(p.second) + CSCConstants::LCT_CENTRAL_BX;
318  if (std::abs(clct.getBX() - pad_bx) > getMaxDeltaBX<T>())
319  continue;
320 
321  // pad number must match
322  int padNumber(getPad(p.second));
323  if (std::abs(lowPad - padNumber) <= maxDeltaPadL1_ or std::abs(padNumber - highPad) <= maxDeltaPadL1_) {
324  result.push_back(p);
325  }
326  }
327 }
int getBX(const GEMPadDigi &p) const
U second(std::pair< T, U > const &p)
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
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float getPad(const GEMPadDigi &) const
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
virtual std::vector< std::pair< int, int > > get_csc_hs_to_gem_pad(Parity par, enum CSCPart) const =0
enum CSCPart getCSCPart(int keystrip) const
template<class S , class T >
void CSCGEMMotherboard::matchingPads ( const S d1,
const S d2,
matches< T > &  result 
) const
protected

Definition at line 330 of file CSCGEMMotherboard.h.

References begin, end, p1, and p2.

330  {
331  matches<T> p1, p2;
332 
333  // pads matching to the CLCT/ALCT
334  matchingPads<T>(d1, p1);
335 
336  // pads matching to the CLCT/ALCT
337  matchingPads<T>(d2, p2);
338 
339  // collect *all* matching pads
340  result.reserve(p1.size() + p2.size());
341  result.insert(std::end(result), std::begin(p1), std::end(p1));
342  result.insert(std::end(result), std::begin(p2), std::end(p2));
343 }
#define end
Definition: vmac.h:39
double p2[4]
Definition: TauolaWrapper.h:90
#define begin
Definition: vmac.h:32
double p1[4]
Definition: TauolaWrapper.h:89
template<class T >
void CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi clct1,
const CSCALCTDigi alct1,
matches< T > &  result 
) const
protected

Definition at line 346 of file CSCGEMMotherboard.h.

References CSCUpgradeMotherboard::intersection().

346  {
347  matches<T> padsClct, padsAlct;
348 
349  // pads matching to the CLCT
350  matchingPads<T>(clct1, padsClct);
351 
352  // pads matching to the ALCT
353  matchingPads<T>(alct1, padsAlct);
354 
355  // collect all *common* pads
356  intersection(padsClct, padsAlct, result);
357 }
void intersection(const S &d1, const S &d2, S &result) const
template<class T >
void CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi clct1,
const CSCCLCTDigi clct2,
const CSCALCTDigi alct1,
const CSCALCTDigi alct2,
matches< T > &  result 
) const
protected

Definition at line 360 of file CSCGEMMotherboard.h.

References begin, and end.

364  {
365  matches<T> padsClct, padsAlct;
366 
367  // pads matching to CLCTs
368  matchingPads<CSCCLCTDigi, T>(clct1, clct2, padsClct);
369 
370  // pads matching to ALCTs
371  matchingPads<CSCALCTDigi, T>(alct1, alct2, padsAlct);
372 
373  // collect *all* matching pads
374  result.reserve(padsClct.size() + padsAlct.size());
375  result.insert(std::end(result), std::begin(padsClct), std::end(padsClct));
376  result.insert(std::end(result), std::begin(padsAlct), std::end(padsAlct));
377 }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
void CSCGEMMotherboard::printGEMTriggerCoPads ( int  bx_start,
int  bx_stop,
enum CSCPart  part 
)
protected

Definition at line 293 of file CSCGEMMotherboard.cc.

References l1GtPatternGenerator_cfi::bx, coPads_, isPadInOverlap(), LogTrace, and ME11.

Referenced by doesWiregroupCrossStrip(), CSCGEMMotherboardME21::run(), and CSCGEMMotherboardME11::run().

293  {
294  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------"
295  << std::endl;
296  LogTrace("CSCGEMMotherboard") << "* GEM trigger coincidence pads: " << std::endl;
297 
298  for (int bx = bx_start; bx <= bx_stop; bx++) {
299  const auto& in_pads = coPads_[bx];
300  LogTrace("CSCGEMMotherboard") << "N(copads) BX " << bx << " : " << in_pads.size() << std::endl;
301 
302  for (const auto& pad : in_pads) {
303  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
304  const auto& roll_id(GEMDetId(pad.first));
305 
306  if (part == CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll()))
307  LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
308  else
309  LogTrace("CSCGEMMotherboard") << std::endl;
310  }
311  }
312 }
GEMCoPadDigiIdsBX coPads_
#define LogTrace(id)
bool isPadInOverlap(int roll) const
part
Definition: HCALResponse.h:20
void CSCGEMMotherboard::printGEMTriggerPads ( int  bx_start,
int  bx_stop,
enum CSCPart  part 
)
protected

Definition at line 272 of file CSCGEMMotherboard.cc.

References l1GtPatternGenerator_cfi::bx, isPadInOverlap(), LogTrace, ME11, and pads_.

Referenced by doesWiregroupCrossStrip(), CSCGEMMotherboardME21::run(), and CSCGEMMotherboardME11::run().

272  {
273  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------"
274  << std::endl;
275  LogTrace("CSCGEMMotherboard") << "* GEM trigger pads: " << std::endl;
276 
277  for (int bx = bx_start; bx <= bx_stop; bx++) {
278  const auto& in_pads = pads_[bx];
279  LogTrace("CSCGEMMotherboard") << "N(pads) BX " << bx << " : " << in_pads.size() << std::endl;
280 
281  for (const auto& pad : in_pads) {
282  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
283  const auto& roll_id(GEMDetId(pad.first));
284 
285  if (part == CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll()))
286  LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
287  else
288  LogTrace("CSCGEMMotherboard") << std::endl;
289  }
290  }
291 }
#define LogTrace(id)
bool isPadInOverlap(int roll) const
part
Definition: HCALResponse.h:20
GEMPadDigiIdsBX pads_
void CSCGEMMotherboard::retrieveGEMCoPads ( )
protected

Definition at line 65 of file CSCGEMMotherboard.cc.

References coPads_, gemCoPadV, CSCConstants::LCT_CENTRAL_BX, DetId::rawId(), CSCBaseboard::theChamber, CSCBaseboard::theRegion, and CSCBaseboard::theStation.

Referenced by doesWiregroupCrossStrip(), CSCGEMMotherboardME21::run(), and CSCGEMMotherboardME11::run().

65  {
66  coPads_.clear();
67  for (const auto& copad : gemCoPadV) {
68  GEMDetId detId(theRegion, 1, theStation, 0, theChamber, 0);
69  // only consider matches with same BX
70  coPads_[CSCConstants::LCT_CENTRAL_BX + copad.bx(1)].emplace_back(detId.rawId(), copad);
71  }
72 }
GEMCoPadDigiIdsBX coPads_
std::vector< GEMCoPadDigi > gemCoPadV
unsigned theChamber
Definition: CSCBaseboard.h:44
unsigned theRegion
Definition: CSCBaseboard.h:42
const unsigned theStation
Definition: CSCBaseboard.h:38
void CSCGEMMotherboard::retrieveGEMPads ( const GEMPadDigiCollection pads,
unsigned  id 
)
protected

Definition at line 47 of file CSCGEMMotherboard.cc.

References l1GtPatternGenerator_cfi::bx, gem_g, CSCConstants::LCT_CENTRAL_BX, maxDeltaBXPad_, pads_, and GEMGeometry::superChamber().

Referenced by doesWiregroupCrossStrip(), CSCGEMMotherboardME21::run(), and CSCGEMMotherboardME11::run().

47  {
48  pads_.clear();
49  auto superChamber(gem_g->superChamber(id));
50  for (const auto& ch : superChamber->chambers()) {
51  for (const auto& roll : ch->etaPartitions()) {
52  GEMDetId roll_id(roll->id());
53  auto pads_in_det = gemPads->get(roll_id);
54  for (auto pad = pads_in_det.first; pad != pads_in_det.second; ++pad) {
55  const int bx_shifted(CSCConstants::LCT_CENTRAL_BX + pad->bx());
56  // consider matches with BX difference +1/0/-1
57  for (int bx = bx_shifted - maxDeltaBXPad_; bx <= bx_shifted + maxDeltaBXPad_; ++bx) {
58  pads_[bx].emplace_back(roll_id.rawId(), *pad);
59  }
60  }
61  }
62  }
63 }
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:69
GEMPadDigiIdsBX pads_
const GEMGeometry * gem_g
virtual void CSCGEMMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiCollection gemPads 
)
pure virtual

Implemented in CSCGEMMotherboardME11, and CSCGEMMotherboardME21.

Referenced by run().

void CSCGEMMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiClusterCollection gemPads 
)

Definition at line 39 of file CSCGEMMotherboard.cc.

References coPadProcessor, and run().

41  {
42  std::unique_ptr<GEMPadDigiCollection> gemPads(new GEMPadDigiCollection());
43  coPadProcessor->declusterize(gemClusters, *gemPads);
44  run(wiredc, compdc, gemPads.get());
45 }
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)=0
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection
void CSCGEMMotherboard::setGEMGeometry ( const GEMGeometry g)
inline

set CSC and GEM geometries for the matching needs

Definition at line 66 of file CSCGEMMotherboard.h.

References g, gem_g, and getLUT().

Referenced by CSCTriggerPrimitivesBuilder::build().

66 { gem_g = g; }
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
Definition: Activities.doc:4
const GEMGeometry * gem_g
void CSCGEMMotherboard::setupGeometry ( )
protected

Definition at line 267 of file CSCGEMMotherboard.cc.

References gem_g, CSCUpgradeMotherboard::generator_, and CSCUpgradeMotherboard::setupGeometry().

Referenced by doesWiregroupCrossStrip(), CSCGEMMotherboardME21::run(), and CSCGEMMotherboardME11::run().

267  {
269  generator_->setGEMGeometry(gem_g);
270 }
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
const GEMGeometry * gem_g

Member Data Documentation

std::unique_ptr<GEMCoPadProcessor> CSCGEMMotherboard::coPadProcessor
GEMCoPadDigiIdsBX CSCGEMMotherboard::coPads_
protected
bool CSCGEMMotherboard::doLCTGhostBustingWithGEMs_
protected

Definition at line 229 of file CSCGEMMotherboard.h.

const GEMGeometry* CSCGEMMotherboard::gem_g
protected
std::vector<GEMCoPadDigi> CSCGEMMotherboard::gemCoPadV
protected
bool CSCGEMMotherboard::gemGeometryAvailable
protected

Definition at line 205 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboardME11::run(), and CSCGEMMotherboardME21::run().

unsigned CSCGEMMotherboard::gemId
protected

Chamber id (trigger-type labels).

Definition at line 202 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), CSCGEMMotherboardME21::run(), and CSCGEMMotherboardME11::run().

int CSCGEMMotherboard::maxDeltaBXCoPad_
protected
int CSCGEMMotherboard::maxDeltaBXPad_
protected

Definition at line 214 of file CSCGEMMotherboard.h.

Referenced by getMaxDeltaBX(), and retrieveGEMPads().

int CSCGEMMotherboard::maxDeltaPadL1_
protected

Definition at line 216 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchingPads().

int CSCGEMMotherboard::maxDeltaPadL2_
protected

Definition at line 217 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

GEMPadDigiIdsBX CSCGEMMotherboard::pads_
protected
bool CSCGEMMotherboard::promoteALCTGEMpattern_
protected

Definition at line 223 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteALCTGEMquality_
protected

Definition at line 225 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteCLCTGEMquality_
protected

Definition at line 226 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::useOldLCTDataFormat_
protected

Definition at line 220 of file CSCGEMMotherboard.h.