CMS 3D CMS Logo

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

#include <CSCGEMMotherboard.h>

Inheritance diagram for CSCGEMMotherboard:
CSCUpgradeMotherboard CSCMotherboard CSCBaseboard CSCGEMMotherboardME11 CSCGEMMotherboardME21

Public Types

enum  Default_values { DEFAULT_MATCHING_VALUE = -99 }
 

Public Member Functions

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

Public Attributes

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

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

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

Additional Inherited Members

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

Detailed Description

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

Author
Sven Dildick (TAMU)

Definition at line 29 of file CSCGEMMotherboard.h.

Member Enumeration Documentation

Enumerator
DEFAULT_MATCHING_VALUE 

Definition at line 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 3 of file CSCGEMMotherboard.cc.

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

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

Definition at line 29 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 > &   
) const
protected

Referenced by doesWiregroupCrossStrip().

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

Definition at line 389 of file CSCGEMMotherboard.h.

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

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

Definition at line 411 of file CSCGEMMotherboard.h.

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

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

Definition at line 439 of file CSCGEMMotherboard.h.

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

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

Definition at line 38 of file CSCGEMMotherboard.cc.

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

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

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

Definition at line 85 of file CSCGEMMotherboard.cc.

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

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

Definition at line 93 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

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

Definition at line 100 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

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

Definition at line 109 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

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

Definition at line 117 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::ALCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCTGEM, GEMCoPadDigi::bx(), CSCCorrelatedLCTDigi::CLCT2GEM, CSCBaseboard::cscId_, doesWiregroupCrossStrip(), CSCMotherboard::encodePattern(), findQualityGEM(), GEMCoPadDigi::first(), CSCGEMMotherboardLUT::get_gem_pad_to_csc_hs(), CSCGEMMotherboardLUT::get_gem_roll_to_csc_wg(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCMotherboard::getBXShiftedALCT(), CSCUpgradeMotherboard::getCSCPart(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), getLUT(), CSCCLCTDigi::getPattern(), GEMPadDigi::isValid(), GEMCoPadDigi::isValid(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, LogTrace, CSCConstants::MAX_HALF_STRIP_ME1B, ME11, ME1A, ME1B, AlCaHLTBitMon_ParallelJobs::p, GEMCoPadDigi::pad(), 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(), CSCUpgradeMotherboard::theParity, and CSCBaseboard::theTrigChamber.

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

Definition at line 469 of file CSCGEMMotherboard.h.

References CSCMotherboard::secondLCT.

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

474 {
475  // Check which LCTs are valid
476  bool bestValid = bestLCT.isValid();
477  bool secondValid = secondLCT.isValid();
478 
479  // At this point, set both LCTs valid if they are invalid
480  // Duplicate LCTs are taken into account later
481  if (bestValid and !secondValid) secondLCT = bestLCT;
482  if (!bestValid and secondValid) bestLCT = secondLCT;
483 
484  // get best matching copad1
485  const GEMCoPadDigi& bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads);
486  const GEMCoPadDigi& secondCoPad = bestMatchingPad<GEMCoPadDigi>(secondLCT, coPads);
487 
488  correlateLCTsGEM(bestLCT, secondLCT, bestCoPad, secondCoPad, lct1, lct2);
489 }
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) 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 
) const
protected

Definition at line 493 of file CSCGEMMotherboard.h.

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

499 {
500  // construct the first LCT from ALCT(CLCT) and a GEM Copad
501  if ((getLctTrigEnable<T>() and bestLCT.isValid()) or
502  (match_trig_enable and bestLCT.isValid()))
503  {
504  lct1 = constructLCTsGEM(bestLCT, bestCoPad, 1);
505  }
506 
507  // construct the second LCT from ALCT(CLCT) and a GEM Copad
508  if ((getLctTrigEnable<T>() and secondLCT.isValid()) or
509  (match_trig_enable and secondLCT.isValid() and secondLCT != bestLCT))
510  {
511  lct2 = constructLCTsGEM(secondLCT, secondCoPad, 2);
512  }
513 }
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
unsigned int match_trig_enable
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
bool isValid() const
return valid pattern bit
virtual bool CSCGEMMotherboard::doesWiregroupCrossStrip ( int  key_wg,
int  key_strip 
) const
inlineprotectedvirtual
unsigned int CSCGEMMotherboard::findQualityGEM ( const CSCALCTDigi aLCT,
const CSCCLCTDigi cLCT,
int  gemlayer 
) const
protected

Definition at line 353 of file CSCGEMMotherboard.cc.

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

Referenced by constructLCTsGEM(), and doesWiregroupCrossStrip().

355 {
356  // Either ALCT or CLCT is invalid
357  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
358 
359  // No CLCT
360  if (aLCT.isValid() && !(cLCT.isValid()))
361  return LCT_Quality::NO_CLCT;
362 
363  // No ALCT
364  else if (!(aLCT.isValid()) && cLCT.isValid())
365  return LCT_Quality::NO_ALCT;
366 
367  // No ALCT and no CLCT
368  else
369  return LCT_Quality::INVALID;
370  }
371  // Both ALCT and CLCT are valid
372  else {
373  const int pattern(cLCT.getPattern());
374 
375  // Layer-trigger in CLCT
376  if (pattern == 1)
377  return LCT_Quality::CLCT_LAYER_TRIGGER;
378 
379  // Multi-layer pattern in CLCT
380  else {
381  // ALCT quality is the number of layers hit minus 3.
382  bool a4 = false;
383 
384  // Case of ME11 with GEMs: require 4 layers for ALCT
385  if (theStation==1) a4 = aLCT.getQuality() >= 1;
386 
387  // Case of ME21 with GEMs: require 4 layers for ALCT+GEM
388  if (theStation==2) a4 = aLCT.getQuality() + gemlayers >=1;
389 
390  // CLCT quality is the number of layers hit.
391  const bool c4((cLCT.getQuality() >= 4) or (cLCT.getQuality() >= 3 and gemlayers>=1));
392 
393  // quality = 4; "reserved for low-quality muons in future"
394 
395  // marginal anode and cathode
396  if (!a4 && !c4)
397  return LCT_Quality::MARGINAL_ANODE_CATHODE;
398 
399  // HQ anode, but marginal cathode
400  else if ( a4 && !c4)
401  return LCT_Quality::HQ_ANODE_MARGINAL_CATHODE;
402 
403  // HQ cathode, but marginal anode
404  else if (!a4 && c4)
405  return LCT_Quality::HQ_CATHODE_MARGINAL_ANODE;
406 
407  // HQ muon, but accelerator ALCT
408  else if ( a4 && c4) {
409 
410  if (aLCT.getAccelerator())
411  return LCT_Quality::HQ_ACCEL_ALCT;
412 
413  else {
414  // quality = 9; "reserved for HQ muons with future patterns
415  // quality = 10; "reserved for HQ muons with future patterns
416 
417  // High quality muons are determined by their CLCT pattern
418  if (pattern == 2 || pattern == 3)
419  return LCT_Quality::HQ_PATTERN_2_3;
420 
421  else if (pattern == 4 || pattern == 5)
422  return LCT_Quality::HQ_PATTERN_4_5;
423 
424  else if (pattern == 6 || pattern == 7)
425  return LCT_Quality::HQ_PATTERN_6_7;
426 
427  else if (pattern == 8 || pattern == 9)
428  return LCT_Quality::HQ_PATTERN_8_9;
429 
430  else if (pattern == 10)
431  return LCT_Quality::HQ_PATTERN_10;
432 
433  else {
434  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
435  << "+++ findQuality: Unexpected CLCT pattern id = "
436  << pattern << "+++\n";
437  return LCT_Quality::INVALID;
438  }
439  }
440  }
441  }
442  }
443  return LCT_Quality::INVALID;
444 }
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:41
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
static constexpr TimeType INVALID
Definition: Time.h:33
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
int getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:38
int getAccelerator() const
Definition: CSCALCTDigi.h:45
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:47
const unsigned theStation
Definition: CSCBaseboard.h:34
int CSCGEMMotherboard::getBX ( const GEMPadDigi p) const
protected

Definition at line 258 of file CSCGEMMotherboard.cc.

References GEMPadDigi::bx().

Referenced by doesWiregroupCrossStrip(), and matchingPads().

259 {
260  return p.bx();
261 }
int bx() const
Definition: GEMPadDigi.h:28
int CSCGEMMotherboard::getBX ( const GEMCoPadDigi p) const
protected

Definition at line 263 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::bx().

264 {
265  return p.bx(1);
266 }
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 472 of file CSCGEMMotherboard.cc.

References CSCMotherboard::alct_trig_enable.

473 {
474  return alct_trig_enable;
475 }
unsigned int alct_trig_enable
template<>
int CSCGEMMotherboard::getLctTrigEnable ( ) const
private

Definition at line 478 of file CSCGEMMotherboard.cc.

References CSCMotherboard::clct_trig_enable.

479 {
480  return clct_trig_enable;
481 }
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 460 of file CSCGEMMotherboard.cc.

References maxDeltaBXPad_.

461 {
462  return maxDeltaBXPad_;
463 }
template<>
int CSCGEMMotherboard::getMaxDeltaBX ( ) const
private

Definition at line 466 of file CSCGEMMotherboard.cc.

References maxDeltaBXCoPad_.

467 {
468  return maxDeltaBXCoPad_;
469 }
float CSCGEMMotherboard::getPad ( const GEMPadDigi p) const
protected

Definition at line 283 of file CSCGEMMotherboard.cc.

References GEMPadDigi::pad().

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

284 {
285  return p.pad();
286 }
int pad() const
Definition: GEMPadDigi.h:27
float CSCGEMMotherboard::getPad ( const GEMCoPadDigi p) const
protected

Definition at line 288 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::pad().

289 {
290  // average pad number for a GEMCoPad
291  return 0.5*(p.pad(1) + p.pad(2));
292 }
int pad(int l) const
Definition: GEMCoPadDigi.cc:38
float CSCGEMMotherboard::getPad ( const CSCCLCTDigi clct,
enum CSCPart  par 
) const
protected

Definition at line 294 of file CSCGEMMotherboard.cc.

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

295 {
296  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(theParity, part));
297  int keyStrip = clct.getKeyStrip();
298  //ME1A part, convert halfstrip from 128-223 to 0-95
300  keyStrip = keyStrip - CSCConstants::MAX_HALF_STRIP_ME1B -1;
301  return 0.5*(mymap[keyStrip].first + mymap[keyStrip].second);
302 
303 }
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:94
template<class T >
const matchesBX<T>& CSCGEMMotherboard::getPads ( ) const
private
template<>
const matchesBX<GEMPadDigi>& CSCGEMMotherboard::getPads ( ) const
private

Definition at line 448 of file CSCGEMMotherboard.cc.

References pads_.

449 {
450  return pads_;
451 }
GEMPadDigiIdsBX pads_
template<>
const matchesBX<GEMCoPadDigi>& CSCGEMMotherboard::getPads ( ) const
private

Definition at line 454 of file CSCGEMMotherboard.cc.

References coPads_.

455 {
456  return coPads_;
457 }
GEMCoPadDigiIdsBX coPads_
int CSCGEMMotherboard::getRoll ( const GEMPadDigiId p) const
protected

Definition at line 268 of file CSCGEMMotherboard.cc.

References GEMDetId::roll().

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

269 {
270  return GEMDetId(p.first).roll();
271 }
int roll() const
Definition: GEMDetId.h:80
int CSCGEMMotherboard::getRoll ( const GEMCoPadDigiId p) const
protected

Definition at line 273 of file CSCGEMMotherboard.cc.

274 {
275  return p.second.roll();
276 }
int CSCGEMMotherboard::getRoll ( const CSCALCTDigi alct) const
protected

Definition at line 278 of file CSCGEMMotherboard.cc.

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

279 {
280  return (getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.getKeyWG()].first;
281 }
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:59
bool CSCGEMMotherboard::isGEMDetId ( unsigned int  p) const
protected

Definition at line 252 of file CSCGEMMotherboard.cc.

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

Referenced by bestMatchingPad(), and doesWiregroupCrossStrip().

253 {
254  return (DetId(p).subdetId() == MuonSubdetId::GEM and
255  DetId(p).det() == DetId::Muon);
256 }
static const int GEM
Definition: MuonSubdetId.h:15
Definition: DetId.h:18
bool CSCGEMMotherboard::isPadInOverlap ( int  roll) const
protected

Definition at line 240 of file CSCGEMMotherboard.cc.

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

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

241 {
242  // this only works for ME1A!
243  const auto& mymap = (getLUT()->get_csc_wg_to_gem_roll(theParity));
244  for (unsigned i=0; i<mymap.size(); i++) {
245  // overlap region are WGs 10-15
246  if ((i < 10) or (i > 15)) continue;
247  if ((mymap[i].first <= roll) and (roll <= mymap[i].second)) return true;
248  }
249  return false;
250 }
U second(std::pair< T, U > const &p)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
virtual const CSCGEMMotherboardLUT * getLUT() const =0
std::vector< std::pair< int, int > > get_csc_wg_to_gem_roll(Parity par, int layer=1) const
template<class T >
void CSCGEMMotherboard::matchingPads ( const CSCALCTDigi alct,
matches< T > &  result 
) const
protected

Definition at line 250 of file CSCGEMMotherboard.h.

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

Referenced by doesWiregroupCrossStrip().

252 {
253  result.clear();
254  // Invalid ALCTs have no matching pads
255  if (not alct.isValid()) return;
256 
257  // Get the corresponding roll numbers for a given ALCT
258  std::pair<int,int> alctRoll =
260 
261  // Get the pads in the ALCT bx
262  const matchesBX<T>& lut = getPads<T>();
263 
264  // If no pads in that bx...
265  if (lut.count(alct.getBX())==0) return;
266 
267  for (const auto& p: lut.at(alct.getBX())){
268  auto padRoll(getRoll(p));
269 
270  // pad bx needs to match to ALCT bx
271  int pad_bx = getBX(p.second)+CSCConstants::LCT_CENTRAL_BX;
272  if (std::abs(alct.getBX()-pad_bx)>getMaxDeltaBX<T>()) continue;
273 
274  // gem roll number if invalid
275  if (alctRoll.first == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
276  alctRoll.second == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE) continue;
277  // ALCTs at the top of the chamber
278  else if (alctRoll.first == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
279  padRoll > alctRoll.second) continue;
280  // ALCTs at the bottom of the chamber
281  else if (alctRoll.second == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
282  padRoll < alctRoll.first) continue;
283  // ignore pads that are too far away in roll number
284  else if ((alctRoll.first != CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
285  alctRoll.second != CSCGEMMotherboard::DEFAULT_MATCHING_VALUE) and
286  (alctRoll.first > padRoll or padRoll > alctRoll.second)) continue;
287  result.push_back(p);
288  }
289 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
int getBX(const GEMPadDigi &p) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int getRoll(const GEMPadDigiId &p) const
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:65
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:59
std::vector< std::pair< int, int > > get_csc_wg_to_gem_roll(Parity par, int layer=1) const
template<class T >
void CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi alct,
matches< T > &  result 
) const
protected

Definition at line 292 of file CSCGEMMotherboard.h.

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

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

Definition at line 332 of file CSCGEMMotherboard.h.

References begin, end, p1, and p2.

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

Definition at line 350 of file CSCGEMMotherboard.h.

References CSCUpgradeMotherboard::intersection().

353 {
354  matches<T> padsClct, padsAlct;
355 
356  // pads matching to the CLCT
357  matchingPads<T>(clct1, padsClct);
358 
359  // pads matching to the ALCT
360  matchingPads<T>(alct1, padsAlct);
361 
362  // collect all *common* pads
363  intersection(padsClct, padsAlct, result);
364 }
void intersection(const S &d1, const S &d2, S &result) const
template<class T >
void CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi clct1,
const CSCCLCTDigi clct2,
const CSCALCTDigi alct1,
const CSCALCTDigi alct2,
matches< T > &  result 
) const
protected

Definition at line 367 of file CSCGEMMotherboard.h.

References begin, and end.

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

Definition at line 333 of file CSCGEMMotherboard.cc.

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

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

334 {
335  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------" << std::endl;
336  LogTrace("CSCGEMMotherboard") << "* GEM trigger coincidence pads: " << std::endl;
337 
338  for (int bx = bx_start; bx <= bx_stop; bx++) {
339  const auto& in_pads = coPads_[bx];
340  LogTrace("CSCGEMMotherboard") << "N(copads) BX " << bx << " : " << in_pads.size() << std::endl;
341 
342  for (const auto& pad : in_pads){
343  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
344  const auto& roll_id(GEMDetId(pad.first));
345 
346  if (part==CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll())) LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
347  else LogTrace("CSCGEMMotherboard") << std::endl;
348  }
349  }
350 }
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 311 of file CSCGEMMotherboard.cc.

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

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

312 {
313  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------" << std::endl;
314  LogTrace("CSCGEMMotherboard") << "* GEM trigger pads: " << std::endl;
315 
316  for (int bx = bx_start; bx <= bx_stop; bx++) {
317  const auto& in_pads = pads_[bx];
318  LogTrace("CSCGEMMotherboard") << "N(pads) BX " << bx << " : " << in_pads.size() << std::endl;
319 
320  for (const auto& pad : in_pads){
321  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
322  const auto& roll_id(GEMDetId(pad.first));
323 
324  if (part==CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll()))
325  LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
326  else
327  LogTrace("CSCGEMMotherboard") << std::endl;
328  }
329  }
330 }
#define LogTrace(id)
bool isPadInOverlap(int roll) const
part
Definition: HCALResponse.h:20
GEMPadDigiIdsBX pads_
void CSCGEMMotherboard::retrieveGEMCoPads ( )
protected

Definition at line 75 of file CSCGEMMotherboard.cc.

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

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

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

Definition at line 56 of file CSCGEMMotherboard.cc.

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

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

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

References coPadProcessor, and run().

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

References g, gem_g, and getLUT().

Referenced by CSCTriggerPrimitivesBuilder::build().

65 { 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 305 of file CSCGEMMotherboard.cc.

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

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

306 {
308  generator_->setGEMGeometry(gem_g);
309 }
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 234 of file CSCGEMMotherboard.h.

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

Definition at line 210 of file CSCGEMMotherboard.h.

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

unsigned CSCGEMMotherboard::gemId
protected

Chamber id (trigger-type labels).

Definition at line 207 of file CSCGEMMotherboard.h.

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

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

Definition at line 219 of file CSCGEMMotherboard.h.

Referenced by getMaxDeltaBX(), and retrieveGEMPads().

int CSCGEMMotherboard::maxDeltaPadL1_
protected

Definition at line 221 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchingPads().

int CSCGEMMotherboard::maxDeltaPadL2_
protected

Definition at line 222 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

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

Definition at line 228 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteALCTGEMquality_
protected

Definition at line 230 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteCLCTGEMquality_
protected

Definition at line 231 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::useOldLCTDataFormat_
protected

Definition at line 225 of file CSCGEMMotherboard.h.