Skip to content

Commit 9e31280

Browse files
committed
Add ME0 Trigger Object (Stub) and Producer
1 parent 12d2679 commit 9e31280

File tree

8 files changed

+13
-44
lines changed

8 files changed

+13
-44
lines changed

L1Trigger/L1TGEM/interface/ME0StubAlgoChamber.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
namespace l1t {
1212
namespace me0 {
13-
// map<int, vector<vector<uint64_t>>> cross_partition_cancellation(vector<vector<uint64_t>> segments);
1413
std::vector<std::vector<ME0StubPrimitive>> cross_partition_cancellation(
1514
std::vector<std::vector<ME0StubPrimitive>>& segments, int cross_part_seg_width);
1615
std::vector<ME0StubPrimitive> process_chamber(const std::vector<std::vector<UInt192>>& chamber_data,

L1Trigger/L1TGEM/interface/ME0StubPrimitive.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef DataFormats_ME0StubPrimitive_H
2-
#define DataFormats_ME0StubPrimitive_H
1+
#ifndef L1Trigger_L1TGEM_ME0StubPrimitive_H
2+
#define L1Trigger_L1TGEM_ME0StubPrimitive_H
33

44
#include <vector>
55
#include <cstdint>

L1Trigger/L1TGEM/plugins/ME0StubBuilder.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,15 @@
2121
#include "FWCore/ParameterSet/interface/ParameterSet.h"
2222
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
2323

24-
// using namespace l1t::me0;
25-
2624
class ME0StubAlgorithmBase;
2725

2826
class ME0StubBuilder {
2927
public:
30-
/** Configure the algorithm via ctor.
31-
* Receives ParameterSet percolated down from EDProducer
32-
* which owns this Builder.
33-
*/
3428
explicit ME0StubBuilder(const edm::ParameterSet&);
35-
/// Destructor
3629
~ME0StubBuilder();
3730

38-
/** Find stubs in each ensemble of 6 GEM layers, build ME0Stub's ,
39-
* and fill into output collection.
40-
*/
4131
void build(const GEMPadDigiCollection* paddigis, ME0StubCollection& oc);
4232

43-
/** Cache pointer to geometry _for current event_
44-
*/
45-
4633
static void fillDescription(edm::ParameterSetDescription& descriptions);
4734

4835
private:

L1Trigger/L1TGEM/plugins/ME0StubProducer.cc

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,29 @@
2020
#include "DataFormats/GEMDigi/interface/ME0StubCollection.h"
2121
#include "DataFormats/GEMDigi/interface/ME0Stub.h"
2222

23-
// #include "RecoLocalMuon/GEMSegment/plugins/GEMSegmentBuilder.h"
2423
#include "L1Trigger/L1TGEM/plugins/ME0StubBuilder.h"
2524
#include "Geometry/Records/interface/MuonGeometryRecord.h"
2625

27-
// using namespace l1t::me0;
28-
2926
class ME0StubProducer : public edm::stream::EDProducer<> {
3027
public:
31-
/// Constructor
3228
explicit ME0StubProducer(const edm::ParameterSet&);
33-
/// Destructor
3429
~ME0StubProducer() override {}
35-
/// Produce the ME0Stub collection
30+
3631
void produce(edm::Event&, const edm::EventSetup&) override;
3732

3833
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
3934

4035
private:
41-
int iev; // events through
36+
int iev;
4237
edm::EDGetTokenT<GEMPadDigiCollection> theGEMPadDigiToken;
4338
std::unique_ptr<ME0StubBuilder> segmentBuilder_;
4439
edm::ESGetToken<GEMGeometry, MuonGeometryRecord> gemGeomToken_;
4540
};
4641

4742
ME0StubProducer::ME0StubProducer(const edm::ParameterSet& ps) : iev(0) {
4843
theGEMPadDigiToken = consumes<GEMPadDigiCollection>(ps.getParameter<edm::InputTag>("InputCollection"));
49-
segmentBuilder_ = std::make_unique<ME0StubBuilder>(ps); // pass on the Parameter Set
44+
segmentBuilder_ = std::make_unique<ME0StubBuilder>(ps);
5045
gemGeomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
51-
// register what this produces
5246
produces<ME0StubCollection>();
5347
}
5448

@@ -62,17 +56,13 @@ void ME0StubProducer::fillDescriptions(edm::ConfigurationDescriptions& descripti
6256
void ME0StubProducer::produce(edm::Event& ev, const edm::EventSetup& setup) {
6357
LogDebug("ME0StubProducer") << "start producing segments for " << ++iev << "th event with GEM data";
6458

65-
// get the collection of GEMDigi
6659
edm::Handle<GEMPadDigiCollection> gemPadDigis;
6760
ev.getByToken(theGEMPadDigiToken, gemPadDigis);
6861

69-
// create empty collection of Segments
7062
auto oc = std::make_unique<ME0StubCollection>();
7163

72-
// fill the collection
73-
segmentBuilder_->build(gemPadDigis.product(), *oc); //@@ FILL oc
64+
segmentBuilder_->build(gemPadDigis.product(), *oc);
7465

75-
// put collection in event
7666
ev.put(std::move(oc));
7767
}
7868

L1Trigger/L1TGEM/src/ME0StubAlgoChamber.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ std::vector<ME0StubPrimitive> l1t::me0::process_chamber(
120120

121121
// pick the best N outputs from each partition
122122
for (int i = 0; i < static_cast<int>(segments.size()); ++i) {
123-
// segments[i] = segment_sorter(segments[i], config.num_outputs);
124123
segment_sorter(segments[i], config.num_outputs);
125124
}
126125

@@ -133,13 +132,11 @@ std::vector<ME0StubPrimitive> l1t::me0::process_chamber(
133132
}
134133
joined_segments.push_back(segments[14]);
135134
for (int i = 0; i < static_cast<int>(joined_segments.size()); ++i) {
136-
// joined_segments[i] = segment_sorter(joined_segments[i], config.num_outputs);
137135
segment_sorter(joined_segments[i], config.num_outputs);
138136
}
139137

140138
// concatenate together all of the segments, sort them, and pick the best N outputs
141139
std::vector<ME0StubPrimitive> concatenated = concatVector(joined_segments);
142-
// concatenated = segment_sorter(concatenated, config.num_outputs);
143140
segment_sorter(concatenated, config.num_outputs);
144141

145142
return concatenated;

L1Trigger/L1TGEM/src/ME0StubAlgoPartition.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ std::vector<ME0StubPrimitive> l1t::me0::cancel_edges(
5656
*/
5757

5858
std::vector<ME0StubPrimitive> canceled_segements = segments;
59-
// std::vector<ME0StubPrimitive> canceled_segements;
60-
// std::copy(segments.begin(), segments.end(), std::back_inserter(canceled_segements));
6159
std::vector<int> comps;
6260

6361
bool ghost;

L1Trigger/L1TGEM/src/ME0StubAlgoPatUnitMux.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ uint64_t l1t::me0::parse_data(const UInt192& data, int strip, int max_span) {
88
if (strip < max_span / 2 + 1) {
99
data_shifted = data << (max_span / 2 - strip);
1010
parsed_data = (data_shifted & UInt192(0xffffffffffffffff >> (64 - max_span))).to_ullong();
11-
// parsed_data = (data_shifted & UInt192(pow(2,max_span)-1)).to_ullong();
1211
} else {
1312
data_shifted = data >> (strip - max_span / 2);
1413
parsed_data = (data_shifted & UInt192(0xffffffffffffffff >> (64 - max_span))).to_ullong();
15-
// parsed_data = (data_shifted & UInt192(pow(2,max_span)-1)).to_ullong();
1614
}
1715
return parsed_data;
1816
}

L1Trigger/L1TGEM/src/ME0StubPrimitive.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ void ME0StubPrimitive::update_quality() {
3535
}
3636
}
3737
void ME0StubPrimitive::fit(int max_span) {
38-
if (id!=0) {
38+
if (id != 0) {
3939
std::vector<double> tmp;
40-
for (double cent : centroid) {
41-
tmp.push_back(cent-(max_span/2+1));
40+
tmp.reserve(centroid.size()); for (double cent : centroid) {
41+
tmp.push_back(cent - (max_span / 2 + 1));
4242
}
4343
std::vector<double> x;
4444
std::vector<double> centroids;
45-
for (uint32_t i=0; i < tmp.size(); ++i) {
46-
if (tmp[i] != -1*(max_span/2+1)) {
47-
x.push_back(i-2.5);
45+
for (uint32_t i = 0; i < tmp.size(); ++i) {
46+
if (tmp[i] != -1 * (max_span / 2 + 1)) {
47+
x.push_back(i - 2.5);
4848
centroids.push_back(tmp[i]);
4949
}
5050
}
5151
std::vector<double> fit = llse_fit(x, centroids);
5252
bend_ang = fit[0];
5353
substrip = fit[1];
54-
mse = fit[2];
54+
mse = fit[2];
5555
}
5656
}
5757
std::vector<double> ME0StubPrimitive::llse_fit(const std::vector<double>& x, const std::vector<double>& y) {

0 commit comments

Comments
 (0)