From 6de6fb1d3faed829a677f5abc9b09f0369b55b94 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Sun, 18 Aug 2024 21:19:12 +0200 Subject: [PATCH 1/5] fix typo --- src/TRestRawAFTERToSignalProcess.cxx | 2 +- src/TRestRawBaseLineCorrectionProcess.cxx | 2 +- src/TRestRawBiPoToSignalProcess.cxx | 2 +- src/TRestRawCommonNoiseReductionProcess.cxx | 2 +- src/TRestRawDAQMetadata.cxx | 2 +- src/TRestRawFEUDreamToSignalProcess.cxx | 2 +- src/TRestRawFindResponseSignalProcess.cxx | 2 +- src/TRestRawMemoryBufferToSignalProcess.cxx | 2 +- src/TRestRawMultiCoBoAsAdToSignalProcess.cxx | 2 +- src/TRestRawMultiFEMINOSToSignalProcess.cxx | 7 ++++--- src/TRestRawSignal.cxx | 2 +- src/TRestRawSignalAddNoiseProcess.cxx | 2 +- src/TRestRawSignalAnalysisProcess.cxx | 2 +- src/TRestRawSignalChannelActivityProcess.cxx | 2 +- src/TRestRawSignalConvolutionFittingProcess.cxx | 2 +- src/TRestRawSignalEvent.cxx | 2 +- src/TRestRawSignalGeneralFitProcess.cxx | 2 +- src/TRestRawSignalRemoveChannelsProcess.cxx | 2 +- src/TRestRawSignalShapingProcess.cxx | 2 +- src/TRestRawSignalViewerProcess.cxx | 2 +- src/TRestRawToSignalProcess.cxx | 2 +- src/TRestRawUSTCToSignalProcess.cxx | 2 +- 22 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/TRestRawAFTERToSignalProcess.cxx b/src/TRestRawAFTERToSignalProcess.cxx index 94f806a2..cb0c8926 100644 --- a/src/TRestRawAFTERToSignalProcess.cxx +++ b/src/TRestRawAFTERToSignalProcess.cxx @@ -31,7 +31,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This documentation +/// \warning **⚠ REST is under continuous development.** This documentation /// is offered to you by the REST community. Your HELP is needed to keep this code /// up to date. Your feedback will be worth to support this software, please report /// any problems/suggestions you may find while using it at [The REST Framework diff --git a/src/TRestRawBaseLineCorrectionProcess.cxx b/src/TRestRawBaseLineCorrectionProcess.cxx index 737bb1e2..d945a4db 100644 --- a/src/TRestRawBaseLineCorrectionProcess.cxx +++ b/src/TRestRawBaseLineCorrectionProcess.cxx @@ -42,7 +42,7 @@ /// ![A raw signal with and without TRestBaseLineCorrectionProcess with smoothing window size /// 75](doc_TRestRawBaseLineCorrectionProcess2.png)
/// -/// \warning **⚠ REST is under continous development.** This documentation +/// \warning **⚠ REST is under continuous development.** This documentation /// is offered to you by the REST community. Your HELP is needed to keep this code /// up to date. Your feedback will be worth to support this software, please report /// any problems/suggestions you may find while using it at [The REST Framework diff --git a/src/TRestRawBiPoToSignalProcess.cxx b/src/TRestRawBiPoToSignalProcess.cxx index cec29271..827e7d75 100644 --- a/src/TRestRawBiPoToSignalProcess.cxx +++ b/src/TRestRawBiPoToSignalProcess.cxx @@ -54,7 +54,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This documentation +/// \warning **⚠ REST is under continuous development.** This documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code up to date. Your feedback will be worth to support this software, please /// report any problems/suggestions you may find will using it at [The REST Framework diff --git a/src/TRestRawCommonNoiseReductionProcess.cxx b/src/TRestRawCommonNoiseReductionProcess.cxx index 5120f7d9..17c56fc0 100644 --- a/src/TRestRawCommonNoiseReductionProcess.cxx +++ b/src/TRestRawCommonNoiseReductionProcess.cxx @@ -51,7 +51,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawDAQMetadata.cxx b/src/TRestRawDAQMetadata.cxx index fd650dbd..97dadaae 100644 --- a/src/TRestRawDAQMetadata.cxx +++ b/src/TRestRawDAQMetadata.cxx @@ -28,7 +28,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawFEUDreamToSignalProcess.cxx b/src/TRestRawFEUDreamToSignalProcess.cxx index 3027411b..f312a565 100644 --- a/src/TRestRawFEUDreamToSignalProcess.cxx +++ b/src/TRestRawFEUDreamToSignalProcess.cxx @@ -36,7 +36,7 @@ // //
// -// \warning **⚠ REST is under continous development.** This +// \warning **⚠ REST is under continuous development.** This // documentation // is offered to you by the REST community. Your HELP is needed to keep this // code diff --git a/src/TRestRawFindResponseSignalProcess.cxx b/src/TRestRawFindResponseSignalProcess.cxx index f2d370fe..7a6bc6c5 100644 --- a/src/TRestRawFindResponseSignalProcess.cxx +++ b/src/TRestRawFindResponseSignalProcess.cxx @@ -36,7 +36,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawMemoryBufferToSignalProcess.cxx b/src/TRestRawMemoryBufferToSignalProcess.cxx index cb989cbb..3dd987b6 100644 --- a/src/TRestRawMemoryBufferToSignalProcess.cxx +++ b/src/TRestRawMemoryBufferToSignalProcess.cxx @@ -76,7 +76,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawMultiCoBoAsAdToSignalProcess.cxx b/src/TRestRawMultiCoBoAsAdToSignalProcess.cxx index 451d9d07..d274a1a7 100644 --- a/src/TRestRawMultiCoBoAsAdToSignalProcess.cxx +++ b/src/TRestRawMultiCoBoAsAdToSignalProcess.cxx @@ -28,7 +28,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawMultiFEMINOSToSignalProcess.cxx b/src/TRestRawMultiFEMINOSToSignalProcess.cxx index 35820d46..d0c689e3 100644 --- a/src/TRestRawMultiFEMINOSToSignalProcess.cxx +++ b/src/TRestRawMultiFEMINOSToSignalProcess.cxx @@ -33,7 +33,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code @@ -276,10 +276,11 @@ void TRestRawMultiFEMINOSToSignalProcess::InitProcess() { } TRestEvent* TRestRawMultiFEMINOSToSignalProcess::ProcessEvent(TRestEvent* inputEvent) { - if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) + if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) { cout << "TRestRawMultiFEMINOSToSignalProcess::ProcessEvent" << endl; + } - while (1) { + while (true) { unsigned short* sh; sh = (unsigned short*)&(cur_fr[2]); unsigned int nb_sh; diff --git a/src/TRestRawSignal.cxx b/src/TRestRawSignal.cxx index 44111823..67f667bb 100644 --- a/src/TRestRawSignal.cxx +++ b/src/TRestRawSignal.cxx @@ -27,7 +27,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawSignalAddNoiseProcess.cxx b/src/TRestRawSignalAddNoiseProcess.cxx index d79232fa..bc2db9c2 100644 --- a/src/TRestRawSignalAddNoiseProcess.cxx +++ b/src/TRestRawSignalAddNoiseProcess.cxx @@ -44,7 +44,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This documentation +/// \warning **⚠ REST is under continuous development.** This documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code up to date. Your feedback will be worth to support this software, please /// report any problems/suggestions you may find will using it at [The REST Framework diff --git a/src/TRestRawSignalAnalysisProcess.cxx b/src/TRestRawSignalAnalysisProcess.cxx index cc8127b8..69a03e26 100644 --- a/src/TRestRawSignalAnalysisProcess.cxx +++ b/src/TRestRawSignalAnalysisProcess.cxx @@ -217,7 +217,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawSignalChannelActivityProcess.cxx b/src/TRestRawSignalChannelActivityProcess.cxx index 256960ac..8b4673c8 100644 --- a/src/TRestRawSignalChannelActivityProcess.cxx +++ b/src/TRestRawSignalChannelActivityProcess.cxx @@ -68,7 +68,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawSignalConvolutionFittingProcess.cxx b/src/TRestRawSignalConvolutionFittingProcess.cxx index 261dff10..8dc78eb2 100644 --- a/src/TRestRawSignalConvolutionFittingProcess.cxx +++ b/src/TRestRawSignalConvolutionFittingProcess.cxx @@ -79,7 +79,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawSignalEvent.cxx b/src/TRestRawSignalEvent.cxx index e44eeedb..a679757d 100644 --- a/src/TRestRawSignalEvent.cxx +++ b/src/TRestRawSignalEvent.cxx @@ -32,7 +32,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawSignalGeneralFitProcess.cxx b/src/TRestRawSignalGeneralFitProcess.cxx index ad5afc1f..5768b77b 100644 --- a/src/TRestRawSignalGeneralFitProcess.cxx +++ b/src/TRestRawSignalGeneralFitProcess.cxx @@ -35,7 +35,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This documentation +/// \warning **⚠ REST is under continuous development.** This documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code up to date. Your feedback will be worth to support this software, please /// report any problems/suggestions you may find while using it at [The REST Framework diff --git a/src/TRestRawSignalRemoveChannelsProcess.cxx b/src/TRestRawSignalRemoveChannelsProcess.cxx index 363c1d35..04908058 100644 --- a/src/TRestRawSignalRemoveChannelsProcess.cxx +++ b/src/TRestRawSignalRemoveChannelsProcess.cxx @@ -43,7 +43,7 @@ /// ///
/// -/// \warning ** REST is under continous development.** This documentation +/// \warning ** REST is under continuous development.** This documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code up to date. Your feedback will be worth to support this software, please /// report any problems/suggestions you may find while using it at [The REST Framework diff --git a/src/TRestRawSignalShapingProcess.cxx b/src/TRestRawSignalShapingProcess.cxx index b6a2d87b..eca705e9 100644 --- a/src/TRestRawSignalShapingProcess.cxx +++ b/src/TRestRawSignalShapingProcess.cxx @@ -48,7 +48,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawSignalViewerProcess.cxx b/src/TRestRawSignalViewerProcess.cxx index 5705e341..56a8f708 100644 --- a/src/TRestRawSignalViewerProcess.cxx +++ b/src/TRestRawSignalViewerProcess.cxx @@ -26,7 +26,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawToSignalProcess.cxx b/src/TRestRawToSignalProcess.cxx index 4f91fa56..3f8a5354 100644 --- a/src/TRestRawToSignalProcess.cxx +++ b/src/TRestRawToSignalProcess.cxx @@ -28,7 +28,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code diff --git a/src/TRestRawUSTCToSignalProcess.cxx b/src/TRestRawUSTCToSignalProcess.cxx index b2d17a04..98b86cf9 100644 --- a/src/TRestRawUSTCToSignalProcess.cxx +++ b/src/TRestRawUSTCToSignalProcess.cxx @@ -28,7 +28,7 @@ /// ///
/// -/// \warning **⚠ REST is under continous development.** This +/// \warning **⚠ REST is under continuous development.** This /// documentation /// is offered to you by the REST community. Your HELP is needed to keep this /// code From d5b367dd389d568b50476e178a4a7e2fcacd7fc3 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 19 Aug 2024 00:53:51 +0200 Subject: [PATCH 2/5] TRestRawFeminosRootToSignalProcess --- inc/TRestRawFeminosRootToSignalProcess.h | 70 ++++++++++ src/TRestRawFeminosRootToSignalProcess.cxx | 148 +++++++++++++++++++++ 2 files changed, 218 insertions(+) create mode 100644 inc/TRestRawFeminosRootToSignalProcess.h create mode 100644 src/TRestRawFeminosRootToSignalProcess.cxx diff --git a/inc/TRestRawFeminosRootToSignalProcess.h b/inc/TRestRawFeminosRootToSignalProcess.h new file mode 100644 index 00000000..d33f370d --- /dev/null +++ b/inc/TRestRawFeminosRootToSignalProcess.h @@ -0,0 +1,70 @@ +/************************************************************************* + * This file is part of the REST software framework. * + * * + * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) * + * For more information see http://gifna.unizar.es/trex * + * * + * REST is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * REST is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have a copy of the GNU General Public License along with * + * REST in $REST_PATH/LICENSE. * + * If not, see http://www.gnu.org/licenses/. * + * For the list of contributors see $REST_PATH/CREDITS. * + *************************************************************************/ + +#ifndef RestCore_TRestRawFeminosRootToSignalProcess +#define RestCore_TRestRawFeminosRootToSignalProcess + +#include + +#include "TRestRawSignalEvent.h" +#include "TRestRawToSignalProcess.h" + +/// +/// Read data from the root file output of https://github.com/rest-for-physics/feminos-daq into a +/// TRestRawSignalEvent +/// + +class TRestRawFeminosRootToSignalProcess : public TRestEventProcess { + private: + TRestRawSignalEvent* fSignalEvent = nullptr; //! + Long64_t fInputTreeEntry = 0;//! + + TFile* fInputFile = nullptr;//! + TTree* fInputEventTree = nullptr;//! + TTree* fInputRunTree = nullptr;//! + + ULong64_t fInputEventTreeTimestamp = 0;//! + std::vector* fInputEventTreeSignalIds = nullptr;//! + std::vector* fInputEventTreeSignalValues = nullptr;//! + + public: + RESTValue GetInputEvent() const override { return RESTValue((TRestEvent*)nullptr); } + RESTValue GetOutputEvent() const override { return fSignalEvent; } + + void InitProcess() override; + void Initialize() override; + + TRestEvent* ProcessEvent(TRestEvent* inputEvent) override; + const char* GetProcessName() const override { return "FeminosRootToSignal"; } + + // Constructor + TRestRawFeminosRootToSignalProcess(); + TRestRawFeminosRootToSignalProcess(const char* configFilename); + + // Destructor + ~TRestRawFeminosRootToSignalProcess(); + + ClassDefOverride(TRestRawFeminosRootToSignalProcess, + 1); // Template for a REST "event process" class inherited from + // TRestEventProcess +}; +#endif diff --git a/src/TRestRawFeminosRootToSignalProcess.cxx b/src/TRestRawFeminosRootToSignalProcess.cxx new file mode 100644 index 00000000..50116b62 --- /dev/null +++ b/src/TRestRawFeminosRootToSignalProcess.cxx @@ -0,0 +1,148 @@ +/************************************************************************* + * This file is part of the REST software framework. * + * * + * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) * + * For more information see http://gifna.unizar.es/trex * + * * + * REST is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * REST is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have a copy of the GNU General Public License along with * + * REST in $REST_PATH/LICENSE. * + * If not, see http://www.gnu.org/licenses/. * + * For the list of contributors see $REST_PATH/CREDITS. * + *************************************************************************/ + +////////////////////////////////////////////////////////////////////////// +/// The TRestRawFeminosRootToSignalProcess ... +/// +/// DOCUMENTATION TO BE WRITTEN (main description, methods, data members) +/// +/// \warning This process might be obsolete today. It may need additional +/// revision, validation, and documentation. Use it under your own risk. If you +/// find this process useful for your work feel free to use it, improve it, +/// validate and/or document this process. If all those points are addressed +/// these lines can be removed. +/// +///
+/// +/// \warning **⚠ REST is under continuous development.** This +/// documentation +/// is offered to you by the REST community. Your HELP is needed to keep this +/// code +/// up to date. Your feedback will be worth to support this software, please +/// report +/// any problems/suggestions you may find will using it at [The REST Framework +/// forum](http://ezpc10.unizar.es). You are welcome to contribute fixing typos, +/// updating +/// information or adding/proposing new contributions. See also our +/// Contribution +/// Guide. +/// +/// +///-------------------------------------------------------------------------- +/// +/// RESTsoft - Software for Rare Event Searches with TPCs +/// +/// History of developments: +/// +/// 2024-Aug: First implementation +/// Luis Obis +/// +/// \class TRestRawFeminosRootToSignalProcess +/// \author Luis Obis +/// +///
+/// + +#include "TRestRawFeminosRootToSignalProcess.h" + +using namespace std; + +ClassImp(TRestRawFeminosRootToSignalProcess); + +TRestRawFeminosRootToSignalProcess::TRestRawFeminosRootToSignalProcess() { Initialize(); } + +TRestRawFeminosRootToSignalProcess::TRestRawFeminosRootToSignalProcess(const char* configFilename) { + Initialize(); +} + +TRestRawFeminosRootToSignalProcess::~TRestRawFeminosRootToSignalProcess() {} + +void TRestRawFeminosRootToSignalProcess::Initialize() { + delete fSignalEvent; + fSignalEvent = new TRestRawSignalEvent(); + + fIsExternal = true; // We need this in order to prevent error since we are not reading a rest root file + fSingleThreadOnly = true; +} + +void TRestRawFeminosRootToSignalProcess::InitProcess() { + // print input aqs file + const auto inputFilename = fRunInfo->GetInputFileName(0); + + // verify it is a root file reading the last 5 characters + if (inputFilename.substr(inputFilename.size() - 5) != ".root") { + cerr << "TRestRawFeminosRootToSignalProcess::InitProcess: Input file is not a root file" << endl; + exit(1); + } + + fInputFile = TFile::Open(inputFilename.c_str(), "READ"); + if (!fInputFile) { + cerr << "TRestRawFeminosRootToSignalProcess::InitProcess: Error opening input file" << endl; + exit(1); + } + fInputFile->cd(); + + fInputRunTree = fInputFile->Get("run"); + fInputEventTree = fInputFile->Get("events"); + + if (!fInputRunTree || !fInputEventTree) { + cerr << "TRestRawFeminosRootToSignalProcess::InitProcess: Error opening input trees" << endl; + exit(1); + } + + fInputEventTree->SetBranchAddress("timestamp", &fInputEventTreeTimestamp); + fInputEventTree->SetBranchAddress("signal_ids", &fInputEventTreeSignalIds); + fInputEventTree->SetBranchAddress("signal_data", &fInputEventTreeSignalValues); +} + +TRestEvent* TRestRawFeminosRootToSignalProcess::ProcessEvent(TRestEvent* inputEvent) { + fSignalEvent->Initialize(); + + fInputEventTree->GetEntry(fInputTreeEntry); + + fSignalEvent->SetID(fInputTreeEntry); + + // TODO: double check this is correct + fSignalEvent->SetTime(fInputEventTreeTimestamp / 1000, fInputEventTreeTimestamp % 1000); + + for (size_t i = 0; i < fInputEventTreeSignalIds->size(); i++) { + auto signal = TRestRawSignal(); + signal.Initialize(); + + const auto id = fInputEventTreeSignalIds->at(i); + signal.SetID(id); + + for (int j = 0; j < 512; j++) { + signal.AddPoint(short(fInputEventTreeSignalValues->at(i * 512 + j))); + } + + fSignalEvent->AddSignal(signal); + } + + fInputTreeEntry += 1; + + if (fInputTreeEntry >= fInputEventTree->GetEntries()) { + return nullptr; + } + + return fSignalEvent; +} From 8a800af373870bb9beebe6b95fc94c70b9cad8a3 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 19 Aug 2024 00:54:15 +0200 Subject: [PATCH 3/5] typo in variable name --- inc/TRestRawToSignalProcess.h | 4 +- src/TRestRawAFTERToSignalProcess.cxx | 4 +- src/TRestRawBiPoToSignalProcess.cxx | 64 ++++++++++---------- src/TRestRawFEUDreamToSignalProcess.cxx | 16 ++--- src/TRestRawMultiCoBoAsAdToSignalProcess.cxx | 14 ++--- src/TRestRawMultiFEMINOSToSignalProcess.cxx | 16 ++--- src/TRestRawTDSToSignalProcess.cxx | 8 +-- src/TRestRawToSignalProcess.cxx | 4 +- src/TRestRawUSTCToSignalProcess.cxx | 14 ++--- 9 files changed, 72 insertions(+), 72 deletions(-) diff --git a/inc/TRestRawToSignalProcess.h b/inc/TRestRawToSignalProcess.h index ac184a05..9a5bdb4a 100644 --- a/inc/TRestRawToSignalProcess.h +++ b/inc/TRestRawToSignalProcess.h @@ -36,7 +36,7 @@ class TRestRawToSignalProcess : public TRestEventProcess { Int_t fMinPoints; Double_t tStart; - Long64_t totalBytesReaded; + Long64_t totalbytesRead; Long64_t totalBytes; TRestRawSignalEvent* fSignalEvent = nullptr; //! @@ -80,7 +80,7 @@ class TRestRawToSignalProcess : public TRestEventProcess { Bool_t ResetEntry() override; - Long64_t GetTotalBytesRead() const override { return totalBytesReaded; } + Long64_t GetTotalBytesRead() const override { return totalbytesRead; } Long64_t GetTotalBytes() const override { return totalBytes; } virtual std::string GetElectronicsType() const { return fElectronicsType; } diff --git a/src/TRestRawAFTERToSignalProcess.cxx b/src/TRestRawAFTERToSignalProcess.cxx index cb0c8926..25c7cddd 100644 --- a/src/TRestRawAFTERToSignalProcess.cxx +++ b/src/TRestRawAFTERToSignalProcess.cxx @@ -127,7 +127,7 @@ void TRestRawAFTERToSignalProcess::InitProcess() { runUid[20] = '\0'; sprintf(initTime, "%s", runUid); printf("File UID is %s \n", initTime); - totalBytesReaded = sizeof(runUid); + totalbytesRead = sizeof(runUid); int year, day, month, hour, minute, second; sscanf(runUid, "R%d.%02d.%02d-%02d:%02d:%02d", &year, &month, &day, &hour, &minute, &second); @@ -346,7 +346,7 @@ TRestEvent* TRestRawAFTERToSignalProcess::ProcessEvent(TRestEvent* inputEvent) { RESTDebug << "Trailer " << eventTime << "\n" << RESTendl; } // end while - totalBytesReaded += frameBits; + totalbytesRead += frameBits; // printf("Event ID %d time stored // %.3lf\n",fSignalEvent->GetID(),fSignalEvent->GetTime()); diff --git a/src/TRestRawBiPoToSignalProcess.cxx b/src/TRestRawBiPoToSignalProcess.cxx index 827e7d75..749b3637 100644 --- a/src/TRestRawBiPoToSignalProcess.cxx +++ b/src/TRestRawBiPoToSignalProcess.cxx @@ -124,7 +124,7 @@ void TRestRawBiPoToSignalProcess::InitProcess() { printf("Error: could not read first prefix.\n"); exit(1); } - totalBytesReaded += CTAG_SZ * sizeof(char); + totalbytesRead += CTAG_SZ * sizeof(char); if (strcmp(buffer, TAG_RUN_BIPO) != 0) { RESTError << "The file " << fInputFileNames[0] << " is not BiPo format" << RESTendl; @@ -155,7 +155,7 @@ TRestEvent* TRestRawBiPoToSignalProcess::ProcessEvent(TRestEvent* inputEvent) { printf("Error: could not read first ACQ prefix.\n"); exit(1); } - totalBytesReaded += CTAG_SZ * sizeof(char); + totalbytesRead += CTAG_SZ * sizeof(char); if (strcmp(buffer, TAG_RUN_STOP) == 0) { RESTDebug << "The run ends" << RESTendl; @@ -224,14 +224,14 @@ void TRestRawBiPoToSignalProcess::ReadFooter() { printf("Error: could not read timestamp.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); Double_t runEndTime = (Double_t)tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read timestamp (us).\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); runEndTime += 1.e-6 * (Double_t)tmp; fRunInfo->SetEndTimeStamp(runEndTime); @@ -251,14 +251,14 @@ void TRestRawBiPoToSignalProcess::ReadHeader() { printf("Error: could not read timestamp.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); Double_t runStartTime = (Double_t)tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read timestamp (us).\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); runStartTime += 1.e-6 * (Double_t)tmp; fRunInfo->SetStartTimeStamp(runStartTime); @@ -268,7 +268,7 @@ void TRestRawBiPoToSignalProcess::ReadHeader() { printf("Error: could not read nBoards.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); fNBoards = nBoards; RESTDebug << "N boards: " << fNBoards << RESTendl; @@ -281,7 +281,7 @@ void TRestRawBiPoToSignalProcess::ReadHeader() { printf("Error: could not read BiPo flag.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); if (bipo != 1) { RESTError << "The file " << fInputFileNames[0] << " is not BiPo format" << RESTendl; @@ -302,14 +302,14 @@ void TRestRawBiPoToSignalProcess::ReadBoard() { printf("Error: could not read base matacq address.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); board.address = tmp; if (fread(&board.en_ch[0], sizeof(int32_t), MATACQ_N_CH, fInputBinFile) != MATACQ_N_CH) { printf("Error: could not read base matacq en_ch.\n"); exit(1); } - totalBytesReaded += MATACQ_N_CH * sizeof(int32_t); + totalbytesRead += MATACQ_N_CH * sizeof(int32_t); int cnt = 0; board.nChannels = 0; @@ -327,48 +327,48 @@ void TRestRawBiPoToSignalProcess::ReadBoard() { printf("Error: could not read base matacq trg_ch.\n"); exit(1); } - totalBytesReaded += MATACQ_N_CH * sizeof(int32_t); + totalbytesRead += MATACQ_N_CH * sizeof(int32_t); if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read Trig type.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); board.Trig_Type = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read Threshold.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); board.Threshold = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read Nb_Acq.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); board.Nb_Acq = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read Posttrig.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); board.Posttrig = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read Time_Tag_On.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); board.Time_Tag_On = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read Sampling_GHz.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); board.Sampling_GHz = tmp; RESTDebug << "MATACQ Base memory address: " << board.address << RESTendl; @@ -397,60 +397,60 @@ void TRestRawBiPoToSignalProcess::ReadBiPoSetup() { printf("Error: could not read BiPo trigger address.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); bipo.trigger_address = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read BiPo Win1 Posttrig.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); bipo.Win1_Posttrig = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read BiPo timeout 200KHz.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); bipo.Timeout_200KHz = tmp; if (fread(&bipo.Trig_Chan[0], sizeof(int32_t), MATACQ_N_CH, fInputBinFile) != MATACQ_N_CH) { printf("Error: could not read Trig_Chan.\n"); exit(1); } - totalBytesReaded += MATACQ_N_CH * sizeof(int32_t); + totalbytesRead += MATACQ_N_CH * sizeof(int32_t); if (fread(&bipo.Level1_mV[0], sizeof(int32_t), MATACQ_N_CH, fInputBinFile) != MATACQ_N_CH) { printf("Error: could not read Level1_mV.\n"); exit(1); } - totalBytesReaded += MATACQ_N_CH * sizeof(int32_t); + totalbytesRead += MATACQ_N_CH * sizeof(int32_t); if (fread(&bipo.Level2_mV[0], sizeof(int32_t), MATACQ_N_CH, fInputBinFile) != MATACQ_N_CH) { printf("Error: could not read Level2_mV.\n"); exit(1); } - totalBytesReaded += MATACQ_N_CH * sizeof(int32_t); + totalbytesRead += MATACQ_N_CH * sizeof(int32_t); if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read BiPo Win1 Posttrig.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); bipo.t1_window = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read BiPo Win1 Posttrig.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); bipo.t2_window = tmp; if (fread(&tmp, sizeof(int32_t), 1, fInputBinFile) != 1) { printf("Error: could not read BiPo Win1 Posttrig.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); bipo.t1_t2_timeout = tmp; RESTDebug << "BiPo trigger address: " << bipo.trigger_address << RESTendl; @@ -488,7 +488,7 @@ Int_t TRestRawBiPoToSignalProcess::ReadBiPoEventData(std::vector& mdat printf("Error: could not read tmp .\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); Int_t boardAddress = tmp; RESTDebug << " Event address --> " << boardAddress << RESTendl; @@ -500,7 +500,7 @@ Int_t TRestRawBiPoToSignalProcess::ReadBiPoEventData(std::vector& mdat printf("Error: could not read tmp .\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); Double_t timeStamp = tmp; @@ -508,7 +508,7 @@ Int_t TRestRawBiPoToSignalProcess::ReadBiPoEventData(std::vector& mdat printf("Error: could not read tmp .\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); timeStamp += 1.e-6 * (Double_t)tmp; fSignalEvent->SetTime(timeStamp); @@ -519,7 +519,7 @@ Int_t TRestRawBiPoToSignalProcess::ReadBiPoEventData(std::vector& mdat printf("Error: could not read tmp .\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); int32_t data_size = tmp; RESTDebug << "Data size --> " << tmp << RESTendl; @@ -527,7 +527,7 @@ Int_t TRestRawBiPoToSignalProcess::ReadBiPoEventData(std::vector& mdat printf("Error: could not read BiPo trigger address.\n"); exit(1); } - totalBytesReaded += sizeof(int32_t); + totalbytesRead += sizeof(int32_t); RESTDebug << " T1-T2 distance --> " << tmp << RESTendl; fSignalEvent->SetAuxiliar(tmp); @@ -536,7 +536,7 @@ Int_t TRestRawBiPoToSignalProcess::ReadBiPoEventData(std::vector& mdat printf("Error: could not read MATACQ data.\n"); exit(1); } - totalBytesReaded += data_size * sizeof(uint16_t); + totalbytesRead += data_size * sizeof(uint16_t); return boardAddress; } diff --git a/src/TRestRawFEUDreamToSignalProcess.cxx b/src/TRestRawFEUDreamToSignalProcess.cxx index f312a565..4400561f 100644 --- a/src/TRestRawFEUDreamToSignalProcess.cxx +++ b/src/TRestRawFEUDreamToSignalProcess.cxx @@ -101,7 +101,7 @@ void TRestRawFEUDreamToSignalProcess::InitProcess() { tStart = 0; // timeStamp of the run initially set to 0 RESTInfo << "TRestRawFEUDreamToSignalProcess::InitProcess" << RESTendl; - totalBytesReaded = 0; + totalbytesRead = 0; } TRestEvent* TRestRawFEUDreamToSignalProcess::ProcessEvent(TRestEvent* inputEvent) { @@ -231,7 +231,7 @@ bool TRestRawFEUDreamToSignalProcess::ReadFeuHeaders(FeuReadOut& Feu) { if (!Feu.data_to_treat) { // data not loaded int nbytes = fread((void*)&(Feu.current_data), sizeof(Feu.current_data), 1, fInputBinFile); - totalBytesReaded += sizeof(Feu.current_data); + totalbytesRead += sizeof(Feu.current_data); if (nbytes == 0) { // perror("TRestRawFEUDreamToSignalProcess::ReadFeuHeaders: Error in reading FeuHeaders !"); RESTWarning @@ -321,7 +321,7 @@ bool TRestRawFEUDreamToSignalProcess::ReadFeuHeaders(FeuReadOut& Feu) { break; // header finished if (fread((void*)&(Feu.current_data), sizeof(Feu.current_data), 1, fInputBinFile) == 0) return true; - totalBytesReaded += sizeof(Feu.current_data); + totalbytesRead += sizeof(Feu.current_data); Feu.current_data.ntohs_(); Feu.data_to_treat = true; @@ -347,7 +347,7 @@ bool TRestRawFEUDreamToSignalProcess::ReadDreamData(FeuReadOut& Feu) { if (!Feu.data_to_treat) { // no data to treat int nbytes = fread((void*)&(Feu.current_data), sizeof(Feu.current_data), 1, fInputBinFile); - totalBytesReaded += sizeof(Feu.current_data); + totalbytesRead += sizeof(Feu.current_data); if (nbytes == 0) { perror("TRestRawFEUDreamToSignalProcess::ReadDreamData: no Dream data to read in file"); RESTError << "TRestRawFEUDreamToSignalProcess::ReadDreamData: problem in reading raw data file, " @@ -547,7 +547,7 @@ bool TRestRawFEUDreamToSignalProcess::ReadDreamData(FeuReadOut& Feu) { } if (fread((char*)&(Feu.current_data), sizeof(Feu.current_data), 1, fInputBinFile) == 0) return true; - totalBytesReaded += sizeof(Feu.current_data); + totalbytesRead += sizeof(Feu.current_data); Feu.current_data.ntohs_(); Feu.data_to_treat = true; @@ -558,7 +558,7 @@ bool TRestRawFEUDreamToSignalProcess::ReadDreamData(FeuReadOut& Feu) { bool TRestRawFEUDreamToSignalProcess::ReadFeuTrailer(FeuReadOut& Feu) { if (!Feu.data_to_treat) { int nbytes = fread((void*)&(Feu.current_data), sizeof(Feu.current_data), 1, fInputBinFile); - totalBytesReaded += sizeof(Feu.current_data); + totalbytesRead += sizeof(Feu.current_data); if (nbytes == 0) { perror("TRestRawFEUDreamToSignalProcess::ReadFeuTrailer: can't read new data from file"); RESTError @@ -605,12 +605,12 @@ bool TRestRawFEUDreamToSignalProcess::ReadFeuTrailer(FeuReadOut& Feu) { if (z == 0) RESTError << "TRestRawFEUDreamToSignalProcess::ReadFeuTrailer. Error reading file" << RESTendl; - totalBytesReaded += sizeof(Feu.current_data); + totalbytesRead += sizeof(Feu.current_data); break; } if (fread((void*)&(Feu.current_data), sizeof(Feu.current_data), 1, fInputBinFile) == 0) return true; - totalBytesReaded += sizeof(Feu.current_data); + totalbytesRead += sizeof(Feu.current_data); Feu.current_data.ntohs_(); Feu.data_to_treat = true; diff --git a/src/TRestRawMultiCoBoAsAdToSignalProcess.cxx b/src/TRestRawMultiCoBoAsAdToSignalProcess.cxx index d274a1a7..977bf3a7 100644 --- a/src/TRestRawMultiCoBoAsAdToSignalProcess.cxx +++ b/src/TRestRawMultiCoBoAsAdToSignalProcess.cxx @@ -136,7 +136,7 @@ void TRestRawMultiCoBoAsAdToSignalProcess::InitProcess() { fStartTimeStamp = TTimeStamp(fRunInfo->GetStartTimestamp()); } - totalBytesReaded = 0; + totalbytesRead = 0; } Bool_t TRestRawMultiCoBoAsAdToSignalProcess::AddInputFile(const string& file) { @@ -155,7 +155,7 @@ Bool_t TRestRawMultiCoBoAsAdToSignalProcess::AddInputFile(const string& file) { fHeaderFrame[i].eventIdx = (unsigned int)4294967295; return kFALSE; } - totalBytesReaded += 256; + totalbytesRead += 256; if (!ReadFrameHeader(fHeaderFrame[i])) { cout << "error when reading frame header in file " << i << " \"" << fInputFileNames[i] << "\"" << endl; @@ -262,7 +262,7 @@ bool TRestRawMultiCoBoAsAdToSignalProcess::FillBuffer() { fHeaderFrame[i].eventIdx = (unsigned int)4294967295; return kFALSE; } - totalBytesReaded += 256; + totalbytesRead += 256; if (!ReadFrameHeader(fHeaderFrame[i])) { cout << "error when reading frame header in file " << i << " \"" << fInputFileNames[i] << "\"" << endl; @@ -319,7 +319,7 @@ bool TRestRawMultiCoBoAsAdToSignalProcess::FillBuffer() { fHeaderFrame[i].eventIdx = (unsigned int)4294967295; break; } - totalBytesReaded += 278528; + totalbytesRead += 278528; ReadFrameDataF(fHeaderFrame[i]); } else { fclose(fInputFiles[i]); @@ -335,7 +335,7 @@ bool TRestRawMultiCoBoAsAdToSignalProcess::FillBuffer() { fHeaderFrame[i].eventIdx = (unsigned int)4294967295; // maximum of unsigned int break; } - totalBytesReaded += 256; + totalbytesRead += 256; if (!ReadFrameHeader(fHeaderFrame[i])) { RESTWarning << "Event " << fCurrentEvent << " : error when reading next frame header" << RESTendl; @@ -352,7 +352,7 @@ bool TRestRawMultiCoBoAsAdToSignalProcess::FillBuffer() { feof(fInputFiles[i])) { break; } - totalBytesReaded += 256; + totalbytesRead += 256; if (ReadFrameHeader(fHeaderFrame[i])) { fVerboseLevel = tmp; RESTWarning << "Successfully found next header (EventId : " @@ -513,7 +513,7 @@ bool TRestRawMultiCoBoAsAdToSignalProcess::ReadFrameDataP(FILE* f, CoBoHeaderFra f = nullptr; return kFALSE; } - totalBytesReaded += 4; + totalbytesRead += 4; // total: 4bytes, 32 bits // 11 111111|1 1111111|11 11 1111|11111111 // agetIdx chanIdx buckIdx unused samplepoint diff --git a/src/TRestRawMultiFEMINOSToSignalProcess.cxx b/src/TRestRawMultiFEMINOSToSignalProcess.cxx index d0c689e3..96a2c321 100644 --- a/src/TRestRawMultiFEMINOSToSignalProcess.cxx +++ b/src/TRestRawMultiFEMINOSToSignalProcess.cxx @@ -231,14 +231,14 @@ void TRestRawMultiFEMINOSToSignalProcess::InitProcess() { unsigned short sh; unsigned short al; - totalBytesReaded = 0; + totalbytesRead = 0; // Read prefix if (fread(&sh, sizeof(unsigned short), 1, fInputBinFile) != 1) { printf("Error: could not read first prefix.\n"); exit(1); } - totalBytesReaded += sizeof(unsigned short); + totalbytesRead += sizeof(unsigned short); // f->tot_file_rd+= sizeof(unsigned short); @@ -255,7 +255,7 @@ void TRestRawMultiFEMINOSToSignalProcess::InitProcess() { if (z == 0) RESTError << "TRestRawMultiFEMINOSToSignalProcess::InitProcess. Problem reading from inputfile" << RESTendl; - totalBytesReaded += sizeof(int); + totalbytesRead += sizeof(int); tStart = tt; RESTDebug << "Timestamp : " << tt << " - " << tStart << RESTendl; @@ -268,7 +268,7 @@ void TRestRawMultiFEMINOSToSignalProcess::InitProcess() { printf("Error: could not read %d characters.\n", al); exit(1); } - totalBytesReaded += sizeof(char); + totalbytesRead += sizeof(char); // Show run string information if desired printf("Run string: %s\n", &(run_str[0])); @@ -306,7 +306,7 @@ TRestEvent* TRestRawMultiFEMINOSToSignalProcess::ProcessEvent(TRestEvent* inputE // The processing thread will be finished when return nullptr is reached return nullptr; } - totalBytesReaded += sizeof(unsigned short); + totalbytesRead += sizeof(unsigned short); if ((*sh & PFX_0_BIT_CONTENT_MASK) == PFX_START_OF_BUILT_EVENT) { if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) @@ -324,7 +324,7 @@ TRestEvent* TRestRawMultiFEMINOSToSignalProcess::ProcessEvent(TRestEvent* inputE printf("Error: could not read two short words.\n"); exit(1); } - totalBytesReaded += sizeof(unsigned short) * 2; + totalbytesRead += sizeof(unsigned short) * 2; // Get the size of the event in bytes fr_sz = (int)(((*(sh + 2)) << 16) | (*(sh + 1))); @@ -343,7 +343,7 @@ TRestEvent* TRestRawMultiFEMINOSToSignalProcess::ProcessEvent(TRestEvent* inputE printf("Error: could not read short word.\n"); exit(1); } - totalBytesReaded += sizeof(unsigned short); + totalbytesRead += sizeof(unsigned short); // Get the size of the event in bytes fr_sz = (int)*(sh + 1); @@ -366,7 +366,7 @@ TRestEvent* TRestRawMultiFEMINOSToSignalProcess::ProcessEvent(TRestEvent* inputE printf("Error: could not read %d bytes.\n", (nb_sh * 2)); return nullptr; // exit(1); } - totalBytesReaded += sizeof(unsigned short) * nb_sh; + totalbytesRead += sizeof(unsigned short) * nb_sh; // Zero the first two bytes because these are no longer used to specify // the size of the frame diff --git a/src/TRestRawTDSToSignalProcess.cxx b/src/TRestRawTDSToSignalProcess.cxx index 9ec743d1..63e19822 100644 --- a/src/TRestRawTDSToSignalProcess.cxx +++ b/src/TRestRawTDSToSignalProcess.cxx @@ -81,7 +81,7 @@ void TRestRawTDSToSignalProcess::Initialize() { TRestRawToSignalProcess::Initial void TRestRawTDSToSignalProcess::InitProcess() { ANABlockHead blockhead; if (fread(&blockhead, sizeof(blockhead), 1, fInputBinFile) != 1) return; - totalBytesReaded = sizeof(blockhead); + totalbytesRead = sizeof(blockhead); nSamples = blockhead.NEvents; nChannels = blockhead.NHits / blockhead.NEvents; fRate = blockhead.SRate; @@ -111,14 +111,14 @@ TRestEvent* TRestRawTDSToSignalProcess::ProcessEvent(TRestEvent* evInput) { // Read block header if any, note that we have nSamples events between 2 block headers if (nEvents % nSamples == 0 && nEvents != 0) { if (fread(&blockhead, sizeof(blockhead), 1, fInputBinFile) != 1) return nullptr; - totalBytesReaded += sizeof(blockhead); + totalbytesRead += sizeof(blockhead); // Update timestamp from the blockHeader tNow = static_cast(blockhead.TimeStamp); } // Always read event header at the beginning of event if (fread(&eventhead, sizeof(eventhead), 1, fInputBinFile) != 1) return nullptr; - totalBytesReaded += sizeof(eventhead); + totalbytesRead += sizeof(eventhead); // This vector holds data which has a length of pulseDepth std::vector buffer(pulseDepth); fSignalEvent->SetID(nEvents); @@ -132,7 +132,7 @@ TRestEvent* TRestRawTDSToSignalProcess::ProcessEvent(TRestEvent* evInput) { fSignalEvent->AddSignal(sgnl); // Read data frame and store in buffer if (fread((char*)&buffer[0], pulseDepth, 1, fInputBinFile) != 1) return nullptr; - totalBytesReaded += pulseDepth; + totalbytesRead += pulseDepth; for (int j = 0; j < pulseDepth; j++) { Short_t data = buffer[j]; if (negPolarity[i]) data *= -1; // Inversion in case pulses are negative diff --git a/src/TRestRawToSignalProcess.cxx b/src/TRestRawToSignalProcess.cxx index 3f8a5354..cb29ec95 100644 --- a/src/TRestRawToSignalProcess.cxx +++ b/src/TRestRawToSignalProcess.cxx @@ -102,7 +102,7 @@ void TRestRawToSignalProcess::Initialize() { fgKeepFileOpen = true; totalBytes = 0; - totalBytesReaded = 0; + totalbytesRead = 0; } void TRestRawToSignalProcess::InitFromConfigFile() { @@ -139,7 +139,7 @@ Bool_t TRestRawToSignalProcess::OpenInputFiles(const vector& files) { fInputFiles.clear(); fInputFileNames.clear(); totalBytes = 0; - totalBytesReaded = 0; + totalbytesRead = 0; for (const auto& file : files) { AddInputFile(file); diff --git a/src/TRestRawUSTCToSignalProcess.cxx b/src/TRestRawUSTCToSignalProcess.cxx index 98b86cf9..93ef5840 100644 --- a/src/TRestRawUSTCToSignalProcess.cxx +++ b/src/TRestRawUSTCToSignalProcess.cxx @@ -104,7 +104,7 @@ void TRestRawUSTCToSignalProcess::InitProcess() { fRunOrigin = fRunInfo->GetRunNumber(); fCurrentFile = 0; fCurrentBuffer = 0; - totalBytesReaded = 0; + totalbytesRead = 0; USTCDataFrame frame; if ((!GetNextFrame(frame)) || (!ReadFrameData(frame))) { @@ -315,7 +315,7 @@ bool TRestRawUSTCToSignalProcess::GetNextFrame(USTCDataFrame& frame) { fInputFiles[fCurrentFile] = nullptr; return OpenNextFile(frame); } - totalBytesReaded += PROTOCOL_SIZE; + totalbytesRead += PROTOCOL_SIZE; if (!(Protocol[0] ^ 0xac) && !(Protocol[1] ^ 0x0f)) { // the first 2 bytes must be 0xac0f, otherwise it is wrong @@ -331,7 +331,7 @@ bool TRestRawUSTCToSignalProcess::GetNextFrame(USTCDataFrame& frame) { fInputFiles[fCurrentFile] = nullptr; return OpenNextFile(frame); } - totalBytesReaded += ENDING_SIZE; + totalbytesRead += ENDING_SIZE; } else if (flag & 0x2) { // this is the evt_header frame memcpy(fHeader, Protocol, PROTOCOL_SIZE); @@ -342,7 +342,7 @@ bool TRestRawUSTCToSignalProcess::GetNextFrame(USTCDataFrame& frame) { fInputFiles[fCurrentFile] = nullptr; return OpenNextFile(frame); } - totalBytesReaded += HEADER_SIZE; + totalbytesRead += HEADER_SIZE; } else { // this is the evt_data frame memcpy(frame.data, Protocol, PROTOCOL_SIZE); @@ -353,7 +353,7 @@ bool TRestRawUSTCToSignalProcess::GetNextFrame(USTCDataFrame& frame) { fInputFiles[fCurrentFile] = nullptr; return OpenNextFile(frame); } - totalBytesReaded += DATA_SIZE; + totalbytesRead += DATA_SIZE; return true; } } else { @@ -366,7 +366,7 @@ bool TRestRawUSTCToSignalProcess::GetNextFrame(USTCDataFrame& frame) { fInputFiles[fCurrentFile] = nullptr; return OpenNextFile(frame); } - totalBytesReaded += DATA_SIZE; + totalbytesRead += DATA_SIZE; if (frame.data[0] * 0x100 + frame.data[1] != 0xEEEE) { RESTarning << "wrong header!" << RESTendl; @@ -414,7 +414,7 @@ void TRestRawUSTCToSignalProcess::FixToNextFrame(FILE* f) { } #endif } - totalBytesReaded += n; + totalbytesRead += n; } bool TRestRawUSTCToSignalProcess::ReadFrameData(USTCDataFrame& frame) { From d690a21a399a1621f9c4754c18cc1429b693b3de Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 18 Aug 2024 23:22:55 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- inc/TRestRawFeminosRootToSignalProcess.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/inc/TRestRawFeminosRootToSignalProcess.h b/inc/TRestRawFeminosRootToSignalProcess.h index d33f370d..2f150a6b 100644 --- a/inc/TRestRawFeminosRootToSignalProcess.h +++ b/inc/TRestRawFeminosRootToSignalProcess.h @@ -36,15 +36,15 @@ class TRestRawFeminosRootToSignalProcess : public TRestEventProcess { private: TRestRawSignalEvent* fSignalEvent = nullptr; //! - Long64_t fInputTreeEntry = 0;//! + Long64_t fInputTreeEntry = 0; //! - TFile* fInputFile = nullptr;//! - TTree* fInputEventTree = nullptr;//! - TTree* fInputRunTree = nullptr;//! + TFile* fInputFile = nullptr; //! + TTree* fInputEventTree = nullptr; //! + TTree* fInputRunTree = nullptr; //! - ULong64_t fInputEventTreeTimestamp = 0;//! - std::vector* fInputEventTreeSignalIds = nullptr;//! - std::vector* fInputEventTreeSignalValues = nullptr;//! + ULong64_t fInputEventTreeTimestamp = 0; //! + std::vector* fInputEventTreeSignalIds = nullptr; //! + std::vector* fInputEventTreeSignalValues = nullptr; //! public: RESTValue GetInputEvent() const override { return RESTValue((TRestEvent*)nullptr); } From c8d750b4cfd44d41fe1778cc87a6611145632f30 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 19 Aug 2024 01:23:24 +0200 Subject: [PATCH 5/5] update to new branch name --- src/TRestRawFeminosRootToSignalProcess.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TRestRawFeminosRootToSignalProcess.cxx b/src/TRestRawFeminosRootToSignalProcess.cxx index 50116b62..68ac8204 100644 --- a/src/TRestRawFeminosRootToSignalProcess.cxx +++ b/src/TRestRawFeminosRootToSignalProcess.cxx @@ -111,7 +111,7 @@ void TRestRawFeminosRootToSignalProcess::InitProcess() { fInputEventTree->SetBranchAddress("timestamp", &fInputEventTreeTimestamp); fInputEventTree->SetBranchAddress("signal_ids", &fInputEventTreeSignalIds); - fInputEventTree->SetBranchAddress("signal_data", &fInputEventTreeSignalValues); + fInputEventTree->SetBranchAddress("signal_values", &fInputEventTreeSignalValues); } TRestEvent* TRestRawFeminosRootToSignalProcess::ProcessEvent(TRestEvent* inputEvent) {