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 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 (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const 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
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) 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
 
unsigned int alctClctOffset
 
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 isSLHC
 
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 ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
const GEMPadDigiIds pads,
const GEMCoPadDigiIds copads,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
enum CSCPart  p 
) const
private

Definition at line 766 of file CSCGEMMotherboardME11.cc.

References CSCTriggerNumbering::chamberFromTriggerLabels(), CSCALCTDigi::clear(), CSCCLCTDigi::clear(), CSCGEMMotherboard::constructLCTsGEM(), doesALCTCrossCLCT(), GEMCoPadDigi::isValid(), CSCCLCTDigi::isValid(), CSCALCTDigi::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().

775 {
776  CSCALCTDigi bestALCT = bALCT;
777  CSCALCTDigi secondALCT = sALCT;
778  CSCCLCTDigi bestCLCT = bCLCT;
779  CSCCLCTDigi secondCLCT = sCLCT;
780 
781  // assume that always anodeBestValid and cathodeBestValid
782  if (secondALCT == bestALCT) secondALCT.clear();
783  if (secondCLCT == bestCLCT) secondCLCT.clear();
784 
785  const bool ok_bb = bestALCT.isValid() and bestCLCT.isValid();
786  const bool ok_bs = bestALCT.isValid() and secondCLCT.isValid();
787  const bool ok_sb = secondALCT.isValid() and bestCLCT.isValid();
788  const bool ok_ss = secondALCT.isValid() and secondCLCT.isValid();
789 
790  const int ok11 = doesALCTCrossCLCT( bestALCT, bestCLCT, p);
791  const int ok12 = doesALCTCrossCLCT( bestALCT, secondCLCT, p);
792  const int ok21 = doesALCTCrossCLCT( secondALCT, bestCLCT, p);
793  const int ok22 = doesALCTCrossCLCT( secondALCT, secondCLCT, p);
794  const int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
795 
796  int dbg=0;
797  int ring = p;
799  CSCDetId did(theEndcap, theStation, ring, chamb, 0);
800  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"debug correlateLCTs in "<<did<< "\n"
801  <<"ALCT1: "<<bestALCT<<"\n"
802  <<"ALCT2: "<<secondALCT<<"\n"
803  <<"CLCT1: "<<bestCLCT<<"\n"
804  <<"CLCT2: "<<secondCLCT<<"\n"
805  <<"ok 11 12 21 22 code = "<<ok11<<" "<<ok12<<" "<<ok21<<" "<<ok22<<" "<<code<<std::endl;
806 
807  if ( code==0 ) return;
808 
809  // LUT defines correspondence between possible ok## combinations
810  // and resulting lct1 and lct2
811  int lut[16][2] = {
812  //ok: 11 12 21 22
813  {0 ,0 }, // 0 0 0 0
814  {22,0 }, // 0 0 0 1
815  {21,0 }, // 0 0 1 0
816  {21,22}, // 0 0 1 1
817  {12,0 }, // 0 1 0 0
818  {12,22}, // 0 1 0 1
819  {12,21}, // 0 1 1 0
820  {12,21}, // 0 1 1 1
821  {11,0 }, // 1 0 0 0
822  {11,22}, // 1 0 0 1
823  {11,21}, // 1 0 1 0
824  {11,22}, // 1 0 1 1
825  {11,12}, // 1 1 0 0
826  {11,22}, // 1 1 0 1
827  {11,12}, // 1 1 1 0
828  {11,22}, // 1 1 1 1
829  };
830 
831  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lut 0 1 = "<<lut[code][0]<<" "<<lut[code][1]<<std::endl;
832 
833  // check matching copads
834  const GEMCoPadDigi& bb_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, bestCLCT, copads, p);
835  const GEMCoPadDigi& bs_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, secondCLCT, copads, p);
836  const GEMCoPadDigi& sb_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, bestCLCT, copads, p);
837  const GEMCoPadDigi& ss_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, secondCLCT, copads, p);
838 
839  // check matching pads
840  const GEMPadDigi& bb_pad = bestMatchingPad<GEMPadDigi>(bestALCT, bestCLCT, pads, p);
841  const GEMPadDigi& bs_pad = bestMatchingPad<GEMPadDigi>(bestALCT, secondCLCT, pads, p);
842  const GEMPadDigi& sb_pad = bestMatchingPad<GEMPadDigi>(secondALCT, bestCLCT, pads, p);
843  const GEMPadDigi& ss_pad = bestMatchingPad<GEMPadDigi>(secondALCT, secondCLCT, pads, p);
844 
845  // evaluate possible combinations
846  const bool ok_bb_copad = ok11==1 and ok_bb and bb_copad.isValid();
847  const bool ok_bs_copad = ok12==1 and ok_bs and bs_copad.isValid();
848  const bool ok_sb_copad = ok21==1 and ok_sb and sb_copad.isValid();
849  const bool ok_ss_copad = ok22==1 and ok_ss and ss_copad.isValid();
850 
851  const bool ok_bb_pad = (not ok_bb_copad) and ok11==1 and ok_bb and bb_pad.isValid();
852  const bool ok_bs_pad = (not ok_bs_copad) and ok12==1 and ok_bs and bs_pad.isValid();
853  const bool ok_sb_pad = (not ok_sb_copad) and ok21==1 and ok_sb and sb_pad.isValid();
854  const bool ok_ss_pad = (not ok_ss_copad) and ok22==1 and ok_ss and ss_pad.isValid();
855 
856  switch (lut[code][0]) {
857  case 11:
858  if (ok_bb_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, bestCLCT, bb_copad, p, 1);
859  if (ok_bb_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, bestCLCT, bb_pad, p, 1);
860  break;
861  case 12:
862  if (ok_bs_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_copad, p, 1);
863  if (ok_bs_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_pad, p, 1);
864  break;
865  case 21:
866  if (ok_sb_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_copad, p, 1);
867  if (ok_sb_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_pad, p, 1);
868  break;
869  case 22:
870  if (ok_ss_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, ss_copad, p, 1);
871  if (ok_ss_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, ss_pad, p, 1);
872  break;
873  default:
874  return;
875  }
876 
877  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lct1: "<<lct1<<std::endl;
878 
879  switch (lut[code][1]){
880  case 12:
881  if (ok_bs_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_copad, p, 2);
882  if (ok_bs_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_pad, p, 2);
883  break;
884  case 21:
885  if (ok_sb_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_copad, p, 2);
886  if (ok_sb_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_pad, p, 2);
887  break;
888  case 22:
889  if (ok_bb_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, bb_copad, p, 2);
890  if (ok_bb_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, bb_pad, p, 2);
891  break;
892  default:
893  return;
894  }
895 
896  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lct2: "<<lct2<<std::endl;
897 
898  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"out of correlateLCTs"<<std::endl;
899  return;
900 }
const unsigned theSector
const unsigned theTrigChamber
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
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
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
#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 733 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().

734 {
735  if ( !c.isValid() or !a.isValid() ) return false;
736  int key_hs = c.getKeyStrip();
737  int key_wg = a.getKeyWG();
738  if ( me == ME1A )
739  {
740  if ( !gangedME1a )
741  {
742  // wrap around ME11 HS number for -z endcap
743  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1A_UNGANGED - key_hs;
744  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1A))[key_wg][0] and
745  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1A))[key_wg][1] ) return true;
746  return false;
747  }
748  else
749  {
750  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1A_GANGED - key_hs;
751  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1Ag))[key_wg][0] and
752  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1Ag))[key_wg][1] ) return true;
753  return false;
754  }
755  }
756  if ( me == ME1B)
757  {
758  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1B - key_hs;
759  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1B))[key_wg][0] and
760  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1B))[key_wg][1] ) return true;
761  }
762  return false;
763 }
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 610 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.

611 {
612  std::vector<CSCCorrelatedLCTDigi> tmpV;
613 
614  // The start time of the L1A*LCT coincidence window should be related
615  // to the fifo_pretrig parameter, but I am not completely sure how.
616  // Just choose it such that the window is centered at bx=7. This may
617  // need further tweaking if the value of tmb_l1a_window_size changes.
618  //static int early_tbins = 4;
619  // The number of LCT bins in the read-out is given by the
620  // tmb_l1a_window_size parameter, forced to be odd
621  const int lct_bins =
623  const int late_tbins = early_tbins + lct_bins;
624 
625  // Start from the vector of all found correlated LCTs and select
626  // those within the LCT*L1A coincidence window.
627  int bx_readout = -1;
628  std::vector<CSCCorrelatedLCTDigi> all_lcts;
629  switch(tmb_cross_bx_algo){
630  case 1:
631  if (me1ab == ME1A and not (mpc_block_me1a or disableME1a)) {
632  allLCTs1a.getMatched(all_lcts);
633  }else if (me1ab == ME1B) {
634  allLCTs1b.getMatched(all_lcts);
635  }
636  break;
637  case 2: sortLCTs(all_lcts, me1ab, CSCUpgradeMotherboard::sortLCTsByQuality);
638  break;
639  case 3: sortLCTs(all_lcts, me1ab, CSCUpgradeMotherboard::sortLCTsByGEMDphi);
640  break;
641  default: LogTrace("CSCGEMCMotherboardME11")<<"tmb_cross_bx_algo error" <<std::endl;
642  break;
643  }
644 
645  for (const auto& lct: all_lcts)
646  {
647  if (!lct.isValid()) continue;
648 
649  int bx = lct.getBX();
650  // Skip LCTs found too early relative to L1Accept.
651  if (bx <= early_tbins) continue;
652 
653  // Skip LCTs found too late relative to L1Accept.
654  if (bx > late_tbins) continue;
655 
656  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
657  // in digi->raw step, LCTs have to be packed into the TMB header, and
658  // currently there is room just for two.
659  if (readout_earliest_2 and (bx_readout == -1 or bx == bx_readout) )
660  {
661  tmpV.push_back(lct);
662  if (bx_readout == -1) bx_readout = bx;
663  }
664  else tmpV.push_back(lct);
665  }
666  return tmpV;
667 }
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 595 of file CSCGEMMotherboardME11.cc.

References ME1A, and CSCMotherboard::readoutLCTs().

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

596 {
597  return readoutLCTs(ME1A);
598 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
std::vector< CSCCorrelatedLCTDigi > CSCGEMMotherboardME11::readoutLCTs1b ( ) const

Definition at line 601 of file CSCGEMMotherboardME11.cc.

References ME1B, and CSCMotherboard::readoutLCTs().

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

602 {
603  return readoutLCTs(ME1B);
604 }
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 81 of file CSCGEMMotherboardME11.cc.

References CSCMotherboard::alct, CSCMotherboard::alctClctOffset, 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().

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

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

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

672 {
673  const auto& allLCTs(me==ME1A ? allLCTs1a : allLCTs1b);
674 
675  allLCTs.getTimeMatched(bx, LCTs);
676 
678 
679  if (LCTs.size() > max_lcts) LCTs.erase(LCTs.begin()+max_lcts, LCTs.end());
680 }
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 683 of file CSCGEMMotherboardME11.cc.

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

685 {
686  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++)
687  {
688  // get sorted LCTs per subchamber
689  std::vector<CSCCorrelatedLCTDigi> LCTs1a;
690  std::vector<CSCCorrelatedLCTDigi> LCTs1b;
691 
694 
695  // temporary collection with all LCTs in the whole chamber
696  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp;
697  LCTs_tmp.insert(LCTs_tmp.begin(), LCTs1b.begin(), LCTs1b.end());
698  LCTs_tmp.insert(LCTs_tmp.end(), LCTs1a.begin(), LCTs1a.end());
699 
700  // sort the selected LCTs
702 
703  //LCTs reduction per BX
704  if (max_lcts > 0)
705  {
706  if (LCTs_tmp.size() > max_lcts) LCTs_tmp.erase(LCTs_tmp.begin()+max_lcts, LCTs_tmp.end());//double check
707  // loop on all the selected LCTs
708  for (const auto& p: LCTs_tmp){
709  // case when you only want to readout ME1A
710  if (me==ME1A and std::find(LCTs1a.begin(), LCTs1a.end(), p) != LCTs1a.end()){
711  LCTs_final.push_back(p);
712  }
713  // case when you only want to readout ME1B
714  else if(me==ME1B and std::find(LCTs1b.begin(), LCTs1b.end(), p) != LCTs1b.end()){
715  LCTs_final.push_back(p);
716  }
717  }
718  }
719  else {
720  if (!LCTs1a.empty() and !LCTs1b.empty() and me==ME1A)
721  LCTs_final.push_back(*LCTs1a.begin());
722  else if (!LCTs1a.empty() and !LCTs1b.empty() and me==ME1B)
723  LCTs_final.push_back(*LCTs1b.begin());
724  else if (!LCTs1a.empty() and LCTs1b.empty() and me==ME1A)
725  LCTs_final.insert(LCTs_final.end(), LCTs1a.begin(), LCTs1a.end());
726  else if (!LCTs1b.empty() and LCTs1a.empty() and me==ME1B)
727  LCTs_final.insert(LCTs_final.end(), LCTs1b.begin(), LCTs1b.end());
728  }
729  }
730 }
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 87 of file CSCGEMMotherboardME11.h.

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

LCTContainer CSCGEMMotherboardME11::allLCTs1b
private

Definition at line 86 of file CSCGEMMotherboardME11.h.

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

bool CSCGEMMotherboardME11::buildLCTfromALCTandGEM_ME1a_
private

Definition at line 103 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::buildLCTfromALCTandGEM_ME1b_
private

Definition at line 104 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::buildLCTfromCLCTandGEM_ME1a_
private

Definition at line 105 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::buildLCTfromCLCTandGEM_ME1b_
private

Definition at line 106 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 93 of file CSCGEMMotherboardME11.h.

Referenced by getCLCTs1a(), and run().

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

Definition at line 94 of file CSCGEMMotherboardME11.h.

Referenced by getCLCTs1b(), and run().

bool CSCGEMMotherboardME11::disableME1a
private

Definition at line 90 of file CSCGEMMotherboardME11.h.

Referenced by readoutLCTs().

bool CSCGEMMotherboardME11::dropLowQualityALCTsNoGEMs_ME1a_
private

Definition at line 99 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityALCTsNoGEMs_ME1b_
private

Definition at line 100 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::dropLowQualityCLCTsNoGEMs_ME1a_
private

Definition at line 97 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::dropLowQualityCLCTsNoGEMs_ME1b_
private

Definition at line 98 of file CSCGEMMotherboardME11.h.

Referenced by run().

bool CSCGEMMotherboardME11::gangedME1a
private

Definition at line 90 of file CSCGEMMotherboardME11.h.

Referenced by doesALCTCrossCLCT().

bool CSCGEMMotherboardME11::promoteCLCTGEMquality_ME1a_
private

Definition at line 109 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::promoteCLCTGEMquality_ME1b_
private

Definition at line 110 of file CSCGEMMotherboardME11.h.

bool CSCGEMMotherboardME11::smartME1aME1b
private

SLHC: special configuration parameters for ME11 treatment.

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