CMS 3D CMS Logo

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< GEMInternalClusterGEMInternalClusters
 

Public Member Functions

void clear ()
 
std::shared_ptr< GEMClusterProcessorclusterProc () 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< CSCCorrelatedLCTDigireadoutLCTs () 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< GEMClusterProcessorclusterProc_
 
std::map< int, GEMInternalClustersclusters_
 
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< CSCAnodeLCTProcessoralctProc
 
std::unique_ptr< CSCCathodeLCTProcessorclctProc
 
- 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< LCTQualityAssignmentqualityAssignment_
 
std::unique_ptr< LCTQualityControlqualityControl_
 
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

◆ GEMInternalClusters

Definition at line 21 of file CSCGEMMotherboard.h.

Constructor & Destructor Documentation

◆ CSCGEMMotherboard()

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");
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  // These LogErrors are sanity checks and should not be printed
42  if (!isME11_ and !isME21_) {
43  edm::LogError("CSCGEMMotherboard") << "GEM-CSC OTMB constructed for a non-ME1/1 or a non-ME2/1 chamber!";
44  };
45 
46  // super chamber has layer=0!
48 
49  clusterProc_ = std::make_shared<GEMClusterProcessor>(theRegion, theStation, theChamber, conf);
50 
51  cscGEMMatcher_ = std::make_unique<CSCGEMMatcher>(theRegion, theStation, theChamber, tmbParams_, conf);
52 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
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
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
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::~CSCGEMMotherboard ( )
override

Definition at line 54 of file CSCGEMMotherboard.cc.

54 {}

Member Function Documentation

◆ clear()

void CSCGEMMotherboard::clear ( void  )

Definition at line 56 of file CSCGEMMotherboard.cc.

References CSCMotherboard::clear(), and clusterProc_.

Referenced by run().

56  {
58  clusterProc_->clear();
59 }
std::shared_ptr< GEMClusterProcessor > clusterProc_

◆ 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_

◆ constructLCTsGEM() [1/3]

void CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMInternalCluster gem,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 505 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::ALCTCLCT, CSCCorrelatedLCTDigi::ALCTCLCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCTGEM, assign_gem_csc_bending_, cscGEMMatcher_, CSCMotherboard::encodePattern(), mixOne_premix_on_sim_cfi::gem, CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCMotherboard::getBXShiftedALCT(), CSCMotherboard::getBXShiftedCLCT(), CSCCLCTDigi::getEighthStripBit(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuartStripBit(), CSCCLCTDigi::getRun3Pattern(), CSCCLCTDigi::getSlope(), 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().

508  {
509  thisLCT.setValid(true);
510  if (gem.isCoincidence()) {
511  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT2GEM);
512  } else if (gem.isValid()) {
513  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCTGEM);
514  } else {
515  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT);
516  }
517  thisLCT.setQuality(qualityAssignment_->findQuality(alct, clct, gem));
518  thisLCT.setALCT(getBXShiftedALCT(alct));
519  thisLCT.setCLCT(getBXShiftedCLCT(clct));
520  // set pads if there are any
521  thisLCT.setGEM1(gem.mid1());
522  thisLCT.setGEM2(gem.mid2());
523  thisLCT.setPattern(encodePattern(clct.getPattern()));
524  thisLCT.setMPCLink(0);
525  thisLCT.setBX0(0);
526  thisLCT.setSyncErr(0);
527  thisLCT.setCSCID(theTrigChamber);
528  // track number to be set later in final sorting stage
529  thisLCT.setTrknmb(0);
530  thisLCT.setWireGroup(alct.getKeyWG());
531  thisLCT.setStrip(clct.getKeyStrip());
532  thisLCT.setBend(clct.getBend());
533  thisLCT.setBX(alct.getBX());
534  if (runCCLUT_) {
535  thisLCT.setRun3(true);
537  thisLCT.setSlope(cscGEMMatcher_->calculateGEMCSCBending(clct, gem));
538  else
539  thisLCT.setSlope(clct.getSlope());
540  thisLCT.setQuartStripBit(clct.getQuartStripBit());
541  thisLCT.setEighthStripBit(clct.getEighthStripBit());
542  thisLCT.setRun3Pattern(clct.getRun3Pattern());
543  }
544 }
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
unsigned int encodePattern(const int clctPattern) const
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
bool getEighthStripBit() const
get single eighth strip bit
Definition: CSCCLCTDigi.h:114
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
bool getQuartStripBit() const
get single quart strip bit
Definition: CSCCLCTDigi.h:108
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
uint16_t getSlope() const
return the slope
Definition: CSCCLCTDigi.h:74
uint16_t getRun3Pattern() const
return pattern
Definition: CSCCLCTDigi.h:68
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
std::unique_ptr< LCTQualityAssignment > qualityAssignment_

◆ constructLCTsGEM() [2/3]

void CSCGEMMotherboard::constructLCTsGEM ( const CSCCLCTDigi clct,
const GEMInternalCluster gem,
int  trackNumber,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 547 of file CSCGEMMotherboard.cc.

References assign_gem_csc_bending_, CSCCorrelatedLCTDigi::CLCT2GEM, cscGEMMatcher_, CSCMotherboard::encodePattern(), mixOne_premix_on_sim_cfi::gem, CSCCLCTDigi::getBend(), CSCMotherboard::getBXShiftedCLCT(), CSCCLCTDigi::getEighthStripBit(), CSCCLCTDigi::getKeyStrip(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuartStripBit(), CSCCLCTDigi::getRun3Pattern(), CSCCLCTDigi::getSlope(), 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.

550  {
551  thisLCT.setValid(true);
552  thisLCT.setType(CSCCorrelatedLCTDigi::CLCT2GEM);
553  thisLCT.setQuality(qualityAssignment_->findQuality(clct, gem));
554  thisLCT.setCLCT(getBXShiftedCLCT(clct));
555  thisLCT.setGEM1(gem.mid1());
556  thisLCT.setGEM2(gem.mid2());
557  thisLCT.setPattern(encodePattern(clct.getPattern()));
558  thisLCT.setMPCLink(0);
559  thisLCT.setBX0(0);
560  thisLCT.setSyncErr(0);
561  thisLCT.setCSCID(theTrigChamber);
562  thisLCT.setTrknmb(trackNumber);
563  thisLCT.setWireGroup(gem.getKeyWG());
564  thisLCT.setStrip(clct.getKeyStrip());
565  thisLCT.setBend(clct.getBend());
566  thisLCT.setBX(gem.bx());
567  if (runCCLUT_) {
568  thisLCT.setRun3(true);
570  thisLCT.setSlope(cscGEMMatcher_->calculateGEMCSCBending(clct, gem));
571  else
572  thisLCT.setSlope(clct.getSlope());
573  thisLCT.setQuartStripBit(clct.getQuartStripBit());
574  thisLCT.setEighthStripBit(clct.getEighthStripBit());
575  thisLCT.setRun3Pattern(clct.getRun3Pattern());
576  }
577 }
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
unsigned int encodePattern(const int clctPattern) const
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
bool getEighthStripBit() const
get single eighth strip bit
Definition: CSCCLCTDigi.h:114
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
bool getQuartStripBit() const
get single quart strip bit
Definition: CSCCLCTDigi.h:108
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
uint16_t getSlope() const
return the slope
Definition: CSCCLCTDigi.h:74
uint16_t getRun3Pattern() const
return pattern
Definition: CSCCLCTDigi.h:68
std::unique_ptr< LCTQualityAssignment > qualityAssignment_

◆ constructLCTsGEM() [3/3]

void CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const GEMInternalCluster gem,
int  trackNumber,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 580 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::ALCT2GEM, mixOne_premix_on_sim_cfi::gem, CSCALCTDigi::getBX(), CSCMotherboard::getBXShiftedALCT(), CSCALCTDigi::getKeyWG(), 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.

583  {
584  thisLCT.setValid(true);
585  thisLCT.setType(CSCCorrelatedLCTDigi::ALCT2GEM);
586  thisLCT.setQuality(qualityAssignment_->findQuality(alct, gem));
587  thisLCT.setALCT(getBXShiftedALCT(alct));
588  thisLCT.setGEM1(gem.mid1());
589  thisLCT.setGEM2(gem.mid2());
590  thisLCT.setPattern(10);
591  thisLCT.setMPCLink(0);
592  thisLCT.setBX0(0);
593  thisLCT.setSyncErr(0);
594  thisLCT.setCSCID(theTrigChamber);
595  thisLCT.setTrknmb(trackNumber);
596  thisLCT.setWireGroup(alct.getKeyWG());
597  thisLCT.setStrip(gem.getKeyStrip());
598  thisLCT.setBend(0);
599  thisLCT.setBX(alct.getBX());
600  if (runCCLUT_) {
601  thisLCT.setRun3(true);
602  thisLCT.setSlope(0);
603  thisLCT.setQuartStripBit(false);
604  thisLCT.setEighthStripBit(false);
605  // ALCT-2GEM type LCTs do not bend in the chamber
606  thisLCT.setRun3Pattern(4);
607  }
608 }
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
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
std::unique_ptr< LCTQualityAssignment > qualityAssignment_

◆ correlateLCTsGEM() [1/3]

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

References bsc_activity_cfg::clusters, 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().

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

◆ correlateLCTsGEM() [2/3]

void CSCGEMMotherboard::correlateLCTsGEM ( const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
const GEMInternalClusters clusters,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
private

Definition at line 433 of file CSCGEMMotherboard.cc.

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

437  {
438  CSCCLCTDigi bestCLCT = bCLCT;
439  CSCCLCTDigi secondCLCT = sCLCT;
440 
441  if (!bestCLCT.isValid()) {
442  edm::LogError("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM!";
443  return;
444  }
445 
446  // if the second best CLCT equals the best CLCT, clear it
447  if (secondCLCT == bestCLCT)
448  secondCLCT.clear();
449 
450  // get the best matching cluster
451  GEMInternalCluster bestCluster;
452  GEMInternalCluster secondCluster;
453  cscGEMMatcher_->bestClusterBXLoc(bestCLCT, clusters, bestCluster);
454  cscGEMMatcher_->bestClusterBXLoc(secondCLCT, clusters, secondCluster);
455 
456  // drop low quality CLCTs if no clusters and flags are set
457  dropLowQualityCLCTNoClusters(bestCLCT, bestCluster);
458  dropLowQualityCLCTNoClusters(secondCLCT, secondCluster);
459 
460  // construct all LCTs with valid CLCTs and coincidence clusters
461  if (bestCLCT.isValid() and bestCluster.isCoincidence()) {
462  constructLCTsGEM(bestCLCT, bestCluster, 1, lct1);
463  }
464  if (secondCLCT.isValid() and secondCluster.isCoincidence()) {
465  constructLCTsGEM(secondCLCT, secondCluster, 2, lct2);
466  }
467 }
bool isCoincidence() const
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
Log< level::Error, false > LogError
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
void dropLowQualityCLCTNoClusters(CSCCLCTDigi &clct, const GEMInternalCluster &cluster) const
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:73

◆ correlateLCTsGEM() [3/3]

void CSCGEMMotherboard::correlateLCTsGEM ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const GEMInternalClusters clusters,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
private

Definition at line 469 of file CSCGEMMotherboard.cc.

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

473  {
474  CSCALCTDigi bestALCT = bALCT;
475  CSCALCTDigi secondALCT = sALCT;
476 
477  if (!bestALCT.isValid()) {
478  edm::LogError("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM!";
479  return;
480  }
481 
482  // if the second best ALCT equals the best ALCT, clear it
483  if (secondALCT == bestALCT)
484  secondALCT.clear();
485 
486  // get the best matching cluster
487  GEMInternalCluster bestCluster;
488  GEMInternalCluster secondCluster;
489  cscGEMMatcher_->bestClusterBXLoc(bestALCT, clusters, bestCluster);
490  cscGEMMatcher_->bestClusterBXLoc(secondALCT, clusters, secondCluster);
491 
492  // drop low quality ALCTs if no clusters and flags are set
493  dropLowQualityALCTNoClusters(bestALCT, bestCluster);
494  dropLowQualityALCTNoClusters(secondALCT, secondCluster);
495 
496  // construct all LCTs with valid ALCTs and coincidence clusters
497  if (bestALCT.isValid() and bestCluster.isCoincidence()) {
498  constructLCTsGEM(bestALCT, bestCluster, 1, lct1);
499  }
500  if (secondALCT.isValid() and secondCluster.isCoincidence()) {
501  constructLCTsGEM(secondALCT, secondCluster, 2, lct2);
502  }
503 }
bool isCoincidence() const
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:60
Log< level::Error, false > LogError
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
void dropLowQualityALCTNoClusters(CSCALCTDigi &alct, const GEMInternalCluster &cluster) const

◆ dropLowQualityALCTNoClusters()

void CSCGEMMotherboard::dropLowQualityALCTNoClusters ( CSCALCTDigi alct,
const GEMInternalCluster cluster 
) const
private

Definition at line 610 of file CSCGEMMotherboard.cc.

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

Referenced by correlateLCTsGEM().

610  {
611  // clear alct if they are of low quality without matching GEM clusters
612  if (alct.getQuality() == 0 and !cluster.isValid() and drop_low_quality_alct_no_gems_)
613  alct.clear();
614 }
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:60
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46

◆ dropLowQualityCLCTNoClusters()

void CSCGEMMotherboard::dropLowQualityCLCTNoClusters ( CSCCLCTDigi clct,
const GEMInternalCluster cluster 
) const
private

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

616  {
617  // Here, we need to check which could be an ME1/a LCT
618  bool dropLQCLCTNoGEMs = drop_low_quality_clct_no_gems_;
620  dropLQCLCTNoGEMs = drop_low_quality_clct_no_gems_me1a_;
621 
622  // clear clct if they are of low quality without matching GEM clusters
623  if (clct.getQuality() <= 3 and !cluster.isValid() and dropLQCLCTNoGEMs)
624  clct.clear();
625 }
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:56
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
bool drop_low_quality_clct_no_gems_me1a_
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:73

◆ matchALCT2GEM()

void CSCGEMMotherboard::matchALCT2GEM ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
private

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

275  {
276  // no matching is done for GE2/1 geometries with 8 eta partitions
277  // this has been superseded by 16-eta partition geometries
279  return;
280 
281  // clear the array to mask GEMs this window is quite wide.
282  // We don't expect GEM coincidence clusters to show up too far
283  // from the central BX (8)
284  bool used_gem_mask[CSCConstants::MAX_ALCT_TBINS] = {false};
285 
286  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
287  // do not consider LCT building in this BX if the mask was set
288  if (bunch_crossing_mask[bx_alct])
289  continue;
290 
291  if (alctProc->getBestALCT(bx_alct).isValid()) {
292  for (unsigned mbx = 0; mbx < 2 * max_delta_bx_alct_gem_ + 1; mbx++) {
293  // evaluate the preffered GEM BX
294  int bx_gem = bx_alct + preferred_bx_match_[mbx];
295 
296  if (bx_gem < 0 or bx_gem >= CSCConstants::MAX_ALCT_TBINS)
297  continue;
298  // drop GEMs in this BX if one of them was previously matched to an ALCT
299  if (drop_used_gems_ and used_gem_mask[bx_gem])
300  continue;
301  // check for at least one valid GEM cluster
302  if (!clusterProc_->getCoincidenceClusters(bx_gem).empty()) {
303  // now correlate the ALCT and GEM into LCT.
304  // smaller mbx means more preferred!
305  correlateLCTsGEM(alctProc->getBestALCT(bx_alct),
306  alctProc->getSecondALCT(bx_alct),
307  clusterProc_->getCoincidenceClusters(bx_gem),
308  allLCTs_(bx_alct, mbx, 0),
309  allLCTs_(bx_alct, mbx, 1));
310 
311  if (allLCTs_(bx_alct, mbx, 0).isValid()) {
312  // do not consider GEM clusters
313  used_gem_mask[bx_gem] = true;
314  // mask this bunch crossing for future consideration
315  bunch_crossing_mask[bx_alct] = true;
316  // if we only consider the first valid GEM coincidence clusters,
317  // we move on to the next ALCT immediately
319  break;
320  }
321  }
322  }
323  }
324  }
325 }
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 correlateLCTsGEM(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const

◆ matchALCTCLCT()

void CSCGEMMotherboard::matchALCTCLCT ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
private

◆ matchALCTCLCTGEM()

void CSCGEMMotherboard::matchALCTCLCTGEM ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
private

Definition at line 158 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_, fileinputsource_cfi::option, CSCMotherboard::preferred_bx_match_, and GEMClusterProcessor::SingleClusters.

Referenced by run().

158  {
159  // no matching is done for GE2/1 geometries with 8 eta partitions
160  // this has been superseded by 16-eta partition geometries
162  return;
163 
164  // by default we will try to match with both single clusters and coincidence clusters
165  // if we do not build ALCT-CLCT-2GEM type LCTs, consider only single clusters
169 
170  // array to mask CLCTs
171  bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false};
172 
173  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
174  // do not consider invalid ALCTs
175  if (alctProc->getBestALCT(bx_alct).isValid()) {
176  for (unsigned mbx = 0; mbx < match_trig_window_size; mbx++) {
177  // evaluate the preffered CLCT BX, taking into account that there is an offset in the simulation
178  unsigned bx_clct = bx_alct + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET;
179 
180  // CLCT BX must be in the time window
181  if (bx_clct >= CSCConstants::MAX_CLCT_TBINS)
182  continue;
183  // drop this CLCT if it was previously matched to an ALCT
184  if (drop_used_clcts and used_clct_mask[bx_clct])
185  continue;
186  // do not consider invalid CLCTs
187  if (clctProc->getBestCLCT(bx_clct).isValid()) {
188  LogTrace("CSCMotherboard") << "Successful ALCT-CLCT match: bx_alct = " << bx_alct << "; bx_clct = " << bx_clct
189  << "; mbx = " << mbx;
190 
191  // now correlate the ALCT and CLCT into LCT.
192  // smaller mbx means more preferred!
193  correlateLCTsGEM(alctProc->getBestALCT(bx_alct),
194  alctProc->getSecondALCT(bx_alct),
195  clctProc->getBestCLCT(bx_clct),
196  clctProc->getSecondCLCT(bx_clct),
197  clusterProc_->getClusters(bx_alct, max_delta_bx_alct_gem_, option),
198  allLCTs_(bx_alct, mbx, 0),
199  allLCTs_(bx_alct, mbx, 1));
200 
201  if (allLCTs_(bx_alct, mbx, 0).isValid()) {
202  // mask this CLCT as used. If a flag is set, the CLCT may or may not be reused
203  used_clct_mask[bx_clct] = true;
204  // mask this bunch crossing for future considation
205  bunch_crossing_mask[bx_alct] = true;
206  // if we only consider the first valid CLCT, we move on to the next ALCT immediately
208  break;
209  }
210  }
211  }
212  }
213  }
214 }
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 correlateLCTsGEM(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const

◆ matchCLCT2GEM()

void CSCGEMMotherboard::matchCLCT2GEM ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
private

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

216  {
217  // no matching is done for GE2/1 geometries with 8 eta partitions
218  // this has been superseded by 16-eta partition geometries
220  return;
221 
222  // array to mask CLCTs
223  bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false};
224 
225  for (int bx_gem = 0; bx_gem < CSCConstants::MAX_ALCT_TBINS; bx_gem++) {
226  // do not consider LCT building in this BX if the mask was set
227  if (bunch_crossing_mask[bx_gem])
228  continue;
229 
230  // Check that there is at least one valid GEM coincidence cluster in this BX
231  if (!clusterProc_->getCoincidenceClusters(bx_gem).empty()) {
232  // GEM clusters will have central BX 8. So do ALCTs. But! CLCTs still have central BX 7
233  // therefore we need to make a correction. The correction is thus the same as for ALCT-CLCT
234  for (unsigned mbx = 0; mbx < 2 * max_delta_bx_clct_gem_ + 1; mbx++) {
235  // evaluate the preffered CLCT BX, taking into account that there is an offset in the simulation
236  int bx_clct = bx_gem + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET;
237 
238  // CLCT BX must be in the time window
239  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS)
240  continue;
241  // drop this CLCT if it was previously matched to a GEM coincidence cluster
242  if (drop_used_clcts and used_clct_mask[bx_clct])
243  continue;
244  // do not consider invalid CLCTs
245  if (clctProc->getBestCLCT(bx_clct).isValid()) {
246  // if this is an ME1/a CLCT, you could consider not building this LCT
248  clctProc->getBestCLCT(bx_clct).getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B)
249  continue;
250  // mbx is a relative time difference, which is used later in the
251  // cross-bunching sorting algorithm to determine the preferred LCTs
252  // to be sent to the MPC
253  correlateLCTsGEM(clctProc->getBestCLCT(bx_clct),
254  clctProc->getSecondCLCT(bx_clct),
255  clusterProc_->getCoincidenceClusters(bx_gem),
256  allLCTs_(bx_gem, mbx, 0),
257  allLCTs_(bx_gem, mbx, 1));
258 
259  if (allLCTs_(bx_gem, mbx, 0).isValid()) {
260  // do not consider GEM clusters
261  used_clct_mask[bx_clct] = true;
262  // mask this bunch crossing for future consideration
263  bunch_crossing_mask[bx_gem] = true;
264  // if we only consider the first valid GEM coincidence clusters,
265  // we move on to the next ALCT immediately
267  break;
268  }
269  }
270  }
271  }
272  }
273 }
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 correlateLCTsGEM(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const

◆ run()

void CSCGEMMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiClusterCollection gemPads 
)

Definition at line 61 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_, CSCMotherboard::selectLCTs(), and CSCBaseboard::theCSCName_.

Referenced by CSCTriggerPrimitivesBuilder::build().

63  {
64  // Step 1: Setup
65  clear();
66 
67  // Check that the processors can deliver data
68  if (!(alctProc and clctProc)) {
69  edm::LogError("CSCGEMMotherboard") << "run() called for non-existing ALCT/CLCT processor in " << theCSCName_;
70  return;
71  }
72 
73  // set geometry
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  bool validClustersAndGeometry = true;
94 
95  // Step 3a: check for GEM geometry
96  if (gem_g == nullptr) {
97  edm::LogWarning("CSCGEMMotherboard") << "run() called for GEM-CSC integrated trigger"
98  << " without valid GEM geometry! Running CSC-only"
99  << " trigger algorithm in " << theCSCName_;
100  validClustersAndGeometry = false;
101  }
102 
103  // Step 3b: check that the GEM cluster collection is a valid pointer
104  if (gemClusters == nullptr) {
105  edm::LogWarning("CSCGEMMotherboard") << "run() called for GEM-CSC integrated trigger"
106  << " without valid GEM clusters! Running CSC-only"
107  << " trigger algorithm in " << theCSCName_;
108  validClustersAndGeometry = false;
109  }
110 
111  if (validClustersAndGeometry) {
112  // Step 3c: set the lookup tables for coordinate conversion and matching
113  if (isME11_) {
114  clusterProc_->setESLookupTables(lookupTableME11ILT_);
115  cscGEMMatcher_->setESLookupTables(lookupTableME11ILT_);
116  }
117  if (isME21_) {
118  clusterProc_->setESLookupTables(lookupTableME21ILT_);
119  cscGEMMatcher_->setESLookupTables(lookupTableME21ILT_);
120  }
121 
122  // Step 3d: run the GEM cluster processor to get the internal clusters
123  clusterProc_->run(gemClusters);
124  hasGE21Geometry16Partitions_ = clusterProc_->hasGE21Geometry16Partitions();
125  }
126 
127  /*
128  Mask for bunch crossings were LCTs were previously found
129  If LCTs were found in BXi for ALCT-CLCT-2GEM or ALCT-CLCT-1GEM,
130  we do not consider BXi in the future. This is
131  because we consider ALCT-CLCT-2GEM > ALCT-CLCT-1GEM > ALCT-CLCT
132  > CLCT-2GEM > ALCT-2GEM. The mask is passsed from one function to the next.
133  */
134  bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS] = {false};
135 
136  // Step 4: ALCT-CLCT-2GEM and ALCT-CLCT-1GEM matching
138  matchALCTCLCTGEM(bunch_crossing_mask);
139  }
140 
141  // Step 5: regular ALCT-CLCT matching (always enabled)
142  CSCMotherboard::matchALCTCLCT(bunch_crossing_mask);
143 
144  // Step 6: CLCT-2GEM matching for BX's that were not previously masked
145  if (build_lct_from_clct_gem_ and validClustersAndGeometry) {
146  matchCLCT2GEM(bunch_crossing_mask);
147  }
148 
149  // Step 7: ALCT-2GEM matching for BX's that were not previously masked
150  if (build_lct_from_alct_gem_ and validClustersAndGeometry) {
151  matchALCT2GEM(bunch_crossing_mask);
152  }
153 
154  // Step 8: Select at most 2 LCTs per BX
155  selectLCTs();
156 }
void matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
std::vector< CSCCLCTDigi > clctV
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Log< level::Error, false > LogError
std::string theCSCName_
Definition: CSCBaseboard.h:90
void matchALCT2GEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_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
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()
Log< level::Warning, false > LogWarning
const GEMGeometry * gem_g

◆ setGEMGeometry()

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

◆ sortLCTsByBending()

void CSCGEMMotherboard::sortLCTsByBending ( std::vector< CSCCorrelatedLCTDigi > &  lcts) const
private

Definition at line 627 of file CSCGEMMotherboard.cc.

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

Referenced by correlateLCTsGEM().

627  {
628  /*
629  For Run-2 GEM-CSC trigger primitives, which we temporarily have
630  to integrate with the Run-2 EMTF during LS2, we sort by quality.
631  Larger quality means smaller bending
632  */
633  if (!runCCLUT_) {
634  std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool {
635  return lct1.getQuality() > lct2.getQuality();
636  });
637  }
638 
639  /*
640  For Run-3 GEM-CSC trigger primitives, which we have
641  to integrate with the Run-3 EMTF, we sort by slope.
642  Smaller slope means smaller bending
643  */
644  else {
645  std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool {
646  return lct1.getSlope() < lct2.getSlope();
647  });
648  }
649 }
uint16_t getSlope() const
return the slope
uint16_t getQuality() const
return the Quality

Member Data Documentation

◆ assign_gem_csc_bending_

bool CSCGEMMotherboard::assign_gem_csc_bending_
private

Definition at line 163 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM(), and CSCGEMMotherboard().

◆ build_lct_from_alct_clct_1gem_

bool CSCGEMMotherboard::build_lct_from_alct_clct_1gem_
private

Definition at line 148 of file CSCGEMMotherboard.h.

Referenced by run().

◆ build_lct_from_alct_clct_2gem_

bool CSCGEMMotherboard::build_lct_from_alct_clct_2gem_
private

Definition at line 147 of file CSCGEMMotherboard.h.

Referenced by matchALCTCLCTGEM(), and run().

◆ build_lct_from_alct_gem_

bool CSCGEMMotherboard::build_lct_from_alct_gem_
private

Definition at line 149 of file CSCGEMMotherboard.h.

Referenced by run().

◆ build_lct_from_clct_gem_

bool CSCGEMMotherboard::build_lct_from_clct_gem_
private

Definition at line 150 of file CSCGEMMotherboard.h.

Referenced by run().

◆ build_lct_from_clct_gem_me1a_

bool CSCGEMMotherboard::build_lct_from_clct_gem_me1a_
private

Definition at line 156 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchCLCT2GEM().

◆ clusterProc_

std::shared_ptr<GEMClusterProcessor> CSCGEMMotherboard::clusterProc_
private

◆ clusters_

std::map<int, GEMInternalClusters> CSCGEMMotherboard::clusters_
private

Definition at line 135 of file CSCGEMMotherboard.h.

◆ cscGEMMatcher_

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

Definition at line 137 of file CSCGEMMotherboard.h.

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

◆ drop_low_quality_alct_no_gems_

bool CSCGEMMotherboard::drop_low_quality_alct_no_gems_
private

Definition at line 143 of file CSCGEMMotherboard.h.

Referenced by dropLowQualityALCTNoClusters().

◆ drop_low_quality_clct_no_gems_

bool CSCGEMMotherboard::drop_low_quality_clct_no_gems_
private

Definition at line 144 of file CSCGEMMotherboard.h.

Referenced by dropLowQualityCLCTNoClusters().

◆ drop_low_quality_clct_no_gems_me1a_

bool CSCGEMMotherboard::drop_low_quality_clct_no_gems_me1a_
private

Definition at line 153 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and dropLowQualityCLCTNoClusters().

◆ drop_used_gems_

bool CSCGEMMotherboard::drop_used_gems_
private

Definition at line 165 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchALCT2GEM().

◆ gem_g

const GEMGeometry* CSCGEMMotherboard::gem_g
private

Definition at line 132 of file CSCGEMMotherboard.h.

Referenced by run(), and setGEMGeometry().

◆ gemId

unsigned CSCGEMMotherboard::gemId
private

Chamber id (trigger-type labels).

Definition at line 131 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

◆ hasGE21Geometry16Partitions_

bool CSCGEMMotherboard::hasGE21Geometry16Partitions_
private

Definition at line 170 of file CSCGEMMotherboard.h.

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

◆ match_earliest_gem_only_

bool CSCGEMMotherboard::match_earliest_gem_only_
private

Definition at line 166 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchALCT2GEM().

◆ max_delta_bx_alct_gem_

unsigned CSCGEMMotherboard::max_delta_bx_alct_gem_
private

Definition at line 159 of file CSCGEMMotherboard.h.

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

◆ max_delta_bx_clct_gem_

unsigned CSCGEMMotherboard::max_delta_bx_clct_gem_
private

Definition at line 160 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchCLCT2GEM().