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
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) 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
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
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(), CSCMotherboard::getBXShiftedALCT(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), getLUT(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), GEMPadDigi::isValid(), GEMCoPadDigi::isValid(), CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, LogTrace, 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  if (not alct.isValid() and not clct.isValid()) {
131  LogTrace("CSCGEMCMotherboard") << "Warning!!! either ALCT or CLCT not valid, return invalid LCT \n";
132  return thisLCT;
133  }
134 
135  // Determine the case and assign properties depending on the LCT dataformat (old/new)
136  if (alct.isValid() and clct.isValid() and gem1.isValid() and not gem2.isValid()) {
137  pattern = encodePattern(clct.getPattern(), clct.getStripType());
138  quality = findQualityGEM(alct, clct, 1);
139  bx = alct.getBX();
140  keyStrip = clct.getKeyStrip();
141  keyWG = alct.getKeyWG();
142  bend = clct.getBend();
143  thisLCT.setALCT(getBXShiftedALCT(alct));
144  thisLCT.setCLCT(clct);
145  thisLCT.setGEM1(gem1);
147  }
148  else if (alct.isValid() and clct.isValid() and not gem1.isValid() and gem2.isValid()) {
149  pattern = encodePattern(clct.getPattern(), clct.getStripType());
150  quality = findQualityGEM(alct, clct, 2);
151  bx = alct.getBX();
152  keyStrip = clct.getKeyStrip();
153  keyWG = alct.getKeyWG();
154  bend = clct.getBend();
155  thisLCT.setALCT(getBXShiftedALCT(alct));
156  thisLCT.setCLCT(clct);
157  thisLCT.setGEM1(gem2.first());
158  thisLCT.setGEM2(gem2.second());
160  }
161  else if (alct.isValid() and gem2.isValid() and not clct.isValid()) {
162  const auto& mymap1 = getLUT()->get_gem_pad_to_csc_hs(par, p);
163  pattern = promoteALCTGEMpattern_ ? 10 : 0;
164  quality = promoteALCTGEMquality_ ? 15 : 11;
165  bx = alct.getBX();
166  // GEM pad number is counting from 1
167  keyStrip = mymap1[gem2.pad(2) - 1];
168  keyWG = alct.getKeyWG();
169  thisLCT.setALCT(getBXShiftedALCT(alct));
170  thisLCT.setGEM1(gem2.first());
171  thisLCT.setGEM2(gem2.second());
173  }
174  else if (clct.isValid() and gem2.isValid() and not alct.isValid()) {
175  const auto& mymap2 = getLUT()->get_gem_roll_to_csc_wg(par, p);
176  pattern = encodePattern(clct.getPattern(), clct.getStripType());
177  quality = promoteCLCTGEMquality_ ? 15 : 11;
178  bx = gem2.bx(1) + CSCConstants::LCT_CENTRAL_BX;
179  keyStrip = clct.getKeyStrip();
180  // choose the corresponding wire-group in the middle of the partition
181  keyWG = mymap2[gem2.roll()];
182  bend = clct.getBend();
183  thisLCT.setCLCT(clct);
184  thisLCT.setGEM1(gem2.first());
185  thisLCT.setGEM2(gem2.second());
187  }
188 
189  // fill the rest of the properties
190  thisLCT.setTrknmb(trknmb);
191  thisLCT.setValid(1);
192  thisLCT.setQuality(quality);
193  thisLCT.setWireGroup(keyWG);
194  thisLCT.setStrip(keyStrip);
195  thisLCT.setPattern(pattern);
196  thisLCT.setBend(bend);
197  thisLCT.setBX(bx);
198  thisLCT.setMPCLink(0);
199  thisLCT.setBX0(0);
200  thisLCT.setSyncErr(0);
201  thisLCT.setCSCID(theTrigChamber);
202 
203  // future work: add a section that produces LCTs according
204  // to the new LCT dataformat (not yet defined)
205 
206  // return new LCT
207  return thisLCT;
208 }
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
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
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
#define LogTrace(id)
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 319 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().

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

References GEMPadDigi::bx().

Referenced by matchingPads(), and setGEMGeometry().

230 {
231  return p.bx();
232 }
int bx() const
Definition: GEMPadDigi.h:28
int CSCGEMMotherboard::getBX ( const GEMCoPadDigi p) const
protected

Definition at line 234 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::bx().

235 {
236  return p.bx(1);
237 }
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 438 of file CSCGEMMotherboard.cc.

References CSCMotherboard::alct_trig_enable.

439 {
440  return alct_trig_enable;
441 }
unsigned int alct_trig_enable
template<>
int CSCGEMMotherboard::getLctTrigEnable ( ) const
private

Definition at line 444 of file CSCGEMMotherboard.cc.

References CSCMotherboard::clct_trig_enable.

445 {
446  return clct_trig_enable;
447 }
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 426 of file CSCGEMMotherboard.cc.

References maxDeltaBXPad_.

427 {
428  return maxDeltaBXPad_;
429 }
template<>
int CSCGEMMotherboard::getMaxDeltaBX ( ) const
private

Definition at line 432 of file CSCGEMMotherboard.cc.

References maxDeltaBXCoPad_.

433 {
434  return maxDeltaBXCoPad_;
435 }
float CSCGEMMotherboard::getPad ( const GEMPadDigi p) const
protected

Definition at line 254 of file CSCGEMMotherboard.cc.

References GEMPadDigi::pad().

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

255 {
256  return p.pad();
257 }
int pad() const
Definition: GEMPadDigi.h:27
float CSCGEMMotherboard::getPad ( const GEMCoPadDigi p) const
protected

Definition at line 259 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::pad().

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

Definition at line 265 of file CSCGEMMotherboard.cc.

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

266 {
267  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(par, part));
268  return 0.5*(mymap[clct.getKeyStrip()].first + mymap[clct.getKeyStrip()].second);
269 }
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 414 of file CSCGEMMotherboard.cc.

References pads_.

415 {
416  return pads_;
417 }
GEMPadDigiIdsBX pads_
template<>
const matchesBX<GEMCoPadDigi>& CSCGEMMotherboard::getPads ( ) const
private

Definition at line 420 of file CSCGEMMotherboard.cc.

References coPads_.

421 {
422  return coPads_;
423 }
GEMCoPadDigiIdsBX coPads_
int CSCGEMMotherboard::getRoll ( const GEMPadDigiId p) const
protected

Definition at line 239 of file CSCGEMMotherboard.cc.

References GEMDetId::roll().

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

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

Definition at line 244 of file CSCGEMMotherboard.cc.

245 {
246  return p.second.roll();
247 }
int CSCGEMMotherboard::getRoll ( const CSCALCTDigi alct) const
protected

Definition at line 249 of file CSCGEMMotherboard.cc.

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

250 {
251  return (getLUT()->get_csc_wg_to_gem_roll(par))[alct.getKeyWG()].first;
252 }
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 223 of file CSCGEMMotherboard.cc.

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

Referenced by bestMatchingPad(), and setGEMGeometry().

224 {
225  return (DetId(p).subdetId() == MuonSubdetId::GEM and
226  DetId(p).det() == DetId::Muon);
227 }
static constexpr int GEM
Definition: MuonSubdetId.h:15
Definition: DetId.h:18
bool CSCGEMMotherboard::isPadInOverlap ( int  roll) const
protected

Definition at line 211 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().

212 {
213  // this only works for ME1A!
214  const auto& mymap = (getLUT()->get_csc_wg_to_gem_roll(par));
215  for (unsigned i=0; i<mymap.size(); i++) {
216  // overlap region are WGs 10-15
217  if ((i < 10) or (i > 15)) continue;
218  if ((mymap[i].first <= roll) and (roll <= mymap[i].second)) return true;
219  }
220  return false;
221 }
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 299 of file CSCGEMMotherboard.cc.

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

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

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

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

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

278 {
279  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------" << std::endl;
280  LogTrace("CSCGEMMotherboard") << "* GEM trigger pads: " << std::endl;
281 
282  for (int bx = bx_start; bx <= bx_stop; bx++) {
283  const auto& in_pads = pads_[bx];
284  LogTrace("CSCGEMMotherboard") << "N(pads) BX " << bx << " : " << in_pads.size() << std::endl;
285 
286  for (const auto& pad : in_pads){
287  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
288  const auto& roll_id(GEMDetId(pad.first));
289 
290  if (part==CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll()))
291  LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
292  else
293  LogTrace("CSCGEMMotherboard") << std::endl;
294  }
295  }
296 }
#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 271 of file CSCGEMMotherboard.cc.

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

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

272 {
274  generator_->setGEMGeometry(gem_g);
275 }
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.