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 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, enum CSCPart) const
 
template<class S >
S bestMatchingPad (const CSCCLCTDigi &clct, const matches< S > &pads, enum CSCPart part) const
 
template<class S >
S bestMatchingPad (const CSCALCTDigi &alct1, const CSCCLCTDigi &clct1, const matches< S > &pads, enum CSCPart part) 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
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 ()
 
template<class S >
void intersection (const S &d1, const S &d2, S &result) const
 
void setCSCGeometry (const CSCGeometry *g)
 
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
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const
 
void run (const std::vector< int > w_time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES], const std::vector< int > hs_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const std::vector< int > ds_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCMotherboard ()=default
 

Public Attributes

std::unique_ptr< GEMCoPadProcessorcoPadProcessor
 
- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralct
 
std::unique_ptr< CSCCathodeLCTProcessorclct
 

Protected Member Functions

template<class T >
T bestMatchingPad (const CSCALCTDigi &, const matches< T > &, enum CSCPart) const
 
template<class T >
T bestMatchingPad (const CSCCLCTDigi &, const matches< T > &, enum CSCPart) const
 
template<class T >
T bestMatchingPad (const CSCALCTDigi &, const CSCCLCTDigi &, const matches< T > &, enum CSCPart) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, enum CSCPart p, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem, enum CSCPart p, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem1, const GEMCoPadDigi &gem2, enum CSCPart p, int i) const
 
template<class T >
void correlateLCTsGEM (T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart) const
 
template<class T >
void correlateLCTsGEM (const T &best, const T &second, const GEMCoPadDigi &, const GEMCoPadDigi &, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart) 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 part) const
 
int getRoll (const GEMPadDigiId &p) const
 
int getRoll (const GEMCoPadDigiId &p) const
 
int getRoll (const CSCALCTDigi &) const
 
bool isGEMDetId (unsigned int) const
 
bool isPadInOverlap (int roll) const
 
template<class T >
void matchingPads (const CSCALCTDigi &alct, enum CSCPart part, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &alct, enum CSCPart part, matches< T > &) const
 
template<class S , class T >
void matchingPads (const S &d1, const S &d2, enum CSCPart part, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &clct1, const CSCALCTDigi &alct1, enum CSCPart part, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &clct1, const CSCCLCTDigi &clct2, const CSCALCTDigi &alct1, const CSCALCTDigi &alct2, enum CSCPart part, 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 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 ptn, const int highPt) const
 
unsigned int findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
 
void testLCT ()
 

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
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
edm::ParameterSet commonParams_
 
const CSCGeometrycsc_g
 
const CSCChambercscChamber
 
bool debug_luts
 
bool debug_matching
 
bool drop_used_clcts
 
std::unique_ptr< CSCUpgradeMotherboardLUTGeneratorgenerator_
 
bool match_earliest_alct_only
 
bool match_earliest_clct_only
 
unsigned int max_lcts
 
Parity par
 
int pref [CSCConstants::MAX_LCT_TBINS]
 
unsigned theChamber
 
unsigned theRegion
 
unsigned int tmb_cross_bx_algo
 
edm::ParameterSet tmbParams_
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
const CSCGeometrycsc_g
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
int infoV
 
bool isMTCC
 
bool isSLHC
 
bool isTMB07
 
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]
 
const unsigned theEndcap
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
unsigned int tmb_l1a_window_size
 

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 33 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 4 of file CSCGEMMotherboard.cc.

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

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

Definition at line 30 of file CSCGEMMotherboard.cc.

CSCGEMMotherboard::~CSCGEMMotherboard ( )
override

Definition at line 34 of file CSCGEMMotherboard.cc.

35 {
36 }

Member Function Documentation

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

Referenced by setGEMGeometry().

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

Definition at line 395 of file CSCGEMMotherboard.h.

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

398 {
399  S result;
400  // no matching pads for invalid stub
401  if (not alct1.isValid()) return result;
402 
403  // return the first one with the same roll number
404  for (const auto& p: pads){
405 
406  // protection against corrupted DetIds
407  if (not isGEMDetId(p.first)) continue;
408 
409  // roll number of pad and ALCT must match
410  if (getRoll(p) == getRoll(alct1)){
411  return p.second;
412  }
413  }
414  return result;
415 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
int getRoll(const GEMPadDigiId &p) const
bool isGEMDetId(unsigned int) const
template<class S >
S CSCGEMMotherboard::bestMatchingPad ( const CSCCLCTDigi clct,
const matches< S > &  pads,
enum CSCPart  part 
) const

Definition at line 418 of file CSCGEMMotherboard.h.

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

421 {
422  S result;
423  // no matching pads for invalid stub
424  if (not clct.isValid()) return result;
425 
426  // return the pad with the smallest bending angle
427  float averagePadNumberCSC = getPad(clct, part);
428  float minDeltaPad = 999;
429  for (const auto& p: pads){
430 
431  // protection against corrupted DetIds
432  if (not isGEMDetId(p.first)) continue;
433 
434  // best pad is closest to CLCT in number of halfstrips
435  float averagePadNumberGEM = getPad(p.second);
436  if (std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad){
437  minDeltaPad = std::abs(averagePadNumberCSC - averagePadNumberGEM);
438  result = p.second;
439  }
440  }
441  return result;
442 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
bool isGEMDetId(unsigned int) const
float getPad(const GEMPadDigi &) const
part
Definition: HCALResponse.h:20
template<class S >
S CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi alct1,
const CSCCLCTDigi clct1,
const matches< S > &  pads,
enum CSCPart  part 
) const

Definition at line 445 of file CSCGEMMotherboard.h.

References funct::abs(), getPad(), getRoll(), isGEMDetId(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), or, AlCaHLTBitMon_ParallelJobs::p, and mps_fire::result.

449 {
450  S result;
451  // no matching pads for invalid stub
452  if (not alct1.isValid() or not clct1.isValid()) return result;
453 
454  // return the pad with the smallest bending angle
455  float averagePadNumberCSC = getPad(clct1, part);
456  float minDeltaPad = 999;
457  for (const auto& p: pads){
458 
459  // protection against corrupted DetIds
460  if (not isGEMDetId(p.first)) continue;
461 
462  float averagePadNumberGEM = getPad(p.second);
463  // add another safety to make sure that the deltaPad is not larger than max value!!!
464  if (std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad and
465  getRoll(p) == getRoll(alct1)){
466  minDeltaPad = std::abs(averagePadNumberCSC - averagePadNumberGEM);
467  result = p.second;
468  }
469  }
470  return result;
471 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
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
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
int getRoll(const GEMPadDigiId &p) const
bool isGEMDetId(unsigned int) const
float getPad(const GEMPadDigi &) const
part
Definition: HCALResponse.h:20
void CSCGEMMotherboard::clear ( void  )

Definition at line 38 of file CSCGEMMotherboard.cc.

References coPads_, and pads_.

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

39 {
40  pads_.clear();
41  coPads_.clear();
42 }
GEMCoPadDigiIdsBX coPads_
GEMPadDigiIdsBX pads_
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const GEMCoPadDigi gem,
enum CSCPart  part,
int  i 
) const
protected

Definition at line 84 of file CSCGEMMotherboard.cc.

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

88 {
89  return constructLCTsGEM(alct, CSCCLCTDigi(), GEMPadDigi(), gem, part, trknmb);
90 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
part
Definition: HCALResponse.h:20
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCCLCTDigi clct,
const GEMCoPadDigi gem,
enum CSCPart  part,
int  i 
) const
protected

Definition at line 93 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

97 {
98  return constructLCTsGEM(CSCALCTDigi(), clct, GEMPadDigi(), gem, part, trknmb);
99 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
part
Definition: HCALResponse.h:20
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMCoPadDigi gem,
enum CSCPart  p,
int  i 
) const
protected

Definition at line 101 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

106 {
107  return constructLCTsGEM(alct, clct, GEMPadDigi(), gem, part, trknmb);
108 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
part
Definition: HCALResponse.h:20
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMPadDigi gem,
enum CSCPart  p,
int  i 
) const
protected

Definition at line 111 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

116 {
117  return constructLCTsGEM(alct, clct, gem, GEMCoPadDigi(), part, trknmb);
118 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
part
Definition: HCALResponse.h:20
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMPadDigi gem1,
const GEMCoPadDigi gem2,
enum CSCPart  p,
int  i 
) const
protected

Definition at line 120 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::ALCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCTGEM, GEMCoPadDigi::bx(), CSCCorrelatedLCTDigi::CLCT2GEM, CSCMotherboard::encodePattern(), findQualityGEM(), GEMCoPadDigi::first(), CSCGEMMotherboardLUT::get_gem_pad_to_csc_hs(), CSCGEMMotherboardLUT::get_gem_roll_to_csc_wg(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), getLUT(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), GEMPadDigi::isValid(), GEMCoPadDigi::isValid(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, GEMCoPadDigi::pad(), CSCUpgradeMotherboard::par, listBenchmarks::pattern, promoteALCTGEMpattern_, promoteALCTGEMquality_, promoteCLCTGEMquality_, jets_cff::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(), and CSCMotherboard::theTrigChamber.

125 {
126  int pattern = 0, quality = 0, bx = 0, keyStrip = 0, keyWG = 0, bend = 0;
127 
128  // make a new LCT
129  CSCCorrelatedLCTDigi thisLCT;
130 
131  // Determine the case and assign properties depending on the LCT dataformat (old/new)
132  if (alct.isValid() and clct.isValid() and gem1.isValid() and not gem2.isValid()) {
133  pattern = encodePattern(clct.getPattern(), clct.getStripType());
134  quality = findQualityGEM(alct, clct, 1);
135  bx = alct.getBX();
136  keyStrip = clct.getKeyStrip();
137  keyWG = alct.getKeyWG();
138  bend = clct.getBend();
139  thisLCT.setALCT(alct);
140  thisLCT.setCLCT(clct);
141  thisLCT.setGEM1(gem1);
143  }
144  else if (alct.isValid() and clct.isValid() and not gem1.isValid() and gem2.isValid()) {
145  pattern = encodePattern(clct.getPattern(), clct.getStripType());
146  quality = findQualityGEM(alct, clct, 2);
147  bx = alct.getBX();
148  keyStrip = clct.getKeyStrip();
149  keyWG = alct.getKeyWG();
150  bend = clct.getBend();
151  thisLCT.setALCT(alct);
152  thisLCT.setCLCT(clct);
153  thisLCT.setGEM1(gem2.first());
154  thisLCT.setGEM2(gem2.second());
156  }
157  else if (alct.isValid() and gem2.isValid()) {
158  const auto& mymap1 = getLUT()->get_gem_pad_to_csc_hs(par, p);
159  pattern = promoteALCTGEMpattern_ ? 10 : 0;
160  quality = promoteALCTGEMquality_ ? 15 : 11;
161  bx = alct.getBX();
162  keyStrip = mymap1[gem2.pad(2)];
163  keyWG = alct.getKeyWG();
164  thisLCT.setALCT(alct);
165  thisLCT.setGEM1(gem2.first());
166  thisLCT.setGEM2(gem2.second());
168  }
169  else if (clct.isValid() and gem2.isValid()) {
170  const auto& mymap2 = getLUT()->get_gem_roll_to_csc_wg(par, p);
171  pattern = encodePattern(clct.getPattern(), clct.getStripType());
172  quality = promoteCLCTGEMquality_ ? 15 : 11;
173  bx = gem2.bx(1) + CSCConstants::LCT_CENTRAL_BX;
174  keyStrip = clct.getKeyStrip();
175  // choose the corresponding wire-group in the middle of the partition
176  keyWG = mymap2[gem2.roll()];
177  bend = clct.getBend();
178  thisLCT.setCLCT(clct);
179  thisLCT.setGEM1(gem2.first());
180  thisLCT.setGEM2(gem2.second());
182  }
183 
184  // fill the rest of the properties
185  thisLCT.setTrknmb(trknmb);
186  thisLCT.setValid(1);
187  thisLCT.setQuality(quality);
188  thisLCT.setWireGroup(keyWG);
189  thisLCT.setStrip(keyStrip);
190  thisLCT.setPattern(pattern);
191  thisLCT.setBend(bend);
192  thisLCT.setBX(bx);
193  thisLCT.setMPCLink(0);
194  thisLCT.setBX0(0);
195  thisLCT.setSyncErr(0);
196  thisLCT.setCSCID(theTrigChamber);
197 
198  // future work: add a section that produces LCTs according
199  // to the new LCT dataformat (not yet defined)
200 
201  // return new LCT
202  return thisLCT;
203 }
bool isValid() const
Definition: GEMPadDigi.cc:48
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
const unsigned theTrigChamber
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
void setBX0(unsigned int b)
set bx0
std::vector< int > get_gem_roll_to_csc_wg(Parity par, int layer=1) const
void setQuality(unsigned int q)
set quality code
int pad(int l) const
Definition: GEMCoPadDigi.cc:38
int getStripType() const
return striptype
Definition: CSCCLCTDigi.h:48
int getBend() const
return bend
Definition: CSCCLCTDigi.h:54
void setMPCLink(const uint16_t &link)
Set mpc link number after MPC sorting.
bool isValid() const
Definition: GEMCoPadDigi.cc:32
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:46
void setStrip(unsigned int s)
set strip
unsigned int findQualityGEM(const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer) const
GEMPadDigi first() const
Definition: GEMCoPadDigi.h:30
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
void setCSCID(unsigned int c)
set cscID
int roll() const
Definition: GEMCoPadDigi.h:26
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:63
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:42
GEMPadDigi second() const
Definition: GEMCoPadDigi.h:31
unsigned int encodePattern(const int ptn, const int highPt) const
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyStrip() const
Definition: CSCCLCTDigi.h:89
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:57
void setGEM1(const GEMPadDigi &gem)
template<class T >
void CSCGEMMotherboard::correlateLCTsGEM ( T best,
T second,
const GEMCoPadDigiIds coPads,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
enum CSCPart  p 
) const
protected

Definition at line 474 of file CSCGEMMotherboard.h.

References AlCaHLTBitMon_ParallelJobs::p, and CSCMotherboard::secondLCT.

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

480 {
481  // Check which LCTs are valid
482  bool bestValid = bestLCT.isValid();
483  bool secondValid = secondLCT.isValid();
484 
485  // At this point, set both LCTs valid if they are invalid
486  // Duplicate LCTs are taken into account later
487  if (bestValid and !secondValid) secondLCT = bestLCT;
488  if (!bestValid and secondValid) bestLCT = secondLCT;
489 
490  // get best matching copad1
491  const GEMCoPadDigi& bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads, p);
492  const GEMCoPadDigi& secondCoPad = bestMatchingPad<GEMCoPadDigi>(secondLCT, coPads, p);
493 
494  correlateLCTsGEM(bestLCT, secondLCT, bestCoPad, secondCoPad, lct1, lct2, p);
495 }
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart) const
bool isValid() const
return valid pattern bit
template<class T >
void CSCGEMMotherboard::correlateLCTsGEM ( const T best,
const T second,
const GEMCoPadDigi bestCoPad,
const GEMCoPadDigi secondCoPad,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
enum CSCPart  p 
) const
protected

Definition at line 499 of file CSCGEMMotherboard.h.

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

506 {
507  // construct the first LCT from ALCT(CLCT) and a GEM Copad
508  if ((getLctTrigEnable<T>() and bestLCT.isValid()) or
509  (match_trig_enable and bestLCT.isValid()))
510  {
511  lct1 = constructLCTsGEM(bestLCT, bestCoPad, p, 1);
512  }
513 
514  // construct the second LCT from ALCT(CLCT) and a GEM Copad
515  if ((getLctTrigEnable<T>() and secondLCT.isValid()) or
516  (match_trig_enable and secondLCT.isValid() and secondLCT != bestLCT))
517  {
518  lct2 = constructLCTsGEM(secondLCT, secondCoPad, p, 2);
519  }
520 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
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
bool isValid() const
return valid pattern bit
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(), CSCCLCTDigi::getQuality(), CSCALCTDigi::getQuality(), CSCMotherboard::infoV, cond::time::INVALID, CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), or, listBenchmarks::pattern, and CSCMotherboard::theStation.

Referenced by constructLCTsGEM(), and setGEMGeometry().

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

Definition at line 224 of file CSCGEMMotherboard.cc.

References GEMPadDigi::bx().

Referenced by matchingPads(), and setGEMGeometry().

225 {
226  return p.bx();
227 }
int bx() const
Definition: GEMPadDigi.h:28
int CSCGEMMotherboard::getBX ( const GEMCoPadDigi p) const
protected

Definition at line 229 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::bx().

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

Definition at line 433 of file CSCGEMMotherboard.cc.

References CSCMotherboard::alct_trig_enable.

434 {
435  return alct_trig_enable;
436 }
unsigned int alct_trig_enable
template<>
int CSCGEMMotherboard::getLctTrigEnable ( ) const
private

Definition at line 439 of file CSCGEMMotherboard.cc.

References CSCMotherboard::clct_trig_enable.

440 {
441  return clct_trig_enable;
442 }
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 421 of file CSCGEMMotherboard.cc.

References maxDeltaBXPad_.

422 {
423  return maxDeltaBXPad_;
424 }
template<>
int CSCGEMMotherboard::getMaxDeltaBX ( ) const
private

Definition at line 427 of file CSCGEMMotherboard.cc.

References maxDeltaBXCoPad_.

428 {
429  return maxDeltaBXCoPad_;
430 }
float CSCGEMMotherboard::getPad ( const GEMPadDigi p) const
protected

Definition at line 249 of file CSCGEMMotherboard.cc.

References GEMPadDigi::pad().

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

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

Definition at line 254 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::pad().

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

Definition at line 260 of file CSCGEMMotherboard.cc.

References CSCGEMMotherboardLUT::get_csc_hs_to_gem_pad(), CSCCLCTDigi::getKeyStrip(), getLUT(), and CSCUpgradeMotherboard::par.

261 {
262  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(par, part));
263  return 0.5*(mymap[clct.getKeyStrip()].first + mymap[clct.getKeyStrip()].second);
264 }
virtual std::vector< std::pair< int, int > > get_csc_hs_to_gem_pad(Parity par, enum CSCPart) const =0
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyStrip() const
Definition: CSCCLCTDigi.h:89
template<class T >
const matchesBX<T>& CSCGEMMotherboard::getPads ( ) const
private
template<>
const matchesBX<GEMPadDigi>& CSCGEMMotherboard::getPads ( ) const
private

Definition at line 409 of file CSCGEMMotherboard.cc.

References pads_.

410 {
411  return pads_;
412 }
GEMPadDigiIdsBX pads_
template<>
const matchesBX<GEMCoPadDigi>& CSCGEMMotherboard::getPads ( ) const
private

Definition at line 415 of file CSCGEMMotherboard.cc.

References coPads_.

416 {
417  return coPads_;
418 }
GEMCoPadDigiIdsBX coPads_
int CSCGEMMotherboard::getRoll ( const GEMPadDigiId p) const
protected

Definition at line 234 of file CSCGEMMotherboard.cc.

References GEMDetId::roll().

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

235 {
236  return GEMDetId(p.first).roll();
237 }
int roll() const
Definition: GEMDetId.h:80
int CSCGEMMotherboard::getRoll ( const GEMCoPadDigiId p) const
protected

Definition at line 239 of file CSCGEMMotherboard.cc.

240 {
241  return p.second.roll();
242 }
int CSCGEMMotherboard::getRoll ( const CSCALCTDigi alct) const
protected

Definition at line 244 of file CSCGEMMotherboard.cc.

References CSCALCTDigi::getKeyWG(), getLUT(), and CSCUpgradeMotherboard::par.

245 {
246  return (getLUT()->get_csc_wg_to_gem_roll(par))[alct.getKeyWG()].first;
247 }
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:57
bool CSCGEMMotherboard::isGEMDetId ( unsigned int  p) const
protected

Definition at line 218 of file CSCGEMMotherboard.cc.

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

Referenced by bestMatchingPad(), and setGEMGeometry().

219 {
220  return (DetId(p).subdetId() == MuonSubdetId::GEM and
221  DetId(p).det() == DetId::Muon);
222 }
static const int GEM
Definition: MuonSubdetId.h:15
Definition: DetId.h:18
bool CSCGEMMotherboard::isPadInOverlap ( int  roll) const
protected

Definition at line 206 of file CSCGEMMotherboard.cc.

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

Referenced by matchingPads(), printGEMTriggerCoPads(), printGEMTriggerPads(), and setGEMGeometry().

207 {
208  // this only works for ME1A!
209  const auto& mymap = (getLUT()->get_csc_wg_to_gem_roll(par));
210  for (unsigned i=0; i<mymap.size(); i++) {
211  // overlap region are WGs 10-15
212  if ((i < 10) or (i > 15)) continue;
213  if ((mymap[i].first <= roll) and (roll <= mymap[i].second)) return true;
214  }
215  return false;
216 }
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,
enum CSCPart  part,
matches< T > &  result 
) const
protected

Definition at line 253 of file CSCGEMMotherboard.h.

References funct::abs(), DEFAULT_MATCHING_VALUE, CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(), CSCALCTDigi::getBX(), getBX(), CSCALCTDigi::getKeyWG(), getLUT(), getRoll(), isPadInOverlap(), CSCALCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, lumiPlot::lut, ME1A, or, AlCaHLTBitMon_ParallelJobs::p, and CSCUpgradeMotherboard::par.

Referenced by setGEMGeometry().

256 {
257  result.clear();
258  // Invalid ALCTs have no matching pads
259  if (not alct.isValid()) return;
260 
261  // Get the corresponding roll numbers for a given ALCT
262  std::pair<int,int> alctRoll =
264 
265  // Get the pads in the ALCT bx
266  const matchesBX<T>& lut = getPads<T>();
267 
268  // If no pads in that bx...
269  if (lut.count(alct.getBX())==0) return;
270 
271  for (const auto& p: lut.at(alct.getBX())){
272  auto padRoll(getRoll(p));
273 
274  // only pads in overlap are good for ME1A
275  if (part==CSCPart::ME1A and !isPadInOverlap(padRoll)) continue;
276 
277  // pad bx needs to match to ALCT bx
278  int pad_bx = getBX(p.second)+CSCConstants::LCT_CENTRAL_BX;
279  if (std::abs(alct.getBX()-pad_bx)>getMaxDeltaBX<T>()) continue;
280 
281  // gem roll number if invalid
282  if (alctRoll.first == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
283  alctRoll.second == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE) continue;
284  // ALCTs at the top of the chamber
285  else if (alctRoll.first == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
286  padRoll > alctRoll.second) continue;
287  // ALCTs at the bottom of the chamber
288  else if (alctRoll.second == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
289  padRoll < alctRoll.first) continue;
290  // ignore pads that are too far away in roll number
291  else if ((alctRoll.first != CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
292  alctRoll.second != CSCGEMMotherboard::DEFAULT_MATCHING_VALUE) and
293  (alctRoll.first > padRoll or padRoll > alctRoll.second)) continue;
294  result.push_back(p);
295  }
296 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
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
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:63
bool isPadInOverlap(int roll) const
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:57
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,
enum CSCPart  part,
matches< T > &  result 
) const
protected

Definition at line 299 of file CSCGEMMotherboard.h.

References funct::abs(), CSCGEMMotherboardLUT::get_csc_hs_to_gem_pad(), getBX(), CSCCLCTDigi::getBX(), CSCCLCTDigi::getKeyStrip(), getLUT(), getPad(), CSCCLCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, lumiPlot::lut, maxDeltaPadL1_, or, AlCaHLTBitMon_ParallelJobs::p, and CSCUpgradeMotherboard::par.

302 {
303  result.clear();
304  // Invalid ALCTs have no matching pads
305  if (not clct.isValid()) return;
306 
307  // Get the corresponding pad numbers for a given CLCT
308  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(par, part));
309  const int lowPad(mymap[clct.getKeyStrip()].first);
310  const int highPad(mymap[clct.getKeyStrip()].second);
311 
312  // Get the pads in the CLCT bx
313  const matchesBX<T>& lut = getPads<T>();
314 
315  // If no pads in that bx...
316  if (lut.count(clct.getBX())==0) return;
317 
318  for (const auto& p: lut.at(clct.getBX())){
319 
320  // pad bx needs to match to CLCT bx
321  int pad_bx = getBX(p.second)+CSCConstants::LCT_CENTRAL_BX;
322  if (std::abs(clct.getBX()-pad_bx)>getMaxDeltaBX<T>()) continue;
323 
324  // pad number must match
325  int padNumber(getPad(p.second));
326  if (std::abs(lowPad - padNumber) <= maxDeltaPadL1_ or
327  std::abs(padNumber - highPad) <= maxDeltaPadL1_){
328  result.push_back(p);
329  }
330  }
331 }
int getBX(const GEMPadDigi &p) 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
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
std::unique_ptr< CSCCathodeLCTProcessor > clct
template<class S , class T >
void CSCGEMMotherboard::matchingPads ( const S d1,
const S d2,
enum CSCPart  part,
matches< T > &  result 
) const
protected

Definition at line 335 of file CSCGEMMotherboard.h.

References begin, end, p1, and p2.

338 {
339  matches<T> p1, p2;
340 
341  // pads matching to the CLCT/ALCT
342  matchingPads<T>(d1, part, p1);
343 
344  // pads matching to the CLCT/ALCT
345  matchingPads<T>(d2, part, p2);
346 
347  // collect *all* matching pads
348  result.reserve(p1.size() + p2.size());
349  result.insert(std::end(result), std::begin(p1), std::end(p1));
350  result.insert(std::end(result), std::begin(p2), std::end(p2));
351 }
#define end
Definition: vmac.h:39
double p2[4]
Definition: TauolaWrapper.h:90
part
Definition: HCALResponse.h:20
#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,
enum CSCPart  part,
matches< T > &  result 
) const
protected

Definition at line 354 of file CSCGEMMotherboard.h.

References CSCUpgradeMotherboard::intersection().

358 {
359  matches<T> padsClct, padsAlct;
360 
361  // pads matching to the CLCT
362  matchingPads<T>(clct1, part, padsClct);
363 
364  // pads matching to the ALCT
365  matchingPads<T>(alct1, part, padsAlct);
366 
367  // collect all *common* pads
368  intersection(padsClct, padsAlct, result);
369 }
part
Definition: HCALResponse.h:20
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,
enum CSCPart  part,
matches< T > &  result 
) const
protected

Definition at line 372 of file CSCGEMMotherboard.h.

References begin, and end.

378 {
379  matches<T> padsClct, padsAlct;
380 
381  // pads matching to CLCTs
382  matchingPads<CSCCLCTDigi, T>(clct1, clct2, part, padsClct);
383 
384  // pads matching to ALCTs
385  matchingPads<CSCALCTDigi, T>(alct1, alct2, part, padsAlct);
386 
387  // collect *all* matching pads
388  result.reserve(padsClct.size() + padsAlct.size());
389  result.insert(std::end(result), std::begin(padsClct), std::end(padsClct));
390  result.insert(std::end(result), std::begin(padsAlct), std::end(padsAlct));
391 }
#define end
Definition: vmac.h:39
part
Definition: HCALResponse.h:20
#define begin
Definition: vmac.h:32
void CSCGEMMotherboard::printGEMTriggerCoPads ( int  bx_start,
int  bx_stop,
enum CSCPart  part 
)
protected

Definition at line 294 of file CSCGEMMotherboard.cc.

References coPads_, isPadInOverlap(), LogTrace, and ME11.

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

295 {
296  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------" << std::endl;
297  LogTrace("CSCGEMMotherboard") << "* GEM trigger coincidence pads: " << std::endl;
298 
299  for (int bx = bx_start; bx <= bx_stop; bx++) {
300  const auto& in_pads = coPads_[bx];
301  LogTrace("CSCGEMMotherboard") << "N(copads) BX " << bx << " : " << in_pads.size() << std::endl;
302 
303  for (const auto& pad : in_pads){
304  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
305  const auto& roll_id(GEMDetId(pad.first));
306 
307  if (part==CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll())) LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
308  else LogTrace("CSCGEMMotherboard") << std::endl;
309  }
310  }
311 }
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 isPadInOverlap(), LogTrace, ME11, and pads_.

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

273 {
274  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------" << 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 74 of file CSCGEMMotherboard.cc.

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

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

75 {
76  coPads_.clear();
77  for (const auto& copad: gemCoPadV){
78  GEMDetId detId(theRegion, 1, theStation, 0, theChamber, 0);
79  // only consider matches with same BX
80  coPads_[CSCConstants::LCT_CENTRAL_BX + copad.bx(1)].emplace_back(detId.rawId(), copad);
81  }
82 }
GEMCoPadDigiIdsBX coPads_
std::vector< GEMCoPadDigi > gemCoPadV
const unsigned theStation
void CSCGEMMotherboard::retrieveGEMPads ( const GEMPadDigiCollection pads,
unsigned  id 
)
protected

Definition at line 55 of file CSCGEMMotherboard.cc.

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

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

56 {
57  pads_.clear();
58  auto superChamber(gem_g->superChamber(id));
59  for (const auto& ch : superChamber->chambers()) {
60  for (const auto& roll : ch->etaPartitions()) {
61  GEMDetId roll_id(roll->id());
62  auto pads_in_det = gemPads->get(roll_id);
63  for (auto pad = pads_in_det.first; pad != pads_in_det.second; ++pad) {
64  const int bx_shifted(CSCConstants::LCT_CENTRAL_BX + pad->bx());
65  // consider matches with BX difference +1/0/-1
66  for (int bx = bx_shifted - maxDeltaBXPad_;bx <= bx_shifted + maxDeltaBXPad_; ++bx) {
67  pads_[bx].emplace_back(roll_id.rawId(), *pad);
68  }
69  }
70  }
71  }
72 }
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:91
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 45 of file CSCGEMMotherboard.cc.

References coPadProcessor, and run().

48 {
49  std::unique_ptr<GEMPadDigiCollection> gemPads(new GEMPadDigiCollection());
50  coPadProcessor->declusterize(gemClusters, *gemPads);
51  run(wiredc, compdc, gemPads.get());
52 }
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 62 of file CSCGEMMotherboard.h.

References CSCMotherboard::alct, bestMatchingPad(), CSCMotherboard::clct, constructLCTsGEM(), correlateLCTsGEM(), findQualityGEM(), g, gem_g, getBX(), getLUT(), getPad(), getRoll(), mps_fire::i, isGEMDetId(), isPadInOverlap(), matchingPads(), AlCaHLTBitMon_ParallelJobs::p, printGEMTriggerCoPads(), printGEMTriggerPads(), retrieveGEMCoPads(), retrieveGEMPads(), edm::second(), and setupGeometry().

Referenced by CSCTriggerPrimitivesBuilder::build().

62 { 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 266 of file CSCGEMMotherboard.cc.

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

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

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 237 of file CSCGEMMotherboard.h.

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

Definition at line 213 of file CSCGEMMotherboard.h.

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

unsigned CSCGEMMotherboard::gemId
protected

Chamber id (trigger-type labels).

Definition at line 210 of file CSCGEMMotherboard.h.

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

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

Definition at line 222 of file CSCGEMMotherboard.h.

Referenced by getMaxDeltaBX(), and retrieveGEMPads().

int CSCGEMMotherboard::maxDeltaPadL1_
protected

Definition at line 224 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchingPads().

int CSCGEMMotherboard::maxDeltaPadL2_
protected

Definition at line 225 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

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

Definition at line 231 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteALCTGEMquality_
protected

Definition at line 233 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteCLCTGEMquality_
protected

Definition at line 234 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::useOldLCTDataFormat_
protected

Definition at line 228 of file CSCGEMMotherboard.h.