CMS 3D CMS Logo

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

#include <L1TPhase2GMTEndcapStubProcessor.h>

Public Member Functions

 L1TPhase2GMTEndcapStubProcessor ()
 
 L1TPhase2GMTEndcapStubProcessor (const edm::ParameterSet &)
 
l1t::MuonStubCollection makeStubs (const MuonDigiCollection< CSCDetId, CSCCorrelatedLCTDigi > &csc, const MuonDigiCollection< RPCDetId, RPCDigi > &rpc, const L1TMuon::GeometryTranslator *t, const edm::EventSetup &iSetup)
 
 ~L1TPhase2GMTEndcapStubProcessor ()
 

Private Member Functions

l1t::MuonStub buildCSCOnlyStub (const CSCDetId &, const CSCCorrelatedLCTDigi &, const L1TMuon::GeometryTranslator *, unsigned int)
 
l1t::MuonStub buildRPCOnlyStub (const RPCDetId &, const RPCDigi &, const L1TMuon::GeometryTranslator *)
 
l1t::MuonStubCollection combineStubs (const l1t::MuonStubCollection &, const l1t::MuonStubCollection &)
 

Private Attributes

double coord1LSB_
 
double coord2LSB_
 
double eta1LSB_
 
double eta2LSB_
 
double etaMatch_
 
int maxBX_
 
int minBX_
 
double phiMatch_
 
bool verbose_
 

Detailed Description

Definition at line 16 of file L1TPhase2GMTEndcapStubProcessor.h.

Constructor & Destructor Documentation

◆ L1TPhase2GMTEndcapStubProcessor() [1/2]

L1TPhase2GMTEndcapStubProcessor::L1TPhase2GMTEndcapStubProcessor ( )

◆ L1TPhase2GMTEndcapStubProcessor() [2/2]

L1TPhase2GMTEndcapStubProcessor::L1TPhase2GMTEndcapStubProcessor ( const edm::ParameterSet iConfig)

Definition at line 10 of file L1TPhase2GMTEndcapStubProcessor.cc.

11  : minBX_(iConfig.getParameter<int>("minBX")),
12  maxBX_(iConfig.getParameter<int>("maxBX")),
13  coord1LSB_(iConfig.getParameter<double>("coord1LSB")),
14  coord2LSB_(iConfig.getParameter<double>("coord2LSB")),
15  eta1LSB_(iConfig.getParameter<double>("eta1LSB")),
16  eta2LSB_(iConfig.getParameter<double>("eta2LSB")),
17  etaMatch_(iConfig.getParameter<double>("etaMatch")),
18  phiMatch_(iConfig.getParameter<double>("phiMatch")),
19  verbose_(iConfig.getParameter<unsigned int>("verbose")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~L1TPhase2GMTEndcapStubProcessor()

L1TPhase2GMTEndcapStubProcessor::~L1TPhase2GMTEndcapStubProcessor ( )

Definition at line 21 of file L1TPhase2GMTEndcapStubProcessor.cc.

21 {}

Member Function Documentation

◆ buildCSCOnlyStub()

l1t::MuonStub L1TPhase2GMTEndcapStubProcessor::buildCSCOnlyStub ( const CSCDetId detid,
const CSCCorrelatedLCTDigi digi,
const L1TMuon::GeometryTranslator translator,
unsigned int  tag 
)
private

Definition at line 23 of file L1TPhase2GMTEndcapStubProcessor.cc.

References nano_mu_digi_cff::bx, relativeConstraints::chamber, CSCDetId::chamber(), coord1LSB_, CSCDetId::endcap(), makeMuonMisalignmentScenario::endcap, HLT_2024v14_cff::eta1, eta1LSB_, CSCCorrelatedLCTDigi::getBX(), L1TMuon::GeometryTranslator::getGlobalPoint(), runTauDisplay::gp, createfilelist::int, phi, funct::primitive(), quality, CSCDetId::ring(), relativeConstraints::ring, nano_mu_digi_cff::sector, l1t::MuonStub::setOfflineQuantities(), Validation_hcalonly_cfi::sign, relativeConstraints::station, CSCDetId::station(), makeGlobalPositionRcd_cfg::tag, parallelization::uint, and makeMuonMisalignmentScenario::wheel.

Referenced by makeStubs().

26  {
27  int endcap = detid.endcap();
28  int station = detid.station();
29  int chamber = detid.chamber();
30  int ring = detid.ring();
31 
33 
34  const GlobalPoint& gp = translator->getGlobalPoint(primitive);
35 
36  int phi = int(gp.phi().value() / coord1LSB_);
37  int eta1 = int(gp.eta() / eta1LSB_);
38 
39  int wheel = 0;
40  int sign = endcap == 1 ? -1 : 1;
41 
42  if (ring == 3)
43  wheel = sign * 3;
44  else if (ring == 2)
45  wheel = sign * 4;
46  else if (ring == 1)
47  wheel = sign * 5;
48 
49  int sector = fabs(chamber);
50 
51  int bx = digi.getBX() - 8;
52  int quality = 1;
53 
54  uint tfLayer = 0;
55  if ((ring == 3 || ring == 2) && station == 1) //ME1/3
56  tfLayer = 4;
57  else if (ring == 1 && station == 1) //ME1/3
58  tfLayer = 0;
59  else if (station == 2) //ME2/2
60  tfLayer = 2;
61  else if (station == 3) //ME3/2
62  tfLayer = 1;
63  else if (station == 4) //ME4/2
64  tfLayer = 3;
65 
66  l1t::MuonStub stub(wheel, sector, station, tfLayer, phi, 0, tag, bx, quality, eta1, 0, 1, 0);
67 
68  stub.setOfflineQuantities(gp.phi().value(), 0.0, gp.eta(), 0.0);
69  return stub;
70 }
GlobalPoint getGlobalPoint(const TriggerPrimitive &) const
Primitive< F, X >::type primitive(const F &f)
Definition: Primitive.h:41
string quality
uint16_t getBX() const
return BX
int chamber() const
Definition: CSCDetId.h:62
int station() const
Definition: CSCDetId.h:79
int endcap() const
Definition: CSCDetId.h:85
int ring() const
Definition: CSCDetId.h:68

◆ buildRPCOnlyStub()

l1t::MuonStub L1TPhase2GMTEndcapStubProcessor::buildRPCOnlyStub ( const RPCDetId detid,
const RPCDigi digi,
const L1TMuon::GeometryTranslator translator 
)
private

Definition at line 72 of file L1TPhase2GMTEndcapStubProcessor.cc.

References RPCDigi::bx(), nano_mu_digi_cff::bx, coord2LSB_, HLT_2024v14_cff::eta2, eta2LSB_, L1TMuon::GeometryTranslator::getGlobalPoint(), runTauDisplay::gp, createfilelist::int, funct::primitive(), quality, RPCDetId::region(), RPCDetId::ring(), relativeConstraints::ring, nano_mu_digi_cff::sector, RPCDetId::sector(), l1t::MuonStub::setOfflineQuantities(), relativeConstraints::station, RPCDetId::station(), RPCDetId::subsector(), makeGlobalPositionRcd_cfg::tag, RPCDetId::trIndex(), parallelization::uint, and makeMuonMisalignmentScenario::wheel.

Referenced by makeStubs().

74  {
76  const GlobalPoint& gp = translator->getGlobalPoint(primitive);
77 
78  int phi2 = int(gp.phi().value() / coord2LSB_);
79  int eta2 = int(gp.eta() / eta2LSB_);
80 
81  int wheel = -(6 - detid.ring()) * detid.region();
82  int sector = (detid.sector() - 1) * 6 + detid.subsector();
83  int station = detid.station();
84  bool tag = detid.trIndex();
85  int bx = digi.bx();
86  int quality = 2;
87 
88  int ring = detid.ring();
89 
90  uint tfLayer = 0;
91 
92  if ((ring == 3 || ring == 2) && station == 1) //ME1/3
93  tfLayer = 4;
94  // else if (ring==1 && station==1) //ME1/3
95  // tfLayer=0;
96  else if (station == 2) //ME2/2
97  tfLayer = 2;
98  else if (station == 3) //ME3/2
99  tfLayer = 1;
100  else if (station == 4) //ME4/2
101  tfLayer = 3;
102 
103  l1t::MuonStub stub(wheel, sector, station, tfLayer, 0, phi2, tag, bx, quality, 0, eta2, 2, 0);
104  stub.setOfflineQuantities(gp.phi().value(), gp.phi().value(), gp.eta(), gp.eta());
105  return stub;
106 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
int bx() const
Definition: RPCDigi.h:28
GlobalPoint getGlobalPoint(const TriggerPrimitive &) const
int trIndex() const
Definition: RPCDetId.h:96
int ring() const
Definition: RPCDetId.h:59
Primitive< F, X >::type primitive(const F &f)
Definition: Primitive.h:41
string quality
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:88
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53

◆ combineStubs()

l1t::MuonStubCollection L1TPhase2GMTEndcapStubProcessor::combineStubs ( const l1t::MuonStubCollection cscStubs,
const l1t::MuonStubCollection rpcStubs 
)
private

Definition at line 108 of file L1TPhase2GMTEndcapStubProcessor.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, l1t::MuonStub::depthRegion(), PVValHelper::eta, l1t::MuonStub::eta1(), etaMatch_, l1t::MuonStub::etaRegion(), mps_fire::i, runTheMatrix::keep, l1t::MuonStub::offline_coord1(), l1t::MuonStub::offline_eta1(), MillePedeFileConverter_cfg::out, phi, phiMatch_, omtf::DataWord64::rpc, l1t::MuonStub::setEta(), l1t::MuonStub::setOfflineQuantities(), and parallelization::uint.

Referenced by makeStubs().

109  {
111  l1t::MuonStubCollection usedRPC;
112  l1t::MuonStubCollection cleanedRPC;
113 
114  l1t::MuonStubCollection cleanedCSC;
115 
116  //clean ME11 ambiguities
117  l1t::MuonStubCollection allCSC = cscStubs;
118 
119  while (!allCSC.empty()) {
120  l1t::MuonStub stub = allCSC[0];
121  l1t::MuonStubCollection freeCSC;
122  for (uint i = 1; i < allCSC.size(); ++i) {
123  if ((stub.etaRegion() == allCSC[i].etaRegion()) && (stub.depthRegion() == allCSC[i].depthRegion()) &&
124  (fabs(deltaPhi(stub.offline_coord1(), allCSC[i].offline_coord1())) < 0.001)) {
125  if (fabs(stub.offline_eta1() - allCSC[i].offline_eta1()) > 0.001) {
126  stub.setEta(stub.eta1(), allCSC[i].eta1(), 3);
127  stub.setOfflineQuantities(stub.offline_coord1(), 0.0, stub.offline_eta1(), allCSC[i].offline_eta1());
128  }
129  } else {
130  freeCSC.push_back(allCSC[i]);
131  }
132  }
133  cleanedCSC.push_back(stub);
134  allCSC = freeCSC;
135  }
136 
137  for (const auto& csc : cleanedCSC) {
138  int nRPC = 0;
139  float phiF = 0.0;
140  float etaF = 0.0;
141  int phi = 0;
142  int eta = 0;
143  for (const auto& rpc : rpcStubs) {
144  if (csc.depthRegion() != rpc.depthRegion())
145  continue;
146  if (fabs(deltaPhi(csc.offline_coord1(), rpc.offline_coord2())) < phiMatch_ &&
147  fabs(csc.offline_eta1() - rpc.offline_eta2()) < etaMatch_ && csc.bxNum() == rpc.bxNum()) {
148  phiF += rpc.offline_coord2();
149  etaF += rpc.offline_eta2();
150  phi += rpc.coord2();
151  eta += rpc.eta2();
152  nRPC++;
153  usedRPC.push_back(rpc);
154  }
155  }
156 
157  int finalRPCPhi = 0;
158  int finalRPCEta = 0;
159  double offline_finalRPCPhi = 0;
160  double offline_finalRPCEta = 0;
161  if (nRPC != 0) {
162  finalRPCPhi = phi / nRPC;
163  finalRPCEta = eta / nRPC;
164  offline_finalRPCPhi = phiF / nRPC;
165  offline_finalRPCEta = etaF / nRPC;
166  l1t::MuonStub stub(csc.etaRegion(),
167  csc.phiRegion(),
168  csc.depthRegion(),
169  csc.tfLayer(),
170  csc.coord1(),
171  finalRPCPhi,
172  0,
173  csc.bxNum(),
174  3,
175  csc.eta1(),
176  finalRPCEta,
177  3,
178  0);
179  stub.setOfflineQuantities(csc.offline_coord1(), offline_finalRPCPhi, csc.offline_eta1(), offline_finalRPCEta);
180  out.push_back(stub);
181  } else {
182  out.push_back(csc);
183  }
184  }
185 
186  //clean the RPC from the used ones
187 
188  for (const auto& rpc : rpcStubs) {
189  bool keep = true;
190  for (const auto& rpc2 : usedRPC) {
191  if (rpc == rpc2) {
192  keep = false;
193  break;
194  }
195  }
196  if (keep)
197  cleanedRPC.push_back(rpc);
198  }
199 
200  while (!cleanedRPC.empty()) {
201  l1t::MuonStubCollection freeRPC;
202 
203  int nRPC = 1;
204  float phiF = cleanedRPC[0].offline_coord2();
205  float etaF = cleanedRPC[0].offline_eta2();
206  int phi = cleanedRPC[0].coord2();
207  int eta = cleanedRPC[0].eta2();
208 
209  for (unsigned i = 1; i < cleanedRPC.size(); ++i) {
210  if (fabs(deltaPhi(cleanedRPC[0].offline_coord2(), cleanedRPC[i].offline_coord2())) < phiMatch_ &&
211  cleanedRPC[0].depthRegion() == cleanedRPC[i].depthRegion() &&
212  fabs(cleanedRPC[0].offline_eta2() - cleanedRPC[i].offline_eta2()) < etaMatch_ &&
213  cleanedRPC[0].bxNum() == cleanedRPC[i].bxNum()) {
214  phiF += cleanedRPC[i].offline_coord2();
215  etaF += cleanedRPC[i].offline_eta2();
216  phi += cleanedRPC[i].coord2();
217  eta += cleanedRPC[i].eta2();
218  nRPC++;
219  } else {
220  freeRPC.push_back(cleanedRPC[i]);
221  }
222  }
223  l1t::MuonStub stub(cleanedRPC[0].etaRegion(),
224  cleanedRPC[0].phiRegion(),
225  cleanedRPC[0].depthRegion(),
226  cleanedRPC[0].tfLayer(),
227  0,
228  phi / nRPC,
229  0,
230  cleanedRPC[0].bxNum(),
231  2,
232  0,
233  eta / nRPC,
234  2,
235  0);
236  stub.setOfflineQuantities(phiF / nRPC, phiF / nRPC, etaF / nRPC, etaF / nRPC);
237  out.push_back(stub);
238  cleanedRPC = freeRPC;
239  };
240  return out;
241 }
double offline_eta1() const
Definition: MuonStub.h:120
void setOfflineQuantities(double coord1, double coord2, double eta1, double eta2)
Definition: MuonStub.h:123
double offline_coord1() const
Definition: MuonStub.h:118
int etaRegion() const
return wheel
Definition: MuonStub.h:67
int depthRegion() const
return station
Definition: MuonStub.h:71
int eta1() const
return eta
Definition: MuonStub.h:108
Definition: L1Track.h:19
std::vector< MuonStub > MuonStubCollection
Definition: MuonStub.h:40
void setEta(int eta1, int eta2, int etaQ)
Definition: MuonStub.h:129

◆ makeStubs()

l1t::MuonStubCollection L1TPhase2GMTEndcapStubProcessor::makeStubs ( const MuonDigiCollection< CSCDetId, CSCCorrelatedLCTDigi > &  csc,
const MuonDigiCollection< RPCDetId, RPCDigi > &  rpc,
const L1TMuon::GeometryTranslator t,
const edm::EventSetup iSetup 
)

Definition at line 243 of file L1TPhase2GMTEndcapStubProcessor.cc.

References MuonDigiCollection< IndexType, DigiType >::begin(), buildCSCOnlyStub(), buildRPCOnlyStub(), l1t::MuonStub::bxNum(), relativeConstraints::chamber, combineStubs(), MuonDigiCollection< IndexType, DigiType >::end(), maxBX_, minBX_, submitPVValidationJobs::t, makeGlobalPositionRcd_cfg::tag, and verbose_.

Referenced by Phase2L1TGMTStubProducer::produce().

247  {
248  l1t::MuonStubCollection cscStubs;
249  auto chamber = csc.begin();
250  auto chend = csc.end();
251  for (; chamber != chend; ++chamber) {
252  auto digi = (*chamber).second.first;
253  auto dend = (*chamber).second.second;
254  unsigned int tag = 0;
255  for (; digi != dend; ++digi) {
256  l1t::MuonStub stub = buildCSCOnlyStub((*chamber).first, *digi, t, tag);
257  tag = tag + 1;
258  if (stub.bxNum() >= minBX_ && stub.bxNum() <= maxBX_)
259  cscStubs.push_back(stub);
260  }
261  }
262 
263  l1t::MuonStubCollection rpcStubs;
264 
265  auto rpcchamber = cleaned.begin();
266  auto rpcchend = cleaned.end();
267  for (; rpcchamber != rpcchend; ++rpcchamber) {
268  if ((*rpcchamber).first.region() == 0)
269  continue;
270  auto digi = (*rpcchamber).second.first;
271  auto dend = (*rpcchamber).second.second;
272  for (; digi != dend; ++digi) {
273  l1t::MuonStub stub = buildRPCOnlyStub((*rpcchamber).first, *digi, t);
274  if (stub.bxNum() >= minBX_ && stub.bxNum() <= maxBX_)
275  rpcStubs.push_back(stub);
276  }
277  }
278 
279  l1t::MuonStubCollection combinedStubs = combineStubs(cscStubs, rpcStubs);
280 
281  if (verbose_) {
282  edm::LogInfo("EndcapStub") << "CSC Stubs";
283  for (const auto& stub : cscStubs)
284  edm::LogInfo("EndcapStub") << "CSC Stub bx=" << stub.bxNum() << " TF=" << stub.tfLayer()
285  << " etaRegion=" << stub.etaRegion() << " phiRegion=" << stub.phiRegion()
286  << " depthRegion=" << stub.depthRegion() << " coord1=" << stub.offline_coord1() << ","
287  << stub.coord1() << " coord2=" << stub.offline_coord2() << "," << stub.coord2()
288  << " eta1=" << stub.offline_eta1() << "," << stub.eta1()
289  << " eta2=" << stub.offline_eta2() << "," << stub.eta2()
290  << " quality=" << stub.quality() << " etaQuality=" << stub.etaQuality();
291 
292  edm::LogInfo("EndcapStub") << "RPC Stubs";
293  for (const auto& stub : rpcStubs)
294  edm::LogInfo("EndcapStub") << "RPC Stub bx=" << stub.bxNum() << " TF=" << stub.tfLayer()
295  << " etaRegion=" << stub.etaRegion() << " phiRegion=" << stub.phiRegion()
296  << " depthRegion=" << stub.depthRegion() << " coord1=" << stub.offline_coord1() << ","
297  << stub.coord1() << " coord2=" << stub.offline_coord2() << "," << stub.coord2()
298  << " eta1=" << stub.offline_eta1() << "," << stub.eta1()
299  << " eta2=" << stub.offline_eta2() << "," << stub.eta2()
300  << " quality=" << stub.quality() << " etaQuality=" << stub.etaQuality();
301 
302  for (const auto& stub : combinedStubs)
303  edm::LogInfo("EndcapStub") << "Combined Stub bx=" << stub.bxNum() << " TF=" << stub.tfLayer()
304  << " etaRegion=" << stub.etaRegion() << " phiRegion=" << stub.phiRegion()
305  << " depthRegion=" << stub.depthRegion() << " coord1=" << stub.offline_coord1() << ","
306  << stub.coord1() << " coord2=" << stub.offline_coord2() << "," << stub.coord2()
307  << " eta1=" << stub.offline_eta1() << "," << stub.eta1()
308  << " eta2=" << stub.offline_eta2() << "," << stub.eta2()
309  << " quality=" << stub.quality() << " etaQuality=" << stub.etaQuality();
310  }
311 
312  return combinedStubs;
313 }
double offline_eta1() const
Definition: MuonStub.h:120
l1t::MuonStub buildCSCOnlyStub(const CSCDetId &, const CSCCorrelatedLCTDigi &, const L1TMuon::GeometryTranslator *, unsigned int)
double offline_eta2() const
Definition: MuonStub.h:121
double offline_coord1() const
Definition: MuonStub.h:118
int coord1() const
return phi
Definition: MuonStub.h:75
int etaRegion() const
return wheel
Definition: MuonStub.h:67
int depthRegion() const
return station
Definition: MuonStub.h:71
int quality() const
return quality code
Definition: MuonStub.h:79
int coord2() const
return phib
Definition: MuonStub.h:77
l1t::MuonStubCollection combineStubs(const l1t::MuonStubCollection &, const l1t::MuonStubCollection &)
int eta1() const
return eta
Definition: MuonStub.h:108
int etaQuality() const
return first eta quality
Definition: MuonStub.h:111
Definition: L1Track.h:19
std::vector< MuonStub > MuonStubCollection
Definition: MuonStub.h:40
Log< level::Info, false > LogInfo
int eta2() const
Definition: MuonStub.h:109
int phiRegion() const
return sector
Definition: MuonStub.h:69
double offline_coord2() const
Definition: MuonStub.h:119
uint tfLayer() const
return track finder layer
Definition: MuonStub.h:73
int bxNum() const
return bunch crossing
Definition: MuonStub.h:105
l1t::MuonStub buildRPCOnlyStub(const RPCDetId &, const RPCDigi &, const L1TMuon::GeometryTranslator *)

Member Data Documentation

◆ coord1LSB_

double L1TPhase2GMTEndcapStubProcessor::coord1LSB_
private

Definition at line 37 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by buildCSCOnlyStub().

◆ coord2LSB_

double L1TPhase2GMTEndcapStubProcessor::coord2LSB_
private

Definition at line 38 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by buildRPCOnlyStub().

◆ eta1LSB_

double L1TPhase2GMTEndcapStubProcessor::eta1LSB_
private

Definition at line 39 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by buildCSCOnlyStub().

◆ eta2LSB_

double L1TPhase2GMTEndcapStubProcessor::eta2LSB_
private

Definition at line 40 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by buildRPCOnlyStub().

◆ etaMatch_

double L1TPhase2GMTEndcapStubProcessor::etaMatch_
private

Definition at line 41 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by combineStubs().

◆ maxBX_

int L1TPhase2GMTEndcapStubProcessor::maxBX_
private

Definition at line 36 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by makeStubs().

◆ minBX_

int L1TPhase2GMTEndcapStubProcessor::minBX_
private

Definition at line 35 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by makeStubs().

◆ phiMatch_

double L1TPhase2GMTEndcapStubProcessor::phiMatch_
private

Definition at line 42 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by combineStubs().

◆ verbose_

bool L1TPhase2GMTEndcapStubProcessor::verbose_
private

Definition at line 43 of file L1TPhase2GMTEndcapStubProcessor.h.

Referenced by makeStubs().