CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
CSCGEMMotherboard Class Referenceabstract

#include <CSCGEMMotherboard.h>

Inheritance diagram for CSCGEMMotherboard:
CSCUpgradeMotherboard CSCMotherboard

Public Member Functions

template<class S >
S bestMatchingPad (const CSCALCTDigi &alct1, const matches< S > &pads, enum CSCPart)
 
template<class S >
S bestMatchingPad (const CSCCLCTDigi &clct, const matches< S > &pads, enum CSCPart part)
 
template<class S >
S bestMatchingPad (const CSCALCTDigi &alct1, const CSCCLCTDigi &clct1, const matches< S > &pads, enum CSCPart part)
 
void clear ()
 
template<>
void correlateLCTsGEM (const CSCALCTDigi &bestLCT, const CSCALCTDigi &secondLCT, const GEMCoPadDigi &bestCoPad, const GEMCoPadDigi &secondCoPad, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart p)
 
template<>
void correlateLCTsGEM (const CSCCLCTDigi &bestLCT, const CSCCLCTDigi &secondLCT, const GEMCoPadDigi &bestCoPad, const GEMCoPadDigi &secondCoPad, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart p)
 
 CSCGEMMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCGEMMotherboard ()
 
template<>
matches< GEMPadDigimatchingPads (const CSCALCTDigi &alct, enum CSCPart part)
 
template<>
matches< GEMCoPadDigimatchingPads (const CSCALCTDigi &alct, enum CSCPart part)
 
template<>
matches< GEMPadDigimatchingPads (const CSCCLCTDigi &clct, enum CSCPart part)
 
template<>
matches< GEMCoPadDigimatchingPads (const CSCCLCTDigi &clct, enum CSCPart part)
 
virtual void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)=0
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads)
 
void setGEMGeometry (const GEMGeometry *g)
 set CSC and GEM geometries for the matching needs More...
 
 ~CSCGEMMotherboard () override
 
- Public Member Functions inherited from CSCUpgradeMotherboard
template<class S >
bool compare (const S &p, const S &q)
 
 CSCUpgradeMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCUpgradeMotherboard ()
 
void debugLUTs ()
 
template<class S >
S intersection (const S &d1, const S &d2)
 
void setCSCGeometry (const CSCGeometry *g)
 
void setupGeometry ()
 
void sortLCTs (std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &))
 
 ~CSCUpgradeMotherboard () override
 
- Public Member Functions inherited from CSCMotherboard
void clear ()
 
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboard ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs ()
 
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< GEMCoPadProcessorcoPadProcessor
 
- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralct
 
std::unique_ptr< CSCCathodeLCTProcessorclct
 

Protected Member Functions

template<class T >
T bestMatchingPad (const CSCALCTDigi &, const matches< T > &, enum CSCPart)
 
template<class T >
T bestMatchingPad (const CSCCLCTDigi &, const matches< T > &, enum CSCPart)
 
template<class T >
T bestMatchingPad (const CSCALCTDigi &, const CSCCLCTDigi &, const matches< T > &, enum CSCPart)
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i)
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, enum CSCPart, int i)
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMCoPadDigi &gem, enum CSCPart p, int i)
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem, enum CSCPart p, int i)
 
CSCCorrelatedLCTDigi constructLCTsGEM (const CSCALCTDigi &alct, const CSCCLCTDigi &clct, const GEMPadDigi &gem1, const GEMCoPadDigi &gem2, enum CSCPart p, int i)
 
template<class T >
void correlateLCTsGEM (T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart)
 
template<class T >
void correlateLCTsGEM (const T &best, const T &second, const GEMCoPadDigi &, const GEMCoPadDigi &, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart)
 
unsigned int findQualityGEM (const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer)
 
float getAvePad (const GEMPadDigi &)
 
float getAvePad (const GEMCoPadDigi &)
 
float getAvePad (const CSCCLCTDigi &, enum CSCPart part)
 
int getBX (const GEMPadDigi &p)
 
int getBX (const GEMCoPadDigi &p)
 
virtual const CSCGEMMotherboardLUTgetLUT () const =0
 
int getRoll (const GEMPadDigiId &p)
 
int getRoll (const GEMCoPadDigiId &p)
 
int getRoll (const CSCALCTDigi &)
 
bool isPadInOverlap (int roll)
 
template<class T >
matches< TmatchingPads (const CSCALCTDigi &alct, enum CSCPart part)
 
template<class T >
matches< TmatchingPads (const CSCCLCTDigi &clct, enum CSCPart part)
 
template<class S , class T >
matches< TmatchingPads (const S &d1, const S &d2, enum CSCPart part)
 
template<class T >
matches< TmatchingPads (const CSCCLCTDigi &clct1, const CSCALCTDigi &alct1, enum CSCPart part)
 
template<class T >
matches< TmatchingPads (const CSCCLCTDigi &clct1, const CSCCLCTDigi &clct2, const CSCALCTDigi &alct1, const CSCALCTDigi &alct2, enum CSCPart part)
 
void printGEMTriggerCoPads (int bx_start, int bx_stop, enum CSCPart)
 
void printGEMTriggerPads (int bx_start, int bx_stop, enum CSCPart)
 
void retrieveGEMCoPads ()
 
void retrieveGEMPads (const GEMPadDigiCollection *pads, unsigned id)
 
void setupGeometry ()
 
- Protected Member Functions inherited from CSCMotherboard
void checkConfigParameters ()
 
CSCCorrelatedLCTDigi constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int)
 
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 ()
 

Protected Attributes

GEMCoPadDigiIdsBX coPads_
 
bool doLCTGhostBustingWithGEMs_
 
const GEMGeometrygem_g
 
std::vector< GEMCoPadDigigemCoPadV
 
bool gemGeometryAvailable
 
unsigned gemId
 
int maxDeltaBXCoPad_
 
int maxDeltaBXPad_
 
int maxDeltaPadL1_
 
int maxDeltaPadL2_
 
GEMPadDigiIdsBX pads_
 
bool promoteALCTGEMpattern_
 
bool promoteALCTGEMquality_
 
bool promoteCLCTGEMquality_
 
bool useOldLCTDataFormat_
 
- Protected Attributes inherited from CSCUpgradeMotherboard
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
edm::ParameterSet commonParams_
 
const CSCGeometrycsc_g
 
const CSCChambercscChamber
 
bool debug_luts
 
bool debug_matching
 
bool drop_used_clcts
 
std::unique_ptr< CSCUpgradeMotherboardLUTGeneratorgenerator_
 
bool match_earliest_alct_only
 
bool match_earliest_clct_only
 
unsigned int max_lcts
 
Parity par
 
int pref [MAX_LCT_BINS]
 
unsigned theChamber
 
unsigned theRegion
 
unsigned int tmb_cross_bx_algo
 
edm::ParameterSet tmbParams_
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
unsigned int 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
 

Additional Inherited Members

- Static Public Member Functions inherited from CSCUpgradeMotherboard
static bool sortLCTsByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortLCTsByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
- Protected Types inherited from CSCMotherboard
enum  { MAX_LCT_BINS = 16 }
 
- Static Protected Member Functions inherited from CSCMotherboard
static bool sortByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
- 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

Definition at line 20 of file CSCGEMMotherboard.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file CSCGEMMotherboard.cc.

References coPadProcessor, gemId, edm::ParameterSet::getParameter(), maxDeltaPadL1_, maxDeltaPadL2_, CSCUpgradeMotherboard::par, DetId::rawId(), CSCUpgradeMotherboard::theChamber, CSCUpgradeMotherboard::theRegion, CSCMotherboard::theStation, and CSCUpgradeMotherboard::tmbParams_.

7  :
8  CSCUpgradeMotherboard(endcap, station, sector, subsector, chamber, conf)
9  , maxDeltaBXPad_(tmbParams_.getParameter<int>("maxDeltaBXPad"))
10  , maxDeltaBXCoPad_(tmbParams_.getParameter<int>("maxDeltaBXCoPad"))
11  , useOldLCTDataFormat_(tmbParams_.getParameter<bool>("useOldLCTDataFormat"))
12  , promoteALCTGEMpattern_(tmbParams_.getParameter<bool>("promoteALCTGEMpattern"))
13  , promoteALCTGEMquality_(tmbParams_.getParameter<bool>("promoteALCTGEMquality"))
14  , doLCTGhostBustingWithGEMs_(tmbParams_.getParameter<bool>("doLCTGhostBustingWithGEMs"))
15 {
17 
18  const edm::ParameterSet coPadParams(conf.getParameter<edm::ParameterSet>("copadParam"));
19  coPadProcessor.reset( new GEMCoPadProcessor(endcap, station, chamber, coPadParams) );
20 
21  maxDeltaPadL1_ = (par ? tmbParams_.getParameter<int>("maxDeltaPadL1Even") :
22  tmbParams_.getParameter<int>("maxDeltaPadL1Odd") );
23  maxDeltaPadL2_ = (par ? tmbParams_.getParameter<int>("maxDeltaPadL2Even") :
24  tmbParams_.getParameter<int>("maxDeltaPadL2Odd") );
25 }
T getParameter(std::string const &) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const unsigned theStation
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
edm::ParameterSet tmbParams_
CSCGEMMotherboard::CSCGEMMotherboard ( )

Definition at line 27 of file CSCGEMMotherboard.cc.

CSCGEMMotherboard::~CSCGEMMotherboard ( )
override

Definition at line 31 of file CSCGEMMotherboard.cc.

32 {
33 }

Member Function Documentation

template<class T >
T CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi ,
const matches< T > &  ,
enum  CSCPart 
)
protected

Referenced by setGEMGeometry().

template<class T >
T CSCGEMMotherboard::bestMatchingPad ( const CSCCLCTDigi ,
const matches< T > &  ,
enum  CSCPart 
)
protected
template<class T >
T CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi ,
const CSCCLCTDigi ,
const matches< T > &  ,
enum  CSCPart 
)
protected
template<class S >
S CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi alct1,
const matches< S > &  pads,
enum  CSCPart 
)

Definition at line 163 of file CSCGEMMotherboard.h.

References getRoll(), CSCALCTDigi::isValid(), AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and S().

164 {
165  S result;
166  if (not alct1.isValid()) return result;
167 
168  // return the first one with the same roll number
169  for (const auto& p: pads){
170  if (getRoll(p) == getRoll(alct1)){
171  return p.second;
172  }
173  }
174  return result;
175 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
int getRoll(const GEMPadDigiId &p)
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
template<class S >
S CSCGEMMotherboard::bestMatchingPad ( const CSCCLCTDigi clct,
const matches< S > &  pads,
enum CSCPart  part 
)

Definition at line 178 of file CSCGEMMotherboard.h.

References funct::abs(), getAvePad(), CSCCLCTDigi::isValid(), AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and S().

179 {
180  S result;
181  if (not clct.isValid()) return result;
182 
183  // return the pad with the smallest bending angle
184  float averagePadNumberCSC = getAvePad(clct, part);
185  float minDeltaPad = 999;
186  for (const auto& p: pads){
187  float averagePadNumberGEM = getAvePad(p.second);
188  if (std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad){
189  minDeltaPad = std::abs(averagePadNumberCSC - averagePadNumberGEM);
190  result = p.second;
191  }
192  }
193  return result;
194 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
part
Definition: HCALResponse.h:20
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
float getAvePad(const GEMPadDigi &)
template<class S >
S CSCGEMMotherboard::bestMatchingPad ( const CSCALCTDigi alct1,
const CSCCLCTDigi clct1,
const matches< S > &  pads,
enum CSCPart  part 
)

Definition at line 197 of file CSCGEMMotherboard.h.

References funct::abs(), getAvePad(), getRoll(), CSCCLCTDigi::isValid(), CSCALCTDigi::isValid(), or, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, and S().

199 {
200  S result;
201  if (not alct1.isValid() or not clct1.isValid()) return result;
202 
203  // return the pad with the smallest bending angle
204  float averagePadNumberCSC = getAvePad(clct1, part);
205  float minDeltaPad = 999;
206  for (const auto& p: pads){
207  float averagePadNumberGEM = getAvePad(p.second);
208  // add another safety to make sure that the deltaPad is not larger than max value!!!
209  if (std::abs(averagePadNumberCSC - averagePadNumberGEM) < minDeltaPad and getRoll(p) == getRoll(alct1)){
210  minDeltaPad = std::abs(averagePadNumberCSC - averagePadNumberGEM);
211  result = p.second;
212  }
213  }
214  return result;
215 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
int getRoll(const GEMPadDigiId &p)
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
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
part
Definition: HCALResponse.h:20
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
float getAvePad(const GEMPadDigi &)
void CSCGEMMotherboard::clear ( void  )

Definition at line 35 of file CSCGEMMotherboard.cc.

References coPads_, and pads_.

36 {
37  pads_.clear();
38  coPads_.clear();
39 }
GEMCoPadDigiIdsBX coPads_
GEMPadDigiIdsBX pads_
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const GEMCoPadDigi gem,
enum CSCPart  part,
int  i 
)
protected

Definition at line 79 of file CSCGEMMotherboard.cc.

Referenced by constructLCTsGEM(), correlateLCTsGEM(), and setGEMGeometry().

83 {
84  return constructLCTsGEM(alct, CSCCLCTDigi(), GEMPadDigi(), gem, part, trknmb);
85 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i)
part
Definition: HCALResponse.h:20
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCCLCTDigi clct,
const GEMCoPadDigi gem,
enum CSCPart  part,
int  i 
)
protected

Definition at line 88 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

92 {
93  return constructLCTsGEM(CSCALCTDigi(), clct, GEMPadDigi(), gem, part, trknmb);
94 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i)
part
Definition: HCALResponse.h:20
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMCoPadDigi gem,
enum CSCPart  p,
int  i 
)
protected

Definition at line 96 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

Referenced by constructLCTsGEM().

101 {
102  return constructLCTsGEM(alct, clct, GEMPadDigi(), gem, part, trknmb);
103 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i)
part
Definition: HCALResponse.h:20
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMPadDigi gem,
enum CSCPart  p,
int  i 
)
protected

Definition at line 106 of file CSCGEMMotherboard.cc.

References constructLCTsGEM().

111 {
112  return constructLCTsGEM(alct, clct, gem, GEMCoPadDigi(), part, trknmb);
113 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i)
part
Definition: HCALResponse.h:20
CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM ( const CSCALCTDigi alct,
const CSCCLCTDigi clct,
const GEMPadDigi gem1,
const GEMCoPadDigi gem2,
enum CSCPart  p,
int  i 
)
protected

Definition at line 115 of file CSCGEMMotherboard.cc.

References ALCT2GEM, ALCTCLCT2GEM, ALCTCLCTGEM, CLCT2GEM, CSCMotherboard::encodePattern(), findQualityGEM(), CSCGEMMotherboardLUT::get_gem_pad_to_csc_hs(), CSCGEMMotherboardLUT::get_gem_roll_to_csc_wg(), CSCALCTDigi::getBX(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), getLUT(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), Invalid, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), CSCMotherboard::lct_central_bx, CSCUpgradeMotherboard::par, listBenchmarks::pattern, promoteALCTGEMpattern_, promoteALCTGEMquality_, promoteCLCTGEMquality_, btvTracks_cfi::quality, and CSCMotherboard::theTrigChamber.

120 {
121  // step 1: determine the case
122  int lctCase = lctTypes::Invalid;
123  if (alct.isValid() and clct.isValid() and gem1 != GEMPadDigi() and gem2 == GEMCoPadDigi()) lctCase = lctTypes::ALCTCLCT2GEM;
124  else if (alct.isValid() and clct.isValid() and gem1 == GEMPadDigi() and gem2 != GEMCoPadDigi()) lctCase = lctTypes::ALCTCLCTGEM;
125  else if (alct.isValid() and gem2 != GEMCoPadDigi()) lctCase = lctTypes::ALCT2GEM;
126  else if (clct.isValid() and gem2 != GEMCoPadDigi()) lctCase = lctTypes::CLCT2GEM;
127 
128  // step 2: assign properties depending on the LCT dataformat (old/new)
129  int pattern = 0, quality = 0, bx = 0, keyStrip = 0, keyWG = 0;
130  switch(lctCase){
131  case lctTypes::ALCTCLCTGEM: {
132  pattern = encodePattern(clct.getPattern(), clct.getStripType());
133  quality = findQualityGEM(alct, clct, 1);
134  bx = alct.getBX();
135  keyStrip = clct.getKeyStrip();
136  keyWG = alct.getKeyWG();
137  break;
138  }
139  case lctTypes::ALCTCLCT2GEM: {
140  pattern = encodePattern(clct.getPattern(), clct.getStripType());
141  quality = findQualityGEM(alct, clct, 2);
142  bx = alct.getBX();
143  keyStrip = clct.getKeyStrip();
144  keyWG = alct.getKeyWG();
145  break;
146  }
147  case lctTypes::ALCT2GEM: {
148  const auto& mymap1 = getLUT()->get_gem_pad_to_csc_hs(par, p);
149  pattern = promoteALCTGEMpattern_ ? 10 : 0;
150  quality = promoteALCTGEMquality_ ? 15 : 11;
151  bx = alct.getBX();
152  keyStrip = mymap1[gem2.pad(2)];
153  keyWG = alct.getKeyWG();
154  break;
155  }
156  case lctTypes::CLCT2GEM: {
157  const auto& mymap2 = getLUT()->get_gem_roll_to_csc_wg(par, p);
158  pattern = encodePattern(clct.getPattern(), clct.getStripType());
159  quality = promoteCLCTGEMquality_ ? 15 : 11;
160  bx = gem2.bx(1) + lct_central_bx;;
161  keyStrip = clct.getKeyStrip();
162  // choose the corresponding wire-group in the middle of the partition
163  keyWG = mymap2[gem2.roll()];
164  break;
165  }
166  };
167 
168  // future work: add a section that produces LCTs according
169  // to the new LCT dataformat (not yet defined)
170 
171  // step 3: make new LCT with afore assigned properties}
172  return CSCCorrelatedLCTDigi(trknmb, 1, quality, keyWG, keyStrip,
173  pattern, 0, bx, 0, 0, 0, theTrigChamber);
174 }
const unsigned theTrigChamber
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
std::vector< int > get_gem_roll_to_csc_wg(Parity par, int layer=1) const
int pad(int l) const
Definition: GEMCoPadDigi.cc:32
int getStripType() const
return striptype
Definition: CSCCLCTDigi.h:39
int bx(int l) const
Definition: GEMCoPadDigi.cc:40
unsigned int encodePattern(const int ptn, const int highPt)
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
int roll() const
Definition: GEMCoPadDigi.h:25
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:48
virtual std::vector< int > get_gem_pad_to_csc_hs(Parity par, enum CSCPart) const =0
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:36
virtual const CSCGEMMotherboardLUT * getLUT() const =0
unsigned int findQualityGEM(const CSCALCTDigi &, const CSCCLCTDigi &, int gemlayer)
if(dp >Float(M_PI)) dp-
lctTypes
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
template<class T >
void CSCGEMMotherboard::correlateLCTsGEM ( T best,
T second,
const GEMCoPadDigiIds coPads,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
enum CSCPart  p 
)
protected

Definition at line 218 of file CSCGEMMotherboard.h.

References AlCaHLTBitMon_ParallelJobs::p, and CSCMotherboard::secondLCT.

Referenced by setGEMGeometry().

220 {
221  bool bestValid = bestLCT.isValid();
222  bool secondValid = secondLCT.isValid();
223 
224  // determine best/second
225  if (bestValid and !secondValid) secondLCT = bestLCT;
226  if (!bestValid and secondValid) bestLCT = secondLCT;
227 
228  // get best matching copad1
229  GEMCoPadDigi bestCoPad = bestMatchingPad<GEMCoPadDigi>(bestLCT, coPads, p);
230  GEMCoPadDigi secondCoPad = bestMatchingPad<GEMCoPadDigi>(secondLCT, coPads, p);
231 
232  correlateLCTsGEM(bestLCT, secondLCT, bestCoPad, secondCoPad, lct1, lct2, p);
233 }
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart)
CSCCorrelatedLCTDigi secondLCT[MAX_LCT_BINS]
bool isValid() const
return valid pattern bit
template<class T >
void CSCGEMMotherboard::correlateLCTsGEM ( const T best,
const T second,
const GEMCoPadDigi ,
const GEMCoPadDigi ,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
enum  CSCPart 
)
protected
template<>
void CSCGEMMotherboard::correlateLCTsGEM ( const CSCALCTDigi bestLCT,
const CSCALCTDigi secondLCT,
const GEMCoPadDigi bestCoPad,
const GEMCoPadDigi secondCoPad,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
enum CSCPart  p 
)

Definition at line 237 of file CSCGEMMotherboard.h.

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

240 {
241  if ((alct_trig_enable and bestLCT.isValid()) or
242  (match_trig_enable and bestLCT.isValid()))
243  {
244  lct1 = constructLCTsGEM(bestLCT, bestCoPad, p, 1);
245  }
246 
247  if ((alct_trig_enable and secondLCT.isValid()) or
248  (match_trig_enable and secondLCT.isValid() and secondLCT != bestLCT))
249  {
250  lct2 = constructLCTsGEM(secondLCT, secondCoPad, p, 2);
251  }
252 }
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i)
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
unsigned int match_trig_enable
unsigned int alct_trig_enable
template<>
void CSCGEMMotherboard::correlateLCTsGEM ( const CSCCLCTDigi bestLCT,
const CSCCLCTDigi secondLCT,
const GEMCoPadDigi bestCoPad,
const GEMCoPadDigi secondCoPad,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2,
enum CSCPart  p 
)

Definition at line 256 of file CSCGEMMotherboard.h.

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

259 {
260  if ((clct_trig_enable and bestLCT.isValid()) or
261  (match_trig_enable and bestLCT.isValid()))
262  {
263  lct1 = constructLCTsGEM(bestLCT, bestCoPad, p, 1);
264  }
265 
266  if ((clct_trig_enable and secondLCT.isValid()) or
267  (match_trig_enable and secondLCT.isValid() and secondLCT != bestLCT))
268  {
269  lct2 = constructLCTsGEM(secondLCT, secondCoPad, p, 2);
270  }
271 }
unsigned int clct_trig_enable
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i)
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 CSCGEMMotherboard::findQualityGEM ( const CSCALCTDigi aLCT,
const CSCCLCTDigi cLCT,
int  gemlayer 
)
protected

Definition at line 276 of file CSCGEMMotherboard.cc.

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

Referenced by constructLCTsGEM(), and setGEMGeometry().

277 {
278  /*
279  Same LCT quality definition as standard LCTs
280  a4 and c4 take GEMs into account!!!
281  */
282 
283  unsigned int quality = 0;
284 
285  // 2008 definition.
286  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
287  if (aLCT.isValid() && !(cLCT.isValid())) quality = 1; // no CLCT
288  else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT
289  else quality = 0; // both absent; should never happen.
290  }
291  else {
292  const int pattern(cLCT.getPattern());
293  if (pattern == 1) quality = 3; // layer-trigger in CLCT
294  else {
295  // ALCT quality is the number of layers hit minus 3.
296  // CLCT quality is the number of layers hit.
297  bool a4;
298  // GE11
299  if (theStation==1) {
300  a4 = (aLCT.getQuality() >= 1);
301  }
302  // GE21
303  else if (theStation==2) {
304  a4 = (aLCT.getQuality() >= 1) or (aLCT.getQuality() >= 0 and gemlayers >=1);
305  }
306  else {
307  return -1;
308  }
309  const bool c4((cLCT.getQuality() >= 4) or (cLCT.getQuality() >= 3 and gemlayers>=1));
310  // quality = 4; "reserved for low-quality muons in future"
311  if (!a4 && !c4) quality = 5; // marginal anode and cathode
312  else if ( a4 && !c4) quality = 6; // HQ anode, but marginal cathode
313  else if (!a4 && c4) quality = 7; // HQ cathode, but marginal anode
314  else if ( a4 && c4) {
315  if (aLCT.getAccelerator()) quality = 8; // HQ muon, but accel ALCT
316  else {
317  // quality = 9; "reserved for HQ muons with future patterns
318  // quality = 10; "reserved for HQ muons with future patterns
319  if (pattern == 2 || pattern == 3) quality = 11;
320  else if (pattern == 4 || pattern == 5) quality = 12;
321  else if (pattern == 6 || pattern == 7) quality = 13;
322  else if (pattern == 8 || pattern == 9) quality = 14;
323  else if (pattern == 10) quality = 15;
324  else {
325  if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
326  << "+++ findQuality: Unexpected CLCT pattern id = "
327  << pattern << "+++\n";
328  }
329  }
330  }
331  }
332  }
333  return quality;
334 }
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
const unsigned theStation
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
float CSCGEMMotherboard::getAvePad ( const GEMPadDigi p)
protected

Definition at line 214 of file CSCGEMMotherboard.cc.

References GEMPadDigi::pad().

Referenced by bestMatchingPad(), matchingPads(), and setGEMGeometry().

215 {
216  return p.pad();
217 }
int pad() const
Definition: GEMPadDigi.h:26
float CSCGEMMotherboard::getAvePad ( const GEMCoPadDigi p)
protected

Definition at line 219 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::pad().

220 {
221  return 0.5*(p.pad(1) + p.pad(2));
222 }
int pad(int l) const
Definition: GEMCoPadDigi.cc:32
float CSCGEMMotherboard::getAvePad ( const CSCCLCTDigi clct,
enum CSCPart  part 
)
protected

Definition at line 224 of file CSCGEMMotherboard.cc.

References CSCGEMMotherboardLUT::get_csc_hs_to_gem_pad(), CSCCLCTDigi::getKeyStrip(), getLUT(), and CSCUpgradeMotherboard::par.

225 {
226  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(par, part));
227  return 0.5*(mymap[clct.getKeyStrip()].first + mymap[clct.getKeyStrip()].second);
228 }
virtual std::vector< std::pair< int, int > > get_csc_hs_to_gem_pad(Parity par, enum CSCPart) const =0
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
int CSCGEMMotherboard::getBX ( const GEMPadDigi p)
protected

Definition at line 189 of file CSCGEMMotherboard.cc.

References GEMPadDigi::bx().

Referenced by matchingPads(), and setGEMGeometry().

190 {
191  return p.bx();
192 }
int bx() const
Definition: GEMPadDigi.h:27
int CSCGEMMotherboard::getBX ( const GEMCoPadDigi p)
protected

Definition at line 194 of file CSCGEMMotherboard.cc.

References GEMCoPadDigi::bx().

195 {
196  return p.bx(1);
197 }
int bx(int l) const
Definition: GEMCoPadDigi.cc:40
virtual const CSCGEMMotherboardLUT* CSCGEMMotherboard::getLUT ( ) const
protectedpure virtual
int CSCGEMMotherboard::getRoll ( const GEMPadDigiId p)
protected

Definition at line 199 of file CSCGEMMotherboard.cc.

References GEMDetId::roll().

Referenced by bestMatchingPad(), matchingPads(), and setGEMGeometry().

200 {
201  return GEMDetId(p.first).roll();
202 }
int roll() const
Definition: GEMDetId.h:80
int CSCGEMMotherboard::getRoll ( const GEMCoPadDigiId p)
protected

Definition at line 204 of file CSCGEMMotherboard.cc.

205 {
206  return p.second.roll();
207 }
int CSCGEMMotherboard::getRoll ( const CSCALCTDigi alct)
protected

Definition at line 209 of file CSCGEMMotherboard.cc.

References CSCALCTDigi::getKeyWG(), getLUT(), and CSCUpgradeMotherboard::par.

210 {
211  return (getLUT()->get_csc_wg_to_gem_roll(par))[alct.getKeyWG()].first;
212 }
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
bool CSCGEMMotherboard::isPadInOverlap ( int  roll)
protected

Definition at line 177 of file CSCGEMMotherboard.cc.

References plotBeamSpotDB::first, CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(), getLUT(), mps_fire::i, or, CSCUpgradeMotherboard::par, and edm::second().

Referenced by matchingPads(), printGEMTriggerCoPads(), printGEMTriggerPads(), and setGEMGeometry().

178 {
179  // this only works for ME1A!
180  const auto& mymap = (getLUT()->get_csc_wg_to_gem_roll(par));
181  for (unsigned i=0; i<mymap.size(); i++) {
182  // overlap region are WGs 10-15
183  if ((i < 10) or (i > 15)) continue;
184  if ((mymap[i].first <= roll) and (roll <= mymap[i].second)) return true;
185  }
186  return false;
187 }
U second(std::pair< T, U > const &p)
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
virtual const CSCGEMMotherboardLUT * getLUT() const =0
std::vector< std::pair< int, int > > get_csc_wg_to_gem_roll(Parity par, int layer=1) const
template<class T >
matches<T> CSCGEMMotherboard::matchingPads ( const CSCALCTDigi alct,
enum CSCPart  part 
)
protected

Referenced by setGEMGeometry().

template<class T >
matches<T> CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi clct,
enum CSCPart  part 
)
protected
template<class S , class T >
matches< T > CSCGEMMotherboard::matchingPads ( const S d1,
const S d2,
enum CSCPart  part 
)
protected

Definition at line 368 of file CSCGEMMotherboard.h.

References begin, end, p1, p2, and mps_fire::result.

369 {
370  matches<T> result, p1, p2;
371  p1 = matchingPads<T>(d1, part);
372  p2 = matchingPads<T>(d2, part);
373  result.reserve(p1.size() + p2.size());
374  result.insert(std::end(result), std::begin(p1), std::end(p1));
375  result.insert(std::end(result), std::begin(p2), std::end(p2));
376  return result;
377 }
#define end
Definition: vmac.h:37
double p2[4]
Definition: TauolaWrapper.h:90
part
Definition: HCALResponse.h:20
#define begin
Definition: vmac.h:30
double p1[4]
Definition: TauolaWrapper.h:89
template<class T >
matches< T > CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi clct1,
const CSCALCTDigi alct1,
enum CSCPart  part 
)
protected

Definition at line 380 of file CSCGEMMotherboard.h.

References CSCUpgradeMotherboard::intersection().

381 {
382  matches<T> padsClct(matchingPads<T>(clct1, part));
383  matches<T> padsAlct(matchingPads<T>(alct1, part));
384  return intersection(padsClct, padsAlct);
385 }
S intersection(const S &d1, const S &d2)
part
Definition: HCALResponse.h:20
template<class T >
matches< T > CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi clct1,
const CSCCLCTDigi clct2,
const CSCALCTDigi alct1,
const CSCALCTDigi alct2,
enum CSCPart  part 
)
protected

Definition at line 388 of file CSCGEMMotherboard.h.

References CSCUpgradeMotherboard::intersection().

391 {
392  matches<T> padsClct(matchingPads<CSCCLCTDigi,T>(clct1, clct2, part));
393  matches<T> padsAlct(matchingPads<CSCALCTDigi,T>(alct1, alct2, part));
394  return intersection(padsClct, padsAlct);
395 }
S intersection(const S &d1, const S &d2)
part
Definition: HCALResponse.h:20
template<>
matches<GEMPadDigi> CSCGEMMotherboard::matchingPads ( const CSCALCTDigi alct,
enum CSCPart  part 
)

Definition at line 275 of file CSCGEMMotherboard.h.

References funct::abs(), CSCALCTDigi::getBX(), getBX(), CSCALCTDigi::getKeyWG(), getLUT(), getRoll(), isPadInOverlap(), CSCALCTDigi::isValid(), CSCMotherboard::lct_central_bx, maxDeltaBXPad_, ME1A, or, AlCaHLTBitMon_ParallelJobs::p, pads_, CSCUpgradeMotherboard::par, and mps_fire::result.

276 {
277  matches<GEMPadDigi> result;
278  if (not alct.isValid()) return result;
279 
280  std::pair<int,int> alctRoll = (getLUT()->CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(par))[alct.getKeyWG()];
281  for (const auto& p: pads_[alct.getBX()]){
282  auto padRoll(getRoll(p));
283  // only pads in overlap are good for ME1A
284  if (part==CSCPart::ME1A and !isPadInOverlap(padRoll)) continue;
285 
286  int pad_bx = getBX(p.second)+lct_central_bx;
287  if (std::abs(alct.getBX()-pad_bx)>maxDeltaBXPad_) continue;
288 
289  if (alctRoll.first == -99 and alctRoll.second == -99) continue; //invalid region
290  else if (alctRoll.first == -99 and !(padRoll <= alctRoll.second)) continue; // top of the chamber
291  else if (alctRoll.second == -99 and !(padRoll >= alctRoll.first)) continue; // bottom of the chamber
292  else if ((alctRoll.first != -99 and alctRoll.second != -99) and // center
293  (alctRoll.first > padRoll or padRoll > alctRoll.second)) continue;
294  result.push_back(p);
295  }
296  return result;
297 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
int getRoll(const GEMPadDigiId &p)
int getBX(const GEMPadDigi &p)
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
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:48
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
GEMPadDigiIdsBX pads_
bool isPadInOverlap(int roll)
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
template<>
matches<GEMCoPadDigi> CSCGEMMotherboard::matchingPads ( const CSCALCTDigi alct,
enum CSCPart  part 
)

Definition at line 300 of file CSCGEMMotherboard.h.

References funct::abs(), coPads_, CSCALCTDigi::getBX(), getBX(), CSCALCTDigi::getKeyWG(), getLUT(), getRoll(), isPadInOverlap(), CSCALCTDigi::isValid(), CSCMotherboard::lct_central_bx, maxDeltaBXCoPad_, ME1A, or, AlCaHLTBitMon_ParallelJobs::p, CSCUpgradeMotherboard::par, and mps_fire::result.

301 {
302  matches<GEMCoPadDigi> result;
303  if (not alct.isValid()) return result;
304 
305  std::pair<int,int> alctRoll = (getLUT()->CSCGEMMotherboardLUT::get_csc_wg_to_gem_roll(par))[alct.getKeyWG()];
306  for (const auto& p: coPads_[alct.getBX()]){
307  auto padRoll(getRoll(p));
308  // only pads in overlap are good for ME1A
309  if (part==CSCPart::ME1A and !isPadInOverlap(padRoll)) continue;
310 
311  int pad_bx = getBX(p.second)+lct_central_bx;
312  if (std::abs(alct.getBX()-pad_bx)>maxDeltaBXCoPad_) continue;
313 
314  if (alctRoll.first == -99 and alctRoll.second == -99) continue; //invalid region
315  else if (alctRoll.first == -99 and !(padRoll <= alctRoll.second)) continue; // top of the chamber
316  else if (alctRoll.second == -99 and !(padRoll >= alctRoll.first)) continue; // bottom of the chamber
317  else if ((alctRoll.first != -99 and alctRoll.second != -99) and // center
318  (alctRoll.first > padRoll or padRoll > alctRoll.second)) continue;
319  result.push_back(p);
320  }
321  return result;
322 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
GEMCoPadDigiIdsBX coPads_
int getRoll(const GEMPadDigiId &p)
int getBX(const GEMPadDigi &p)
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
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:48
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
bool isPadInOverlap(int roll)
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
template<>
matches<GEMPadDigi> CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi clct,
enum CSCPart  part 
)

Definition at line 326 of file CSCGEMMotherboard.h.

References funct::abs(), CSCGEMMotherboardLUT::get_csc_hs_to_gem_pad(), getAvePad(), CSCCLCTDigi::getBX(), getBX(), CSCCLCTDigi::getKeyStrip(), getLUT(), CSCCLCTDigi::isValid(), CSCMotherboard::lct_central_bx, maxDeltaBXPad_, maxDeltaPadL1_, or, AlCaHLTBitMon_ParallelJobs::p, pads_, CSCUpgradeMotherboard::par, and mps_fire::result.

327 {
328  matches<GEMPadDigi> result;
329  if (not clct.isValid()) return result;
330 
331  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(par, part));
332  const int lowPad(mymap[clct.getKeyStrip()].first);
333  const int highPad(mymap[clct.getKeyStrip()].second);
334  for (const auto& p: pads_[clct.getBX()]){
335  auto padRoll(getAvePad(p.second));
336  int pad_bx = getBX(p.second)+lct_central_bx;
337  if (std::abs(clct.getBX()-pad_bx)>maxDeltaBXPad_) continue;
338  if (std::abs(lowPad - padRoll) <= maxDeltaPadL1_ or std::abs(padRoll - highPad) <= maxDeltaPadL1_){
339  result.push_back(p);
340  }
341  }
342  return result;
343 }
int getBX(const GEMPadDigi &p)
virtual std::vector< std::pair< int, int > > get_csc_hs_to_gem_pad(Parity par, enum CSCPart) const =0
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
int getBX() const
return BX
Definition: CSCCLCTDigi.h:51
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
GEMPadDigiIdsBX pads_
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
float getAvePad(const GEMPadDigi &)
template<>
matches<GEMCoPadDigi> CSCGEMMotherboard::matchingPads ( const CSCCLCTDigi clct,
enum CSCPart  part 
)

Definition at line 347 of file CSCGEMMotherboard.h.

References funct::abs(), coPads_, CSCGEMMotherboardLUT::get_csc_hs_to_gem_pad(), getAvePad(), CSCCLCTDigi::getBX(), getBX(), CSCCLCTDigi::getKeyStrip(), getLUT(), CSCCLCTDigi::isValid(), CSCMotherboard::lct_central_bx, maxDeltaBXCoPad_, maxDeltaPadL1_, or, AlCaHLTBitMon_ParallelJobs::p, CSCUpgradeMotherboard::par, and mps_fire::result.

348 {
349  matches<GEMCoPadDigi> result;
350  if (not clct.isValid()) return result;
351 
352  const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(par, part));
353  const int lowPad(mymap[clct.getKeyStrip()].first);
354  const int highPad(mymap[clct.getKeyStrip()].second);
355  for (const auto& p: coPads_[clct.getBX()]){
356  auto padRoll(getAvePad(p.second));
357  int pad_bx = getBX(p.second)+lct_central_bx;
358  if (std::abs(clct.getBX()-pad_bx)>maxDeltaBXCoPad_) continue;
359  if (std::abs(lowPad - padRoll) <= maxDeltaPadL1_ or std::abs(padRoll - highPad) <= maxDeltaPadL1_){
360  result.push_back(p);
361  }
362  }
363  return result;
364 }
GEMCoPadDigiIdsBX coPads_
int getBX(const GEMPadDigi &p)
virtual std::vector< std::pair< int, int > > get_csc_hs_to_gem_pad(Parity par, enum CSCPart) const =0
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
int getBX() const
return BX
Definition: CSCCLCTDigi.h:51
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
part
Definition: HCALResponse.h:20
virtual const CSCGEMMotherboardLUT * getLUT() const =0
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
float getAvePad(const GEMPadDigi &)
void CSCGEMMotherboard::printGEMTriggerCoPads ( int  bx_start,
int  bx_stop,
enum CSCPart  part 
)
protected

Definition at line 256 of file CSCGEMMotherboard.cc.

References coPads_, isPadInOverlap(), LogTrace, and ME11.

Referenced by setGEMGeometry().

257 {
258  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------" << std::endl;
259  LogTrace("CSCGEMMotherboard") << "* GEM trigger coincidence pads: " << std::endl;
260 
261  for (int bx = bx_start; bx <= bx_stop; bx++) {
262  const auto& in_pads = coPads_[bx];
263  LogTrace("CSCGEMMotherboard") << "N(copads) BX " << bx << " : " << in_pads.size() << std::endl;
264 
265  for (const auto& pad : in_pads){
266  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
267  const auto& roll_id(GEMDetId(pad.first));
268 
269  if (part==CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll())) LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
270  else LogTrace("CSCGEMMotherboard") << std::endl;
271  }
272  }
273 }
GEMCoPadDigiIdsBX coPads_
#define LogTrace(id)
part
Definition: HCALResponse.h:20
bool isPadInOverlap(int roll)
void CSCGEMMotherboard::printGEMTriggerPads ( int  bx_start,
int  bx_stop,
enum CSCPart  part 
)
protected

Definition at line 236 of file CSCGEMMotherboard.cc.

References isPadInOverlap(), LogTrace, ME11, and pads_.

Referenced by setGEMGeometry().

237 {
238  LogTrace("CSCGEMMotherboard") << "------------------------------------------------------------------------" << std::endl;
239  LogTrace("CSCGEMMotherboard") << "* GEM trigger pads: " << std::endl;
240 
241  for (int bx = bx_start; bx <= bx_stop; bx++) {
242  const auto& in_pads = pads_[bx];
243  LogTrace("CSCGEMMotherboard") << "N(pads) BX " << bx << " : " << in_pads.size() << std::endl;
244 
245  for (const auto& pad : in_pads){
246  LogTrace("CSCGEMMotherboard") << "\tdetId " << GEMDetId(pad.first) << ", pad = " << pad.second;
247  const auto& roll_id(GEMDetId(pad.first));
248 
249  if (part==CSCPart::ME11 and isPadInOverlap(GEMDetId(roll_id).roll())) LogTrace("CSCGEMMotherboard") << " (in overlap)" << std::endl;
250  else LogTrace("CSCGEMMotherboard") << std::endl;
251  }
252  }
253 }
#define LogTrace(id)
part
Definition: HCALResponse.h:20
GEMPadDigiIdsBX pads_
bool isPadInOverlap(int roll)
void CSCGEMMotherboard::retrieveGEMCoPads ( )
protected

Definition at line 70 of file CSCGEMMotherboard.cc.

References coPads_, gemCoPadV, and CSCMotherboard::lct_central_bx.

Referenced by setGEMGeometry().

71 {
72  coPads_.clear();
73  for (const auto& copad: gemCoPadV){
74  if (copad.first().bx() != lct_central_bx) continue;
75  coPads_[copad.bx(1)].push_back(std::make_pair(copad.roll(), copad));
76  }
77 }
GEMCoPadDigiIdsBX coPads_
std::vector< GEMCoPadDigi > gemCoPadV
void CSCGEMMotherboard::retrieveGEMPads ( const GEMPadDigiCollection pads,
unsigned  id 
)
protected

Definition at line 52 of file CSCGEMMotherboard.cc.

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

Referenced by setGEMGeometry().

53 {
54  pads_.clear();
55  auto superChamber(gem_g->superChamber(id));
56  for (const auto& ch : superChamber->chambers()) {
57  for (const auto& roll : ch->etaPartitions()) {
58  GEMDetId roll_id(roll->id());
59  auto pads_in_det = gemPads->get(roll_id);
60  for (auto pad = pads_in_det.first; pad != pads_in_det.second; ++pad) {
61  const int bx_shifted(lct_central_bx + pad->bx());
62  for (int bx = bx_shifted - maxDeltaBXPad_;bx <= bx_shifted + maxDeltaBXPad_; ++bx) {
63  pads_[bx].emplace_back(roll_id, *pad);
64  }
65  }
66  }
67  }
68 }
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:91
GEMPadDigiIdsBX pads_
const GEMGeometry * gem_g
virtual void CSCGEMMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiCollection gemPads 
)
pure virtual

Referenced by run().

void CSCGEMMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiClusterCollection gemPads 
)

Definition at line 42 of file CSCGEMMotherboard.cc.

References coPadProcessor, and run().

45 {
46  std::unique_ptr<GEMPadDigiCollection> gemPads(new GEMPadDigiCollection());
47  coPadProcessor->declusterize(gemClusters, *gemPads);
48  run(wiredc, compdc, gemPads.get());
49 }
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads)=0
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection
void CSCGEMMotherboard::setGEMGeometry ( const GEMGeometry g)
inline

set CSC and GEM geometries for the matching needs

Definition at line 48 of file CSCGEMMotherboard.h.

References CSCMotherboard::alct, bestMatchingPad(), CSCMotherboard::clct, constructLCTsGEM(), correlateLCTsGEM(), findQualityGEM(), g, gem_g, getAvePad(), getBX(), getLUT(), getRoll(), mps_fire::i, isPadInOverlap(), matchingPads(), AlCaHLTBitMon_ParallelJobs::p, printGEMTriggerCoPads(), printGEMTriggerPads(), retrieveGEMCoPads(), retrieveGEMPads(), S(), edm::second(), and setupGeometry().

48 { 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
void CSCGEMMotherboard::setupGeometry ( )
protected

Definition at line 230 of file CSCGEMMotherboard.cc.

References gem_g, CSCUpgradeMotherboard::generator_, and CSCUpgradeMotherboard::setupGeometry().

Referenced by setGEMGeometry().

231 {
233  generator_->setGEMGeometry(gem_g);
234 }
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
const GEMGeometry * gem_g

Member Data Documentation

std::unique_ptr<GEMCoPadProcessor> CSCGEMMotherboard::coPadProcessor

additional processor for GEMs

Definition at line 45 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and run().

GEMCoPadDigiIdsBX CSCGEMMotherboard::coPads_
protected

Definition at line 140 of file CSCGEMMotherboard.h.

Referenced by clear(), matchingPads(), printGEMTriggerCoPads(), and retrieveGEMCoPads().

bool CSCGEMMotherboard::doLCTGhostBustingWithGEMs_
protected

Definition at line 158 of file CSCGEMMotherboard.h.

const GEMGeometry* CSCGEMMotherboard::gem_g
protected

Definition at line 133 of file CSCGEMMotherboard.h.

Referenced by retrieveGEMPads(), setGEMGeometry(), and setupGeometry().

std::vector<GEMCoPadDigi> CSCGEMMotherboard::gemCoPadV
protected

Definition at line 136 of file CSCGEMMotherboard.h.

Referenced by retrieveGEMCoPads().

bool CSCGEMMotherboard::gemGeometryAvailable
protected

Definition at line 134 of file CSCGEMMotherboard.h.

unsigned CSCGEMMotherboard::gemId
protected

Chamber id (trigger-type labels).

Definition at line 131 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

int CSCGEMMotherboard::maxDeltaBXCoPad_
protected

Definition at line 144 of file CSCGEMMotherboard.h.

Referenced by matchingPads().

int CSCGEMMotherboard::maxDeltaBXPad_
protected

Definition at line 143 of file CSCGEMMotherboard.h.

Referenced by matchingPads(), and retrieveGEMPads().

int CSCGEMMotherboard::maxDeltaPadL1_
protected

Definition at line 145 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard(), and matchingPads().

int CSCGEMMotherboard::maxDeltaPadL2_
protected

Definition at line 146 of file CSCGEMMotherboard.h.

Referenced by CSCGEMMotherboard().

GEMPadDigiIdsBX CSCGEMMotherboard::pads_
protected

Definition at line 139 of file CSCGEMMotherboard.h.

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

bool CSCGEMMotherboard::promoteALCTGEMpattern_
protected

Definition at line 152 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteALCTGEMquality_
protected

Definition at line 154 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::promoteCLCTGEMquality_
protected

Definition at line 155 of file CSCGEMMotherboard.h.

Referenced by constructLCTsGEM().

bool CSCGEMMotherboard::useOldLCTDataFormat_
protected

Definition at line 149 of file CSCGEMMotherboard.h.