Skip to content

Commit 214e8b4

Browse files
author
Ivan
committed
code format
1 parent be7612c commit 214e8b4

File tree

2 files changed

+43
-45
lines changed

2 files changed

+43
-45
lines changed

RecoLocalTracker/SiStripClusterizer/plugins/SiStripApprox2ApproxClusters.cc

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@ class SiStripApprox2ApproxClusters : public edm::stream::EDProducer<> {
3232
SiStripApprox2ApproxClusters::SiStripApprox2ApproxClusters(const edm::ParameterSet& conf) {
3333
inputApproxClusters = conf.getParameter<edm::InputTag>("inputApproxClusters");
3434
approxVersionS = conf.getParameter<std::string>("approxVersion");
35-
36-
approxVersion=-1;
37-
38-
if(approxVersionS=="ORIGINAL") approxVersion=0;
39-
else if(approxVersionS=="FULL_WIDTH") approxVersion=1;
40-
else if(approxVersionS=="BARY_RES_0.1") approxVersion=2;
41-
else if(approxVersionS=="BARY_CHARGE_RES_0.1") approxVersion=3;
42-
35+
36+
approxVersion = -1;
37+
38+
if (approxVersionS == "ORIGINAL")
39+
approxVersion = 0;
40+
else if (approxVersionS == "FULL_WIDTH")
41+
approxVersion = 1;
42+
else if (approxVersionS == "BARY_RES_0.1")
43+
approxVersion = 2;
44+
else if (approxVersionS == "BARY_CHARGE_RES_0.1")
45+
approxVersion = 3;
46+
4347
clusterToken = consumes<edmNew::DetSetVector<SiStripApproximateCluster>>(inputApproxClusters);
4448
produces<edmNew::DetSetVector<SiStripApproximateCluster>>();
4549
}
@@ -55,29 +59,32 @@ void SiStripApprox2ApproxClusters::produce(edm::Event& event, edm::EventSetup co
5559
float barycenter = cluster.barycenter();
5660
uint8_t width = cluster.width();
5761
float avgCharge = cluster.avgCharge();
58-
59-
switch(approxVersion){
60-
case 0: //ORIGINAL
61-
barycenter = std::round(barycenter);
62-
if (width > 0x3F) width = 0x3F;
62+
63+
switch (approxVersion) {
64+
case 0: //ORIGINAL
65+
barycenter = std::round(barycenter);
66+
if (width > 0x3F)
67+
width = 0x3F;
6368
avgCharge = std::round(avgCharge);
64-
break;
65-
case 1: //FULL_WIDTH
69+
break;
70+
case 1: //FULL_WIDTH
6671
barycenter = std::round(barycenter);
6772
avgCharge = std::round(avgCharge);
68-
break;
69-
case 2: //BARY_RES_0.1
73+
break;
74+
case 2: //BARY_RES_0.1
7075
barycenter = std::round(barycenter * 10) / 10;
71-
if (width > 0x3F) width = 0x3F;
76+
if (width > 0x3F)
77+
width = 0x3F;
7278
avgCharge = std::round(avgCharge);
73-
break;
74-
case 3: //BARY_CHARGE_RES_0.1
79+
break;
80+
case 3: //BARY_CHARGE_RES_0.1
7581
barycenter = std::round(barycenter * 10) / 10;
76-
if (width > 0x3F) width = 0x3F;
82+
if (width > 0x3F)
83+
width = 0x3F;
7784
avgCharge = std::round(avgCharge * 10) / 10;
78-
break;
85+
break;
7986
}
80-
87+
8188
ff.push_back(SiStripApproximateCluster(barycenter, width, avgCharge));
8289
}
8390
}

RecoLocalTracker/SiStripClusterizer/plugins/SiStripClusters2ApproxClusters.cc

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,37 @@
1212
#include "DataFormats/Common/interface/DetSetVectorNew.h"
1313
#include "DataFormats/Common/interface/DetSetVector.h"
1414

15-
1615
#include <vector>
1716
#include <memory>
1817

19-
class SiStripClusters2ApproxClusters: public edm::stream::EDProducer<> {
20-
18+
class SiStripClusters2ApproxClusters : public edm::stream::EDProducer<> {
2119
public:
22-
2320
explicit SiStripClusters2ApproxClusters(const edm::ParameterSet& conf);
2421
void produce(edm::Event&, const edm::EventSetup&) override;
25-
22+
2623
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
2724

2825
private:
29-
3026
edm::InputTag inputClusters;
31-
edm::EDGetTokenT< edmNew::DetSetVector<SiStripCluster> > clusterToken;
27+
edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > clusterToken;
3228
};
3329

30+
SiStripClusters2ApproxClusters::SiStripClusters2ApproxClusters(const edm::ParameterSet& conf) {
31+
inputClusters = conf.getParameter<edm::InputTag>("inputClusters");
3432

35-
36-
SiStripClusters2ApproxClusters::SiStripClusters2ApproxClusters(const edm::ParameterSet& conf){
37-
inputClusters = conf.getParameter< edm::InputTag >("inputClusters");
38-
39-
clusterToken = consumes< edmNew::DetSetVector< SiStripCluster > >(inputClusters);
40-
produces< edmNew::DetSetVector< SiStripApproximateCluster > >();
41-
33+
clusterToken = consumes<edmNew::DetSetVector<SiStripCluster> >(inputClusters);
34+
produces<edmNew::DetSetVector<SiStripApproximateCluster> >();
4235
}
4336

44-
void SiStripClusters2ApproxClusters::produce(edm::Event& event, edm::EventSetup const&){
45-
auto result = std::make_unique<edmNew::DetSetVector< SiStripApproximateCluster > >();
37+
void SiStripClusters2ApproxClusters::produce(edm::Event& event, edm::EventSetup const&) {
38+
auto result = std::make_unique<edmNew::DetSetVector<SiStripApproximateCluster> >();
4639
const auto& clusterCollection = event.get(clusterToken);
4740

48-
49-
for ( const auto& detClusters : clusterCollection ) {
41+
for (const auto& detClusters : clusterCollection) {
5042
edmNew::DetSetVector<SiStripApproximateCluster>::FastFiller ff{*result, detClusters.id()};
5143

52-
for ( const auto& cluster : detClusters ) ff.push_back(SiStripApproximateCluster(cluster));
53-
44+
for (const auto& cluster : detClusters)
45+
ff.push_back(SiStripApproximateCluster(cluster));
5446
}
5547

5648
event.put(std::move(result));
@@ -59,8 +51,7 @@ void SiStripClusters2ApproxClusters::produce(edm::Event& event, edm::EventSetup
5951
void SiStripClusters2ApproxClusters::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
6052
edm::ParameterSetDescription desc;
6153
desc.add<edm::InputTag>("inputClusters", edm::InputTag("siStripClusters"));
62-
descriptions.add("SiStripClusters2ApproxClusters", desc);
54+
descriptions.add("SiStripClusters2ApproxClusters", desc);
6355
}
6456

65-
6657
DEFINE_FWK_MODULE(SiStripClusters2ApproxClusters);

0 commit comments

Comments
 (0)