From 5440683bd3c9d7ef806525a0cbd605c90efbf2c3 Mon Sep 17 00:00:00 2001 From: googol23nphy <googol23nphy@gmail.com> Date: Fri, 12 May 2023 14:44:51 +0200 Subject: [PATCH] CLAG formatting --- core/detectors/sts/CbmStsParAsic.h | 11 ++--- macro/run/run_unpack_tsa.C | 46 +++++++++---------- .../detectors/sts/unpack/CbmStsUnpackAlgo.cxx | 2 +- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/core/detectors/sts/CbmStsParAsic.h b/core/detectors/sts/CbmStsParAsic.h index ae2a37c7ff..6815acc241 100644 --- a/core/detectors/sts/CbmStsParAsic.h +++ b/core/detectors/sts/CbmStsParAsic.h @@ -206,14 +206,9 @@ private: double fNoise = 0.; ///< RMS of noise [e] double fZeroNoiseRate = 0.; ///< Zero-crossing noise rate [1/ns] double fTimeOffset = 0.; ///< Time offset [ns] - std::array<double, 32> fWalkCoef = {{0., 0., 0., 0., ///< Parameters for correction of walk effect - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0.}}; + std::array<double, 32> fWalkCoef = {{0., 0., 0., 0., ///< Parameters for correction of walk effect + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}}; std::set<uint16_t> fDeadChannels {}; ///< Map of dead channels bool fIsInit = kFALSE; //! Flag for being initialised diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C index cc851a2500..a7419c6d69 100644 --- a/macro/run/run_unpack_tsa.C +++ b/macro/run/run_unpack_tsa.C @@ -168,31 +168,26 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid } // Noise removal - stsconfig->SetMinAdcCut(1, 1); // ADC cut to Station 0 Ladder 0 Module 0 - stsconfig->SetMinAdcCut(2, 1); // ADC cut to Station 0 Ladder 0 Module 0 - stsconfig->SetMinAdcCut(3, 1); // ADC cut to Station 0 Ladder 0 Module 1 - stsconfig->SetMinAdcCut(4, 1); // ADC cut to Station 0 Ladder 0 Module 1 + stsconfig->SetMinAdcCut(1, 1); // ADC cut to Station 0 Ladder 0 Module 0 + stsconfig->SetMinAdcCut(2, 1); // ADC cut to Station 0 Ladder 0 Module 0 + stsconfig->SetMinAdcCut(3, 1); // ADC cut to Station 0 Ladder 0 Module 1 + stsconfig->SetMinAdcCut(4, 1); // ADC cut to Station 0 Ladder 0 Module 1 // Masking noisy channels std::ifstream mask_channels(Form("%s/sts_mask_channels.par", parfilesbasepathSts.data())); int feb_idx, feb_chn; - while (mask_channels >> feb_idx >> feb_chn){ + while (mask_channels >> feb_idx >> feb_chn) { stsconfig->MaskNoisyChannel(feb_idx, feb_chn); } // Time Walk correction std::map<uint32_t, CbmStsParModule> moduleWalkMap; - auto parAsic = new CbmStsParAsic(128, 31, 31., 1., 5., 800., 1000., 3.9789e-3); // Default ASIC parameters - auto parMod = new CbmStsParModule(2048, 128); // Generic STS module parameter object - - std::array<double, 32> tw_map = {{0., 0., 0., 0., // Default time walk map - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0., - 0., 0., 0., 0.}}; + auto parAsic = new CbmStsParAsic(128, 31, 31., 1., 5., 800., 1000., 3.9789e-3); // Default ASIC parameters + auto parMod = new CbmStsParModule(2048, 128); // Generic STS module parameter object + + std::array<double, 32> tw_map = {{0., 0., 0., 0., // Default time walk map + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}}; parAsic->SetWalkCoef(tw_map); // Set generic ASIC par with no time walk correction parMod->SetAllAsics(*parAsic); // Set generic module ASIC as default ASIC parameter configuration @@ -204,18 +199,19 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid std::ifstream asicTimeWalk_par(Form("%s/mStsAsicTimeWalk.par", parfilesbasepathSts.data())); while (asicTimeWalk_par >> std::hex >> sensor >> std::dec >> asic) { // Read module and ASIC LOG(info) << Form("[STS] Reading %x %u", sensor, asic); - for (int adc = 0; adc < 31; adc++){ // Read time offset by ADC - asicTimeWalk_par >> tw_map[adc]; // Set time walk map offset value for given ADC - if (std::fabs(tw_map[adc]) > 100){ - LOG(warning) << "[STS] Very large time walk parameter"; // Large offset values could indicate par file malformation + for (int adc = 0; adc < 31; adc++) { // Read time offset by ADC + asicTimeWalk_par >> tw_map[adc]; // Set time walk map offset value for given ADC + if (std::fabs(tw_map[adc]) > 100) { + LOG(warning) + << "[STS] Very large time walk parameter"; // Large offset values could indicate par file malformation } - } // end ASIC idx loop - parAsic->SetWalkCoef(tw_map); // Set time walk map for the ASIC par obj + } // end ASIC idx loop + parAsic->SetWalkCoef(tw_map); // Set time walk map for the ASIC par obj - if (!moduleWalkMap.count(sensor)) { // No parameters obj for given module - moduleWalkMap[sensor] = CbmStsParModule(*parMod); // Create CbmStsParModule obj for the loaded module + if (!moduleWalkMap.count(sensor)) { // No parameters obj for given module + moduleWalkMap[sensor] = CbmStsParModule(*parMod); // Create CbmStsParModule obj for the loaded module } - moduleWalkMap[sensor].SetAsic(asic, *parAsic); // Set ASIC parameter + moduleWalkMap[sensor].SetAsic(asic, *parAsic); // Set ASIC parameter LOG(info) << Form("\n[STS] Time Walk parameters loaded for: module %x, ASIC %u\n", sensor, asic); } diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx index a3c509914a..031f5f1030 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx @@ -516,7 +516,7 @@ void CbmStsUnpackAlgo::processHitInfo(const stsxyter::Message& mess) // Time-Walk correction or Asic-byAsic offsetting, depending on availability if (fbUseTimeWalkCorrection == true && fWalkLookup.count(fviFebAddress[uFebIdx])) { - dTimeInNs += fWalkLookup[fviFebAddress[uFebIdx]][uChanInMod / fNrChsPerAsic][usRawAdc-1]; + dTimeInNs += fWalkLookup[fviFebAddress[uFebIdx]][uChanInMod / fNrChsPerAsic][usRawAdc - 1]; } else if (uAsicIdx < fvdTimeOffsetNsAsics.size()) { dTimeInNs -= fvdTimeOffsetNsAsics[uAsicIdx]; -- GitLab