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 CSCBaseboard

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
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const override
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
 
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
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
 ~CSCMotherboard () override=default
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCBaseboard ()
 
std::string getCSCName () const
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCBaseboard ()=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
 
bool doesWiregroupCrossStrip (int key_wg, int key_hs) const override
 
const CSCGEMMotherboardLUTME11getLUT () const override
 
std::vector< CSCCorrelatedLCTDigireadoutLCTsME11 (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 correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
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
 
bool debug_luts
 
bool debug_matching
 
std::unique_ptr< CSCUpgradeMotherboardLUTGeneratorgenerator_
 
bool match_earliest_alct_only
 
bool match_earliest_clct_only
 
unsigned int max_lcts
 
int pref [CSCConstants::MAX_LCT_TBINS]
 
Parity theParity
 
unsigned int tmb_cross_bx_algo
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
std::vector< CSCCLCTDigiclctV
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
bool readout_earliest_2
 
CSCCorrelatedLCTDigi secondLCT [CSCConstants::MAX_LCT_TBINS]
 
unsigned int tmb_l1a_window_size
 
- Protected Attributes inherited from CSCBaseboard
unsigned int alctClctOffset_
 
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctSLHC_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isSLHC_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
unsigned theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 
- Static Protected Attributes inherited from CSCMotherboard
static const unsigned int def_alct_trig_enable = 0
 
static const unsigned int def_clct_trig_enable = 0
 
static const unsigned int def_match_trig_enable = 1
 
static const unsigned int def_match_trig_window_size = 7
 
static const unsigned int def_mpc_block_me1a = 1
 
static const unsigned int def_tmb_l1a_window_size = 7
 

Detailed Description

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_, CSCBaseboard::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
std::unique_ptr< CSCMotherboardLUTME11 > cscTmbLUT_
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:61
std::unique_ptr< CSCGEMMotherboardLUTME11 > tmbLUT_
CSCGEMMotherboardME11::CSCGEMMotherboardME11 ( )

Constructor for use during testing.

Definition at line 29 of file CSCGEMMotherboardME11.cc.

References CSCBaseboard::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 439 of file CSCGEMMotherboardME11.cc.

References CSCCorrelatedLCTDigi::ALCTCLCT, CSCALCTDigi::clear(), CSCCLCTDigi::clear(), CSCMotherboard::constructLCTs(), CSCGEMMotherboard::constructLCTsGEM(), CSCBaseboard::cscId_, doesALCTCrossCLCT(), GEMCoPadDigi::isValid(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), LogTrace, and lumiPlot::lut.

Referenced by run().

447 {
448  CSCALCTDigi bestALCT = bALCT;
449  CSCALCTDigi secondALCT = sALCT;
450  CSCCLCTDigi bestCLCT = bCLCT;
451  CSCCLCTDigi secondCLCT = sCLCT;
452 
453  // assume that always anodeBestValid and cathodeBestValid
454  if (secondALCT == bestALCT) secondALCT.clear();
455  if (secondCLCT == bestCLCT) secondCLCT.clear();
456 
457  const bool ok_bb = bestALCT.isValid() and bestCLCT.isValid();
458  const bool ok_bs = bestALCT.isValid() and secondCLCT.isValid();
459  const bool ok_sb = secondALCT.isValid() and bestCLCT.isValid();
460  const bool ok_ss = secondALCT.isValid() and secondCLCT.isValid();
461 
462  const int ok11 = doesALCTCrossCLCT( bestALCT, bestCLCT);
463  const int ok12 = doesALCTCrossCLCT( bestALCT, secondCLCT);
464  const int ok21 = doesALCTCrossCLCT( secondALCT, bestCLCT);
465  const int ok22 = doesALCTCrossCLCT( secondALCT, secondCLCT);
466  const int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
467 
468  int dbg=0;
469  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"debug correlateLCTs in ME11"<< cscId_ << "\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 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:39
bool doesALCTCrossCLCT(const CSCALCTDigi &a, const CSCCLCTDigi &c) const
CSCDetId cscId_
Definition: CSCBaseboard.h:46
bool isValid() const
Definition: GEMCoPadDigi.cc:32
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
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:54
bool CSCGEMMotherboardME11::doesALCTCrossCLCT ( const CSCALCTDigi a,
const CSCCLCTDigi c 
) const
private

Definition at line 428 of file CSCGEMMotherboardME11.cc.

References cscTmbLUT_, CSCBaseboard::gangedME1a_, and CSCBaseboard::theEndcap.

Referenced by correlateLCTsGEM().

429 {
430  return cscTmbLUT_->doesALCTCrossCLCT(a, c, theEndcap, gangedME1a_);
431 }
const unsigned theEndcap
Definition: CSCBaseboard.h:33
bool gangedME1a_
Definition: CSCBaseboard.h:77
std::unique_ptr< CSCMotherboardLUTME11 > cscTmbLUT_
bool CSCGEMMotherboardME11::doesWiregroupCrossStrip ( int  key_wg,
int  key_hs 
) const
overrideprivatevirtual

Reimplemented from CSCGEMMotherboard.

Definition at line 433 of file CSCGEMMotherboardME11.cc.

References cscTmbLUT_, CSCBaseboard::gangedME1a_, and CSCBaseboard::theEndcap.

434 {
435  return cscTmbLUT_->doesWiregroupCrossStrip(key_wg, key_strip, theEndcap, gangedME1a_);
436 }
const unsigned theEndcap
Definition: CSCBaseboard.h:33
bool gangedME1a_
Definition: CSCBaseboard.h:77
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::readoutLCTs1a ( ) const

Definition at line 326 of file CSCGEMMotherboardME11.cc.

References ME1A, and readoutLCTsME11().

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

327 {
328  return readoutLCTsME11(ME1A);
329 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTsME11(enum CSCPart me1ab) const
std::vector< CSCCorrelatedLCTDigi > CSCGEMMotherboardME11::readoutLCTs1b ( ) const

Definition at line 332 of file CSCGEMMotherboardME11.cc.

References ME1B, and readoutLCTsME11().

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

333 {
334  return readoutLCTsME11(ME1B);
335 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTsME11(enum CSCPart me1ab) const
std::vector< CSCCorrelatedLCTDigi > CSCGEMMotherboardME11::readoutLCTsME11 ( enum CSCPart  me1ab) const
private

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

Referenced by readoutLCTs1a(), and readoutLCTs1b().

342 {
343  std::vector<CSCCorrelatedLCTDigi> tmpV;
344 
345  // The start time of the L1A*LCT coincidence window should be related
346  // to the fifo_pretrig parameter, but I am not completely sure how.
347  // Just choose it such that the window is centered at bx=7. This may
348  // need further tweaking if the value of tmb_l1a_window_size changes.
349  //static int early_tbins = 4;
350  // The number of LCT bins in the read-out is given by the
351  // tmb_l1a_window_size parameter, forced to be odd
352  const int lct_bins =
354  const int late_tbins = early_tbins + lct_bins;
355 
356  // Start from the vector of all found correlated LCTs and select
357  // those within the LCT*L1A coincidence window.
358  int bx_readout = -1;
359  std::vector<CSCCorrelatedLCTDigi> all_lcts;
360  switch(tmb_cross_bx_algo){
361  case 0: case 1:
362  allLCTs.getMatched(all_lcts);
363  break;
365  break;
367  break;
368  default: LogTrace("CSCGEMCMotherboardME11")<<"tmb_cross_bx_algo error" <<std::endl;
369  break;
370  }
371 
372  for (const auto& lct: all_lcts)
373  {
374  if (!lct.isValid()) continue;
375 
376  int bx = lct.getBX();
377  // Skip LCTs found too early relative to L1Accept.
378  if (bx <= early_tbins) continue;
379 
380  // Skip LCTs found too late relative to L1Accept.
381  if (bx > late_tbins) continue;
382 
383  if ((me1ab == CSCPart::ME1B and lct.getStrip() > CSCConstants::MAX_HALF_STRIP_ME1B ) or (me1ab == CSCPart::ME1A and lct.getStrip() <= CSCConstants::MAX_HALF_STRIP_ME1B))
384  continue;
385 
386  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
387  // in digi->raw step, LCTs have to be packed into the TMB header, and
388  // currently there is room just for two.
389  if (readout_earliest_2 and (bx_readout == -1 or bx == bx_readout) )
390  {
391  tmpV.push_back(lct);
392  if (bx_readout == -1) bx_readout = bx;
393  }
394  else tmpV.push_back(lct);
395  }
396  return tmpV;
397 }
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
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 CSCBaseboard::alctClctOffset_, CSCMotherboard::alctProc, CSCMotherboard::alctV, CSCUpgradeMotherboard::allLCTs, b, buildLCTfromALCTandGEM_ME1b_, buildLCTfromCLCTandGEM_ME1b_, CSCMotherboard::clctProc, clctV, CSCGEMMotherboard::clear(), CSCGEMMotherboard::coPadProcessor, CSCGEMMotherboard::coPads_, correlateLCTsGEM(), CSCGEMMotherboard::correlateLCTsGEM(), CSCBaseboard::cscGeometry_, CSCBaseboard::cscId_, CSCUpgradeMotherboard::debug_matching, CSCUpgradeMotherboard::debugLUTs(), CSCMotherboard::drop_used_clcts, dropLowQualityCLCTsNoGEMs_ME1b_, CSCGEMMotherboard::gem_g, CSCGEMMotherboard::gemCoPadV, CSCGEMMotherboard::gemGeometryAvailable, CSCGEMMotherboard::gemId, CSCBaseboard::infoV, CSCBaseboard::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(cscGeometry_);
80  clctProc->setCSCGeometry(cscGeometry_);
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: " << cscId_ << "\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 ME1/1: " << nSuccesFulMatches
243  << ", CSCDetId " << cscId_
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 ME1/1: "
248  << " CSCDetId " << cscId_
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 ME1/1: "
253  << " CSCDetId " << cscId_
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 ME1/1: "
258  << "CSCDetId " << cscId_
259  << ", bx_alct = " << bx_alct
260  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
261  }
262  } // end of ALCT valid block
263  else {
264  auto coPads(coPads_[bx_alct]);
265  if (!coPads.empty()) {
266  // keep it simple for the time being, only consider the first copad
267  const int bx_clct_start(bx_alct - match_trig_window_size/2);
268  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
269 
270  // matching in ME1b
272  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
273  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
274  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
275  if (clctProc->bestCLCT[bx_clct].isValid()) {
276  const int quality(clctProc->bestCLCT[bx_clct].getQuality());
277  // only use high-Q stubs for the time being
278  if (quality < 4) continue;
279  int mbx = bx_clct-bx_clct_start;
280  CSCGEMMotherboard::correlateLCTsGEM(clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct], coPads,
281  allLCTs(bx_alct,mbx,0), allLCTs(bx_alct,mbx,1));
282  if (debug_matching) {
283  // if (infoV > 1) LogTrace("CSCMotherboard")
284  LogTrace("CSCGEMCMotherboardME11") << "Successful GEM-CLCT match in ME1b: bx_alct = " << bx_alct
285  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
286  << "]; bx_clct = " << bx_clct << "\n"
287  << "+++ Best CLCT Details: " << clctProc->bestCLCT[bx_clct] << "\n"
288  << "+++ Second CLCT Details: " << clctProc->secondCLCT[bx_clct] << std::endl;
289  }
290  if (allLCTs(bx_alct,mbx,0).isValid()) {
291  used_clct_mask[bx_clct] += 1;
292  if (match_earliest_clct_only) break;
293  }
294  }
295  } //end of clct loop
296  }
297  } // if (!coPads.empty())
298  }
299  } // end of ALCT-centric matching
300 
301  if (debug_matching){
302  LogTrace("CSCGEMCMotherboardME11") << "======================================================================== \n"
303  << "Counting the LCTs in CSCGEMMotherboard ME11 \n"
304  << "========================================================================" << std::endl;
305  }
306 
307 
308  unsigned int n1b=0, n1a=0;
309  LogTrace("CSCGEMCMotherboardME11") << "======================================================================== \n"
310  << "Counting the final LCTs in CSCGEMMotherboard ME11\n"
311  << "======================================================================== \n"
312  << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
313 
314  for (const auto& p : readoutLCTs1b()) {
315  n1b++;
316  LogTrace("CSCGEMCMotherboardME11") << "1b LCT "<<n1b<<" " << p <<std::endl;
317  }
318 
319  for (const auto& p : readoutLCTs1a()){
320  n1a++;
321  LogTrace("CSCGEMCMotherboardME11") << "1a LCT "<<n1a<<" " << p <<std::endl;
322 
323  }
324 }
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
std::vector< CSCCLCTDigi > clctV
unsigned int match_trig_window_size
GEMCoPadDigiIdsBX coPads_
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
CSCDetId cscId_
Definition: CSCBaseboard.h:46
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)
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:54
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
unsigned int alctClctOffset_
Definition: CSCBaseboard.h:86
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 401 of file CSCGEMMotherboardME11.cc.

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

Referenced by readoutLCTsME11(), and sortLCTs().

403 {
404  allLCTs.getTimeMatched(bx, LCTs);
405 
407 
408  if (LCTs.size() > max_lcts) LCTs.erase(LCTs.begin()+max_lcts, LCTs.end());
409 }
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 412 of file CSCGEMMotherboardME11.cc.

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

414 {
415  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
416  // temporary collection with all LCTs in the whole chamber
417  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp;
418  CSCGEMMotherboardME11::sortLCTs(LCTs_tmp, bx, *sorter);
419 
420  // Add the LCTs
421  for (const auto& p: LCTs_tmp){
422  LCTs.push_back(p);
423  }
424  }
425 }
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 84 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::buildLCTfromALCTandGEM_ME1b_
private

Definition at line 85 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::buildLCTfromCLCTandGEM_ME1a_
private

Definition at line 86 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::buildLCTfromCLCTandGEM_ME1b_
private

Definition at line 87 of file CSCGEMMotherboardME11.h.

Referenced by run().

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

Definition at line 75 of file CSCGEMMotherboardME11.h.

Referenced by run().

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

Definition at line 80 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityALCTsNoGEMs_ME1b_
private

Definition at line 81 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityCLCTsNoGEMs_ME1a_
private

Definition at line 78 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityCLCTsNoGEMs_ME1b_
private

Definition at line 79 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::promoteCLCTGEMquality_ME1a_
private

Definition at line 90 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::promoteCLCTGEMquality_ME1b_
private

Definition at line 91 of file CSCGEMMotherboardME11.h.

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

Definition at line 45 of file CSCGEMMotherboardME11.h.

Referenced by CSCGEMMotherboardME11(), and getLUT().