diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C index e54cb426b3076683dd08fd2b7289706be7c187fe..33929425a6ab8bf62b00f0cdb0202ac796bc60db 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 d75320f09512cb2915db299e7aa12aab8c27ece6..f356f08b47074448a2369c220890adeda6d991b0 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 01488c6b599842885946bcd1b320ff727440cfab..a2b816c1f3ed3fd91702190eef02feda63fcd6b0 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 a40bcfd6d9e5e8551f37809a48189f0615bcfd85..8869788fe3e18fea86d47b09f5f30477803f2426 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 0dc96ec9de4a13beaa9c70f678f14e6f5b995ae1..13f62319962eda6a5d6319410084aa677d055104 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) };