CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
CSCGEMMotherboard Class Reference

#include <CSCGEMMotherboard.h>

Inheritance diagram for CSCGEMMotherboard:
CSCMotherboard CSCBaseboard

Classes

struct  RunContext
 

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, CSCBaseboard::Parameters &conf)
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads, RunContext const &)
 
uint16_t Run2PatternConverter (const int slope) const
 
 ~CSCGEMMotherboard () override
 
- Public Member Functions inherited from CSCMotherboard
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, CSCBaseboard::Parameters &conf)
 
virtual std::vector< CSCCorrelatedLCTDigireadoutLCTs () const
 
std::vector< CSCShowerDigireadoutShower () const
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const RunContext &)
 
void selectLCTs ()
 
 ~CSCMotherboard () override=default
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, Parameters &conf)
 
 CSCBaseboard ()
 
std::string getCSCName () const
 
CSCDetId id () const
 
virtual ~CSCBaseboard ()=default
 

Private Member Functions

void constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMInternalCluster &gem, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT, CSCCorrelatedLCTDigi &lct) const
 
void constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, CSCCorrelatedLCTDigi &lct) const
 
void constructLCTsGEM (const CSCCLCTDigi &clct, const GEMInternalCluster &gem, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT, 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, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT, CSCCorrelatedLCTDigi &lct) const
 
void correlateLCTsGEM (const CSCALCTDigi &ALCT, const CSCCLCTDigi &CLCT, CSCCorrelatedLCTDigi &lct) const
 
void correlateLCTsGEM (const CSCCLCTDigi &CLCT, const GEMInternalClusters &clusters, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT, CSCCorrelatedLCTDigi &lct) const
 
void correlateLCTsGEM (const CSCALCTDigi &ALCT, const GEMInternalClusters &clusters, CSCCorrelatedLCTDigi &lct) const
 
void matchALCTCLCTGEM (const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT)
 
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_
 
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
bool doesALCTCrossCLCT (const CSCALCTDigi &, const CSCCLCTDigi &) const
 
unsigned int encodePattern (const int clctPattern) const
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) const
 
CSCCLCTDigi getBXShiftedCLCT (const CSCCLCTDigi &) const
 
unsigned int match_trig_enable () const
 
unsigned int match_trig_window_size () const
 
int preferred_bx_match (unsigned int index) const
 
std::tuple< std::vector< CSCALCTDigi >, std::vector< CSCCLCTDigi > > runCommon (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const RunContext &context)
 
bool sort_clct_bx () const
 
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)
 
const CSCChambercscChamber (CSCGeometry const &) const
 
- Protected Attributes inherited from CSCMotherboard
LCTContainer allLCTs_
 
std::unique_ptr< LCTQualityAssignmentqualityAssignment_
 
- Protected Attributes inherited from CSCBaseboard
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_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
int theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 

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,
CSCBaseboard::Parameters 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_, CSCBaseboard::Parameters::conf(), 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::Parameters::tmbParams().

11  drop_low_quality_alct_(conf.tmbParams().getParameter<bool>("dropLowQualityALCTs")),
12  drop_low_quality_clct_(conf.tmbParams().getParameter<bool>("dropLowQualityCLCTs")),
13  build_lct_from_alct_gem_(conf.tmbParams().getParameter<bool>("buildLCTfromALCTandGEM")),
14  build_lct_from_clct_gem_(conf.tmbParams().getParameter<bool>("buildLCTfromCLCTandGEM")) {
15  // case for ME1/1
16  if (isME11_) {
17  drop_low_quality_clct_me1a_ = conf.tmbParams().getParameter<bool>("dropLowQualityCLCTs_ME1a");
18  }
19 
20  alct_gem_bx_window_size_ = conf.tmbParams().getParameter<unsigned>("windowBXALCTGEM");
21  clct_gem_bx_window_size_ = conf.tmbParams().getParameter<unsigned>("windowBXCLCTGEM");
22 
23  assign_gem_csc_bending_ = conf.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.conf());
39 
40  cscGEMMatcher_ = std::make_unique<CSCGEMMatcher>(theRegion, theStation, theChamber, conf.tmbParams(), conf.conf());
41 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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, CSCBaseboard::Parameters &conf)
edm::ParameterSet const & tmbParams() const
Definition: CSCBaseboard.h:22
unsigned theChamber
Definition: CSCBaseboard.h:81
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const unsigned theStation
Definition: CSCBaseboard.h:75
std::shared_ptr< GEMClusterProcessor > clusterProc_
edm::ParameterSet const & conf() const
Definition: CSCBaseboard.h:18
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 clusterProc_.

Referenced by run().

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

◆ clusterProc()

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

Definition at line 58 of file CSCGEMMotherboard.h.

References clusterProc_.

Referenced by CSCTriggerPrimitivesBuilder::build().

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

◆ constructLCTsGEM() [1/4]

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

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

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

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

◆ constructLCTsGEM() [3/4]

void CSCGEMMotherboard::constructLCTsGEM ( const CSCCLCTDigi clct,
const GEMInternalCluster gem,
const CSCL1TPLookupTableME11ILT lookupTableME11ILT,
const CSCL1TPLookupTableME21ILT lookupTableME21ILT,
CSCCorrelatedLCTDigi lct 
) const
private

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

574  {
575  thisLCT.setValid(true);
576  thisLCT.setType(CSCCorrelatedLCTDigi::CLCT2GEM);
577  thisLCT.setQuality(qualityAssignment_->findQuality(clct, gem));
578  thisLCT.setCLCT(getBXShiftedCLCT(clct));
579  thisLCT.setGEM1(gem.mid1());
580  thisLCT.setGEM2(gem.mid2());
581  thisLCT.setPattern(encodePattern(clct.getPattern()));
582  thisLCT.setMPCLink(0);
583  thisLCT.setBX0(0);
584  thisLCT.setSyncErr(0);
585  thisLCT.setCSCID(theTrigChamber);
586  thisLCT.setTrknmb(0); // will be set later after sorting
587  thisLCT.setWireGroup(gem.getKeyWG());
588  thisLCT.setStrip(clct.getKeyStrip());
589  thisLCT.setBend(clct.getBend());
590  thisLCT.setBX(gem.bx());
591  if (runCCLUT_) {
592  thisLCT.setRun3(true);
594  gem.isValid()) { //calculate new slope from strip difference between CLCT and associated GEM
595  int slope = cscGEMMatcher_->calculateGEMCSCBending(clct, gem, lookupTableME11ILT, lookupTableME21ILT);
596  thisLCT.setSlope(abs(slope));
597  thisLCT.setBend(pow(-1, std::signbit(slope)));
598  thisLCT.setPattern(Run2PatternConverter(slope));
599  } else
600  thisLCT.setSlope(clct.getSlope());
601  thisLCT.setQuartStripBit(clct.getQuartStripBit());
602  thisLCT.setEighthStripBit(clct.getEighthStripBit());
603  thisLCT.setRun3Pattern(clct.getRun3Pattern());
604  }
605 }
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:78
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 608 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.

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

Definition at line 379 of file CSCGEMMotherboard.cc.

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

Referenced by matchALCTCLCTGEM().

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

414  {
415  // Sanity checks on ALCT, CLCT
416  if (!ALCT.isValid() or (ALCT.getQuality() == 0 and drop_low_quality_alct_)) {
417  LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM";
418  return;
419  }
420 
421  bool dropLowQualityCLCT = drop_low_quality_clct_;
423  dropLowQualityCLCT = drop_low_quality_clct_me1a_;
424 
425  if (!CLCT.isValid() or (CLCT.getQuality() <= 3 and dropLowQualityCLCT)) {
426  LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM";
427  return;
428  }
429 
430  // construct LCT
431  if (match_trig_enable() and doesALCTCrossCLCT(ALCT, CLCT)) {
432  constructLCTsGEM(ALCT, CLCT, lct);
433  }
434 }
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, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT, CSCCorrelatedLCTDigi &lct) const
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const
unsigned int match_trig_enable() const
static constexpr int MAX_HALF_STRIP_ME1B
Definition: CSCConstants.h:88

◆ correlateLCTsGEM() [3/4]

void CSCGEMMotherboard::correlateLCTsGEM ( const CSCCLCTDigi CLCT,
const GEMInternalClusters clusters,
const CSCL1TPLookupTableME11ILT lookupTableME11ILT,
const CSCL1TPLookupTableME21ILT lookupTableME21ILT,
CSCCorrelatedLCTDigi lct 
) const
private

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

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

◆ correlateLCTsGEM() [4/4]

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

Definition at line 470 of file CSCGEMMotherboard.cc.

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

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

◆ matchALCTCLCTGEM()

void CSCGEMMotherboard::matchALCTCLCTGEM ( const CSCL1TPLookupTableME11ILT lookupTableME11ILT,
const CSCL1TPLookupTableME21ILT lookupTableME21ILT 
)
private

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

104  {
105  // no matching is done for GE2/1 geometries with 8 eta partitions
106  // this has been superseded by 16-eta partition geometries
108  return;
109 
110  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
111  // Declaration of all LCTs for this BX:
112 
113  // ALCT + CLCT + GEM
114  CSCCorrelatedLCTDigi LCTbestAbestCgem, LCTbestAsecondCgem, LCTsecondAbestCgem, LCTsecondAsecondCgem;
115  // ALCT + CLCT
116  CSCCorrelatedLCTDigi LCTbestAbestC, LCTbestAsecondC, LCTsecondAbestC, LCTsecondAsecondC;
117  // CLCT + 2 GEM
118  CSCCorrelatedLCTDigi LCTbestCLCTgem, LCTsecondCLCTgem;
119  // ALCT + 2 GEM
120  CSCCorrelatedLCTDigi LCTbestALCTgem, LCTsecondALCTgem;
121 
122  // Construct all the LCTs, selection will come later:
123 
124  CSCALCTDigi bestALCT = alctProc->getBestALCT(bx_alct), secondALCT = alctProc->getSecondALCT(bx_alct);
125  CSCCLCTDigi bestCLCT, secondCLCT;
126  GEMInternalClusters clustersGEM;
127 
128  // Find best and second CLCTs by preferred CLCT BX, taking into account that there is an offset in the simulation
129 
130  unsigned matchingBX = 0;
131  unsigned matching_clctbx = 0;
132  unsigned bx_clct = 0;
133 
134  std::vector<unsigned> clctBx_qualbend_match;
135  sortCLCTByQualBend(bx_alct, clctBx_qualbend_match);
136 
137  bool hasLocalShower = false;
138  for (unsigned ibx = 1; ibx <= match_trig_window_size() / 2; ibx++)
139  hasLocalShower = (hasLocalShower or clctProc->getLocalShowerFlag(bx_alct - CSCConstants::ALCT_CLCT_OFFSET - ibx));
140  // BestCLCT and secondCLCT
141  for (unsigned mbx = 0; mbx < match_trig_window_size(); mbx++) {
142  //bx_clct_run2 would be overflow when bx_alct is small but it is okay
143  unsigned bx_clct_run2 = bx_alct + preferred_bx_match(mbx) - CSCConstants::ALCT_CLCT_OFFSET;
144  unsigned bx_clct_qualbend = clctBx_qualbend_match[mbx];
145  bx_clct = (sort_clct_bx() or not(hasLocalShower)) ? bx_clct_run2 : bx_clct_qualbend;
146 
147  if (bx_clct >= CSCConstants::MAX_CLCT_TBINS)
148  continue;
149  matchingBX = mbx;
150  matching_clctbx = mbx;
151 
152  if ((clctProc->getBestCLCT(bx_clct)).isValid())
153  break;
154  }
155 
156  bestCLCT = clctProc->getBestCLCT(bx_clct);
157  secondCLCT = clctProc->getSecondCLCT(bx_clct);
158 
159  if (!bestALCT.isValid() and !secondALCT.isValid() and !bestCLCT.isValid() and !secondCLCT.isValid())
160  continue;
161  if (!build_lct_from_clct_gem_ and !bestALCT.isValid())
162  continue;
163  if (!build_lct_from_alct_gem_ and !bestCLCT.isValid())
164  continue;
165 
166  if (infoV > 1)
167  LogTrace("CSCGEMMotherboard") << "GEMCSCOTMB: Successful ALCT-CLCT match: bx_alct = " << bx_alct
168  << "; bx_clct = " << matching_clctbx << "; mbx = " << matchingBX << " bestALCT "
169  << bestALCT << " secondALCT " << secondALCT << " bestCLCT " << bestCLCT
170  << " secondCLCT " << secondCLCT;
171  // ALCT + CLCT + GEM
172 
173  for (unsigned gmbx = 0; gmbx < alct_gem_bx_window_size_; gmbx++) {
174  unsigned bx_gem = bx_alct + preferred_bx_match(gmbx);
175  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::AllClusters);
176  if (!clustersGEM.empty()) {
177  correlateLCTsGEM(bestALCT, bestCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTbestAbestCgem);
178  correlateLCTsGEM(bestALCT, secondCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTbestAsecondCgem);
179  correlateLCTsGEM(secondALCT, bestCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTsecondAbestCgem);
181  secondALCT, secondCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTsecondAsecondCgem);
182  break;
183  }
184  }
185 
186  // ALCT + CLCT
187 
188  correlateLCTsGEM(bestALCT, bestCLCT, LCTbestAbestC);
189  correlateLCTsGEM(bestALCT, secondCLCT, LCTbestAsecondC);
190  correlateLCTsGEM(secondALCT, bestCLCT, LCTsecondAbestC);
191  correlateLCTsGEM(secondALCT, secondCLCT, LCTsecondAsecondC);
192 
193  // CLCT + 2 GEM
194 
196  unsigned bx_gem = bx_alct;
197 
198  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
199  correlateLCTsGEM(bestCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTbestCLCTgem);
200  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
201  correlateLCTsGEM(secondCLCT, clustersGEM, lookupTableME11ILT, lookupTableME21ILT, LCTsecondCLCTgem);
202  }
203 
204  // ALCT + 2 GEM
205 
207  for (unsigned gmbx = 0; gmbx < alct_gem_bx_window_size_; gmbx++) {
208  unsigned bx_gem = bx_alct + preferred_bx_match(gmbx);
209  clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters);
210  if (!clustersGEM.empty()) {
211  correlateLCTsGEM(bestALCT, clustersGEM, LCTbestALCTgem);
212  correlateLCTsGEM(secondALCT, clustersGEM, LCTsecondALCTgem);
213  break;
214  }
215  }
216  }
217 
218  // Select LCTs, following FW logic
219 
220  std::vector<CSCCorrelatedLCTDigi> selectedLCTs;
221 
222  // CASE => Only bestALCT is valid
223  if (bestALCT.isValid() and !secondALCT.isValid() and !bestCLCT.isValid() and !secondCLCT.isValid()) {
224  if (LCTbestALCTgem.isValid()) {
225  LCTbestALCTgem.setTrknmb(1);
226  allLCTs_(bx_alct, matchingBX, 0) = LCTbestALCTgem;
227  }
228  }
229 
230  // CASE => Only bestCLCT is valid
231  if (!bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
232  if (LCTbestCLCTgem.isValid()) {
233  LCTbestCLCTgem.setTrknmb(1);
234  allLCTs_(bx_alct, matchingBX, 0) = LCTbestCLCTgem;
235  }
236  }
237 
238  // CASE => bestALCT and bestCLCT are valid
239  if (bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
240  if (LCTbestAbestCgem.isValid()) {
241  LCTbestAbestCgem.setTrknmb(1);
242  allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestCgem;
243  } else if (LCTbestAbestC.isValid()) {
244  LCTbestAbestC.setTrknmb(1);
245  allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestC;
246  }
247  }
248 
249  // CASE => bestALCT, secondALCT, bestCLCT are valid
250  if (bestALCT.isValid() and secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) {
251  CSCCorrelatedLCTDigi lctbb, lctsb;
252  if (LCTbestAbestCgem.isValid())
253  lctbb = LCTbestAbestCgem;
254  else if (LCTbestAbestC.isValid())
255  lctbb = LCTbestAbestC;
256  if (LCTsecondAbestCgem.isValid())
257  lctsb = LCTsecondAbestCgem;
258  else if (LCTsecondAbestC.isValid())
259  lctsb = LCTsecondAbestC;
260 
261  if (lctbb.getQuality() >= lctsb.getQuality() and lctbb.isValid()) {
262  selectedLCTs.push_back(lctbb);
263  if (LCTsecondALCTgem.isValid() and build_lct_from_alct_gem_)
264  selectedLCTs.push_back(LCTsecondALCTgem);
265  else if (LCTsecondAbestC.isValid())
266  selectedLCTs.push_back(LCTsecondAbestC);
267  } else if (lctbb.getQuality() < lctsb.getQuality() and lctsb.isValid()) {
268  selectedLCTs.push_back(lctsb);
269  if (LCTbestALCTgem.isValid() and build_lct_from_alct_gem_)
270  selectedLCTs.push_back(LCTbestALCTgem);
271  else if (LCTbestAbestC.isValid())
272  selectedLCTs.push_back(LCTbestAbestC);
273  }
274 
275  sortLCTs(selectedLCTs);
276 
277  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
278  iLCT++) {
279  if (selectedLCTs[iLCT].isValid()) {
280  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
281  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
282  }
283  }
284  }
285 
286  // CASE => bestALCT, bestCLCT, secondCLCT are valid
287  if (bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and secondCLCT.isValid()) {
288  CSCCorrelatedLCTDigi lctbb, lctbs;
289  if (LCTbestAbestCgem.isValid())
290  lctbb = LCTbestAbestCgem;
291  else if (LCTbestAbestC.isValid())
292  lctbb = LCTbestAbestC;
293  if (LCTbestAsecondCgem.isValid())
294  lctbs = LCTbestAsecondCgem;
295  else if (LCTbestAsecondC.isValid())
296  lctbs = LCTbestAsecondC;
297 
298  if (lctbb.getQuality() >= lctbs.getQuality() and lctbb.isValid()) {
299  selectedLCTs.push_back(lctbb);
300  if (LCTsecondCLCTgem.isValid() and build_lct_from_clct_gem_)
301  selectedLCTs.push_back(LCTsecondCLCTgem);
302  else if (LCTbestAsecondC.isValid())
303  selectedLCTs.push_back(LCTbestAsecondC);
304  } else if (lctbb.getQuality() < lctbs.getQuality() and lctbs.isValid()) {
305  selectedLCTs.push_back(lctbs);
306  if (LCTbestCLCTgem.isValid() and build_lct_from_alct_gem_)
307  selectedLCTs.push_back(LCTbestCLCTgem);
308  else if (LCTbestAbestC.isValid())
309  selectedLCTs.push_back(LCTbestAbestC);
310  }
311 
312  sortLCTs(selectedLCTs);
313 
314  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
315  iLCT++) {
316  if (selectedLCTs[iLCT].isValid()) {
317  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
318  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
319  }
320  }
321  }
322 
323  // CASE => bestALCT, secondALCT, bestCLCT, secondCLCT are valid
324  if (bestALCT.isValid() and secondALCT.isValid() and bestCLCT.isValid() and secondCLCT.isValid()) {
325  CSCCorrelatedLCTDigi lctbb, lctbs, lctsb, lctss;
326 
327  // compute LCT bestA-bestC
328  if (LCTbestAbestCgem.isValid())
329  lctbb = LCTbestAbestCgem;
330  else if (LCTbestAbestC.isValid())
331  lctbb = LCTbestAbestC;
332 
333  // compute LCT bestA-secondC
334  if (LCTbestAsecondCgem.isValid())
335  lctbs = LCTbestAsecondCgem;
336  else if (LCTbestAsecondC.isValid())
337  lctbs = LCTbestAsecondC;
338 
339  if (lctbb.getQuality() >= lctbs.getQuality()) {
340  // push back LCT bestA-bestC
341  selectedLCTs.push_back(lctbb);
342 
343  // compute LCT secondA-secondC
344  if (LCTsecondAsecondCgem.isValid())
345  lctss = LCTsecondAsecondCgem;
346  else if (LCTsecondAsecondC.isValid())
347  lctss = LCTsecondAsecondC;
348 
349  // push back LCT secondA-secondC
350  selectedLCTs.push_back(lctss);
351  } else {
352  // push back LCT bestA-secondC
353  selectedLCTs.push_back(lctbs);
354 
355  // compute LCT secondA-bestC
356  if (LCTsecondAbestCgem.isValid())
357  lctsb = LCTsecondAbestCgem;
358  else if (LCTsecondAbestC.isValid())
359  lctsb = LCTsecondAbestC;
360 
361  // push back LCT secondA-bestC
362  selectedLCTs.push_back(lctsb);
363  }
364 
365  sortLCTs(selectedLCTs);
366 
367  for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC));
368  iLCT++) {
369  if (selectedLCTs[iLCT].isValid()) {
370  selectedLCTs[iLCT].setTrknmb(iLCT + 1);
371  allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT];
372  }
373  }
374  }
375  }
376 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
LCTContainer allLCTs_
int preferred_bx_match(unsigned int index) const
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
unsigned alct_gem_bx_window_size_
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
#define LogTrace(id)
void correlateLCTsGEM(const CSCALCTDigi &ALCT, const CSCCLCTDigi &CLCT, const GEMInternalClusters &clusters, const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT, CSCCorrelatedLCTDigi &lct) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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
unsigned int match_trig_window_size() const
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts) const
void sortCLCTByQualBend(int alct_bx, std::vector< unsigned > &clctBxVector)
std::shared_ptr< GEMClusterProcessor > clusterProc_
bool sort_clct_bx() const
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
if(threadIdxLocalY==0 &&threadIdxLocalX==0)

◆ run()

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

Definition at line 67 of file CSCGEMMotherboard.cc.

References clear(), clusterProc_, visDQMUpload::context, hasGE21Geometry16Partitions_, matchALCTCLCTGEM(), CSCMotherboard::runCommon(), and CSCMotherboard::selectLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

70  {
71  // Step 1: Setup
72  clear();
73 
74  // check for GEM geometry
75  if (context.gemGeometry_ == nullptr) {
76  edm::LogError("CSCGEMMotherboard") << "run() called for GEM-CSC integrated trigger without valid GEM geometry! \n";
77  return;
78  }
79 
80  // Step 2: Run the processors
81  CSCMotherboard::RunContext mbc{context.cscGeometry_,
82  context.lookupTableCCLUT_,
83  context.lookupTableME11ILT_,
84  context.lookupTableME21ILT_,
85  context.parameters_};
86  auto [alctV, clctV] = runCommon(wiredc, compdc, mbc);
87 
88  // if there are no ALCTs and no CLCTs, do not run the ALCT-CLCT correlation
89  if (alctV.empty() and clctV.empty())
90  return;
91 
92  // Step 3: run the GEM cluster processor to get the internal clusters
93  clusterProc_->run(gemClusters, context.lookupTableME11ILT_, context.lookupTableME21ILT_);
94  hasGE21Geometry16Partitions_ = clusterProc_->hasGE21Geometry16Partitions();
95 
96  // Step 4: ALCT-CLCT-GEM matching
97  matchALCTCLCTGEM(context.lookupTableME11ILT_, context.lookupTableME21ILT_);
98 
99  // Step 5: Select at most 2 LCTs per BX
100  selectLCTs();
101 }
std::tuple< std::vector< CSCALCTDigi >, std::vector< CSCCLCTDigi > > runCommon(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const RunContext &context)
Log< level::Error, false > LogError
std::shared_ptr< GEMClusterProcessor > clusterProc_
void matchALCTCLCTGEM(const CSCL1TPLookupTableME11ILT *lookupTableME11ILT, const CSCL1TPLookupTableME21ILT *lookupTableME21ILT)

◆ Run2PatternConverter()

uint16_t CSCGEMMotherboard::Run2PatternConverter ( const int  slope) const

Definition at line 48 of file CSCGEMMotherboard.cc.

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

Referenced by constructLCTsGEM().

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

◆ sortLCTs()

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

Definition at line 637 of file CSCGEMMotherboard.cc.

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

Referenced by matchALCTCLCTGEM().

637  {
638  // LCTs are sorted by quality. If there are two with the same quality, then the sorting is done by the slope
639  std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool {
640  if (lct1.getQuality() > lct2.getQuality())
641  return lct1.getQuality() > lct2.getQuality();
642  else if (lct1.getQuality() == lct2.getQuality())
643  return lct1.getSlope() < lct2.getSlope();
644  else
645  return false;
646  });
647 }
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 144 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchALCTCLCTGEM().

◆ assign_gem_csc_bending_

bool CSCGEMMotherboard::assign_gem_csc_bending_
private

Definition at line 148 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 140 of file CSCGEMMotherboard.h.

Referenced by matchALCTCLCTGEM().

◆ build_lct_from_clct_gem_

bool CSCGEMMotherboard::build_lct_from_clct_gem_
private

Definition at line 141 of file CSCGEMMotherboard.h.

Referenced by matchALCTCLCTGEM().

◆ clct_gem_bx_window_size_

unsigned CSCGEMMotherboard::clct_gem_bx_window_size_
private

Definition at line 145 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

◆ clusterProc_

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

Definition at line 131 of file CSCGEMMotherboard.h.

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

◆ clusters_

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

Definition at line 125 of file CSCGEMMotherboard.h.

◆ cscGEMMatcher_

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

Definition at line 128 of file CSCGEMMotherboard.h.

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

◆ drop_low_quality_alct_

bool CSCGEMMotherboard::drop_low_quality_alct_
private

Definition at line 134 of file CSCGEMMotherboard.h.

Referenced by correlateLCTsGEM().

◆ drop_low_quality_clct_

bool CSCGEMMotherboard::drop_low_quality_clct_
private

Definition at line 135 of file CSCGEMMotherboard.h.

Referenced by correlateLCTsGEM().

◆ drop_low_quality_clct_me1a_

bool CSCGEMMotherboard::drop_low_quality_clct_me1a_
private

Definition at line 137 of file CSCGEMMotherboard.h.

Referenced by correlateLCTsGEM(), and CSCGEMMotherboard().

◆ gemId

unsigned CSCGEMMotherboard::gemId
private

Chamber id (trigger-type labels).

Definition at line 122 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

◆ hasGE21Geometry16Partitions_

bool CSCGEMMotherboard::hasGE21Geometry16Partitions_
private

Definition at line 152 of file CSCGEMMotherboard.h.

Referenced by matchALCTCLCTGEM(), and run().