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")) {}
65 l1t::MuonStub stub(
wheel, sector,
station, tfLayer,
phi, 0, 0,
bx,
quality,
eta1, 0, 1, 0);
102 l1t::MuonStub stub(
wheel, sector,
station, tfLayer, 0, phi2,
tag,
bx,
quality, 0,
eta2, 2, 0);
118 while (!allCSC.empty()) {
121 for (
uint i = 1;
i < allCSC.size(); ++
i) {
124 if (fabs(stub.
offline_eta1() - allCSC[
i].offline_eta1()) > 0.001) {
129 freeCSC.push_back(allCSC[
i]);
132 cleanedCSC.push_back(stub);
136 for (
const auto&
csc : cleanedCSC) {
142 for (
const auto&
rpc : rpcStubs) {
143 if (
csc.depthRegion() !=
rpc.depthRegion())
147 phiF +=
rpc.offline_coord2();
148 etaF +=
rpc.offline_eta2();
152 usedRPC.push_back(
rpc);
158 double offline_finalRPCPhi = 0;
159 double offline_finalRPCEta = 0;
161 finalRPCPhi =
phi / nRPC;
162 finalRPCEta =
eta / nRPC;
163 offline_finalRPCPhi = phiF / nRPC;
164 offline_finalRPCEta = etaF / nRPC;
187 for (
const auto&
rpc : rpcStubs) {
189 for (
const auto& rpc2 : usedRPC) {
196 cleanedRPC.push_back(
rpc);
199 while (!cleanedRPC.empty()) {
203 float phiF = cleanedRPC[0].offline_coord2();
204 float etaF = cleanedRPC[0].offline_eta2();
205 int phi = cleanedRPC[0].coord2();
206 int eta = cleanedRPC[0].eta2();
208 for (
unsigned i = 1;
i < cleanedRPC.size(); ++
i) {
209 if (fabs(
deltaPhi(cleanedRPC[0].offline_coord2(), cleanedRPC[
i].offline_coord2())) <
phiMatch_ &&
210 cleanedRPC[0].depthRegion() == cleanedRPC[
i].depthRegion() &&
211 fabs(cleanedRPC[0].offline_eta2() - cleanedRPC[
i].offline_eta2()) <
etaMatch_ &&
212 cleanedRPC[0].bxNum() == cleanedRPC[
i].bxNum()) {
213 phiF += cleanedRPC[
i].offline_coord2();
214 etaF += cleanedRPC[
i].offline_eta2();
215 phi += cleanedRPC[
i].coord2();
216 eta += cleanedRPC[
i].eta2();
219 freeRPC.push_back(cleanedRPC[
i]);
223 cleanedRPC[0].phiRegion(),
224 cleanedRPC[0].depthRegion(),
225 cleanedRPC[0].tfLayer(),
229 cleanedRPC[0].bxNum(),
237 cleanedRPC = freeRPC;
249 auto chend =
csc.end();
251 auto digi = (*chamber).second.first;
252 auto dend = (*chamber).second.second;
253 for (; digi != dend; ++digi) {
256 cscStubs.push_back(stub);
262 auto rpcchamber = cleaned.
begin();
263 auto rpcchend = cleaned.
end();
264 for (; rpcchamber != rpcchend; ++rpcchamber) {
265 if ((*rpcchamber).first.region() == 0)
267 auto digi = (*rpcchamber).second.first;
268 auto dend = (*rpcchamber).second.second;
269 for (; digi != dend; ++digi) {
272 rpcStubs.push_back(stub);
279 printf(
"CSC Stubs\n");
280 for (
const auto& stub : cscStubs)
282 "CSC Stub bx=%d TF=%d etaRegion=%d phiRegion=%d depthRegion=%d coord1=%f,%d coord2=%f,%d eta1=%f,%d " 283 "eta2=%f,%d quality=%d etaQuality=%d\n",
289 stub.offline_coord1(),
291 stub.offline_coord2(),
299 printf(
"RPC Stubs\n");
300 for (
const auto& stub : rpcStubs)
302 "RPC Stub bx=%d TF=%d etaRegion=%d phiRegion=%d depthRegion=%d coord1=%f,%d coord2=%f,%d eta1=%f,%d " 303 "eta2=%f,%d quality=%d etaQuality=%d\n",
309 stub.offline_coord1(),
311 stub.offline_coord2(),
319 for (
const auto& stub : combinedStubs)
321 "Combined Stub bx=%d TF=%d etaRegion=%d phiRegion=%d depthRegion=%d coord1=%f,%d coord2=%f,%d eta1=%f,%d " 322 "eta2=%f,%d quality=%d etaQuality=%d\n",
328 stub.offline_coord1(),
330 stub.offline_coord2(),
340 return combinedStubs;
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
l1t::MuonStub buildCSCOnlyStub(const CSCDetId &, const CSCCorrelatedLCTDigi &, const L1TMuon::GeometryTranslator *)
double offline_eta1() const
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
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
DigiRangeIterator begin() const
std::vector< MuonStub > MuonStubCollection
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
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...