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
 
std::vector< CSCShowerDigireadoutShower () 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 ()
 
void matchShowers (CSCShowerDigi *anode_showers, CSCShowerDigi *cathode_showers, bool andlogic)
 
void sortCLCTByQualBend (int alct_bx, std::vector< unsigned > &clctBxVector)
 
- 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 maxbx_readout_
 
unsigned minbx_readout_
 
unsigned int mpc_block_me1a
 
std::vector< int > preferred_bx_match_
 
std::unique_ptr< LCTQualityAssignmentqualityAssignment_
 
std::unique_ptr< LCTQualityControlqualityControl_
 
bool readout_earliest_2
 
CSCShowerDigi showers_ [CSCConstants::MAX_LCT_TBINS]
 
std::vector< unsigned > showerSource_
 
bool sort_clct_bx_
 
unsigned thisShowerSource_
 
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 516 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().

519  {
520  thisLCT.setValid(true);
521  if (gem.isCoincidence())
522  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT2GEM);
523  else if (gem.isValid())
524  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCTGEM);
525  thisLCT.setQuality(qualityAssignment_->findQuality(alct, clct, gem));
526  thisLCT.setALCT(getBXShiftedALCT(alct));
527  thisLCT.setCLCT(getBXShiftedCLCT(clct));
528  // set pads if there are any
529  thisLCT.setGEM1(gem.mid1());
530  thisLCT.setGEM2(gem.mid2());
531  thisLCT.setPattern(encodePattern(clct.getPattern()));
532  thisLCT.setMPCLink(0);
533  thisLCT.setBX0(0);
534  thisLCT.setSyncErr(0);
535  thisLCT.setCSCID(theTrigChamber);
536  thisLCT.setTrknmb(0); // will be set later after sorting
537  thisLCT.setWireGroup(alct.getKeyWG());
538  thisLCT.setStrip(clct.getKeyStrip());
539  thisLCT.setBend(clct.getBend());
540  thisLCT.setBX(alct.getBX());
541  if (runCCLUT_) {
542  thisLCT.setRun3(true);
544  gem.isValid()) { //calculate new slope from strip difference between CLCT and associated GEM
545  int slope = cscGEMMatcher_->calculateGEMCSCBending(clct, gem);
546  thisLCT.setSlope(abs(slope));
547  thisLCT.setBend(std::signbit(slope));
548  thisLCT.setPattern(Run2PatternConverter(slope));
549  } else
550  thisLCT.setSlope(clct.getSlope());
551  thisLCT.setQuartStripBit(clct.getQuartStripBit());
552  thisLCT.setEighthStripBit(clct.getEighthStripBit());
553  thisLCT.setRun3Pattern(clct.getRun3Pattern());
554  }
555 }
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 558 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.

560  {
561  thisLCT.setValid(true);
562  thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT);
563  thisLCT.setALCT(getBXShiftedALCT(aLCT));
564  thisLCT.setCLCT(getBXShiftedCLCT(cLCT));
565  thisLCT.setPattern(encodePattern(cLCT.getPattern()));
566  thisLCT.setMPCLink(0);
567  thisLCT.setBX0(0);
568  thisLCT.setSyncErr(0);
569  thisLCT.setCSCID(theTrigChamber);
570  thisLCT.setTrknmb(0); // will be set later after sorting
571  thisLCT.setWireGroup(aLCT.getKeyWG());
572  thisLCT.setStrip(cLCT.getKeyStrip());
573  thisLCT.setBend(cLCT.getBend());
574  thisLCT.setBX(aLCT.getBX());
575  thisLCT.setQuality(qualityAssignment_->findQuality(aLCT, cLCT));
576  if (runCCLUT_) {
577  thisLCT.setRun3(true);
578  // 4-bit slope value derived with the CCLUT algorithm
579  thisLCT.setSlope(cLCT.getSlope());
580  thisLCT.setQuartStripBit(cLCT.getQuartStripBit());
581  thisLCT.setEighthStripBit(cLCT.getEighthStripBit());
582  thisLCT.setRun3Pattern(cLCT.getRun3Pattern());
583  }
584 }
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 587 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.

589  {
590  thisLCT.setValid(true);
591  thisLCT.setType(CSCCorrelatedLCTDigi::CLCT2GEM);
592  thisLCT.setQuality(qualityAssignment_->findQuality(clct, gem));
593  thisLCT.setCLCT(getBXShiftedCLCT(clct));
594  thisLCT.setGEM1(gem.mid1());
595  thisLCT.setGEM2(gem.mid2());
596  thisLCT.setPattern(encodePattern(clct.getPattern()));
597  thisLCT.setMPCLink(0);
598  thisLCT.setBX0(0);
599  thisLCT.setSyncErr(0);
600  thisLCT.setCSCID(theTrigChamber);
601  thisLCT.setTrknmb(0); // will be set later after sorting
602  thisLCT.setWireGroup(gem.getKeyWG());
603  thisLCT.setStrip(clct.getKeyStrip());
604  thisLCT.setBend(clct.getBend());
605  thisLCT.setBX(gem.bx());
606  if (runCCLUT_) {
607  thisLCT.setRun3(true);
609  gem.isValid()) { //calculate new slope from strip difference between CLCT and associated GEM
610  int slope = cscGEMMatcher_->calculateGEMCSCBending(clct, gem);
611  thisLCT.setSlope(abs(slope));
612  thisLCT.setBend(pow(-1, std::signbit(slope)));
613  thisLCT.setPattern(Run2PatternConverter(slope));
614  } else
615  thisLCT.setSlope(clct.getSlope());
616  thisLCT.setQuartStripBit(clct.getQuartStripBit());
617  thisLCT.setEighthStripBit(clct.getEighthStripBit());
618  thisLCT.setRun3Pattern(clct.getRun3Pattern());
619  }
620 }
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 623 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.

625  {
626  thisLCT.setValid(true);
627  thisLCT.setType(CSCCorrelatedLCTDigi::ALCT2GEM);
628  thisLCT.setQuality(qualityAssignment_->findQuality(alct, gem));
629  thisLCT.setALCT(getBXShiftedALCT(alct));
630  thisLCT.setGEM1(gem.mid1());
631  thisLCT.setGEM2(gem.mid2());
632  thisLCT.setPattern(10);
633  thisLCT.setMPCLink(0);
634  thisLCT.setBX0(0);
635  thisLCT.setSyncErr(0);
636  thisLCT.setCSCID(theTrigChamber);
637  thisLCT.setTrknmb(0); // will be set later after sorting
638  thisLCT.setWireGroup(alct.getKeyWG());
639  thisLCT.setStrip(gem.getKeyStrip());
640  thisLCT.setBend(0);
641  thisLCT.setBX(alct.getBX());
642  if (runCCLUT_) {
643  thisLCT.setRun3(true);
644  thisLCT.setSlope(0);
645  thisLCT.setQuartStripBit(false);
646  thisLCT.setEighthStripBit(false);
647  // ALCT-2GEM type LCTs do not bend in the chamber
648  thisLCT.setRun3Pattern(4);
649  }
650 }
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 402 of file CSCGEMMotherboard.cc.

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

Referenced by matchALCTCLCTGEM().

405  {
406  // Sanity checks on ALCT, CLCT, GEM clusters
407  if (!ALCT.isValid()) {
408  LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM";
409  return;
410  }
411 
412  if (!CLCT.isValid()) {
413  LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM";
414  return;
415  }
416 
417  GEMInternalClusters ValidClusters;
418  for (const auto& cl : clusters)
419  if (cl.isValid())
420  ValidClusters.push_back(cl);
421  if (ValidClusters.empty())
422  return;
423 
424  // We can now check possible triplets and construct all LCTs with
425  // valid ALCT, valid CLCTs and GEM clusters
426  GEMInternalCluster bestCluster;
427  cscGEMMatcher_->bestClusterLoc(ALCT, CLCT, ValidClusters, bestCluster);
428  if (bestCluster.isValid())
429  constructLCTsGEM(ALCT, CLCT, bestCluster, lct);
430 }
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 433 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.

435  {
436  // Sanity checks on ALCT, CLCT
437  if (!ALCT.isValid() or (ALCT.getQuality() == 0 and drop_low_quality_alct_)) {
438  LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM";
439  return;
440  }
441 
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  // construct LCT
452  if (match_trig_enable and doesALCTCrossCLCT(ALCT, CLCT)) {
453  constructLCTsGEM(ALCT, CLCT, lct);
454  }
455 }
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 458 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.

460  {
461  // Sanity checks on CLCT, GEM clusters
462  bool dropLowQualityCLCT = drop_low_quality_clct_;
464  dropLowQualityCLCT = drop_low_quality_clct_me1a_;
465 
466  if (!CLCT.isValid() or (CLCT.getQuality() <= 3 and dropLowQualityCLCT)) {
467  LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM";
468  return;
469  }
470 
471  GEMInternalClusters ValidClusters;
472  for (const auto& cl : clusters)
473  if (cl.isValid())
474  ValidClusters.push_back(cl);
475  if (ValidClusters.empty())
476  return;
477 
478  // get the best matching cluster
479  GEMInternalCluster bestCluster;
480  cscGEMMatcher_->bestClusterLoc(CLCT, ValidClusters, bestCluster);
481 
482  // construct all LCTs with valid CLCTs and coincidence clusters
483  if (bestCluster.isCoincidence()) {
484  constructLCTsGEM(CLCT, bestCluster, lct);
485  }
486 }
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 489 of file CSCGEMMotherboard.cc.

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

491  {
492  // Sanity checks on ALCT, GEM clusters
493  if (!ALCT.isValid() or (ALCT.getQuality() == 0 and drop_low_quality_alct_)) {
494  LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM";
495  return;
496  }
497 
498  GEMInternalClusters ValidClusters;
499  for (const auto& cl : clusters)
500  if (cl.isValid())
501  ValidClusters.push_back(cl);
502  if (ValidClusters.empty())
503  return;
504 
505  // get the best matching cluster
506  GEMInternalCluster bestCluster;
507  cscGEMMatcher_->bestClusterLoc(ALCT, ValidClusters, bestCluster);
508 
509  // construct all LCTs with valid ALCTs and coincidence clusters
510  if (bestCluster.isCoincidence()) {
511  constructLCTsGEM(ALCT, bestCluster, lct);
512  }
513 }
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::infoV, CSCBaseboard::isME21_, CSCALCTDigi::isValid(), sistrip::SpyUtilities::isValid(), CSCCLCTDigi::isValid(), CSCCorrelatedLCTDigi::isValid(), LogTrace, CSCMotherboard::match_trig_window_size, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, CSCConstants::MAX_LCTS_PER_CSC, SiStripPI::min, or, CSCMotherboard::preferred_bx_match_, CSCCorrelatedLCTDigi::setTrknmb(), CSCMotherboard::sort_clct_bx_, CSCMotherboard::sortCLCTByQualBend(), 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  unsigned matching_clctbx = 0;
156  unsigned bx_clct = 0;
157 
158  std::vector<unsigned> clctBx_qualbend_match;
159  sortCLCTByQualBend(bx_alct, clctBx_qualbend_match);
160 
161  bool hasLocalShower = false;
162  for (unsigned ibx = 1; ibx <= match_trig_window_size / 2; ibx++)
163  hasLocalShower = (hasLocalShower or clctProc->getLocalShowerFlag(bx_alct - CSCConstants::ALCT_CLCT_OFFSET - ibx));
164  // BestCLCT and secondCLCT
165  for (unsigned mbx = 0; mbx < match_trig_window_size; mbx++) {
166  //bx_clct_run2 would be overflow when bx_alct is small but it is okay
167  unsigned bx_clct_run2 = bx_alct + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET;
168  unsigned bx_clct_qualbend = clctBx_qualbend_match[mbx];
169  bx_clct = (sort_clct_bx_ or not(hasLocalShower)) ? bx_clct_run2 : bx_clct_qualbend;
170 
171  if (bx_clct >= CSCConstants::MAX_CLCT_TBINS)
172  continue;
173  matchingBX = mbx;
174  matching_clctbx = mbx;
175 
176  if ((clctProc->getBestCLCT(bx_clct)).isValid())
177  break;
178  }
179 
180  bestCLCT = clctProc->getBestCLCT(bx_clct);
181  secondCLCT = clctProc->getSecondCLCT(bx_clct);
182 
183  if (!bestALCT.isValid() and !secondALCT.isValid() and !bestCLCT.isValid() and !secondCLCT.isValid())
184  continue;
185  if (!build_lct_from_clct_gem_ and !bestALCT.isValid())
186  continue;
187  if (!build_lct_from_alct_gem_ and !bestCLCT.isValid())
188  continue;
189 
190  if (infoV > 1)
191  LogTrace("CSCGEMMotherboard") << "GEMCSCOTMB: Successful ALCT-CLCT match: bx_alct = " << bx_alct
192  << "; bx_clct = " << matching_clctbx << "; mbx = " << matchingBX << " bestALCT "
193  << bestALCT << " secondALCT " << secondALCT << " bestCLCT " << bestCLCT
194  << " secondCLCT " << secondCLCT;
195  // ALCT + CLCT + GEM
196 
197  for (unsigned gmbx = 0; gmbx < alct_gem_bx_window_size_; gmbx++) {
198  unsigned bx_gem = bx_alct + preferred_bx_match_[gmbx];
199  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::AllClusters);
200  if (!clustersGEM.empty()) {
201  correlateLCTsGEM(bestALCT, bestCLCT, clustersGEM, LCTbestAbestCgem);
202  correlateLCTsGEM(bestALCT, secondCLCT, clustersGEM, LCTbestAsecondCgem);
203  correlateLCTsGEM(secondALCT, bestCLCT, clustersGEM, LCTsecondAbestCgem);
204  correlateLCTsGEM(secondALCT, secondCLCT, clustersGEM, LCTsecondAsecondCgem);
205  break;
206  }
207  }
208 
209  // ALCT + CLCT
210 
211  correlateLCTsGEM(bestALCT, bestCLCT, LCTbestAbestC);
212  correlateLCTsGEM(bestALCT, secondCLCT, LCTbestAsecondC);
213  correlateLCTsGEM(secondALCT, bestCLCT, LCTsecondAbestC);
214  correlateLCTsGEM(secondALCT, secondCLCT, LCTsecondAsecondC);
215 
216  // CLCT + 2 GEM
217 
219  unsigned bx_gem = bx_alct;
220 
221  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
222  correlateLCTsGEM(bestCLCT, clustersGEM, LCTbestCLCTgem);
223  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
224  correlateLCTsGEM(secondCLCT, clustersGEM, LCTsecondCLCTgem);
225  }
226 
227  // ALCT + 2 GEM
228 
230  for (unsigned gmbx = 0; gmbx < alct_gem_bx_window_size_; gmbx++) {
231  unsigned bx_gem = bx_alct + preferred_bx_match_[gmbx];
232  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
233  if (!clustersGEM.empty()) {
234  correlateLCTsGEM(bestALCT, clustersGEM, LCTbestALCTgem);
235  correlateLCTsGEM(secondALCT, clustersGEM, LCTsecondALCTgem);
236  break;
237  }
238  }
239  }
240 
241  // Select LCTs, following FW logic
242 
243  std::vector<CSCCorrelatedLCTDigi> selectedLCTs;
244 
245  // CASE => Only bestALCT is valid
246  if (bestALCT.isValid() and !secondALCT.isValid() and !bestCLCT.isValid() and !secondCLCT.isValid()) {
247  if (LCTbestALCTgem.isValid()) {
248  LCTbestALCTgem.setTrknmb(1);
249  allLCTs_(bx_alct, matchingBX, 0) = LCTbestALCTgem;
250  }
251  }
252 
253  // CASE => Only bestCLCT is valid
254  if (!bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
255  if (LCTbestCLCTgem.isValid()) {
256  LCTbestCLCTgem.setTrknmb(1);
257  allLCTs_(bx_alct, matchingBX, 0) = LCTbestCLCTgem;
258  }
259  }
260 
261  // CASE => bestALCT and bestCLCT are valid
262  if (bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
263  if (LCTbestAbestCgem.isValid()) {
264  LCTbestAbestCgem.setTrknmb(1);
265  allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestCgem;
266  } else if (LCTbestAbestC.isValid()) {
267  LCTbestAbestC.setTrknmb(1);
268  allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestC;
269  }
270  }
271 
272  // CASE => bestALCT, secondALCT, bestCLCT are valid
273  if (bestALCT.isValid() and secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
274  CSCCorrelatedLCTDigi lctbb, lctsb;
275  if (LCTbestAbestCgem.isValid())
276  lctbb = LCTbestAbestCgem;
277  else if (LCTbestAbestC.isValid())
278  lctbb = LCTbestAbestC;
279  if (LCTsecondAbestCgem.isValid())
280  lctsb = LCTsecondAbestCgem;
281  else if (LCTsecondAbestC.isValid())
282  lctsb = LCTsecondAbestC;
283 
284  if (lctbb.getQuality() >= lctsb.getQuality() and lctbb.isValid()) {
285  selectedLCTs.push_back(lctbb);
286  if (LCTsecondALCTgem.isValid() and build_lct_from_alct_gem_)
287  selectedLCTs.push_back(LCTsecondALCTgem);
288  else if (LCTsecondAbestC.isValid())
289  selectedLCTs.push_back(LCTsecondAbestC);
290  } else if (lctbb.getQuality() < lctsb.getQuality() and lctsb.isValid()) {
291  selectedLCTs.push_back(lctsb);
292  if (LCTbestALCTgem.isValid() and build_lct_from_alct_gem_)
293  selectedLCTs.push_back(LCTbestALCTgem);
294  else if (LCTbestAbestC.isValid())
295  selectedLCTs.push_back(LCTbestAbestC);
296  }
297 
298  sortLCTs(selectedLCTs);
299 
300  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
301  iLCT++) {
302  if (selectedLCTs[iLCT].isValid()) {
303  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
304  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
305  }
306  }
307  }
308 
309  // CASE => bestALCT, bestCLCT, secondCLCT are valid
310  if (bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and secondCLCT.isValid()) {
311  CSCCorrelatedLCTDigi lctbb, lctbs;
312  if (LCTbestAbestCgem.isValid())
313  lctbb = LCTbestAbestCgem;
314  else if (LCTbestAbestC.isValid())
315  lctbb = LCTbestAbestC;
316  if (LCTbestAsecondCgem.isValid())
317  lctbs = LCTbestAsecondCgem;
318  else if (LCTbestAsecondC.isValid())
319  lctbs = LCTbestAsecondC;
320 
321  if (lctbb.getQuality() >= lctbs.getQuality() and lctbb.isValid()) {
322  selectedLCTs.push_back(lctbb);
323  if (LCTsecondCLCTgem.isValid() and build_lct_from_clct_gem_)
324  selectedLCTs.push_back(LCTsecondCLCTgem);
325  else if (LCTbestAsecondC.isValid())
326  selectedLCTs.push_back(LCTbestAsecondC);
327  } else if (lctbb.getQuality() < lctbs.getQuality() and lctbs.isValid()) {
328  selectedLCTs.push_back(lctbs);
329  if (LCTbestCLCTgem.isValid() and build_lct_from_alct_gem_)
330  selectedLCTs.push_back(LCTbestCLCTgem);
331  else if (LCTbestAbestC.isValid())
332  selectedLCTs.push_back(LCTbestAbestC);
333  }
334 
335  sortLCTs(selectedLCTs);
336 
337  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
338  iLCT++) {
339  if (selectedLCTs[iLCT].isValid()) {
340  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
341  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
342  }
343  }
344  }
345 
346  // CASE => bestALCT, secondALCT, bestCLCT, secondCLCT are valid
347  if (bestALCT.isValid() and secondALCT.isValid() and bestCLCT.isValid() and secondCLCT.isValid()) {
348  CSCCorrelatedLCTDigi lctbb, lctbs, lctsb, lctss;
349 
350  // compute LCT bestA-bestC
351  if (LCTbestAbestCgem.isValid())
352  lctbb = LCTbestAbestCgem;
353  else if (LCTbestAbestC.isValid())
354  lctbb = LCTbestAbestC;
355 
356  // compute LCT bestA-secondC
357  if (LCTbestAsecondCgem.isValid())
358  lctbs = LCTbestAsecondCgem;
359  else if (LCTbestAsecondC.isValid())
360  lctbs = LCTbestAsecondC;
361 
362  if (lctbb.getQuality() >= lctbs.getQuality()) {
363  // push back LCT bestA-bestC
364  selectedLCTs.push_back(lctbb);
365 
366  // compute LCT secondA-secondC
367  if (LCTsecondAsecondCgem.isValid())
368  lctss = LCTsecondAsecondCgem;
369  else if (LCTsecondAsecondC.isValid())
370  lctss = LCTsecondAsecondC;
371 
372  // push back LCT secondA-secondC
373  selectedLCTs.push_back(lctss);
374  } else {
375  // push back LCT bestA-secondC
376  selectedLCTs.push_back(lctbs);
377 
378  // compute LCT secondA-bestC
379  if (LCTsecondAbestCgem.isValid())
380  lctsb = LCTsecondAbestCgem;
381  else if (LCTsecondAbestC.isValid())
382  lctsb = LCTsecondAbestC;
383 
384  // push back LCT secondA-bestC
385  selectedLCTs.push_back(lctsb);
386  }
387 
388  sortLCTs(selectedLCTs);
389 
390  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
391  iLCT++) {
392  if (selectedLCTs[iLCT].isValid()) {
393  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
394  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
395  }
396  }
397  }
398  }
399 }
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
#define LogTrace(id)
std::vector< int > preferred_bx_match_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool isValid() const
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
void sortCLCTByQualBend(int alct_bx, std::vector< unsigned > &clctBxVector)
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 652 of file CSCGEMMotherboard.cc.

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

Referenced by matchALCTCLCTGEM().

652  {
653  // LCTs are sorted by quality. If there are two with the same quality, then the sorting is done by the slope
654  std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool {
655  if (lct1.getQuality() > lct2.getQuality())
656  return lct1.getQuality() > lct2.getQuality();
657  else if (lct1.getQuality() == lct2.getQuality())
658  return lct1.getSlope() < lct2.getSlope();
659  else
660  return false;
661  });
662 }
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().