CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
CSCMotherboardME11GEM Class Reference

#include <CSCMotherboardME11GEM.h>

Inheritance diagram for CSCMotherboardME11GEM:
CSCMotherboard

Public Types

enum  ME11Part { ME1B = 1, ME1A =4 }
 

Public Member Functions

void clear ()
 
 CSCMotherboardME11GEM (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboardME11GEM ()
 
std::vector< CSCALCTDigigetALCTs1b ()
 
std::vector< CSCCLCTDigigetCLCTs1a ()
 
std::vector< CSCCLCTDigigetCLCTs1b ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs1a ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs1b ()
 
std::vector< GEMCoPadDigireadoutCoPads ()
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs (enum ME11Part me1ab)
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs1a ()
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs1b ()
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setCSCGeometry (const CSCGeometry *g)
 set CSC and GEM geometries for the matching needs More...
 
void setGEMGeometry (const GEMGeometry *g)
 
std::vector< CSCCorrelatedLCTDigisortLCTsByGEMDPhi (int bx, enum ME11Part=ME1B)
 
std::vector< CSCCorrelatedLCTDigisortLCTsByGEMDPhi (enum ME11Part=ME1B)
 
std::vector< CSCCorrelatedLCTDigisortLCTsByGEMDPhi (std::vector< CSCCorrelatedLCTDigi >)
 
std::vector< CSCCorrelatedLCTDigisortLCTsByQuality (int bx, enum ME11Part=ME1B)
 
std::vector< CSCCorrelatedLCTDigisortLCTsByQuality (enum ME11Part=ME1B)
 
std::vector< CSCCorrelatedLCTDigisortLCTsByQuality (std::vector< CSCCorrelatedLCTDigi >)
 
 ~CSCMotherboardME11GEM ()
 
- 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 ()
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs ()
 
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)
 
virtual ~CSCMotherboard ()=default
 

Public Attributes

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

Private Types

typedef std::pair< unsigned int, const GEMPadDigiGEMPadBX
 
typedef std::map< int, GEMPadsBXGEMPads
 
typedef std::vector< GEMPadBXGEMPadsBX
 

Private Member Functions

int assignGEMRoll (double eta)
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const GEMPadDigi &gem, int me, bool oldDataFormat=false)
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCCLCTDigi &clct, const GEMPadDigi &gem, int roll, int me, bool oldDataFormat=true)
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, bool hasPad, bool hasCoPad)
 
void correlateLCTs (CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2)
 
void correlateLCTsGEM (CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, int me, const GEMPadsBX &pads=GEMPadsBX(), const GEMPadsBX &copads=GEMPadsBX())
 
void correlateLCTsGEM (CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, GEMPadDigi gemPad, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, int me)
 
void correlateLCTsGEM (CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, GEMPadDigi gemPad, int roll, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, int me)
 
void createGEMRollEtaLUT (bool isEven)
 
int deltaPad (int hs, int pad)
 
int deltaRoll (int wg, int roll)
 
bool doesALCTCrossCLCT (CSCALCTDigi &a, CSCCLCTDigi &c, int me)
 
unsigned int encodePatternGEM (const int ptn, const int highPt)
 
unsigned int findQualityGEM (const CSCALCTDigi &aLCT, const GEMPadDigi &gem)
 
unsigned int findQualityGEM (const CSCCLCTDigi &cLCT, const GEMPadDigi &gem)
 
unsigned int findQualityGEM (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, bool hasPad, bool hasCoPad)
 
bool isPadInOverlap (int roll)
 
GEMPadsBX matchingGEMPads (const CSCCLCTDigi &cLCT, const GEMPadsBX &pads=GEMPadsBX(), enum ME11Part=ME1B, bool isCopad=false, bool first=true)
 
GEMPadsBX matchingGEMPads (const CSCALCTDigi &aLCT, const GEMPadsBX &pads=GEMPadsBX(), enum ME11Part=ME1B, bool isCopad=false, bool first=true)
 
GEMPadsBX matchingGEMPads (const CSCCLCTDigi &cLCT, const CSCALCTDigi &aLCT, const GEMPadsBX &pads=GEMPadsBX(), enum ME11Part=ME1B, bool isCopad=false, bool first=true)
 
void printGEMTriggerPads (int minBX, int maxBx, bool iscopad=false)
 
void retrieveGEMCoPads ()
 
void retrieveGEMPads (const GEMPadDigiCollection *pads, unsigned id)
 

Private Attributes

std::vector< CSCALCTDigialctV
 
CSCCorrelatedLCTDigi allLCTs1a [MAX_LCT_BINS][15][2]
 
CSCCorrelatedLCTDigi allLCTs1b [MAX_LCT_BINS][15][2]
 
bool buildLCTfromALCTandGEM_ME1a_
 
bool buildLCTfromALCTandGEM_ME1b_
 
bool buildLCTfromCLCTandGEM_ME1a_
 
bool buildLCTfromCLCTandGEM_ME1b_
 
bool clct_to_alct
 
std::vector< CSCCLCTDigiclctV1a
 
std::vector< CSCCLCTDigiclctV1b
 
GEMPads coPads_
 
bool correctLCTtimingWithGEM_
 
const CSCGeometrycsc_g
 
std::map< int, std::pair< int, int > > cscHsToGemPadME1a_
 
std::map< int, std::pair< int, int > > cscHsToGemPadME1b_
 
std::map< int, std::pair< int, int > > cscWgToGemRoll_
 
bool debug_gem_dphi
 
bool debug_gem_matching
 
bool debug_luts
 
bool disableME1a
 
bool doLCTGhostBustingWithGEMs_
 
bool drop_used_clcts
 
bool dropLowQualityALCTsNoGEMs_ME1a_
 
bool dropLowQualityALCTsNoGEMs_ME1b_
 
bool dropLowQualityCLCTsNoGEMs_ME1a_
 
bool dropLowQualityCLCTsNoGEMs_ME1b_
 
bool firstTwoLCTsInChamber_
 
bool gangedME1a
 
const GEMGeometrygem_g
 
std::vector< GEMCoPadDigigemCoPadV
 
std::map< int, int > gemPadToCscHsME1a_
 
std::map< int, int > gemPadToCscHsME1b_
 
std::map< int, std::pair< double, double > > gemRollToEtaLimits_
 
bool match_earliest_alct_me11_only
 
bool match_earliest_clct_me11_only
 
unsigned int max_me11_lcts
 
int maxDeltaBXCoPad_
 
int maxDeltaBXCoPadEven_
 
int maxDeltaBXCoPadOdd_
 
int maxDeltaBXPad_
 
int maxDeltaBXPadEven_
 
int maxDeltaBXPadOdd_
 
int maxDeltaPadCoPad_
 
int maxDeltaPadCoPadEven_
 
int maxDeltaPadCoPadOdd_
 
int maxDeltaPadPad_
 
int maxDeltaPadPadEven_
 
int maxDeltaPadPadOdd_
 
GEMPads pads_
 
int pref [MAX_LCT_BINS]
 
bool promoteALCTGEMpattern_
 
bool promoteALCTGEMquality_
 
bool promoteCLCTGEMquality_ME1a_
 
bool promoteCLCTGEMquality_ME1b_
 
bool runME11ILT_
 GEM-CSC integrated local algorithm. More...
 
bool smartME1aME1b
 
unsigned int tmb_cross_bx_algo
 
bool useOldLCTDataFormat_
 

Static Private Attributes

static const double lut_pt_vs_dphi_gemcsc [8][3]
 
static const double lut_wg_etaMin_etaMax_even [48][3]
 
static const double lut_wg_etaMin_etaMax_odd [48][3]
 
static const int lut_wg_vs_hs_me1a [48][2]
 
static const int lut_wg_vs_hs_me1ag [48][2]
 
static const int lut_wg_vs_hs_me1b [48][2]
 

Additional Inherited Members

- Protected Types inherited from CSCMotherboard
enum  { MAX_LCT_BINS = 16 }
 
- Protected Member Functions inherited from CSCMotherboard
void checkConfigParameters ()
 
CSCCorrelatedLCTDigi constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
 
void correlateLCTs (CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT)
 
void dumpConfigParams () const
 
unsigned int encodePattern (const int ptn, const int highPt)
 
unsigned int findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
 
void testLCT ()
 
- Static Protected Member Functions inherited from CSCMotherboard
static bool sortByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
unsigned int clct_trig_enable
 
bool drop_used_alcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [MAX_LCT_BINS]
 
int infoV
 
bool isMTCC
 
bool isSLHC
 
bool isTMB07
 
int lct_central_bx
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
bool readout_earliest_2
 
CSCCorrelatedLCTDigi secondLCT [MAX_LCT_BINS]
 
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 24 of file CSCMotherboardME11GEM.h.

Member Typedef Documentation

typedef std::pair<unsigned int, const GEMPadDigi> CSCMotherboardME11GEM::GEMPadBX
private

Definition at line 26 of file CSCMotherboardME11GEM.h.

typedef std::map<int, GEMPadsBX> CSCMotherboardME11GEM::GEMPads
private

Definition at line 28 of file CSCMotherboardME11GEM.h.

typedef std::vector<GEMPadBX> CSCMotherboardME11GEM::GEMPadsBX
private

Definition at line 27 of file CSCMotherboardME11GEM.h.

Member Enumeration Documentation

labels for ME1a and ME1B

Enumerator
ME1B 
ME1A 

Definition at line 53 of file CSCMotherboardME11GEM.h.

Constructor & Destructor Documentation

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

Normal constructor.

Definition at line 181 of file CSCMotherboardME11GEM.cc.

References buildLCTfromALCTandGEM_ME1a_, buildLCTfromALCTandGEM_ME1b_, buildLCTfromCLCTandGEM_ME1a_, buildLCTfromCLCTandGEM_ME1b_, clct1a, clct_to_alct, coPadProcessor, correctLCTtimingWithGEM_, debug_gem_dphi, debug_gem_matching, debug_luts, disableME1a, doLCTGhostBustingWithGEMs_, drop_used_clcts, dropLowQualityALCTsNoGEMs_ME1a_, dropLowQualityALCTsNoGEMs_ME1b_, dropLowQualityCLCTsNoGEMs_ME1a_, dropLowQualityCLCTsNoGEMs_ME1b_, firstTwoLCTsInChamber_, gangedME1a, edm::ParameterSet::getParameter(), CSCMotherboard::isSLHC, funct::m, match_earliest_alct_me11_only, match_earliest_clct_me11_only, CSCMotherboard::match_trig_window_size, max_me11_lcts, maxDeltaBXCoPadEven_, maxDeltaBXCoPadOdd_, maxDeltaBXPadEven_, maxDeltaBXPadOdd_, maxDeltaPadCoPadEven_, maxDeltaPadCoPadOdd_, maxDeltaPadPadEven_, maxDeltaPadPadOdd_, pref, promoteALCTGEMpattern_, promoteALCTGEMquality_, promoteCLCTGEMquality_ME1a_, promoteCLCTGEMquality_ME1b_, runME11ILT_, smartME1aME1b, tmb_cross_bx_algo, and useOldLCTDataFormat_.

184  :
185  CSCMotherboard(endcap, station, sector, subsector, chamber, conf)
186 {
187  const edm::ParameterSet commonParams(conf.getParameter<edm::ParameterSet>("commonParam"));
188 
189  // special configuration parameters for ME11 treatment
190  smartME1aME1b = commonParams.getParameter<bool>("smartME1aME1b");
191  disableME1a = commonParams.getParameter<bool>("disableME1a");
192  gangedME1a = commonParams.getParameter<bool>("gangedME1a");
193  runME11ILT_ = commonParams.getParameter<bool>("runME11ILT");
194 
195  if (!isSLHC) edm::LogError("L1CSCTPEmulatorConfigError")
196  << "+++ Upgrade CSCMotherboardME11GEM constructed while isSLHC is not set! +++\n";
197  if (!smartME1aME1b) edm::LogError("L1CSCTPEmulatorConfigError")
198  << "+++ Upgrade CSCMotherboardME11GEM constructed while smartME1aME1b is not set! +++\n";
199 
200  const edm::ParameterSet alctParams(conf.getParameter<edm::ParameterSet>("alctSLHC"));
201  const edm::ParameterSet clctParams(conf.getParameter<edm::ParameterSet>("clctSLHC"));
202  const edm::ParameterSet me11tmbParams(conf.getParameter<edm::ParameterSet>("me11tmbSLHCGEM"));
203  const edm::ParameterSet coPadParams(conf.getParameter<edm::ParameterSet>("copadParam"));
204 
205  clct1a.reset( new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams, me11tmbParams) );
206  clct1a->setRing(4);
207  coPadProcessor.reset( new GEMCoPadProcessor(endcap, station, 1, chamber, coPadParams) );
208  match_earliest_alct_me11_only = me11tmbParams.getParameter<bool>("matchEarliestAlctME11Only");
209  match_earliest_clct_me11_only = me11tmbParams.getParameter<bool>("matchEarliestClctME11Only");
210 
211  // if true: use regular CLCT-to-ALCT matching in TMB
212  // if false: do ALCT-to-CLCT matching
213  clct_to_alct = me11tmbParams.getParameter<bool>("clctToAlct");
214 
215  // whether to not reuse CLCTs that were used by previous matching ALCTs
216  // in ALCT-to-CLCT algorithm
217  drop_used_clcts = me11tmbParams.getParameter<bool>("tmbDropUsedClcts");
218 
219  tmb_cross_bx_algo = me11tmbParams.getParameter<unsigned int>("tmbCrossBxAlgorithm");
220 
221  // maximum lcts per BX in ME11: 2, 3, 4 or 999
222  max_me11_lcts = me11tmbParams.getParameter<unsigned int>("maxME11LCTs");
223 
225  for (unsigned int m=2; m<match_trig_window_size; m+=2)
226  {
227  pref[m-1] = pref[0] - m/2;
228  pref[m] = pref[0] + m/2;
229  }
230 
231  //----------------------------------------------------------------------------------------//
232 
233  // G E M - C S C I N T E G R A T E D L O C A L A L G O R I T H M
234 
235  //----------------------------------------------------------------------------------------//
236 
237  // debug gem matching
238  debug_gem_matching = me11tmbParams.getParameter<bool>("debugMatching");
239  debug_luts = me11tmbParams.getParameter<bool>("debugLUTs");
240  debug_gem_dphi = me11tmbParams.getParameter<bool>("debugGEMDphi");
241 
242  // deltas used to match to GEM pads
243  maxDeltaBXPadEven_ = me11tmbParams.getParameter<int>("maxDeltaBXPadEven");
244  maxDeltaPadPadEven_ = me11tmbParams.getParameter<int>("maxDeltaPadPadEven");
245  maxDeltaBXPadOdd_ = me11tmbParams.getParameter<int>("maxDeltaBXPadOdd");
246  maxDeltaPadPadOdd_ = me11tmbParams.getParameter<int>("maxDeltaPadPadOdd");
247 
248  // deltas used to match to GEM coincidence pads
249  maxDeltaBXCoPadEven_ = me11tmbParams.getParameter<int>("maxDeltaBXCoPadEven");
250  maxDeltaPadCoPadEven_ = me11tmbParams.getParameter<int>("maxDeltaPadCoPadEven");
251  maxDeltaBXCoPadOdd_ = me11tmbParams.getParameter<int>("maxDeltaBXCoPadOdd");
252  maxDeltaPadCoPadOdd_ = me11tmbParams.getParameter<int>("maxDeltaPadCoPadOdd");
253 
254  // drop low quality stubs if they don't have GEMs
255  dropLowQualityCLCTsNoGEMs_ME1a_ = me11tmbParams.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1a");
256  dropLowQualityCLCTsNoGEMs_ME1b_ = me11tmbParams.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1b");
257  dropLowQualityALCTsNoGEMs_ME1a_ = me11tmbParams.getParameter<bool>("dropLowQualityALCTsNoGEMs_ME1a");
258  dropLowQualityALCTsNoGEMs_ME1b_ = me11tmbParams.getParameter<bool>("dropLowQualityALCTsNoGEMs_ME1b");
259 
260  // build LCT from ALCT and GEM
261  buildLCTfromALCTandGEM_ME1a_ = me11tmbParams.getParameter<bool>("buildLCTfromALCTandGEM_ME1a");
262  buildLCTfromALCTandGEM_ME1b_ = me11tmbParams.getParameter<bool>("buildLCTfromALCTandGEM_ME1b");
263  buildLCTfromCLCTandGEM_ME1a_ = me11tmbParams.getParameter<bool>("buildLCTfromCLCTandGEM_ME1a");
264  buildLCTfromCLCTandGEM_ME1b_ = me11tmbParams.getParameter<bool>("buildLCTfromCLCTandGEM_ME1b");
265 
266  // LCT ghostbusting
267  doLCTGhostBustingWithGEMs_ = me11tmbParams.getParameter<bool>("doLCTGhostBustingWithGEMs");
268 
269  // correct LCT timing with GEMs
270  correctLCTtimingWithGEM_ = me11tmbParams.getParameter<bool>("correctLCTtimingWithGEM");
271 
272  // use "old" or "new" dataformat for integrated LCTs?
273  useOldLCTDataFormat_ = me11tmbParams.getParameter<bool>("useOldLCTDataFormat");
274 
275  // promote ALCT-GEM pattern
276  promoteALCTGEMpattern_ = me11tmbParams.getParameter<bool>("promoteALCTGEMpattern");
277 
278  // promote ALCT-GEM quality
279  promoteALCTGEMquality_ = me11tmbParams.getParameter<bool>("promoteALCTGEMquality");
280  promoteCLCTGEMquality_ME1a_ = me11tmbParams.getParameter<bool>("promoteCLCTGEMquality_ME1a");
281  promoteCLCTGEMquality_ME1b_ = me11tmbParams.getParameter<bool>("promoteCLCTGEMquality_ME1b");
282 
283  // send first 2 LCTs
284  firstTwoLCTsInChamber_ = me11tmbParams.getParameter<bool>("firstTwoLCTsInChamber");
285 }
T getParameter(std::string const &) const
unsigned int match_trig_window_size
bool runME11ILT_
GEM-CSC integrated local algorithm.
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
CSCMotherboardME11GEM::CSCMotherboardME11GEM ( )

Constructor for use during testing.

Definition at line 288 of file CSCMotherboardME11GEM.cc.

References clct1a, funct::m, CSCMotherboard::match_trig_window_size, and pref.

288  : CSCMotherboard()
289 {
290  // Constructor used only for testing.
291 
292  clct1a.reset( new CSCCathodeLCTProcessor() );
293  clct1a->setRing(4);
294 
296  for (unsigned int m=2; m<match_trig_window_size; m+=2)
297  {
298  pref[m-1] = pref[0] - m/2;
299  pref[m] = pref[0] + m/2;
300  }
301 }
unsigned int match_trig_window_size
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
CSCMotherboardME11GEM::~CSCMotherboardME11GEM ( )

Default destructor.

Definition at line 304 of file CSCMotherboardME11GEM.cc.

305 {
306 }

Member Function Documentation

int CSCMotherboardME11GEM::assignGEMRoll ( double  eta)
private

Definition at line 1564 of file CSCMotherboardME11GEM.cc.

References gemRollToEtaLimits_, maxEta, cutBasedElectronID_CSA14_50ns_V0_cff::minEta, AlCaHLTBitMon_ParallelJobs::p, and mps_fire::result.

Referenced by run().

1565 {
1566  int result = -99;
1567  for(auto p : gemRollToEtaLimits_) {
1568  const float minEta((p.second).first);
1569  const float maxEta((p.second).second);
1570  if (minEta <= eta and eta <= maxEta) {
1571  result = p.first;
1572  break;
1573  }
1574  }
1575  return result;
1576 }
double maxEta
std::map< int, std::pair< double, double > > gemRollToEtaLimits_
void CSCMotherboardME11GEM::clear ( void  )

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

Definition at line 309 of file CSCMotherboardME11GEM.cc.

References allLCTs1a, allLCTs1b, clct1a, CSCCorrelatedLCTDigi::clear(), CSCMotherboard::clear(), coPads_, cscHsToGemPadME1a_, cscHsToGemPadME1b_, cscWgToGemRoll_, gemPadToCscHsME1a_, gemPadToCscHsME1b_, gemRollToEtaLimits_, mps_fire::i, CSCMotherboard::match_trig_window_size, CSCMotherboard::MAX_LCT_BINS, and pads_.

Referenced by getCLCTs1b(), and run().

310 {
312  if (clct1a) clct1a->clear();
313  for (int bx = 0; bx < MAX_LCT_BINS; bx++)
314  {
315  //firstLCT1a[bx].clear();
316  //secondLCT1a[bx].clear();
317  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
318  for (int i=0;i<2;i++)
319  {
320  allLCTs1b[bx][mbx][i].clear();
321  allLCTs1a[bx][mbx][i].clear();
322  }
323  }
324  gemRollToEtaLimits_.clear();
325  cscWgToGemRoll_.clear();
326 
327  gemPadToCscHsME1a_.clear();
328  gemPadToCscHsME1b_.clear();
329 
330  cscHsToGemPadME1a_.clear();
331  cscHsToGemPadME1b_.clear();
332 
333  pads_.clear();
334  coPads_.clear();
335 }
std::map< int, std::pair< int, int > > cscHsToGemPadME1a_
unsigned int match_trig_window_size
std::map< int, std::pair< int, int > > cscHsToGemPadME1b_
CSCCorrelatedLCTDigi allLCTs1a[MAX_LCT_BINS][15][2]
std::map< int, std::pair< double, double > > gemRollToEtaLimits_
std::map< int, int > gemPadToCscHsME1a_
std::map< int, std::pair< int, int > > cscWgToGemRoll_
CSCCorrelatedLCTDigi allLCTs1b[MAX_LCT_BINS][15][2]
std::map< int, int > gemPadToCscHsME1b_
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
CSCCorrelatedLCTDigi CSCMotherboardME11GEM::constructLCTsGEM ( const CSCALCTDigi alct,
const GEMPadDigi gem,
int  me,
bool  oldDataFormat = false 
)
private

Definition at line 1579 of file CSCMotherboardME11GEM.cc.

References GEMPadDigi::bx(), gemPadToCscHsME1a_, gemPadToCscHsME1b_, CSCALCTDigi::getBX(), CSCALCTDigi::getKeyWG(), CSCMotherboard::lct_central_bx, lut_wg_vs_hs_me1a, lut_wg_vs_hs_me1b, ME1A, GEMPadDigi::pad(), listBenchmarks::pattern, promoteALCTGEMpattern_, promoteALCTGEMquality_, btvTracks_cfi::quality, and CSCMotherboard::theTrigChamber.

Referenced by correlateLCTsGEM().

1582 {
1583  auto mymap(ME==ME1A ? gemPadToCscHsME1a_ : gemPadToCscHsME1b_);
1584  auto wgvshs(ME==ME1A ? lut_wg_vs_hs_me1a : lut_wg_vs_hs_me1b);
1585  if (oldDataFormat){
1586  // CLCT pattern number - set it to a highest value
1587  // hack to get LCTs in the CSCTF
1588  unsigned int pattern = promoteALCTGEMpattern_ ? 10 : 0;
1589 
1590  // LCT quality number - set it to a very high value
1591  // hack to get LCTs in the CSCTF
1592  unsigned int quality = promoteALCTGEMquality_ ? 14 : 11;
1593 
1594  // Bunch crossing
1595  int bx = alct.getBX();
1596 
1597  // get keyStrip from LUT
1598  int keyStrip = mymap[gem.pad()];
1599 
1600  // get wiregroup from ALCT
1601  int wg = alct.getKeyWG();
1602 
1603  if (keyStrip>wgvshs[wg][0] && keyStrip<wgvshs[wg][1])
1604  { // construct correlated LCT; temporarily assign track number of 0.
1605  return CSCCorrelatedLCTDigi(0, 1, quality, wg, keyStrip, pattern, 0, bx, 0, 0, 0, theTrigChamber);
1606  }
1607  else return CSCCorrelatedLCTDigi(0,0,0,0,0,0,0,0,0,0,0,0);
1608  }
1609  else {
1610 
1611  // CLCT pattern number - no pattern
1612  unsigned int pattern = 0;
1613 
1614  // LCT quality number
1615  unsigned int quality = 1;
1616 
1617  // Bunch crossing
1618  int bx = gem.bx() + lct_central_bx;
1619 
1620  // get keyStrip from LUT
1621  int keyStrip = mymap[gem.pad()];
1622 
1623  // get wiregroup from ALCT
1624  int wg = alct.getKeyWG();
1625 
1626  if (keyStrip>wgvshs[wg][0] && keyStrip<wgvshs[wg][1])
1627  { // construct correlated LCT; temporarily assign track number of 0.
1628  return CSCCorrelatedLCTDigi(0, 1, quality, wg, keyStrip, pattern, 0, bx, 0, 0, 0, theTrigChamber);
1629  }
1630  else return CSCCorrelatedLCTDigi(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1631  }
1632 }
const unsigned theTrigChamber
static const int lut_wg_vs_hs_me1b[48][2]
Definition: ME.h:11
int pad() const
Definition: GEMPadDigi.h:26
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:48
static const int lut_wg_vs_hs_me1a[48][2]
int bx() const
Definition: GEMPadDigi.h:27
std::map< int, int > gemPadToCscHsME1a_
std::map< int, int > gemPadToCscHsME1b_
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
CSCCorrelatedLCTDigi CSCMotherboardME11GEM::constructLCTsGEM ( const CSCCLCTDigi clct,
const GEMPadDigi gem,
int  roll,
int  me,
bool  oldDataFormat = true 
)
private

Definition at line 1634 of file CSCMotherboardME11GEM.cc.

References GEMPadDigi::bx(), encodePatternGEM(), CSCCLCTDigi::getBend(), CSCCLCTDigi::getKeyStrip(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), CSCMotherboard::lct_central_bx, ME1A, listBenchmarks::pattern, promoteCLCTGEMquality_ME1a_, promoteCLCTGEMquality_ME1b_, btvTracks_cfi::quality, and CSCMotherboard::theTrigChamber.

1637 {
1638 // auto mymap(ME==ME1A ? gemPadToCscHsME1a_ : gemPadToCscHsME1b_);
1639  if (oldDataFormat){
1640  // CLCT pattern number - no pattern
1641  unsigned int pattern = encodePatternGEM(clct.getPattern(), clct.getStripType());
1642 
1643  // LCT quality number - dummy quality
1644  const bool promoteCLCTGEMquality(ME == ME1A ? promoteCLCTGEMquality_ME1a_:promoteCLCTGEMquality_ME1b_);
1645  unsigned int quality = promoteCLCTGEMquality ? 14 : 11;
1646 
1647  // Bunch crossing: get it from cathode LCT if anode LCT is not there.
1648  int bx = gem.bx() + lct_central_bx;;
1649 
1650  // pick a random WG in the roll range
1651  int wg(5);
1652 
1653  // construct correlated LCT; temporarily assign track number of 0.
1654  return CSCCorrelatedLCTDigi(0, 1, quality, wg, clct.getKeyStrip(), pattern, clct.getBend(), bx, 0, 0, 0, theTrigChamber);
1655  }
1656  else {
1657  // CLCT pattern number - no pattern
1658  unsigned int pattern = encodePatternGEM(clct.getPattern(), clct.getStripType());
1659 
1660  // LCT quality number - dummy quality
1661  unsigned int quality = 5;//findQualityGEM(alct, gem);
1662 
1663  // Bunch crossing: get it from cathode LCT if anode LCT is not there.
1664  int bx = gem.bx() + lct_central_bx;;
1665 
1666  // ALCT WG
1667  int wg(5);
1668 
1669  // construct correlated LCT; temporarily assign track number of 0.
1670  return CSCCorrelatedLCTDigi(0, 1, quality, wg, 0, pattern, 0, bx, 0, 0, 0, theTrigChamber);
1671  }
1672 }
const unsigned theTrigChamber
unsigned int encodePatternGEM(const int ptn, const int highPt)
int getStripType() const
return striptype
Definition: CSCCLCTDigi.h:39
int getBend() const
return bend
Definition: CSCCLCTDigi.h:42
Definition: ME.h:11
int bx() const
Definition: GEMPadDigi.h:27
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:36
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
CSCCorrelatedLCTDigi CSCMotherboardME11GEM::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
bool  hasPad,
bool  hasCoPad 
)
private

Definition at line 1675 of file CSCMotherboardME11GEM.cc.

References CSCMotherboard::encodePattern(), findQualityGEM(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCCLCTDigi::getBX(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), CSCALCTDigi::isValid(), listBenchmarks::pattern, btvTracks_cfi::quality, and CSCMotherboard::theTrigChamber.

1677 {
1678  // CLCT pattern number
1679  unsigned int pattern = encodePattern(cLCT.getPattern(), cLCT.getStripType());
1680 
1681  // LCT quality number
1682  unsigned int quality = findQualityGEM(aLCT, cLCT, hasPad, hasCoPad);
1683 
1684  // Bunch crossing: get it from cathode LCT if anode LCT is not there.
1685  int bx = aLCT.isValid() ? aLCT.getBX() : cLCT.getBX();
1686 
1687  // construct correlated LCT; temporarily assign track number of 0.
1688  int trknmb = 0;
1689  CSCCorrelatedLCTDigi thisLCT(trknmb, 1, quality, aLCT.getKeyWG(),
1690  cLCT.getKeyStrip(), pattern, cLCT.getBend(),
1691  bx, 0, 0, 0, theTrigChamber);
1692  return thisLCT;
1693 }
const unsigned theTrigChamber
unsigned int encodePattern(const int ptn, const int highPt)
unsigned int findQualityGEM(const CSCALCTDigi &aLCT, const GEMPadDigi &gem)
void CSCMotherboardME11GEM::correlateLCTs ( CSCALCTDigi  bestALCT,
CSCALCTDigi  secondALCT,
CSCCLCTDigi  bestCLCT,
CSCCLCTDigi  secondCLCT,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
)
private

Definition at line 1258 of file CSCMotherboardME11GEM.cc.

References CSCMotherboard::alct_trig_enable, CSCMotherboard::clct_trig_enable, CSCMotherboard::constructLCTs(), CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), CSCMotherboard::match_trig_enable, or, and CSCCorrelatedLCTDigi::setTrknmb().

1264 {
1265  bool anodeBestValid = bestALCT.isValid();
1266  bool anodeSecondValid = secondALCT.isValid();
1267  bool cathodeBestValid = bestCLCT.isValid();
1268  bool cathodeSecondValid = secondCLCT.isValid();
1269 
1270  if (anodeBestValid and !anodeSecondValid) secondALCT = bestALCT;
1271  if (!anodeBestValid and anodeSecondValid) bestALCT = secondALCT;
1272  if (cathodeBestValid and !cathodeSecondValid) secondCLCT = bestCLCT;
1273  if (!cathodeBestValid and cathodeSecondValid) bestCLCT = secondCLCT;
1274 
1275  // ALCT-CLCT matching conditions are defined by "trig_enable" configuration
1276  // parameters.
1277  if ((alct_trig_enable and bestALCT.isValid()) or
1278  (clct_trig_enable and bestCLCT.isValid()) or
1279  (match_trig_enable and bestALCT.isValid() and bestCLCT.isValid()))
1280  {
1281  lct1 = constructLCTs(bestALCT, bestCLCT);
1282  lct1.setTrknmb(1);
1283  }
1284 
1285  if (((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) and
1286  ((alct_trig_enable and secondALCT.isValid()) or
1287  (clct_trig_enable and secondCLCT.isValid()) or
1288  (match_trig_enable and secondALCT.isValid() and secondCLCT.isValid())))
1289  {
1290  lct2 = constructLCTs(secondALCT, secondCLCT);
1291  lct2.setTrknmb(2);
1292  }
1293 }
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
unsigned int clct_trig_enable
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
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
unsigned int match_trig_enable
unsigned int alct_trig_enable
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
void CSCMotherboardME11GEM::correlateLCTsGEM ( CSCALCTDigi  bestALCT,
CSCALCTDigi  secondALCT,
CSCCLCTDigi  bestCLCT,
CSCCLCTDigi  secondCLCT,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
int  me,
const GEMPadsBX pads = GEMPadsBX(),
const GEMPadsBX copads = GEMPadsBX() 
)
private

Definition at line 1353 of file CSCMotherboardME11GEM.cc.

References EnergyCorrector::c, CSCTriggerNumbering::chamberFromTriggerLabels(), CSCALCTDigi::clear(), CSCCLCTDigi::clear(), constructLCTsGEM(), gather_cfg::cout, debug_gem_matching, deltaPad(), deltaRoll(), doesALCTCrossCLCT(), doLCTGhostBustingWithGEMs_, plotBeamSpotDB::first, CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), mps_fire::i, LogTrace, lumiPlot::lut, ME1B, AlCaHLTBitMon_ParallelJobs::p, relativeConstraints::ring, GEMDetId::roll(), CSCCorrelatedLCTDigi::setTrknmb(), CSCMotherboard::theEndcap, CSCMotherboard::theSector, CSCMotherboard::theStation, CSCMotherboard::theSubsector, and CSCMotherboard::theTrigChamber.

Referenced by run().

1362 {
1363  // assume that always anodeBestValid and cathodeBestValid
1364 
1365  if (secondALCT == bestALCT) secondALCT.clear();
1366  if (secondCLCT == bestCLCT) secondCLCT.clear();
1367 
1368  int ok11 = doesALCTCrossCLCT( bestALCT, bestCLCT, me);
1369  int ok12 = doesALCTCrossCLCT( bestALCT, secondCLCT, me);
1370  int ok21 = doesALCTCrossCLCT( secondALCT, bestCLCT, me);
1371  int ok22 = doesALCTCrossCLCT( secondALCT, secondCLCT, me);
1372  int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
1373 
1374  int dbg=0;
1375  int ring = me;
1377  CSCDetId did(theEndcap, theStation, ring, chamb, 0);
1378  if (dbg) LogTrace("CSCMotherboardME11GEM")<<"debug correlateLCTs in "<<did<<std::endl
1379  <<"ALCT1: "<<bestALCT<<std::endl
1380  <<"ALCT2: "<<secondALCT<<std::endl
1381  <<"CLCT1: "<<bestCLCT<<std::endl
1382  <<"CLCT2: "<<secondCLCT<<std::endl
1383  <<"ok 11 12 21 22 code = "<<ok11<<" "<<ok12<<" "<<ok21<<" "<<ok22<<" "<<code<<std::endl;
1384 
1385  if ( code==0 ) return;
1386 
1387  // LUT defines correspondence between possible ok## combinations
1388  // and resulting lct1 and lct2
1389  int lut[16][2] = {
1390  //ok: 11 12 21 22
1391  {0 ,0 }, // 0 0 0 0
1392  {22,0 }, // 0 0 0 1
1393  {21,0 }, // 0 0 1 0
1394  {21,22}, // 0 0 1 1
1395  {12,0 }, // 0 1 0 0
1396  {12,22}, // 0 1 0 1
1397  {12,21}, // 0 1 1 0
1398  {12,21}, // 0 1 1 1
1399  {11,0 }, // 1 0 0 0
1400  {11,22}, // 1 0 0 1
1401  {11,21}, // 1 0 1 0
1402  {11,22}, // 1 0 1 1
1403  {11,12}, // 1 1 0 0
1404  {11,22}, // 1 1 0 1
1405  {11,12}, // 1 1 1 0
1406  {11,22}, // 1 1 1 1
1407  };
1408 
1409  if (dbg) LogTrace("CSCMotherboardME11GEM")<<"lut 0 1 = "<<lut[code][0]<<" "<<lut[code][1]<<std::endl;
1410 
1411  // first check the special case (11,22) where we have an ambiguity
1412  const int nPads(pads.size());
1413  const int nCoPads(copads.size());
1414  const bool hasPads(nPads!=0);
1415  const bool hasCoPads(nCoPads!=0);
1416 
1417  if (doLCTGhostBustingWithGEMs_ and (lut[code][0] == 11) and (lut[code][0] == 22) and hasPads and (me==ME1B)){
1418 
1419  if (debug_gem_matching) std::cout << "++Info: 2 valid ALCTs-CLCTs pairs with trigger pads. Call the GHOSTBUSTERS!!!" << std::endl;
1420  // first check if there are any copads
1421  typedef std::pair<int,int> mypair;
1422  // for each trigger pad, store (deltaRoll,deltaHS) for 11,22,12 and 21.
1423  std::vector<std::tuple<mypair,mypair,mypair,mypair>> deltas;
1424  deltas.clear();
1425 
1426  if (hasCoPads){
1427  for (auto p : copads) {
1428  const GEMDetId detId(p.first);
1429  const int rollN(detId.roll());
1430  const int padN((p.second).pad());
1431 
1432  auto t11(std::make_pair(deltaRoll( bestALCT.getKeyWG(), rollN), deltaPad( bestCLCT.getKeyStrip(), padN)));
1433  auto t22(std::make_pair(deltaRoll(secondALCT.getKeyWG(), rollN), deltaPad(secondCLCT.getKeyStrip(), padN)));
1434  auto t12(std::make_pair(deltaRoll( bestALCT.getKeyWG(), rollN), deltaPad(secondCLCT.getKeyStrip(), padN)));
1435  auto t21(std::make_pair(deltaRoll(secondALCT.getKeyWG(), rollN), deltaPad( bestCLCT.getKeyStrip(), padN)));
1436 
1437  deltas.push_back(std::make_tuple(t11,t22,t12,t21));
1438  }
1439  if (debug_gem_matching){
1440  std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
1441  std::cout << "Printing (deltaRoll, deltaPad) for each (ALCT,CLCT) pair and for each trigger copad" << std::endl;
1442  for (unsigned i =0; i < deltas.size(); ++i){
1443  auto c(deltas.at(i));
1444  std::cout << "\tCoPad " << i << std::endl;
1445  std::cout << "\t11: " << "(" << std::get<0>(c).first << "," << std::get<0>(c).second << "); "
1446  << "22: " << "(" << std::get<1>(c).first << "," << std::get<1>(c).second << "); "
1447  << "12: " << "(" << std::get<2>(c).first << "," << std::get<2>(c).second << "); "
1448  << "21: " << "(" << std::get<3>(c).first << "," << std::get<3>(c).second << ")" << std::endl << std::endl;
1449  }
1450  std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
1451  }
1452 
1453 
1454 // lct1 = constructLCTs(bestALCT, bestCLCT);
1455 // lct1.setTrknmb(1);
1456 // lct2 = constructLCTs(secondALCT, secondCLCT);
1457 // lct2.setTrknmb(2);
1458 
1459 // lct1 = constructLCTs(bestALCT, secondCLCT);
1460 // lct1.setTrknmb(1);
1461 // lct2 = constructLCTs(secondLCT, bestCLCT);
1462 // lct2.setTrknmb(2);
1463  return;
1464  }
1465 
1466  // if no copads were found, do the same with pads...
1467  if (hasPads){
1468  for (auto p : pads) {
1469  const GEMDetId detId(p.first);
1470  const int rollN(detId.roll());
1471  const int padN((p.second).pad());
1472 
1473  auto t11(std::make_pair(deltaRoll( bestALCT.getKeyWG(), rollN), deltaPad( bestCLCT.getKeyStrip(), padN)));
1474  auto t22(std::make_pair(deltaRoll(secondALCT.getKeyWG(), rollN), deltaPad(secondCLCT.getKeyStrip(), padN)));
1475  auto t12(std::make_pair(deltaRoll( bestALCT.getKeyWG(), rollN), deltaPad(secondCLCT.getKeyStrip(), padN)));
1476  auto t21(std::make_pair(deltaRoll(secondALCT.getKeyWG(), rollN), deltaPad( bestCLCT.getKeyStrip(), padN)));
1477 
1478  deltas.push_back(std::make_tuple(t11,t22,t12,t21));
1479  }
1480  if (debug_gem_matching){
1481  std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
1482  std::cout << "Printing (deltaRoll, deltaPad) for each (ALCT,CLCT) pair and for each trigger pad" << std::endl;
1483  for (unsigned i =0; i < deltas.size(); ++i){
1484  auto c(deltas.at(i));
1485  std::cout << "\tPad " << i << std::endl;
1486  std::cout << "\t11: " << "(" << std::get<0>(c).first << "," << std::get<0>(c).second << "); "
1487  << "22: " << "(" << std::get<1>(c).first << "," << std::get<1>(c).second << "); "
1488  << "12: " << "(" << std::get<2>(c).first << "," << std::get<2>(c).second << "); "
1489  << "21: " << "(" << std::get<3>(c).first << "," << std::get<3>(c).second << ")" << std::endl << std::endl;
1490  }
1491  std::cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
1492  }
1493 
1494  return;
1495  }
1496  }
1497 
1498  switch (lut[code][0]) {
1499  case 11:
1500  lct1 = constructLCTsGEM(bestALCT, bestCLCT, hasPads, hasCoPads);
1501  break;
1502  case 12:
1503  lct1 = constructLCTsGEM(bestALCT, secondCLCT, hasPads, hasCoPads);
1504  break;
1505  case 21:
1506  lct1 = constructLCTsGEM(secondALCT, bestCLCT, hasPads, hasCoPads);
1507  break;
1508  case 22:
1509  lct1 = constructLCTsGEM(secondALCT, secondCLCT, hasPads, hasCoPads);
1510  break;
1511  default:
1512  return;
1513  }
1514  lct1.setTrknmb(1);
1515 
1516  if (dbg) LogTrace("CSCMotherboardME11GEM")<<"lct1: "<<lct1<<std::endl;
1517 
1518  switch (lut[code][1])
1519  {
1520  case 12:
1521  lct2 = constructLCTsGEM(bestALCT, secondCLCT, hasPads, hasCoPads);
1522  lct2.setTrknmb(2);
1523  if (dbg) LogTrace("CSCMotherboardME11GEM")<<"lct2: "<<lct2<<std::endl;
1524  return;
1525  case 21:
1526  lct2 = constructLCTsGEM(secondALCT, bestCLCT, hasPads, hasCoPads);
1527  lct2.setTrknmb(2);
1528  if (dbg) LogTrace("CSCMotherboardME11GEM")<<"lct2: "<<lct2<<std::endl;
1529  return;
1530  case 22:
1531  lct2 = constructLCTsGEM(secondALCT, secondCLCT, hasPads, hasCoPads);
1532  lct2.setTrknmb(2);
1533  if (dbg) LogTrace("CSCMotherboardME11GEM")<<"lct2: "<<lct2<<std::endl;
1534  return;
1535  default:
1536  return;
1537  }
1538  if (dbg) LogTrace("CSCMotherboardME11GEM")<<"out of correlateLCTs"<<std::endl;
1539 
1540  return;
1541 }
const unsigned theSector
const unsigned theTrigChamber
const unsigned theEndcap
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:35
Definition: deltas.h:18
int deltaPad(int hs, int pad)
const unsigned theStation
const unsigned theSubsector
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMPadDigi &gem, int me, bool oldDataFormat=false)
int deltaRoll(int wg, int roll)
#define LogTrace(id)
bool doesALCTCrossCLCT(CSCALCTDigi &a, CSCCLCTDigi &c, int me)
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:58
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
void CSCMotherboardME11GEM::correlateLCTsGEM ( CSCALCTDigi  bestALCT,
CSCALCTDigi  secondALCT,
GEMPadDigi  gemPad,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
int  me 
)
private

Definition at line 1296 of file CSCMotherboardME11GEM.cc.

References CSCMotherboard::alct_trig_enable, constructLCTsGEM(), CSCALCTDigi::isValid(), CSCMotherboard::match_trig_enable, or, CSCCorrelatedLCTDigi::setTrknmb(), and useOldLCTDataFormat_.

1301 {
1302  bool anodeBestValid = bestALCT.isValid();
1303  bool anodeSecondValid = secondALCT.isValid();
1304 
1305  if (anodeBestValid and !anodeSecondValid) secondALCT = bestALCT;
1306  if (!anodeBestValid and anodeSecondValid) bestALCT = secondALCT;
1307 
1308  if ((alct_trig_enable and bestALCT.isValid()) or
1309  (match_trig_enable and bestALCT.isValid()))
1310  {
1311  lct1 = constructLCTsGEM(bestALCT, gemPad, ME, useOldLCTDataFormat_);
1312  lct1.setTrknmb(1);
1313  // lct1.setGEMDPhi(0.0);
1314  }
1315 
1316  if ((alct_trig_enable and secondALCT.isValid()) or
1317  (match_trig_enable and secondALCT.isValid() and secondALCT != bestALCT))
1318  {
1319  lct2 = constructLCTsGEM(secondALCT, gemPad, ME, useOldLCTDataFormat_);
1320  lct2.setTrknmb(2);
1321  // lct2.setGEMDPhi(0.0);
1322  }
1323 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
Definition: ME.h:11
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
unsigned int match_trig_enable
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMPadDigi &gem, int me, bool oldDataFormat=false)
unsigned int alct_trig_enable
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
void CSCMotherboardME11GEM::correlateLCTsGEM ( CSCCLCTDigi  bestCLCT,
CSCCLCTDigi  secondCLCT,
GEMPadDigi  gemPad,
int  roll,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
int  me 
)
private

Definition at line 1326 of file CSCMotherboardME11GEM.cc.

References CSCMotherboard::clct_trig_enable, constructLCTsGEM(), CSCCLCTDigi::isValid(), CSCMotherboard::match_trig_enable, or, CSCCorrelatedLCTDigi::setTrknmb(), and useOldLCTDataFormat_.

1331 {
1332  bool cathodeBestValid = bestCLCT.isValid();
1333  bool cathodeSecondValid = secondCLCT.isValid();
1334 
1335  if (cathodeBestValid and !cathodeSecondValid) secondCLCT = bestCLCT;
1336  if (!cathodeBestValid and cathodeSecondValid) bestCLCT = secondCLCT;
1337 
1338  if ((clct_trig_enable and bestCLCT.isValid()) or
1339  (match_trig_enable and bestCLCT.isValid()))
1340  {
1341  lct1 = constructLCTsGEM(bestCLCT, gemPad, roll, ME, useOldLCTDataFormat_);
1342  lct1.setTrknmb(1);
1343  }
1344 
1345  if ((clct_trig_enable and secondCLCT.isValid()) or
1346  (match_trig_enable and secondCLCT.isValid() and secondCLCT != bestCLCT))
1347  {
1348  lct2 = constructLCTsGEM(secondCLCT, gemPad, roll, ME, useOldLCTDataFormat_);
1349  lct2.setTrknmb(2);
1350  }
1351 }
unsigned int clct_trig_enable
Definition: ME.h:11
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
unsigned int match_trig_enable
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMPadDigi &gem, int me, bool oldDataFormat=false)
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
void CSCMotherboardME11GEM::createGEMRollEtaLUT ( bool  isEven)
private

Definition at line 1544 of file CSCMotherboardME11GEM.cc.

References relativeConstraints::chamber, GEMGeometry::chamber(), gem_g, gemRollToEtaLimits_, and gen::n.

Referenced by run().

1545 {
1546  int ch(isEven ? 2 : 1);
1547  auto chamber(gem_g->chamber(GEMDetId(1,1,1,1,ch,0)));
1548  if (chamber==nullptr) return;
1549 
1550  int n = 1;
1551  if (isEven) n = 2; // this only works for the 9-10 partition geometry!!! FIXME
1552  for(auto roll : chamber->etaPartitions()) {
1553  const float half_striplength(roll->specs()->specificTopology().stripLength()/2.);
1554  const LocalPoint lp_top(0., half_striplength, 0.);
1555  const LocalPoint lp_bottom(0., -half_striplength, 0.);
1556  const GlobalPoint gp_top(roll->toGlobal(lp_top));
1557  const GlobalPoint gp_bottom(roll->toGlobal(lp_bottom));
1558  gemRollToEtaLimits_[n] = std::make_pair(gp_top.eta(), gp_bottom.eta());
1559  ++n;
1560  }
1561 }
std::map< int, std::pair< double, double > > gemRollToEtaLimits_
const GEMGeometry * gem_g
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:95
int CSCMotherboardME11GEM::deltaPad ( int  hs,
int  pad 
)
private

Definition at line 1911 of file CSCMotherboardME11GEM.cc.

References funct::abs(), cscHsToGemPadME1b_, min(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by correlateLCTsGEM(), and matchingGEMPads().

1912 {
1913  const auto p(cscHsToGemPadME1b_[hs]);
1914  return std::min(std::abs(p.first - pad), std::abs(p.second - pad));
1915 }
std::map< int, std::pair< int, int > > cscHsToGemPadME1b_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
int CSCMotherboardME11GEM::deltaRoll ( int  wg,
int  roll 
)
private

Definition at line 1904 of file CSCMotherboardME11GEM.cc.

References funct::abs(), cscWgToGemRoll_, min(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by correlateLCTsGEM().

1905 {
1906  const auto p(cscWgToGemRoll_[wg]);
1907  return std::min(std::abs(p.first - pad), std::abs(p.second - pad));
1908 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
std::map< int, std::pair< int, int > > cscWgToGemRoll_
bool CSCMotherboardME11GEM::doesALCTCrossCLCT ( CSCALCTDigi a,
CSCCLCTDigi c,
int  me 
)
private

Definition at line 1226 of file CSCMotherboardME11GEM.cc.

References gangedME1a, CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), lut_wg_vs_hs_me1a, lut_wg_vs_hs_me1ag, lut_wg_vs_hs_me1b, ME1A, ME1B, or, and CSCMotherboard::theEndcap.

Referenced by correlateLCTsGEM().

1227 {
1228  if ( !c.isValid() or !a.isValid() ) return false;
1229  int key_hs = c.getKeyStrip();
1230  int key_wg = a.getKeyWG();
1231  if ( me == ME1A )
1232  {
1233  if ( !gangedME1a )
1234  {
1235  // wrap around ME11 HS number for -z endcap
1236  if (theEndcap==2) key_hs = 95 - key_hs;
1237  if ( key_hs >= lut_wg_vs_hs_me1a[key_wg][0] and
1238  key_hs <= lut_wg_vs_hs_me1a[key_wg][1] ) return true;
1239  return false;
1240  }
1241  else
1242  {
1243  if (theEndcap==2) key_hs = 31 - key_hs;
1244  if ( key_hs >= lut_wg_vs_hs_me1ag[key_wg][0] and
1245  key_hs <= lut_wg_vs_hs_me1ag[key_wg][1] ) return true;
1246  return false;
1247  }
1248  }
1249  if ( me == ME1B)
1250  {
1251  if (theEndcap==2) key_hs = 127 - key_hs;
1252  if ( key_hs >= lut_wg_vs_hs_me1b[key_wg][0] and
1253  key_hs <= lut_wg_vs_hs_me1b[key_wg][1] ) return true;
1254  }
1255  return false;
1256 }
static const int lut_wg_vs_hs_me1ag[48][2]
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
const unsigned theEndcap
static const int lut_wg_vs_hs_me1b[48][2]
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
static const int lut_wg_vs_hs_me1a[48][2]
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
unsigned int CSCMotherboardME11GEM::encodePatternGEM ( const int  ptn,
const int  highPt 
)
private

Definition at line 1696 of file CSCMotherboardME11GEM.cc.

Referenced by constructLCTsGEM().

1697 {
1698  return 0;
1699 }
unsigned int CSCMotherboardME11GEM::findQualityGEM ( const CSCALCTDigi aLCT,
const GEMPadDigi gem 
)
private

Referenced by constructLCTsGEM().

unsigned int CSCMotherboardME11GEM::findQualityGEM ( const CSCCLCTDigi cLCT,
const GEMPadDigi gem 
)
private

Definition at line 1829 of file CSCMotherboardME11GEM.cc.

1830 {
1831  return 0;
1832 }
unsigned int CSCMotherboardME11GEM::findQualityGEM ( const CSCALCTDigi aLCT,
const CSCCLCTDigi cLCT,
bool  hasPad,
bool  hasCoPad 
)
private

Definition at line 1702 of file CSCMotherboardME11GEM.cc.

References CSCALCTDigi::getAccelerator(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuality(), CSCALCTDigi::getQuality(), CSCCLCTDigi::getStripType(), CSCMotherboard::infoV, CSCMotherboard::isTMB07, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), PFRecoTauDiscriminationByIsolation_cfi::offset, or, listBenchmarks::pattern, and btvTracks_cfi::quality.

1704 {
1705 
1706  /*
1707  Same LCT quality definition as standard LCTs
1708  c4 takes GEMs into account!!!
1709  */
1710 
1711  unsigned int quality = 0;
1712 
1713  if (!isTMB07) {
1714  bool isDistrip = (cLCT.getStripType() == 0);
1715 
1716  if (aLCT.isValid() && !(cLCT.isValid())) { // no CLCT
1717  if (aLCT.getAccelerator()) {quality = 1;}
1718  else {quality = 3;}
1719  }
1720  else if (!(aLCT.isValid()) && cLCT.isValid()) { // no ALCT
1721  if (isDistrip) {quality = 4;}
1722  else {quality = 5;}
1723  }
1724  else if (aLCT.isValid() && cLCT.isValid()) { // both ALCT and CLCT
1725  if (aLCT.getAccelerator()) {quality = 2;} // accelerator muon
1726  else { // collision muon
1727  // CLCT quality is, in fact, the number of layers hit, so subtract 3
1728  // to get quality analogous to ALCT one.
1729  int sumQual = aLCT.getQuality() + (cLCT.getQuality()-3);
1730  if (sumQual < 1 || sumQual > 6) {
1731  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
1732  << "+++ findQuality: sumQual = " << sumQual << "+++ \n";
1733  }
1734  if (isDistrip) { // distrip pattern
1735  if (sumQual == 2) {quality = 6;}
1736  else if (sumQual == 3) {quality = 7;}
1737  else if (sumQual == 4) {quality = 8;}
1738  else if (sumQual == 5) {quality = 9;}
1739  else if (sumQual == 6) {quality = 10;}
1740  }
1741  else { // halfstrip pattern
1742  if (sumQual == 2) {quality = 11;}
1743  else if (sumQual == 3) {quality = 12;}
1744  else if (sumQual == 4) {quality = 13;}
1745  else if (sumQual == 5) {quality = 14;}
1746  else if (sumQual == 6) {quality = 15;}
1747  }
1748  }
1749  }
1750  }
1751 #ifdef OLD
1752  else {
1753  // Temporary definition, used until July 2008.
1754  // First if statement is fictitious, just to help the CSC TF emulator
1755  // handle such cases (one needs to make sure they will be accounted for
1756  // in the new quality definition.
1757  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
1758  if (aLCT.isValid() && !(cLCT.isValid())) quality = 1; // no CLCT
1759  else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT
1760  else quality = 0; // both absent; should never happen.
1761  }
1762  else {
1763  // Sum of ALCT and CLCT quality bits. CLCT quality is, in fact, the
1764  // number of layers hit, so subtract 3 to put it to the same footing as
1765  // the ALCT quality.
1766  int sumQual = aLCT.getQuality() + (cLCT.getQuality()-3);
1767  if (sumQual < 1 || sumQual > 6) {
1768  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
1769  << "+++ findQuality: Unexpected sumQual = " << sumQual << "+++\n";
1770  }
1771 
1772  // LCT quality is basically the sum of ALCT and CLCT qualities, but split
1773  // in two groups depending on the CLCT pattern id (higher quality for
1774  // straighter patterns).
1775  int offset = 0;
1776  if (cLCT.getPattern() <= 7) offset = 4;
1777  else offset = 9;
1778  quality = offset + sumQual;
1779  }
1780  }
1781 #endif
1782  else {
1783  // 2008 definition.
1784  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
1785  if (aLCT.isValid() && !(cLCT.isValid())) quality = 1; // no CLCT
1786  else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT
1787  else quality = 0; // both absent; should never happen.
1788  }
1789  else {
1790  int pattern = cLCT.getPattern();
1791  if (pattern == 1) quality = 3; // layer-trigger in CLCT
1792  else {
1793  // CLCT quality is the number of layers hit minus 3.
1794  // CLCT quality is the number of layers hit.
1795  // const int n_gem((pad!=NULL and 1) or (copad!=NULL and 2));
1796  int n_gem = 0;
1797  if (hasPad) n_gem = 1;
1798  if (hasCoPad) n_gem = 2;
1799  const bool a4(aLCT.getQuality() >= 1);
1800  const bool c4((cLCT.getQuality() >= 4) or (cLCT.getQuality() >= 3 and n_gem>=1));
1801  // quality = 4; "reserved for low-quality muons in future"
1802  if (!a4 && !c4) quality = 5; // marginal anode and cathode
1803  else if ( a4 && !c4) quality = 6; // HQ anode, but marginal cathode
1804  else if (!a4 && c4) quality = 7; // HQ cathode, but marginal anode
1805  else if ( a4 && c4) {
1806  if (aLCT.getAccelerator()) quality = 8; // HQ muon, but accel ALCT
1807  else {
1808  // quality = 9; "reserved for HQ muons with future patterns
1809  // quality = 10; "reserved for HQ muons with future patterns
1810  if (pattern == 2 || pattern == 3) quality = 11;
1811  else if (pattern == 4 || pattern == 5) quality = 12;
1812  else if (pattern == 6 || pattern == 7) quality = 13;
1813  else if (pattern == 8 || pattern == 9) quality = 14;
1814  else if (pattern == 10) quality = 15;
1815  else {
1816  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
1817  << "+++ findQuality: Unexpected CLCT pattern id = "
1818  << pattern << "+++\n";
1819  }
1820  }
1821  }
1822  }
1823  }
1824  }
1825  return quality;
1826 }
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:33
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
int getStripType() const
return striptype
Definition: CSCCLCTDigi.h:39
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
int getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:33
int getAccelerator() const
Definition: CSCALCTDigi.h:37
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:36
std::vector<CSCALCTDigi> CSCMotherboardME11GEM::getALCTs1b ( )
inline

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

Definition at line 64 of file CSCMotherboardME11GEM.h.

References alctV.

64 {return alctV;}
std::vector< CSCALCTDigi > alctV
std::vector<CSCCLCTDigi> CSCMotherboardME11GEM::getCLCTs1a ( )
inline

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

Definition at line 67 of file CSCMotherboardME11GEM.h.

References clctV1a.

67 {return clctV1a;}
std::vector< CSCCLCTDigi > clctV1a
std::vector<CSCCLCTDigi> CSCMotherboardME11GEM::getCLCTs1b ( )
inline

Definition at line 68 of file CSCMotherboardME11GEM.h.

References clctV1b, clear(), and setConfigParameters().

68 {return clctV1b;}
std::vector< CSCCLCTDigi > clctV1b
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::getLCTs1a ( )

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

Definition at line 1048 of file CSCMotherboardME11GEM.cc.

References allLCTs1a, disableME1a, mps_fire::i, CSCMotherboard::match_trig_window_size, CSCMotherboard::MAX_LCT_BINS, CSCMotherboard::mpc_block_me1a, and or.

Referenced by readoutLCTs().

1049 {
1050  std::vector<CSCCorrelatedLCTDigi> tmpV;
1051 
1052  // disabled ME1a
1053  if (mpc_block_me1a or disableME1a) return tmpV;
1054 
1055  // Report all LCTs found.
1056  for (int bx = 0; bx < MAX_LCT_BINS; bx++)
1057  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
1058  for (int i=0;i<2;i++)
1059  if (allLCTs1a[bx][mbx][i].isValid()) tmpV.push_back(allLCTs1a[bx][mbx][i]);
1060  return tmpV;
1061 }
unsigned int match_trig_window_size
unsigned int mpc_block_me1a
CSCCorrelatedLCTDigi allLCTs1a[MAX_LCT_BINS][15][2]
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::getLCTs1b ( )

Definition at line 1035 of file CSCMotherboardME11GEM.cc.

References allLCTs1b, mps_fire::i, CSCMotherboard::match_trig_window_size, and CSCMotherboard::MAX_LCT_BINS.

Referenced by readoutLCTs().

1036 {
1037  std::vector<CSCCorrelatedLCTDigi> tmpV;
1038 
1039  for (int bx = 0; bx < MAX_LCT_BINS; bx++)
1040  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
1041  for (int i=0;i<2;i++)
1042  if (allLCTs1b[bx][mbx][i].isValid()) tmpV.push_back(allLCTs1b[bx][mbx][i]);
1043  return tmpV;
1044 }
unsigned int match_trig_window_size
CSCCorrelatedLCTDigi allLCTs1b[MAX_LCT_BINS][15][2]
bool CSCMotherboardME11GEM::isPadInOverlap ( int  roll)
private

Definition at line 1893 of file CSCMotherboardME11GEM.cc.

References cscWgToGemRoll_, or, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by matchingGEMPads(), and printGEMTriggerPads().

1894 {
1895  for (auto& p : cscWgToGemRoll_) {
1896  // overlap region are WGs 10-15
1897  if ((p.first < 10) or (p.first > 15)) continue;
1898  if (((p.second).first <= roll) and (roll <= (p.second).second)) return true;
1899  }
1900  return false;
1901 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::map< int, std::pair< int, int > > cscWgToGemRoll_
CSCMotherboardME11GEM::GEMPadsBX CSCMotherboardME11GEM::matchingGEMPads ( const CSCCLCTDigi cLCT,
const GEMPadsBX pads = GEMPadsBX(),
enum ME11Part  part = ME1B,
bool  isCopad = false,
bool  first = true 
)
private

Definition at line 1919 of file CSCMotherboardME11GEM.cc.

References funct::abs(), gather_cfg::cout, cscHsToGemPadME1a_, cscHsToGemPadME1b_, debug, deltaPad(), CSCCLCTDigi::getKeyStrip(), maxDeltaPadCoPad_, maxDeltaPadPad_, ME1A, or, AlCaHLTBitMon_ParallelJobs::p, and mps_fire::result.

Referenced by matchingGEMPads(), and run().

1920 {
1922 
1923  // fetch the low and high pad edges
1925  int deltaPad(isCoPad ? maxDeltaPadCoPad_ : maxDeltaPadPad_);
1926  const int lowPad(mymap[clct.getKeyStrip()].first);
1927  const int highPad(mymap[clct.getKeyStrip()].second);
1928  const bool debug(false);
1929  if (debug) std::cout << "lowpad " << lowPad << " highpad " << highPad << " delta pad " << deltaPad <<std::endl;
1930  for (auto p: pads){
1931  auto padRoll((p.second).pad());
1932  if (debug) std::cout << "padRoll " << padRoll << std::endl;
1933  if (std::abs(lowPad - padRoll) <= deltaPad or std::abs(padRoll - highPad) <= deltaPad){
1934  if (debug) std::cout << "++Matches! " << std::endl;
1935  result.push_back(p);
1936  if (first) return result;
1937  }
1938  }
1939  return result;
1940 }
std::map< int, std::pair< int, int > > cscHsToGemPadME1a_
std::map< int, std::pair< int, int > > cscHsToGemPadME1b_
int deltaPad(int hs, int pad)
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
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
part
Definition: HCALResponse.h:20
std::unique_ptr< CSCCathodeLCTProcessor > clct
std::vector< GEMPadBX > GEMPadsBX
CSCMotherboardME11GEM::GEMPadsBX CSCMotherboardME11GEM::matchingGEMPads ( const CSCALCTDigi aLCT,
const GEMPadsBX pads = GEMPadsBX(),
enum ME11Part  part = ME1B,
bool  isCopad = false,
bool  first = true 
)
private

Definition at line 1944 of file CSCMotherboardME11GEM.cc.

References gather_cfg::cout, cscWgToGemRoll_, debug, CSCALCTDigi::getKeyWG(), isPadInOverlap(), ME1A, or, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and GEMDetId::roll().

1945 {
1947 
1948  auto alctRoll(cscWgToGemRoll_[alct.getKeyWG()]);
1949  const bool debug(false);
1950  if (debug) std::cout << "ALCT keyWG " << alct.getKeyWG() << ", rolls " << alctRoll.first << " " << alctRoll.second << std::endl;
1951  for (auto p: pads){
1952  auto padRoll(GEMDetId(p.first).roll());
1953  if (debug) std::cout << "Candidate ALCT: " << padRoll << std::endl;
1954  // only pads in overlap are good for ME1A
1955  if (part==ME1A and !isPadInOverlap(padRoll)) continue;
1956  if (alctRoll.first == -99 and alctRoll.second == -99) continue; //invalid region
1957  else if (alctRoll.first == -99 and !(padRoll <= alctRoll.second)) continue; // top of the chamber
1958  else if (alctRoll.second == -99 and !(padRoll >= alctRoll.first)) continue; // bottom of the chamber
1959  else if ((alctRoll.first != -99 and alctRoll.second != -99) and // center
1960  (alctRoll.first > padRoll or padRoll > alctRoll.second)) continue;
1961  if (debug) std::cout << "++Matches! " << std::endl;
1962  result.push_back(p);
1963  if (first) return result;
1964  }
1965  return result;
1966 }
int roll() const
Definition: GEMDetId.h:80
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
#define debug
Definition: HDRShower.cc:19
part
Definition: HCALResponse.h:20
std::map< int, std::pair< int, int > > cscWgToGemRoll_
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::vector< GEMPadBX > GEMPadsBX
CSCMotherboardME11GEM::GEMPadsBX CSCMotherboardME11GEM::matchingGEMPads ( const CSCCLCTDigi cLCT,
const CSCALCTDigi aLCT,
const GEMPadsBX pads = GEMPadsBX(),
enum ME11Part  part = ME1B,
bool  isCopad = false,
bool  first = true 
)
private

Definition at line 1970 of file CSCMotherboardME11GEM.cc.

References gather_cfg::cout, debug, matchingGEMPads(), or, AlCaHLTBitMon_ParallelJobs::p, lumiQueryAPI::q, and mps_fire::result.

1972 {
1974 
1975  // Fetch all (!) pads matching to ALCTs and CLCTs
1976  auto padsClct(matchingGEMPads(clct, pads, part, isCoPad, false));
1977  auto padsAlct(matchingGEMPads(alct, pads, part, isCoPad, false));
1978 
1979  const bool debug(false);
1980  if (debug) std::cout << "-----------------------------------------------------------------------"<<std::endl;
1981  // Check if the pads overlap
1982  for (auto p : padsAlct){
1983  if (debug) std::cout<< "Candidate ALCT: " << p.first << " " << p.second << std::endl;
1984  for (auto q: padsClct){
1985  if (debug) std::cout<< "++Candidate CLCT: " << q.first << " " << q.second << std::endl;
1986  // look for exactly the same pads
1987  if ((p.first != q.first) or GEMPadDigi(p.second) != q.second) continue;
1988  if (debug) std::cout << "++Matches! " << std::endl;
1989  result.push_back(p);
1990  if (first) return result;
1991  }
1992  }
1993  if (debug) std::cout << "-----------------------------------------------------------------------"<<std::endl;
1994  return result;
1995 }
GEMPadsBX matchingGEMPads(const CSCCLCTDigi &cLCT, const GEMPadsBX &pads=GEMPadsBX(), enum ME11Part=ME1B, bool isCopad=false, bool first=true)
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
#define debug
Definition: HDRShower.cc:19
part
Definition: HCALResponse.h:20
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
std::vector< GEMPadBX > GEMPadsBX
void CSCMotherboardME11GEM::printGEMTriggerPads ( int  minBX,
int  maxBx,
bool  iscopad = false 
)
private

Definition at line 1835 of file CSCMotherboardME11GEM.cc.

References coPads_, gather_cfg::cout, plotBeamSpotDB::first, isPadInOverlap(), CSCMotherboard::lct_central_bx, and pads_.

Referenced by run().

1836 {
1837  // pads or copads?
1838  auto thePads(!iscopad ? pads_ : coPads_);
1839  const bool hasPads(thePads.size()!=0);
1840 
1841  std::cout << "------------------------------------------------------------------------" << std::endl;
1842  bool first = true;
1843  for (int bx = bx_start; bx <= bx_stop; bx++) {
1844  // print only the pads for the central BX
1845  if (bx!=lct_central_bx and iscopad) continue;
1846  std::vector<std::pair<unsigned int, const GEMPadDigi> > in_pads = thePads[bx];
1847  if (first) {
1848  if (!iscopad) std::cout << "* GEM trigger pads: " << std::endl;
1849  else std::cout << "* GEM trigger coincidence pads: " << std::endl;
1850  }
1851  first = false;
1852  if (!iscopad) std::cout << "N(pads) BX " << bx << " : " << in_pads.size() << std::endl;
1853  else std::cout << "N(copads) BX " << bx << " : " << in_pads.size() << std::endl;
1854  if (hasPads){
1855  for (auto pad : in_pads){
1856  auto roll_id(GEMDetId(pad.first));
1857  std::cout << "\tdetId " << pad.first << " " << roll_id << ", pad = " << pad.second.pad() << ", BX = " << pad.second.bx() + 6;
1858  if (isPadInOverlap(roll_id.roll())) std::cout << " (in overlap)" << std::endl;
1859  else std::cout << std::endl;
1860  }
1861  }
1862  else
1863  break;
1864  }
1865 }
std::vector< GEMCoPadDigi > CSCMotherboardME11GEM::readoutCoPads ( )

Definition at line 1999 of file CSCMotherboardME11GEM.cc.

References gemCoPadV.

2000 {
2001  return gemCoPadV;
2002 }
std::vector< GEMCoPadDigi > gemCoPadV
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::readoutLCTs ( enum ME11Part  me1ab)

Definition at line 973 of file CSCMotherboardME11GEM.cc.

References gather_cfg::cout, CSCMotherboard::early_tbins, getLCTs1a(), getLCTs1b(), ME1A, ME1B, or, CSCMotherboard::readout_earliest_2, sortLCTsByGEMDPhi(), sortLCTsByQuality(), tmb_cross_bx_algo, and CSCMotherboard::tmb_l1a_window_size.

974 {
975  std::vector<CSCCorrelatedLCTDigi> tmpV;
976 
977  // The start time of the L1A*LCT coincidence window should be related
978  // to the fifo_pretrig parameter, but I am not completely sure how.
979  // Just choose it such that the window is centered at bx=7. This may
980  // need further tweaking if the value of tmb_l1a_window_size changes.
981  //static int early_tbins = 4;
982  // The number of LCT bins in the read-out is given by the
983  // tmb_l1a_window_size parameter, forced to be odd
984  static int lct_bins =
986  static int late_tbins = early_tbins + lct_bins;
987 
988 
989  // Start from the vector of all found correlated LCTs and select
990  // those within the LCT*L1A coincidence window.
991  int bx_readout = -1;
992  std::vector<CSCCorrelatedLCTDigi> tmp_lcts;
993  std::vector<CSCCorrelatedLCTDigi> all_lcts;
994  if (me1ab == ME1A) tmp_lcts = getLCTs1a();
995  if (me1ab == ME1B) tmp_lcts = getLCTs1b();
996  switch(tmb_cross_bx_algo){
997  case 0: all_lcts = tmp_lcts;
998  break;
999  case 1: all_lcts = tmp_lcts;
1000  break;
1001  case 2: all_lcts = sortLCTsByQuality(me1ab);
1002  break;
1003  case 3: all_lcts = sortLCTsByGEMDPhi(me1ab);
1004  break;
1005  default: std::cout<<"tmb_cross_bx_algo error" <<std::endl;
1006  break;
1007  }
1008  std::vector <CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin();
1009  for (; plct != all_lcts.end(); plct++)
1010  {
1011  if (!plct->isValid()) continue;
1012 
1013  int bx = (*plct).getBX();
1014  // Skip LCTs found too early relative to L1Accept.
1015  if (bx <= early_tbins) continue;
1016 
1017  // Skip LCTs found too late relative to L1Accept.
1018  if (bx > late_tbins) continue;
1019 
1020  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
1021  // in digi->raw step, LCTs have to be packed into the TMB header, and
1022  // currently there is room just for two.
1023  if (readout_earliest_2 and (bx_readout == -1 or bx == bx_readout) )
1024  {
1025  tmpV.push_back(*plct);
1026  if (bx_readout == -1) bx_readout = bx;
1027  }
1028  else tmpV.push_back(*plct);
1029  }
1030  return tmpV;
1031 }
std::vector< CSCCorrelatedLCTDigi > sortLCTsByQuality(int bx, enum ME11Part=ME1B)
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
unsigned int tmb_l1a_window_size
std::vector< CSCCorrelatedLCTDigi > getLCTs1b()
std::vector< CSCCorrelatedLCTDigi > getLCTs1a()
std::vector< CSCCorrelatedLCTDigi > sortLCTsByGEMDPhi(int bx, enum ME11Part=ME1B)
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::readoutLCTs1a ( )

Definition at line 958 of file CSCMotherboardME11GEM.cc.

References ME1A, and CSCMotherboard::readoutLCTs().

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

959 {
960  return readoutLCTs(ME1A);
961 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs()
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::readoutLCTs1b ( )

Definition at line 964 of file CSCMotherboardME11GEM.cc.

References ME1B, and CSCMotherboard::readoutLCTs().

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

965 {
966  return readoutLCTs(ME1B);
967 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs()
void CSCMotherboardME11GEM::retrieveGEMCoPads ( )
private

Definition at line 1884 of file CSCMotherboardME11GEM.cc.

References coPads_, gemCoPadV, and CSCMotherboard::lct_central_bx.

Referenced by run().

1885 {
1886  for (auto copad: gemCoPadV){
1887  if (copad.first().bx() != lct_central_bx) continue;
1888  coPads_[copad.bx(1)].push_back(std::make_pair(copad.roll(), copad.first()));
1889  coPads_[copad.bx(1)].push_back(std::make_pair(copad.roll(), copad.second()));
1890  }
1891 }
std::vector< GEMCoPadDigi > gemCoPadV
void CSCMotherboardME11GEM::retrieveGEMPads ( const GEMPadDigiCollection pads,
unsigned  id 
)
private

Definition at line 1867 of file CSCMotherboardME11GEM.cc.

References gem_g, CSCMotherboard::lct_central_bx, maxDeltaBXPad_, pads_, and GEMGeometry::superChamber().

Referenced by run().

1868 {
1869  auto superChamber(gem_g->superChamber(id));
1870  for (auto ch : superChamber->chambers()) {
1871  for (auto roll : ch->etaPartitions()) {
1872  GEMDetId roll_id(roll->id());
1873  auto pads_in_det = gemPads->get(roll_id);
1874  for (auto pad = pads_in_det.first; pad != pads_in_det.second; ++pad) {
1875  const int bx_shifted(lct_central_bx + pad->bx());
1876  for (int bx = bx_shifted - maxDeltaBXPad_;bx <= bx_shifted + maxDeltaBXPad_; ++bx) {
1877  pads_[bx].push_back(std::make_pair(roll_id, *pad));
1878  }
1879  }
1880  }
1881  }
1882 }
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:91
const GEMGeometry * gem_g
void CSCMotherboardME11GEM::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiCollection gemPads 
)

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

Definition at line 347 of file CSCMotherboardME11GEM.cc.

References CSCMotherboard::alct, alctV, allLCTs1a, allLCTs1b, assignGEMRoll(), b, buildLCTfromALCTandGEM_ME1a_, buildLCTfromALCTandGEM_ME1b_, buildLCTfromCLCTandGEM_ME1a_, buildLCTfromCLCTandGEM_ME1b_, CSCTriggerGeomManager::chamber(), CSCGeometry::chamber(), GEMGeometry::chamber(), CSCMotherboard::clct, clct1a, clctV1a, clctV1b, CSCCorrelatedLCTDigi::clear(), clear(), coPadProcessor, coPads_, correctLCTtimingWithGEM_, correlateLCTsGEM(), gather_cfg::cout, createGEMRollEtaLUT(), csc_g, cscHsToGemPadME1a_, cscHsToGemPadME1b_, cscWgToGemRoll_, debug_gem_matching, debug_luts, drop_used_clcts, dropLowQualityCLCTsNoGEMs_ME1a_, dropLowQualityCLCTsNoGEMs_ME1b_, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, plotBeamSpotDB::first, gem_g, gemCoPadV, gemPadToCscHsME1a_, gemPadToCscHsME1b_, gemRollToEtaLimits_, CSCTriggerGeometry::get(), runTauDisplay::gp, mps_fire::i, CSCMotherboard::infoV, createfilelist::int, LogDebug, lut_wg_etaMin_etaMax_even, lut_wg_etaMin_etaMax_odd, match_earliest_clct_me11_only, CSCMotherboard::match_trig_window_size, matchingGEMPads(), CSCAnodeLCTProcessor::MAX_ALCT_BINS, CSCCathodeLCTProcessor::MAX_CLCT_BINS, CSCMotherboard::MAX_LCT_BINS, max_me11_lcts, maxDeltaBXCoPad_, maxDeltaBXCoPadEven_, maxDeltaBXCoPadOdd_, maxDeltaBXPad_, maxDeltaBXPadEven_, maxDeltaBXPadOdd_, maxDeltaPadCoPad_, maxDeltaPadCoPadEven_, maxDeltaPadCoPadOdd_, maxDeltaPadPad_, maxDeltaPadPadEven_, maxDeltaPadPadOdd_, ME1A, ME1B, or, AlCaHLTBitMon_ParallelJobs::p, pads_, pref, printGEMTriggerPads(), btvTracks_cfi::quality, readoutLCTs1a(), readoutLCTs1b(), retrieveGEMCoPads(), retrieveGEMPads(), runME11ILT_, smartME1aME1b, CSCMotherboard::theEndcap, CSCMotherboard::theSector, CSCMotherboard::theStation, CSCMotherboard::theSubsector, CSCMotherboard::theTrigChamber, and tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build().

350 {
351  clear();
352 
353  if (!( alct and clct and clct1a and smartME1aME1b))
354  {
355  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
356  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
357  return;
358  }
359 
360  alctV = alct->run(wiredc); // run anodeLCT
361  clctV1b = clct->run(compdc); // run cathodeLCT in ME1/b
362  clctV1a = clct1a->run(compdc); // run cathodeLCT in ME1/a
363  gemCoPadV = coPadProcessor->run(gemPads); // run copad processor in GE1/1
364 
365  bool gemGeometryAvailable(false);
366  if (gem_g != nullptr) {
367  if (infoV >= 0) edm::LogInfo("L1CSCTPEmulatorSetupInfo")
368  << "+++ run() called for GEM-CSC integrated trigger! +++ \n";
369  gemGeometryAvailable = true;
370  }
371 
372  int used_clct_mask[20], used_clct_mask_1a[20];
373  for (int b=0;b<20;b++)
374  used_clct_mask[b] = used_clct_mask_1a[b] = 0;
375 
376  // retrieve CSCChamber geometry
378  const CSCChamber* cscChamberME1b(geo_manager->chamber(theEndcap, theStation, theSector, theSubsector, theTrigChamber));
379  const CSCDetId me1bId(cscChamberME1b->id());
380  const CSCDetId me1aId(me1bId.endcap(), 1, 4, me1bId.chamber());
381  const CSCChamber* cscChamberME1a(csc_g->chamber(me1aId));
382 
383  if (runME11ILT_){
384 
385  // check for GEM geometry
386  if (not gemGeometryAvailable){
387  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
388  << "+++ run() called for GEM-CSC integrated trigger without valid GEM geometry! +++ \n";
389  return;
390  }
391 
392  // trigger geometry
393  const CSCLayer* keyLayerME1b(cscChamberME1b->layer(3));
394  const CSCLayerGeometry* keyLayerGeometryME1b(keyLayerME1b->geometry());
395  const CSCLayer* keyLayerME1a(cscChamberME1a->layer(3));
396  const CSCLayerGeometry* keyLayerGeometryME1a(keyLayerME1a->geometry());
397 
398  const bool isEven(me1bId.chamber()%2==0);
399  const int region((theEndcap == 1) ? 1: -1);
400  const GEMDetId gem_id(region, 1, theStation, 1, me1bId.chamber(), 0);
401  const GEMChamber* gemChamber(gem_g->chamber(gem_id));
402 
403  // initialize depending on whether even or odd
408 
409  // LUT<roll,<etaMin,etaMax> >
410  createGEMRollEtaLUT(isEven);
411  if (debug_luts){
412  LogDebug("CSCMotherboardME11GEM") << "me1b Det "<< me1bId<<" "<< me1bId.rawId() <<" "
413  << (isEven ? "Even":"odd") <<" chamber "<< me1bId.chamber()<<std::endl;
414  if (gemRollToEtaLimits_.size())
415  for(auto p : gemRollToEtaLimits_)
416  LogDebug("CSCMotherboardME11GEM") << "pad "<< p.first << " min eta " << (p.second).first << " max eta " << (p.second).second << std::endl;
417  }
418 
419  // loop on all wiregroups to create a LUT <WG,rollMin,rollMax>
420  const int numberOfWG(keyLayerGeometryME1b->numberOfWireGroups());
421  for (int i = 0; i< numberOfWG; ++i){
422  auto etaMin(isEven ? lut_wg_etaMin_etaMax_even[i][1] : lut_wg_etaMin_etaMax_odd[i][1]);
423  auto etaMax(isEven ? lut_wg_etaMin_etaMax_even[i][2] : lut_wg_etaMin_etaMax_odd[i][2]);
425  }
426  if (debug_luts){
427  for(auto p : cscWgToGemRoll_) {
428  LogDebug("CSCMotherboardME11GEM") << "WG "<< p.first << " GEM pads " << (p.second).first << " " << (p.second).second << std::endl;
429  }
430  }
431 
432  // pick any roll
433  auto randRoll(gemChamber->etaPartition(2));
434 
435  // ME1a
436  auto nStripsME1a(keyLayerGeometryME1a->numberOfStrips());
437  for (float i = 0; i< nStripsME1a; i = i+0.5){
438  const LocalPoint lpCSC(keyLayerGeometryME1a->topology()->localPosition(i));
439  const GlobalPoint gp(keyLayerME1a->toGlobal(lpCSC));
440  const LocalPoint lpGEM(randRoll->toLocal(gp));
441  const int HS(i/0.5);
442  const bool edge(HS < 4 or HS > 93);
443  const float pad(edge ? -99 : randRoll->pad(lpGEM));
444  // HS are wrapped-around
445  cscHsToGemPadME1a_[HS] = std::make_pair(std::floor(pad),std::ceil(pad));
446  }
447  // ME1b
448  auto nStripsME1b(keyLayerGeometryME1b->numberOfStrips());
449  for (float i = 0; i< nStripsME1b; i = i+0.5){
450  const LocalPoint lpCSC(keyLayerGeometryME1b->topology()->localPosition(i));
451  const GlobalPoint gp(keyLayerME1b->toGlobal(lpCSC));
452  const LocalPoint lpGEM(randRoll->toLocal(gp));
453  const int HS(i/0.5);
454  const bool edge(HS < 5 or HS > 124);
455  const float pad(edge ? -99 : randRoll->pad(lpGEM));
456  // HS are wrapped-around
457  cscHsToGemPadME1b_[HS] = std::make_pair(std::floor(pad),std::ceil(pad));
458  }
459  if (debug_luts){
460  LogDebug("CSCMotherboardME11GEM") << "detId " << me1bId;
461  LogDebug("CSCMotherboardME11GEM") << "CSCHSToGEMPad LUT in ME1a";
462  for(auto p : cscHsToGemPadME1a_) {
463  LogDebug("CSCMotherboardME11GEM") << "CSC HS "<< p.first << " GEM Pad low " << (p.second).first << " GEM Pad high " << (p.second).second;
464  }
465  LogDebug("CSCMotherboardME11GEM") << "CSCHSToGEMPad LUT in ME1b";
466  for(auto p : cscHsToGemPadME1b_) {
467  LogDebug("CSCMotherboardME11GEM") << "CSC HS "<< p.first << " GEM Pad low " << (p.second).first << " GEM Pad high " << (p.second).second;
468  }
469  }
470 
471  const int nGEMPads(randRoll->npads());
472  for (int i = 0; i< nGEMPads; ++i){
473  const LocalPoint lpGEM(randRoll->centreOfPad(i));
474  const GlobalPoint gp(randRoll->toGlobal(lpGEM));
475  const LocalPoint lpCSCME1a(keyLayerME1a->toLocal(gp));
476  const LocalPoint lpCSCME1b(keyLayerME1b->toLocal(gp));
477  const float stripME1a(keyLayerGeometryME1a->strip(lpCSCME1a));
478  const float stripME1b(keyLayerGeometryME1b->strip(lpCSCME1b));
479  // HS are wrapped-around
480  gemPadToCscHsME1a_[i] = (int) (stripME1a - 0.25)/0.5;
481  gemPadToCscHsME1b_[i] = (int) (stripME1b - 0.25)/0.5;
482  }
483  if (debug_luts){
484  LogDebug("CSCMotherboardME11GEM") << "detId " << me1bId;
485  LogDebug("CSCMotherboardME11GEM") << "GEMPadToCSCHs LUT in ME1a";
486  for(auto p : gemPadToCscHsME1a_) {
487  LogDebug("CSCMotherboardME11GEM") << "GEM Pad "<< p.first << " CSC HS: " << p.second;
488  }
489  LogDebug("CSCMotherboardME11GEM") << "GEMPadToCSCHs LUT in ME1b";
490  for(auto p : gemPadToCscHsME1b_) {
491  LogDebug("CSCMotherboardME11GEM") << "GEM Pad "<< p.first << " CSC HS: " << p.second;
492  }
493  }
494 
495  // retrieve pads and copads in a certain BX window for this CSC
496  pads_.clear();
497  coPads_.clear();
498  retrieveGEMPads(gemPads, gem_id);
500  }
501 
502  const bool hasPads(pads_.size()!=0);
503  const bool hasCoPads(hasPads and coPads_.size()!=0);
504  bool hasLCTs(false);
505 
506  // ALCT-centric matching
507  for (int bx_alct = 0; bx_alct < CSCAnodeLCTProcessor::MAX_ALCT_BINS; bx_alct++)
508  {
509  if (alct->bestALCT[bx_alct].isValid())
510  {
511  const int bx_clct_start(bx_alct - match_trig_window_size/2);
512  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
513  const int bx_copad_start(bx_alct - maxDeltaBXCoPad_);
514  const int bx_copad_stop(bx_alct + maxDeltaBXCoPad_);
515 
516  if (debug_gem_matching){
517  std::cout << "========================================================================" << std::endl;
518  std::cout << "ALCT-CLCT matching in ME1/1 chamber: " << cscChamberME1b->id() << std::endl;
519  std::cout << "------------------------------------------------------------------------" << std::endl;
520  std::cout << "+++ Best ALCT Details: ";
521  alct->bestALCT[bx_alct].print();
522  std::cout << "+++ Second ALCT Details: ";
523  alct->secondALCT[bx_alct].print();
524 
525  printGEMTriggerPads(bx_clct_start, bx_clct_stop);
526  printGEMTriggerPads(bx_clct_start, bx_clct_stop, true);
527 
528  std::cout << "------------------------------------------------------------------------" << std::endl;
529  std::cout << "Attempt ALCT-CLCT matching in ME1/b in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
530  }
531 
532  // ALCT-to-CLCT matching in ME1b
533  int nSuccesFulMatches = 0;
534  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
535  {
536  if (bx_clct < 0 or bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS) continue;
537  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
538  if (clct->bestCLCT[bx_clct].isValid())
539  {
540  const int quality(clct->bestCLCT[bx_clct].getQuality());
541  if (debug_gem_matching) std::cout << "++Valid ME1b CLCT: " << clct->bestCLCT[bx_clct] << std::endl;
542 
543  // pick the pad that corresponds
544  auto matchingPads(matchingGEMPads(clct->bestCLCT[bx_clct], alct->bestALCT[bx_alct], pads_[bx_clct], ME1B, false));
545  auto matchingCoPads(matchingGEMPads(clct->bestCLCT[bx_clct], alct->bestALCT[bx_alct], coPads_[bx_clct], ME1B, true));
546  if (runME11ILT_ and dropLowQualityCLCTsNoGEMs_ME1b_ and quality < 4 and hasPads){
547  int nFound(matchingPads.size());
548  const bool clctInEdge(clct->bestCLCT[bx_clct].getKeyStrip() < 5 or clct->bestCLCT[bx_clct].getKeyStrip() > 124);
549  if (clctInEdge){
550  if (debug_gem_matching) std::cout << "\tInfo: low quality CLCT in CSC chamber edge, don't care about GEM pads" << std::endl;
551  }
552  else {
553  if (nFound != 0){
554  if (debug_gem_matching) std::cout << "\tInfo: low quality CLCT with " << nFound << " matching GEM trigger pads" << std::endl;
555  }
556  else {
557  if (debug_gem_matching) std::cout << "\tWarning: low quality CLCT without matching GEM trigger pad" << std::endl;
558  continue;
559  }
560  }
561  }
562 
563  // check timing
565  int nFound(matchingCoPads.size());
566  if (nFound != 0 and bx_alct == 6 and bx_clct != 6){
567  if (debug_gem_matching) std::cout << "\tInfo: CLCT with incorrect timing" << std::endl;
568  continue;
569  }
570  }
571 
572  ++nSuccesFulMatches;
573 
574  hasLCTs = true;
575  // if (infoV > 1) LogTrace("CSCMotherboard")
576  int mbx = bx_clct-bx_clct_start;
577  correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
578  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct],
579  allLCTs1b[bx_alct][mbx][0], allLCTs1b[bx_alct][mbx][1], ME1B, matchingPads, matchingCoPads);
580  if (debug_gem_matching) {
581  std::cout << "Successful ALCT-CLCT match in ME1b: bx_alct = " << bx_alct
582  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
583  << "]; bx_clct = " << bx_clct << std::endl;
584  std::cout << "+++ Best CLCT Details: ";
585  clct->bestCLCT[bx_clct].print();
586  std::cout << "+++ Second CLCT Details: ";
587  clct->secondCLCT[bx_clct].print();
588  }
589 
590  if (allLCTs1b[bx_alct][mbx][0].isValid()) {
591  used_clct_mask[bx_clct] += 1;
593  }
594  }
595  }
596 
597  // ALCT-to-GEM matching in ME1b
598  int nSuccesFulGEMMatches = 0;
599  if (runME11ILT_ and nSuccesFulMatches==0 and buildLCTfromALCTandGEM_ME1b_){
600  if (debug_gem_matching) std::cout << "++No valid ALCT-CLCT matches in ME1b" << std::endl;
601  for (int bx_gem = bx_copad_start; bx_gem <= bx_copad_stop; bx_gem++) {
602  if (not hasCoPads) {
603  continue;
604  }
605 
606  // find the best matching copad - first one
607  auto copads(matchingGEMPads(alct->bestALCT[bx_alct], coPads_[bx_gem], ME1B, true));
608  if (debug_gem_matching) std::cout << "\t++Number of matching GEM CoPads in BX " << bx_alct << " : "<< copads.size() << std::endl;
609  if (copads.size()==0) {
610  continue;
611  }
612 
613  correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
614  copads.at(0).second, allLCTs1b[bx_alct][0][0], allLCTs1b[bx_alct][0][1], ME1B);
615  if (allLCTs1b[bx_alct][0][0].isValid()) {
616  ++nSuccesFulGEMMatches;
618  }
619  if (debug_gem_matching) {
620  std::cout << "Successful ALCT-GEM CoPad match in ME1b: bx_alct = " << bx_alct << std::endl << std::endl;
621  std::cout << "------------------------------------------------------------------------" << std::endl << std::endl;
622  }
623  }
624  }
625 
626  if (debug_gem_matching) {
627  std::cout << "========================================================================" << std::endl;
628  std::cout << "Summary: " << std::endl;
629  if (nSuccesFulMatches>1)
630  std::cout << "Too many successful ALCT-CLCT matches in ME1b: " << nSuccesFulMatches
631  << ", CSCDetId " << cscChamberME1b->id()
632  << ", bx_alct = " << bx_alct
633  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
634  else if (nSuccesFulMatches==1)
635  std::cout << "1 successful ALCT-CLCT match in ME1b: "
636  << " CSCDetId " << cscChamberME1b->id()
637  << ", bx_alct = " << bx_alct
638  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
639  else if (nSuccesFulGEMMatches==1)
640  std::cout << "1 successful ALCT-GEM match in ME1b: "
641  << " CSCDetId " << cscChamberME1b->id()
642  << ", bx_alct = " << bx_alct
643  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
644  else
645  std::cout << "Unsuccessful ALCT-CLCT match in ME1b: "
646  << "CSCDetId " << cscChamberME1b->id()
647  << ", bx_alct = " << bx_alct
648  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
649 
650  std::cout << "------------------------------------------------------------------------" << std::endl;
651  std::cout << "Attempt ALCT-CLCT matching in ME1/a in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
652  }
653 
654  // ALCT-to-CLCT matching in ME1a
655  nSuccesFulMatches = 0;
656  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
657  {
658  if (bx_clct < 0 or bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS) continue;
659  if (drop_used_clcts and used_clct_mask_1a[bx_clct]) continue;
660  if (clct1a->bestCLCT[bx_clct].isValid())
661  {
662  const int quality(clct1a->bestCLCT[bx_clct].getQuality());
663  if (debug_gem_matching) std::cout << "++Valid ME1a CLCT: " << clct1a->bestCLCT[bx_clct] << std::endl;
664 
665  // pick the pad that corresponds
666  auto matchingPads(matchingGEMPads(clct1a->bestCLCT[bx_clct], alct->bestALCT[bx_alct], pads_[bx_clct], ME1A, false));
667  auto matchingCoPads(matchingGEMPads(clct1a->bestCLCT[bx_clct], alct->bestALCT[bx_alct], coPads_[bx_clct], ME1A, true));
668  if (runME11ILT_ and dropLowQualityCLCTsNoGEMs_ME1a_ and quality < 4 and hasPads){
669  int nFound(matchingPads.size());
670  const bool clctInEdge(clct1a->bestCLCT[bx_clct].getKeyStrip() < 4 or clct1a->bestCLCT[bx_clct].getKeyStrip() > 93);
671  if (clctInEdge){
672  if (debug_gem_matching) std::cout << "\tInfo: low quality CLCT in CSC chamber edge, don't care about GEM pads" << std::endl;
673  }
674  else {
675  if (nFound != 0){
676  if (debug_gem_matching) std::cout << "\tInfo: low quality CLCT with " << nFound << " matching GEM trigger pads" << std::endl;
677  }
678  else {
679  if (debug_gem_matching) std::cout << "\tWarning: low quality CLCT without matching GEM trigger pad" << std::endl;
680  continue;
681  }
682  }
683  }
684  ++nSuccesFulMatches;
685  int mbx = bx_clct-bx_clct_start;
686  correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
687  clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct],
688  allLCTs1a[bx_alct][mbx][0], allLCTs1a[bx_alct][mbx][1], ME1A, matchingPads, matchingCoPads);
689  if (debug_gem_matching) {
690  std::cout << "Successful ALCT-CLCT match in ME1a: bx_alct = " << bx_alct
691  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
692  << "]; bx_clct = " << bx_clct << std::endl;
693  std::cout << "+++ Best CLCT Details: ";
694  clct1a->bestCLCT[bx_clct].print();
695  std::cout << "+++ Second CLCT Details: ";
696  clct1a->secondCLCT[bx_clct].print();
697  }
698  if (allLCTs1a[bx_alct][mbx][0].isValid()){
699  used_clct_mask_1a[bx_clct] += 1;
701  }
702  }
703  }
704 
705  // ALCT-to-GEM matching in ME1a
706  nSuccesFulGEMMatches = 0;
707  if (runME11ILT_ and nSuccesFulMatches==0 and buildLCTfromALCTandGEM_ME1a_){
708  if (debug_gem_matching) std::cout << "++No valid ALCT-CLCT matches in ME1a" << std::endl;
709  for (int bx_gem = bx_copad_start; bx_gem <= bx_copad_stop; bx_gem++) {
710  if (not hasCoPads) {
711  continue;
712  }
713 
714  // find the best matching copad - first one
715  auto copads(matchingGEMPads(alct->bestALCT[bx_alct], coPads_[bx_gem], ME1A, true));
716  if (debug_gem_matching) std::cout << "\t++Number of matching GEM CoPads in BX " << bx_alct << " : "<< copads.size() << std::endl;
717  if (copads.size()==0) {
718  continue;
719  }
720 
721  correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
722  copads.at(0).second, allLCTs1a[bx_alct][0][0], allLCTs1a[bx_alct][0][1], ME1A);
723  if (allLCTs1a[bx_alct][0][0].isValid()) {
724  ++nSuccesFulGEMMatches;
726  }
727  if (debug_gem_matching) {
728  std::cout << "Successful ALCT-GEM CoPad match in ME1a: bx_alct = " << bx_alct << std::endl << std::endl;
729  std::cout << "------------------------------------------------------------------------" << std::endl << std::endl;
730  }
731  }
732  }
733 
734  if (debug_gem_matching) {
735  std::cout << "========================================================================" << std::endl;
736  std::cout << "Summary: " << std::endl;
737  if (nSuccesFulMatches>1)
738  std::cout << "Too many successful ALCT-CLCT matches in ME1a: " << nSuccesFulMatches
739  << ", CSCDetId " << cscChamberME1a->id()
740  << ", bx_alct = " << bx_alct
741  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
742  else if (nSuccesFulMatches==1)
743  std::cout << "1 successful ALCT-CLCT match in ME1a: "
744  << " CSCDetId " << cscChamberME1a->id()
745  << ", bx_alct = " << bx_alct
746  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
747  else if (nSuccesFulGEMMatches==1)
748  std::cout << "1 successful ALCT-GEM match in ME1a: "
749  << " CSCDetId " << cscChamberME1a->id()
750  << ", bx_alct = " << bx_alct
751  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
752  else
753  std::cout << "Unsuccessful ALCT-CLCT match in ME1a: "
754  << "CSCDetId " << cscChamberME1a->id()
755  << ", bx_alct = " << bx_alct
756  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
757  }
758 
759  } // end of ALCT valid block
760  else {
761  auto coPads(coPads_[bx_alct]);
762  if (runME11ILT_ and coPads.size()!=0) {
763  // keep it simple for the time being, only consider the first copad
764  const int bx_clct_start(bx_alct - match_trig_window_size/2);
765  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
766 
767  // matching in ME1b
769  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
770  if (bx_clct < 0 or bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS) continue;
771  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
772  if (clct->bestCLCT[bx_clct].isValid()) {
773  const int quality(clct->bestCLCT[bx_clct].getQuality());
774  // only use high-Q stubs for the time being
775  if (quality < 4) continue;
776  int mbx = bx_clct-bx_clct_start;
777  correlateLCTsGEM(clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct], coPads[0].second, GEMDetId(coPads[0].first).roll(),
778  allLCTs1b[bx_alct][mbx][0], allLCTs1b[bx_alct][mbx][1], ME1B);
779  if (debug_gem_matching) {
780  // if (infoV > 1) LogTrace("CSCMotherboard")
781  std::cout << "Successful GEM-CLCT match in ME1b: bx_alct = " << bx_alct
782  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
783  << "]; bx_clct = " << bx_clct << std::endl;
784  std::cout << "+++ Best CLCT Details: ";
785  clct->bestCLCT[bx_clct].print();
786  std::cout << "+++ Second CLCT Details: ";
787  clct->secondCLCT[bx_clct].print();
788  }
789  if (allLCTs1b[bx_alct][mbx][0].isValid()) {
790  used_clct_mask[bx_clct] += 1;
792  }
793  }
794  }
795  }
796 
797  // matching in ME1a
799  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
800  if (bx_clct < 0 || bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS) continue;
801  if (drop_used_clcts && used_clct_mask_1a[bx_clct]) continue;
802  if (clct1a->bestCLCT[bx_clct].isValid()){
803  const int quality(clct1a->bestCLCT[bx_clct].getQuality());
804  // only use high-Q stubs for the time being
805  if (quality < 4) continue;
806  int mbx = bx_clct-bx_clct_start;
807  correlateLCTsGEM(clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct], coPads[0].second, GEMDetId(coPads[0].first).roll(),
808  allLCTs1a[bx_alct][mbx][0], allLCTs1a[bx_alct][mbx][1], ME1A);
809  if (debug_gem_matching) {
810  // if (infoV > 1) LogTrace("CSCMotherboard")
811  std::cout << "Successful GEM-CLCT match in ME1a: bx_alct = " << bx_alct
812  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
813  << "]; bx_clct = " << bx_clct << std::endl;
814  std::cout << "+++ Best CLCT Details: ";
815  clct1a->bestCLCT[bx_clct].print();
816  std::cout << "+++ Second CLCT Details: ";
817  clct1a->secondCLCT[bx_clct].print();
818  }
819  if (allLCTs1a[bx_alct][mbx][0].isValid()){
820  used_clct_mask_1a[bx_clct] += 1;
822  }
823  }
824  }
825  }
826  }
827  }
828  } // end of ALCT-centric matching
829 
830  if (hasLCTs and debug_gem_matching){
831  std::cout << "========================================================================" << std::endl;
832  std::cout << "Counting the LCTs" << std::endl;
833  std::cout << "========================================================================" << std::endl;
834  }
835 
836  // reduction of nLCTs per each BX
837  for (int bx = 0; bx < MAX_LCT_BINS; bx++)
838  {
839  // counting
840  unsigned int n1a=0, n1b=0;
841  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
842  for (int i=0;i<2;i++)
843  {
844  int cbx = bx + mbx - match_trig_window_size/2;
845  if (allLCTs1b[bx][mbx][i].isValid())
846  {
847  n1b++;
848  if (infoV > 0) LogDebug("CSCMotherboard")
849  << "1b LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1b[bx][mbx][i]<<std::endl;
850  }
851  if (allLCTs1a[bx][mbx][i].isValid())
852  {
853  n1a++;
854  if (infoV > 0) LogDebug("CSCMotherboard")
855  << "1a LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1a[bx][mbx][i]<<std::endl;
856  }
857  }
858  if (infoV > 0 and n1a+n1b>0) LogDebug("CSCMotherboard")
859  <<"bx "<<bx<<" nLCT:"<<n1a<<" "<<n1b<<" "<<n1a+n1b<<std::endl;
860 
861  // some simple cross-bx sorting algorithms
862  if (tmb_cross_bx_algo == 1 and (n1a>2 or n1b>2) )
863  {
864  n1a=0, n1b=0;
865  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
866  for (int i=0;i<2;i++)
867  {
868  if (allLCTs1b[bx][pref[mbx]][i].isValid())
869  {
870  n1b++;
871  if (n1b>2) allLCTs1b[bx][pref[mbx]][i].clear();
872  }
873  if (allLCTs1a[bx][pref[mbx]][i].isValid())
874  {
875  n1a++;
876  if (n1a>2) allLCTs1a[bx][pref[mbx]][i].clear();
877  }
878  }
879 
880  n1a=0, n1b=0;
881  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
882  for (int i=0;i<2;i++)
883  {
884  int cbx = bx + mbx - match_trig_window_size/2;
885  if (allLCTs1b[bx][mbx][i].isValid())
886  {
887  n1b++;
888  if (infoV > 0) LogDebug("CSCMotherboard")
889  << "1b LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1b[bx][mbx][i]<<std::cout;
890  }
891  if (allLCTs1a[bx][mbx][i].isValid())
892  {
893  n1a++;
894  if (infoV > 0) LogDebug("CSCMotherboard")
895  << "1a LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1a[bx][mbx][i]<<std::cout;
896  }
897  }
898  if (infoV > 0 and n1a+n1b>0) LogDebug("CSCMotherboard")
899  <<"bx "<<bx<<" nnLCT:"<<n1a<<" "<<n1b<<" "<<n1a+n1b<<std::endl;
900  } // x-bx sorting
901 
902  // Maximum 2 per whole ME11 per BX case:
903  // (supposedly, now we should have max 2 per bx in each 1a and 1b)
904  if (n1a+n1b > max_me11_lcts and tmb_cross_bx_algo == 1)
905  {
906  // do it simple so far: take all low eta 1/b stubs
907  unsigned int nLCT=n1b;
908  n1a=0;
909  // right now nLCT<=2; cut 1a if necessary
910  for (unsigned int mbx=0; mbx<match_trig_window_size; mbx++)
911  for (int i=0;i<2;i++)
912  if (allLCTs1a[bx][mbx][i].isValid()) {
913  nLCT++;
914  if (nLCT>max_me11_lcts) allLCTs1a[bx][mbx][i].clear();
915  else n1a++;
916  }
917  // if (infoV > 0 and nLCT>0) LogDebug("CSCMotherboard")
918 // std::cout <<"bx "<<bx<<" nnnLCT: "<<n1a<<" "<<n1b<<" "<<n1a+n1b<<std::cout;
919  }
920  }// reduction per bx
921 
922  bool first = true;
923  unsigned int n1b=0, n1a=0;
924  for (auto p : readoutLCTs1b())
925  {
926  if (debug_gem_matching and first){
927  std::cout << "========================================================================" << std::endl;
928  std::cout << "Counting the final LCTs" << std::endl;
929  std::cout << "========================================================================" << std::endl;
930  first = false;
931  std::cout << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
932 
933  }
934  n1b++;
935  if (debug_gem_matching)
936  std::cout << "1b LCT "<<n1b<<" " << p <<std::endl;
937  }
938 
939  for (auto p : readoutLCTs1a())
940  {
941  if (debug_gem_matching and first){
942  std::cout << "========================================================================" << std::endl;
943  std::cout << "Counting the final LCTs" << std::endl;
944  std::cout << "========================================================================" << std::endl;
945  first = false;
946  std::cout << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
947  }
948  n1a++;
949  if (debug_gem_matching)
950  std::cout << "1a LCT "<<n1a<<" " << p <<std::endl;
951  }
952 
953  // if (infoV > 1) LogTrace("CSCMotherboardME11GEM")<<"clct_count E:"<<theEndcap<<"S:"<<theStation<<"R:"<<1<<"C:"
954  // <<CSCTriggerNumbering::chamberFromTriggerLabels(theSector,theSubsector, theStation, theTrigChamber)
955  // <<" a "<<n_clct_a<<" b "<<n_clct_b<<" ab "<<n_clct_a+n_clct_b;
956 }
#define LogDebug(id)
const unsigned theSector
std::map< int, std::pair< int, int > > cscHsToGemPadME1a_
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a()
unsigned int match_trig_window_size
const unsigned theTrigChamber
bool runME11ILT_
GEM-CSC integrated local algorithm.
const unsigned theEndcap
std::map< int, std::pair< int, int > > cscHsToGemPadME1b_
GEMPadsBX matchingGEMPads(const CSCCLCTDigi &cLCT, const GEMPadsBX &pads=GEMPadsBX(), enum ME11Part=ME1B, bool isCopad=false, bool first=true)
CSCCorrelatedLCTDigi allLCTs1a[MAX_LCT_BINS][15][2]
const unsigned theStation
static CSCTriggerGeomManager * get()
void correlateLCTsGEM(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, int me, const GEMPadsBX &pads=GEMPadsBX(), const GEMPadsBX &copads=GEMPadsBX())
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
const unsigned theSubsector
std::map< int, std::pair< double, double > > gemRollToEtaLimits_
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
void printGEMTriggerPads(int minBX, int maxBx, bool iscopad=false)
std::vector< CSCALCTDigi > alctV
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
const GEMGeometry * gem_g
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:95
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< GEMCoPadDigi > gemCoPadV
std::map< int, int > gemPadToCscHsME1a_
std::map< int, std::pair< int, int > > cscWgToGemRoll_
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b()
void createGEMRollEtaLUT(bool isEven)
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::vector< CSCCLCTDigi > clctV1b
std::vector< CSCCLCTDigi > clctV1a
std::unique_ptr< CSCCathodeLCTProcessor > clct
CSCCorrelatedLCTDigi allLCTs1b[MAX_LCT_BINS][15][2]
std::map< int, int > gemPadToCscHsME1b_
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
const CSCGeometry * csc_g
static const double lut_wg_etaMin_etaMax_even[48][3]
static const double lut_wg_etaMin_etaMax_odd[48][3]
void CSCMotherboardME11GEM::setConfigParameters ( const CSCDBL1TPParameters conf)

Set configuration parameters obtained via EventSetup mechanism.

Definition at line 338 of file CSCMotherboardME11GEM.cc.

References CSCMotherboard::alct, CSCMotherboard::clct, and clct1a.

Referenced by getCLCTs1b().

339 {
340  alct->setConfigParameters(conf);
341  clct->setConfigParameters(conf);
342  clct1a->setConfigParameters(conf);
343  // No config. parameters in DB for the TMB itself yet.
344 }
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
void CSCMotherboardME11GEM::setCSCGeometry ( const CSCGeometry g)
inline

set CSC and GEM geometries for the matching needs

Definition at line 89 of file CSCMotherboardME11GEM.h.

References csc_g, and g.

Referenced by CSCTriggerPrimitivesBuilder::build().

89 { csc_g = 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 g
Definition: Activities.doc:4
const CSCGeometry * csc_g
void CSCMotherboardME11GEM::setGEMGeometry ( const GEMGeometry g)
inline

Definition at line 90 of file CSCMotherboardME11GEM.h.

References g, and gem_g.

Referenced by CSCTriggerPrimitivesBuilder::build().

90 { gem_g = 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 g
Definition: Activities.doc:4
const GEMGeometry * gem_g
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::sortLCTsByGEMDPhi ( int  bx,
enum ME11Part  me = ME1B 
)

Definition at line 1145 of file CSCMotherboardME11GEM.cc.

References allLCTs1a, allLCTs1b, mps_fire::i, CSCMotherboard::match_trig_window_size, max_me11_lcts, ME1A, and CSCMotherboard::sortByGEMDphi().

Referenced by readoutLCTs(), and sortLCTsByGEMDPhi().

1146 {
1147 
1148  auto allLCTs(me==ME1A ? allLCTs1a : allLCTs1b);
1149  std::vector<CSCCorrelatedLCTDigi> LCTs;
1150  std::vector<CSCCorrelatedLCTDigi> tmpV;
1151  tmpV.clear();
1152  LCTs.clear();
1153  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
1154  for (int i=0;i<2;i++)
1155  if (allLCTs[bx][mbx][i].isValid())
1156  LCTs.push_back(allLCTs[bx][mbx][i]);
1157 
1158  std::sort(LCTs.begin(), LCTs.end(), CSCMotherboard::sortByGEMDphi);
1159  tmpV = LCTs;
1160  if (tmpV.size() > max_me11_lcts) tmpV.erase(tmpV.begin()+max_me11_lcts, tmpV.end());
1161  return tmpV;
1162 }
static bool sortByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
unsigned int match_trig_window_size
CSCCorrelatedLCTDigi allLCTs1a[MAX_LCT_BINS][15][2]
CSCCorrelatedLCTDigi allLCTs1b[MAX_LCT_BINS][15][2]
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::sortLCTsByGEMDPhi ( enum ME11Part  me = ME1B)

Definition at line 1176 of file CSCMotherboardME11GEM.cc.

References firstTwoLCTsInChamber_, CSCMotherboard::MAX_LCT_BINS, ME1A, ME1B, and sortLCTsByGEMDPhi().

1177 {
1178  std::vector<CSCCorrelatedLCTDigi> LCTs_final;
1179  LCTs_final.clear();
1180  for (int bx = 0; bx < MAX_LCT_BINS; bx++)
1181  {
1182  std::vector<CSCCorrelatedLCTDigi> LCTs1a;
1183  std::vector<CSCCorrelatedLCTDigi> LCTs1b;
1184  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp;
1185  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp1;
1186  LCTs1a = sortLCTsByGEMDPhi(bx, ME1A);
1187  LCTs1b = sortLCTsByGEMDPhi(bx, ME1B);
1188  std::vector<CSCCorrelatedLCTDigi>::iterator it1a = LCTs1a.begin();
1189  std::vector<CSCCorrelatedLCTDigi>::iterator it1b = LCTs1b.begin();
1190  LCTs_tmp.insert(LCTs_tmp.begin(), LCTs1b.begin(), LCTs1b.end());
1191  LCTs_tmp.insert(LCTs_tmp.end(), LCTs1a.begin(), LCTs1a.end());
1192  LCTs_tmp1 = sortLCTsByGEMDPhi(LCTs_tmp);//LCTs reduction per BX
1194  {
1195  std::vector<CSCCorrelatedLCTDigi>::iterator itp = LCTs_tmp1.begin();
1196  while (itp != LCTs_tmp1.end())
1197  {
1198  if (me==ME1B and it1b != LCTs1b.end() and *itp==*it1b)
1199  {
1200  LCTs_final.push_back(*it1b);
1201  it1b++;
1202  }
1203  if (me==ME1A and it1a != LCTs1a.end() and *itp==*it1a)
1204  {
1205  LCTs_final.push_back(*it1a);
1206  it1a++;
1207  }
1208  itp++;
1209  }
1210  }
1211  else {
1212  if (LCTs1a.size() and LCTs1b.size() and me==ME1A)
1213  LCTs_final.push_back(*LCTs1a.begin());
1214  else if (LCTs1a.size() and LCTs1b.size() and me==ME1B)
1215  LCTs_final.push_back(*LCTs1b.begin());
1216  else if (LCTs1a.size() and LCTs1b.size()==0 and me==ME1A)
1217  LCTs_final.insert(LCTs_final.end(), LCTs1a.begin(), LCTs1a.end());
1218  else if (LCTs1b.size() and LCTs1a.size()==0 and me==ME1B)
1219  LCTs_final.insert(LCTs_final.end(), LCTs1b.begin(), LCTs1b.end());
1220  }
1221  }
1222  return LCTs_final;
1223 }
std::vector< CSCCorrelatedLCTDigi > sortLCTsByGEMDPhi(int bx, enum ME11Part=ME1B)
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::sortLCTsByGEMDPhi ( std::vector< CSCCorrelatedLCTDigi LCTs)

Definition at line 1164 of file CSCMotherboardME11GEM.cc.

References max_me11_lcts, and CSCMotherboard::sortByGEMDphi().

1165 {
1166  std::vector<CSCCorrelatedLCTDigi> tmpV;
1167  tmpV.clear();
1168  std::sort(LCTs.begin(), LCTs.end(), CSCMotherboard::sortByGEMDphi);
1169  tmpV = LCTs;
1170  if (tmpV.size() > max_me11_lcts) tmpV.erase(tmpV.begin()+max_me11_lcts, tmpV.end());
1171  return tmpV;
1172 }
static bool sortByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::sortLCTsByQuality ( int  bx,
enum ME11Part  me = ME1B 
)

Methods to sort the LCTs

Definition at line 1065 of file CSCMotherboardME11GEM.cc.

References allLCTs1a, allLCTs1b, mps_fire::i, CSCMotherboard::match_trig_window_size, max_me11_lcts, ME1A, and CSCMotherboard::sortByQuality().

Referenced by readoutLCTs(), and sortLCTsByQuality().

1066 {
1067  auto allLCTs(me==ME1A ? allLCTs1a : allLCTs1b);
1068  std::vector<CSCCorrelatedLCTDigi> LCTs;
1069  std::vector<CSCCorrelatedLCTDigi> tmpV;
1070  tmpV.clear();
1071  LCTs.clear();
1072  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
1073  for (int i=0;i<2;i++)
1074  if (allLCTs[bx][mbx][i].isValid())
1075  LCTs.push_back(allLCTs[bx][mbx][i]);
1076 
1077  std::sort(LCTs.begin(), LCTs.end(), CSCMotherboard::sortByQuality);
1078  tmpV = LCTs;
1079  if (tmpV.size()> max_me11_lcts) tmpV.erase(tmpV.begin()+max_me11_lcts, tmpV.end());
1080  return tmpV;
1081 }
unsigned int match_trig_window_size
CSCCorrelatedLCTDigi allLCTs1a[MAX_LCT_BINS][15][2]
CSCCorrelatedLCTDigi allLCTs1b[MAX_LCT_BINS][15][2]
static bool sortByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::sortLCTsByQuality ( enum ME11Part  me = ME1B)

Definition at line 1095 of file CSCMotherboardME11GEM.cc.

References firstTwoLCTsInChamber_, CSCMotherboard::MAX_LCT_BINS, ME1A, ME1B, and sortLCTsByQuality().

1096 {
1097  std::vector<CSCCorrelatedLCTDigi> LCTs_final;
1098  LCTs_final.clear();
1099  for (int bx = 0; bx < MAX_LCT_BINS; bx++)
1100  {
1101  std::vector<CSCCorrelatedLCTDigi> LCTs1a;
1102  std::vector<CSCCorrelatedLCTDigi> LCTs1b;
1103  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp;
1104  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp1;
1105  LCTs1a = sortLCTsByQuality(bx, ME1A);
1106  LCTs1b = sortLCTsByQuality(bx, ME1B);
1107  std::vector<CSCCorrelatedLCTDigi>::iterator it1a = LCTs1a.begin();
1108  std::vector<CSCCorrelatedLCTDigi>::iterator it1b = LCTs1b.begin();
1109  LCTs_tmp.insert(LCTs_tmp.begin(), LCTs1b.begin(), LCTs1b.end());
1110  LCTs_tmp.insert(LCTs_tmp.end(), LCTs1a.begin(), LCTs1a.end());
1111  LCTs_tmp1 = sortLCTsByQuality(LCTs_tmp);//LCTs reduction per BX
1113  {
1114  std::vector<CSCCorrelatedLCTDigi>::iterator itp = LCTs_tmp1.begin();
1115  for ( ; itp != LCTs_tmp1.end(); itp++)
1116  {
1117  if (me==ME1A and it1a != LCTs1a.end() and *itp==*it1a )
1118  {
1119  LCTs_final.push_back(*it1a);
1120  it1a++;
1121  }
1122  if (me==ME1B and it1b != LCTs1b.end() and *itp==*it1b)
1123  {
1124  LCTs_final.push_back(*it1b);
1125  it1b++;
1126  }
1127  }
1128  }
1129  else {
1130  if (LCTs1a.size() and LCTs1b.size() and me==ME1A)
1131  LCTs_final.push_back(*LCTs1a.begin());
1132  else if (LCTs1a.size() and LCTs1b.size() and me==ME1B)
1133  LCTs_final.push_back(*LCTs1b.begin());
1134  else if (LCTs1a.size() and LCTs1b.size()==0 and me==ME1A)
1135  LCTs_final.insert(LCTs_final.end(), LCTs1a.begin(), LCTs1a.end());
1136  else if (LCTs1b.size() and LCTs1a.size()==0 and me==ME1B)
1137  LCTs_final.insert(LCTs_final.end(), LCTs1b.begin(), LCTs1b.end());
1138  }
1139  }
1140  return LCTs_final;
1141 }
std::vector< CSCCorrelatedLCTDigi > sortLCTsByQuality(int bx, enum ME11Part=ME1B)
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11GEM::sortLCTsByQuality ( std::vector< CSCCorrelatedLCTDigi LCTs)

Definition at line 1083 of file CSCMotherboardME11GEM.cc.

References max_me11_lcts, and CSCMotherboard::sortByQuality().

1084 {
1085  std::vector<CSCCorrelatedLCTDigi> tmpV;
1086  tmpV.clear();
1087  std::sort(LCTs.begin(), LCTs.end(), CSCMotherboard::sortByQuality);
1088  tmpV = LCTs;
1089  if (tmpV.size()> max_me11_lcts) tmpV.erase(tmpV.begin()+max_me11_lcts, tmpV.end());
1090  return tmpV;
1091 }
static bool sortByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)

Member Data Documentation

std::vector<CSCALCTDigi> CSCMotherboardME11GEM::alctV
private

Definition at line 165 of file CSCMotherboardME11GEM.h.

Referenced by getALCTs1b(), and run().

CSCCorrelatedLCTDigi CSCMotherboardME11GEM::allLCTs1a[MAX_LCT_BINS][15][2]
private

Definition at line 115 of file CSCMotherboardME11GEM.h.

Referenced by clear(), getLCTs1a(), run(), sortLCTsByGEMDPhi(), and sortLCTsByQuality().

CSCCorrelatedLCTDigi CSCMotherboardME11GEM::allLCTs1b[MAX_LCT_BINS][15][2]
private

Container for first correlated LCT in ME1a. Container for second correlated LCT in ME1a. for the case when more than 2 LCTs/BX are allowed; maximum match window = 15

Definition at line 114 of file CSCMotherboardME11GEM.h.

Referenced by clear(), getLCTs1b(), run(), sortLCTsByGEMDPhi(), and sortLCTsByQuality().

bool CSCMotherboardME11GEM::buildLCTfromALCTandGEM_ME1a_
private

Definition at line 223 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::buildLCTfromALCTandGEM_ME1b_
private

Definition at line 224 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::buildLCTfromCLCTandGEM_ME1a_
private

Definition at line 225 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::buildLCTfromCLCTandGEM_ME1b_
private

Definition at line 226 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

std::unique_ptr<CSCCathodeLCTProcessor> CSCMotherboardME11GEM::clct1a

additional Cathode LCT processor for ME1a

Definition at line 78 of file CSCMotherboardME11GEM.h.

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

bool CSCMotherboardME11GEM::clct_to_alct
private

if true: use regular CLCT-to-ALCT matching in TMB if false: do ALCT-to-CLCT matching

Definition at line 178 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM().

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

Definition at line 167 of file CSCMotherboardME11GEM.h.

Referenced by getCLCTs1a(), and run().

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

Definition at line 166 of file CSCMotherboardME11GEM.h.

Referenced by getCLCTs1b(), and run().

std::unique_ptr<GEMCoPadProcessor> CSCMotherboardME11GEM::coPadProcessor

additional processor for GEMs

Definition at line 86 of file CSCMotherboardME11GEM.h.

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

GEMPads CSCMotherboardME11GEM::coPads_
private

Definition at line 260 of file CSCMotherboardME11GEM.h.

Referenced by clear(), printGEMTriggerPads(), retrieveGEMCoPads(), and run().

bool CSCMotherboardME11GEM::correctLCTtimingWithGEM_
private

Definition at line 232 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

const CSCGeometry* CSCMotherboardME11GEM::csc_g
private

Definition at line 192 of file CSCMotherboardME11GEM.h.

Referenced by run(), and setCSCGeometry().

std::map<int,std::pair<int,int> > CSCMotherboardME11GEM::cscHsToGemPadME1a_
private

Definition at line 255 of file CSCMotherboardME11GEM.h.

Referenced by clear(), matchingGEMPads(), and run().

std::map<int,std::pair<int,int> > CSCMotherboardME11GEM::cscHsToGemPadME1b_
private

Definition at line 256 of file CSCMotherboardME11GEM.h.

Referenced by clear(), deltaPad(), matchingGEMPads(), and run().

std::map<int,std::pair<int,int> > CSCMotherboardME11GEM::cscWgToGemRoll_
private

Definition at line 250 of file CSCMotherboardME11GEM.h.

Referenced by clear(), deltaRoll(), isPadInOverlap(), matchingGEMPads(), and run().

bool CSCMotherboardME11GEM::debug_gem_dphi
private

Definition at line 198 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::debug_gem_matching
private

Definition at line 196 of file CSCMotherboardME11GEM.h.

Referenced by correlateLCTsGEM(), CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::debug_luts
private

Definition at line 197 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::disableME1a
private

Definition at line 102 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and getLCTs1a().

bool CSCMotherboardME11GEM::doLCTGhostBustingWithGEMs_
private

Definition at line 229 of file CSCMotherboardME11GEM.h.

Referenced by correlateLCTsGEM(), and CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::drop_used_clcts
private

whether to not reuse CLCTs that were used by previous matching ALCTs in ALCT-to-CLCT algorithm

Definition at line 182 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::dropLowQualityALCTsNoGEMs_ME1a_
private

Definition at line 219 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::dropLowQualityALCTsNoGEMs_ME1b_
private

Definition at line 220 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::dropLowQualityCLCTsNoGEMs_ME1a_
private

Definition at line 217 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::dropLowQualityCLCTsNoGEMs_ME1b_
private

Definition at line 218 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::firstTwoLCTsInChamber_
private
bool CSCMotherboardME11GEM::gangedME1a
private

Definition at line 102 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and doesALCTCrossCLCT().

const GEMGeometry* CSCMotherboardME11GEM::gem_g
private

Definition at line 193 of file CSCMotherboardME11GEM.h.

Referenced by createGEMRollEtaLUT(), retrieveGEMPads(), run(), and setGEMGeometry().

std::vector<GEMCoPadDigi> CSCMotherboardME11GEM::gemCoPadV
private

Definition at line 168 of file CSCMotherboardME11GEM.h.

Referenced by readoutCoPads(), retrieveGEMCoPads(), and run().

std::map<int,int> CSCMotherboardME11GEM::gemPadToCscHsME1a_
private

Definition at line 253 of file CSCMotherboardME11GEM.h.

Referenced by clear(), constructLCTsGEM(), and run().

std::map<int,int> CSCMotherboardME11GEM::gemPadToCscHsME1b_
private

Definition at line 254 of file CSCMotherboardME11GEM.h.

Referenced by clear(), constructLCTsGEM(), and run().

std::map<int,std::pair<double,double> > CSCMotherboardME11GEM::gemRollToEtaLimits_
private

Definition at line 249 of file CSCMotherboardME11GEM.h.

Referenced by assignGEMRoll(), clear(), createGEMRollEtaLUT(), and run().

const double CSCMotherboardME11GEM::lut_pt_vs_dphi_gemcsc
staticprivate
Initial value:
= {
{3, 0.03971647, 0.01710244},
{5, 0.02123785, 0.00928431},
{7, 0.01475524, 0.00650928},
{10, 0.01023299, 0.00458796},
{15, 0.00689220, 0.00331313},
{20, 0.00535176, 0.00276152},
{30, 0.00389050, 0.00224959},
{40, 0.00329539, 0.00204670}}

Definition at line 97 of file CSCMotherboardME11GEM.h.

const double CSCMotherboardME11GEM::lut_wg_etaMin_etaMax_even
staticprivate

Definition at line 99 of file CSCMotherboardME11GEM.h.

Referenced by run().

const double CSCMotherboardME11GEM::lut_wg_etaMin_etaMax_odd
staticprivate

Definition at line 98 of file CSCMotherboardME11GEM.h.

Referenced by run().

const int CSCMotherboardME11GEM::lut_wg_vs_hs_me1a
staticprivate
Initial value:
= {
{0, 95},{0, 95},{0, 95},{0, 95},{0, 95},
{0, 95},{0, 95},{0, 95},{0, 95},{0, 95},
{0, 95},{0, 95},{0, 77},{0, 61},{0, 39},
{0, 22},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1} }

Definition at line 95 of file CSCMotherboardME11GEM.h.

Referenced by constructLCTsGEM(), and doesALCTCrossCLCT().

const int CSCMotherboardME11GEM::lut_wg_vs_hs_me1ag
staticprivate
Initial value:
= {
{0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
{0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
{0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
{0, 22},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1} }

Definition at line 96 of file CSCMotherboardME11GEM.h.

Referenced by doesALCTCrossCLCT().

const int CSCMotherboardME11GEM::lut_wg_vs_hs_me1b
staticprivate
Initial value:
= {
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
{100, 127},{73, 127},{47, 127},{22, 127},{0, 127},
{0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
{0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
{0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
{0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
{0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
{0, 127},{0, 127},{0, 127},{0, 127},{0, 105},
{0, 93},{0, 78},{0, 63} }

Definition at line 94 of file CSCMotherboardME11GEM.h.

Referenced by constructLCTsGEM(), and doesALCTCrossCLCT().

bool CSCMotherboardME11GEM::match_earliest_alct_me11_only
private

Definition at line 173 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::match_earliest_clct_me11_only
private

Definition at line 174 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

unsigned int CSCMotherboardME11GEM::max_me11_lcts
private

maximum lcts per BX in ME11: 2, 3, 4 or 999

Definition at line 187 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), run(), sortLCTsByGEMDPhi(), and sortLCTsByQuality().

int CSCMotherboardME11GEM::maxDeltaBXCoPad_
private

Definition at line 209 of file CSCMotherboardME11GEM.h.

Referenced by run().

int CSCMotherboardME11GEM::maxDeltaBXCoPadEven_
private

Definition at line 211 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

int CSCMotherboardME11GEM::maxDeltaBXCoPadOdd_
private

Definition at line 213 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

int CSCMotherboardME11GEM::maxDeltaBXPad_
private

Definition at line 201 of file CSCMotherboardME11GEM.h.

Referenced by retrieveGEMPads(), and run().

int CSCMotherboardME11GEM::maxDeltaBXPadEven_
private

Definition at line 203 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

int CSCMotherboardME11GEM::maxDeltaBXPadOdd_
private

Definition at line 205 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

int CSCMotherboardME11GEM::maxDeltaPadCoPad_
private

Definition at line 210 of file CSCMotherboardME11GEM.h.

Referenced by matchingGEMPads(), and run().

int CSCMotherboardME11GEM::maxDeltaPadCoPadEven_
private

Definition at line 212 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

int CSCMotherboardME11GEM::maxDeltaPadCoPadOdd_
private

Definition at line 214 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

int CSCMotherboardME11GEM::maxDeltaPadPad_
private

Definition at line 202 of file CSCMotherboardME11GEM.h.

Referenced by matchingGEMPads(), and run().

int CSCMotherboardME11GEM::maxDeltaPadPadEven_
private

Definition at line 204 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

int CSCMotherboardME11GEM::maxDeltaPadPadOdd_
private

Definition at line 206 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

GEMPads CSCMotherboardME11GEM::pads_
private

Definition at line 259 of file CSCMotherboardME11GEM.h.

Referenced by clear(), printGEMTriggerPads(), retrieveGEMPads(), and run().

int CSCMotherboardME11GEM::pref[MAX_LCT_BINS]
private

"preferential" index array in matching window for cross-BX sorting

Definition at line 171 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::promoteALCTGEMpattern_
private

Definition at line 241 of file CSCMotherboardME11GEM.h.

Referenced by constructLCTsGEM(), and CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::promoteALCTGEMquality_
private

Definition at line 244 of file CSCMotherboardME11GEM.h.

Referenced by constructLCTsGEM(), and CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::promoteCLCTGEMquality_ME1a_
private

Definition at line 245 of file CSCMotherboardME11GEM.h.

Referenced by constructLCTsGEM(), and CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::promoteCLCTGEMquality_ME1b_
private

Definition at line 246 of file CSCMotherboardME11GEM.h.

Referenced by constructLCTsGEM(), and CSCMotherboardME11GEM().

bool CSCMotherboardME11GEM::runME11ILT_
private

GEM-CSC integrated local algorithm.

Definition at line 190 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

bool CSCMotherboardME11GEM::smartME1aME1b
private

SLHC: special configuration parameters for ME11 treatment.

Definition at line 102 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), and run().

unsigned int CSCMotherboardME11GEM::tmb_cross_bx_algo
private

Definition at line 184 of file CSCMotherboardME11GEM.h.

Referenced by CSCMotherboardME11GEM(), readoutLCTs(), and run().

bool CSCMotherboardME11GEM::useOldLCTDataFormat_
private

Definition at line 235 of file CSCMotherboardME11GEM.h.

Referenced by correlateLCTsGEM(), and CSCMotherboardME11GEM().