From 1a5984a6aed910640213d94c76a55b4bcca45d9a Mon Sep 17 00:00:00 2001 From: Vikas Singhal <vsinghal@gsi.de> Date: Thu, 4 May 2023 13:13:47 +0530 Subject: [PATCH] Apply clang-format --- macro/run/run_unpack_tsa.C | 2 +- .../much/unpack/CbmMuchUnpackAlgo.cxx | 34 +++++++++---------- .../detectors/much/unpack/CbmMuchUnpackAlgo.h | 8 ++--- .../much/unpack/CbmMuchUnpackConfig.cxx | 13 ++++--- .../much/unpack/CbmMuchUnpackConfig.h | 8 ++--- 5 files changed, 31 insertions(+), 34 deletions(-) diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C index e54cb426b3..33929425a6 100644 --- a/macro/run/run_unpack_tsa.C +++ b/macro/run/run_unpack_tsa.C @@ -273,7 +273,7 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid // muchconfig->MaskNoisyChannel(3, 56); //List of noisy channels *.txt file based on CbmMuchAddress is placed at the same location as par files // - std::string NoisyChannelFilePath = parfilesbasepathMuch + "mMuChNoisyChannelMarch2022.txt"; + std::string NoisyChannelFilePath = parfilesbasepathMuch + "mMuChNoisyChannelMarch2022.txt"; LOG(info) << "Noisy Channel File Name : " << NoisyChannelFilePath; muchconfig->SetNoisyChannelFile(NoisyChannelFilePath); } diff --git a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx index d75320f095..f356f08b47 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx +++ b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx @@ -65,14 +65,14 @@ uint64_t CbmMuchUnpackAlgo::getFullTimeStamp(const uint16_t usRawTs) } // ---- init -Bool_t CbmMuchUnpackAlgo::init() { - LOG(debug) << " Below are the list of addresses of noisy channels "; - for (auto it = fInactiveChannels.begin(); it != - fInactiveChannels.end(); ++it) - LOG(debug) << " " << *it; - - return kTRUE; - } +Bool_t CbmMuchUnpackAlgo::init() +{ + LOG(debug) << " Below are the list of addresses of noisy channels "; + for (auto it = fInactiveChannels.begin(); it != fInactiveChannels.end(); ++it) + LOG(debug) << " " << *it; + + return kTRUE; +} // ---- initDpbIdIndexMap ---- void CbmMuchUnpackAlgo::initDpbIdIndexMap(CbmMuchUnpackPar* parset) @@ -363,7 +363,6 @@ void CbmMuchUnpackAlgo::loopMsMessages(const uint8_t* msContent, const uint32_t } } } - } // ---- MaskNoisyChannel ---- @@ -540,16 +539,15 @@ void CbmMuchUnpackAlgo::processHitInfo(const stsxyter::Message& mess) if (usChan > 127) LOG(debug) << "ERROR !!! Channel in hit message is out of range " << usChan; // uFebIdx is FEB position in the GEM and RPC const uint32_t address = CreateMuchAddress(fuCurrDpbIdx, uFebIdx, usChan); - + // Masking Noisy Channel. If Address is part of Inactive Channel List if (fInactiveChannels.count(address)) { - //Counting number of hits fall on noisy channel - fMaskedNoisyHitsFromCbmMuchAddress++; - return; - } - - - + //Counting number of hits fall on noisy channel + fMaskedNoisyHitsFromCbmMuchAddress++; + return; + } + + //const uint32_t address = CreateMuchAddress(fuCurrDpbIdx, uFebIdx, uChanInFeb); LOG(debug) << "Created Much Address = " << address << " from fuCurrDpbIdx " << fuCurrDpbIdx << " Feb Id " << uFebIdx << " Channnel Id " << uChanInFeb; @@ -997,7 +995,7 @@ bool CbmMuchUnpackAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp, U fMonitor->FillVectorSize(ts->index(), fOutputVec.size()); //fMonitor->DrawCanvases(); } - + std::cout << "Total Number of Masked Addresses " << fMaskedNoisyHitsFromCbmMuchAddress << std::endl; return true; } diff --git a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.h b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.h index 01488c6b59..a2b816c1f3 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.h +++ b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.h @@ -34,8 +34,8 @@ #include <cstddef> #include <cstdint> #include <memory> -#include <utility> #include <set> +#include <utility> class CbmMuchUnpackAlgo : public CbmRecoUnpackAlgo<CbmMuchDigi, CbmMuchDigi, CbmErrorMessage> { public: @@ -102,7 +102,7 @@ public: */ void SetParFileName(std::string sNewName) { fParFileName = sNewName; } - void SetInactiveChannel(uint32_t channel){ fInactiveChannels.insert(channel);} + void SetInactiveChannel(uint32_t channel) { fInactiveChannels.insert(channel); } protected: /** @@ -333,8 +333,8 @@ protected: /** @brief Current µSlice time */ uint64_t fMsStartTime = 0; - std::set<uint32_t> fInactiveChannels = {}; - + std::set<uint32_t> fInactiveChannels = {}; + uint64_t fMaskedNoisyHitsFromCbmMuchAddress = 0; private: diff --git a/reco/detectors/much/unpack/CbmMuchUnpackConfig.cxx b/reco/detectors/much/unpack/CbmMuchUnpackConfig.cxx index a40bcfd6d9..8869788fe3 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackConfig.cxx +++ b/reco/detectors/much/unpack/CbmMuchUnpackConfig.cxx @@ -37,7 +37,7 @@ void CbmMuchUnpackConfig::InitAlgo() // Set the flags for duplicate digis rejections fAlgo->SetDuplicatesRejection(fbRejectDuplicateDigis, fbDupliWithoutAdc); - + // --- Read list of inactive channels if (!fInactiveChannelFileName.IsNull()) { LOG(info) << GetName() << ": Reading inactive channels from " << fInactiveChannelFileName; @@ -47,7 +47,7 @@ void CbmMuchUnpackConfig::InitAlgo() return; } //LOG(info) << GetName() << ": " << std::get<0>(result) << " lines read from file, " << fInactiveChannels.size() - // << " channels set inactive"; + // << " channels set inactive"; } @@ -59,7 +59,6 @@ void CbmMuchUnpackConfig::InitAlgo() // Mask the noisy channels set by the user for (auto chmask : fvChanMasks) fAlgo->MaskNoisyChannel(chmask.uFeb, chmask.uChan, chmask.bMasked); - } // ---- chooseAlgo ---- @@ -87,12 +86,12 @@ std::shared_ptr<CbmMuchUnpackAlgo> CbmMuchUnpackConfig::chooseAlgo() // ----- Read list of inactive channels --------------------------------- std::pair<size_t, bool> CbmMuchUnpackConfig::ReadInactiveChannels() { - + if (fInactiveChannelFileName.IsNull()) return std::make_pair(0, true); - + FILE* channelFile = fopen(fInactiveChannelFileName.Data(), "r"); if (channelFile == nullptr) return std::make_pair(0, false); - + size_t nLines = 0; uint32_t channel = 0; while (fscanf(channelFile, "%u", &channel) == 1) { @@ -100,7 +99,7 @@ std::pair<size_t, bool> CbmMuchUnpackConfig::ReadInactiveChannels() nLines++; } bool success = feof(channelFile); - + fclose(channelFile); LOG(info) << " Number of Noisy Channels in CbmAddress Format : " << nLines; return std::make_pair(nLines, success); diff --git a/reco/detectors/much/unpack/CbmMuchUnpackConfig.h b/reco/detectors/much/unpack/CbmMuchUnpackConfig.h index 0dc96ec9de..13f6231996 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackConfig.h +++ b/reco/detectors/much/unpack/CbmMuchUnpackConfig.h @@ -73,11 +73,11 @@ public: { fvChanMasks.emplace_back(FebChanMaskReco {uFeb, uChan, bMasked}); } - + /** * @brief Read Inactive Channel list based on CbmMuchAddress from a file. */ - + virtual std::pair<size_t, bool> ReadInactiveChannels(); // Setters @@ -149,8 +149,8 @@ protected: /// Parameter file name std::string fsParFileName = "mMuchPar.par"; - TString fInactiveChannelFileName = ""; - + TString fInactiveChannelFileName = ""; + private: ClassDef(CbmMuchUnpackConfig, 2) }; -- GitLab