diff --git a/core/detectors/sts/CbmStsParAsic.h b/core/detectors/sts/CbmStsParAsic.h index ae2a37c7ff3773b1ba5015baa1e967f9129c928f..6815acc24132085777dd13fe1a41d7d2b536f2cd 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 cc851a250061bffbbe1990c9e3a0178735acfbb7..a7419c6d6973a8c5a32b5429e737a3443522b79c 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 a3c509914afc9faf0a5c79b1eea1b62610d83daa..031f5f10307fc2f3bbd0e5ba7fae04326c4f4fb1 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];