Skip to content

Commit

Permalink
remove std::endl; at the end of messageLogger statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Dec 21, 2021
1 parent 7fb1a6b commit 0cfb6bf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
Expand Up @@ -109,10 +109,10 @@ void SiPixelLorentzAnglePCLHarvester::beginRun(const edm::Run& iRun, const edm::

uint count = 0;
for (const auto& id : hists.BPixnewDetIds_) {
LogDebug("SiPixelLorentzAnglePCLHarvester") << id << std::endl;
LogDebug("SiPixelLorentzAnglePCLHarvester") << id;
count++;
}
LogDebug("SiPixelLorentzAnglePCLHarvester") << "Stored a total of " << count << " new detIds." << std::endl;
LogDebug("SiPixelLorentzAnglePCLHarvester") << "Stored a total of " << count << " new detIds.";

// list of modules already filled, return (we already entered here)
if (!hists.detIdsList.empty())
Expand Down Expand Up @@ -144,11 +144,11 @@ void SiPixelLorentzAnglePCLHarvester::beginRun(const edm::Run& iRun, const edm::
count = 0;
for (const auto& i : treatedIndices) {
for (const auto& id : hists.detIdsList.at(i)) {
LogDebug("SiPixelLorentzAnglePCLHarvester") << id << std::endl;
LogDebug("SiPixelLorentzAnglePCLHarvester") << id;
count++;
};
}
LogDebug("SiPixelLorentzAnglePCLHarvester") << "Stored a total of " << count << " detIds." << std::endl;
LogDebug("SiPixelLorentzAnglePCLHarvester") << "Stored a total of " << count << " detIds.";
}

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -255,7 +255,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
<< "p5" << "\t" << "e5" << "\t"
<< "chi2" << "\t" << "prob" << "\t"
<< "newDetId" << "\t" << "tan(LA)" << "\t"
<< "Error(LA)" << std::endl;
<< "Error(LA)" ;
// clang-format on

std::unique_ptr<SiPixelLorentzAngle> LorentzAngle = std::make_unique<SiPixelLorentzAngle>();
Expand Down Expand Up @@ -334,23 +334,22 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
<< "\t" << e1 / p1 * 100. << "\t" << (p1 - p1_simul_newmodule) / e1 << "\t" << p2
<< "\t" << e2 << "\t" << p3 << "\t" << e3 << "\t" << p4 << "\t" << e4 << "\t" << p5
<< "\t" << e5 << "\t" << chi2 << "\t" << prob << "\t" << hists.BPixnewDetIds_[j]
<< "\t" << tan_LA << "\t" << error_LA << std::endl;
<< "\t" << tan_LA << "\t" << error_LA;

float bPixLorentzAnglePerTesla_;
// if the fit quality is OK
if (prob > fitProbCut_) {
bPixLorentzAnglePerTesla_ = tan_LA / theMagField;
if (!LorentzAngle->putLorentzAngle(rawId, bPixLorentzAnglePerTesla_)) {
edm::LogError("SiPixelLorentzAnglePCLHarvester")
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling new modules: detid already exists" << std::endl;
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling new modules: detid already exists";
}
} else {
// just copy the values from the existing payload
bPixLorentzAnglePerTesla_ = currentLorentzAngle->getLorentzAngle(rawId);
if (!LorentzAngle->putLorentzAngle(rawId, bPixLorentzAnglePerTesla_)) {
edm::LogError("SiPixelLorentzAnglePCLHarvester")
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling new modules (from current): detid already exists"
<< std::endl;
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling new modules (from current): detid already exists";
}
}
} // loop on BPix new modules
Expand Down Expand Up @@ -439,16 +438,16 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
<< e2 << "\t" << p3 << "\t" << e3 << "\t" << p4 << "\t" << e4 << "\t" << p5 << "\t"
<< e5 << "\t" << chi2 << "\t" << prob << "\t"
<< "null"
<< "\t" << tan_LA << "\t" << error_LA << std::endl;
<< "\t" << tan_LA << "\t" << error_LA;

const auto& detIdsToFill = hists.detIdsList.at(i_index);

LogDebug("SiPixelLorentzAnglePCLHarvester")
<< "index: " << i_index << " i_module: " << i_module << " i_layer: " << i_layer << std::endl;
<< "index: " << i_index << " i_module: " << i_module << " i_layer: " << i_layer;
for (const auto& id : detIdsToFill) {
LogDebug("SiPixelLorentzAnglePCLHarvester") << id << ",";
}
LogDebug("SiPixelLorentzAnglePCLHarvester") << std::endl;
LogDebug("SiPixelLorentzAnglePCLHarvester");

float bPixLorentzAnglePerTesla_;
// if the fit quality is OK
Expand All @@ -457,7 +456,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
bPixLorentzAnglePerTesla_ = tan_LA / theMagField;
if (!LorentzAngle->putLorentzAngle(id, bPixLorentzAnglePerTesla_)) {
edm::LogError("SiPixelLorentzAnglePCLHarvester")
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling BPix: detid already exists" << std::endl;
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling BPix: detid already exists";
}
}
} else {
Expand All @@ -466,8 +465,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
bPixLorentzAnglePerTesla_ = currentLorentzAngle->getLorentzAngle(id);
if (!LorentzAngle->putLorentzAngle(id, bPixLorentzAnglePerTesla_)) {
edm::LogError("SiPixelLorentzAnglePCLHarvester")
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling BPix (from current): detid already exists"
<< std::endl;
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling BPix (from current): detid already exists";
}
}
}
Expand Down Expand Up @@ -498,7 +496,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
float fPixLorentzAnglePerTesla_ = currentLorentzAngle->getLorentzAngle(id);
if (!LorentzAngle->putLorentzAngle(id, fPixLorentzAnglePerTesla_)) {
edm::LogError("SiPixelLorentzAnglePCLHarvester")
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling rest of payload: detid already exists" << std::endl;
<< "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling rest of payload: detid already exists";
}
}

Expand All @@ -518,12 +516,12 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
try {
mydbservice->writeOneIOV(*LorentzAngle, mydbservice->currentTime(), recordName_);
} catch (const cond::Exception& er) {
edm::LogError("SiPixelLorentzAngleDB") << er.what() << std::endl;
edm::LogError("SiPixelLorentzAngleDB") << er.what();
} catch (const std::exception& er) {
edm::LogError("SiPixelLorentzAngleDB") << "caught std::exception " << er.what() << std::endl;
edm::LogError("SiPixelLorentzAngleDB") << "caught std::exception " << er.what();
}
} else {
edm::LogError("SiPixelLorentzAngleDB") << "Service is unavailable" << std::endl;
edm::LogError("SiPixelLorentzAngleDB") << "Service is unavailable";
}
}

Expand Down
Expand Up @@ -425,7 +425,7 @@ void SiPixelLorentzAnglePCLWorker::analyze(edm::Event const& iEvent, edm::EventS
// fill the trackhit info
TrajectoryStateOnSurface tsos = itTraj.updatedState();
if (!tsos.isValid()) {
edm::LogWarning("SiPixelLorentzAnglePCLWorker") << "tsos not valid" << std::endl;
edm::LogWarning("SiPixelLorentzAnglePCLWorker") << "tsos not valid";
continue;
}
LocalVector trackdirection = tsos.localDirection();
Expand Down Expand Up @@ -590,7 +590,7 @@ void SiPixelLorentzAnglePCLWorker::analyze(edm::Event const& iEvent, edm::EventS
// fill the trackhit info
TrajectoryStateOnSurface tsos = itTraj.updatedState();
if (!tsos.isValid()) {
edm::LogWarning("SiPixelLorentzAnglePCLWorker") << "tsos not valid" << std::endl;
edm::LogWarning("SiPixelLorentzAnglePCLWorker") << "tsos not valid";
continue;
}
LocalVector trackdirection = tsos.localDirection();
Expand Down Expand Up @@ -654,7 +654,7 @@ void SiPixelLorentzAnglePCLWorker::dqmBeginRun(edm::Run const& run, edm::EventSe
if (!SiPixelTemplate::pushfile(*templateDBobject_, thePixelTemp_)) {
edm::LogError("SiPixelLorentzAnglePCLWorker")
<< "Templates not filled correctly. Check the sqlite file. Using SiPixelTemplateDBObject version "
<< (*templateDBobject_).version() << std::endl;
<< (*templateDBobject_).version();
}
}
}
Expand Down Expand Up @@ -811,9 +811,8 @@ void SiPixelLorentzAnglePCLWorker::bookHistograms(DQMStore::IBooker& iBooker,
unsigned int i_index = i_module + (i_layer - 1) * iHists.nModules_[i_layer - 1];
std::string binName = fmt::sprintf("BPix Layer%i Module %i", i_layer, i_module);

LogDebug("SiPixelLorentzAnglePCLWorker")
<< " i_index: " << i_index << " bin name: " << binName << " (i_layer: " << i_layer << " i_module:" << i_module
<< ")" << std::endl;
LogDebug("SiPixelLorentzAnglePCLWorker") << " i_index: " << i_index << " bin name: " << binName
<< " (i_layer: " << i_layer << " i_module:" << i_module << ")";

iHists.h_bySectOccupancy_->setBinLabel(i_index, binName);
iHists.h_bySectLA_->setBinLabel(i_index, binName);
Expand All @@ -824,8 +823,7 @@ void SiPixelLorentzAnglePCLWorker::bookHistograms(DQMStore::IBooker& iBooker,
for (int i = 0; i < (int)iHists.BPixnewDetIds_.size(); i++) {
int new_index = iHists.nModules_[iHists.nlay - 1] + (iHists.nlay - 1) * iHists.nModules_[iHists.nlay - 1] + 1 + i;

LogDebug("SiPixelLorentzAnglePCLWorker")
<< "i_index" << new_index << " bin name: " << iHists.BPixnewmodulename_[i] << std::endl;
LogDebug("SiPixelLorentzAnglePCLWorker") << "i_index" << new_index << " bin name: " << iHists.BPixnewmodulename_[i];

iHists.h_bySectOccupancy_->setBinLabel(new_index, iHists.BPixnewmodulename_[i]);
iHists.h_bySectLA_->setBinLabel(new_index, iHists.BPixnewmodulename_[i]);
Expand Down

0 comments on commit 0cfb6bf

Please sign in to comment.