CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCGEMMotherboardME11 Class Reference

#include <CSCGEMMotherboardME11.h>

Inheritance diagram for CSCGEMMotherboardME11:
CSCGEMMotherboard CSCUpgradeMotherboard CSCMotherboard

Public Member Functions

 CSCGEMMotherboardME11 (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCGEMMotherboardME11 ()
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs1a () const
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs1b () const
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads) override
 
 ~CSCGEMMotherboardME11 () override
 
- Public Member Functions inherited from CSCGEMMotherboard
template<class S >
S bestMatchingPad (const CSCALCTDigi &alct1, const matches< S > &pads) const
 
template<class S >
S bestMatchingPad (const CSCCLCTDigi &clct, const matches< S > &pads) const
 
template<class S >
S bestMatchingPad (const CSCALCTDigi &alct1, const CSCCLCTDigi &clct1, const matches< S > &pads) const
 
void clear ()
 
 CSCGEMMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCGEMMotherboard ()
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads)
 
void setGEMGeometry (const GEMGeometry *g)
 set CSC and GEM geometries for the matching needs More...
 
 ~CSCGEMMotherboard () override
 
- Public Member Functions inherited from CSCUpgradeMotherboard
void clear ()
 
template<class S >
bool compare (const S &p, const S &q) const
 
 CSCUpgradeMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCUpgradeMotherboard ()
 
void debugLUTs ()
 
enum CSCPart getCSCPart (int keystrip) const
 
template<class S >
void intersection (const S &d1, const S &d2, S &result) const
 
void setupGeometry ()
 
void sortLCTs (std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
 
 ~CSCUpgradeMotherboard () override
 
- Public Member Functions inherited from CSCMotherboard
void clear ()
 
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboard ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs () const
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCMotherboard ()=default
 

Private Member Functions

void correlateLCTsGEM (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMPadDigiIds &pads, const GEMCoPadDigiIds &copads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
bool doesALCTCrossCLCT (const CSCALCTDigi &a, const CSCCLCTDigi &c) const
 
const CSCGEMMotherboardLUTME11getLUT () const override
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs (enum CSCPart me1ab) const
 
void sortLCTs (std::vector< CSCCorrelatedLCTDigi > &, int bx, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
 
void sortLCTs (std::vector< CSCCorrelatedLCTDigi > &, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
 

Private Attributes

bool buildLCTfromALCTandGEM_ME1a_
 
bool buildLCTfromALCTandGEM_ME1b_
 
bool buildLCTfromCLCTandGEM_ME1a_
 
bool buildLCTfromCLCTandGEM_ME1b_
 
std::vector< CSCCLCTDigiclctV
 
std::unique_ptr< CSCMotherboardLUTME11cscTmbLUT_
 
bool dropLowQualityALCTsNoGEMs_ME1a_
 
bool dropLowQualityALCTsNoGEMs_ME1b_
 
bool dropLowQualityCLCTsNoGEMs_ME1a_
 
bool dropLowQualityCLCTsNoGEMs_ME1b_
 
bool promoteCLCTGEMquality_ME1a_
 
bool promoteCLCTGEMquality_ME1b_
 
std::unique_ptr< CSCGEMMotherboardLUTME11tmbLUT_
 

Additional Inherited Members

- Public Types inherited from CSCGEMMotherboard
enum  Default_values { DEFAULT_MATCHING_VALUE = -99 }
 
- Static Public Member Functions inherited from CSCUpgradeMotherboard
static bool sortLCTsByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortLCTsByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
- Public Attributes inherited from CSCGEMMotherboard
std::unique_ptr< GEMCoPadProcessorcoPadProcessor
 
- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralctProc
 
std::unique_ptr< CSCCathodeLCTProcessorclctProc
 
- Protected Types inherited from CSCMotherboard
enum  LCT_Quality {
  INVALID = 0, NO_CLCT = 1, NO_ALCT = 2, CLCT_LAYER_TRIGGER = 3,
  LOW_QUALITY = 4, MARGINAL_ANODE_CATHODE = 5, HQ_ANODE_MARGINAL_CATHODE = 6, HQ_CATHODE_MARGINAL_ANODE = 7,
  HQ_ACCEL_ALCT = 8, HQ_RESERVED_1 = 9, HQ_RESERVED_2 = 10, HQ_PATTERN_2_3 = 11,
  HQ_PATTERN_4_5 = 12, HQ_PATTERN_6_7 = 13, HQ_PATTERN_8_9 = 14, HQ_PATTERN_10 = 15
}
 
- Protected Member Functions inherited from CSCGEMMotherboard
template<class T >
T bestMatchingPad (const CSCALCTDigi &, const matches< T > &) const
 
template<class T >
T bestMatchingPad (const CSCCLCTDigi &, const matches< T > &) const
 
template<class T >
T bestMatchingPad (const CSCALCTDigi &, const CSCCLCTDigi &, const matches< T > &) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem1, const GEMCoPadDigi &gem2, int i) const
 
template<class T >
void correlateLCTsGEM (T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
template<class T >
void correlateLCTsGEM (const T &best, const T &second, const GEMCoPadDigi &, const GEMCoPadDigi &, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
unsigned int findQualityGEM (const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer) const
 
int getBX (const GEMPadDigi &p) const
 
int getBX (const GEMCoPadDigi &p) const
 
float getPad (const GEMPadDigi &) const
 
float getPad (const GEMCoPadDigi &) const
 
float getPad (const CSCCLCTDigi &, enum CSCPart par) const
 
int getRoll (const GEMPadDigiId &p) const
 
int getRoll (const GEMCoPadDigiId &p) const
 
int getRoll (const CSCALCTDigi &) const
 
bool isGEMDetId (unsigned int) const
 
bool isPadInOverlap (int roll) const
 
template<class T >
void matchingPads (const CSCALCTDigi &alct, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &alct, matches< T > &) const
 
template<class S , class T >
void matchingPads (const S &d1, const S &d2, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &clct1, const CSCALCTDigi &alct1, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &clct1, const CSCCLCTDigi &clct2, const CSCALCTDigi &alct1, const CSCALCTDigi &alct2, matches< T > &) const
 
void printGEMTriggerCoPads (int bx_start, int bx_stop, enum CSCPart)
 
void printGEMTriggerPads (int bx_start, int bx_stop, enum CSCPart)
 
void retrieveGEMCoPads ()
 
void retrieveGEMPads (const GEMPadDigiCollection *pads, unsigned id)
 
void setupGeometry ()
 
- Protected Member Functions inherited from CSCUpgradeMotherboard
void setPrefIndex ()
 
- Protected Member Functions inherited from CSCMotherboard
void checkConfigParameters ()
 
CSCCorrelatedLCTDigi constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
 
void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, int type)
 
void dumpConfigParams () const
 
unsigned int encodePattern (const int clctPattern) const
 
unsigned int findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) const
 
- Protected Attributes inherited from CSCGEMMotherboard
GEMCoPadDigiIdsBX coPads_
 
bool doLCTGhostBustingWithGEMs_
 
const GEMGeometrygem_g
 
std::vector< GEMCoPadDigigemCoPadV
 
bool gemGeometryAvailable
 
unsigned gemId
 
int maxDeltaBXCoPad_
 
int maxDeltaBXPad_
 
int maxDeltaPadL1_
 
int maxDeltaPadL2_
 
GEMPadDigiIdsBX pads_
 
bool promoteALCTGEMpattern_
 
bool promoteALCTGEMquality_
 
bool promoteCLCTGEMquality_
 
bool useOldLCTDataFormat_
 
- Protected Attributes inherited from CSCUpgradeMotherboard
LCTContainer allLCTs
 
const CSCChambercscChamber
 
bool debug_luts
 
bool debug_matching
 
bool disableME1a
 
bool gangedME1a
 
std::unique_ptr< CSCUpgradeMotherboardLUTGeneratorgenerator_
 
bool match_earliest_alct_only
 
bool match_earliest_clct_only
 
unsigned int max_lcts
 
Parity par
 
int pref [CSCConstants::MAX_LCT_TBINS]
 
unsigned theChamber
 
unsigned theRegion
 
unsigned int tmb_cross_bx_algo
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
unsigned int alctClctOffset
 
edm::ParameterSet alctParams_
 
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
edm::ParameterSet clctParams_
 
std::vector< CSCCLCTDigiclctV
 
edm::ParameterSet commonParams_
 
const CSCGeometrycsc_g
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
int infoV
 
bool isSLHC_
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
bool readout_earliest_2
 
bool runME11ILT_
 
bool runME21ILT_
 
bool runME3141ILT_
 
CSCCorrelatedLCTDigi secondLCT [CSCConstants::MAX_LCT_TBINS]
 
const unsigned theEndcap
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
unsigned int tmb_l1a_window_size
 
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

Extended CSCMotherboard for ME11 TMB upgrade

Author
Sven Dildick March 2014

Based on CSCMotherboard code

Definition at line 16 of file CSCGEMMotherboardME11.h.

Constructor & Destructor Documentation

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

Normal constructor.

Definition at line 3 of file CSCGEMMotherboardME11.cc.

References cscTmbLUT_, CSCMotherboard::isSLHC_, and tmbLUT_.

7  : CSCGEMMotherboard(endcap, station, sector, subsector, chamber, conf)
8  // special configuration parameters for ME11 treatment
9  , dropLowQualityCLCTsNoGEMs_ME1a_(tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1a"))
10  , dropLowQualityCLCTsNoGEMs_ME1b_(tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1b"))
11  , dropLowQualityALCTsNoGEMs_ME1a_(tmbParams_.getParameter<bool>("dropLowQualityALCTsNoGEMs_ME1a"))
12  , dropLowQualityALCTsNoGEMs_ME1b_(tmbParams_.getParameter<bool>("dropLowQualityALCTsNoGEMs_ME1b"))
13  , buildLCTfromALCTandGEM_ME1a_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM_ME1a"))
14  , buildLCTfromALCTandGEM_ME1b_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM_ME1b"))
15  , buildLCTfromCLCTandGEM_ME1a_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM_ME1a"))
16  , buildLCTfromCLCTandGEM_ME1b_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM_ME1b"))
17  , promoteCLCTGEMquality_ME1a_(tmbParams_.getParameter<bool>("promoteCLCTGEMquality_ME1a"))
18  , promoteCLCTGEMquality_ME1b_(tmbParams_.getParameter<bool>("promoteCLCTGEMquality_ME1b"))
19 {
20  if (!isSLHC_) edm::LogError("CSCGEMMotherboardME11|ConfigError")
21  << "+++ Upgrade CSCGEMMotherboardME11 constructed while isSLHC is not set! +++\n";
22 
23  // set LUTs
24  tmbLUT_.reset(new CSCGEMMotherboardLUTME11());
25  cscTmbLUT_.reset(new CSCMotherboardLUTME11());
26 }
T getParameter(std::string const &) const
edm::ParameterSet tmbParams_
std::unique_ptr< CSCMotherboardLUTME11 > cscTmbLUT_
std::unique_ptr< CSCGEMMotherboardLUTME11 > tmbLUT_
CSCGEMMotherboardME11::CSCGEMMotherboardME11 ( )

Constructor for use during testing.

Definition at line 29 of file CSCGEMMotherboardME11.cc.

References CSCMotherboard::isSLHC_.

29  :
31 {
32  // Constructor used only for testing.
33  if (!isSLHC_) edm::LogError("CSCGEMMotherboardME11|ConfigError")
34  << "+++ Upgrade CSCGEMMotherboardME11 constructed while isSLHC is not set! +++\n";
35 }
CSCGEMMotherboardME11::~CSCGEMMotherboardME11 ( )
override

Default destructor.

Definition at line 38 of file CSCGEMMotherboardME11.cc.

39 {
40 }

Member Function Documentation

void CSCGEMMotherboardME11::correlateLCTsGEM ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
const GEMPadDigiIds pads,
const GEMCoPadDigiIds copads,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
private

Definition at line 437 of file CSCGEMMotherboardME11.cc.

References CSCCorrelatedLCTDigi::ALCTCLCT, CSCTriggerNumbering::chamberFromTriggerLabels(), CSCCLCTDigi::clear(), CSCALCTDigi::clear(), CSCMotherboard::constructLCTs(), CSCGEMMotherboard::constructLCTsGEM(), doesALCTCrossCLCT(), GEMCoPadDigi::isValid(), CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), LogTrace, lumiPlot::lut, CSCMotherboard::theEndcap, CSCMotherboard::theSector, CSCMotherboard::theStation, CSCMotherboard::theSubsector, and CSCMotherboard::theTrigChamber.

Referenced by run().

445 {
446  CSCALCTDigi bestALCT = bALCT;
447  CSCALCTDigi secondALCT = sALCT;
448  CSCCLCTDigi bestCLCT = bCLCT;
449  CSCCLCTDigi secondCLCT = sCLCT;
450 
451  // assume that always anodeBestValid and cathodeBestValid
452  if (secondALCT == bestALCT) secondALCT.clear();
453  if (secondCLCT == bestCLCT) secondCLCT.clear();
454 
455  const bool ok_bb = bestALCT.isValid() and bestCLCT.isValid();
456  const bool ok_bs = bestALCT.isValid() and secondCLCT.isValid();
457  const bool ok_sb = secondALCT.isValid() and bestCLCT.isValid();
458  const bool ok_ss = secondALCT.isValid() and secondCLCT.isValid();
459 
460  const int ok11 = doesALCTCrossCLCT( bestALCT, bestCLCT);
461  const int ok12 = doesALCTCrossCLCT( bestALCT, secondCLCT);
462  const int ok21 = doesALCTCrossCLCT( secondALCT, bestCLCT);
463  const int ok22 = doesALCTCrossCLCT( secondALCT, secondCLCT);
464  const int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
465 
466  int dbg=0;
468  CSCDetId did(theEndcap, theStation, 1, chamb, 0);
469  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"debug correlateLCTs in ME11"<<did<< "\n"
470  <<"ALCT1: "<<bestALCT<<"\n"
471  <<"ALCT2: "<<secondALCT<<"\n"
472  <<"CLCT1: "<<bestCLCT<<"\n"
473  <<"CLCT2: "<<secondCLCT<<"\n"
474  <<"ok 11 12 21 22 code = "<<ok11<<" "<<ok12<<" "<<ok21<<" "<<ok22<<" "<<code<<std::endl;
475 
476  if ( code==0 ) return;
477 
478  // LUT defines correspondence between possible ok## combinations
479  // and resulting lct1 and lct2
480  int lut[16][2] = {
481  //ok: 11 12 21 22
482  {0 ,0 }, // 0 0 0 0
483  {22,0 }, // 0 0 0 1
484  {21,0 }, // 0 0 1 0
485  {21,22}, // 0 0 1 1
486  {12,0 }, // 0 1 0 0
487  {12,22}, // 0 1 0 1
488  {12,21}, // 0 1 1 0
489  {12,21}, // 0 1 1 1
490  {11,0 }, // 1 0 0 0
491  {11,22}, // 1 0 0 1
492  {11,21}, // 1 0 1 0
493  {11,22}, // 1 0 1 1
494  {11,12}, // 1 1 0 0
495  {11,22}, // 1 1 0 1
496  {11,12}, // 1 1 1 0
497  {11,22}, // 1 1 1 1
498  };
499 
500  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lut 0 1 = "<<lut[code][0]<<" "<<lut[code][1]<<std::endl;
501 
502  // check matching copads
503  const GEMCoPadDigi& bb_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, bestCLCT, copads);
504  const GEMCoPadDigi& bs_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, secondCLCT, copads);
505  const GEMCoPadDigi& sb_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, bestCLCT, copads);
506  const GEMCoPadDigi& ss_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, secondCLCT, copads);
507 
508  // check matching pads
509  const GEMPadDigi& bb_pad = bestMatchingPad<GEMPadDigi>(bestALCT, bestCLCT, pads);
510  const GEMPadDigi& bs_pad = bestMatchingPad<GEMPadDigi>(bestALCT, secondCLCT, pads);
511  const GEMPadDigi& sb_pad = bestMatchingPad<GEMPadDigi>(secondALCT, bestCLCT, pads);
512  const GEMPadDigi& ss_pad = bestMatchingPad<GEMPadDigi>(secondALCT, secondCLCT, pads);
513 
514  // evaluate possible combinations
515  const bool ok_bb_copad = ok11==1 and ok_bb and bb_copad.isValid();
516  const bool ok_bs_copad = ok12==1 and ok_bs and bs_copad.isValid();
517  const bool ok_sb_copad = ok21==1 and ok_sb and sb_copad.isValid();
518  const bool ok_ss_copad = ok22==1 and ok_ss and ss_copad.isValid();
519 
520  const bool ok_bb_pad = (not ok_bb_copad) and ok11==1 and ok_bb and bb_pad.isValid();
521  const bool ok_bs_pad = (not ok_bs_copad) and ok12==1 and ok_bs and bs_pad.isValid();
522  const bool ok_sb_pad = (not ok_sb_copad) and ok21==1 and ok_sb and sb_pad.isValid();
523  const bool ok_ss_pad = (not ok_ss_copad) and ok22==1 and ok_ss and ss_pad.isValid();
524 
525  switch (lut[code][0]) {
526  case 11:
527  if (ok_bb_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, bestCLCT, bb_copad, 1);
528  else if (ok_bb_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, bestCLCT, bb_pad, 1);
529  else lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
530  break;
531  case 12:
532  if (ok_bs_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_copad, 1);
533  else if (ok_bs_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_pad, 1);
534  else lct1 = constructLCTs(bestALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
535  break;
536  case 21:
537  if (ok_sb_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_copad, 1);
538  else if (ok_sb_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_pad, 1);
539  else lct1 = constructLCTs(secondALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
540  break;
541  case 22:
542  if (ok_ss_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, ss_copad, 1);
543  else if (ok_ss_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, ss_pad, 1);
544  else lct1 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
545  break;
546  default:
547  return;
548  }
549 
550  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lct1: "<<lct1<<std::endl;
551 
552  switch (lut[code][1]){
553  case 12:
554  if (ok_bs_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_copad, 2);
555  else if (ok_bs_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_pad, 2);
556  else lct2 = constructLCTs(bestALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
557  break;
558  case 21:
559  if (ok_sb_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_copad, 2);
560  else if (ok_sb_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_pad, 2);
561  else lct2 = constructLCTs(secondALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
562  break;
563  case 22:
564  if (ok_bb_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, bb_copad, 2);
565  else if (ok_bb_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, bb_pad, 2);
566  else lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
567  break;
568  default:
569  return;
570  }
571 
572  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lct2: "<<lct2<<std::endl;
573 
574  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"out of correlateLCTs"<<std::endl;
575  return;
576 }
const unsigned theSector
const unsigned theTrigChamber
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
const unsigned theEndcap
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:35
bool doesALCTCrossCLCT(const CSCALCTDigi &a, const CSCCLCTDigi &c) const
bool isValid() const
Definition: GEMCoPadDigi.cc:32
const unsigned theStation
const unsigned theSubsector
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
#define LogTrace(id)
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:58
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
bool CSCGEMMotherboardME11::doesALCTCrossCLCT ( const CSCALCTDigi a,
const CSCCLCTDigi c 
) const
private

Definition at line 431 of file CSCGEMMotherboardME11.cc.

References cscTmbLUT_, CSCUpgradeMotherboard::gangedME1a, and CSCMotherboard::theEndcap.

Referenced by correlateLCTsGEM().

432 {
433  return cscTmbLUT_->doesALCTCrossCLCT(a, c, theEndcap, gangedME1a);
434 }
const unsigned theEndcap
std::unique_ptr< CSCMotherboardLUTME11 > cscTmbLUT_
const CSCGEMMotherboardLUTME11* CSCGEMMotherboardME11::getLUT ( ) const
inlineoverrideprivatevirtual

Implements CSCGEMMotherboard.

Definition at line 44 of file CSCGEMMotherboardME11.h.

References tmbLUT_.

44 {return tmbLUT_.get();}
std::unique_ptr< CSCGEMMotherboardLUTME11 > tmbLUT_
std::vector< CSCCorrelatedLCTDigi > CSCGEMMotherboardME11::readoutLCTs ( enum CSCPart  me1ab) const
private

Definition at line 344 of file CSCGEMMotherboardME11.cc.

References CSCUpgradeMotherboard::allLCTs, CSCMotherboard::early_tbins, CSCUpgradeMotherboard::LCTContainer::getMatched(), LogTrace, CSCConstants::MAX_HALF_STRIP_ME1B, ME1A, ME1B, or, CSCMotherboard::readout_earliest_2, sortLCTs(), CSCUpgradeMotherboard::sortLCTsByGEMDphi(), CSCUpgradeMotherboard::sortLCTsByQuality(), CSCUpgradeMotherboard::tmb_cross_bx_algo, and CSCMotherboard::tmb_l1a_window_size.

345 {
346  std::vector<CSCCorrelatedLCTDigi> tmpV;
347 
348  // The start time of the L1A*LCT coincidence window should be related
349  // to the fifo_pretrig parameter, but I am not completely sure how.
350  // Just choose it such that the window is centered at bx=7. This may
351  // need further tweaking if the value of tmb_l1a_window_size changes.
352  //static int early_tbins = 4;
353  // The number of LCT bins in the read-out is given by the
354  // tmb_l1a_window_size parameter, forced to be odd
355  const int lct_bins =
357  const int late_tbins = early_tbins + lct_bins;
358 
359  // Start from the vector of all found correlated LCTs and select
360  // those within the LCT*L1A coincidence window.
361  int bx_readout = -1;
362  std::vector<CSCCorrelatedLCTDigi> all_lcts;
363  switch(tmb_cross_bx_algo){
364  case 0: case 1:
365  allLCTs.getMatched(all_lcts);
366  break;
368  break;
370  break;
371  default: LogTrace("CSCGEMCMotherboardME11")<<"tmb_cross_bx_algo error" <<std::endl;
372  break;
373  }
374 
375  for (const auto& lct: all_lcts)
376  {
377  if (!lct.isValid()) continue;
378 
379  int bx = lct.getBX();
380  // Skip LCTs found too early relative to L1Accept.
381  if (bx <= early_tbins) continue;
382 
383  // Skip LCTs found too late relative to L1Accept.
384  if (bx > late_tbins) continue;
385 
386  if ((me1ab == CSCPart::ME1B and lct.getStrip() > CSCConstants::MAX_HALF_STRIP_ME1B ) or (me1ab == CSCPart::ME1A and lct.getStrip() <= CSCConstants::MAX_HALF_STRIP_ME1B))
387  continue;
388 
389  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
390  // in digi->raw step, LCTs have to be packed into the TMB header, and
391  // currently there is room just for two.
392  if (readout_earliest_2 and (bx_readout == -1 or bx == bx_readout) )
393  {
394  tmpV.push_back(lct);
395  if (bx_readout == -1) bx_readout = bx;
396  }
397  else tmpV.push_back(lct);
398  }
399  return tmpV;
400 }
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &, int bx, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
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
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
unsigned int tmb_l1a_window_size
#define LogTrace(id)
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
std::vector< CSCCorrelatedLCTDigi > CSCGEMMotherboardME11::readoutLCTs1a ( ) const

Definition at line 329 of file CSCGEMMotherboardME11.cc.

References ME1A, and CSCMotherboard::readoutLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build(), and run().

330 {
331  return readoutLCTs(ME1A);
332 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
std::vector< CSCCorrelatedLCTDigi > CSCGEMMotherboardME11::readoutLCTs1b ( ) const

Definition at line 335 of file CSCGEMMotherboardME11.cc.

References ME1B, and CSCMotherboard::readoutLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build(), and run().

336 {
337  return readoutLCTs(ME1B);
338 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
void CSCGEMMotherboardME11::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiCollection gemPads 
)
overridevirtual

Run function for normal usage. Runs cathode and anode LCT processors, takes results and correlates into CorrelatedLCT.

Implements CSCGEMMotherboard.

Definition at line 50 of file CSCGEMMotherboardME11.cc.

References CSCMotherboard::alctClctOffset, CSCMotherboard::alctProc, CSCMotherboard::alctV, CSCUpgradeMotherboard::allLCTs, b, buildLCTfromALCTandGEM_ME1b_, buildLCTfromCLCTandGEM_ME1b_, CSCMotherboard::clctProc, clctV, CSCGEMMotherboard::clear(), CSCGEMMotherboard::coPadProcessor, CSCGEMMotherboard::coPads_, correlateLCTsGEM(), CSCGEMMotherboard::correlateLCTsGEM(), CSCMotherboard::csc_g, CSCUpgradeMotherboard::cscChamber, CSCUpgradeMotherboard::debug_matching, CSCUpgradeMotherboard::debugLUTs(), CSCMotherboard::drop_used_clcts, dropLowQualityCLCTsNoGEMs_ME1b_, CSCGEMMotherboard::gem_g, CSCGEMMotherboard::gemCoPadV, CSCGEMMotherboard::gemGeometryAvailable, CSCGEMMotherboard::gemId, CSCChamber::id(), CSCMotherboard::infoV, CSCMotherboard::isSLHC_, LogTrace, CSCUpgradeMotherboard::match_earliest_clct_only, CSCMotherboard::match_trig_window_size, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, CSCGEMMotherboard::maxDeltaBXCoPad_, ME11, or, AlCaHLTBitMon_ParallelJobs::p, CSCGEMMotherboard::pads_, CSCGEMMotherboard::printGEMTriggerCoPads(), CSCGEMMotherboard::printGEMTriggerPads(), jets_cff::quality, readoutLCTs1a(), readoutLCTs1b(), CSCGEMMotherboard::retrieveGEMCoPads(), CSCGEMMotherboard::retrieveGEMPads(), CSCGEMMotherboard::setupGeometry(), and CSCUpgradeMotherboard::tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build().

53 {
55  setupGeometry();
56  debugLUTs();
57 
58  if (gem_g != nullptr) {
59  if (infoV >= 0) edm::LogInfo("CSCGEMMotherboardME11|SetupInfo")
60  << "+++ run() called for GEM-CSC integrated trigger! +++ \n";
61  gemGeometryAvailable = true;
62  }
63 
64  // check for GEM geometry
65  if (not gemGeometryAvailable){
66  if (infoV >= 0) edm::LogError("CSCGEMMotherboardME11|SetupError")
67  << "+++ run() called for GEM-CSC integrated trigger without valid GEM geometry! +++ \n";
68  return;
69  }
70  gemCoPadV = coPadProcessor->run(gemPads); // run copad processor in GE1/1
71 
72  if (!( alctProc and clctProc and isSLHC_))
73  {
74  if (infoV >= 0) edm::LogError("CSCGEMMotherboardME11|SetupError")
75  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
76  return;
77  }
78 
79  alctProc->setCSCGeometry(csc_g);
80  clctProc->setCSCGeometry(csc_g);
81 
82  alctV = alctProc->run(wiredc); // run anodeLCT
83  clctV = clctProc->run(compdc); // run cathodeLCT
84 
85  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
86  if (alctV.empty() and clctV.empty()) return;
87 
88  LogTrace("CSCGEMCMotherboardME11") <<"ALL ALCTs from ME11 "<< std::endl;
89  for (const auto& alct : alctV)
90  if (alct.isValid())
91  LogTrace("CSCGEMCMotherboardME11") << alct << std::endl;
92 
93  LogTrace("CSCGEMCMotherboardME11") <<"ALL CLCTs from ME11 "<< std::endl;
94  for (const auto& clct : clctV)
95  if (clct.isValid())
96  LogTrace("CSCGEMCMotherboardME11") << clct << std::endl;
97 
98  int used_clct_mask[20];
99  for (int b=0;b<20;b++)
100  used_clct_mask[b] = 0;
101 
102  retrieveGEMPads(gemPads, gemId);
104 
105  const bool hasPads(!pads_.empty());
106  const bool hasCoPads(hasPads and !coPads_.empty());
107 
108  // ALCT-centric matching
109  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++)
110  {
111  if (alctProc->bestALCT[bx_alct].isValid())
112  {
113  const int bx_clct_start(bx_alct - match_trig_window_size/2 - alctClctOffset);
114  const int bx_clct_stop(bx_alct + match_trig_window_size/2 - alctClctOffset);
115  const int bx_copad_start(bx_alct - maxDeltaBXCoPad_);
116  const int bx_copad_stop(bx_alct + maxDeltaBXCoPad_);
117 
118  if (debug_matching){
119  LogTrace("CSCGEMCMotherboardME11") << "========================================================================\n"
120  << "ALCT-CLCT matching in ME1/1 chamber: " << cscChamber->id() << "\n"
121  << "------------------------------------------------------------------------\n"
122  << "+++ Best ALCT Details: " << alctProc->bestALCT[bx_alct] << "\n"
123  << "+++ Second ALCT Details: " << alctProc->secondALCT[bx_alct] << std::endl;
124 
125  printGEMTriggerPads(bx_clct_start, bx_clct_stop, CSCPart::ME11);
126  printGEMTriggerCoPads(bx_clct_start, bx_clct_stop, CSCPart::ME11);
127 
128  LogTrace("CSCGEMCMotherboardME11") << "------------------------------------------------------------------------ \n"
129  << "Attempt ALCT-CLCT matching in ME1/b in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
130  }
131 
132  // ALCT-to-CLCT matching in ME1b
133  int nSuccesFulMatches = 0;
134  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
135  {
136  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
137  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
138  if (clctProc->bestCLCT[bx_clct].isValid())
139  {
140  const int quality(clctProc->bestCLCT[bx_clct].getQuality());
141  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++Valid ME1b CLCT: " << clctProc->bestCLCT[bx_clct] << std::endl;
142 
143  // pick the pad that corresponds
144  matches<GEMPadDigi> mPads;
145  matchingPads<GEMPadDigi>(clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct],
146  alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct], mPads);
147  matches<GEMCoPadDigi> mCoPads;
148  matchingPads<GEMCoPadDigi>(clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct],
149  alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct], mCoPads);
150 
151  // Low quality LCTs have at most 3 layers. Check if there is a matching GEM pad to keep the CLCT
152  if (dropLowQualityCLCTsNoGEMs_ME1b_ and quality < 4 and hasPads){
153  int nFound(mPads.size());
154  // these halfstrips (1,2,3,4) and (125,126,127,128) do not have matching GEM pads because GEM chambers are slightly wider than CSCs
155  const bool clctInEdge(clctProc->bestCLCT[bx_clct].getKeyStrip() < 5 or clctProc->bestCLCT[bx_clct].getKeyStrip() > 124);
156  if (clctInEdge){
157  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT in CSC chamber edge, don't care about GEM pads" << std::endl;
158  }
159  else {
160  if (nFound != 0){
161  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT with " << nFound << " matching GEM trigger pads" << std::endl;
162  }
163  else {
164  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tWarning: low quality CLCT without matching GEM trigger pad" << std::endl;
165  continue;
166  }
167  }
168  }
169 
170  ++nSuccesFulMatches;
171 
172  // if (infoV > 1) LogTrace("CSCMotherboard")
173  int mbx = bx_clct-bx_clct_start;
174  correlateLCTsGEM(alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct],
175  clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct],
176  mPads, mCoPads,
177  allLCTs(bx_alct,mbx,0), allLCTs(bx_alct,mbx,1));
178  if (debug_matching ) {
179  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-CLCT match in ME1b: bx_alct = " << bx_alct
180  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
181  << "]; bx_clct = " << bx_clct << "\n"
182  << "+++ Best CLCT Details: " << clctProc->bestCLCT[bx_clct] << "\n"
183  << "+++ Second CLCT Details: " << clctProc->secondCLCT[bx_clct] << std::endl;
184  if (allLCTs(bx_alct,mbx,0).isValid())
185  LogTrace("CSCGEMCMotherboardME11") << "LCT #1 "<< allLCTs(bx_alct,mbx,0) << std::endl;
186  else
187  LogTrace("CSCGEMCMotherboardME11") << "No valid LCT is built from ALCT-CLCT matching in ME1b" << std::endl;
188  if (allLCTs(bx_alct,mbx,1).isValid())
189  LogTrace("CSCGEMCMotherboardME11") << "LCT #2 "<< allLCTs(bx_alct,mbx,1) << std::endl;
190  }
191 
192  if (allLCTs(bx_alct,mbx,0).isValid()) {
193  used_clct_mask[bx_clct] += 1;
194  if (match_earliest_clct_only) break;
195  }
196  }
197  }
198 
199  // ALCT-to-GEM matching in ME1b
200  int nSuccesFulGEMMatches = 0;
201  if (nSuccesFulMatches==0 and buildLCTfromALCTandGEM_ME1b_){
202  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++No valid ALCT-CLCT matches in ME1b" << std::endl;
203  for (int bx_gem = bx_copad_start; bx_gem <= bx_copad_stop; bx_gem++) {
204  if (not hasCoPads) {
205  continue;
206  }
207 
208  // find the best matching copad
209  matches<GEMCoPadDigi> copads;
210  matchingPads<CSCALCTDigi, GEMCoPadDigi>(alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct], copads);
211 
212  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\t++Number of matching GEM CoPads in BX " << bx_alct << " : "<< copads.size() << std::endl;
213  if (copads.empty()) {
214  continue;
215  }
216 
217  CSCGEMMotherboard::correlateLCTsGEM(alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct],
218  copads, allLCTs(bx_alct,0,0), allLCTs(bx_alct,0,1));
219 
220  if (debug_matching) {
221  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-GEM CoPad match in ME1b: bx_alct = " << bx_alct << "\n\n"
222  << "------------------------------------------------------------------------" << std::endl << std::endl;
223  if (allLCTs(bx_alct,0,0).isValid())
224  LogTrace("CSCGEMCMotherboardME11") << "LCT #1 "<< allLCTs(bx_alct,0,0) << std::endl;
225  else
226  LogTrace("CSCGEMCMotherboardME11") << "No valid LCT is built from ALCT-GEM matching in ME1b" << std::endl;
227  if (allLCTs(bx_alct,0,1).isValid())
228  LogTrace("CSCGEMCMotherboardME11") << "LCT #2 "<< allLCTs(bx_alct,0,1) << std::endl;
229  }
230 
231  if (allLCTs(bx_alct,0,0).isValid()) {
232  ++nSuccesFulGEMMatches;
233  if (match_earliest_clct_only) break;
234  }
235  }
236  }
237 
238  if (debug_matching) {
239  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
240  << "Summary: " << std::endl;
241  if (nSuccesFulMatches>1)
242  LogTrace("CSCGEMCMotherboardME11") << "Too many successful ALCT-CLCT matches in ME1b: " << nSuccesFulMatches
243  << ", CSCDetId " << cscChamber->id()
244  << ", bx_alct = " << bx_alct
245  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
246  else if (nSuccesFulMatches==1)
247  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-CLCT match in ME1b: "
248  << " CSCDetId " << cscChamber->id()
249  << ", bx_alct = " << bx_alct
250  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
251  else if (nSuccesFulGEMMatches==1)
252  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-GEM match in ME1b: "
253  << " CSCDetId " << cscChamber->id()
254  << ", bx_alct = " << bx_alct
255  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
256  else
257  LogTrace("CSCGEMCMotherboardME11") << "Unsuccessful ALCT-CLCT match in ME1b: "
258  << "CSCDetId " << cscChamber->id()
259  << ", bx_alct = " << bx_alct
260  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
261 
262  LogTrace("CSCGEMCMotherboardME11") << "------------------------------------------------------------------------" << std::endl
263  << "Attempt ALCT-CLCT matching in ME1/a in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
264  }
265  } // end of ALCT valid block
266  else {
267  auto coPads(coPads_[bx_alct]);
268  if (!coPads.empty()) {
269  // keep it simple for the time being, only consider the first copad
270  const int bx_clct_start(bx_alct - match_trig_window_size/2);
271  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
272 
273  // matching in ME1b
275  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
276  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
277  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
278  if (clctProc->bestCLCT[bx_clct].isValid()) {
279  const int quality(clctProc->bestCLCT[bx_clct].getQuality());
280  // only use high-Q stubs for the time being
281  if (quality < 4) continue;
282  int mbx = bx_clct-bx_clct_start;
283  CSCGEMMotherboard::correlateLCTsGEM(clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct], coPads,
284  allLCTs(bx_alct,mbx,0), allLCTs(bx_alct,mbx,1));
285  if (debug_matching) {
286  // if (infoV > 1) LogTrace("CSCMotherboard")
287  LogTrace("CSCGEMCMotherboardME11") << "Successful GEM-CLCT match in ME1b: bx_alct = " << bx_alct
288  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
289  << "]; bx_clct = " << bx_clct << "\n"
290  << "+++ Best CLCT Details: " << clctProc->bestCLCT[bx_clct] << "\n"
291  << "+++ Second CLCT Details: " << clctProc->secondCLCT[bx_clct] << std::endl;
292  }
293  if (allLCTs(bx_alct,mbx,0).isValid()) {
294  used_clct_mask[bx_clct] += 1;
295  if (match_earliest_clct_only) break;
296  }
297  }
298  } //end of clct loop
299  }
300  } // if (!coPads.empty())
301  }
302  } // end of ALCT-centric matching
303 
304  if (debug_matching){
305  LogTrace("CSCGEMCMotherboardME11") << "======================================================================== \n"
306  << "Counting the LCTs in CSCGEMMotherboard ME11 \n"
307  << "========================================================================" << std::endl;
308  }
309 
310 
311  unsigned int n1b=0, n1a=0;
312  LogTrace("CSCGEMCMotherboardME11") << "======================================================================== \n"
313  << "Counting the final LCTs in CSCGEMMotherboard ME11\n"
314  << "======================================================================== \n"
315  << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
316 
317  for (const auto& p : readoutLCTs1b()) {
318  n1b++;
319  LogTrace("CSCGEMCMotherboardME11") << "1b LCT "<<n1b<<" " << p <<std::endl;
320  }
321 
322  for (const auto& p : readoutLCTs1a()){
323  n1a++;
324  LogTrace("CSCGEMCMotherboardME11") << "1a LCT "<<n1a<<" " << p <<std::endl;
325 
326  }
327 }
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
std::vector< CSCCLCTDigi > clctV
unsigned int match_trig_window_size
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:37
GEMCoPadDigiIdsBX coPads_
unsigned int alctClctOffset
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
const CSCChamber * cscChamber
const CSCGeometry * csc_g
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
std::vector< GEMCoPadDigi > gemCoPadV
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) 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
std::vector< CSCALCTDigi > alctV
void printGEMTriggerCoPads(int bx_start, int bx_stop, enum CSCPart)
#define LogTrace(id)
double b
Definition: hdecay.h:120
void correlateLCTsGEM(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMPadDigiIds &pads, const GEMCoPadDigiIds &copads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
GEMPadDigiIdsBX pads_
const GEMGeometry * gem_g
void printGEMTriggerPads(int bx_start, int bx_stop, enum CSCPart)
void CSCGEMMotherboardME11::sortLCTs ( std::vector< CSCCorrelatedLCTDigi > &  LCTs,
int  bx,
bool(*)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)  sorter 
) const
private

Methods to sort the LCTs

Definition at line 404 of file CSCGEMMotherboardME11.cc.

References CSCUpgradeMotherboard::allLCTs, CSCUpgradeMotherboard::LCTContainer::getTimeMatched(), CSCUpgradeMotherboard::max_lcts, and CSCUpgradeMotherboard::sortLCTs().

Referenced by readoutLCTs(), and sortLCTs().

406 {
407  allLCTs.getTimeMatched(bx, LCTs);
408 
410 
411  if (LCTs.size() > max_lcts) LCTs.erase(LCTs.begin()+max_lcts, LCTs.end());
412 }
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
void getTimeMatched(const int bx, std::vector< CSCCorrelatedLCTDigi > &) const
void CSCGEMMotherboardME11::sortLCTs ( std::vector< CSCCorrelatedLCTDigi > &  LCTs,
bool(*)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)  sorter 
) const
private

Definition at line 415 of file CSCGEMMotherboardME11.cc.

References CSCConstants::MAX_LCT_TBINS, AlCaHLTBitMon_ParallelJobs::p, and sortLCTs().

417 {
418  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
419  // temporary collection with all LCTs in the whole chamber
420  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp;
421  CSCGEMMotherboardME11::sortLCTs(LCTs_tmp, bx, *sorter);
422 
423  // Add the LCTs
424  for (const auto& p: LCTs_tmp){
425  LCTs.push_back(p);
426  }
427  }
428 }
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &, int bx, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const

Member Data Documentation

bool CSCGEMMotherboardME11::buildLCTfromALCTandGEM_ME1a_
private

Definition at line 81 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::buildLCTfromALCTandGEM_ME1b_
private

Definition at line 82 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::buildLCTfromCLCTandGEM_ME1a_
private

Definition at line 83 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::buildLCTfromCLCTandGEM_ME1b_
private

Definition at line 84 of file CSCGEMMotherboardME11.h.

Referenced by run().

std::vector<CSCCLCTDigi> CSCGEMMotherboardME11::clctV
private

Definition at line 72 of file CSCGEMMotherboardME11.h.

Referenced by run().

std::unique_ptr<CSCMotherboardLUTME11> CSCGEMMotherboardME11::cscTmbLUT_
private

Definition at line 46 of file CSCGEMMotherboardME11.h.

Referenced by CSCGEMMotherboardME11(), and doesALCTCrossCLCT().

bool CSCGEMMotherboardME11::dropLowQualityALCTsNoGEMs_ME1a_
private

Definition at line 77 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityALCTsNoGEMs_ME1b_
private

Definition at line 78 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityCLCTsNoGEMs_ME1a_
private

Definition at line 75 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityCLCTsNoGEMs_ME1b_
private

Definition at line 76 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::promoteCLCTGEMquality_ME1a_
private

Definition at line 87 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::promoteCLCTGEMquality_ME1b_
private

Definition at line 88 of file CSCGEMMotherboardME11.h.

std::unique_ptr<CSCGEMMotherboardLUTME11> CSCGEMMotherboardME11::tmbLUT_
private

Definition at line 45 of file CSCGEMMotherboardME11.h.

Referenced by CSCGEMMotherboardME11(), and getLUT().