From f01b12658adedce5ee27d0847c6af1ccc4b95c77 Mon Sep 17 00:00:00 2001 From: Alexandru Bercuci <abercuci@niham.nipne.ro> Date: Thu, 11 May 2023 11:58:41 +0300 Subject: [PATCH] Apply clang-format --- core/detectors/trd/CbmTrdModuleAbstract.cxx | 5 +++-- core/detectors/trd/CbmTrdParFasp.cxx | 10 +++++----- core/detectors/trd/CbmTrdParFasp.h | 6 ++++-- core/detectors/trd/CbmTrdParSetAsic.cxx | 10 +++++----- core/detectors/trd/CbmTrdParSetAsic.h | 2 +- reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.cxx | 4 ++-- reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.h | 2 +- 7 files changed, 21 insertions(+), 18 deletions(-) diff --git a/core/detectors/trd/CbmTrdModuleAbstract.cxx b/core/detectors/trd/CbmTrdModuleAbstract.cxx index 63c7f1c182..9ba7513d73 100644 --- a/core/detectors/trd/CbmTrdModuleAbstract.cxx +++ b/core/detectors/trd/CbmTrdModuleAbstract.cxx @@ -3,9 +3,10 @@ Authors: Florian Uhlig [committer], Alexandru Bercuci */ #include "CbmTrdModuleAbstract.h" + #include "CbmTrdParAsic.h" -#include <Logger.h> +#include <Logger.h> //_______________________________________________________________________________ CbmTrdModuleAbstract::CbmTrdModuleAbstract() @@ -47,7 +48,7 @@ CbmTrdModuleAbstract::~CbmTrdModuleAbstract() bool CbmTrdModuleAbstract::IsChannelMasked(int ch) const { if (!fAsicPar) return false; - const CbmTrdParAsic *p = fAsicPar->GetAsicPar(ch); + const CbmTrdParAsic* p = fAsicPar->GetAsicPar(ch); if (!p) return false; return p->IsChannelMasked(ch); } diff --git a/core/detectors/trd/CbmTrdParFasp.cxx b/core/detectors/trd/CbmTrdParFasp.cxx index 609e845a06..2889db58d2 100644 --- a/core/detectors/trd/CbmTrdParFasp.cxx +++ b/core/detectors/trd/CbmTrdParFasp.cxx @@ -78,7 +78,7 @@ void CbmTrdParFasp::LoadParams(int* valArray) for (Int_t ich(0); ich < NFASPCH; ich++) { int chAddress = valArray[offset++]; SetChannelAddress(abs(chAddress)); - fCalib[ich].SetPairing(bool(chAddress>0)); + fCalib[ich].SetPairing(bool(chAddress > 0)); } for (Int_t ich(0); ich < NFASPCH; ich++) { fCalib[ich].fPileUpTime = valArray[offset++]; @@ -118,7 +118,7 @@ Bool_t CbmTrdParFasp::SetCalibParameters(Int_t ch, Double_t const* par) void CbmTrdParFasp::SetChannelMask(uint32_t mask) { for (Int_t ich(0); ich < NFASPCH; ich++) { - bool on = !bool((mask>>ich)&0x1); + bool on = !bool((mask >> ich) & 0x1); fCalib[ich].SetMask(on); } } @@ -128,7 +128,7 @@ uint32_t CbmTrdParFasp::GetChannelMask() const { uint32_t mask(0); for (Int_t ich(0); ich < NFASPCH; ich++) { - if(!fCalib[ich].IsMasked()) mask |= 0x1; + if (!fCalib[ich].IsMasked()) mask |= 0x1; mask <<= 1; } return mask; @@ -160,8 +160,8 @@ CbmTrdParFaspChannel::CbmTrdParFaspChannel(Int_t pup, Int_t ft, Int_t thr, Int_t //___________________________________________________________________ void CbmTrdParFaspChannel::Print(Option_t* /*opt*/) const { - printf("[%c]; MASK{%c}; CALIB{ PUT[ns]=%3d FT[clk]=%2d THR[ADC]=%4d MDS[ADC]=%4d }\n", (HasPairingR() ? 'R' : 'T'), (IsMasked() ? 'X' : ' '), - fPileUpTime, fFlatTop, fThreshold, fMinDelaySignal); + printf("[%c]; MASK{%c}; CALIB{ PUT[ns]=%3d FT[clk]=%2d THR[ADC]=%4d MDS[ADC]=%4d }\n", (HasPairingR() ? 'R' : 'T'), + (IsMasked() ? 'X' : ' '), fPileUpTime, fFlatTop, fThreshold, fMinDelaySignal); } ClassImp(CbmTrdParFasp); diff --git a/core/detectors/trd/CbmTrdParFasp.h b/core/detectors/trd/CbmTrdParFasp.h index 1734d3c778..982f429950 100644 --- a/core/detectors/trd/CbmTrdParFasp.h +++ b/core/detectors/trd/CbmTrdParFasp.h @@ -11,7 +11,7 @@ #define NFASPCH 16 // The size of the parameter translation is calculated as follows: // size = detId + chMask + NFASPCH*(chAddress + pileUp + threshold + delay) -#define NFASPPARS 2 + 4 * NFASPCH +#define NFASPPARS 2 + 4 * NFASPCH #define FASP_EPOCH_LENGTH 128 @@ -36,7 +36,8 @@ public: enum CbmTrdParFaspChannelDef { kPair = 0 //< pad pairing type definition see SetPairing() - ,kMask = 1 //< pad masking. See SetMask() + , + kMask = 1 //< pad masking. See SetMask() }; /** \brief Parametrization of a FASP channel based on CADENCE simulations from 12.01.2018 and * parabolic parametrization of dt(signal). @@ -106,6 +107,7 @@ public: */ virtual Bool_t SetCalibParameters(Int_t ch, Double_t const* par); virtual void SetChannelMask(uint32_t mask); + private: static Double_t fgSizeX; ///< FASP half size in x [cm] static Double_t fgSizeY; ///< FASP half size in y [cm] diff --git a/core/detectors/trd/CbmTrdParSetAsic.cxx b/core/detectors/trd/CbmTrdParSetAsic.cxx index 29884ffe4e..b64098723c 100644 --- a/core/detectors/trd/CbmTrdParSetAsic.cxx +++ b/core/detectors/trd/CbmTrdParSetAsic.cxx @@ -83,7 +83,7 @@ Bool_t CbmTrdParSetAsic::getParams(FairParamList* l) new CbmTrdParSetAsic(GetName(), Form("%s for Module %d", GetTitle(), moduleId[i]) /*, GetContext()*/); // only for FASP if (9 == typeAsic[i]) { - Int_t maxValues = maxNrAsics * (NFASPPARS); + Int_t maxValues = maxNrAsics * (NFASPPARS); TArrayI values(maxValues); if (!l->fill(Form("FaspInfo - Module %d", moduleId[i]), &values)) continue; for (Int_t iasic = 0; iasic < nAsic[i]; iasic++) { @@ -94,7 +94,7 @@ Bool_t CbmTrdParSetAsic::getParams(FairParamList* l) static_cast<CbmTrdParFasp*>(asic)->LoadParams(&(values.GetArray()[offset])); fModPar[moduleId[i]]->SetAsicPar(address, asic); } - fModPar[moduleId[i]]->SetAsicType((int)CbmTrdDigi::eCbmTrdAsicType::kFASP); + fModPar[moduleId[i]]->SetAsicType((int) CbmTrdDigi::eCbmTrdAsicType::kFASP); } else { Int_t maxValues = maxNrAsics * (5 + NSPADICCH); @@ -114,7 +114,7 @@ Bool_t CbmTrdParSetAsic::getParams(FairParamList* l) asic->SetChannelAddresses(addresses); fModPar[moduleId[i]]->SetAsicPar(address, asic); } - fModPar[moduleId[i]]->SetAsicType((int)CbmTrdDigi::eCbmTrdAsicType::kSPADIC); + fModPar[moduleId[i]]->SetAsicType((int) CbmTrdDigi::eCbmTrdAsicType::kSPADIC); } } return kTRUE; @@ -180,7 +180,7 @@ void CbmTrdParSetAsic::putParams(FairParamList* l) l->add(Form("SpadicInfo - Module %d", moduleId[i]), asicInfo); } if (mod->fModuleMap.begin()->second->IsA() == CbmTrdParFasp::Class()) { - Int_t fullSize = nAsic[i] * NFASPPARS; + Int_t fullSize = nAsic[i] * NFASPPARS; TArrayI asicInfo(fullSize); iAsicNr = 0; @@ -192,7 +192,7 @@ void CbmTrdParSetAsic::putParams(FairParamList* l) asicInfo[offset++] = fasp->GetChannelMask(); Int_t ich(0); for (auto chAddress : fasp->GetChannelAddresses()) { - asicInfo[offset + ich] = chAddress; + asicInfo[offset + ich] = chAddress; const CbmTrdParFaspChannel* ch = fasp->GetChannel(ich); if (!ch) { LOG(info) << "Missing calib for Fasp[" << offset << "] pad " << chAddress; diff --git a/core/detectors/trd/CbmTrdParSetAsic.h b/core/detectors/trd/CbmTrdParSetAsic.h index 3efa40c456..b2ad65cdd7 100644 --- a/core/detectors/trd/CbmTrdParSetAsic.h +++ b/core/detectors/trd/CbmTrdParSetAsic.h @@ -57,7 +57,7 @@ public: * \param module ASICs par (FASP or SPADIC) */ void putParams(FairParamList*); - + /** \brief Query the ASICs in the module for their DAQ address. * It applies to the list of ASICs. * Returns the list of id of the ASICs within the module. diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.cxx b/reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.cxx index d74a5409f5..b272233fd2 100644 --- a/reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.cxx +++ b/reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.cxx @@ -115,7 +115,7 @@ Bool_t CbmTrdUnpackFaspMonitor::Init() } //_________________________________________________________________________________ -void CbmTrdUnpackFaspMonitor::MapMaskedChannels(const CbmTrdParSetAsic *par) +void CbmTrdUnpackFaspMonitor::MapMaskedChannels(const CbmTrdParSetAsic* par) { int ncol(-1), modAddress(-1); std::shared_ptr<TH1> histo = nullptr; @@ -126,7 +126,7 @@ void CbmTrdUnpackFaspMonitor::MapMaskedChannels(const CbmTrdParSetAsic *par) CbmTrdParFasp* fasp = (CbmTrdParFasp*) par->GetModulePar(address); if (modAddress != address / 1000) { - modAddress = address / 1000; + modAddress = address / 1000; auto modpair = fDigiHistoMap[eDigiHistos::kMap_St]; if (modpair.find(modAddress) == modpair.end()) continue; if (!(histo = modpair[modAddress])) continue; diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.h b/reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.h index 80fa9297f4..ca6e7507bf 100644 --- a/reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.h +++ b/reco/detectors/trd/unpack/CbmTrdUnpackFaspMonitor.h @@ -71,7 +71,7 @@ public: Bool_t Init(); /** @brief Special call for monitoring the masked channel map*/ - void MapMaskedChannels(const CbmTrdParSetAsic *asics); + void MapMaskedChannels(const CbmTrdParSetAsic* asics); /** @brief transfer the enums for the histos to be activated to the member vector */ void SetActiveHistos(std::vector<eDigiHistos> vec) { fActiveDigiHistos.swap(vec); } -- GitLab