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)
 
uint16_t Run2PatternConverter (const int slope) const
 
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 CSCALCTDigi &alct, const CSCCLCTDigi &clct, CSCCorrelatedLCTDigi &lct) const
 
void constructLCTsGEM (const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
 
void constructLCTsGEM (const CSCALCTDigi &alct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
 
void correlateLCTsGEM (const CSCALCTDigi &ALCT, const CSCCLCTDigi &CLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct) const
 
void correlateLCTsGEM (const CSCALCTDigi &ALCT, const CSCCLCTDigi &CLCT, CSCCorrelatedLCTDigi &lct) const
 
void correlateLCTsGEM (const CSCCLCTDigi &CLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct) const
 
void correlateLCTsGEM (const CSCALCTDigi &ALCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct) const
 
void matchALCTCLCTGEM ()
 
void sortLCTs (std::vector< CSCCorrelatedLCTDigi > &lcts) const
 

Private Attributes

unsigned alct_gem_bx_window_size_
 
bool assign_gem_csc_bending_
 
bool build_lct_from_alct_gem_
 
bool build_lct_from_clct_gem_
 
unsigned clct_gem_bx_window_size_
 
std::shared_ptr< GEMClusterProcessorclusterProc_
 
std::map< int, GEMInternalClustersclusters_
 
std::unique_ptr< CSCGEMMatchercscGEMMatcher_
 
bool drop_low_quality_alct_
 
bool drop_low_quality_clct_
 
bool drop_low_quality_clct_me1a_
 
const GEMGeometrygem_g
 
unsigned gemId
 
bool hasGE21Geometry16Partitions_
 

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 copyValidToInValidALCT (CSCALCTDigi &, CSCALCTDigi &) const
 
void copyValidToInValidCLCT (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 ()
 
- 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 run3_
 
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) by Giovanni Mocellin (UC Davis)

Definition at line 21 of file CSCGEMMotherboard.h.

Member Typedef Documentation

◆ GEMInternalClusters

Definition at line 23 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 alct_gem_bx_window_size_, assign_gem_csc_bending_, clct_gem_bx_window_size_, clusterProc_, cscGEMMatcher_, drop_low_quality_clct_me1a_, gemId, edm::ParameterSet::getParameter(), CSCBaseboard::isME11_, CSCBaseboard::isME21_, 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_(tmbParams_.getParameter<bool>("dropLowQualityALCTs")),
12  drop_low_quality_clct_(tmbParams_.getParameter<bool>("dropLowQualityCLCTs")),
13  build_lct_from_alct_gem_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM")),
14  build_lct_from_clct_gem_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM")) {
15  // case for ME1/1
16  if (isME11_) {
17  drop_low_quality_clct_me1a_ = tmbParams_.getParameter<bool>("dropLowQualityCLCTs_ME1a");
18  }
19 
20  alct_gem_bx_window_size_ = tmbParams_.getParameter<unsigned>("windowBXALCTGEM");
21  clct_gem_bx_window_size_ = tmbParams_.getParameter<unsigned>("windowBXCLCTGEM");
22 
23  assign_gem_csc_bending_ = tmbParams_.getParameter<bool>("assignGEMCSCBending");
25 
26  // These LogErrors are sanity checks and should not be printed
27  if (isME11_ and !runME11ILT_) {
28  edm::LogError("CSCGEMMotherboard") << "TMB constructed while runME11ILT_ is not set!";
29  };
30 
31  if (isME21_ and !runME21ILT_) {
32  edm::LogError("CSCGEMMotherboard") << "TMB constructed while runME21ILT_ is not set!";
33  };
34 
35  // super chamber has layer=0!
37 
38  clusterProc_ = std::make_shared<GEMClusterProcessor>(theRegion, theStation, theChamber, conf);
39 
40  cscGEMMatcher_ = std::make_unique<CSCGEMMatcher>(theRegion, theStation, theChamber, tmbParams_, conf);
41 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
unsigned alct_gem_bx_window_size_
Log< level::Error, false > LogError
CSCMotherboard(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
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 clct_gem_bx_window_size_
std::unique_ptr< LCTQualityAssignment > qualityAssignment_

◆ ~CSCGEMMotherboard()

CSCGEMMotherboard::~CSCGEMMotherboard ( )
override

Definition at line 43 of file CSCGEMMotherboard.cc.

43 {}

Member Function Documentation

◆ clear()

void CSCGEMMotherboard::clear ( void  )

Definition at line 45 of file CSCGEMMotherboard.cc.

References CSCMotherboard::clear(), and clusterProc_.

Referenced by run().

45  {
47  clusterProc_->clear();
48 }
std::shared_ptr< GEMClusterProcessor > clusterProc_

◆ clusterProc()

std::shared_ptr<GEMClusterProcessor> CSCGEMMotherboard::clusterProc ( ) const
inline

Definition at line 46 of file CSCGEMMotherboard.h.

References clusterProc_.

Referenced by CSCTriggerPrimitivesBuilder::build().

46 { return clusterProc_; }
std::shared_ptr< GEMClusterProcessor > clusterProc_

◆ constructLCTsGEM() [1/4]

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

Definition at line 496 of file CSCGEMMotherboard.cc.

References funct::abs(), 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_, Run2PatternConverter(), 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(), slope, and CSCBaseboard::theTrigChamber.

Referenced by correlateLCTsGEM().

499  {
500  thisLCT.setValid(true);
501  if (gem.isCoincidence())
502  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT2GEM);
503  else if (gem.isValid())
504  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCTGEM);
505  thisLCT.setQuality(qualityAssignment_->findQuality(alct, clct, gem));
506  thisLCT.setALCT(getBXShiftedALCT(alct));
507  thisLCT.setCLCT(getBXShiftedCLCT(clct));
508  // set pads if there are any
509  thisLCT.setGEM1(gem.mid1());
510  thisLCT.setGEM2(gem.mid2());
511  thisLCT.setPattern(encodePattern(clct.getPattern()));
512  thisLCT.setMPCLink(0);
513  thisLCT.setBX0(0);
514  thisLCT.setSyncErr(0);
515  thisLCT.setCSCID(theTrigChamber);
516  thisLCT.setTrknmb(0); // will be set later after sorting
517  thisLCT.setWireGroup(alct.getKeyWG());
518  thisLCT.setStrip(clct.getKeyStrip());
519  thisLCT.setBend(clct.getBend());
520  thisLCT.setBX(alct.getBX());
521  if (runCCLUT_) {
522  thisLCT.setRun3(true);
524  gem.isValid()) { //calculate new slope from strip difference between CLCT and associated GEM
525  int slope = cscGEMMatcher_->calculateGEMCSCBending(clct, gem);
526  thisLCT.setSlope(abs(slope));
527  thisLCT.setBend(std::signbit(slope));
528  thisLCT.setPattern(Run2PatternConverter(slope));
529  } else
530  thisLCT.setSlope(clct.getSlope());
531  thisLCT.setQuartStripBit(clct.getQuartStripBit());
532  thisLCT.setEighthStripBit(clct.getEighthStripBit());
533  thisLCT.setRun3Pattern(clct.getRun3Pattern());
534  }
535 }
uint16_t Run2PatternConverter(const int slope) const
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
static const double slope[3]
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
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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/4]

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

Definition at line 538 of file CSCGEMMotherboard.cc.

References CSCCorrelatedLCTDigi::ALCTCLCT, CSCMotherboard::encodePattern(), 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::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.

540  {
541  thisLCT.setValid(true);
542  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT);
543  thisLCT.setALCT(getBXShiftedALCT(aLCT));
544  thisLCT.setCLCT(getBXShiftedCLCT(cLCT));
545  thisLCT.setPattern(encodePattern(cLCT.getPattern()));
546  thisLCT.setMPCLink(0);
547  thisLCT.setBX0(0);
548  thisLCT.setSyncErr(0);
549  thisLCT.setCSCID(theTrigChamber);
550  thisLCT.setTrknmb(0); // will be set later after sorting
551  thisLCT.setWireGroup(aLCT.getKeyWG());
552  thisLCT.setStrip(cLCT.getKeyStrip());
553  thisLCT.setBend(cLCT.getBend());
554  thisLCT.setBX(aLCT.getBX());
555  thisLCT.setQuality(qualityAssignment_->findQuality(aLCT, cLCT));
556  if (runCCLUT_) {
557  thisLCT.setRun3(true);
558  // 4-bit slope value derived with the CCLUT algorithm
559  thisLCT.setSlope(cLCT.getSlope());
560  thisLCT.setQuartStripBit(cLCT.getQuartStripBit());
561  thisLCT.setEighthStripBit(cLCT.getEighthStripBit());
562  thisLCT.setRun3Pattern(cLCT.getRun3Pattern());
563  }
564 }
unsigned int encodePattern(const int clctPattern) const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
std::unique_ptr< LCTQualityAssignment > qualityAssignment_

◆ constructLCTsGEM() [3/4]

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

Definition at line 567 of file CSCGEMMotherboard.cc.

References funct::abs(), 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(), funct::pow(), CSCMotherboard::qualityAssignment_, Run2PatternConverter(), 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(), slope, and CSCBaseboard::theTrigChamber.

569  {
570  thisLCT.setValid(true);
571  thisLCT.setType(CSCCorrelatedLCTDigi::CLCT2GEM);
572  thisLCT.setQuality(qualityAssignment_->findQuality(clct, gem));
573  thisLCT.setCLCT(getBXShiftedCLCT(clct));
574  thisLCT.setGEM1(gem.mid1());
575  thisLCT.setGEM2(gem.mid2());
576  thisLCT.setPattern(encodePattern(clct.getPattern()));
577  thisLCT.setMPCLink(0);
578  thisLCT.setBX0(0);
579  thisLCT.setSyncErr(0);
580  thisLCT.setCSCID(theTrigChamber);
581  thisLCT.setTrknmb(0); // will be set later after sorting
582  thisLCT.setWireGroup(gem.getKeyWG());
583  thisLCT.setStrip(clct.getKeyStrip());
584  thisLCT.setBend(clct.getBend());
585  thisLCT.setBX(gem.bx());
586  if (runCCLUT_) {
587  thisLCT.setRun3(true);
589  gem.isValid()) { //calculate new slope from strip difference between CLCT and associated GEM
590  int slope = cscGEMMatcher_->calculateGEMCSCBending(clct, gem);
591  thisLCT.setSlope(abs(slope));
592  thisLCT.setBend(pow(-1, std::signbit(slope)));
593  thisLCT.setPattern(Run2PatternConverter(slope));
594  } else
595  thisLCT.setSlope(clct.getSlope());
596  thisLCT.setQuartStripBit(clct.getQuartStripBit());
597  thisLCT.setEighthStripBit(clct.getEighthStripBit());
598  thisLCT.setRun3Pattern(clct.getRun3Pattern());
599  }
600 }
uint16_t Run2PatternConverter(const int slope) const
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
unsigned int encodePattern(const int clctPattern) const
static const double slope[3]
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
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
std::unique_ptr< LCTQualityAssignment > qualityAssignment_

◆ constructLCTsGEM() [4/4]

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

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

605  {
606  thisLCT.setValid(true);
607  thisLCT.setType(CSCCorrelatedLCTDigi::ALCT2GEM);
608  thisLCT.setQuality(qualityAssignment_->findQuality(alct, gem));
609  thisLCT.setALCT(getBXShiftedALCT(alct));
610  thisLCT.setGEM1(gem.mid1());
611  thisLCT.setGEM2(gem.mid2());
612  thisLCT.setPattern(10);
613  thisLCT.setMPCLink(0);
614  thisLCT.setBX0(0);
615  thisLCT.setSyncErr(0);
616  thisLCT.setCSCID(theTrigChamber);
617  thisLCT.setTrknmb(0); // will be set later after sorting
618  thisLCT.setWireGroup(alct.getKeyWG());
619  thisLCT.setStrip(gem.getKeyStrip());
620  thisLCT.setBend(0);
621  thisLCT.setBX(alct.getBX());
622  if (runCCLUT_) {
623  thisLCT.setRun3(true);
624  thisLCT.setSlope(0);
625  thisLCT.setQuartStripBit(false);
626  thisLCT.setEighthStripBit(false);
627  // ALCT-2GEM type LCTs do not bend in the chamber
628  thisLCT.setRun3Pattern(4);
629  }
630 }
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/4]

void CSCGEMMotherboard::correlateLCTsGEM ( const CSCALCTDigi ALCT,
const CSCCLCTDigi CLCT,
const GEMInternalClusters clusters,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 382 of file CSCGEMMotherboard.cc.

References cscdqm::ALCT, haddnano::cl, bsc_activity_cfg::clusters, constructLCTsGEM(), cscGEMMatcher_, GEMInternalCluster::isValid(), CSCCLCTDigi::isValid(), and LogTrace.

Referenced by matchALCTCLCTGEM().

385  {
386  // Sanity checks on ALCT, CLCT, GEM clusters
387  if (!ALCT.isValid()) {
388  LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM";
389  return;
390  }
391 
392  if (!CLCT.isValid()) {
393  LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM";
394  return;
395  }
396 
397  GEMInternalClusters ValidClusters;
398  for (const auto& cl : clusters)
399  if (cl.isValid())
400  ValidClusters.push_back(cl);
401  if (ValidClusters.empty())
402  return;
403 
404  // We can now check possible triplets and construct all LCTs with
405  // valid ALCT, valid CLCTs and GEM clusters
406  GEMInternalCluster bestCluster;
407  cscGEMMatcher_->bestClusterLoc(ALCT, CLCT, ValidClusters, bestCluster);
408  if (bestCluster.isValid())
409  constructLCTsGEM(ALCT, CLCT, bestCluster, lct);
410 }
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
#define LogTrace(id)
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
std::vector< GEMInternalCluster > GEMInternalClusters
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50

◆ correlateLCTsGEM() [2/4]

void CSCGEMMotherboard::correlateLCTsGEM ( const CSCALCTDigi ALCT,
const CSCCLCTDigi CLCT,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 413 of file CSCGEMMotherboard.cc.

References cscdqm::ALCT, constructLCTsGEM(), CSCMotherboard::doesALCTCrossCLCT(), drop_low_quality_alct_, drop_low_quality_clct_, drop_low_quality_clct_me1a_, CSCCLCTDigi::getKeyStrip(), CSCCLCTDigi::getQuality(), CSCBaseboard::isME11_, CSCCLCTDigi::isValid(), LogTrace, CSCMotherboard::match_trig_enable, CSCConstants::MAX_HALF_STRIP_ME1B, and or.

415  {
416  // Sanity checks on ALCT, CLCT
417  if (!ALCT.isValid() or (ALCT.getQuality() == 0 and drop_low_quality_alct_)) {
418  LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM";
419  return;
420  }
421 
422  bool dropLowQualityCLCT = drop_low_quality_clct_;
424  dropLowQualityCLCT = drop_low_quality_clct_me1a_;
425 
426  if (!CLCT.isValid() or (CLCT.getQuality() <= 3 and dropLowQualityCLCT)) {
427  LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM";
428  return;
429  }
430 
431  // construct LCT
432  if (match_trig_enable and doesALCTCrossCLCT(ALCT, CLCT)) {
433  constructLCTsGEM(ALCT, CLCT, lct);
434  }
435 }
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
#define LogTrace(id)
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
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
unsigned int match_trig_enable
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const

◆ correlateLCTsGEM() [3/4]

void CSCGEMMotherboard::correlateLCTsGEM ( const CSCCLCTDigi CLCT,
const GEMInternalClusters clusters,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 438 of file CSCGEMMotherboard.cc.

References haddnano::cl, bsc_activity_cfg::clusters, constructLCTsGEM(), cscGEMMatcher_, drop_low_quality_clct_, drop_low_quality_clct_me1a_, CSCCLCTDigi::getKeyStrip(), CSCCLCTDigi::getQuality(), GEMInternalCluster::isCoincidence(), CSCBaseboard::isME11_, CSCCLCTDigi::isValid(), LogTrace, CSCConstants::MAX_HALF_STRIP_ME1B, and or.

440  {
441  // Sanity checks on CLCT, GEM clusters
442  bool dropLowQualityCLCT = drop_low_quality_clct_;
444  dropLowQualityCLCT = drop_low_quality_clct_me1a_;
445 
446  if (!CLCT.isValid() or (CLCT.getQuality() <= 3 and dropLowQualityCLCT)) {
447  LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM";
448  return;
449  }
450 
451  GEMInternalClusters ValidClusters;
452  for (const auto& cl : clusters)
453  if (cl.isValid())
454  ValidClusters.push_back(cl);
455  if (ValidClusters.empty())
456  return;
457 
458  // get the best matching cluster
459  GEMInternalCluster bestCluster;
460  cscGEMMatcher_->bestClusterLoc(CLCT, ValidClusters, bestCluster);
461 
462  // construct all LCTs with valid CLCTs and coincidence clusters
463  if (bestCluster.isCoincidence()) {
464  constructLCTsGEM(CLCT, bestCluster, lct);
465  }
466 }
bool isCoincidence() const
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
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
#define LogTrace(id)
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
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
std::vector< GEMInternalCluster > GEMInternalClusters
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50

◆ correlateLCTsGEM() [4/4]

void CSCGEMMotherboard::correlateLCTsGEM ( const CSCALCTDigi ALCT,
const GEMInternalClusters clusters,
CSCCorrelatedLCTDigi lct 
) const
private

Definition at line 469 of file CSCGEMMotherboard.cc.

References cscdqm::ALCT, haddnano::cl, bsc_activity_cfg::clusters, constructLCTsGEM(), cscGEMMatcher_, drop_low_quality_alct_, GEMInternalCluster::isCoincidence(), LogTrace, and or.

471  {
472  // Sanity checks on ALCT, GEM clusters
473  if (!ALCT.isValid() or (ALCT.getQuality() == 0 and drop_low_quality_alct_)) {
474  LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM";
475  return;
476  }
477 
478  GEMInternalClusters ValidClusters;
479  for (const auto& cl : clusters)
480  if (cl.isValid())
481  ValidClusters.push_back(cl);
482  if (ValidClusters.empty())
483  return;
484 
485  // get the best matching cluster
486  GEMInternalCluster bestCluster;
487  cscGEMMatcher_->bestClusterLoc(ALCT, ValidClusters, bestCluster);
488 
489  // construct all LCTs with valid ALCTs and coincidence clusters
490  if (bestCluster.isCoincidence()) {
491  constructLCTsGEM(ALCT, bestCluster, lct);
492  }
493 }
bool isCoincidence() const
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
#define LogTrace(id)
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
void constructLCTsGEM(const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, CSCCorrelatedLCTDigi &lct) const
std::vector< GEMInternalCluster > GEMInternalClusters

◆ matchALCTCLCTGEM()

void CSCGEMMotherboard::matchALCTCLCTGEM ( )
private

Definition at line 128 of file CSCGEMMotherboard.cc.

References CSCConstants::ALCT_CLCT_OFFSET, alct_gem_bx_window_size_, CSCMotherboard::alctProc, GEMClusterProcessor::AllClusters, CSCMotherboard::allLCTs_, build_lct_from_alct_gem_, build_lct_from_clct_gem_, CSCMotherboard::clctProc, clusterProc_, GEMClusterProcessor::CoincidenceClusters, correlateLCTsGEM(), CSCCorrelatedLCTDigi::getQuality(), hasGE21Geometry16Partitions_, CSCBaseboard::isME21_, CSCALCTDigi::isValid(), sistrip::SpyUtilities::isValid(), CSCCLCTDigi::isValid(), CSCCorrelatedLCTDigi::isValid(), CSCMotherboard::match_trig_window_size, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, CSCConstants::MAX_LCTS_PER_CSC, SiStripPI::min, CSCMotherboard::preferred_bx_match_, CSCCorrelatedLCTDigi::setTrknmb(), and sortLCTs().

Referenced by run().

128  {
129  // no matching is done for GE2/1 geometries with 8 eta partitions
130  // this has been superseded by 16-eta partition geometries
132  return;
133 
134  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
135  // Declaration of all LCTs for this BX:
136 
137  // ALCT + CLCT + GEM
138  CSCCorrelatedLCTDigi LCTbestAbestCgem, LCTbestAsecondCgem, LCTsecondAbestCgem, LCTsecondAsecondCgem;
139  // ALCT + CLCT
140  CSCCorrelatedLCTDigi LCTbestAbestC, LCTbestAsecondC, LCTsecondAbestC, LCTsecondAsecondC;
141  // CLCT + 2 GEM
142  CSCCorrelatedLCTDigi LCTbestCLCTgem, LCTsecondCLCTgem;
143  // ALCT + 2 GEM
144  CSCCorrelatedLCTDigi LCTbestALCTgem, LCTsecondALCTgem;
145 
146  // Construct all the LCTs, selection will come later:
147 
148  CSCALCTDigi bestALCT = alctProc->getBestALCT(bx_alct), secondALCT = alctProc->getSecondALCT(bx_alct);
149  CSCCLCTDigi bestCLCT, secondCLCT;
150  GEMInternalClusters clustersGEM;
151 
152  // Find best and second CLCTs by preferred CLCT BX, taking into account that there is an offset in the simulation
153 
154  unsigned matchingBX = 0;
155 
156  // BestCLCT and secondCLCT
157  for (unsigned mbx = 0; mbx < match_trig_window_size; mbx++) {
158  unsigned bx_clct = bx_alct + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET;
159  if (bx_clct >= CSCConstants::MAX_CLCT_TBINS)
160  continue;
161  bestCLCT = clctProc->getBestCLCT(bx_clct);
162  secondCLCT = clctProc->getSecondCLCT(bx_clct);
163  matchingBX = mbx;
164  if (bestCLCT.isValid())
165  break;
166  }
167 
168  if (!bestALCT.isValid() and !secondALCT.isValid() and !bestCLCT.isValid() and !secondCLCT.isValid())
169  continue;
170  if (!build_lct_from_clct_gem_ and !bestALCT.isValid())
171  continue;
172  if (!build_lct_from_alct_gem_ and !bestCLCT.isValid())
173  continue;
174 
175  // ALCT + CLCT + GEM
176 
177  for (unsigned gmbx = 0; gmbx < alct_gem_bx_window_size_; gmbx++) {
178  unsigned bx_gem = bx_alct + preferred_bx_match_[gmbx];
179  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::AllClusters);
180  if (!clustersGEM.empty()) {
181  correlateLCTsGEM(bestALCT, bestCLCT, clustersGEM, LCTbestAbestCgem);
182  correlateLCTsGEM(bestALCT, secondCLCT, clustersGEM, LCTbestAsecondCgem);
183  correlateLCTsGEM(secondALCT, bestCLCT, clustersGEM, LCTsecondAbestCgem);
184  correlateLCTsGEM(secondALCT, secondCLCT, clustersGEM, LCTsecondAsecondCgem);
185  break;
186  }
187  }
188 
189  // ALCT + CLCT
190 
191  correlateLCTsGEM(bestALCT, bestCLCT, LCTbestAbestC);
192  correlateLCTsGEM(bestALCT, secondCLCT, LCTbestAsecondC);
193  correlateLCTsGEM(secondALCT, bestCLCT, LCTsecondAbestC);
194  correlateLCTsGEM(secondALCT, secondCLCT, LCTsecondAsecondC);
195 
196  // CLCT + 2 GEM
197 
199  unsigned bx_gem = bx_alct;
200 
201  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
202  correlateLCTsGEM(bestCLCT, clustersGEM, LCTbestCLCTgem);
203  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
204  correlateLCTsGEM(secondCLCT, clustersGEM, LCTsecondCLCTgem);
205  }
206 
207  // ALCT + 2 GEM
208 
210  for (unsigned gmbx = 0; gmbx < alct_gem_bx_window_size_; gmbx++) {
211  unsigned bx_gem = bx_alct + preferred_bx_match_[gmbx];
212  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
213  if (!clustersGEM.empty()) {
214  correlateLCTsGEM(bestALCT, clustersGEM, LCTbestALCTgem);
215  correlateLCTsGEM(secondALCT, clustersGEM, LCTsecondALCTgem);
216  break;
217  }
218  }
219  }
220 
221  // Select LCTs, following FW logic
222 
223  std::vector<CSCCorrelatedLCTDigi> selectedLCTs;
224 
225  // CASE => Only bestALCT is valid
226  if (bestALCT.isValid() and !secondALCT.isValid() and !bestCLCT.isValid() and !secondCLCT.isValid()) {
227  if (LCTbestALCTgem.isValid()) {
228  LCTbestALCTgem.setTrknmb(1);
229  allLCTs_(bx_alct, matchingBX, 0) = LCTbestALCTgem;
230  }
231  }
232 
233  // CASE => Only bestCLCT is valid
234  if (!bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
235  if (LCTbestCLCTgem.isValid()) {
236  LCTbestCLCTgem.setTrknmb(1);
237  allLCTs_(bx_alct, matchingBX, 0) = LCTbestCLCTgem;
238  }
239  }
240 
241  // CASE => bestALCT and bestCLCT are valid
242  if (bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
243  if (LCTbestAbestCgem.isValid()) {
244  LCTbestAbestCgem.setTrknmb(1);
245  allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestCgem;
246  } else if (LCTbestAbestC.isValid()) {
247  LCTbestAbestC.setTrknmb(1);
248  allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestC;
249  }
250  }
251 
252  // CASE => bestALCT, secondALCT, bestCLCT are valid
253  if (bestALCT.isValid() and secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
254  CSCCorrelatedLCTDigi lctbb, lctsb;
255  if (LCTbestAbestCgem.isValid())
256  lctbb = LCTbestAbestCgem;
257  else if (LCTbestAbestC.isValid())
258  lctbb = LCTbestAbestC;
259  if (LCTsecondAbestCgem.isValid())
260  lctsb = LCTsecondAbestCgem;
261  else if (LCTsecondAbestC.isValid())
262  lctsb = LCTsecondAbestC;
263 
264  if (lctbb.getQuality() >= lctsb.getQuality() and lctbb.isValid()) {
265  selectedLCTs.push_back(lctbb);
266  if (LCTsecondALCTgem.isValid() and build_lct_from_alct_gem_)
267  selectedLCTs.push_back(LCTsecondALCTgem);
268  else if (LCTsecondAbestC.isValid())
269  selectedLCTs.push_back(LCTsecondAbestC);
270  } else if (lctbb.getQuality() < lctsb.getQuality() and lctsb.isValid()) {
271  selectedLCTs.push_back(lctsb);
272  if (LCTbestALCTgem.isValid() and build_lct_from_alct_gem_)
273  selectedLCTs.push_back(LCTbestALCTgem);
274  else if (LCTbestAbestC.isValid())
275  selectedLCTs.push_back(LCTbestAbestC);
276  }
277 
278  sortLCTs(selectedLCTs);
279 
280  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
281  iLCT++) {
282  if (selectedLCTs[iLCT].isValid()) {
283  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
284  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
285  }
286  }
287  }
288 
289  // CASE => bestALCT, bestCLCT, secondCLCT are valid
290  if (bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and secondCLCT.isValid()) {
291  CSCCorrelatedLCTDigi lctbb, lctbs;
292  if (LCTbestAbestCgem.isValid())
293  lctbb = LCTbestAbestCgem;
294  else if (LCTbestAbestC.isValid())
295  lctbb = LCTbestAbestC;
296  if (LCTbestAsecondCgem.isValid())
297  lctbs = LCTbestAsecondCgem;
298  else if (LCTbestAsecondC.isValid())
299  lctbs = LCTbestAsecondC;
300 
301  if (lctbb.getQuality() >= lctbs.getQuality() and lctbb.isValid()) {
302  selectedLCTs.push_back(lctbb);
303  if (LCTsecondCLCTgem.isValid() and build_lct_from_clct_gem_)
304  selectedLCTs.push_back(LCTsecondCLCTgem);
305  else if (LCTbestAsecondC.isValid())
306  selectedLCTs.push_back(LCTbestAsecondC);
307  } else if (lctbb.getQuality() < lctbs.getQuality() and lctbs.isValid()) {
308  selectedLCTs.push_back(lctbs);
309  if (LCTbestCLCTgem.isValid() and build_lct_from_alct_gem_)
310  selectedLCTs.push_back(LCTbestCLCTgem);
311  else if (LCTbestAbestC.isValid())
312  selectedLCTs.push_back(LCTbestAbestC);
313  }
314 
315  sortLCTs(selectedLCTs);
316 
317  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
318  iLCT++) {
319  if (selectedLCTs[iLCT].isValid()) {
320  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
321  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
322  }
323  }
324  }
325 
326  // CASE => bestALCT, secondALCT, bestCLCT, secondCLCT are valid
327  if (bestALCT.isValid() and secondALCT.isValid() and bestCLCT.isValid() and secondCLCT.isValid()) {
328  CSCCorrelatedLCTDigi lctbb, lctbs, lctsb, lctss;
329 
330  // compute LCT bestA-bestC
331  if (LCTbestAbestCgem.isValid())
332  lctbb = LCTbestAbestCgem;
333  else if (LCTbestAbestC.isValid())
334  lctbb = LCTbestAbestC;
335 
336  // compute LCT bestA-secondC
337  if (LCTbestAsecondCgem.isValid())
338  lctbs = LCTbestAsecondCgem;
339  else if (LCTbestAsecondC.isValid())
340  lctbs = LCTbestAsecondC;
341 
342  if (lctbb.getQuality() >= lctbs.getQuality()) {
343  // push back LCT bestA-bestC
344  selectedLCTs.push_back(lctbb);
345 
346  // compute LCT secondA-secondC
347  if (LCTsecondAsecondCgem.isValid())
348  lctss = LCTsecondAsecondCgem;
349  else if (LCTsecondAsecondC.isValid())
350  lctss = LCTsecondAsecondC;
351 
352  // push back LCT secondA-secondC
353  selectedLCTs.push_back(lctss);
354  } else {
355  // push back LCT bestA-secondC
356  selectedLCTs.push_back(lctbs);
357 
358  // compute LCT secondA-bestC
359  if (LCTsecondAbestCgem.isValid())
360  lctsb = LCTsecondAbestCgem;
361  else if (LCTsecondAbestC.isValid())
362  lctsb = LCTsecondAbestC;
363 
364  // push back LCT secondA-bestC
365  selectedLCTs.push_back(lctsb);
366  }
367 
368  sortLCTs(selectedLCTs);
369 
370  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
371  iLCT++) {
372  if (selectedLCTs[iLCT].isValid()) {
373  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
374  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
375  }
376  }
377  }
378  }
379 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
LCTContainer allLCTs_
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
unsigned alct_gem_bx_window_size_
unsigned int match_trig_window_size
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
void correlateLCTsGEM(const CSCALCTDigi &ALCT, const CSCCLCTDigi &CLCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct) const
std::vector< int > preferred_bx_match_
bool isValid() const
return valid pattern bit
std::vector< GEMInternalCluster > GEMInternalClusters
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
uint16_t getQuality() const
return the Quality
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts) const
std::shared_ptr< GEMClusterProcessor > clusterProc_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.

◆ run()

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

Definition at line 70 of file CSCGEMMotherboard.cc.

References CSCMotherboard::alctProc, CSCMotherboard::alctV, CSCMotherboard::clctProc, CSCMotherboard::clctV, clear(), clusterProc_, cscGEMMatcher_, CSCBaseboard::cscGeometry_, CSCMotherboard::encodeHighMultiplicityBits(), gem_g, hasGE21Geometry16Partitions_, CSCBaseboard::isME11_, CSCBaseboard::isME21_, CSCMotherboard::lookupTableCCLUT_, CSCMotherboard::lookupTableME11ILT_, CSCMotherboard::lookupTableME21ILT_, matchALCTCLCTGEM(), CSCBaseboard::runCCLUT_, and CSCMotherboard::selectLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

72  {
73  // Step 1: Setup
74  clear();
75 
76  // check for GEM geometry
77  if (gem_g == nullptr) {
78  edm::LogError("CSCGEMMotherboard") << "run() called for GEM-CSC integrated trigger without valid GEM geometry! \n";
79  return;
80  }
81 
82  // Check that the processors can deliver data
83  if (!(alctProc and clctProc)) {
84  edm::LogError("CSCGEMMotherboard") << "run() called for non-existing ALCT/CLCT processor! \n";
85  return;
86  }
87 
88  alctProc->setCSCGeometry(cscGeometry_);
89  clctProc->setCSCGeometry(cscGeometry_);
90 
91  // set CCLUT parameters if necessary
92  if (runCCLUT_) {
93  clctProc->setESLookupTables(lookupTableCCLUT_);
94  }
95 
96  // Step 2: Run the processors
97  const std::vector<CSCALCTDigi>& alctV = alctProc->run(wiredc); // run anodeLCT
98  const std::vector<CSCCLCTDigi>& clctV = clctProc->run(compdc); // run cathodeLCT
99 
100  // Step 2b: encode high multiplicity bits (independent of LCT construction)
102 
103  // if there are no ALCTs and no CLCTs, do not run the ALCT-CLCT correlation
104  if (alctV.empty() and clctV.empty())
105  return;
106 
107  // set the lookup tables for coordinate conversion and matching
108  if (isME11_) {
109  clusterProc_->setESLookupTables(lookupTableME11ILT_);
110  cscGEMMatcher_->setESLookupTables(lookupTableME11ILT_);
111  }
112  if (isME21_) {
113  clusterProc_->setESLookupTables(lookupTableME21ILT_);
114  cscGEMMatcher_->setESLookupTables(lookupTableME21ILT_);
115  }
116 
117  // Step 3: run the GEM cluster processor to get the internal clusters
118  clusterProc_->run(gemClusters);
119  hasGE21Geometry16Partitions_ = clusterProc_->hasGE21Geometry16Partitions();
120 
121  // Step 4: ALCT-CLCT-GEM matching
123 
124  // Step 5: Select at most 2 LCTs per BX
125  selectLCTs();
126 }
std::unique_ptr< CSCGEMMatcher > cscGEMMatcher_
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
std::vector< CSCCLCTDigi > clctV
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Log< level::Error, false > LogError
std::vector< CSCALCTDigi > alctV
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:71
std::shared_ptr< GEMClusterProcessor > clusterProc_
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
void encodeHighMultiplicityBits()
const GEMGeometry * gem_g

◆ Run2PatternConverter()

uint16_t CSCGEMMotherboard::Run2PatternConverter ( const int  slope) const

Definition at line 51 of file CSCGEMMotherboard.cc.

References funct::abs(), Validation_hcalonly_cfi::sign, and slope.

Referenced by constructLCTsGEM().

51  {
52  unsigned sign = std::signbit(slope);
53  unsigned slope_ = abs(slope);
54  uint16_t Run2Pattern = 0;
55 
56  if (slope_ < 3)
57  Run2Pattern = 10;
58  else if (slope_ < 6)
59  Run2Pattern = 8 + sign;
60  else if (slope_ < 9)
61  Run2Pattern = 6 + sign;
62  else if (slope_ < 12)
63  Run2Pattern = 4 + sign;
64  else
65  Run2Pattern = 2 + sign;
66 
67  return Run2Pattern;
68 }
static const double slope[3]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ setGEMGeometry()

void CSCGEMMotherboard::setGEMGeometry ( const GEMGeometry g)
inline

Definition at line 49 of file CSCGEMMotherboard.h.

References g, and gem_g.

Referenced by CSCTriggerPrimitivesBuilder::build().

49 { 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

◆ sortLCTs()

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

Definition at line 632 of file CSCGEMMotherboard.cc.

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

Referenced by matchALCTCLCTGEM().

632  {
633  // LCTs are sorted by quality. If there are two with the same quality, then the sorting is done by the slope
634  std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool {
635  if (lct1.getQuality() > lct2.getQuality())
636  return lct1.getQuality() > lct2.getQuality();
637  else if (lct1.getQuality() == lct2.getQuality())
638  return lct1.getSlope() < lct2.getSlope();
639  else
640  return false;
641  });
642 }
uint16_t getSlope() const
return the slope
uint16_t getQuality() const
return the Quality

Member Data Documentation

◆ alct_gem_bx_window_size_

unsigned CSCGEMMotherboard::alct_gem_bx_window_size_
private

Definition at line 123 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchALCTCLCTGEM().

◆ assign_gem_csc_bending_

bool CSCGEMMotherboard::assign_gem_csc_bending_
private

Definition at line 127 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM(), and CSCGEMMotherboard().

◆ build_lct_from_alct_gem_

bool CSCGEMMotherboard::build_lct_from_alct_gem_
private

Definition at line 119 of file CSCGEMMotherboard.h.

Referenced by matchALCTCLCTGEM().

◆ build_lct_from_clct_gem_

bool CSCGEMMotherboard::build_lct_from_clct_gem_
private

Definition at line 120 of file CSCGEMMotherboard.h.

Referenced by matchALCTCLCTGEM().

◆ clct_gem_bx_window_size_

unsigned CSCGEMMotherboard::clct_gem_bx_window_size_
private

Definition at line 124 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

◆ clusterProc_

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

Definition at line 110 of file CSCGEMMotherboard.h.

Referenced by clear(), clusterProc(), CSCGEMMotherboard(), matchALCTCLCTGEM(), and run().

◆ clusters_

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

Definition at line 104 of file CSCGEMMotherboard.h.

◆ cscGEMMatcher_

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

Definition at line 107 of file CSCGEMMotherboard.h.

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

◆ drop_low_quality_alct_

bool CSCGEMMotherboard::drop_low_quality_alct_
private

Definition at line 113 of file CSCGEMMotherboard.h.

Referenced by correlateLCTsGEM().

◆ drop_low_quality_clct_

bool CSCGEMMotherboard::drop_low_quality_clct_
private

Definition at line 114 of file CSCGEMMotherboard.h.

Referenced by correlateLCTsGEM().

◆ drop_low_quality_clct_me1a_

bool CSCGEMMotherboard::drop_low_quality_clct_me1a_
private

Definition at line 116 of file CSCGEMMotherboard.h.

Referenced by correlateLCTsGEM(), and CSCGEMMotherboard().

◆ gem_g

const GEMGeometry* CSCGEMMotherboard::gem_g
private

Definition at line 101 of file CSCGEMMotherboard.h.

Referenced by run(), and setGEMGeometry().

◆ gemId

unsigned CSCGEMMotherboard::gemId
private

Chamber id (trigger-type labels).

Definition at line 100 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

◆ hasGE21Geometry16Partitions_

bool CSCGEMMotherboard::hasGE21Geometry16Partitions_
private

Definition at line 131 of file CSCGEMMotherboard.h.

Referenced by matchALCTCLCTGEM(), and run().