CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
CSCGEMMotherboard Class Reference

#include <CSCGEMMotherboard.h>

Inheritance diagram for CSCGEMMotherboard:
CSCMotherboard CSCBaseboard

Public Types

typedef std::vector
< GEMInternalCluster
GEMInternalClusters
 

Public Member Functions

void clear ()
 
std::shared_ptr
< GEMClusterProcessor
clusterProc () const
 
 CSCGEMMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads)
 
void setGEMGeometry (const GEMGeometry *g)
 
 ~CSCGEMMotherboard () override
 
- Public Member Functions inherited from CSCMotherboard
void clear ()
 
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
virtual std::vector
< CSCCorrelatedLCTDigi
readoutLCTs () const
 
CSCShowerDigi readoutShower () const
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
void selectLCTs ()
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setESLookupTables (const CSCL1TPLookupTableCCLUT *conf)
 
void setESLookupTables (const CSCL1TPLookupTableME11ILT *conf)
 
void setESLookupTables (const CSCL1TPLookupTableME21ILT *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
 
CSCDetId id () const
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCBaseboard ()=default
 

Private Member Functions

void constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
 
void constructLCTsGEM (const CSCCLCTDigi &clct, const GEMInternalCluster &gem, int trackNumber, CSCCorrelatedLCTDigi &lct) const
 
void constructLCTsGEM (const CSCALCTDigi &alct, const GEMInternalCluster &gem, int trackNumber, CSCCorrelatedLCTDigi &lct) const
 
void correlateLCTsGEM (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
void correlateLCTsGEM (const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
void correlateLCTsGEM (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
void dropLowQualityALCTNoClusters (CSCALCTDigi &alct, const GEMInternalCluster &cluster) const
 
void dropLowQualityCLCTNoClusters (CSCCLCTDigi &clct, const GEMInternalCluster &cluster) const
 
void matchALCT2GEM (bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
 
void matchALCTCLCT (bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
 
void matchALCTCLCTGEM (bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
 
void matchCLCT2GEM (bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
 
void sortLCTsByBending (std::vector< CSCCorrelatedLCTDigi > &lcts) const
 

Private Attributes

bool assign_gem_csc_bending_
 
bool build_lct_from_alct_clct_1gem_
 
bool build_lct_from_alct_clct_2gem_
 
bool build_lct_from_alct_gem_
 
bool build_lct_from_clct_gem_
 
bool build_lct_from_clct_gem_me1a_
 
std::shared_ptr
< GEMClusterProcessor
clusterProc_
 
std::map< int,
GEMInternalClusters
clusters_
 
std::unique_ptr< CSCGEMMatchercscGEMMatcher_
 
bool drop_low_quality_alct_no_gems_
 
bool drop_low_quality_clct_no_gems_
 
bool drop_low_quality_clct_no_gems_me1a_
 
bool drop_used_gems_
 
const GEMGeometrygem_g
 
unsigned gemId
 
bool hasGE21Geometry16Partitions_
 
bool match_earliest_gem_only_
 
unsigned max_delta_bx_alct_gem_
 
unsigned max_delta_bx_clct_gem_
 

Additional Inherited Members

- Public Attributes inherited from CSCMotherboard
std::unique_ptr
< CSCAnodeLCTProcessor
alctProc
 
std::unique_ptr
< CSCCathodeLCTProcessor
clctProc
 
- Protected Member Functions inherited from CSCMotherboard
void checkConfigParameters ()
 
void constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const
 
void copyValidToInValid (CSCALCTDigi &, CSCALCTDigi &, CSCCLCTDigi &, CSCCLCTDigi &) const
 
void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &bLCT, CSCCorrelatedLCTDigi &sLCT, int type) const
 
bool doesALCTCrossCLCT (const CSCALCTDigi &, const CSCCLCTDigi &) const
 
void dumpConfigParams () const
 
void encodeHighMultiplicityBits ()
 
unsigned int encodePattern (const int clctPattern) const
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) const
 
CSCCLCTDigi getBXShiftedCLCT (const CSCCLCTDigi &) const
 
void matchALCTCLCT (bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
 
- Protected Member Functions inherited from CSCBaseboard
void checkConfigParameters (unsigned int &var, const unsigned int var_max, const unsigned int var_def, const std::string &var_str)
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
std::vector< CSCALCTDigialctV
 
LCTContainer allLCTs_
 
unsigned int clct_trig_enable
 
std::vector< CSCCLCTDigiclctV
 
std::unique_ptr< CSCALCTCrossCLCTcscOverlap_
 
bool drop_used_clcts
 
int early_tbins
 
bool ignoreAlctCrossClct_
 
std::vector< CSCCorrelatedLCTDigilctV
 
const CSCL1TPLookupTableCCLUTlookupTableCCLUT_
 
const CSCL1TPLookupTableME11ILTlookupTableME11ILT_
 
const CSCL1TPLookupTableME21ILTlookupTableME21ILT_
 
bool match_earliest_clct_only_
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
std::vector< int > preferred_bx_match_
 
std::unique_ptr
< LCTQualityAssignment
qualityAssignment_
 
std::unique_ptr
< LCTQualityControl
qualityControl_
 
bool readout_earliest_2
 
CSCShowerDigi shower_
 
unsigned showerSource_
 
unsigned int tmb_l1a_window_size
 
- Protected Attributes inherited from CSCBaseboard
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctPhase2_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isME12_
 
bool isME13_
 
bool isME21_
 
bool isME22_
 
bool isME31_
 
bool isME32_
 
bool isME41_
 
bool isME42_
 
bool runCCLUT_
 
bool runCCLUT_OTMB_
 
bool runCCLUT_TMB_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
bool runPhase2_
 
edm::ParameterSet showerParams_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
int theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 
- 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

Class for TMBs for the GEM-CSC integrated local trigger. Inherits from CSCMotherboard. Provides functionality to match ALCT/CLCT to GEM single clusters or coincidences of clusters

Author
Sven Dildick (Rice University)

Definition at line 19 of file CSCGEMMotherboard.h.

Member Typedef Documentation

Definition at line 21 of file CSCGEMMotherboard.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file CSCGEMMotherboard.cc.

References assign_gem_csc_bending_, build_lct_from_clct_gem_me1a_, clusterProc_, cscGEMMatcher_, drop_low_quality_clct_no_gems_me1a_, drop_used_gems_, gemId, edm::ParameterSet::getParameter(), CSCBaseboard::isME11_, CSCBaseboard::isME21_, match_earliest_gem_only_, max_delta_bx_alct_gem_, max_delta_bx_clct_gem_, CSCMotherboard::qualityAssignment_, DetId::rawId(), CSCBaseboard::runME11ILT_, CSCBaseboard::runME21ILT_, CSCBaseboard::theChamber, CSCBaseboard::theRegion, CSCBaseboard::theStation, and CSCBaseboard::tmbParams_.

10  : CSCMotherboard(endcap, station, sector, subsector, chamber, conf),
11  drop_low_quality_alct_no_gems_(tmbParams_.getParameter<bool>("dropLowQualityALCTsNoGEMs")),
12  drop_low_quality_clct_no_gems_(tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs")),
13  build_lct_from_alct_clct_2gem_(tmbParams_.getParameter<bool>("buildLCTfromALCTCLCTand2GEM")),
14  build_lct_from_alct_clct_1gem_(tmbParams_.getParameter<bool>("buildLCTfromALCTCLCTand1GEM")),
15  build_lct_from_alct_gem_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM")),
16  build_lct_from_clct_gem_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM")) {
17  // case for ME1/1
18  if (isME11_) {
19  drop_low_quality_clct_no_gems_me1a_ = tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1a");
20  build_lct_from_clct_gem_me1a_ = tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM_ME1a");
21  }
22 
23  max_delta_bx_alct_gem_ = tmbParams_.getParameter<unsigned>("maxDeltaBXALCTGEM");
24  max_delta_bx_clct_gem_ = tmbParams_.getParameter<unsigned>("maxDeltaBXCLCTGEM");
25 
26  assign_gem_csc_bending_ = tmbParams_.getParameter<bool>("assignGEMCSCBending");
27  qualityAssignment_->setGEMCSCBending(assign_gem_csc_bending_);
28 
29  drop_used_gems_ = tmbParams_.getParameter<bool>("tmbDropUsedGems");
30  match_earliest_gem_only_ = tmbParams_.getParameter<bool>("matchEarliestGemsOnly");
31 
32  // These LogErrors are sanity checks and should not be printed
33  if (isME11_ and !runME11ILT_) {
34  edm::LogError("CSCGEMMotherboard") << "TMB constructed while runME11ILT_ is not set!";
35  };
36 
37  if (isME21_ and !runME21ILT_) {
38  edm::LogError("CSCGEMMotherboard") << "TMB constructed while runME21ILT_ is not set!";
39  };
40 
41  // super chamber has layer=0!
43 
44  clusterProc_ = std::make_shared<GEMClusterProcessor>(theRegion, theStation, theChamber, conf);
45 
46  cscGEMMatcher_ = std::make_unique<CSCGEMMatcher>(theRegion, theStation, theChamber, tmbParams_, conf);
47 }
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool drop_low_quality_clct_no_gems_me1a_
Log< level::Error, false > LogError
CSCMotherboard(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
unsigned max_delta_bx_clct_gem_
unsigned theChamber
Definition: CSCBaseboard.h:49
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:78
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const unsigned theStation
Definition: CSCBaseboard.h:43
std::shared_ptr< GEMClusterProcessor > clusterProc_
unsigned max_delta_bx_alct_gem_
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
CSCGEMMotherboard::~CSCGEMMotherboard ( )
override

Definition at line 49 of file CSCGEMMotherboard.cc.

49 {}

Member Function Documentation

void CSCGEMMotherboard::clear ( void  )

Definition at line 51 of file CSCGEMMotherboard.cc.

References CSCMotherboard::clear(), and clusterProc_.

Referenced by run().

51  {
53  clusterProc_->clear();
54 }
std::shared_ptr< GEMClusterProcessor > clusterProc_
std::shared_ptr<GEMClusterProcessor> CSCGEMMotherboard::clusterProc ( ) const
inline

Definition at line 50 of file CSCGEMMotherboard.h.

References clusterProc_.

Referenced by CSCTriggerPrimitivesBuilder::build().

50 { return clusterProc_; }
std::shared_ptr< GEMClusterProcessor > clusterProc_
void CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMInternalCluster gem,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 485 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::ALCTCLCT, CSCCorrelatedLCTDigi::ALCTCLCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCTGEM, assign_gem_csc_bending_, cscGEMMatcher_, CSCMotherboard::encodePattern(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCMotherboard::getBXShiftedALCT(), CSCMotherboard::getBXShiftedCLCT(), CSCCLCTDigi::getEighthStripBit(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuartStripBit(), CSCCLCTDigi::getRun3Pattern(), CSCCLCTDigi::getSlope(), GEMInternalCluster::isCoincidence(), GEMInternalCluster::isValid(), GEMInternalCluster::mid1(), GEMInternalCluster::mid2(), CSCMotherboard::qualityAssignment_, CSCBaseboard::runCCLUT_, CSCCorrelatedLCTDigi::setALCT(), CSCCorrelatedLCTDigi::setBend(), CSCCorrelatedLCTDigi::setBX(), CSCCorrelatedLCTDigi::setBX0(), CSCCorrelatedLCTDigi::setCLCT(), CSCCorrelatedLCTDigi::setCSCID(), CSCCorrelatedLCTDigi::setEighthStripBit(), CSCCorrelatedLCTDigi::setGEM1(), CSCCorrelatedLCTDigi::setGEM2(), CSCCorrelatedLCTDigi::setMPCLink(), CSCCorrelatedLCTDigi::setPattern(), CSCCorrelatedLCTDigi::setQuality(), CSCCorrelatedLCTDigi::setQuartStripBit(), CSCCorrelatedLCTDigi::setRun3(), CSCCorrelatedLCTDigi::setRun3Pattern(), CSCCorrelatedLCTDigi::setSlope(), CSCCorrelatedLCTDigi::setStrip(), CSCCorrelatedLCTDigi::setSyncErr(), CSCCorrelatedLCTDigi::setTrknmb(), CSCCorrelatedLCTDigi::setType(), CSCCorrelatedLCTDigi::setValid(), CSCCorrelatedLCTDigi::setWireGroup(), and CSCBaseboard::theTrigChamber.

Referenced by correlateLCTsGEM().

488  {
489  thisLCT.setValid(true);
490  if (gem.isCoincidence()) {
491  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT2GEM);
492  } else if (gem.isValid()) {
493  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCTGEM);
494  } else {
495  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT);
496  }
497  thisLCT.setQuality(qualityAssignment_->findQuality(alct, clct, gem));
498  thisLCT.setALCT(getBXShiftedALCT(alct));
499  thisLCT.setCLCT(getBXShiftedCLCT(clct));
500  // set pads if there are any
501  thisLCT.setGEM1(gem.mid1());
502  thisLCT.setGEM2(gem.mid2());
503  thisLCT.setPattern(encodePattern(clct.getPattern()));
504  thisLCT.setMPCLink(0);
505  thisLCT.setBX0(0);
506  thisLCT.setSyncErr(0);
507  thisLCT.setCSCID(theTrigChamber);
508  // track number to be set later in final sorting stage
509  thisLCT.setTrknmb(0);
510  thisLCT.setWireGroup(alct.getKeyWG());
511  thisLCT.setStrip(clct.getKeyStrip());
512  thisLCT.setBend(clct.getBend());
513  thisLCT.setBX(alct.getBX());
514  if (runCCLUT_) {
515  thisLCT.setRun3(true);
517  thisLCT.setSlope(cscGEMMatcher_->calculateGEMCSCBending(clct, gem));
518  else
519  thisLCT.setSlope(clct.getSlope());
520  thisLCT.setQuartStripBit(clct.getQuartStripBit());
521  thisLCT.setEighthStripBit(clct.getEighthStripBit());
522  thisLCT.setRun3Pattern(clct.getRun3Pattern());
523  }
524 }
GEMPadDigi mid1() const
uint16_t getRun3Pattern() const
return pattern
Definition: CSCCLCTDigi.h:68
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
bool getEighthStripBit() const
get single eighth strip bit
Definition: CSCCLCTDigi.h:114
unsigned int encodePattern(const int clctPattern) const
GEMPadDigi mid2() const
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
uint16_t getSlope() const
return the slope
Definition: CSCCLCTDigi.h:74
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
bool isCoincidence() const
bool getQuartStripBit() const
get single quart strip bit
Definition: CSCCLCTDigi.h:108
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
void CSCGEMMotherboard::constructLCTsGEM ( const CSCCLCTDigi clct,
const GEMInternalCluster gem,
int  trackNumber,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 527 of file CSCGEMMotherboard.cc.

References assign_gem_csc_bending_, GEMInternalCluster::bx(), CSCCorrelatedLCTDigi::CLCT2GEM, cscGEMMatcher_, CSCMotherboard::encodePattern(), CSCCLCTDigi::getBend(), CSCMotherboard::getBXShiftedCLCT(), CSCCLCTDigi::getEighthStripBit(), CSCCLCTDigi::getKeyStrip(), GEMInternalCluster::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuartStripBit(), CSCCLCTDigi::getRun3Pattern(), CSCCLCTDigi::getSlope(), GEMInternalCluster::mid1(), GEMInternalCluster::mid2(), CSCMotherboard::qualityAssignment_, CSCBaseboard::runCCLUT_, CSCCorrelatedLCTDigi::setBend(), CSCCorrelatedLCTDigi::setBX(), CSCCorrelatedLCTDigi::setBX0(), CSCCorrelatedLCTDigi::setCLCT(), CSCCorrelatedLCTDigi::setCSCID(), CSCCorrelatedLCTDigi::setEighthStripBit(), CSCCorrelatedLCTDigi::setGEM1(), CSCCorrelatedLCTDigi::setGEM2(), CSCCorrelatedLCTDigi::setMPCLink(), CSCCorrelatedLCTDigi::setPattern(), CSCCorrelatedLCTDigi::setQuality(), CSCCorrelatedLCTDigi::setQuartStripBit(), CSCCorrelatedLCTDigi::setRun3(), CSCCorrelatedLCTDigi::setRun3Pattern(), CSCCorrelatedLCTDigi::setSlope(), CSCCorrelatedLCTDigi::setStrip(), CSCCorrelatedLCTDigi::setSyncErr(), CSCCorrelatedLCTDigi::setTrknmb(), CSCCorrelatedLCTDigi::setType(), CSCCorrelatedLCTDigi::setValid(), CSCCorrelatedLCTDigi::setWireGroup(), and CSCBaseboard::theTrigChamber.

530  {
531  thisLCT.setValid(true);
532  thisLCT.setType(CSCCorrelatedLCTDigi::CLCT2GEM);
533  thisLCT.setQuality(qualityAssignment_->findQuality(clct, gem));
534  thisLCT.setCLCT(getBXShiftedCLCT(clct));
535  thisLCT.setGEM1(gem.mid1());
536  thisLCT.setGEM2(gem.mid2());
537  thisLCT.setPattern(encodePattern(clct.getPattern()));
538  thisLCT.setMPCLink(0);
539  thisLCT.setBX0(0);
540  thisLCT.setSyncErr(0);
541  thisLCT.setCSCID(theTrigChamber);
542  thisLCT.setTrknmb(trackNumber);
543  thisLCT.setWireGroup(gem.getKeyWG());
544  thisLCT.setStrip(clct.getKeyStrip());
545  thisLCT.setBend(clct.getBend());
546  thisLCT.setBX(gem.bx());
547  if (runCCLUT_) {
548  thisLCT.setRun3(true);
550  thisLCT.setSlope(cscGEMMatcher_->calculateGEMCSCBending(clct, gem));
551  else
552  thisLCT.setSlope(clct.getSlope());
553  thisLCT.setQuartStripBit(clct.getQuartStripBit());
554  thisLCT.setEighthStripBit(clct.getEighthStripBit());
555  thisLCT.setRun3Pattern(clct.getRun3Pattern());
556  }
557 }
GEMPadDigi mid1() const
uint16_t getRun3Pattern() const
return pattern
Definition: CSCCLCTDigi.h:68
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
bool getEighthStripBit() const
get single eighth strip bit
Definition: CSCCLCTDigi.h:114
unsigned int encodePattern(const int clctPattern) const
GEMPadDigi mid2() const
uint16_t getSlope() const
return the slope
Definition: CSCCLCTDigi.h:74
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
unsigned getKeyWG() const
bool getQuartStripBit() const
get single quart strip bit
Definition: CSCCLCTDigi.h:108
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
void CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const GEMInternalCluster gem,
int  trackNumber,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 560 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::ALCT2GEM, CSCALCTDigi::getBX(), CSCMotherboard::getBXShiftedALCT(), GEMInternalCluster::getKeyStrip(), CSCALCTDigi::getKeyWG(), GEMInternalCluster::mid1(), GEMInternalCluster::mid2(), CSCMotherboard::qualityAssignment_, CSCBaseboard::runCCLUT_, CSCCorrelatedLCTDigi::setALCT(), CSCCorrelatedLCTDigi::setBend(), CSCCorrelatedLCTDigi::setBX(), CSCCorrelatedLCTDigi::setBX0(), CSCCorrelatedLCTDigi::setCSCID(), CSCCorrelatedLCTDigi::setEighthStripBit(), CSCCorrelatedLCTDigi::setGEM1(), CSCCorrelatedLCTDigi::setGEM2(), CSCCorrelatedLCTDigi::setMPCLink(), CSCCorrelatedLCTDigi::setPattern(), CSCCorrelatedLCTDigi::setQuality(), CSCCorrelatedLCTDigi::setQuartStripBit(), CSCCorrelatedLCTDigi::setRun3(), CSCCorrelatedLCTDigi::setRun3Pattern(), CSCCorrelatedLCTDigi::setSlope(), CSCCorrelatedLCTDigi::setStrip(), CSCCorrelatedLCTDigi::setSyncErr(), CSCCorrelatedLCTDigi::setTrknmb(), CSCCorrelatedLCTDigi::setType(), CSCCorrelatedLCTDigi::setValid(), CSCCorrelatedLCTDigi::setWireGroup(), and CSCBaseboard::theTrigChamber.

563  {
564  thisLCT.setValid(true);
565  thisLCT.setType(CSCCorrelatedLCTDigi::ALCT2GEM);
566  thisLCT.setQuality(qualityAssignment_->findQuality(alct, gem));
567  thisLCT.setALCT(getBXShiftedALCT(alct));
568  thisLCT.setGEM1(gem.mid1());
569  thisLCT.setGEM2(gem.mid2());
570  thisLCT.setPattern(10);
571  thisLCT.setMPCLink(0);
572  thisLCT.setBX0(0);
573  thisLCT.setSyncErr(0);
574  thisLCT.setCSCID(theTrigChamber);
575  thisLCT.setTrknmb(trackNumber);
576  thisLCT.setWireGroup(alct.getKeyWG());
577  thisLCT.setStrip(gem.getKeyStrip());
578  thisLCT.setBend(0);
579  thisLCT.setBX(alct.getBX());
580  if (runCCLUT_) {
581  thisLCT.setRun3(true);
582  thisLCT.setSlope(0);
583  thisLCT.setQuartStripBit(false);
584  thisLCT.setEighthStripBit(false);
585  // ALCT-2GEM type LCTs do not bend in the chamber
586  thisLCT.setRun3Pattern(4);
587  }
588 }
GEMPadDigi mid1() const
uint16_t getKeyStrip(int n=2) const
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
GEMPadDigi mid2() const
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
void CSCGEMMotherboard::correlateLCTsGEM ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
const GEMInternalClusters clusters,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
private

Definition at line 307 of file CSCGEMMotherboard.cc.

References constructLCTsGEM(), CSCMotherboard::copyValidToInValid(), cscGEMMatcher_, dropLowQualityALCTNoClusters(), dropLowQualityCLCTNoClusters(), CSCALCTDigi::isValid(), sistrip::SpyUtilities::isValid(), CSCCLCTDigi::isValid(), CSCConstants::MAX_LCTS_PER_CSC, CSCCorrelatedLCTDigi::setTrknmb(), and sortLCTsByBending().

Referenced by matchALCT2GEM(), matchALCTCLCTGEM(), and matchCLCT2GEM().

313  {
314  // case where there no valid clusters
315  if (clusters.empty())
316  return;
317 
318  // temporary container
319  std::vector<CSCCorrelatedLCTDigi> lcts;
320 
321  CSCALCTDigi bestALCT = bALCT;
322  CSCALCTDigi secondALCT = sALCT;
323  CSCCLCTDigi bestCLCT = bCLCT;
324  CSCCLCTDigi secondCLCT = sCLCT;
325 
326  // Sanity checks on the ALCT and CLCT
327  if (!bestALCT.isValid()) {
328  edm::LogError("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM!";
329  return;
330  }
331 
332  if (!bestCLCT.isValid()) {
333  edm::LogError("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM!";
334  return;
335  }
336 
337  // at this point, we have at least one valid cluster, and we're either dealing
338  // wit GE1/1 or GE2/1 with 16 partitions, both are OK for GEM-CSC trigger
339 
340  // before matching ALCT-CLCT pairs with clusters, we check if we need
341  // to drop particular low quality ALCTs or CLCTs without matching clusters
342  // drop low quality CLCTs if no clusters and flags are set
343  GEMInternalCluster bestALCTCluster, secondALCTCluster;
344  GEMInternalCluster bestCLCTCluster, secondCLCTCluster;
345  cscGEMMatcher_->bestClusterBXLoc(bestALCT, clusters, bestALCTCluster);
346  cscGEMMatcher_->bestClusterBXLoc(secondALCT, clusters, secondALCTCluster);
347  cscGEMMatcher_->bestClusterBXLoc(bestCLCT, clusters, bestCLCTCluster);
348  cscGEMMatcher_->bestClusterBXLoc(secondCLCT, clusters, secondCLCTCluster);
349 
350  dropLowQualityALCTNoClusters(bestALCT, bestALCTCluster);
351  dropLowQualityALCTNoClusters(secondALCT, secondALCTCluster);
352  dropLowQualityCLCTNoClusters(bestCLCT, bestCLCTCluster);
353  dropLowQualityCLCTNoClusters(secondCLCT, secondCLCTCluster);
354 
355  // check which ALCTs and CLCTs are valid after dropping the low-quality ones
356  copyValidToInValid(bestALCT, secondALCT, bestCLCT, secondCLCT);
357 
358  // We can now check possible triplets and construct all LCTs with
359  // valid ALCT, valid CLCTs and coincidence clusters
360  GEMInternalCluster bbCluster, bsCluster, sbCluster, ssCluster;
361  cscGEMMatcher_->bestClusterBXLoc(bestALCT, bestCLCT, clusters, bbCluster);
362  cscGEMMatcher_->bestClusterBXLoc(bestALCT, secondCLCT, clusters, bsCluster);
363  cscGEMMatcher_->bestClusterBXLoc(secondALCT, bestCLCT, clusters, sbCluster);
364  cscGEMMatcher_->bestClusterBXLoc(secondALCT, secondCLCT, clusters, ssCluster);
365 
366  // At this point it is still possible that certain pairs with high-quality
367  // ALCTs and CLCTs do not have matching clusters. In that case we construct
368  // a regular ALCT-CLCT type LCT. For instance, it could be that two muons went
369  // through the chamber, produced 2 ALCTs, 2 CLCTs, but only 1 GEM cluster - because
370  // GEM cluster efficiency is not 100% (closer to 95%). So we don't require
371  // all clusters to be valid. If they are valid, the LCTs is constructed accordingly.
372  // But we do require that the ALCT and CLCT are valid for each pair.
373  CSCCorrelatedLCTDigi lctbb, lctbs, lctsb, lctss;
374  if (bestALCT.isValid() and bestCLCT.isValid()) {
375  constructLCTsGEM(bestALCT, bestCLCT, bbCluster, lctbb);
376  lcts.push_back(lctbb);
377  }
378  if (bestALCT.isValid() and secondCLCT.isValid() and (secondCLCT != bestCLCT)) {
379  constructLCTsGEM(bestALCT, secondCLCT, bsCluster, lctbs);
380  lcts.push_back(lctbs);
381  }
382  if (bestCLCT.isValid() and secondALCT.isValid() and (secondALCT != bestALCT)) {
383  constructLCTsGEM(secondALCT, bestCLCT, sbCluster, lctsb);
384  lcts.push_back(lctsb);
385  }
386  if (secondALCT.isValid() and secondCLCT.isValid() and (secondALCT != bestALCT) and (secondCLCT != bestCLCT)) {
387  constructLCTsGEM(secondALCT, secondCLCT, ssCluster, lctss);
388  lcts.push_back(lctss);
389  }
390 
391  // no LCTs
392  if (lcts.empty())
393  return;
394 
395  // sort by bending angle
396  sortLCTsByBending(lcts);
397 
398  // retain best two
399  lcts.resize(CSCConstants::MAX_LCTS_PER_CSC);
400 
401  // assign the track number
402  if (lcts[0].isValid()) {
403  lct1 = lcts[0];
404  lct1.setTrknmb(1);
405  }
406 
407  if (lcts[1].isValid()) {
408  lct2 = lcts[1];
409  lct2.setTrknmb(2);
410  }
411 }
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
void sortLCTsByBending(std::vector< CSCCorrelatedLCTDigi > &lcts) const
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
Log< level::Error, false > LogError
void copyValidToInValid(CSCALCTDigi &, CSCALCTDigi &, CSCCLCTDigi &, CSCCLCTDigi &) const
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
void dropLowQualityALCTNoClusters(CSCALCTDigi &alct, const GEMInternalCluster &cluster) const
void dropLowQualityCLCTNoClusters(CSCCLCTDigi &clct, const GEMInternalCluster &cluster) const
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
void CSCGEMMotherboard::correlateLCTsGEM ( const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
const GEMInternalClusters clusters,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
private

Definition at line 413 of file CSCGEMMotherboard.cc.

References CSCCLCTDigi::clear(), constructLCTsGEM(), cscGEMMatcher_, dropLowQualityCLCTNoClusters(), GEMInternalCluster::isCoincidence(), and CSCCLCTDigi::isValid().

417  {
418  CSCCLCTDigi bestCLCT = bCLCT;
419  CSCCLCTDigi secondCLCT = sCLCT;
420 
421  if (!bestCLCT.isValid()) {
422  edm::LogError("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM!";
423  return;
424  }
425 
426  // if the second best CLCT equals the best CLCT, clear it
427  if (secondCLCT == bestCLCT)
428  secondCLCT.clear();
429 
430  // get the best matching cluster
431  GEMInternalCluster bestCluster;
432  GEMInternalCluster secondCluster;
433  cscGEMMatcher_->bestClusterBXLoc(bestCLCT, clusters, bestCluster);
434  cscGEMMatcher_->bestClusterBXLoc(secondCLCT, clusters, secondCluster);
435 
436  // drop low quality CLCTs if no clusters and flags are set
437  dropLowQualityCLCTNoClusters(bestCLCT, bestCluster);
438  dropLowQualityCLCTNoClusters(secondCLCT, secondCluster);
439 
440  // construct all LCTs with valid CLCTs and coincidence clusters
441  if (bestCLCT.isValid() and bestCluster.isCoincidence()) {
442  constructLCTsGEM(bestCLCT, bestCluster, 1, lct1);
443  }
444  if (secondCLCT.isValid() and secondCluster.isCoincidence()) {
445  constructLCTsGEM(secondCLCT, secondCluster, 2, lct2);
446  }
447 }
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
Log< level::Error, false > LogError
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:73
void dropLowQualityCLCTNoClusters(CSCCLCTDigi &clct, const GEMInternalCluster &cluster) const
bool isCoincidence() const
void CSCGEMMotherboard::correlateLCTsGEM ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const GEMInternalClusters clusters,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
private

Definition at line 449 of file CSCGEMMotherboard.cc.

References CSCALCTDigi::clear(), constructLCTsGEM(), cscGEMMatcher_, dropLowQualityALCTNoClusters(), GEMInternalCluster::isCoincidence(), and CSCALCTDigi::isValid().

453  {
454  CSCALCTDigi bestALCT = bALCT;
455  CSCALCTDigi secondALCT = sALCT;
456 
457  if (!bestALCT.isValid()) {
458  edm::LogError("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM!";
459  return;
460  }
461 
462  // if the second best ALCT equals the best ALCT, clear it
463  if (secondALCT == bestALCT)
464  secondALCT.clear();
465 
466  // get the best matching cluster
467  GEMInternalCluster bestCluster;
468  GEMInternalCluster secondCluster;
469  cscGEMMatcher_->bestClusterBXLoc(bestALCT, clusters, bestCluster);
470  cscGEMMatcher_->bestClusterBXLoc(secondALCT, clusters, secondCluster);
471 
472  // drop low quality ALCTs if no clusters and flags are set
473  dropLowQualityALCTNoClusters(bestALCT, bestCluster);
474  dropLowQualityALCTNoClusters(secondALCT, secondCluster);
475 
476  // construct all LCTs with valid ALCTs and coincidence clusters
477  if (bestALCT.isValid() and bestCluster.isCoincidence()) {
478  constructLCTsGEM(bestALCT, bestCluster, 1, lct1);
479  }
480  if (secondALCT.isValid() and secondCluster.isCoincidence()) {
481  constructLCTsGEM(secondALCT, secondCluster, 2, lct2);
482  }
483 }
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:60
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
Log< level::Error, false > LogError
void dropLowQualityALCTNoClusters(CSCALCTDigi &alct, const GEMInternalCluster &cluster) const
bool isCoincidence() const
void CSCGEMMotherboard::dropLowQualityALCTNoClusters ( CSCALCTDigi alct,
const GEMInternalCluster cluster 
) const
private

Definition at line 590 of file CSCGEMMotherboard.cc.

References CSCALCTDigi::clear(), drop_low_quality_alct_no_gems_, CSCALCTDigi::getQuality(), and GEMInternalCluster::isValid().

Referenced by correlateLCTsGEM().

590  {
591  // clear alct if they are of low quality without matching GEM clusters
592  if (alct.getQuality() == 0 and !cluster.isValid() and drop_low_quality_alct_no_gems_)
593  alct.clear();
594 }
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:60
void CSCGEMMotherboard::dropLowQualityCLCTNoClusters ( CSCCLCTDigi clct,
const GEMInternalCluster cluster 
) const
private

Definition at line 596 of file CSCGEMMotherboard.cc.

References CSCCLCTDigi::clear(), drop_low_quality_clct_no_gems_, drop_low_quality_clct_no_gems_me1a_, CSCCLCTDigi::getKeyStrip(), CSCCLCTDigi::getQuality(), CSCBaseboard::isME11_, GEMInternalCluster::isValid(), and CSCConstants::MAX_HALF_STRIP_ME1B.

Referenced by correlateLCTsGEM().

596  {
597  // Here, we need to check which could be an ME1/a LCT
598  bool dropLQCLCTNoGEMs = drop_low_quality_clct_no_gems_;
600  dropLQCLCTNoGEMs = drop_low_quality_clct_no_gems_me1a_;
601 
602  // clear clct if they are of low quality without matching GEM clusters
603  if (clct.getQuality() <= 3 and !cluster.isValid() and dropLQCLCTNoGEMs)
604  clct.clear();
605 }
bool drop_low_quality_clct_no_gems_me1a_
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:73
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:56
void CSCGEMMotherboard::matchALCT2GEM ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
private

Definition at line 255 of file CSCGEMMotherboard.cc.

References CSCMotherboard::alctProc, CSCMotherboard::allLCTs_, clusterProc_, correlateLCTsGEM(), drop_used_gems_, hasGE21Geometry16Partitions_, CSCBaseboard::isME21_, match_earliest_gem_only_, CSCConstants::MAX_ALCT_TBINS, max_delta_bx_alct_gem_, and CSCMotherboard::preferred_bx_match_.

Referenced by run().

255  {
256  // no matching is done for GE2/1 geometries with 8 eta partitions
257  // this has been superseded by 16-eta partition geometries
259  return;
260 
261  // clear the array to mask GEMs this window is quite wide.
262  // We don't expect GEM coincidence clusters to show up too far
263  // from the central BX (8)
264  bool used_gem_mask[CSCConstants::MAX_ALCT_TBINS] = {false};
265 
266  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
267  // do not consider LCT building in this BX if the mask was set
268  if (bunch_crossing_mask[bx_alct])
269  continue;
270 
271  if (alctProc->getBestALCT(bx_alct).isValid()) {
272  for (unsigned mbx = 0; mbx < 2 * max_delta_bx_alct_gem_ + 1; mbx++) {
273  // evaluate the preffered GEM BX
274  int bx_gem = bx_alct + preferred_bx_match_[mbx];
275 
276  if (bx_gem < 0 or bx_gem >= CSCConstants::MAX_ALCT_TBINS)
277  continue;
278  // drop GEMs in this BX if one of them was previously matched to an ALCT
279  if (drop_used_gems_ and used_gem_mask[bx_gem])
280  continue;
281  // check for at least one valid GEM cluster
282  if (!clusterProc_->getCoincidenceClusters(bx_gem).empty()) {
283  // now correlate the ALCT and GEM into LCT.
284  // smaller mbx means more preferred!
285  correlateLCTsGEM(alctProc->getBestALCT(bx_alct),
286  alctProc->getSecondALCT(bx_alct),
287  clusterProc_->getCoincidenceClusters(bx_gem),
288  allLCTs_(bx_alct, mbx, 0),
289  allLCTs_(bx_alct, mbx, 1));
290 
291  if (allLCTs_(bx_alct, mbx, 0).isValid()) {
292  // do not consider GEM clusters
293  used_gem_mask[bx_gem] = true;
294  // mask this bunch crossing for future consideration
295  bunch_crossing_mask[bx_alct] = true;
296  // if we only consider the first valid GEM coincidence clusters,
297  // we move on to the next ALCT immediately
299  break;
300  }
301  }
302  }
303  }
304  }
305 }
void correlateLCTsGEM(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
LCTContainer allLCTs_
std::vector< int > preferred_bx_match_
std::shared_ptr< GEMClusterProcessor > clusterProc_
unsigned max_delta_bx_alct_gem_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void CSCGEMMotherboard::matchALCTCLCT ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
private
void CSCGEMMotherboard::matchALCTCLCTGEM ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
private

Definition at line 138 of file CSCGEMMotherboard.cc.

References CSCConstants::ALCT_CLCT_OFFSET, CSCMotherboard::alctProc, GEMClusterProcessor::AllClusters, CSCMotherboard::allLCTs_, build_lct_from_alct_clct_2gem_, CSCMotherboard::clctProc, clusterProc_, correlateLCTsGEM(), CSCMotherboard::drop_used_clcts, hasGE21Geometry16Partitions_, CSCBaseboard::isME21_, LogTrace, CSCMotherboard::match_earliest_clct_only_, CSCMotherboard::match_trig_window_size, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, max_delta_bx_alct_gem_, CSCMotherboard::preferred_bx_match_, and GEMClusterProcessor::SingleClusters.

Referenced by run().

138  {
139  // no matching is done for GE2/1 geometries with 8 eta partitions
140  // this has been superseded by 16-eta partition geometries
142  return;
143 
144  // by default we will try to match with both single clusters and coincidence clusters
145  // if we do not build ALCT-CLCT-2GEM type LCTs, consider only single clusters
149 
150  // array to mask CLCTs
151  bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false};
152 
153  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
154  // do not consider invalid ALCTs
155  if (alctProc->getBestALCT(bx_alct).isValid()) {
156  for (unsigned mbx = 0; mbx < match_trig_window_size; mbx++) {
157  // evaluate the preffered CLCT BX, taking into account that there is an offset in the simulation
158  unsigned bx_clct = bx_alct + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET;
159 
160  // CLCT BX must be in the time window
161  if (bx_clct >= CSCConstants::MAX_CLCT_TBINS)
162  continue;
163  // drop this CLCT if it was previously matched to an ALCT
164  if (drop_used_clcts and used_clct_mask[bx_clct])
165  continue;
166  // do not consider invalid CLCTs
167  if (clctProc->getBestCLCT(bx_clct).isValid()) {
168  LogTrace("CSCMotherboard") << "Successful ALCT-CLCT match: bx_alct = " << bx_alct << "; bx_clct = " << bx_clct
169  << "; mbx = " << mbx;
170 
171  // now correlate the ALCT and CLCT into LCT.
172  // smaller mbx means more preferred!
173  correlateLCTsGEM(alctProc->getBestALCT(bx_alct),
174  alctProc->getSecondALCT(bx_alct),
175  clctProc->getBestCLCT(bx_clct),
176  clctProc->getSecondCLCT(bx_clct),
177  clusterProc_->getClusters(bx_alct, max_delta_bx_alct_gem_, option),
178  allLCTs_(bx_alct, mbx, 0),
179  allLCTs_(bx_alct, mbx, 1));
180 
181  if (allLCTs_(bx_alct, mbx, 0).isValid()) {
182  // mask this CLCT as used. If a flag is set, the CLCT may or may not be reused
183  used_clct_mask[bx_clct] = true;
184  // mask this bunch crossing for future considation
185  bunch_crossing_mask[bx_alct] = true;
186  // if we only consider the first valid CLCT, we move on to the next ALCT immediately
188  break;
189  }
190  }
191  }
192  }
193  }
194 }
void correlateLCTsGEM(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
LCTContainer allLCTs_
unsigned int match_trig_window_size
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
#define LogTrace(id)
std::vector< int > preferred_bx_match_
bool match_earliest_clct_only_
std::shared_ptr< GEMClusterProcessor > clusterProc_
unsigned max_delta_bx_alct_gem_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void CSCGEMMotherboard::matchCLCT2GEM ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
private

Definition at line 196 of file CSCGEMMotherboard.cc.

References CSCConstants::ALCT_CLCT_OFFSET, CSCMotherboard::allLCTs_, build_lct_from_clct_gem_me1a_, CSCMotherboard::clctProc, clusterProc_, correlateLCTsGEM(), CSCMotherboard::drop_used_clcts, hasGE21Geometry16Partitions_, CSCBaseboard::isME11_, CSCBaseboard::isME21_, CSCMotherboard::match_earliest_clct_only_, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, max_delta_bx_clct_gem_, CSCConstants::MAX_HALF_STRIP_ME1B, and CSCMotherboard::preferred_bx_match_.

Referenced by run().

196  {
197  // no matching is done for GE2/1 geometries with 8 eta partitions
198  // this has been superseded by 16-eta partition geometries
200  return;
201 
202  // array to mask CLCTs
203  bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false};
204 
205  for (int bx_gem = 0; bx_gem < CSCConstants::MAX_ALCT_TBINS; bx_gem++) {
206  // do not consider LCT building in this BX if the mask was set
207  if (bunch_crossing_mask[bx_gem])
208  continue;
209 
210  // Check that there is at least one valid GEM coincidence cluster in this BX
211  if (!clusterProc_->getCoincidenceClusters(bx_gem).empty()) {
212  // GEM clusters will have central BX 8. So do ALCTs. But! CLCTs still have central BX 7
213  // therefore we need to make a correction. The correction is thus the same as for ALCT-CLCT
214  for (unsigned mbx = 0; mbx < 2 * max_delta_bx_clct_gem_ + 1; mbx++) {
215  // evaluate the preffered CLCT BX, taking into account that there is an offset in the simulation
216  int bx_clct = bx_gem + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET;
217 
218  // CLCT BX must be in the time window
219  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS)
220  continue;
221  // drop this CLCT if it was previously matched to a GEM coincidence cluster
222  if (drop_used_clcts and used_clct_mask[bx_clct])
223  continue;
224  // do not consider invalid CLCTs
225  if (clctProc->getBestCLCT(bx_clct).isValid()) {
226  // if this is an ME1/a CLCT, you could consider not building this LCT
228  clctProc->getBestCLCT(bx_clct).getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B)
229  continue;
230  // mbx is a relative time difference, which is used later in the
231  // cross-bunching sorting algorithm to determine the preferred LCTs
232  // to be sent to the MPC
233  correlateLCTsGEM(clctProc->getBestCLCT(bx_clct),
234  clctProc->getSecondCLCT(bx_clct),
235  clusterProc_->getCoincidenceClusters(bx_gem),
236  allLCTs_(bx_gem, mbx, 0),
237  allLCTs_(bx_gem, mbx, 1));
238 
239  if (allLCTs_(bx_gem, mbx, 0).isValid()) {
240  // do not consider GEM clusters
241  used_clct_mask[bx_clct] = true;
242  // mask this bunch crossing for future consideration
243  bunch_crossing_mask[bx_gem] = true;
244  // if we only consider the first valid GEM coincidence clusters,
245  // we move on to the next ALCT immediately
247  break;
248  }
249  }
250  }
251  }
252  }
253 }
void correlateLCTsGEM(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
LCTContainer allLCTs_
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
std::vector< int > preferred_bx_match_
bool match_earliest_clct_only_
unsigned max_delta_bx_clct_gem_
std::shared_ptr< GEMClusterProcessor > clusterProc_
void CSCGEMMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiClusterCollection gemPads 
)

Definition at line 56 of file CSCGEMMotherboard.cc.

References CSCMotherboard::alctProc, CSCMotherboard::alctV, build_lct_from_alct_clct_1gem_, build_lct_from_alct_clct_2gem_, build_lct_from_alct_gem_, build_lct_from_clct_gem_, CSCMotherboard::clctProc, CSCMotherboard::clctV, clear(), clusterProc_, cscGEMMatcher_, CSCBaseboard::cscGeometry_, CSCMotherboard::encodeHighMultiplicityBits(), gem_g, hasGE21Geometry16Partitions_, CSCBaseboard::isME11_, CSCBaseboard::isME21_, CSCMotherboard::lookupTableCCLUT_, CSCMotherboard::lookupTableME11ILT_, CSCMotherboard::lookupTableME21ILT_, matchALCT2GEM(), CSCMotherboard::matchALCTCLCT(), matchALCTCLCTGEM(), matchCLCT2GEM(), CSCConstants::MAX_ALCT_TBINS, or, CSCBaseboard::runCCLUT_, and CSCMotherboard::selectLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

58  {
59  // Step 1: Setup
60  clear();
61 
62  // check for GEM geometry
63  if (gem_g == nullptr) {
64  edm::LogError("CSCGEMMotherboard") << "run() called for GEM-CSC integrated trigger without valid GEM geometry! \n";
65  return;
66  }
67 
68  // Check that the processors can deliver data
69  if (!(alctProc and clctProc)) {
70  edm::LogError("CSCGEMMotherboard") << "run() called for non-existing ALCT/CLCT processor! \n";
71  return;
72  }
73 
74  alctProc->setCSCGeometry(cscGeometry_);
75  clctProc->setCSCGeometry(cscGeometry_);
76 
77  // set CCLUT parameters if necessary
78  if (runCCLUT_) {
79  clctProc->setESLookupTables(lookupTableCCLUT_);
80  }
81 
82  // Step 2: Run the processors
83  const std::vector<CSCALCTDigi>& alctV = alctProc->run(wiredc); // run anodeLCT
84  const std::vector<CSCCLCTDigi>& clctV = clctProc->run(compdc); // run cathodeLCT
85 
86  // Step 2b: encode high multiplicity bits (independent of LCT construction)
88 
89  // if there are no ALCTs and no CLCTs, do not run the ALCT-CLCT correlation
90  if (alctV.empty() and clctV.empty())
91  return;
92 
93  // set the lookup tables for coordinate conversion and matching
94  if (isME11_) {
95  clusterProc_->setESLookupTables(lookupTableME11ILT_);
96  cscGEMMatcher_->setESLookupTables(lookupTableME11ILT_);
97  }
98  if (isME21_) {
99  clusterProc_->setESLookupTables(lookupTableME21ILT_);
100  cscGEMMatcher_->setESLookupTables(lookupTableME21ILT_);
101  }
102 
103  // Step 3: run the GEM cluster processor to get the internal clusters
104  clusterProc_->run(gemClusters);
105  hasGE21Geometry16Partitions_ = clusterProc_->hasGE21Geometry16Partitions();
106 
107  /*
108  Mask for bunch crossings were LCTs were previously found
109  If LCTs were found in BXi for ALCT-CLCT-2GEM or ALCT-CLCT-1GEM,
110  we do not consider BXi in the future. This is
111  because we consider ALCT-CLCT-2GEM > ALCT-CLCT-1GEM > ALCT-CLCT
112  > CLCT-2GEM > ALCT-2GEM. The mask is passsed from one function to the next.
113  */
114  bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS] = {false};
115 
116  // Step 4: ALCT-CLCT-2GEM and ALCT-CLCT-1GEM matching
118  matchALCTCLCTGEM(bunch_crossing_mask);
119  }
120 
121  // Step 5: regular ALCT-CLCT matching (always enabled)
122  CSCMotherboard::matchALCTCLCT(bunch_crossing_mask);
123 
124  // Step 6: CLCT-2GEM matching for BX's that were not previously masked
126  matchCLCT2GEM(bunch_crossing_mask);
127  }
128 
129  // Step 7: ALCT-2GEM matching for BX's that were not previously masked
131  matchALCT2GEM(bunch_crossing_mask);
132  }
133 
134  // Step 8: Select at most 2 LCTs per BX
135  selectLCTs();
136 }
void matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
std::vector< CSCCLCTDigi > clctV
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Log< level::Error, false > LogError
void matchALCT2GEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
std::vector< CSCALCTDigi > alctV
void matchCLCT2GEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:71
void matchALCTCLCTGEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
std::shared_ptr< GEMClusterProcessor > clusterProc_
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
void encodeHighMultiplicityBits()
const GEMGeometry * gem_g
void CSCGEMMotherboard::setGEMGeometry ( const GEMGeometry g)
inline

Definition at line 53 of file CSCGEMMotherboard.h.

References g, and gem_g.

Referenced by CSCTriggerPrimitivesBuilder::build().

53 { 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::sortLCTsByBending ( std::vector< CSCCorrelatedLCTDigi > &  lcts) const
private

Definition at line 607 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::getQuality(), CSCCorrelatedLCTDigi::getSlope(), and CSCBaseboard::runCCLUT_.

Referenced by correlateLCTsGEM().

607  {
608  /*
609  For Run-2 GEM-CSC trigger primitives, which we temporarily have
610  to integrate with the Run-2 EMTF during LS2, we sort by quality.
611  Larger quality means smaller bending
612  */
613  if (!runCCLUT_) {
614  std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool {
615  return lct1.getQuality() > lct2.getQuality();
616  });
617  }
618 
619  /*
620  For Run-3 GEM-CSC trigger primitives, which we have
621  to integrate with the Run-3 EMTF, we sort by slope.
622  Smaller slope means smaller bending
623  */
624  else {
625  std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool {
626  return lct1.getSlope() < lct2.getSlope();
627  });
628  }
629 }
uint16_t getSlope() const
return the slope
uint16_t getQuality() const
return the Quality

Member Data Documentation

bool CSCGEMMotherboard::assign_gem_csc_bending_
private

Definition at line 163 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM(), and CSCGEMMotherboard().

bool CSCGEMMotherboard::build_lct_from_alct_clct_1gem_
private

Definition at line 148 of file CSCGEMMotherboard.h.

Referenced by run().

bool CSCGEMMotherboard::build_lct_from_alct_clct_2gem_
private

Definition at line 147 of file CSCGEMMotherboard.h.

Referenced by matchALCTCLCTGEM(), and run().

bool CSCGEMMotherboard::build_lct_from_alct_gem_
private

Definition at line 149 of file CSCGEMMotherboard.h.

Referenced by run().

bool CSCGEMMotherboard::build_lct_from_clct_gem_
private

Definition at line 150 of file CSCGEMMotherboard.h.

Referenced by run().

bool CSCGEMMotherboard::build_lct_from_clct_gem_me1a_
private

Definition at line 156 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchCLCT2GEM().

std::shared_ptr<GEMClusterProcessor> CSCGEMMotherboard::clusterProc_
private
std::map<int, GEMInternalClusters> CSCGEMMotherboard::clusters_
private

Definition at line 135 of file CSCGEMMotherboard.h.

std::unique_ptr<CSCGEMMatcher> CSCGEMMotherboard::cscGEMMatcher_
private

Definition at line 137 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM(), correlateLCTsGEM(), CSCGEMMotherboard(), and run().

bool CSCGEMMotherboard::drop_low_quality_alct_no_gems_
private

Definition at line 143 of file CSCGEMMotherboard.h.

Referenced by dropLowQualityALCTNoClusters().

bool CSCGEMMotherboard::drop_low_quality_clct_no_gems_
private

Definition at line 144 of file CSCGEMMotherboard.h.

Referenced by dropLowQualityCLCTNoClusters().

bool CSCGEMMotherboard::drop_low_quality_clct_no_gems_me1a_
private

Definition at line 153 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and dropLowQualityCLCTNoClusters().

bool CSCGEMMotherboard::drop_used_gems_
private

Definition at line 165 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchALCT2GEM().

const GEMGeometry* CSCGEMMotherboard::gem_g
private

Definition at line 132 of file CSCGEMMotherboard.h.

Referenced by run(), and setGEMGeometry().

unsigned CSCGEMMotherboard::gemId
private

Chamber id (trigger-type labels).

Definition at line 131 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

bool CSCGEMMotherboard::hasGE21Geometry16Partitions_
private

Definition at line 170 of file CSCGEMMotherboard.h.

Referenced by matchALCT2GEM(), matchALCTCLCTGEM(), matchCLCT2GEM(), and run().

bool CSCGEMMotherboard::match_earliest_gem_only_
private

Definition at line 166 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchALCT2GEM().

unsigned CSCGEMMotherboard::max_delta_bx_alct_gem_
private

Definition at line 159 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), matchALCT2GEM(), and matchALCTCLCTGEM().

unsigned CSCGEMMotherboard::max_delta_bx_clct_gem_
private

Definition at line 160 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchCLCT2GEM().