Skip to content

Commit

Permalink
Changed array to std::array to improve code readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaymudholkar committed Mar 30, 2017
1 parent f957a08 commit e131c90
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DQM/EcalMonitorTasks/interface/TimingTask.h
Expand Up @@ -28,7 +28,7 @@ namespace ecaldqm {
void beginEvent(edm::Event const&, edm::EventSetup const&) override;
void setParams(edm::ParameterSet const&) override;

int bxBinEdges_[nBXBins + 1];
std::array<int,nBXBins+1> bxBinEdges_;
double bxBin_;

float chi2ThresholdEB_;
Expand Down
2 changes: 1 addition & 1 deletion DQM/EcalMonitorTasks/interface/TrigPrimTask.h
Expand Up @@ -45,7 +45,7 @@ namespace ecaldqm {
/* bool HLTCaloBit_; */
/* bool HLTMuonBit_; */

int bxBinEdges_[nBXBins + 1];
std::array<int,nBXBins+1> bxBinEdges_;
double bxBin_;

std::map<uint32_t, unsigned> towerReadouts_;
Expand Down
6 changes: 3 additions & 3 deletions DQM/EcalMonitorTasks/src/TimingTask.cc
Expand Up @@ -13,7 +13,7 @@ namespace ecaldqm
{
TimingTask::TimingTask() :
DQWorkerTask(),
bxBinEdges_{1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565},
bxBinEdges_{ {1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565} },
bxBin_(0.),
chi2ThresholdEB_(0.),
chi2ThresholdEE_(0.),
Expand Down Expand Up @@ -62,8 +62,8 @@ namespace ecaldqm
TimingTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es)
{
using namespace std;
int* pBin(std::upper_bound(bxBinEdges_, bxBinEdges_ + nBXBins + 1, _evt.bunchCrossing()));
bxBin_ = static_cast<int>(pBin - bxBinEdges_) - 0.5;
int* pBin(std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing()));
bxBin_ = static_cast<int>(pBin - bxBinEdges_.begin()) - 0.5;
}

void
Expand Down
6 changes: 3 additions & 3 deletions DQM/EcalMonitorTasks/src/TrigPrimTask.cc
Expand Up @@ -22,7 +22,7 @@ namespace ecaldqm
// HLTMuonPath_(""),
// HLTCaloBit_(false),
// HLTMuonBit_(false),
bxBinEdges_{1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565},
bxBinEdges_{ {1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565} },
bxBin_(0.),
towerReadouts_()
{
Expand Down Expand Up @@ -76,8 +76,8 @@ namespace ecaldqm
// HLTCaloBit_ = false;
// HLTMuonBit_ = false;

int* pBin(std::upper_bound(bxBinEdges_, bxBinEdges_ + nBXBins + 1, _evt.bunchCrossing()));
bxBin_ = static_cast<int>(pBin - bxBinEdges_) - 0.5;
int* pBin(std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing()));
bxBin_ = static_cast<int>(pBin - bxBinEdges_.begin()) - 0.5;

edm::ESHandle<EcalTPGTowerStatus> TTStatusRcd_;
_es.get<EcalTPGTowerStatusRcd>().get(TTStatusRcd_);
Expand Down

0 comments on commit e131c90

Please sign in to comment.