Skip to content

Commit 1e4126a

Browse files
committed
implementing comments from Andrea
1 parent e02da84 commit 1e4126a

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

DataFormats/L1TCalorimeterPhase2/interface/CaloPFCluster.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <string>
77
#include <algorithm>
88
#include "DataFormats/L1Trigger/interface/L1Candidate.h"
9-
#include "FWCore/MessageLogger/interface/MessageLogger.h"
109

1110
namespace l1tp2 {
1211

L1Trigger/L1CaloTrigger/interface/Phase2L1CaloPFClusterEmulator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace gctpf {
3434

3535
typedef struct {
3636
GCTpfcluster_t GCTpfclusters[nPFClusterSLR];
37-
} GCTPfcluster_t;
37+
} PFcluster_t;
3838

3939
typedef struct {
4040
float et;
@@ -96,7 +96,7 @@ namespace gctpf {
9696

9797
inline GCTint_t getPeakPosition(const region_t& region) {
9898
gctEtaStripPeak_t etaPeak;
99-
for (int i = 0; i < 19; i++) {
99+
for (int i = 0; i < nTowerEtaSLR - 2; i++) {
100100
etaPeak.p[i] = getPeakOfStrip(region.s[i + 1]);
101101
}
102102
GCTint_t max = getPeakBin(etaPeak);
@@ -174,14 +174,14 @@ namespace gctpf {
174174
return pfclusterReturn;
175175
}
176176

177-
inline GCTPfcluster_t pfcluster(float temporary[nTowerEtaSLR][nTowerPhiSLR], int etaoffset, int phioffset) {
177+
inline PFcluster_t pfcluster(float temporary[nTowerEtaSLR][nTowerPhiSLR], int etaoffset, int phioffset) {
178178
GCTpfcluster_t pfcluster[nPFClusterSLR];
179179

180180
for (int i = 0; i < nPFClusterSLR; i++) {
181181
pfcluster[i] = recoPfcluster(temporary, etaoffset, phioffset);
182182
}
183183

184-
GCTPfcluster_t GCTPfclusters;
184+
PFcluster_t GCTPfclusters;
185185

186186
for (int i = 0; i < nPFClusterSLR; i++) {
187187
GCTPfclusters.GCTpfclusters[i].et = pfcluster[i].et;

L1Trigger/L1CaloTrigger/plugins/Phase2L1CaloPFClusterEmulator.cc

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,17 @@
4848
class Phase2L1CaloPFClusterEmulator : public edm::stream::EDProducer<> {
4949
public:
5050
explicit Phase2L1CaloPFClusterEmulator(const edm::ParameterSet&);
51-
~Phase2L1CaloPFClusterEmulator() override;
51+
~Phase2L1CaloPFClusterEmulator() override = default;
5252

5353
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
5454

5555
private:
5656
void produce(edm::Event&, const edm::EventSetup&) override;
5757

5858
// ----------member data ---------------------------
59-
edm::EDGetTokenT<l1tp2::CaloTowerCollection> caloTowerToken_;
59+
const edm::EDGetTokenT<l1tp2::CaloTowerCollection> caloTowerToken_;
6060
};
6161

62-
//
63-
// constants, enums and typedefs
64-
//
65-
66-
//
67-
// static data member definitions
68-
//
69-
7062
//
7163
// constructors and destructor
7264
//
@@ -75,8 +67,6 @@ Phase2L1CaloPFClusterEmulator::Phase2L1CaloPFClusterEmulator(const edm::Paramete
7567
produces<l1tp2::CaloPFClusterCollection>("GCTPFCluster");
7668
}
7769

78-
Phase2L1CaloPFClusterEmulator::~Phase2L1CaloPFClusterEmulator() {}
79-
8070
//
8171
// member functions
8272
//
@@ -87,10 +77,10 @@ void Phase2L1CaloPFClusterEmulator::produce(edm::Event& iEvent, const edm::Event
8777
std::unique_ptr<l1tp2::CaloPFClusterCollection> pfclusterCands(make_unique<l1tp2::CaloPFClusterCollection>());
8878

8979
edm::Handle<std::vector<l1tp2::CaloTower>> caloTowerCollection;
90-
if (!iEvent.getByToken(caloTowerToken_, caloTowerCollection))
80+
iEvent.getByToken(caloTowerToken_, caloTowerCollection);
81+
if (!caloTowerCollection.isValid())
9182
cms::Exception("Phase2L1CaloPFClusterEmulator") << "Failed to get towers from caloTowerCollection!";
9283

93-
iEvent.getByToken(caloTowerToken_, caloTowerCollection);
9484
float GCTintTowers[nTowerEta][nTowerPhi];
9585
float realEta[nTowerEta][nTowerPhi];
9686
float realPhi[nTowerEta][nTowerPhi];
@@ -155,7 +145,7 @@ void Phase2L1CaloPFClusterEmulator::produce(edm::Event& iEvent, const edm::Event
155145
if (k > 1 && k % 2 == 0)
156146
phioffset = phioffset + 4;
157147

158-
gctpf::GCTPfcluster_t tempPfclusters;
148+
gctpf::PFcluster_t tempPfclusters;
159149
tempPfclusters = gctpf::pfcluster(temporary, etaoffset, phioffset);
160150

161151
for (int i = 0; i < nPFClusterSLR; i++) {

0 commit comments

Comments
 (0)