CMS 3D CMS Logo

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

#include <CSCALCTCrossCLCT.h>

Public Member Functions

void calculateLCTCodes (const CSCALCTDigi &a1, const CSCCLCTDigi &c1, const CSCALCTDigi &a2, const CSCCLCTDigi &c2, unsigned &bestLCTCode, unsigned &secondLCTCode) const
 
 CSCALCTCrossCLCT (unsigned endcap, unsigned station, unsigned ring, bool ignoreAlctCrossClct, const edm::ParameterSet &conf)
 
bool doesALCTCrossCLCT (const CSCALCTDigi &a, const CSCCLCTDigi &c) const
 

Private Member Functions

bool doesWiregroupCrossHalfStrip (int wg, int keystrip) const
 

Private Attributes

std::unique_ptr< CSCLUTReadercode_to_best_lct_
 
std::unique_ptr< CSCLUTReadercode_to_second_lct_
 
unsigned endcap_
 
bool gangedME1a_
 
bool ignoreAlctCrossClct_
 
std::vector< std::string > lctCombinationCodeFiles_
 
unsigned ring_
 
unsigned station_
 
std::unique_ptr< CSCLUTReaderwg_cross_max_hs_ME1a_
 
std::unique_ptr< CSCLUTReaderwg_cross_max_hs_ME1a_ganged_
 
std::unique_ptr< CSCLUTReaderwg_cross_max_hs_ME1b_
 
std::unique_ptr< CSCLUTReaderwg_cross_min_hs_ME1a_
 
std::unique_ptr< CSCLUTReaderwg_cross_min_hs_ME1a_ganged_
 
std::unique_ptr< CSCLUTReaderwg_cross_min_hs_ME1b_
 
std::vector< std::string > wgCrossHsME1aFiles_
 
std::vector< std::string > wgCrossHsME1aGangedFiles_
 
std::vector< std::string > wgCrossHsME1bFiles_
 

Detailed Description

Helper class to check if an ALCT crosses with a CLCT in ME1/1. This check was originally introduced by Vadim Khotilovich in 2010 to improve the quality of the ME1/1 LCTs that are sent to the endcap muon track finder. However, it is the policy of the EMTF group that they would like to receive all LCT information, even if an ME1/1 LCT has no physical crossing half-strips and wiregroups. The EMTF disassembles LCTs into ALCT and CLCT anyway and thus for normal trigger operations this class should not be used. However, in the event that multiple high-quality LCTs are present in ME1/1, this class could be used to trim the unphysical ones. As of writing (April 2021) no plans are in place to implement this feature into the CSC trigger firmware

Author
Sven Dildick (Rice University)

Definition at line 33 of file CSCALCTCrossCLCT.h.

Constructor & Destructor Documentation

◆ CSCALCTCrossCLCT()

CSCALCTCrossCLCT::CSCALCTCrossCLCT ( unsigned  endcap,
unsigned  station,
unsigned  ring,
bool  ignoreAlctCrossClct,
const edm::ParameterSet conf 
)

Definition at line 8 of file CSCALCTCrossCLCT.cc.

11  const auto& commonParams = conf.getParameter<edm::ParameterSet>("commonParam");
12  gangedME1a_ = commonParams.getParameter<bool>("gangedME1a");
14 
15  if (!ignoreAlctCrossClct_) {
16  const edm::ParameterSet me11luts(conf.getParameter<edm::ParameterSet>("wgCrossHsME11Params"));
17  wgCrossHsME1aFiles_ = me11luts.getParameter<std::vector<std::string>>("wgCrossHsME1aFiles");
18  wgCrossHsME1aGangedFiles_ = me11luts.getParameter<std::vector<std::string>>("wgCrossHsME1aGangedFiles");
19  wgCrossHsME1bFiles_ = me11luts.getParameter<std::vector<std::string>>("wgCrossHsME1bFiles");
20  wg_cross_min_hs_ME1a_ = std::make_unique<CSCLUTReader>(wgCrossHsME1aFiles_[0]);
21  wg_cross_max_hs_ME1a_ = std::make_unique<CSCLUTReader>(wgCrossHsME1aFiles_[1]);
22  wg_cross_min_hs_ME1a_ganged_ = std::make_unique<CSCLUTReader>(wgCrossHsME1aGangedFiles_[0]);
23  wg_cross_max_hs_ME1a_ganged_ = std::make_unique<CSCLUTReader>(wgCrossHsME1aGangedFiles_[1]);
24  wg_cross_min_hs_ME1b_ = std::make_unique<CSCLUTReader>(wgCrossHsME1bFiles_[0]);
25  wg_cross_max_hs_ME1b_ = std::make_unique<CSCLUTReader>(wgCrossHsME1bFiles_[1]);
26  }
27 }

References gangedME1a_, edm::ParameterSet::getParameter(), tmbParams::ignoreAlctCrossClct, ignoreAlctCrossClct_, wg_cross_max_hs_ME1a_, wg_cross_max_hs_ME1a_ganged_, wg_cross_max_hs_ME1b_, wg_cross_min_hs_ME1a_, wg_cross_min_hs_ME1a_ganged_, wg_cross_min_hs_ME1b_, wgCrossHsME1aFiles_, wgCrossHsME1aGangedFiles_, and wgCrossHsME1bFiles_.

Member Function Documentation

◆ calculateLCTCodes()

void CSCALCTCrossCLCT::calculateLCTCodes ( const CSCALCTDigi a1,
const CSCCLCTDigi c1,
const CSCALCTDigi a2,
const CSCCLCTDigi c2,
unsigned &  bestLCTCode,
unsigned &  secondLCTCode 
) const

Definition at line 29 of file CSCALCTCrossCLCT.cc.

34  {
35  // Each of these calls should return "1" when the ALCT and CLCT are valid.
36  const bool ok11 = doesALCTCrossCLCT(bestALCT, bestCLCT);
37  const bool ok12 = doesALCTCrossCLCT(bestALCT, secondCLCT);
38  const bool ok21 = doesALCTCrossCLCT(secondALCT, bestCLCT);
39  const bool ok22 = doesALCTCrossCLCT(secondALCT, secondCLCT);
40 
41  /*
42  With these okxx, we now calculate a 4-bit code that determines
43  the best and second LCT combinations.
44  */
45 
46  const unsigned code = (ok11 << 3) | (ok12 << 2) | (ok21 << 1) | (ok22);
47 
48  bestLCTCode = code_to_best_lct_->lookup(code);
49  secondLCTCode = code_to_second_lct_->lookup(code);
50 
51  edm::LogInfo("CSCALCTCrossCLCT") << "Calculate LCT combination code" << std::endl
52  << "ALCT1: " << bestALCT << std::endl
53  << "ALCT2: " << secondALCT << std::endl
54  << "CLCT1: " << bestCLCT << std::endl
55  << "CLCT2: " << secondCLCT << std::endl
56  << "LCT combination code: " << code << std::endl
57  << "LCT1: " << bestLCTCode << std::endl
58  << "LCT1: " << secondLCTCode << std::endl;
59 }

References code_to_best_lct_, code_to_second_lct_, and doesALCTCrossCLCT().

◆ doesALCTCrossCLCT()

bool CSCALCTCrossCLCT::doesALCTCrossCLCT ( const CSCALCTDigi a,
const CSCCLCTDigi c 
) const

Definition at line 61 of file CSCALCTCrossCLCT.cc.

61  {
62  // both need to valid
63  if (!c.isValid() || !a.isValid()) {
64  return false;
65  }
66 
67  // when non-overlapping half-strips and wiregroups don't matter
69  return true;
70 
71  // overlap only needs to be considered for ME1/1
72  if (station_ == 1 and ring_ == 1) {
73  return doesWiregroupCrossHalfStrip(a.getKeyWG(), c.getKeyStrip());
74  } else
75  return true;
76 }

References a, c, doesWiregroupCrossHalfStrip(), ignoreAlctCrossClct_, ring_, and station_.

Referenced by calculateLCTCodes().

◆ doesWiregroupCrossHalfStrip()

bool CSCALCTCrossCLCT::doesWiregroupCrossHalfStrip ( int  wg,
int  keystrip 
) const
private

Definition at line 78 of file CSCALCTCrossCLCT.cc.

78  {
79  const int min_hs_ME1a = wg_cross_min_hs_ME1a_->lookup(wiregroup);
80  const int max_hs_ME1a = wg_cross_max_hs_ME1a_->lookup(wiregroup);
81  const int min_hs_ME1a_ganged = wg_cross_min_hs_ME1a_ganged_->lookup(wiregroup);
82  const int max_hs_ME1a_ganged = wg_cross_max_hs_ME1a_ganged_->lookup(wiregroup);
83  const int min_hs_ME1b = wg_cross_min_hs_ME1b_->lookup(wiregroup);
84  const int max_hs_ME1b = wg_cross_max_hs_ME1b_->lookup(wiregroup);
85 
86  // ME1/a half-strip starts at 128
87  if (halfstrip > CSCConstants::MAX_HALF_STRIP_ME1B) {
88  if (!gangedME1a_) {
89  // wrap around ME11 HS number for -z endcap
90  if (endcap_ == 2) {
91  // first subtract 128
92  halfstrip -= 1 + CSCConstants::MAX_HALF_STRIP_ME1B;
93  // flip the HS
94  halfstrip = CSCConstants::MAX_HALF_STRIP_ME1A_UNGANGED - halfstrip;
95  // then add 128 again
96  halfstrip += 1 + CSCConstants::MAX_HALF_STRIP_ME1B;
97  }
98  return halfstrip >= min_hs_ME1a && halfstrip <= max_hs_ME1a;
99  }
100 
101  else {
102  // wrap around ME11 HS number for -z endcap
103  if (endcap_ == 2) {
104  // first subtract 128
105  halfstrip -= 1 + CSCConstants::MAX_HALF_STRIP_ME1B;
106  // flip the HS
107  halfstrip = CSCConstants::MAX_HALF_STRIP_ME1A_GANGED - halfstrip;
108  // then add 128 again
109  halfstrip += 1 + CSCConstants::MAX_HALF_STRIP_ME1B;
110  }
111  return halfstrip >= min_hs_ME1a_ganged && halfstrip <= max_hs_ME1a_ganged;
112  }
113  }
114  // ME1/b half-strip ends at 127
115  else if (halfstrip <= CSCConstants::MAX_HALF_STRIP_ME1B) {
116  if (endcap_ == 2) {
117  halfstrip = CSCConstants::MAX_HALF_STRIP_ME1B - halfstrip;
118  }
119  return halfstrip >= min_hs_ME1b && halfstrip <= max_hs_ME1b;
120  }
121  // all other cases, return true
122  else
123  return true;
124 }

References endcap_, gangedME1a_, CSCConstants::MAX_HALF_STRIP_ME1A_GANGED, CSCConstants::MAX_HALF_STRIP_ME1A_UNGANGED, CSCConstants::MAX_HALF_STRIP_ME1B, wg_cross_max_hs_ME1a_, wg_cross_max_hs_ME1a_ganged_, wg_cross_max_hs_ME1b_, wg_cross_min_hs_ME1a_, wg_cross_min_hs_ME1a_ganged_, and wg_cross_min_hs_ME1b_.

Referenced by doesALCTCrossCLCT().

Member Data Documentation

◆ code_to_best_lct_

std::unique_ptr<CSCLUTReader> CSCALCTCrossCLCT::code_to_best_lct_
private

Definition at line 87 of file CSCALCTCrossCLCT.h.

Referenced by calculateLCTCodes().

◆ code_to_second_lct_

std::unique_ptr<CSCLUTReader> CSCALCTCrossCLCT::code_to_second_lct_
private

Definition at line 88 of file CSCALCTCrossCLCT.h.

Referenced by calculateLCTCodes().

◆ endcap_

unsigned CSCALCTCrossCLCT::endcap_
private

Definition at line 68 of file CSCALCTCrossCLCT.h.

Referenced by doesWiregroupCrossHalfStrip().

◆ gangedME1a_

bool CSCALCTCrossCLCT::gangedME1a_
private

Definition at line 71 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT(), and doesWiregroupCrossHalfStrip().

◆ ignoreAlctCrossClct_

bool CSCALCTCrossCLCT::ignoreAlctCrossClct_
private

Definition at line 72 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT(), and doesALCTCrossCLCT().

◆ lctCombinationCodeFiles_

std::vector<std::string> CSCALCTCrossCLCT::lctCombinationCodeFiles_
private

Definition at line 78 of file CSCALCTCrossCLCT.h.

◆ ring_

unsigned CSCALCTCrossCLCT::ring_
private

Definition at line 70 of file CSCALCTCrossCLCT.h.

Referenced by doesALCTCrossCLCT().

◆ station_

unsigned CSCALCTCrossCLCT::station_
private

Definition at line 69 of file CSCALCTCrossCLCT.h.

Referenced by doesALCTCrossCLCT().

◆ wg_cross_max_hs_ME1a_

std::unique_ptr<CSCLUTReader> CSCALCTCrossCLCT::wg_cross_max_hs_ME1a_
private

Definition at line 82 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT(), and doesWiregroupCrossHalfStrip().

◆ wg_cross_max_hs_ME1a_ganged_

std::unique_ptr<CSCLUTReader> CSCALCTCrossCLCT::wg_cross_max_hs_ME1a_ganged_
private

Definition at line 84 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT(), and doesWiregroupCrossHalfStrip().

◆ wg_cross_max_hs_ME1b_

std::unique_ptr<CSCLUTReader> CSCALCTCrossCLCT::wg_cross_max_hs_ME1b_
private

Definition at line 86 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT(), and doesWiregroupCrossHalfStrip().

◆ wg_cross_min_hs_ME1a_

std::unique_ptr<CSCLUTReader> CSCALCTCrossCLCT::wg_cross_min_hs_ME1a_
private

Definition at line 81 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT(), and doesWiregroupCrossHalfStrip().

◆ wg_cross_min_hs_ME1a_ganged_

std::unique_ptr<CSCLUTReader> CSCALCTCrossCLCT::wg_cross_min_hs_ME1a_ganged_
private

Definition at line 83 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT(), and doesWiregroupCrossHalfStrip().

◆ wg_cross_min_hs_ME1b_

std::unique_ptr<CSCLUTReader> CSCALCTCrossCLCT::wg_cross_min_hs_ME1b_
private

Definition at line 85 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT(), and doesWiregroupCrossHalfStrip().

◆ wgCrossHsME1aFiles_

std::vector<std::string> CSCALCTCrossCLCT::wgCrossHsME1aFiles_
private

Definition at line 75 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT().

◆ wgCrossHsME1aGangedFiles_

std::vector<std::string> CSCALCTCrossCLCT::wgCrossHsME1aGangedFiles_
private

Definition at line 76 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT().

◆ wgCrossHsME1bFiles_

std::vector<std::string> CSCALCTCrossCLCT::wgCrossHsME1bFiles_
private

Definition at line 77 of file CSCALCTCrossCLCT.h.

Referenced by CSCALCTCrossCLCT().

CSCALCTCrossCLCT::wgCrossHsME1bFiles_
std::vector< std::string > wgCrossHsME1bFiles_
Definition: CSCALCTCrossCLCT.h:77
CSCALCTCrossCLCT::doesALCTCrossCLCT
bool doesALCTCrossCLCT(const CSCALCTDigi &a, const CSCCLCTDigi &c) const
Definition: CSCALCTCrossCLCT.cc:61
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCALCTCrossCLCT::wg_cross_min_hs_ME1a_
std::unique_ptr< CSCLUTReader > wg_cross_min_hs_ME1a_
Definition: CSCALCTCrossCLCT.h:81
CSCALCTCrossCLCT::wgCrossHsME1aGangedFiles_
std::vector< std::string > wgCrossHsME1aGangedFiles_
Definition: CSCALCTCrossCLCT.h:76
CSCALCTCrossCLCT::wg_cross_max_hs_ME1b_
std::unique_ptr< CSCLUTReader > wg_cross_max_hs_ME1b_
Definition: CSCALCTCrossCLCT.h:86
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCALCTCrossCLCT::station_
unsigned station_
Definition: CSCALCTCrossCLCT.h:69
CSCALCTCrossCLCT::ignoreAlctCrossClct_
bool ignoreAlctCrossClct_
Definition: CSCALCTCrossCLCT.h:72
CSCALCTCrossCLCT::doesWiregroupCrossHalfStrip
bool doesWiregroupCrossHalfStrip(int wg, int keystrip) const
Definition: CSCALCTCrossCLCT.cc:78
CSCALCTCrossCLCT::wg_cross_min_hs_ME1b_
std::unique_ptr< CSCLUTReader > wg_cross_min_hs_ME1b_
Definition: CSCALCTCrossCLCT.h:85
CSCConstants::MAX_HALF_STRIP_ME1B
Definition: CSCConstants.h:88
CSCALCTCrossCLCT::ring_
unsigned ring_
Definition: CSCALCTCrossCLCT.h:70
edm::ParameterSet
Definition: ParameterSet.h:47
CSCConstants::MAX_HALF_STRIP_ME1A_UNGANGED
Definition: CSCConstants.h:87
a
double a
Definition: hdecay.h:119
CSCALCTCrossCLCT::code_to_best_lct_
std::unique_ptr< CSCLUTReader > code_to_best_lct_
Definition: CSCALCTCrossCLCT.h:87
CSCALCTCrossCLCT::code_to_second_lct_
std::unique_ptr< CSCLUTReader > code_to_second_lct_
Definition: CSCALCTCrossCLCT.h:88
CSCConstants::MAX_HALF_STRIP_ME1A_GANGED
Definition: CSCConstants.h:86
CSCALCTCrossCLCT::wg_cross_min_hs_ME1a_ganged_
std::unique_ptr< CSCLUTReader > wg_cross_min_hs_ME1a_ganged_
Definition: CSCALCTCrossCLCT.h:83
CSCALCTCrossCLCT::endcap_
unsigned endcap_
Definition: CSCALCTCrossCLCT.h:68
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CSCALCTCrossCLCT::wg_cross_max_hs_ME1a_
std::unique_ptr< CSCLUTReader > wg_cross_max_hs_ME1a_
Definition: CSCALCTCrossCLCT.h:82
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCALCTCrossCLCT::gangedME1a_
bool gangedME1a_
Definition: CSCALCTCrossCLCT.h:71
tmbParams.ignoreAlctCrossClct
ignoreAlctCrossClct
Definition: tmbParams.py:43
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
CSCALCTCrossCLCT::wgCrossHsME1aFiles_
std::vector< std::string > wgCrossHsME1aFiles_
Definition: CSCALCTCrossCLCT.h:75
CSCALCTCrossCLCT::wg_cross_max_hs_ME1a_ganged_
std::unique_ptr< CSCLUTReader > wg_cross_max_hs_ME1a_ganged_
Definition: CSCALCTCrossCLCT.h:84