Skip to content

Commit 5f912ec

Browse files
committed
Fix comments on PR
1 parent 81e0f46 commit 5f912ec

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

L1Trigger/L1TGEM/interface/GE0TriggerPseudoBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class GE0TriggerPseudoBuilder {
2828
~GE0TriggerPseudoBuilder();
2929

3030
/** Build Triggers from ME0 segment in each chamber and fill them into output collections. */
31-
void build(const GEMSegmentCollection* me0segments, GE0TriggerDigiCollection& oc_trig);
31+
void build(const GEMSegmentCollection& me0segments, GE0TriggerDigiCollection& oc_trig);
3232

3333
/** set geometry for the matching needs */
3434
void setME0Geometry(const GEMGeometry* g) { me0_g = g; }

L1Trigger/L1TGEM/plugins/GE0TriggerPseudoProducer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void GE0TriggerPseudoProducer::produce(edm::StreamID, edm::Event& ev, const edm:
6464

6565
// Fill output collections if valid input collection is available.
6666
if (me0Segmentcoll.isValid()) {
67-
trigBuilder->build(me0segments, *oc_trig);
67+
trigBuilder->build(*me0segments, *oc_trig);
6868
}
6969

7070
// Put collections in event.

L1Trigger/L1TGEM/src/GE0TriggerPseudoBuilder.cc

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ GE0TriggerPseudoBuilder::GE0TriggerPseudoBuilder(const edm::ParameterSet& conf)
1717

1818
GE0TriggerPseudoBuilder::~GE0TriggerPseudoBuilder() {}
1919

20-
void GE0TriggerPseudoBuilder::build(const GEMSegmentCollection* me0Segments, GE0TriggerDigiCollection& oc_trig) {
20+
void GE0TriggerPseudoBuilder::build(const GEMSegmentCollection& me0Segments, GE0TriggerDigiCollection& oc_trig) {
2121
if (info_ > 2)
22-
dumpAllME0Segments(*me0Segments);
22+
dumpAllME0Segments(me0Segments);
2323

2424
for (int endc = 0; endc < static_cast<int>(trig_me0s::MAX_ENDCAPS); endc++) {
2525
for (int cham = 0; cham < static_cast<int>(trig_me0s::MAX_CHAMBERS); cham++) {
@@ -29,7 +29,7 @@ void GE0TriggerPseudoBuilder::build(const GEMSegmentCollection* me0Segments, GE0
2929
// constexpr GEMDetId(int region, int ring, int station, int layer, int chamber, int ieta)
3030
GEMDetId detid(region, 1, 0, 0, cham + 1, 0);
3131

32-
const auto& drange = me0Segments->get(detid);
32+
const auto& drange = me0Segments.get(detid);
3333
std::vector<ME0TriggerDigi> trigV;
3434
for (auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
3535
if (info_ > 1)
@@ -74,9 +74,10 @@ ME0TriggerDigi GE0TriggerPseudoBuilder::segmentConversion(const GEMSegment segme
7474
//assert(rolls.size() <= 2); // we did found very few ME0 segments crossing 3 rolls!!! this cut is applied offline
7575
if (rolls.empty())
7676
return ME0TriggerDigi();
77-
if (rolls[0] < 1)
77+
if (rolls[0] < 1) {
7878
LogTrace("L1ME0Trigger") << " ME0 segment has wrong roll number " << rolls[0] << " which should be >= 1 \n !!!";
79-
assert(rolls[0] >= 1);
79+
throw edm::Exception(edm::errors::LogicError, "ME0 should have at least one roll");
80+
}
8081
int partition = (rolls[0] - 1) << 1; //roll from detid counts from 1
8182
if (rolls.size() == 2 and rolls[0] > rolls[1])
8283
partition = partition - 1;
@@ -146,19 +147,21 @@ ME0TriggerDigi GE0TriggerPseudoBuilder::segmentConversion(const GEMSegment segme
146147
}
147148

148149
void GE0TriggerPseudoBuilder::dumpAllME0Segments(const GEMSegmentCollection& segments) const {
149-
LogTrace("L1ME0Trigger") << "dumpt all ME0 Segments" << std::endl;
150-
// for (auto iC = segments.id_begin(); iC != segments.id_end(); ++iC) {
151-
// auto ch_segs = segments.get(*iC);
152-
// for (auto iS = ch_segs.first; iS != ch_segs.second; ++iS) {
153-
// GlobalPoint gp = me0_g->idToDet(iS->me0DetId())->surface().toGlobal(iS->localPosition());
154-
// LogTrace("L1ME0Trigger") << "ME0Detid " << iS->me0DetId() << " segment " << *iS << " eta " << gp.eta() << " phi "
155-
// << gp.phi() << std::endl;
156-
// auto recHits(iS->recHits());
157-
// LogTrace("L1ME0Trigger") << "\t has " << recHits.size() << " me0 rechits" << std::endl;
158-
// for (auto& rh : recHits) {
159-
// const ME0RecHit* me0rh(dynamic_cast<const ME0RecHit*>(rh));
160-
// LogTrace("L1ME0Trigger") << "\t detid " << me0rh->me0Id() << " rechit " << *me0rh << std::endl;
161-
// }
162-
// }
163-
// }
150+
LogTrace("L1GE0Trigger") << "dumpt all ME0 Segments" << std::endl;
151+
for (auto iC = segments.id_begin(); iC != segments.id_end(); ++iC) {
152+
auto ch_segs = segments.get(*iC);
153+
for (auto iS = ch_segs.first; iS != ch_segs.second; ++iS) {
154+
if (iS->gemDetId().station() != 0) // only dump GE0 segments
155+
continue;
156+
GlobalPoint gp = me0_g->idToDet(iS->gemDetId())->surface().toGlobal(iS->localPosition());
157+
LogTrace("L1ME0Trigger") << "ME0Detid " << iS->gemDetId() << " segment " << *iS << " eta " << gp.eta() << " phi "
158+
<< gp.phi() << std::endl;
159+
auto recHits(iS->recHits());
160+
LogTrace("L1GE0Trigger") << "\t has " << recHits.size() << " me0 rechits" << std::endl;
161+
for (auto& rh : recHits) {
162+
const GEMRecHit* me0rh(dynamic_cast<const GEMRecHit*>(rh));
163+
LogTrace("L1GEMTrigger") << "\t detid " << me0rh->gemId() << " rechit " << *me0rh << std::endl;
164+
}
165+
}
166+
}
164167
}

0 commit comments

Comments
 (0)