From ef71fd24d104e91b546db2f5ab9492aedcf8d617 Mon Sep 17 00:00:00 2001 From: Andrey Erokhin Date: Thu, 29 Oct 2020 04:36:00 +0300 Subject: [PATCH] Detectors/CPV,CTF,FIT,HMPID: make readability-braces-around-statements happy --- Detectors/CPV/calib/src/BadChannelMap.cxx | 3 +- .../CPV/reconstruction/src/Clusterer.cxx | 12 ++-- .../include/CPVSimulation/GeometryParams.h | 9 ++- Detectors/CPV/workflow/src/RecoWorkflow.cxx | 3 +- Detectors/CTF/test/test_ctf_io_tof.cxx | 3 +- .../FDD/reconstruction/src/Reconstructor.cxx | 6 +- .../include/FDDSimulation/Detector.h | 3 +- .../FIT/FDD/simulation/src/Digitizer.cxx | 25 ++++--- Detectors/FIT/FT0/base/src/Geometry.cxx | 6 +- .../FIT/FT0/raw/include/FT0Raw/DataBlockFT0.h | 3 +- .../include/FT0Reconstruction/ReadRaw.h | 6 +- .../FIT/FT0/reconstruction/src/ReadRaw.cxx | 6 +- .../include/FT0Simulation/Digitizer.h | 9 ++- .../include/FT0Simulation/Digits2Raw.h | 6 +- Detectors/FIT/FT0/simulation/src/Detector.cxx | 6 +- .../FIT/FT0/simulation/src/Digitizer.cxx | 18 +++-- .../FIT/FT0/simulation/src/Digits2Raw.cxx | 15 +++-- .../include/FT0Workflow/RawReaderFT0.h | 6 +- .../workflow/src/FT0DataProcessDPLSpec.cxx | 3 +- .../FIT/FT0/workflow/src/FT0Workflow.cxx | 6 +- .../FIT/FV0/reconstruction/src/ReadRaw.cxx | 3 +- .../FIT/FV0/simulation/src/Digitizer.cxx | 3 +- .../FIT/raw/include/FITRaw/DataBlockBase.h | 15 +++-- .../FIT/raw/include/FITRaw/RawReaderBase.h | 5 +- .../HMPID/base/include/HMPIDBase/Param.h | 6 +- Detectors/HMPID/base/src/Param.cxx | 67 ++++++++++++------- Detectors/HMPID/simulation/src/Detector.cxx | 62 +++++++++++------ 27 files changed, 207 insertions(+), 108 deletions(-) diff --git a/Detectors/CPV/calib/src/BadChannelMap.cxx b/Detectors/CPV/calib/src/BadChannelMap.cxx index b453b8e030903..92bf6f77f2cb1 100644 --- a/Detectors/CPV/calib/src/BadChannelMap.cxx +++ b/Detectors/CPV/calib/src/BadChannelMap.cxx @@ -79,8 +79,9 @@ void BadChannelMap::PrintStream(std::ostream& stream) const // first sort bad channel IDs stream << "Number of bad cells: " << mBadCells.count() << "\n"; for (int cellID = 0; cellID < mBadCells.size(); cellID++) { - if (mBadCells.test(cellID)) + if (mBadCells.test(cellID)) { stream << cellID << "\n"; + } } } diff --git a/Detectors/CPV/reconstruction/src/Clusterer.cxx b/Detectors/CPV/reconstruction/src/Clusterer.cxx index 74105acc4f378..5af836e70d79e 100644 --- a/Detectors/CPV/reconstruction/src/Clusterer.cxx +++ b/Detectors/CPV/reconstruction/src/Clusterer.cxx @@ -40,8 +40,9 @@ void Clusterer::process(gsl::span digits, gsl::spanclear(); //final out list of clusters trigRec->clear(); - if (cluMC) + if (cluMC) { cluMC->clear(); + } for (const auto& tr : dtr) { mFirstDigitInEvent = tr.getFirstEntry(); @@ -103,8 +104,9 @@ void Clusterer::makeClusters(gsl::span digits) int iFirst = mFirstDigitInEvent; // first index of digit which potentially can be a part of cluster for (int i = iFirst; i < mLastDigitInEvent; i++) { - if (digitsUsed[i - mFirstDigitInEvent]) + if (digitsUsed[i - mFirstDigitInEvent]) { continue; + } const Digit& digitSeed = digits[i]; float digitSeedEnergy = calibrate(digitSeed.getAmplitude(), digitSeed.getAbsId()); @@ -134,8 +136,9 @@ void Clusterer::makeClusters(gsl::span digits) short digitSeedAbsId = clu->getDigitAbsId(index); index++; for (Int_t j = iFirst; j < mLastDigitInEvent; j++) { - if (digitsUsed[j - mFirstDigitInEvent]) + if (digitsUsed[j - mFirstDigitInEvent]) { continue; // look through remaining digits + } const Digit* digitN = &(digits[j]); float digitNEnergy = calibrate(digitN->getAmplitude(), digitN->getAbsId()); if (isBadChannel(digitN->getAbsId())) { //remove digit @@ -251,8 +254,9 @@ void Clusterer::unfoldOneCluster(FullCluster& iniClu, char nMax, gsl::span a[iclu] += mfij[idig][iclu] * mfij[idig][iclu]; b[iclu] += it.energy * mfij[idig][iclu]; for (int kclu = 0; kclu < nMax; kclu++) { - if (iclu == kclu) + if (iclu == kclu) { continue; + } c[iclu] += eMax[kclu] * mfij[idig][iclu] * mfij[idig][kclu]; } } diff --git a/Detectors/CPV/simulation/include/CPVSimulation/GeometryParams.h b/Detectors/CPV/simulation/include/CPVSimulation/GeometryParams.h index 26ffdc379dcd4..7c40586b518f7 100644 --- a/Detectors/CPV/simulation/include/CPVSimulation/GeometryParams.h +++ b/Detectors/CPV/simulation/include/CPVSimulation/GeometryParams.h @@ -41,17 +41,20 @@ class GeometryParams final : public TNamed void GetModuleAngle(int module, float angle[3][2]) const { - for (int i = 0; i < 3; i++) - for (int ian = 0; ian < 2; ian++) + for (int i = 0; i < 3; i++) { + for (int ian = 0; ian < 2; ian++) { angle[i][ian] = mModuleAngle[module][i][ian]; + } + } } float GetCPVAngle(Int_t index) const { return mCPVAngle[index - 1]; } void GetModuleCenter(int module, float* pos) const { - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) { pos[i] = mModuleCenter[module][i]; + } } int GetNModules() const { return mNModules; } diff --git a/Detectors/CPV/workflow/src/RecoWorkflow.cxx b/Detectors/CPV/workflow/src/RecoWorkflow.cxx index 50d860a856c25..82bc452753350 100644 --- a/Detectors/CPV/workflow/src/RecoWorkflow.cxx +++ b/Detectors/CPV/workflow/src/RecoWorkflow.cxx @@ -95,8 +95,9 @@ o2::framework::WorkflowSpec getWorkflow(bool propagateMC, o2::framework::OutputSpec{"CPV", "DIGITSMCTR"}}, propagateMC)); - if (enableDigitsPrinter) + if (enableDigitsPrinter) { specs.emplace_back(o2::cpv::reco_workflow::getPhosDigitsPrinterSpec()); + } if (isEnabled(OutputType::Clusters)) { // add clusterizer diff --git a/Detectors/CTF/test/test_ctf_io_tof.cxx b/Detectors/CTF/test/test_ctf_io_tof.cxx index dce6d920c19e6..27810fc5b9292 100644 --- a/Detectors/CTF/test/test_ctf_io_tof.cxx +++ b/Detectors/CTF/test/test_ctf_io_tof.cxx @@ -67,8 +67,9 @@ BOOST_AUTO_TEST_CASE(CompressedClustersTest) [](const Digit& a, const Digit& b) { int strip1 = a.getChannel() / Geo::NPADS, strip2 = b.getChannel() / Geo::NPADS; if (strip1 == strip2) { - if (a.getBC() == b.getBC()) + if (a.getBC() == b.getBC()) { return a.getTDC() < b.getTDC(); + } return a.getBC() < b.getBC(); } return strip1 < strip2; diff --git a/Detectors/FIT/FDD/reconstruction/src/Reconstructor.cxx b/Detectors/FIT/FDD/reconstruction/src/Reconstructor.cxx index 30cc96d5a0aa6..7bfcca22dedb1 100644 --- a/Detectors/FIT/FDD/reconstruction/src/Reconstructor.cxx +++ b/Detectors/FIT/FDD/reconstruction/src/Reconstructor.cxx @@ -28,11 +28,13 @@ void Reconstructor::process(const o2::fdd::Digit& digitBC, gsl::span 1) + if (adc > 1) { timeErr = 1 / adc; + } if (channel.mPMNumber < 8) { timeFDC += time / (timeErr * timeErr); weightFDC += 1. / (timeErr * timeErr); diff --git a/Detectors/FIT/FDD/simulation/include/FDDSimulation/Detector.h b/Detectors/FIT/FDD/simulation/include/FDDSimulation/Detector.h index 2f5862e960568..9ea50b4ee45fb 100644 --- a/Detectors/FIT/FDD/simulation/include/FDDSimulation/Detector.h +++ b/Detectors/FIT/FDD/simulation/include/FDDSimulation/Detector.h @@ -52,8 +52,9 @@ class Detector : public o2::base::DetImpl std::vector* getHits(Int_t iColl) { - if (iColl == 0) + if (iColl == 0) { return mHits; + } return nullptr; } diff --git a/Detectors/FIT/FDD/simulation/src/Digitizer.cxx b/Detectors/FIT/FDD/simulation/src/Digitizer.cxx index e3909e028b80f..fdb232dc95d66 100644 --- a/Detectors/FIT/FDD/simulation/src/Digitizer.cxx +++ b/Detectors/FIT/FDD/simulation/src/Digitizer.cxx @@ -90,17 +90,19 @@ void Digitizer::createPulse(int nPhE, int parID, double timeHit, std::array= binShift) + if (iBin >= binShift) { mTimeCFD[iBin] = 5.0 * pulse[iBin - binShift] - pulse[iBin]; - else + } else { mTimeCFD[iBin] = -1.0 * pulse[iBin]; + } } for (int iBin = 1; iBin < NTimeBinsPerBC; ++iBin) { if (mTimeCFD[iBin - 1] < 0 && mTimeCFD[iBin] >= 0) { @@ -328,8 +332,9 @@ void Digitizer::finish() {} int Digitizer::simulateLightYield(int pmt, int nPhot) { const float p = parameters.LightYield * PhotoCathodeEfficiency; - if (p == 1.0f || nPhot == 0) + if (p == 1.0f || nPhot == 0) { return nPhot; + } const int n = int(nPhot < 100 ? gRandom->Binomial(nPhot, p) : gRandom->Gaus(p * nPhot + 0.5, TMath::Sqrt(p * (1 - p) * nPhot))); return n; } @@ -350,8 +355,9 @@ Double_t Digitizer::SinglePhESpectrum(Double_t* x, Double_t*) { // this function describes the PM amplitude response to a single photoelectron Double_t y = x[0]; - if (y < 0) + if (y < 0) { return 0; + } return (TMath::Poisson(y, PMNbOfSecElec) + PMTransparency * TMath::Poisson(y, 1.0)); } //______________________________________________________________ @@ -361,8 +367,9 @@ void Digitizer::BCCache::print() const for (int ic = 0; ic < 16; ic++) { printf("Ch[%d] | ", ic); for (int ib = 0; ib < NTimeBinsPerBC; ib++) { - if (ib % 10 == 0) + if (ib % 10 == 0) { printf("%f ", pulse[ic][ib]); + } } printf("\n"); } diff --git a/Detectors/FIT/FT0/base/src/Geometry.cxx b/Detectors/FIT/FT0/base/src/Geometry.cxx index ef2712bc789ee..6d30591501427 100644 --- a/Detectors/FIT/FT0/base/src/Geometry.cxx +++ b/Detectors/FIT/FT0/base/src/Geometry.cxx @@ -90,8 +90,10 @@ Geometry::Geometry() : mMCP{{0, 0, 0}} gc[i] = -1 * ac[i]; } // Set coordinate - for (int ipmt = 0; ipmt < 24; ipmt++) + for (int ipmt = 0; ipmt < 24; ipmt++) { mMCP[ipmt].SetXYZ(xa[ipmt], xa[ipmt], zDetA); - for (int ipmt = 24; ipmt < 52; ipmt++) + } + for (int ipmt = 24; ipmt < 52; ipmt++) { mMCP[ipmt].SetXYZ(xc2[ipmt - 24], yc2[ipmt - 24], zc2[ipmt - 24]); + } } diff --git a/Detectors/FIT/FT0/raw/include/FT0Raw/DataBlockFT0.h b/Detectors/FIT/FT0/raw/include/FT0Raw/DataBlockFT0.h index 30bf27f61dd0e..407fba225fc1d 100644 --- a/Detectors/FIT/FT0/raw/include/FT0Raw/DataBlockFT0.h +++ b/Detectors/FIT/FT0/raw/include/FT0Raw/DataBlockFT0.h @@ -55,8 +55,9 @@ class DataBlockPM : public DataBlockBase // put here code for raw data checking void sanityCheck(bool& flag) { - if (DataBlockWrapper::mNelements % 2 == 0 && DataBlockWrapper::mData[DataBlockWrapper::mNelements - 1].channelID == 0) + if (DataBlockWrapper::mNelements % 2 == 0 && DataBlockWrapper::mData[DataBlockWrapper::mNelements - 1].channelID == 0) { DataBlockWrapper::mNelements--; //in case of half GBT-word filling + } //TODO, Descriptor checking, Channel range } }; diff --git a/Detectors/FIT/FT0/reconstruction/include/FT0Reconstruction/ReadRaw.h b/Detectors/FIT/FT0/reconstruction/include/FT0Reconstruction/ReadRaw.h index 47e83b3c16426..84185564bb6a5 100644 --- a/Detectors/FIT/FT0/reconstruction/include/FT0Reconstruction/ReadRaw.h +++ b/Detectors/FIT/FT0/reconstruction/include/FT0Reconstruction/ReadRaw.h @@ -60,9 +60,11 @@ class ReadRaw static o2::ft0::LookUpTable linear() { std::vector lut_data(Nchannels_PM * NPMs); - for (int link = 0; link < NPMs; ++link) - for (int mcp = 0; mcp < Nchannels_PM; ++mcp) + for (int link = 0; link < NPMs; ++link) { + for (int mcp = 0; mcp < Nchannels_PM; ++mcp) { lut_data[link * Nchannels_PM + mcp] = o2::ft0::Topo{link, mcp}; + } + } return o2::ft0::LookUpTable{lut_data}; } diff --git a/Detectors/FIT/FT0/reconstruction/src/ReadRaw.cxx b/Detectors/FIT/FT0/reconstruction/src/ReadRaw.cxx index 27c6008b33ab0..bd72a9f5a7625 100644 --- a/Detectors/FIT/FT0/reconstruction/src/ReadRaw.cxx +++ b/Detectors/FIT/FT0/reconstruction/src/ReadRaw.cxx @@ -173,8 +173,9 @@ void ReadRaw::readData(const std::string fileRaw, const o2::ft0::LookUpTable& lu void ReadRaw::close() { LOG(INFO) << " CLOSE "; - if (mFileDest.is_open()) + if (mFileDest.is_open()) { mFileDest.close(); + } } //_____________________________________________________________________________ void ReadRaw::writeDigits(std::string fileDataOut) @@ -196,8 +197,9 @@ void ReadRaw::writeDigits(std::string fileDataOut) std::vector chDataVec; digitVec.reserve(mDigitAccum.size()); size_t numberOfChData = 0; - for (auto const& [intrec, digit] : mDigitAccum) + for (auto const& [intrec, digit] : mDigitAccum) { numberOfChData += digit.getChDgData().size(); + } chDataVec.reserve(numberOfChData); for (auto& [intrec, digit] : mDigitAccum) { int first = gsl::narrow_cast(chDataVec.size()); diff --git a/Detectors/FIT/FT0/simulation/include/FT0Simulation/Digitizer.h b/Detectors/FIT/FT0/simulation/include/FT0Simulation/Digitizer.h index c53064101a6e7..faf0576122531 100644 --- a/Detectors/FIT/FT0/simulation/include/FT0Simulation/Digitizer.h +++ b/Detectors/FIT/FT0/simulation/include/FT0Simulation/Digitizer.h @@ -94,8 +94,9 @@ class Digitizer protected: inline float signalForm(float x) const { // table lookup for the signal shape - if (x <= 0.0f) + if (x <= 0.0f) { return 0.0f; + } float const y = x / mParameters.bunchWidth * DP::SIGNAL_TABLE_SIZE; int const index = std::floor(y); if (index + 1 >= DP::SIGNAL_TABLE_SIZE) { @@ -112,8 +113,9 @@ class Digitizer auto const rem = y - index; Vc::float_v val(0); for (size_t i = 0; i < float_v::size(); ++i) { - if (y[i] < 0.0f) + if (y[i] < 0.0f) { continue; + } if (index[i] + 1 < DP::SIGNAL_TABLE_SIZE) { val[i] = mSignalTable[index[i]] + rem[i] * (mSignalTable[index[i] + 1] - mSignalTable[index[i]]); } else { @@ -170,8 +172,9 @@ inline float signalForm_integral(float x) using namespace std; double const a = -0.45458; double const b = -0.83344945; - if (x < 0) + if (x < 0) { x = 0; + } return -(exp(b * x) / b - exp(a * x) / a) / 7.8446501; }; diff --git a/Detectors/FIT/FT0/simulation/include/FT0Simulation/Digits2Raw.h b/Detectors/FIT/FT0/simulation/include/FT0Simulation/Digits2Raw.h index 9cbfa837a0881..4a4b4cabd3f15 100644 --- a/Detectors/FIT/FT0/simulation/include/FT0Simulation/Digits2Raw.h +++ b/Detectors/FIT/FT0/simulation/include/FT0Simulation/Digits2Raw.h @@ -59,9 +59,11 @@ class Digits2Raw static o2::ft0::LookUpTable linear() { std::vector lut_data(Nchannels_PM * (NPMs - 1)); - for (int link = 0; link < NPMs - 1; ++link) - for (int mcp = 0; mcp < Nchannels_PM; ++mcp) + for (int link = 0; link < NPMs - 1; ++link) { + for (int mcp = 0; mcp < Nchannels_PM; ++mcp) { lut_data[link * Nchannels_PM + mcp] = o2::ft0::Topo{link, mcp}; + } + } return o2::ft0::LookUpTable{lut_data}; } diff --git a/Detectors/FIT/FT0/simulation/src/Detector.cxx b/Detectors/FIT/FT0/simulation/src/Detector.cxx index 961b8bd5e5c67..6becdfbf2866c 100644 --- a/Detectors/FIT/FT0/simulation/src/Detector.cxx +++ b/Detectors/FIT/FT0/simulation/src/Detector.cxx @@ -478,8 +478,9 @@ void Detector::DefineOpticalProperties() // Path of the optical properties input file TString inputDir; const char* aliceO2env = std::getenv("O2_ROOT"); - if (aliceO2env) + if (aliceO2env) { inputDir = aliceO2env; + } inputDir += "/share/Detectors/FT0/files/"; TString optPropPath = inputDir + "quartzOptProperties.txt"; @@ -560,8 +561,9 @@ Bool_t Detector::RegisterPhotoE(float energy) { float eff = mPMTeff->Eval(energy); float p = gRandom->Rndm(); - if (p > eff) + if (p > eff) { return kFALSE; + } return kTRUE; } diff --git a/Detectors/FIT/FT0/simulation/src/Digitizer.cxx b/Detectors/FIT/FT0/simulation/src/Digitizer.cxx index d34d5f22aec8f..3cde3b5b42ef6 100644 --- a/Detectors/FIT/FT0/simulation/src/Digitizer.cxx +++ b/Detectors/FIT/FT0/simulation/src/Digitizer.cxx @@ -161,15 +161,17 @@ void Digitizer::process(const std::vector* hits, Int_t parent = -10; for (auto const& hit : *hits) { - if (hit.GetEnergyLoss() > 0) + if (hit.GetEnergyLoss() > 0) { continue; + } Int_t hit_ch = hit.GetDetectorID(); Bool_t is_A_side = (hit_ch < 4 * mParameters.nCellsA); Float_t time_compensate = is_A_side ? mParameters.A_side_cable_cmps : mParameters.C_side_cable_cmps; Double_t hit_time = hit.GetTime() - time_compensate; - if (hit_time > 250) + if (hit_time > 250) { continue; //not collect very slow particles + } auto relBC = o2::InteractionRecord{hit_time}; if (mCache.size() <= relBC.bc) { mCache.resize(relBC.bc + 1); @@ -189,8 +191,9 @@ void Digitizer::storeBC(BCCache& bc, std::vector& digitsCh, o2::dataformats::MCTruthContainer& labels) { - if (bc.hits.empty()) + if (bc.hits.empty()) { return; + } int n_hit_A = 0, n_hit_C = 0, mean_time_A = 0, mean_time_C = 0; int summ_ampl_A = 0, summ_ampl_C = 0; int vertex_time; @@ -216,14 +219,16 @@ void Digitizer::storeBC(BCCache& bc, mDeadTimes[ipmt].intrec = firstBCinDeque; mDeadTimes[ipmt].deadTime = cfd.deadTime; - if (!cfd.particle) + if (!cfd.particle) { continue; + } int smeared_time = 1000. * (*cfd.particle - mParameters.mCfdShift) * mParameters.ChannelWidthInverse; bool is_time_in_signal_gate = (smeared_time > -mParameters.mTime_trg_gate && smeared_time < mParameters.mTime_trg_gate); float charge = measure_amplitude(channel_times) * mParameters.charge2amp; float amp = is_time_in_signal_gate ? mParameters.mV_2_Nchannels * charge : 0; - if (amp > 4095) + if (amp > 4095) { amp = 4095; + } LOG(DEBUG) << mEventID << " bc " << firstBCinDeque.bc << " orbit " << firstBCinDeque.orbit << ", ipmt " << ipmt << ", smeared_time " << smeared_time << " nStored " << nStored; digitsCh.emplace_back(ipmt, smeared_time, int(amp), chain); nStored++; @@ -264,8 +269,9 @@ void Digitizer::storeBC(BCCache& bc, digitsBC.emplace_back(first, nStored, firstBCinDeque, triggers, mEventID - 1); size_t const nBC = digitsBC.size(); - for (auto const& lbl : bc.labels) + for (auto const& lbl : bc.labels) { labels.addElement(nBC - 1, lbl); + } } // Debug output ------------------------------------------------------------- diff --git a/Detectors/FIT/FT0/simulation/src/Digits2Raw.cxx b/Detectors/FIT/FT0/simulation/src/Digits2Raw.cxx index 6986a709b1bca..d564780137f2e 100644 --- a/Detectors/FIT/FT0/simulation/src/Digits2Raw.cxx +++ b/Detectors/FIT/FT0/simulation/src/Digits2Raw.cxx @@ -114,8 +114,9 @@ void Digits2Raw::readDigits(const std::string& outDir, const std::string& fileDi auto& bcd = digitsBC[ibc]; intRecord = bcd.getIntRecord(); auto channels = bcd.getBunchChannelData(digitsCh); - if (!channels.empty()) + if (!channels.empty()) { convertDigits(bcd, channels, lut, intRecord); + } } } } @@ -136,8 +137,9 @@ void Digits2Raw::convertDigits(o2::ft0::Digit bcdigits, if (oldlink >= 0) { uint nGBTWords = uint((nchannels + 1) / 2); LOG(DEBUG) << " oldlink " << oldlink << " nGBTWords " << nGBTWords; - if ((nchannels % 2) == 1) + if ((nchannels % 2) == 1) { mRawEventData.mEventData[nchannels] = {}; + } mRawEventData.mEventHeader.nGBTWords = nGBTWords; auto data = mRawEventData.to_vector(false); mLinkID = uint32_t(oldlink); @@ -160,8 +162,9 @@ void Digits2Raw::convertDigits(o2::ft0::Digit bcdigits, } // fill mEventData[nchannels] with 0s to flag that this is a dummy data uint nGBTWords = uint((nchannels + 1) / 2); - if ((nchannels % 2) == 1) + if ((nchannels % 2) == 1) { mRawEventData.mEventData[nchannels] = {}; + } mRawEventData.mEventHeader.nGBTWords = nGBTWords; auto datalast = mRawEventData.to_vector(false); mLinkID = uint32_t(oldlink); @@ -176,10 +179,12 @@ void Digits2Raw::convertDigits(o2::ft0::Digit bcdigits, float ampA = mTriggers.amplA; float ampC = mTriggers.amplC; - if (ampA > 131071) + if (ampA > 131071) { ampA = 131071; //2^17 - if (ampC > 131071) + } + if (ampC > 131071) { ampC = 131071; //2^17 + } tcmdata.vertex = mTriggers.getVertex(); tcmdata.orA = mTriggers.getOrA(); tcmdata.orC = mTriggers.getOrC(); diff --git a/Detectors/FIT/FT0/workflow/include/FT0Workflow/RawReaderFT0.h b/Detectors/FIT/FT0/workflow/include/FT0Workflow/RawReaderFT0.h index ca97dfeb1cccb..20adeed3cda20 100644 --- a/Detectors/FIT/FT0/workflow/include/FT0Workflow/RawReaderFT0.h +++ b/Detectors/FIT/FT0/workflow/include/FT0Workflow/RawReaderFT0.h @@ -52,8 +52,9 @@ class RawReaderFT0 : public RawReaderFT0BaseNorm getDigits(mVecDigits, mVecChannelData); LOG(INFO) << "Number of Digits: " << mVecDigits.size(); LOG(INFO) << "Number of ChannelData: " << mVecChannelData.size(); - if (mDumpData) + if (mDumpData) { DigitBlockFT0::print(mVecDigits, mVecChannelData); + } } static void prepareOutputSpec(std::vector& outputSpec) { @@ -91,8 +92,9 @@ class RawReaderFT0ext : public RawReaderFT0BaseExt LOG(INFO) << "Number of Digits: " << mVecDigitsExt.size(); LOG(INFO) << "Number of ChannelData: " << mVecChannelData.size(); LOG(INFO) << "Number of TriggerExt: " << mVecTrgExt.size(); - if (mDumpData) + if (mDumpData) { DigitBlockFT0ext::print(mVecDigitsExt, mVecChannelData, mVecTrgExt); + } } static void prepareOutputSpec(std::vector& outputSpec) { diff --git a/Detectors/FIT/FT0/workflow/src/FT0DataProcessDPLSpec.cxx b/Detectors/FIT/FT0/workflow/src/FT0DataProcessDPLSpec.cxx index 7fe7de20506b9..9ad55e06a8c56 100644 --- a/Detectors/FIT/FT0/workflow/src/FT0DataProcessDPLSpec.cxx +++ b/Detectors/FIT/FT0/workflow/src/FT0DataProcessDPLSpec.cxx @@ -28,8 +28,9 @@ void FT0DataProcessDPLSpec::run(ProcessingContext& pc) LOG(INFO) << "FT0DataProcessDPLSpec running..."; auto vecDigits = pc.inputs().get>("digits"); auto vecChannelData = pc.inputs().get>("digch"); - if (mDumpEventBlocks) + if (mDumpEventBlocks) { DigitBlockFT0::print(vecDigits, vecChannelData); + } } DataProcessorSpec getFT0DataProcessDPLSpec(bool dumpProcessor) diff --git a/Detectors/FIT/FT0/workflow/src/FT0Workflow.cxx b/Detectors/FIT/FT0/workflow/src/FT0Workflow.cxx index ada920a29c99f..db4187ee49169 100644 --- a/Detectors/FIT/FT0/workflow/src/FT0Workflow.cxx +++ b/Detectors/FIT/FT0/workflow/src/FT0Workflow.cxx @@ -31,10 +31,12 @@ framework::WorkflowSpec getFT0Workflow(bool isExtendedMode, bool useProcess, } else { specs.emplace_back(o2::ft0::getFT0DataReaderDPLSpec(RawReaderFT0{dumpReader})); } - if (useProcess) + if (useProcess) { specs.emplace_back(o2::ft0::getFT0DataProcessDPLSpec(dumpProcessor)); - if (!disableRootOut) + } + if (!disableRootOut) { specs.emplace_back(o2::ft0::getFT0DigitWriterDPLSpec()); + } return specs; } diff --git a/Detectors/FIT/FV0/reconstruction/src/ReadRaw.cxx b/Detectors/FIT/FV0/reconstruction/src/ReadRaw.cxx index ab8902f6dca54..db2dd6e2c33ca 100644 --- a/Detectors/FIT/FV0/reconstruction/src/ReadRaw.cxx +++ b/Detectors/FIT/FV0/reconstruction/src/ReadRaw.cxx @@ -121,8 +121,9 @@ void ReadRaw::readRawData(const LookUpTable& lut) void ReadRaw::close() { - if (mRawFileIn.is_open()) + if (mRawFileIn.is_open()) { mRawFileIn.close(); + } } void ReadRaw::writeDigits(const std::string& outputDigitsFilePath) diff --git a/Detectors/FIT/FV0/simulation/src/Digitizer.cxx b/Detectors/FIT/FV0/simulation/src/Digitizer.cxx index 146e47705fd87..c457619ef529a 100644 --- a/Detectors/FIT/FV0/simulation/src/Digitizer.cxx +++ b/Detectors/FIT/FV0/simulation/src/Digitizer.cxx @@ -202,8 +202,9 @@ void Digitizer::storeBC(const BCCache& bc, std::vector& digitsB double cfdWithOffset = SimulateTimeCfd(bc.mPmtChargeVsTime[iPmt]); double cfdZero = cfdWithOffset - FV0DigParam::Instance().avgCfdTimeForMip; - if (cfdZero < -FV0DigParam::Instance().cfdCheckWindow || cfdZero > FV0DigParam::Instance().cfdCheckWindow) + if (cfdZero < -FV0DigParam::Instance().cfdCheckWindow || cfdZero > FV0DigParam::Instance().cfdCheckWindow) { continue; + } //LOG(INFO) << "time inside analyse and store =========> " << cfdZero <<" detid "< vecBytes(sizeWord * nWords); uint8_t* srcAddress = (uint8_t*)mData; - if (nWords == 0 || nWords > MaxNwords) + if (nWords == 0 || nWords > MaxNwords) { return std::move(vecBytes); + } gsl::span serializedBytes(vecBytes); size_t countBytes = 0; int nSteps = std::get(sReadingLookupTable[nWords]); @@ -125,10 +126,12 @@ struct DataBlockWrapper { payloadPerElem -= payloadInWord; payloadInWord = 0; } - if (payloadInWord == 0) + if (payloadInWord == 0) { payloadInWord = T::PayloadPerGBTword; - if (payloadPerElem == 0) + } + if (payloadPerElem == 0) { payloadPerElem = T::PayloadSize; + } } return count; } @@ -193,8 +196,9 @@ struct DataBlockWrapper { bytesInWord = 0; } - if (payloadInWord == 0) + if (payloadInWord == 0) { payloadInWord = T::PayloadPerGBTword; + } if (payloadPerElem == 0) { payloadPerElem = T::PayloadSize; countElement++; @@ -236,8 +240,9 @@ struct DataBlockWrapper { } countWord++; } - if (payloadPerElem == 0) + if (payloadPerElem == 0) { payloadPerElem = T::PayloadSize; + } payloadPerElem -= std::get((GetByteLookupTable())[iStep]); } //Last step checking diff --git a/Detectors/FIT/raw/include/FITRaw/RawReaderBase.h b/Detectors/FIT/raw/include/FITRaw/RawReaderBase.h index bc290305c5bca..bea49dd68fc07 100644 --- a/Detectors/FIT/raw/include/FITRaw/RawReaderBase.h +++ b/Detectors/FIT/raw/include/FITRaw/RawReaderBase.h @@ -49,10 +49,11 @@ class RawReaderBase DataBlockType dataBlock; dataBlock.decodeBlock(binaryPayload, srcPos); srcPos += dataBlock.mSize; - if (dataBlock.isCorrect()) + if (dataBlock.isCorrect()) { vecDataBlocks.push_back(dataBlock); //change to in-place construction? TODO - else + } else { LOG(INFO) << "WARNING! INCORRECT DATA BLOCK!"; + } } return srcPos; } diff --git a/Detectors/HMPID/base/include/HMPIDBase/Param.h b/Detectors/HMPID/base/include/HMPIDBase/Param.h index c71cf5942a331..d94a6c2caee95 100644 --- a/Detectors/HMPID/base/include/HMPIDBase/Param.h +++ b/Detectors/HMPID/base/include/HMPIDBase/Param.h @@ -119,16 +119,18 @@ class Param static Int_t InHVSector(float y); //find HV sector static Int_t Radiator(float y) { - if (InHVSector(y) < 0) + if (InHVSector(y) < 0) { return -1; + } return InHVSector(y) / 2; } // height in the radiator to estimate temperature from gradient static double HinRad(float y) { - if (Radiator(y) < 0) + if (Radiator(y) < 0) { return -1; + } return y - Radiator(y) * fgkMinPcY[Radiator(y)]; } //is point inside chamber boundaries? diff --git a/Detectors/HMPID/base/src/Param.cxx b/Detectors/HMPID/base/src/Param.cxx index 3a75748b7ab12..9358bc480e691 100644 --- a/Detectors/HMPID/base/src/Param.cxx +++ b/Detectors/HMPID/base/src/Param.cxx @@ -93,13 +93,15 @@ Param::Param(bool noGeo) : mX(0), mY(0), mRefIdx(1.28947), mPhotEMean(6.675), mT float dead = 2.6; // cm of the dead zones between PCs-> See 2CRC2099P1 - if (noGeo == kTRUE) + if (noGeo == kTRUE) { fgInstanceType = kFALSE; //instance from ideal geometry, no actual geom is present + } if (noGeo == kFALSE && !gGeoManager) { TGeoManager::Import("geometry.root"); - if (!gGeoManager) + if (!gGeoManager) { Printf("!!!!!!No geometry loaded!!!!!!!"); + } } fgCellX = 0.8; @@ -150,7 +152,7 @@ Param::Param(bool noGeo) : mX(0), mY(0), mRefIdx(1.28947), mPhotEMean(6.675), mT } } - for (Int_t i = kMinCh; i <= kMaxCh; i++) + for (Int_t i = kMinCh; i <= kMaxCh; i++) { if (gGeoManager && gGeoManager->IsClosed()) { TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(Form("/HMPID/Chamber%i", i)); if (!pne) { @@ -159,9 +161,9 @@ Param::Param(bool noGeo) : mX(0), mY(0), mRefIdx(1.28947), mPhotEMean(6.675), mT IdealPosition(i, mM[i]); } else { TGeoPhysicalNode* pnode = pne->GetPhysicalNode(); - if (pnode) + if (pnode) { mM[i] = new TGeoHMatrix(*(pnode->GetMatrix())); - else { + } else { mM[i] = new TGeoHMatrix; IdealPosition(i, mM[i]); } @@ -170,6 +172,7 @@ Param::Param(bool noGeo) : mX(0), mY(0), mRefIdx(1.28947), mPhotEMean(6.675), mT mM[i] = new TGeoHMatrix; IdealPosition(i, mM[i]); } + } fgInstance = this; } //ctor //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -177,8 +180,9 @@ void Param::Print(Option_t* opt) const { // print some usefull (hopefully) info on some internal guts of HMPID parametrisation - for (Int_t i = 0; i < 7; i++) + for (Int_t i = 0; i < 7; i++) { mM[i]->Print(opt); + } } //Print() //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void Param::IdealPosition(Int_t iCh, TGeoHMatrix* pMatrix) @@ -284,10 +288,12 @@ double Param::Sigma2(double trkTheta, double trkPhi, double ckovTh, double ckovP TVector3 v(-999, -999, -999); double trkBeta = 1. / (TMath::Cos(ckovTh) * GetRefIdx()); - if (trkBeta > 1) + if (trkBeta > 1) { trkBeta = 1; //protection against bad measured thetaCer - if (trkBeta < 0) + } + if (trkBeta < 0) { trkBeta = 0.0001; // + } v.SetX(SigLoc(trkTheta, trkPhi, ckovTh, ckovPh, trkBeta)); v.SetY(SigGeom(trkTheta, trkPhi, ckovTh, ckovPh, trkBeta)); @@ -318,8 +324,9 @@ double Param::SigLoc(double trkTheta, double trkPhi, double thetaC, double phiC, double alpha = cost - tantheta * cosfd * sint; // formula (11) double k = 1. - GetRefIdx() * GetRefIdx() + alpha * alpha / (betaM * betaM); // formula (after 8 in the text) - if (k < 0) + if (k < 0) { return 1e10; + } double mu = sint * sinf + tantheta * (cost * cosfd * sinf + sinfd * cosf); // formula (10) double e = sint * cosf + tantheta * (cost * cosfd * cosf - sinfd * sinf); // formula (9) @@ -381,8 +388,9 @@ double Param::SigGeom(double trkTheta, double trkPhi, double thetaC, double phiC double alpha = cost - tantheta * cosfd * sint; // formula (11) double k = 1. - GetRefIdx() * GetRefIdx() + alpha * alpha / (betaM * betaM); // formula (after 8 in the text) - if (k < 0) + if (k < 0) { return 1e10; + } double eTr = 0.5 * RadThick() * betaM * TMath::Sqrt(k) / (GapThick() * alpha); // formula (14) double lambda = (1. - sint * sinf) * (1. + sint * sinf); // formula (15) @@ -427,8 +435,9 @@ Param* Param::Instance() // Return pointer to the AliHMPIDParam singleton. // Arguments: none // Returns: pointer to the instance of AliHMPIDParam or 0 if no geometry - if (!fgInstance) + if (!fgInstance) { new Param(kFALSE); //default setting for reconstruction, if no geometry.root -> AliFatal + } return fgInstance; } //Instance() @@ -438,8 +447,9 @@ Param* Param::InstanceNoGeo() // Return pointer to the AliHMPIDParam singleton without the geometry.root. // Arguments: none // Returns: pointer to the instance of AliHMPIDParam or 0 if no geometry - if (!fgInstance) + if (!fgInstance) { new Param(kTRUE); //to avoid AliFatal, for MOOD and displays, use ideal geometry parameters + } return fgInstance; } //Instance() //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -448,9 +458,11 @@ bool Param::IsInDead(float x, float y) // Check is the current point is outside of sensitive area or in dead zones // Arguments: x,y -position // Returns: 1 if not in sensitive zone - for (Int_t iPc = 0; iPc < 6; iPc++) - if (x >= fgkMinPcX[iPc] && x <= fgkMaxPcX[iPc] && y >= fgkMinPcY[iPc] && y <= fgkMaxPcY[iPc]) + for (Int_t iPc = 0; iPc < 6; iPc++) { + if (x >= fgkMinPcX[iPc] && x <= fgkMaxPcX[iPc] && y >= fgkMinPcY[iPc] && y <= fgkMaxPcY[iPc]) { return kFALSE; //in current pc + } + } return kTRUE; } @@ -461,8 +473,9 @@ bool Param::IsDeadPad(Int_t padx, Int_t pady, Int_t ch) // Arguments: padx,pady pad integer coord // Returns: kTRUE if dead, kFALSE if active - if (fgMapPad[padx - 1][pady - 1][ch]) + if (fgMapPad[padx - 1][pady - 1][ch]) { return kFALSE; //current pad active + } return kTRUE; } @@ -481,8 +494,9 @@ void Param::Lors2Pad(float x, float y, Int_t& pc, Int_t& px, Int_t& py) pc = 1; px = Int_t((x - fgkMinPcX[1]) / SizePadX()); } //PC 1 or 3 or 5 - else + else { return; + } if (y > fgkMinPcY[0] && y < fgkMaxPcY[0]) { py = Int_t(y / SizePadY()); } //PC 0 or 1 @@ -494,8 +508,9 @@ void Param::Lors2Pad(float x, float y, Int_t& pc, Int_t& px, Int_t& py) pc += 4; py = Int_t((y - fgkMinPcY[4]) / SizePadY()); } //PC 4 or 5 - else + else { return; + } } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Int_t Param::InHVSector(float y) @@ -507,8 +522,9 @@ Int_t Param::InHVSector(float y) Int_t hvsec = -1; Int_t pc, px, py; Lors2Pad(1., y, pc, px, py); - if (py == -1) + if (py == -1) { return hvsec; + } hvsec = (py + (pc / 2) * (kMaxPy + 1)) / ((kMaxPy + 1) / 2); @@ -519,12 +535,15 @@ double Param::FindTemp(double tLow, double tHigh, double y) { // Model for gradient in temperature double yRad = HinRad(y); //height in a given radiator - if (tHigh < tLow) + if (tHigh < tLow) { tHigh = tLow; //if Tout < Tin consider just Tin as reference... - if (yRad < 0) + } + if (yRad < 0) { yRad = 0; //protection against fake y values - if (yRad > SizePcY()) + } + if (yRad > SizePcY()) { yRad = SizePcY(); //protection against fake y values + } double gradT = (tHigh - tLow) / SizePcY(); // linear gradient return gradT * yRad + tLow; @@ -589,13 +608,15 @@ void Param::PrintChStatus(Int_t ch) Printf(" --------- C H A M B E R %d ---------------", ch); for (Int_t pady = kMaxPcy; pady >= 0; pady--) { for (Int_t padx = 0; padx < kMaxPcx + 1; padx++) { - if (padx == 80) + if (padx == 80) { printf(" "); + } printf("%d", fgMapPad[padx][pady][ch]); } printf(" %d \n", pady + 1); - if (pady % 48 == 0) + if (pady % 48 == 0) { printf("\n"); + } } printf("\n"); } diff --git a/Detectors/HMPID/simulation/src/Detector.cxx b/Detectors/HMPID/simulation/src/Detector.cxx index 60ff9d033d970..89af501ba15cd 100644 --- a/Detectors/HMPID/simulation/src/Detector.cxx +++ b/Detectors/HMPID/simulation/src/Detector.cxx @@ -151,17 +151,19 @@ void Detector::GenFee(Float_t qtot) Double_t ranf[2]; fMC->GetRandom()->RndmArray(2, ranf); //Sample direction cthf = ranf[0] * 2 - 1.0; - if (cthf < 0) + if (cthf < 0) { continue; + } sthf = TMath::Sqrt((1. - cthf) * (1. + cthf)); phif = ranf[1] * 2 * TMath::Pi(); - if (Double_t randomNumber = fMC->GetRandom()->Rndm() <= 0.57) + if (Double_t randomNumber = fMC->GetRandom()->Rndm() <= 0.57) { enfp = 7.5e-9; - else if (randomNumber <= 0.7) + } else if (randomNumber <= 0.7) { enfp = 6.4e-9; - else + } else { enfp = 7.9e-9; + } dir[0] = sthf * TMath::Sin(phif); dir[1] = cthf; @@ -184,40 +186,49 @@ void Detector::GenFee(Float_t qtot) e3[2] = -dir[0]; vmod = 0; - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { vmod += e1[j] * e1[j]; - if (!vmod) + } + if (!vmod) { for (j = 0; j < 3; j++) { uswop = e1[j]; e1[j] = e3[j]; e3[j] = uswop; } + } vmod = 0; - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { vmod += e2[j] * e2[j]; - if (!vmod) + } + if (!vmod) { for (j = 0; j < 3; j++) { uswop = e2[j]; e2[j] = e3[j]; e3[j] = uswop; } + } vmod = 0; - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { vmod += e1[j] * e1[j]; + } vmod = TMath::Sqrt(1 / vmod); - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { e1[j] *= vmod; + } vmod = 0; - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { vmod += e2[j] * e2[j]; + } vmod = TMath::Sqrt(1 / vmod); - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { e2[j] *= vmod; + } phi = fMC->GetRandom()->Rndm() * 2 * TMath::Pi(); - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { pol[j] = e1[j] * TMath::Sin(phi) + e2[j] * TMath::Cos(phi); + } fMC->Gdtom(pol, pol, 2); Int_t outputNtracksStored; } //feedbacks loop @@ -242,8 +253,9 @@ Bool_t Detector::IsLostByFresnel() if (fMC->GetRandom()->Rndm() < Fresnel(p4.E() * 1e9, cotheta, 1)) { // AliDebug(1,"Photon lost"); return kTRUE; - } else + } else { return kFALSE; + } } //IsLostByFresnel() //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Float_t Detector::Fresnel(Float_t ene, Float_t pdoti, Bool_t pola) @@ -296,8 +308,9 @@ Float_t Detector::Fresnel(Float_t ene, Float_t pdoti, Bool_t pola) if (pola) { Float_t pdotr = 0.8; //DEGREE OF POLARIZATION : 1->P , -1->S fresn = 0.5 * (rp * (1 + pdotr) + rs * (1 - pdotr)); - } else + } else { fresn = 0.5 * (rp + rs); + } fresn = fresn * rO; return fresn; @@ -613,13 +626,16 @@ TGeoVolume* Detector::createChamber(int number) rad->AddNode(si1, 2, new TGeoTranslation(0 * mm, +204 * mm, -0.5 * mm)); rad->AddNode(si2, 1, new TGeoTranslation(-660 * mm, 0 * mm, -0.5 * mm)); rad->AddNode(si2, 2, new TGeoTranslation(+660 * mm, 0 * mm, -0.5 * mm)); - for (Int_t i = 0; i < 3; i++) - for (Int_t j = 0; j < 10; j++) + for (Int_t i = 0; i < 3; i++) { + for (Int_t j = 0; j < 10; j++) { rad->AddNode(spa, 10 * i + j, new TGeoTranslation(-1330 * mm / 2 + 116 * mm + j * 122 * mm, (i - 1) * 105 * mm, -0.5 * mm)); + } + } hmp->AddNode(fr4, 1, new TGeoTranslation(0 * mm, 0 * mm, 9.00 * mm)); // p.84 TDR - for (int i = 1; i <= 322; i++) + for (int i = 1; i <= 322; i++) { fr4->AddNode(col, i, new TGeoCombiTrans(0 * mm, -1296 / 2 * mm + i * 4 * mm, -5 * mm, rot)); // F4 2043P1 + } fr4->AddNode(f4a, 1, new TGeoTranslation(0 * mm, 0 * mm, 2.5 * mm)); f4a->AddNode(f4i, 1, new TGeoTranslation(0 * mm, 0 * mm, 0 * mm)); hmp->AddNode(sec, 4, new TGeoTranslation(-335 * mm, +433 * mm, 78.6 * mm)); @@ -1152,15 +1168,17 @@ TGeoVolume* Detector::CradleBaseVolume(TGeoMedium* med, Double_t l[7], const cha xtruOut->DefineSection(1, +l[4] / 2., 0., 0., 1.0); // 1= II plane z; Double_t tgalpha = 0; - if (xv[3] - xv[0] == 0) + if (xv[3] - xv[0] == 0) { tgalpha = 999999; - else + } else { tgalpha = l[2] / TMath::Abs(xv[3] - xv[0]); + } Double_t tgbeta = 0; - if (xv[2] - xv[1] == 0) + if (xv[2] - xv[1] == 0) { tgbeta = 999999; - else + } else { tgbeta = l[2] / TMath::Abs(xv[2] - xv[1]); + } xv[0] = xv[0] - l[5] / tgalpha; yv[0] = l[2] / 2 - l[5];