Skip to content

Commit

Permalink
Code style and quality issues formated
Browse files Browse the repository at this point in the history
  • Loading branch information
mileva committed May 2, 2020
1 parent 71f9804 commit a56f00c
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 114 deletions.
1 change: 0 additions & 1 deletion L1Trigger/L1TMuonCPPF/interface/EmulateCPPF.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/Common/interface/DetSetVector.h"


class EmulateCPPF {
public:
explicit EmulateCPPF(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iConsumes);
Expand Down
2 changes: 0 additions & 2 deletions L1Trigger/L1TMuonCPPF/src/CPPFClusterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ CPPFClusterContainer CPPFClusterizer::doAction(const RPCDigiCollection::Range& d

return finalCluster;
}


4 changes: 2 additions & 2 deletions L1Trigger/L1TMuonCPPF/src/CPPFMaskReClusterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "CPPFMaskReClusterizer.h"

CPPFClusterContainer CPPFMaskReClusterizer::doAction(const RPCDetId& id,
CPPFClusterContainer& initClusters,
const CPPFRollMask& mask) const {
CPPFClusterContainer& initClusters,
const CPPFRollMask& mask) const {
CPPFClusterContainer finClusters;
if (initClusters.empty())
return finClusters;
Expand Down
71 changes: 36 additions & 35 deletions L1Trigger/L1TMuonCPPF/src/EmulateCPPF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,44 @@
#include "Geometry/RPCGeometry/interface/RPCRoll.h"
#include "DataFormats/Common/interface/DetSetVector.h"

EmulateCPPF::EmulateCPPF(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iConsumes):
recHit_processors_(),
EmulateCPPF::EmulateCPPF(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iConsumes)
: recHit_processors_(),
rpcDigiToken_(iConsumes.consumes<RPCDigiCollection>(iConfig.getParameter<edm::InputTag>("rpcDigiLabel"))),
recHitToken_(iConsumes.consumes<RPCRecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitLabel"))),
rpcDigiSimLinkToken_(iConsumes.consumes<edm::DetSetVector<RPCDigiSimLink> >(iConfig.getParameter<edm::InputTag>("rpcDigiSimLinkLabel"))),
rpcDigiSimLinkToken_(iConsumes.consumes<edm::DetSetVector<RPCDigiSimLink> >(
iConfig.getParameter<edm::InputTag>("rpcDigiSimLinkLabel"))),
cppfSource_(CppfSource::EventSetup),
MaxClusterSize_(0) {
MaxClusterSize_ = iConfig.getParameter<int>("MaxClusterSize");
const std::string cppfSource = iConfig.getParameter<std::string>("cppfSource");
// Look up table
if (cppfSource == "File") {
cppfSource_ = CppfSource::File;
edm::FileInPath fp = iConfig.getParameter<edm::FileInPath>("cppfvecfile");
std::ifstream inputFile(fp.fullPath().c_str(), std::ios::in);
if (!inputFile) {
throw cms::Exception("No LUT") << "Error: CPPF look up table file cannot not be opened";
exit(1);
}
while (inputFile.good()) {
RecHitProcessor::CppfItem Item;
inputFile >> Item.rawId >> Item.strip >> Item.lb >> Item.halfchannel >> Item.int_phi >> Item.int_theta;
if (inputFile.good())
CppfVec_1.push_back(Item);
}
inputFile.close();
}
// RPC Geometry
else if (cppfSource == "Geo") {
cppfSource_ = CppfSource::EventSetup;
}
// Error for wrong input
else {
throw cms::Exception("Invalid option") << "Error: Specify in python/emulatorCppfDigis_cfi 'File' for look up table or 'Geo' for RPC Geometry";
exit(1);
}
}
MaxClusterSize_ = iConfig.getParameter<int>("MaxClusterSize");
const std::string cppfSource = iConfig.getParameter<std::string>("cppfSource");
// Look up table
if (cppfSource == "File") {
cppfSource_ = CppfSource::File;
edm::FileInPath fp = iConfig.getParameter<edm::FileInPath>("cppfvecfile");
std::ifstream inputFile(fp.fullPath().c_str(), std::ios::in);
if (!inputFile) {
throw cms::Exception("No LUT") << "Error: CPPF look up table file cannot not be opened";
exit(1);
}
while (inputFile.good()) {
RecHitProcessor::CppfItem Item;
inputFile >> Item.rawId >> Item.strip >> Item.lb >> Item.halfchannel >> Item.int_phi >> Item.int_theta;
if (inputFile.good())
CppfVec_1.push_back(Item);
}
inputFile.close();
}
// RPC Geometry
else if (cppfSource == "Geo") {
cppfSource_ = CppfSource::EventSetup;
}
// Error for wrong input
else {
throw cms::Exception("Invalid option")
<< "Error: Specify in python/emulatorCppfDigis_cfi 'File' for look up table or 'Geo' for RPC Geometry";
exit(1);
}
}

EmulateCPPF::~EmulateCPPF() {}

Expand All @@ -56,7 +58,8 @@ void EmulateCPPF::process(const edm::Event &iEvent,
if (cppfSource_ == CppfSource::File) { // Using the look up table to fill the information
cppf_recHit.clear();
for (auto &recHit_processor : recHit_processors_) {
recHit_processor.processLook(iEvent, iSetup, recHitToken_, rpcDigiToken_, rpcDigiSimLinkToken_, CppfVec_1, cppf_recHit, MaxClusterSize_);
recHit_processor.processLook(
iEvent, iSetup, recHitToken_, rpcDigiToken_, rpcDigiSimLinkToken_, CppfVec_1, cppf_recHit, MaxClusterSize_);
}
} else if (cppfSource_ == CppfSource::EventSetup) {
// Clear output collections
Expand All @@ -80,5 +83,3 @@ void EmulateCPPF::process(const edm::Event &iEvent,
}
}
} // End void EmulateCPPF::process()


0 comments on commit a56f00c

Please sign in to comment.