CMS 3D CMS Logo

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

#include <CSCGEMMotherboardME11.h>

Inheritance diagram for CSCGEMMotherboardME11:
CSCGEMMotherboard CSCUpgradeMotherboard CSCMotherboard

Public Member Functions

void clear ()
 
 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, enum CSCPart) const
 
template<class S >
S bestMatchingPad (const CSCCLCTDigi &clct, const matches< S > &pads, enum CSCPart part) const
 
template<class S >
S bestMatchingPad (const CSCALCTDigi &alct1, const CSCCLCTDigi &clct1, const matches< S > &pads, enum CSCPart part) 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
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 ()
 
template<class S >
void intersection (const S &d1, const S &d2, S &result) const
 
void setCSCGeometry (const CSCGeometry *g)
 
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 std::vector< int > w_time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES], const std::vector< int > hs_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const std::vector< int > ds_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCMotherboard ()=default
 

Public Attributes

std::unique_ptr< CSCCathodeLCTProcessorclct1a
 
- Public Attributes inherited from CSCGEMMotherboard
std::unique_ptr< GEMCoPadProcessorcoPadProcessor
 
- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralct
 
std::unique_ptr< CSCCathodeLCTProcessorclct
 

Private Member Functions

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

Private Attributes

LCTContainer allLCTs1a
 
LCTContainer allLCTs1b
 
bool buildLCTfromALCTandGEM_ME1a_
 
bool buildLCTfromALCTandGEM_ME1b_
 
bool buildLCTfromCLCTandGEM_ME1a_
 
bool buildLCTfromCLCTandGEM_ME1b_
 
std::vector< CSCCLCTDigiclctV1a
 
std::vector< CSCCLCTDigiclctV1b
 
bool disableME1a
 
bool dropLowQualityALCTsNoGEMs_ME1a_
 
bool dropLowQualityALCTsNoGEMs_ME1b_
 
bool dropLowQualityCLCTsNoGEMs_ME1a_
 
bool dropLowQualityCLCTsNoGEMs_ME1b_
 
bool gangedME1a
 
bool promoteCLCTGEMquality_ME1a_
 
bool promoteCLCTGEMquality_ME1b_
 
bool smartME1aME1b
 
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 &)
 
- 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 > &, enum CSCPart) const
 
template<class T >
T bestMatchingPad (const CSCCLCTDigi &, const matches< T > &, enum CSCPart) const
 
template<class T >
T bestMatchingPad (const CSCALCTDigi &, const CSCCLCTDigi &, const matches< T > &, enum CSCPart) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, enum CSCPart p, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem, enum CSCPart p, int i) const
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem1, const GEMCoPadDigi &gem2, enum CSCPart p, int i) const
 
template<class T >
void correlateLCTsGEM (T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart) const
 
template<class T >
void correlateLCTsGEM (const T &best, const T &second, const GEMCoPadDigi &, const GEMCoPadDigi &, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart) 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 part) 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, enum CSCPart part, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &alct, enum CSCPart part, matches< T > &) const
 
template<class S , class T >
void matchingPads (const S &d1, const S &d2, enum CSCPart part, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &clct1, const CSCALCTDigi &alct1, enum CSCPart part, matches< T > &) const
 
template<class T >
void matchingPads (const CSCCLCTDigi &clct1, const CSCCLCTDigi &clct2, const CSCALCTDigi &alct1, const CSCALCTDigi &alct2, enum CSCPart part, 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 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 ptn, const int highPt) const
 
unsigned int findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
 
void testLCT ()
 
- 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
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
edm::ParameterSet commonParams_
 
const CSCGeometrycsc_g
 
const CSCChambercscChamber
 
bool debug_luts
 
bool debug_matching
 
bool drop_used_clcts
 
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
 
edm::ParameterSet tmbParams_
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
const CSCGeometrycsc_g
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
int infoV
 
bool isMTCC
 
bool isSLHC
 
bool isTMB07
 
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]
 
const unsigned theEndcap
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
unsigned int tmb_l1a_window_size
 
- 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 6 of file CSCGEMMotherboardME11.cc.

References clct1a, CSCUpgradeMotherboard::commonParams_, edm::ParameterSet::getParameter(), smartME1aME1b, tmbLUT_, and CSCUpgradeMotherboard::tmbParams_.

10  : CSCGEMMotherboard(endcap, station, sector, subsector, chamber, conf)
13  // special configuration parameters for ME11 treatment
14  , smartME1aME1b(commonParams_.getParameter<bool>("smartME1aME1b"))
15  , disableME1a(commonParams_.getParameter<bool>("disableME1a"))
16  , gangedME1a(commonParams_.getParameter<bool>("gangedME1a"))
17  , dropLowQualityCLCTsNoGEMs_ME1a_(tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1a"))
18  , dropLowQualityCLCTsNoGEMs_ME1b_(tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1b"))
19  , dropLowQualityALCTsNoGEMs_ME1a_(tmbParams_.getParameter<bool>("dropLowQualityALCTsNoGEMs_ME1a"))
20  , dropLowQualityALCTsNoGEMs_ME1b_(tmbParams_.getParameter<bool>("dropLowQualityALCTsNoGEMs_ME1b"))
21  , buildLCTfromALCTandGEM_ME1a_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM_ME1a"))
22  , buildLCTfromALCTandGEM_ME1b_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM_ME1b"))
23  , buildLCTfromCLCTandGEM_ME1a_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM_ME1a"))
24  , buildLCTfromCLCTandGEM_ME1b_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM_ME1b"))
25  , promoteCLCTGEMquality_ME1a_(tmbParams_.getParameter<bool>("promoteCLCTGEMquality_ME1a"))
26  , promoteCLCTGEMquality_ME1b_(tmbParams_.getParameter<bool>("promoteCLCTGEMquality_ME1b"))
27 {
28  if (!smartME1aME1b) edm::LogError("L1CSCTPEmulatorConfigError")
29  << "+++ Upgrade CSCGEMMotherboardME11 constructed while smartME1aME1b is not set! +++\n";
30 
31  const edm::ParameterSet clctParams(conf.getParameter<edm::ParameterSet>("clctSLHC"));
32  clct1a.reset( new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams_, tmbParams_) );
33  clct1a->setRing(4);
34 
35  // set LUTs
36  tmbLUT_.reset(new CSCGEMMotherboardLUTME11());
37 }
T getParameter(std::string const &) const
unsigned int match_trig_window_size
edm::ParameterSet commonParams_
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
edm::ParameterSet tmbParams_
std::unique_ptr< CSCGEMMotherboardLUTME11 > tmbLUT_
CSCGEMMotherboardME11::CSCGEMMotherboardME11 ( )

Constructor for use during testing.

Definition at line 40 of file CSCGEMMotherboardME11.cc.

References clct1a.

40  :
44 {
45  // Constructor used only for testing.
46 
47  clct1a.reset( new CSCCathodeLCTProcessor() );
48  clct1a->setRing(4);
49 }
unsigned int match_trig_window_size
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
CSCGEMMotherboardME11::~CSCGEMMotherboardME11 ( )
override

Default destructor.

Definition at line 52 of file CSCGEMMotherboardME11.cc.

53 {
54 }

Member Function Documentation

void CSCGEMMotherboardME11::clear ( void  )

Clears correlated LCT and passes clear signal on to cathode and anode LCT processors.

Definition at line 57 of file CSCGEMMotherboardME11.cc.

References allLCTs1a, allLCTs1b, clct1a, CSCGEMMotherboard::clear(), CSCMotherboard::clear(), mps_fire::i, CSCMotherboard::match_trig_window_size, CSCConstants::MAX_LCT_TBINS, and CSCConstants::MAX_LCTS_PER_CSC.

Referenced by run().

58 {
61 
62  if (clct1a) clct1a->clear();
63  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
64  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
65  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++) {
66  allLCTs1b(bx,mbx,i).clear();
67  allLCTs1a(bx,mbx,i).clear();
68  }
69  }
70  }
71 }
unsigned int match_trig_window_size
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
void CSCGEMMotherboardME11::correlateLCTsGEM ( CSCALCTDigi bestALCT,
CSCALCTDigi secondALCT,
CSCCLCTDigi bestCLCT,
CSCCLCTDigi secondCLCT,
const GEMPadDigiIds pads,
const GEMCoPadDigiIds copads,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
enum CSCPart  p 
) const
private

Definition at line 728 of file CSCGEMMotherboardME11.cc.

References CSCTriggerNumbering::chamberFromTriggerLabels(), CSCCLCTDigi::clear(), CSCALCTDigi::clear(), CSCGEMMotherboard::constructLCTsGEM(), doesALCTCrossCLCT(), GEMCoPadDigi::isValid(), GEMPadDigi::isValid(), LogTrace, lumiPlot::lut, AlCaHLTBitMon_ParallelJobs::p, relativeConstraints::ring, CSCMotherboard::theEndcap, CSCMotherboard::theSector, CSCMotherboard::theStation, CSCMotherboard::theSubsector, and CSCMotherboard::theTrigChamber.

Referenced by getCLCTs1b(), and run().

737 {
738  // assume that always anodeBestValid and cathodeBestValid
739 
740  if (secondALCT == bestALCT) secondALCT.clear();
741  if (secondCLCT == bestCLCT) secondCLCT.clear();
742 
743  const int ok11 = doesALCTCrossCLCT( bestALCT, bestCLCT, p);
744  const int ok12 = doesALCTCrossCLCT( bestALCT, secondCLCT, p);
745  const int ok21 = doesALCTCrossCLCT( secondALCT, bestCLCT, p);
746  const int ok22 = doesALCTCrossCLCT( secondALCT, secondCLCT, p);
747  const int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
748 
749  int dbg=0;
750  int ring = p;
752  CSCDetId did(theEndcap, theStation, ring, chamb, 0);
753  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"debug correlateLCTs in "<<did<<std::endl
754  <<"ALCT1: "<<bestALCT<<std::endl
755  <<"ALCT2: "<<secondALCT<<std::endl
756  <<"CLCT1: "<<bestCLCT<<std::endl
757  <<"CLCT2: "<<secondCLCT<<std::endl
758  <<"ok 11 12 21 22 code = "<<ok11<<" "<<ok12<<" "<<ok21<<" "<<ok22<<" "<<code<<std::endl;
759 
760  if ( code==0 ) return;
761 
762  // LUT defines correspondence between possible ok## combinations
763  // and resulting lct1 and lct2
764  int lut[16][2] = {
765  //ok: 11 12 21 22
766  {0 ,0 }, // 0 0 0 0
767  {22,0 }, // 0 0 0 1
768  {21,0 }, // 0 0 1 0
769  {21,22}, // 0 0 1 1
770  {12,0 }, // 0 1 0 0
771  {12,22}, // 0 1 0 1
772  {12,21}, // 0 1 1 0
773  {12,21}, // 0 1 1 1
774  {11,0 }, // 1 0 0 0
775  {11,22}, // 1 0 0 1
776  {11,21}, // 1 0 1 0
777  {11,22}, // 1 0 1 1
778  {11,12}, // 1 1 0 0
779  {11,22}, // 1 1 0 1
780  {11,12}, // 1 1 1 0
781  {11,22}, // 1 1 1 1
782  };
783 
784  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lut 0 1 = "<<lut[code][0]<<" "<<lut[code][1]<<std::endl;
785 
786  // check matching copads
787  const GEMCoPadDigi& bb_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, bestCLCT, copads, p);
788  const GEMCoPadDigi& bs_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, secondCLCT, copads, p);
789  const GEMCoPadDigi& sb_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, bestCLCT, copads, p);
790  const GEMCoPadDigi& ss_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, secondCLCT, copads, p);
791 
792  // check matching pads
793  const GEMPadDigi& bb_pad = bestMatchingPad<GEMPadDigi>(bestALCT, bestCLCT, pads, p);
794  const GEMPadDigi& bs_pad = bestMatchingPad<GEMPadDigi>(bestALCT, secondCLCT, pads, p);
795  const GEMPadDigi& sb_pad = bestMatchingPad<GEMPadDigi>(secondALCT, bestCLCT, pads, p);
796  const GEMPadDigi& ss_pad = bestMatchingPad<GEMPadDigi>(secondALCT, secondCLCT, pads, p);
797 
798  // evaluate possible combinations
799  const bool ok_bb_copad = ok11==1 and bestALCT.isValid() and bestCLCT.isValid() and bb_copad.isValid();
800  const bool ok_bs_copad = ok12==1 and bestALCT.isValid() and secondCLCT.isValid() and bs_copad.isValid();
801  const bool ok_sb_copad = ok21==1 and secondALCT.isValid() and bestCLCT.isValid() and sb_copad.isValid();
802  const bool ok_ss_copad = ok22==1 and secondALCT.isValid() and secondCLCT.isValid() and ss_copad.isValid();
803 
804  const bool ok_bb_pad = (not ok_bb_copad) and ok11==1 and bestALCT.isValid() and bestCLCT.isValid() and bb_pad.isValid();
805  const bool ok_bs_pad = (not ok_bs_copad) and ok12==1 and bestALCT.isValid() and secondCLCT.isValid() and bs_pad.isValid();
806  const bool ok_sb_pad = (not ok_sb_copad) and ok21==1 and secondALCT.isValid() and bestCLCT.isValid() and sb_pad.isValid();
807  const bool ok_ss_pad = (not ok_ss_copad) and ok22==1 and secondALCT.isValid() and secondCLCT.isValid() and ss_pad.isValid();
808 
809  switch (lut[code][0]) {
810  case 11:
811  if (ok_bb_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, bestCLCT, bb_copad, p, 1);
812  if (ok_bb_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, bestCLCT, bb_pad, p, 1);
813  break;
814  case 12:
815  if (ok_bs_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_copad, p, 1);
816  if (ok_bs_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_pad, p, 1);
817  break;
818  case 21:
819  if (ok_sb_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_copad, p, 1);
820  if (ok_sb_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_pad, p, 1);
821  break;
822  case 22:
823  if (ok_ss_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, ss_copad, p, 1);
824  if (ok_ss_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, ss_pad, p, 1);
825  break;
826  default:
827  return;
828  }
829 
830  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lct1: "<<lct1<<std::endl;
831 
832  switch (lut[code][1]){
833  case 12:
834  if (ok_bs_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_copad, p, 2);
835  if (ok_bs_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_pad, p, 2);
836  break;
837  case 21:
838  if (ok_sb_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_copad, p, 2);
839  if (ok_sb_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_pad, p, 2);
840  break;
841  case 22:
842  if (ok_bb_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, bb_copad, p, 2);
843  if (ok_bb_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, bb_pad, p, 2);
844  break;
845  default:
846  return;
847  }
848 
849  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lct2: "<<lct2<<std::endl;
850 
851  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"out of correlateLCTs"<<std::endl;
852  return;
853 }
bool isValid() const
Definition: GEMPadDigi.cc:48
const unsigned theSector
const unsigned theTrigChamber
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
bool doesALCTCrossCLCT(const CSCALCTDigi &a, const CSCCLCTDigi &c, int me) const
const unsigned theEndcap
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:35
bool isValid() const
Definition: GEMCoPadDigi.cc:32
const unsigned theStation
const unsigned theSubsector
#define LogTrace(id)
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,
int  me 
) const
private

Definition at line 695 of file CSCGEMMotherboardME11.cc.

References gangedME1a, CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), CSCConstants::MAX_HALF_STRIP_ME1A_GANGED, CSCConstants::MAX_HALF_STRIP_ME1A_UNGANGED, CSCConstants::MAX_HALF_STRIP_ME1B, ME1A, ME1Ag, ME1B, or, CSCMotherboard::theEndcap, and tmbLUT_.

Referenced by correlateLCTsGEM(), and getCLCTs1b().

696 {
697  if ( !c.isValid() or !a.isValid() ) return false;
698  int key_hs = c.getKeyStrip();
699  int key_wg = a.getKeyWG();
700  if ( me == ME1A )
701  {
702  if ( !gangedME1a )
703  {
704  // wrap around ME11 HS number for -z endcap
705  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1A_UNGANGED - key_hs;
706  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1A))[key_wg][0] and
707  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1A))[key_wg][1] ) return true;
708  return false;
709  }
710  else
711  {
712  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1A_GANGED - key_hs;
713  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1Ag))[key_wg][0] and
714  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1Ag))[key_wg][1] ) return true;
715  return false;
716  }
717  }
718  if ( me == ME1B)
719  {
720  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1B - key_hs;
721  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1B))[key_wg][0] and
722  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1B))[key_wg][1] ) return true;
723  }
724  return false;
725 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
const unsigned theEndcap
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
std::unique_ptr< CSCGEMMotherboardLUTME11 > tmbLUT_
int getKeyStrip() const
Definition: CSCCLCTDigi.h:89
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:57
std::vector<CSCALCTDigi> CSCGEMMotherboardME11::getALCTs1b ( ) const
inlineprivate

Returns vectors of found ALCTs in ME1a and ME1b, if any.

Definition at line 55 of file CSCGEMMotherboardME11.h.

References CSCUpgradeMotherboard::alctV.

55 {return alctV;}
std::vector< CSCALCTDigi > alctV
std::vector<CSCCLCTDigi> CSCGEMMotherboardME11::getCLCTs1a ( ) const
inlineprivate

Returns vectors of found CLCTs in ME1a and ME1b, if any.

Definition at line 58 of file CSCGEMMotherboardME11.h.

References clctV1a.

58 {return clctV1a;}
std::vector< CSCCLCTDigi > clctV1a
std::vector<CSCCLCTDigi> CSCGEMMotherboardME11::getCLCTs1b ( ) const
inlineprivate
const CSCGEMMotherboardLUTME11* CSCGEMMotherboardME11::getLUT ( ) const
inlineoverrideprivatevirtual

Implements CSCGEMMotherboard.

Definition at line 51 of file CSCGEMMotherboardME11.h.

References tmbLUT_.

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

Definition at line 576 of file CSCGEMMotherboardME11.cc.

References allLCTs1a, allLCTs1b, disableME1a, CSCMotherboard::early_tbins, CSCUpgradeMotherboard::LCTContainer::getMatched(), LogTrace, ME1A, ME1B, CSCMotherboard::mpc_block_me1a, or, CSCMotherboard::readout_earliest_2, sortLCTs(), CSCUpgradeMotherboard::sortLCTsByGEMDphi(), CSCUpgradeMotherboard::sortLCTsByQuality(), CSCUpgradeMotherboard::tmb_cross_bx_algo, and CSCMotherboard::tmb_l1a_window_size.

577 {
578  std::vector<CSCCorrelatedLCTDigi> tmpV;
579 
580  // The start time of the L1A*LCT coincidence window should be related
581  // to the fifo_pretrig parameter, but I am not completely sure how.
582  // Just choose it such that the window is centered at bx=7. This may
583  // need further tweaking if the value of tmb_l1a_window_size changes.
584  //static int early_tbins = 4;
585  // The number of LCT bins in the read-out is given by the
586  // tmb_l1a_window_size parameter, forced to be odd
587  const int lct_bins =
589  const int late_tbins = early_tbins + lct_bins;
590 
591  // Start from the vector of all found correlated LCTs and select
592  // those within the LCT*L1A coincidence window.
593  int bx_readout = -1;
594  std::vector<CSCCorrelatedLCTDigi> all_lcts;
595  if (me1ab == ME1A and not (mpc_block_me1a or disableME1a)) {
596  allLCTs1a.getMatched(all_lcts);
597  }
598  if (me1ab == ME1B) {
599  allLCTs1b.getMatched(all_lcts);
600  }
601  // sort LCTs by quality or bending angle
602  switch(tmb_cross_bx_algo){
603  case 2: sortLCTs(all_lcts, me1ab, CSCUpgradeMotherboard::sortLCTsByQuality);
604  break;
605  case 3: sortLCTs(all_lcts, me1ab, CSCUpgradeMotherboard::sortLCTsByGEMDphi);
606  break;
607  default: LogTrace("CSCGEMCMotherboardME11")<<"tmb_cross_bx_algo error" <<std::endl;
608  break;
609  }
610  for (const auto& lct: all_lcts)
611  {
612  if (!lct.isValid()) continue;
613 
614  int bx = lct.getBX();
615  // Skip LCTs found too early relative to L1Accept.
616  if (bx <= early_tbins) continue;
617 
618  // Skip LCTs found too late relative to L1Accept.
619  if (bx > late_tbins) continue;
620 
621  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
622  // in digi->raw step, LCTs have to be packed into the TMB header, and
623  // currently there is room just for two.
624  if (readout_earliest_2 and (bx_readout == -1 or bx == bx_readout) )
625  {
626  tmpV.push_back(lct);
627  if (bx_readout == -1) bx_readout = bx;
628  }
629  else tmpV.push_back(lct);
630  }
631  return tmpV;
632 }
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
unsigned int mpc_block_me1a
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 sortLCTs(std::vector< CSCCorrelatedLCTDigi > &, int bx, enum CSCPart, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
std::vector< CSCCorrelatedLCTDigi > CSCGEMMotherboardME11::readoutLCTs1a ( ) const

Definition at line 561 of file CSCGEMMotherboardME11.cc.

References ME1A, and CSCMotherboard::readoutLCTs().

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

562 {
563  return readoutLCTs(ME1A);
564 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
std::vector< CSCCorrelatedLCTDigi > CSCGEMMotherboardME11::readoutLCTs1b ( ) const

Definition at line 567 of file CSCGEMMotherboardME11.cc.

References ME1B, and CSCMotherboard::readoutLCTs().

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

568 {
569  return readoutLCTs(ME1B);
570 }
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 74 of file CSCGEMMotherboardME11.cc.

References CSCMotherboard::alct, CSCUpgradeMotherboard::alctV, allLCTs1a, allLCTs1b, b, buildLCTfromALCTandGEM_ME1a_, buildLCTfromALCTandGEM_ME1b_, buildLCTfromCLCTandGEM_ME1a_, buildLCTfromCLCTandGEM_ME1b_, CSCGeometry::chamber(), CSCMotherboard::clct, clct1a, clctV1a, clctV1b, clear(), CSCGEMMotherboard::coPadProcessor, CSCGEMMotherboard::coPads_, correlateLCTsGEM(), CSCGEMMotherboard::correlateLCTsGEM(), CSCUpgradeMotherboard::csc_g, CSCUpgradeMotherboard::cscChamber, CSCUpgradeMotherboard::debug_matching, CSCUpgradeMotherboard::debugLUTs(), CSCUpgradeMotherboard::drop_used_clcts, dropLowQualityCLCTsNoGEMs_ME1a_, dropLowQualityCLCTsNoGEMs_ME1b_, CSCGEMMotherboard::gem_g, CSCGEMMotherboard::gemCoPadV, CSCGEMMotherboard::gemGeometryAvailable, CSCGEMMotherboard::gemId, mps_fire::i, CSCChamber::id(), CSCMotherboard::infoV, LogDebug, LogTrace, CSCUpgradeMotherboard::match_earliest_clct_only, CSCMotherboard::match_trig_window_size, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, CSCConstants::MAX_LCT_TBINS, CSCUpgradeMotherboard::max_lcts, CSCConstants::MAX_LCTS_PER_CSC, CSCGEMMotherboard::maxDeltaBXCoPad_, ME11, ME1A, ME1B, or, AlCaHLTBitMon_ParallelJobs::p, CSCGEMMotherboard::pads_, CSCUpgradeMotherboard::pref, CSCGEMMotherboard::printGEMTriggerCoPads(), CSCGEMMotherboard::printGEMTriggerPads(), jets_cff::quality, readoutLCTs1a(), readoutLCTs1b(), CSCGEMMotherboard::retrieveGEMCoPads(), CSCGEMMotherboard::retrieveGEMPads(), CSCGEMMotherboard::setupGeometry(), smartME1aME1b, CSCUpgradeMotherboard::theChamber, CSCMotherboard::theEndcap, and CSCUpgradeMotherboard::tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build().

77 {
78  clear();
79  setupGeometry();
80  debugLUTs();
81 
82  if (gem_g != nullptr) {
83  if (infoV >= 0) edm::LogInfo("L1CSCTPEmulatorSetupInfo")
84  << "+++ run() called for GEM-CSC integrated trigger! +++ \n";
85  gemGeometryAvailable = true;
86  }
87 
88  // check for GEM geometry
89  if (not gemGeometryAvailable){
90  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
91  << "+++ run() called for GEM-CSC integrated trigger without valid GEM geometry! +++ \n";
92  return;
93  }
94  gemCoPadV = coPadProcessor->run(gemPads); // run copad processor in GE1/1
95 
96  if (!( alct and clct and clct1a and smartME1aME1b))
97  {
98  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
99  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
100  return;
101  }
102 
103  alct->setCSCGeometry(csc_g);
104  clct->setCSCGeometry(csc_g);
105  clct1a->setCSCGeometry(csc_g);
106 
107  alctV = alct->run(wiredc); // run anodeLCT
108  clctV1b = clct->run(compdc); // run cathodeLCT in ME1/b
109  clctV1a = clct1a->run(compdc); // run cathodeLCT in ME1/a
110 
111  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
112  if (alctV.empty() and clctV1b.empty() and clctV1a.empty()) return;
113 
114  int used_clct_mask[20], used_clct_mask_1a[20];
115  for (int b=0;b<20;b++)
116  used_clct_mask[b] = used_clct_mask_1a[b] = 0;
117 
118  // retrieve CSCChamber geometry
119  const CSCDetId me1aId(theEndcap, 1, 4, theChamber);
120  const CSCChamber* cscChamberME1a(csc_g->chamber(me1aId));
121 
122  retrieveGEMPads(gemPads, gemId);
124 
125  const bool hasPads(!pads_.empty());
126  const bool hasCoPads(hasPads and !coPads_.empty());
127 
128  // ALCT-centric matching
129  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++)
130  {
131  if (alct->bestALCT[bx_alct].isValid())
132  {
133  const int bx_clct_start(bx_alct - match_trig_window_size/2);
134  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
135  const int bx_copad_start(bx_alct - maxDeltaBXCoPad_);
136  const int bx_copad_stop(bx_alct + maxDeltaBXCoPad_);
137 
138  if (debug_matching){
139  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
140  << "ALCT-CLCT matching in ME1/1 chamber: " << cscChamber->id() << std::endl
141  << "------------------------------------------------------------------------" << std::endl
142  << "+++ Best ALCT Details: " << alct->bestALCT[bx_alct] << std::endl
143  << "+++ Second ALCT Details: " << alct->secondALCT[bx_alct] << std::endl;
144 
145  printGEMTriggerPads(bx_clct_start, bx_clct_stop, CSCPart::ME11);
146  printGEMTriggerCoPads(bx_clct_start, bx_clct_stop, CSCPart::ME11);
147 
148  LogTrace("CSCGEMCMotherboardME11") << "------------------------------------------------------------------------" << std::endl
149  << "Attempt ALCT-CLCT matching in ME1/b in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
150  }
151 
152  // ALCT-to-CLCT matching in ME1b
153  int nSuccesFulMatches = 0;
154  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
155  {
156  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
157  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
158  if (clct->bestCLCT[bx_clct].isValid())
159  {
160  const int quality(clct->bestCLCT[bx_clct].getQuality());
161  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++Valid ME1b CLCT: " << clct->bestCLCT[bx_clct] << std::endl;
162 
163  // pick the pad that corresponds
164  matches<GEMPadDigi> mPads;
165  matchingPads<GEMPadDigi>(clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct],
166  alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1B, mPads);
167  matches<GEMCoPadDigi> mCoPads;
168  matchingPads<GEMCoPadDigi>(clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct],
169  alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1B, mCoPads);
170 
171  // Low quality LCTs have at most 3 layers. Check if there is a matching GEM pad to keep the CLCT
172  if (dropLowQualityCLCTsNoGEMs_ME1b_ and quality < 4 and hasPads){
173  int nFound(mPads.size());
174  // 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
175  const bool clctInEdge(clct->bestCLCT[bx_clct].getKeyStrip() < 5 or clct->bestCLCT[bx_clct].getKeyStrip() > 124);
176  if (clctInEdge){
177  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT in CSC chamber edge, don't care about GEM pads" << std::endl;
178  }
179  else {
180  if (nFound != 0){
181  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT with " << nFound << " matching GEM trigger pads" << std::endl;
182  }
183  else {
184  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tWarning: low quality CLCT without matching GEM trigger pad" << std::endl;
185  continue;
186  }
187  }
188  }
189 
190  ++nSuccesFulMatches;
191 
192  // if (infoV > 1) LogTrace("CSCMotherboard")
193  int mbx = bx_clct-bx_clct_start;
194  correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
195  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct],
196  mPads, mCoPads,
197  allLCTs1b(bx_alct,mbx,0), allLCTs1b(bx_alct,mbx,1), ME1B);
198  if (debug_matching) {
199  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-CLCT match in ME1b: bx_alct = " << bx_alct
200  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
201  << "]; bx_clct = " << bx_clct << std::endl
202  << "+++ Best CLCT Details: " << clct->bestCLCT[bx_clct] << std::endl
203  << "+++ Second CLCT Details: " << clct->secondCLCT[bx_clct] << std::endl;
204  }
205 
206  if (allLCTs1b(bx_alct,mbx,0).isValid()) {
207  used_clct_mask[bx_clct] += 1;
208  if (match_earliest_clct_only) break;
209  }
210  }
211  }
212 
213  // ALCT-to-GEM matching in ME1b
214  int nSuccesFulGEMMatches = 0;
215  if (nSuccesFulMatches==0 and buildLCTfromALCTandGEM_ME1b_){
216  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++No valid ALCT-CLCT matches in ME1b" << std::endl;
217  for (int bx_gem = bx_copad_start; bx_gem <= bx_copad_stop; bx_gem++) {
218  if (not hasCoPads) {
219  continue;
220  }
221 
222  // find the best matching copad
223  matches<GEMCoPadDigi> copads;
224  matchingPads<CSCALCTDigi, GEMCoPadDigi>(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1B, copads);
225 
226  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\t++Number of matching GEM CoPads in BX " << bx_alct << " : "<< copads.size() << std::endl;
227  if (copads.empty()) {
228  continue;
229  }
230 
231  CSCGEMMotherboard::correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
232  copads, allLCTs1b(bx_alct,0,0), allLCTs1b(bx_alct,0,1), ME1B);
233  if (allLCTs1b(bx_alct,0,0).isValid()) {
234  ++nSuccesFulGEMMatches;
235  if (match_earliest_clct_only) break;
236  }
237  if (debug_matching) {
238  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-GEM CoPad match in ME1b: bx_alct = " << bx_alct << std::endl << std::endl
239  << "------------------------------------------------------------------------" << std::endl << std::endl;
240  }
241  }
242  }
243 
244  if (debug_matching) {
245  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
246  << "Summary: " << std::endl;
247  if (nSuccesFulMatches>1)
248  LogTrace("CSCGEMCMotherboardME11") << "Too many successful ALCT-CLCT matches in ME1b: " << nSuccesFulMatches
249  << ", CSCDetId " << cscChamber->id()
250  << ", bx_alct = " << bx_alct
251  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
252  else if (nSuccesFulMatches==1)
253  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-CLCT match in ME1b: "
254  << " CSCDetId " << cscChamber->id()
255  << ", bx_alct = " << bx_alct
256  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
257  else if (nSuccesFulGEMMatches==1)
258  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-GEM match in ME1b: "
259  << " CSCDetId " << cscChamber->id()
260  << ", bx_alct = " << bx_alct
261  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
262  else
263  LogTrace("CSCGEMCMotherboardME11") << "Unsuccessful ALCT-CLCT match in ME1b: "
264  << "CSCDetId " << cscChamber->id()
265  << ", bx_alct = " << bx_alct
266  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
267 
268  LogTrace("CSCGEMCMotherboardME11") << "------------------------------------------------------------------------" << std::endl
269  << "Attempt ALCT-CLCT matching in ME1/a in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
270  }
271 
272  // ALCT-to-CLCT matching in ME1a
273  nSuccesFulMatches = 0;
274  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
275  {
276  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
277  if (drop_used_clcts and used_clct_mask_1a[bx_clct]) continue;
278  if (clct1a->bestCLCT[bx_clct].isValid())
279  {
280  const int quality(clct1a->bestCLCT[bx_clct].getQuality());
281  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++Valid ME1a CLCT: " << clct1a->bestCLCT[bx_clct] << std::endl;
282 
283  // pick the pad that corresponds
284  matches<GEMPadDigi> mPads;
285  matchingPads<GEMPadDigi>(clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct],
286  alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1A, mPads);
287  matches<GEMCoPadDigi> mCoPads;
288  matchingPads<GEMCoPadDigi>(clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct],
289  alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1A, mCoPads);
290 
291  if (dropLowQualityCLCTsNoGEMs_ME1a_ and quality < 4 and hasPads){
292  int nFound(mPads.size());
293  const bool clctInEdge(clct1a->bestCLCT[bx_clct].getKeyStrip() < 4 or clct1a->bestCLCT[bx_clct].getKeyStrip() > 93);
294  if (clctInEdge){
295  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT in CSC chamber edge, don't care about GEM pads" << std::endl;
296  }
297  else {
298  if (nFound != 0){
299  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT with " << nFound << " matching GEM trigger pads" << std::endl;
300  }
301  else {
302  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tWarning: low quality CLCT without matching GEM trigger pad" << std::endl;
303  continue;
304  }
305  }
306  }
307  ++nSuccesFulMatches;
308  int mbx = bx_clct-bx_clct_start;
309  correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
310  clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct],
311  mPads, mCoPads,
312  allLCTs1a(bx_alct,mbx,0), allLCTs1a(bx_alct,mbx,1), ME1A);
313  if (debug_matching) {
314  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-CLCT match in ME1a: bx_alct = " << bx_alct
315  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
316  << "]; bx_clct = " << bx_clct << std::endl
317  << "+++ Best CLCT Details: " << clct1a->bestCLCT[bx_clct] << std::endl
318  << "+++ Second CLCT Details: " << clct1a->secondCLCT[bx_clct] << std::endl;
319  }
320  if (allLCTs1a(bx_alct,mbx,0).isValid()){
321  used_clct_mask_1a[bx_clct] += 1;
322  if (match_earliest_clct_only) break;
323  }
324  }
325  }
326 
327  // ALCT-to-GEM matching in ME1a
328  nSuccesFulGEMMatches = 0;
329  if (nSuccesFulMatches==0 and buildLCTfromALCTandGEM_ME1a_){
330  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++No valid ALCT-CLCT matches in ME1a" << std::endl;
331  for (int bx_gem = bx_copad_start; bx_gem <= bx_copad_stop; bx_gem++) {
332  if (not hasCoPads) {
333  continue;
334  }
335 
336  // find the best matching copad
337  matches<GEMCoPadDigi> copads;
338  matchingPads<CSCALCTDigi, GEMCoPadDigi>(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1A, copads);
339 
340  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\t++Number of matching GEM CoPads in BX " << bx_alct << " : "<< copads.size() << std::endl;
341  if (copads.empty()) {
342  continue;
343  }
344 
345  CSCGEMMotherboard::correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
346  copads, allLCTs1a(bx_alct,0,0), allLCTs1a(bx_alct,0,1), ME1A);
347  if (allLCTs1a(bx_alct,0,0).isValid()) {
348  ++nSuccesFulGEMMatches;
349  if (match_earliest_clct_only) break;
350  }
351  if (debug_matching) {
352  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-GEM CoPad match in ME1a: bx_alct = " << bx_alct << std::endl << std::endl
353  << "------------------------------------------------------------------------" << std::endl << std::endl;
354  }
355  }
356  }
357 
358  if (debug_matching) {
359  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
360  << "Summary: " << std::endl;
361  if (nSuccesFulMatches>1)
362  LogTrace("CSCGEMCMotherboardME11") << "Too many successful ALCT-CLCT matches in ME1a: " << nSuccesFulMatches
363  << ", CSCDetId " << cscChamberME1a->id()
364  << ", bx_alct = " << bx_alct
365  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
366  else if (nSuccesFulMatches==1)
367  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-CLCT match in ME1a: "
368  << " CSCDetId " << cscChamberME1a->id()
369  << ", bx_alct = " << bx_alct
370  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
371  else if (nSuccesFulGEMMatches==1)
372  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-GEM match in ME1a: "
373  << " CSCDetId " << cscChamberME1a->id()
374  << ", bx_alct = " << bx_alct
375  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
376  else
377  LogTrace("CSCGEMCMotherboardME11") << "Unsuccessful ALCT-CLCT match in ME1a: "
378  << "CSCDetId " << cscChamberME1a->id()
379  << ", bx_alct = " << bx_alct
380  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
381  }
382 
383  } // end of ALCT valid block
384  else {
385  auto coPads(coPads_[bx_alct]);
386  if (!coPads.empty()) {
387  // keep it simple for the time being, only consider the first copad
388  const int bx_clct_start(bx_alct - match_trig_window_size/2);
389  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
390 
391  // matching in ME1b
393  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
394  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
395  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
396  if (clct->bestCLCT[bx_clct].isValid()) {
397  const int quality(clct->bestCLCT[bx_clct].getQuality());
398  // only use high-Q stubs for the time being
399  if (quality < 4) continue;
400  int mbx = bx_clct-bx_clct_start;
401  CSCGEMMotherboard::correlateLCTsGEM(clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct], coPads,
402  allLCTs1b(bx_alct,mbx,0), allLCTs1b(bx_alct,mbx,1), ME1B);
403  if (debug_matching) {
404  // if (infoV > 1) LogTrace("CSCMotherboard")
405  LogTrace("CSCGEMCMotherboardME11") << "Successful GEM-CLCT match in ME1b: bx_alct = " << bx_alct
406  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
407  << "]; bx_clct = " << bx_clct << std::endl
408  << "+++ Best CLCT Details: " << clct->bestCLCT[bx_clct] << std::endl
409  << "+++ Second CLCT Details: " << clct->secondCLCT[bx_clct] << std::endl;
410  }
411  if (allLCTs1b(bx_alct,mbx,0).isValid()) {
412  used_clct_mask[bx_clct] += 1;
413  if (match_earliest_clct_only) break;
414  }
415  }
416  }
417  }
418 
419  // matching in ME1a
421  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
422  if (bx_clct < 0 || bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
423  if (drop_used_clcts && used_clct_mask_1a[bx_clct]) continue;
424  if (clct1a->bestCLCT[bx_clct].isValid()){
425  const int quality(clct1a->bestCLCT[bx_clct].getQuality());
426  // only use high-Q stubs for the time being
427  if (quality < 4) continue;
428  int mbx = bx_clct-bx_clct_start;
429  CSCGEMMotherboard::correlateLCTsGEM(clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct], coPads,
430  allLCTs1a(bx_alct,mbx,0), allLCTs1a(bx_alct,mbx,1), ME1A);
431  if (debug_matching) {
432  // if (infoV > 1) LogTrace("CSCMotherboard")
433  LogTrace("CSCGEMCMotherboardME11") << "Successful GEM-CLCT match in ME1a: bx_alct = " << bx_alct
434  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
435  << "]; bx_clct = " << bx_clct << std::endl
436  << "+++ Best CLCT Details: " << clct1a->bestCLCT[bx_clct] << std::endl
437  << "+++ Second CLCT Details: " << clct1a->secondCLCT[bx_clct] << std::endl;
438  }
439  if (allLCTs1a(bx_alct,mbx,0).isValid()){
440  used_clct_mask_1a[bx_clct] += 1;
441  if (match_earliest_clct_only) break;
442  }
443  }
444  }
445  }
446  }
447  }
448  } // end of ALCT-centric matching
449 
450  if (debug_matching){
451  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
452  << "Counting the LCTs" << std::endl
453  << "========================================================================" << std::endl;
454  }
455 
456  // reduction of nLCTs per each BX
457  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++)
458  {
459  // counting
460  unsigned int n1a=0, n1b=0;
461  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
462  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
463  {
464  int cbx = bx + mbx - match_trig_window_size/2;
465  if (allLCTs1b(bx,mbx,i).isValid())
466  {
467  n1b++;
468  if (infoV > 0) LogDebug("CSCGEMMotherboardME11")
469  << "1b LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1b(bx,mbx,i)<<std::endl;
470  }
471  if (allLCTs1a(bx,mbx,i).isValid())
472  {
473  n1a++;
474  if (infoV > 0) LogDebug("CSCGEMMotherboardME11")
475  << "1a LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1a(bx,mbx,i)<<std::endl;
476  }
477  }
478  if (infoV > 0 and n1a+n1b>0) LogDebug("CSCGEMMotherboardME11")
479  <<"bx "<<bx<<" nLCT:"<<n1a<<" "<<n1b<<" "<<n1a+n1b<<std::endl;
480 
481  // some simple cross-bx sorting algorithms
482  if (tmb_cross_bx_algo == 1 and (n1a>2 or n1b>2) )
483  {
484  n1a=0, n1b=0;
485  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
486  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
487  {
488  if (allLCTs1b(bx,pref[mbx],i).isValid())
489  {
490  n1b++;
491  if (n1b>2) allLCTs1b(bx,pref[mbx],i).clear();
492  }
493  if (allLCTs1a(bx,pref[mbx],i).isValid())
494  {
495  n1a++;
496  if (n1a>2) allLCTs1a(bx,pref[mbx],i).clear();
497  }
498  }
499 
500  n1a=0, n1b=0;
501  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
502  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
503  {
504  int cbx = bx + mbx - match_trig_window_size/2;
505  if (allLCTs1b(bx,mbx,i).isValid())
506  {
507  n1b++;
508  if (infoV > 0) LogDebug("CSCGEMMotherboardME11")
509  << "1b LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1b(bx,mbx,i)<< std::endl;
510  }
511  if (allLCTs1a(bx,mbx,i).isValid())
512  {
513  n1a++;
514  if (infoV > 0) LogDebug("CSCGEMMotherboardME11")
515  << "1a LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1a(bx,mbx,i)<< std::endl;
516  }
517  }
518  if (infoV > 0 and n1a+n1b>0) LogDebug("CSCGEMMotherboardME11")
519  <<"bx "<<bx<<" nnLCT:"<<n1a<<" "<<n1b<<" "<<n1a+n1b<<std::endl;
520  } // x-bx sorting
521 
522  // Maximum 2 per whole ME11 per BX case:
523  // (supposedly, now we should have max 2 per bx in each 1a and 1b)
524  if (n1a+n1b > max_lcts and tmb_cross_bx_algo == 1)
525  {
526  // do it simple so far: take all low eta 1/b stubs
527  unsigned int nLCT=n1b;
528  n1a=0;
529  // right now nLCT<=2; cut 1a if necessary
530  for (unsigned int mbx=0; mbx<match_trig_window_size; mbx++)
531  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
532  if (allLCTs1a(bx,mbx,i).isValid()) {
533  nLCT++;
534  if (nLCT>max_lcts) allLCTs1a(bx,mbx,i).clear();
535  else n1a++;
536  }
537  if (infoV > 0 and nLCT>0) LogDebug("CSCGEMMotherboardME11")
538  <<"bx "<<bx<<" nnnLCT: "<<n1a<<" "<<n1b<<" "<<n1a+n1b<< std::endl;
539  }
540  }// reduction per bx
541 
542  unsigned int n1b=0, n1a=0;
543  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
544  << "Counting the final LCTs" << std::endl
545  << "========================================================================" << std::endl
546  << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
547 
548  for (const auto& p : readoutLCTs1b()) {
549  n1b++;
550  if (debug_matching)
551  LogTrace("CSCGEMCMotherboardME11") << "1b LCT "<<n1b<<" " << p <<std::endl;
552  }
553 
554  for (const auto& p : readoutLCTs1a()){
555  n1a++;
556  if (debug_matching)
557  LogTrace("CSCGEMCMotherboardME11") << "1a LCT "<<n1a<<" " << p <<std::endl;
558  }
559 }
#define LogDebug(id)
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
std::vector< CSCCLCTDigi > clctV1b
unsigned int match_trig_window_size
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:37
GEMCoPadDigiIdsBX coPads_
const unsigned theEndcap
int pref[CSCConstants::MAX_LCT_TBINS]
const CSCChamber * cscChamber
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
std::vector< GEMCoPadDigi > gemCoPadV
std::vector< CSCALCTDigi > alctV
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
const CSCGeometry * csc_g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart) const
void printGEMTriggerCoPads(int bx_start, int bx_stop, enum CSCPart)
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
#define LogTrace(id)
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
double b
Definition: hdecay.h:120
std::vector< CSCCLCTDigi > clctV1a
GEMPadDigiIdsBX pads_
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
const GEMGeometry * gem_g
void correlateLCTsGEM(CSCALCTDigi &bestALCT, CSCALCTDigi &secondALCT, CSCCLCTDigi &bestCLCT, CSCCLCTDigi &secondCLCT, const GEMPadDigiIds &pads, const GEMCoPadDigiIds &copads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart p) const
void printGEMTriggerPads(int bx_start, int bx_stop, enum CSCPart)
void CSCGEMMotherboardME11::sortLCTs ( std::vector< CSCCorrelatedLCTDigi > &  LCTs,
int  bx,
enum CSCPart  me,
bool(*)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)  sorter 
) const
private

Methods to sort the LCTs

Definition at line 635 of file CSCGEMMotherboardME11.cc.

References allLCTs1a, allLCTs1b, ME1A, and CSCUpgradeMotherboard::sortLCTs().

Referenced by getCLCTs1b(), readoutLCTs(), and sortLCTs().

637 {
638  const auto& allLCTs(me==ME1A ? allLCTs1a : allLCTs1b);
639 
640  allLCTs.getTimeMatched(bx, LCTs);
641 
643 }
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
void CSCGEMMotherboardME11::sortLCTs ( std::vector< CSCCorrelatedLCTDigi > &  LCTs_final,
enum CSCPart  me,
bool(*)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)  sorter 
) const
private

Definition at line 646 of file CSCGEMMotherboardME11.cc.

References spr::find(), CSCConstants::MAX_LCT_TBINS, CSCUpgradeMotherboard::max_lcts, ME1A, ME1B, AlCaHLTBitMon_ParallelJobs::p, sortLCTs(), and CSCUpgradeMotherboard::sortLCTs().

648 {
649  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++)
650  {
651  // get sorted LCTs per subchamber
652  std::vector<CSCCorrelatedLCTDigi> LCTs1a;
653  std::vector<CSCCorrelatedLCTDigi> LCTs1b;
654 
657 
658  // temporary collection with all LCTs in the whole chamber
659  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp;
660  LCTs_tmp.insert(LCTs_tmp.begin(), LCTs1b.begin(), LCTs1b.end());
661  LCTs_tmp.insert(LCTs_tmp.end(), LCTs1a.begin(), LCTs1a.end());
662 
663  // sort the selected LCTs
665 
666  //LCTs reduction per BX
667  if (max_lcts==2)
668  {
669  // loop on all the selected LCTs
670  for (const auto& p: LCTs_tmp){
671  // case when you only want to readout ME1A
672  if (me==ME1A and std::find(LCTs1a.begin(), LCTs1a.end(), p) != LCTs1a.end()){
673  LCTs_final.push_back(p);
674  }
675  // case when you only want to readout ME1B
676  else if(me==ME1B and std::find(LCTs1b.begin(), LCTs1b.end(), p) != LCTs1b.end()){
677  LCTs_final.push_back(p);
678  }
679  }
680  }
681  else {
682  if (!LCTs1a.empty() and !LCTs1b.empty() and me==ME1A)
683  LCTs_final.push_back(*LCTs1a.begin());
684  else if (!LCTs1a.empty() and !LCTs1b.empty() and me==ME1B)
685  LCTs_final.push_back(*LCTs1b.begin());
686  else if (!LCTs1a.empty() and LCTs1b.empty() and me==ME1A)
687  LCTs_final.insert(LCTs_final.end(), LCTs1a.begin(), LCTs1a.end());
688  else if (!LCTs1b.empty() and LCTs1a.empty() and me==ME1B)
689  LCTs_final.insert(LCTs_final.end(), LCTs1b.begin(), LCTs1b.end());
690  }
691  }
692 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &, int bx, enum CSCPart, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const

Member Data Documentation

LCTContainer CSCGEMMotherboardME11::allLCTs1a
private

Definition at line 83 of file CSCGEMMotherboardME11.h.

Referenced by clear(), readoutLCTs(), run(), and sortLCTs().

LCTContainer CSCGEMMotherboardME11::allLCTs1b
private

Definition at line 82 of file CSCGEMMotherboardME11.h.

Referenced by clear(), readoutLCTs(), run(), and sortLCTs().

bool CSCGEMMotherboardME11::buildLCTfromALCTandGEM_ME1a_
private

Definition at line 99 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::buildLCTfromALCTandGEM_ME1b_
private

Definition at line 100 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::buildLCTfromCLCTandGEM_ME1a_
private

Definition at line 101 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::buildLCTfromCLCTandGEM_ME1b_
private

Definition at line 102 of file CSCGEMMotherboardME11.h.

Referenced by run().

std::unique_ptr<CSCCathodeLCTProcessor> CSCGEMMotherboardME11::clct1a

additional Cathode LCT processor for ME1a

Definition at line 46 of file CSCGEMMotherboardME11.h.

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

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

Definition at line 89 of file CSCGEMMotherboardME11.h.

Referenced by getCLCTs1a(), and run().

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

Definition at line 90 of file CSCGEMMotherboardME11.h.

Referenced by getCLCTs1b(), and run().

bool CSCGEMMotherboardME11::disableME1a
private

Definition at line 86 of file CSCGEMMotherboardME11.h.

Referenced by readoutLCTs().

bool CSCGEMMotherboardME11::dropLowQualityALCTsNoGEMs_ME1a_
private

Definition at line 95 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityALCTsNoGEMs_ME1b_
private

Definition at line 96 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityCLCTsNoGEMs_ME1a_
private

Definition at line 93 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::dropLowQualityCLCTsNoGEMs_ME1b_
private

Definition at line 94 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::gangedME1a
private

Definition at line 86 of file CSCGEMMotherboardME11.h.

Referenced by doesALCTCrossCLCT().

bool CSCGEMMotherboardME11::promoteCLCTGEMquality_ME1a_
private

Definition at line 105 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::promoteCLCTGEMquality_ME1b_
private

Definition at line 106 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::smartME1aME1b
private

SLHC: special configuration parameters for ME11 treatment.

Definition at line 86 of file CSCGEMMotherboardME11.h.

Referenced by CSCGEMMotherboardME11(), and run().

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

Definition at line 52 of file CSCGEMMotherboardME11.h.

Referenced by CSCGEMMotherboardME11(), doesALCTCrossCLCT(), and getLUT().