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")) {}
66 l1t::MuonStub stub(
wheel,
sector,
station, tfLayer,
phi, 0,
tag,
bx,
quality,
eta1, 0, 1, 0);
103 l1t::MuonStub stub(
wheel,
sector,
station, tfLayer, 0, phi2,
tag,
bx,
quality, 0,
eta2, 2, 0);
119 while (!allCSC.empty()) {
122 for (
uint i = 1;
i < allCSC.size(); ++
i) {
125 if (fabs(stub.
offline_eta1() - allCSC[
i].offline_eta1()) > 0.001) {
130 freeCSC.push_back(allCSC[
i]);
133 cleanedCSC.push_back(stub);
137 for (
const auto&
csc : cleanedCSC) {
143 for (
const auto&
rpc : rpcStubs) {
144 if (
csc.depthRegion() !=
rpc.depthRegion())
148 phiF +=
rpc.offline_coord2();
149 etaF +=
rpc.offline_eta2();
153 usedRPC.push_back(
rpc);
159 double offline_finalRPCPhi = 0;
160 double offline_finalRPCEta = 0;
162 finalRPCPhi =
phi / nRPC;
163 finalRPCEta =
eta / nRPC;
164 offline_finalRPCPhi = phiF / nRPC;
165 offline_finalRPCEta = etaF / nRPC;
188 for (
const auto&
rpc : rpcStubs) {
190 for (
const auto& rpc2 : usedRPC) {
197 cleanedRPC.push_back(
rpc);
200 while (!cleanedRPC.empty()) {
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();
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();
220 freeRPC.push_back(cleanedRPC[
i]);
224 cleanedRPC[0].phiRegion(),
225 cleanedRPC[0].depthRegion(),
226 cleanedRPC[0].tfLayer(),
230 cleanedRPC[0].bxNum(),
238 cleanedRPC = freeRPC;
250 auto chend =
csc.end();
252 auto digi = (*chamber).second.first;
253 auto dend = (*chamber).second.second;
254 unsigned int tag = 0;
255 for (; digi != dend; ++digi) {
259 cscStubs.push_back(stub);
265 auto rpcchamber = cleaned.
begin();
266 auto rpcchend = cleaned.
end();
267 for (; rpcchamber != rpcchend; ++rpcchamber) {
268 if ((*rpcchamber).first.region() == 0)
270 auto digi = (*rpcchamber).second.first;
271 auto dend = (*rpcchamber).second.second;
272 for (; digi != dend; ++digi) {
275 rpcStubs.push_back(stub);
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();
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();
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();
312 return combinedStubs;
double offline_eta1() const
l1t::MuonStub buildCSCOnlyStub(const CSCDetId &, const CSCCorrelatedLCTDigi &, const L1TMuon::GeometryTranslator *, unsigned int)
L1TPhase2GMTEndcapStubProcessor()
void setOfflineQuantities(double coord1, double coord2, double eta1, double eta2)
double offline_coord1() const
GlobalPoint getGlobalPoint(const TriggerPrimitive &) const
int etaRegion() const
return wheel
int depthRegion() const
return station
Primitive< F, X >::type primitive(const F &f)
l1t::MuonStubCollection makeStubs(const MuonDigiCollection< CSCDetId, CSCCorrelatedLCTDigi > &csc, const MuonDigiCollection< RPCDetId, RPCDigi > &rpc, const L1TMuon::GeometryTranslator *t, const edm::EventSetup &iSetup)
~L1TPhase2GMTEndcapStubProcessor()
l1t::MuonStubCollection combineStubs(const l1t::MuonStubCollection &, const l1t::MuonStubCollection &)
int eta1() const
return eta
DigiRangeIterator begin() const
std::vector< MuonStub > MuonStubCollection
Log< level::Info, false > LogInfo
void setEta(int eta1, int eta2, int etaQ)
int bxNum() const
return bunch crossing
DigiRangeIterator end() const
l1t::MuonStub buildRPCOnlyStub(const RPCDetId &, const RPCDigi &, const L1TMuon::GeometryTranslator *)
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...