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
 
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 setGEMGeometry().

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

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

389 {
390  S result;
391  // no matching pads for invalid stub
392  if (not alct1.isValid()) return result;
393 
394  // return the first one with the same roll number
395  for (const auto& p: pads){
396 
397  // protection against corrupted DetIds
398  if (not isGEMDetId(p.first)) continue;
399 
400  // roll number of pad and ALCT must match
401  if (getRoll(p) == getRoll(alct1)){
402  return p.second;
403  }
404  }
405  return result;
406 }
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 
) const

Definition at line 409 of file CSCGEMMotherboard.h.

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

411 {
412  S result;
413  // no matching pads for invalid stub
414  if (not clct.isValid()) return result;
415 
416  auto part(getCSCPart(clct.getKeyStrip()));
417 
418  // return the pad with the smallest bending angle
419  float averagePadNumberCSC = getPad(clct, part);
420  float minDeltaPad = 999;
421  for (const auto& p: pads){
422 
423  // protection against corrupted DetIds
424  if (not isGEMDetId(p.first)) continue;
425 
426  // best pad is closest to CLCT in number of halfstrips
427  float averagePadNumberGEM = getPad(p.second);
428  if (std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad){
429  minDeltaPad = std::abs(averagePadNumberCSC - averagePadNumberGEM);
430  result = p.second;
431  }
432  }
433  return result;
434 }
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
int getKeyStrip() const
Definition: CSCCLCTDigi.h:89
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 437 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.

440 {
441  S result;
442  // no matching pads for invalid stub
443  if (not alct1.isValid() or not clct1.isValid()) return result;
444 
445  auto part(getCSCPart(clct1.getKeyStrip()));
446 
447  // return the pad with the smallest bending angle
448  float averagePadNumberCSC = getPad(clct1, part);
449  float minDeltaPad = 999;
450  for (const auto& p: pads){
451 
452  // protection against corrupted DetIds
453  if (not isGEMDetId(p.first)) continue;
454 
455  float averagePadNumberGEM = getPad(p.second);
456  // add another safety to make sure that the deltaPad is not larger than max value!!!
457  if (std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad and
458  getRoll(p) == getRoll(alct1)){
459  minDeltaPad = std::abs(averagePadNumberCSC - averagePadNumberGEM);
460  result = p.second;
461  }
462  }
463  return result;
464 }
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
int getKeyStrip() const
Definition: CSCCLCTDigi.h:89
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 setGEMGeometry().

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, 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(), CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), CSCConstants::LCT_CENTRAL_BX, LogTrace, ME11, 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;
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 and alct.getKeyWG() <= 15)
167  p = CSCPart::ME1B;
168  const auto& mymap1 = getLUT()->get_gem_pad_to_csc_hs(theParity, p);
169  pattern = promoteALCTGEMpattern_ ? 10 : 0;
170  quality = promoteALCTGEMquality_ ? 15 : 11;
171  bx = alct.getBX();
172  // GEM pad number is counting from 1
173  keyStrip = mymap1[gem2.pad(2) - 1];
174  keyWG = alct.getKeyWG();
175  thisLCT.setALCT(getBXShiftedALCT(alct));
176  thisLCT.setGEM1(gem2.first());
177  thisLCT.setGEM2(gem2.second());
179  }
180  else if (clct.isValid() and gem2.isValid() and not alct.isValid()) {
181  auto p(getCSCPart(clct.getKeyStrip()));
182  const auto& mymap2 = getLUT()->get_gem_roll_to_csc_wg(theParity, p);
183  pattern = encodePattern(clct.getPattern());
184  quality = promoteCLCTGEMquality_ ? 15 : 11;
185  bx = gem2.bx(1) + CSCConstants::LCT_CENTRAL_BX;
186  keyStrip = clct.getKeyStrip();
187  // choose the corresponding wire-group in the middle of the partition
188  keyWG = mymap2[gem2.roll()];
189  bend = clct.getBend();
190  thisLCT.setCLCT(clct);
191  thisLCT.setGEM1(gem2.first());
192  thisLCT.setGEM2(gem2.second());
194  }
195 
196  // fill the rest of the properties
197  thisLCT.setTrknmb(trknmb);
198  thisLCT.setValid(1);
199  thisLCT.setQuality(quality);
200  thisLCT.setWireGroup(keyWG);
201  thisLCT.setStrip(keyStrip);
202  thisLCT.setPattern(pattern);
203  thisLCT.setBend(bend);
204  thisLCT.setBX(bx);
205  thisLCT.setMPCLink(0);
206  thisLCT.setBX0(0);
207  thisLCT.setSyncErr(0);
208  thisLCT.setCSCID(theTrigChamber);
209 
210  // future work: add a section that produces LCTs according
211  // to the new LCT dataformat (not yet defined)
212 
213  // return new LCT
214  return thisLCT;
215 }
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: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 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
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: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
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)
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 467 of file CSCGEMMotherboard.h.

References CSCMotherboard::secondLCT.

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

472 {
473  // Check which LCTs are valid
474  bool bestValid = bestLCT.isValid();
475  bool secondValid = secondLCT.isValid();
476 
477  // At this point, set both LCTs valid if they are invalid
478  // Duplicate LCTs are taken into account later
479  if (bestValid and !secondValid) secondLCT = bestLCT;
480  if (!bestValid and secondValid) bestLCT = secondLCT;
481 
482  // get best matching copad1
483  const GEMCoPadDigi& bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads);
484  const GEMCoPadDigi& secondCoPad = bestMatchingPad<GEMCoPadDigi>(secondLCT, coPads);
485 
486  correlateLCTsGEM(bestLCT, secondLCT, bestCoPad, secondCoPad, lct1, lct2);
487 }
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 491 of file CSCGEMMotherboard.h.

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

497 {
498  // construct the first LCT from ALCT(CLCT) and a GEM Copad
499  if ((getLctTrigEnable<T>() and bestLCT.isValid()) or
500  (match_trig_enable and bestLCT.isValid()))
501  {
502  lct1 = constructLCTsGEM(bestLCT, bestCoPad, 1);
503  }
504 
505  // construct the second LCT from ALCT(CLCT) and a GEM Copad
506  if ((getLctTrigEnable<T>() and secondLCT.isValid()) or
507  (match_trig_enable and secondLCT.isValid() and secondLCT != bestLCT))
508  {
509  lct2 = constructLCTsGEM(secondLCT, secondCoPad, 2);
510  }
511 }
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
unsigned int CSCGEMMotherboard::findQualityGEM ( const CSCALCTDigi aLCT,
const CSCCLCTDigi cLCT,
int  gemlayer 
) const
protected

Definition at line 326 of file CSCGEMMotherboard.cc.

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

Referenced by constructLCTsGEM(), and setGEMGeometry().

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

Definition at line 236 of file CSCGEMMotherboard.cc.

References GEMPadDigi::bx().

Referenced by matchingPads(), and setGEMGeometry().

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

Definition at line 241 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::bx().

242 {
243  return p.bx(1);
244 }
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 445 of file CSCGEMMotherboard.cc.

References CSCMotherboard::alct_trig_enable.

446 {
447  return alct_trig_enable;
448 }
unsigned int alct_trig_enable
template<>
int CSCGEMMotherboard::getLctTrigEnable ( ) const
private

Definition at line 451 of file CSCGEMMotherboard.cc.

References CSCMotherboard::clct_trig_enable.

452 {
453  return clct_trig_enable;
454 }
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 433 of file CSCGEMMotherboard.cc.

References maxDeltaBXPad_.

434 {
435  return maxDeltaBXPad_;
436 }
template<>
int CSCGEMMotherboard::getMaxDeltaBX ( ) const
private

Definition at line 439 of file CSCGEMMotherboard.cc.

References maxDeltaBXCoPad_.

440 {
441  return maxDeltaBXCoPad_;
442 }
float CSCGEMMotherboard::getPad ( const GEMPadDigi p) const
protected

Definition at line 261 of file CSCGEMMotherboard.cc.

References GEMPadDigi::pad().

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

262 {
263  return p.pad();
264 }
int pad() const
Definition: GEMPadDigi.h:27
float CSCGEMMotherboard::getPad ( const GEMCoPadDigi p) const
protected

Definition at line 266 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::pad().

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

Definition at line 272 of file CSCGEMMotherboard.cc.

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

273 {
274  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(theParity, part));
275  return 0.5*(mymap[clct.getKeyStrip()].first + mymap[clct.getKeyStrip()].second);
276 }
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 421 of file CSCGEMMotherboard.cc.

References pads_.

422 {
423  return pads_;
424 }
GEMPadDigiIdsBX pads_
template<>
const matchesBX<GEMCoPadDigi>& CSCGEMMotherboard::getPads ( ) const
private

Definition at line 427 of file CSCGEMMotherboard.cc.

References coPads_.

428 {
429  return coPads_;
430 }
GEMCoPadDigiIdsBX coPads_
int CSCGEMMotherboard::getRoll ( const GEMPadDigiId p) const
protected

Definition at line 246 of file CSCGEMMotherboard.cc.

References GEMDetId::roll().

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

247 {
248  return GEMDetId(p.first).roll();
249 }
int roll() const
Definition: GEMDetId.h:80
int CSCGEMMotherboard::getRoll ( const GEMCoPadDigiId p) const
protected

Definition at line 251 of file CSCGEMMotherboard.cc.

252 {
253  return p.second.roll();
254 }
int CSCGEMMotherboard::getRoll ( const CSCALCTDigi alct) const
protected

Definition at line 256 of file CSCGEMMotherboard.cc.

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

257 {
258  return (getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.getKeyWG()].first;
259 }
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 230 of file CSCGEMMotherboard.cc.

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

Referenced by bestMatchingPad(), and setGEMGeometry().

231 {
232  return (DetId(p).subdetId() == MuonSubdetId::GEM and
233  DetId(p).det() == DetId::Muon);
234 }
static const int GEM
Definition: MuonSubdetId.h:15
Definition: DetId.h:18
bool CSCGEMMotherboard::isPadInOverlap ( int  roll) const
protected

Definition at line 218 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 printGEMTriggerCoPads(), printGEMTriggerPads(), and setGEMGeometry().

219 {
220  // this only works for ME1A!
221  const auto& mymap = (getLUT()->get_csc_wg_to_gem_roll(theParity));
222  for (unsigned i=0; i<mymap.size(); i++) {
223  // overlap region are WGs 10-15
224  if ((i < 10) or (i > 15)) continue;
225  if ((mymap[i].first <= roll) and (roll <= mymap[i].second)) return true;
226  }
227  return false;
228 }
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 248 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 setGEMGeometry().

250 {
251  result.clear();
252  // Invalid ALCTs have no matching pads
253  if (not alct.isValid()) return;
254 
255  // Get the corresponding roll numbers for a given ALCT
256  std::pair<int,int> alctRoll =
258 
259  // Get the pads in the ALCT bx
260  const matchesBX<T>& lut = getPads<T>();
261 
262  // If no pads in that bx...
263  if (lut.count(alct.getBX())==0) return;
264 
265  for (const auto& p: lut.at(alct.getBX())){
266  auto padRoll(getRoll(p));
267 
268  // pad bx needs to match to ALCT bx
269  int pad_bx = getBX(p.second)+CSCConstants::LCT_CENTRAL_BX;
270  if (std::abs(alct.getBX()-pad_bx)>getMaxDeltaBX<T>()) continue;
271 
272  // gem roll number if invalid
273  if (alctRoll.first == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
274  alctRoll.second == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE) continue;
275  // ALCTs at the top of the chamber
276  else if (alctRoll.first == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
277  padRoll > alctRoll.second) continue;
278  // ALCTs at the bottom of the chamber
279  else if (alctRoll.second == CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
280  padRoll < alctRoll.first) continue;
281  // ignore pads that are too far away in roll number
282  else if ((alctRoll.first != CSCGEMMotherboard::DEFAULT_MATCHING_VALUE and
283  alctRoll.second != CSCGEMMotherboard::DEFAULT_MATCHING_VALUE) and
284  (alctRoll.first > padRoll or padRoll > alctRoll.second)) continue;
285  result.push_back(p);
286  }
287 }
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
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,
matches< T > &  result 
) const
protected

Definition at line 290 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.

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

References begin, end, p1, and p2.

332 {
333  matches<T> p1, p2;
334 
335  // pads matching to the CLCT/ALCT
336  matchingPads<T>(d1, p1);
337 
338  // pads matching to the CLCT/ALCT
339  matchingPads<T>(d2, p2);
340 
341  // collect *all* matching pads
342  result.reserve(p1.size() + p2.size());
343  result.insert(std::end(result), std::begin(p1), std::end(p1));
344  result.insert(std::end(result), std::begin(p2), std::end(p2));
345 }
#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 348 of file CSCGEMMotherboard.h.

References CSCUpgradeMotherboard::intersection().

351 {
352  matches<T> padsClct, padsAlct;
353 
354  // pads matching to the CLCT
355  matchingPads<T>(clct1, padsClct);
356 
357  // pads matching to the ALCT
358  matchingPads<T>(alct1, padsAlct);
359 
360  // collect all *common* pads
361  intersection(padsClct, padsAlct, result);
362 }
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 365 of file CSCGEMMotherboard.h.

References begin, and end.

370 {
371  matches<T> padsClct, padsAlct;
372 
373  // pads matching to CLCTs
374  matchingPads<CSCCLCTDigi, T>(clct1, clct2, padsClct);
375 
376  // pads matching to ALCTs
377  matchingPads<CSCALCTDigi, T>(alct1, alct2, padsAlct);
378 
379  // collect *all* matching pads
380  result.reserve(padsClct.size() + padsAlct.size());
381  result.insert(std::end(result), std::begin(padsClct), std::end(padsClct));
382  result.insert(std::end(result), std::begin(padsAlct), std::end(padsAlct));
383 }
#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 306 of file CSCGEMMotherboard.cc.

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

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

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

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

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

285 {
286  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------" << std::endl;
287  LogTrace("CSCGEMMotherboard") << "* GEM trigger pads: " << std::endl;
288 
289  for (int bx = bx_start; bx <= bx_stop; bx++) {
290  const auto& in_pads = pads_[bx];
291  LogTrace("CSCGEMMotherboard") << "N(pads) BX " << bx << " : " << in_pads.size() << std::endl;
292 
293  for (const auto& pad : in_pads){
294  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
295  const auto& roll_id(GEMDetId(pad.first));
296 
297  if (part==CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll()))
298  LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
299  else
300  LogTrace("CSCGEMMotherboard") << std::endl;
301  }
302  }
303 }
#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 CSCGEMMotherboardME11::run(), CSCGEMMotherboardME21::run(), and setGEMGeometry().

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 CSCGEMMotherboardME11::run(), CSCGEMMotherboardME21::run(), and setGEMGeometry().

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 bestMatchingPad(), 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().

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

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

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

279 {
281  generator_->setGEMGeometry(gem_g);
282 }
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 232 of file CSCGEMMotherboard.h.

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

Definition at line 208 of file CSCGEMMotherboard.h.

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

unsigned CSCGEMMotherboard::gemId
protected

Chamber id (trigger-type labels).

Definition at line 205 of file CSCGEMMotherboard.h.

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

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

Definition at line 217 of file CSCGEMMotherboard.h.

Referenced by getMaxDeltaBX(), and retrieveGEMPads().

int CSCGEMMotherboard::maxDeltaPadL1_
protected

Definition at line 219 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchingPads().

int CSCGEMMotherboard::maxDeltaPadL2_
protected

Definition at line 220 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

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

Definition at line 226 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteALCTGEMquality_
protected

Definition at line 228 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteCLCTGEMquality_
protected

Definition at line 229 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::useOldLCTDataFormat_
protected

Definition at line 223 of file CSCGEMMotherboard.h.