diff --git a/.clang-format b/.clang-format index 686e2d92d..f01f570b3 100644 --- a/.clang-format +++ b/.clang-format @@ -7,4 +7,4 @@ DerivePointerAlignment: false PointerAlignment: Left IndentWidth: 4 -ColumnLimit : 110 +ColumnLimit: 110 diff --git a/.cmake-format.yaml b/.cmake-format.yaml new file mode 100644 index 000000000..5b703c9d7 --- /dev/null +++ b/.cmake-format.yaml @@ -0,0 +1,6 @@ +# https://cmake-format.readthedocs.io/en/latest/configuration.html + +format: + tab_size: 4 + separate_ctrl_name_with_space: true + separate_fn_name_with_space: false diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index eaf16fa54..966052fe4 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -21,7 +21,7 @@ defaults: jobs: framework-validation: uses: rest-for-physics/framework/.github/workflows/validation.yml@master - + libCheck: name: Validate library runs-on: ubuntu-latest @@ -29,7 +29,7 @@ jobs: image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics steps: - uses: actions/checkout@v3 - - run: python3 pipeline/validateLibrary.py . + - run: python3 pipeline/validateLibrary.py . build-detectorlib: name: Build only detectorlib @@ -43,6 +43,10 @@ jobs: with: cmake-flags: "-DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DRESTLIB_DETECTOR=ON" branch: ${{ env.BRANCH_NAME }} + - name: Verify pre-commit config files match + run: | + cd $GITHUB_WORKSPACE + curl https://raw.githubusercontent.com/rest-for-physics/framework/master/scripts/validatePreCommitConfig.py | python - name: Load REST libraries run: | source ${{ env.REST_PATH }}/thisREST.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d37228211..30c5d4f29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -80,5 +80,3 @@ Load REST Libraries: except: variables: - $CRONJOB - - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..87c5b7f64 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,35 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-symlinks + - id: check-yaml + - id: check-xml + - id: requirements-txt-fixer + - id: end-of-file-fixer + exclude: external/.*$ + - id: mixed-line-ending + exclude: external/.*$ + - id: trailing-whitespace + exclude: external/.*$ + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v15.0.6 + hooks: + - id: clang-format + exclude: external/.*$ + + - repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-format + additional_dependencies: [ pyyaml ] + # - id: cmake-lint + + - repo: https://github.com/psf/black + rev: 22.12.0 + hooks: + - id: black diff --git a/CMakeLists.txt b/CMakeLists.txt index b0f2d2370..b9e56ddfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ set(LibraryVersion "1.9") add_definitions(-DLIBRARY_VERSION="${LibraryVersion}") -#find garfield libs and includes -IF (NOT DEFINED REST_GARFIELD) +# find garfield libs and includes +if (NOT DEFINED REST_GARFIELD) set(REST_GARFIELD OFF) -ENDIF () +endif () if (${REST_GARFIELD} MATCHES "ON") add_definitions(-DUSE_Garfield) @@ -14,9 +14,11 @@ if (${REST_GARFIELD} MATCHES "ON") message(STATUS "Using new Garfield CMake") set(GARFIELD_INSTALL $ENV{GARFIELD_INSTALL}) find_package(Garfield REQUIRED) - set(external_include_dirs ${external_include_dirs} ${GARFIELD_INSTALL}/include/Garfield) + set(external_include_dirs ${external_include_dirs} + ${GARFIELD_INSTALL}/include/Garfield) set(external_libs ${external_libs} Garfield::Garfield) - # recommended CMake way does not work, we need to delete the "FindGarfield.cmake" script + # recommended CMake way does not work, we need to delete the + # "FindGarfield.cmake" script elseif (DEFINED ENV{GARFIELD_HOME}) # Old way, for backwards compatibility message(STATUS "Using old Garfield CMake") @@ -25,8 +27,10 @@ if (${REST_GARFIELD} MATCHES "ON") message(STATUS Garfield_INCLUDE_DIRS ${Garfield_INCLUDE_DIRS}) message(STATUS Garfield_INCLUDE_DIRS ${Garfield_INCLUDE_Heed_DIRS}) message(STATUS Garfield_LIBRARIES ${Garfield_LIBRARIES}) - set(external_include_dirs ${external_include_dirs} ${Garfield_INCLUDE_DIRS}) - set(external_include_dirs ${external_include_dirs} ${Garfield_INCLUDE_Heed_DIRS}) + set(external_include_dirs ${external_include_dirs} + ${Garfield_INCLUDE_DIRS}) + set(external_include_dirs ${external_include_dirs} + ${Garfield_INCLUDE_Heed_DIRS}) set(external_libs ${external_libs} ${Garfield_LIBRARIES}) add_definitions(-DUSE_Garfield_OLD) else () @@ -36,7 +40,9 @@ if (${REST_GARFIELD} MATCHES "ON") message(STATUS "GARFIELD INSTALLATION: ${GARFIELD_INSTALL}") set(feature_added "Garfield") - set(feature_added ${feature_added} PARENT_SCOPE) + set(feature_added + ${feature_added} + PARENT_SCOPE) else () set(REST_GARFIELD OFF) endif (${REST_GARFIELD} MATCHES "ON") @@ -45,9 +51,9 @@ if (NOT ${REST_EVE} MATCHES "ON") set(excludes ${excludes} TRestDetectorHitsEventViewer) endif () -COMPILELIB("") +compilelib("") file(GLOB_RECURSE MAC "${CMAKE_CURRENT_SOURCE_DIR}/macros/*") -INSTALL(FILES ${MAC} DESTINATION ./macros/detector) +install(FILES ${MAC} DESTINATION ./macros/detector) -ADD_LIBRARY_TEST() +add_library_test() diff --git a/inc/TRestDetectorDaqChannelSwitchingProcess.h b/inc/TRestDetectorDaqChannelSwitchingProcess.h index 0c863c99a..50e026a1f 100644 --- a/inc/TRestDetectorDaqChannelSwitchingProcess.h +++ b/inc/TRestDetectorDaqChannelSwitchingProcess.h @@ -46,7 +46,8 @@ class TRestDetectorDaqChannelSwitchingProcess : public TRestEventProcess { RESTMetadata << "module's daq channel re-definition: " << RESTendl; auto iter = fFirstDaqChannelDef.begin(); while (iter != fFirstDaqChannelDef.end()) { - RESTMetadata << "module id: " << iter->first << " first daq channel: " << iter->second << RESTendl; + RESTMetadata << "module id: " << iter->first << " first daq channel: " << iter->second + << RESTendl; iter++; } RESTMetadata << RESTendl; diff --git a/inc/TRestDetectorHitsAnalysisProcess.h b/inc/TRestDetectorHitsAnalysisProcess.h index 46b259b83..e17c02eab 100644 --- a/inc/TRestDetectorHitsAnalysisProcess.h +++ b/inc/TRestDetectorHitsAnalysisProcess.h @@ -76,8 +76,10 @@ class TRestDetectorHitsAnalysisProcess : public TRestEventProcess { RESTMetadata << " -------------------" << RESTendl; RESTMetadata << " Fiducial parameters" << RESTendl; RESTMetadata << " -------------------" << RESTendl; - RESTMetadata << " x0 : (" << fFid_x0.X() << " , " << fFid_x0.Y() << " , " << fFid_x0.Z() << ")" << RESTendl; - RESTMetadata << " x1 : (" << fFid_x1.X() << " , " << fFid_x1.Y() << " , " << fFid_x1.Z() << ")" << RESTendl; + RESTMetadata << " x0 : (" << fFid_x0.X() << " , " << fFid_x0.Y() << " , " << fFid_x0.Z() << ")" + << RESTendl; + RESTMetadata << " x1 : (" << fFid_x1.X() << " , " << fFid_x1.Y() << " , " << fFid_x1.Z() << ")" + << RESTendl; RESTMetadata << " R : " << fFid_R << RESTendl; RESTMetadata << " sX : " << fFid_sX << RESTendl; RESTMetadata << " sY : " << fFid_sY << RESTendl; diff --git a/inc/TRestDetectorPositionMappingProcess.h b/inc/TRestDetectorPositionMappingProcess.h index 6ac172e94..e8a2ccbe8 100644 --- a/inc/TRestDetectorPositionMappingProcess.h +++ b/inc/TRestDetectorPositionMappingProcess.h @@ -65,9 +65,9 @@ class TRestDetectorPositionMappingProcess : public TRestEventProcess { RESTMetadata << "the mode is:" << RESTendl; RESTMetadata << (fApplyGainCorrection ? "> " : " ") - << "Apply position correction std::map for spectrum " << RESTendl; - RESTMetadata << (fCreateGainMap ? "> " : " ") << "Create new correction std::map for each position" - << RESTendl; + << "Apply position correction std::map for spectrum " << RESTendl; + RESTMetadata << (fCreateGainMap ? "> " : " ") + << "Create new correction std::map for each position" << RESTendl; RESTMetadata << "output mapping file: " << fMappingSave << RESTendl; RESTMetadata << "Energy cut for Threshold integral: " << any(fEnergyCutRange) << RESTendl; RESTMetadata << "Energy cut for NGoodSignals: " << any(fNHitsCutRange) << RESTendl; diff --git a/inc/TRestDetectorReadoutEventViewer.h b/inc/TRestDetectorReadoutEventViewer.h index ef59e6a01..1f6c20df4 100644 --- a/inc/TRestDetectorReadoutEventViewer.h +++ b/inc/TRestDetectorReadoutEventViewer.h @@ -20,7 +20,7 @@ #include "TRestDetectorSignalEvent.h" #include "TRestEventViewer.h" -//#include "TRestDecoding.h" +// #include "TRestDecoding.h" #include "TH2Poly.h" #include "TRestDetectorReadout.h" diff --git a/inc/TRestDetectorSingleChannelAnalysisProcess.h b/inc/TRestDetectorSingleChannelAnalysisProcess.h index 22e11759f..1238f41dd 100644 --- a/inc/TRestDetectorSingleChannelAnalysisProcess.h +++ b/inc/TRestDetectorSingleChannelAnalysisProcess.h @@ -66,9 +66,9 @@ class TRestDetectorSingleChannelAnalysisProcess : public TRestEventProcess { RESTMetadata << "the mode is:" << RESTendl; RESTMetadata << (fApplyGainCorrection ? "> " : " ") - << "Apply channel correction std::map for spectrum " << RESTendl; - RESTMetadata << (fCreateGainMap ? "> " : " ") << "Create new correction std::map for each channel" - << RESTendl; + << "Apply channel correction std::map for spectrum " << RESTendl; + RESTMetadata << (fCreateGainMap ? "> " : " ") + << "Create new correction std::map for each channel" << RESTendl; RESTMetadata << "output mapping file: " << fCalibSave << RESTendl; RESTMetadata << "Energy cut for Threshold integral: " << any(fThrIntegralCutRange) << RESTendl; RESTMetadata << "Energy cut for NGoodSignals: " << any(fNGoodSignalsCutRange) << RESTendl; diff --git a/macros/REST_Detector_ViewHitsEvent.C b/macros/REST_Detector_ViewHitsEvent.C index 0262d1f2b..dae968513 100644 --- a/macros/REST_Detector_ViewHitsEvent.C +++ b/macros/REST_Detector_ViewHitsEvent.C @@ -1,6 +1,6 @@ #include "TRestBrowser.h" -#include "TRestTask.h" #include "TRestDetectorHitsEvent.h" +#include "TRestTask.h" #ifndef RestTask_ViewHitsEvents #define RestTask_ViewHitsEvents diff --git a/pipeline/clang-format/clang-format.sh b/pipeline/clang-format/clang-format.sh index 09ad26806..f06fdef50 100755 --- a/pipeline/clang-format/clang-format.sh +++ b/pipeline/clang-format/clang-format.sh @@ -106,4 +106,3 @@ if [ "-" = "$1" ] ; then }"' '"${file}"' done fi - diff --git a/pipeline/clang-format/clangformattest.sh b/pipeline/clang-format/clangformattest.sh index 41defb1e7..6c4fb55f4 100755 --- a/pipeline/clang-format/clangformattest.sh +++ b/pipeline/clang-format/clangformattest.sh @@ -52,4 +52,3 @@ fi git reset HEAD --hard exit 1 - diff --git a/pipeline/validateLibrary.py b/pipeline/validateLibrary.py index 6510e05e0..c943d94df 100755 --- a/pipeline/validateLibrary.py +++ b/pipeline/validateLibrary.py @@ -5,7 +5,7 @@ # J. Galan - Javier.Galan.Lacarra@cern.ch # 23 - Dec - 2019 -#from __future__ import print_function +# from __future__ import print_function import os import sys import re @@ -14,41 +14,42 @@ def validateClass(className): - print ("") - print ("++++ Validating class : " + className) - with open(className, 'r', encoding="utf-8") as file: + print("") + print("++++ Validating class : " + className) + with open(className, "r", encoding="utf-8") as file: data = file.read() - data = data[data.find("::Initialize"):] + data = data[data.find("::Initialize") :] data = getMethodDefinition(data) data = removeCppComment(data) - #print (data) - #print data.find("SETLIBRARYVERSION(LIBRARY_VERSION);") + # print (data) + # print data.find("SETLIBRARYVERSION(LIBRARY_VERSION);") if data.find("SETLIBRARYVERSION(LIBRARY_VERSION);") >= 0: - print ("OK") + print("OK") return else: - print( "Problem found at class : " + className ) - print( "SetLibraryVersion was NOT found at Initialization!" ) + print("Problem found at class : " + className) + print("SetLibraryVersion was NOT found at Initialization!") sys.exit(1) return + def getObservablePositions(data): obsposes = {} pos = 0 - str = "SETOBSERVABLEVALUE(\"" - while(pos < len(data)): - pos1 = data.find(str,pos) - if(pos1 == -1): - break + str = 'SETOBSERVABLEVALUE("' + while pos < len(data): + pos1 = data.find(str, pos) + if pos1 == -1: + break pos1 += len(str) - pos2 = data.find("\"",pos1) - if(pos2 == -1): - break + pos2 = data.find('"', pos1) + if pos2 == -1: + break name = data[pos1:pos2] - if(not name in obsposes): + if not name in obsposes: obsposes[name] = pos1 pos = pos2 + 1 @@ -60,115 +61,120 @@ def getMethodDefinition(text): counter = 1 start = initPos + 1 - while(counter > 0): - pos1 = text.find("{",start) - pos2 = text.find("}",start) + while counter > 0: + pos1 = text.find("{", start) + pos2 = text.find("}", start) endPosition = pos2 + 1 - if(pos1 != -1 and pos2 != -1): - if(pos1 < pos2): + if pos1 != -1 and pos2 != -1: + if pos1 < pos2: counter = counter + 1 start = pos1 + 1 - if(pos2 < pos1): + if pos2 < pos1: counter = counter - 1 start = pos2 + 1 elif pos1 != -1: - print ("Big error!!") + print("Big error!!") else: - counter = counter - 1 - start = pos2 + 1 + counter = counter - 1 + start = pos2 + 1 return text[initPos:endPosition].upper() -def removeCppComment(strInput) : - state = 0; - strOutput = '' - strRemoved = '' - - for c in strInput : - if state == 0 and c == '/' : # ex. [/] - state = 1 - elif state == 1 and c == '*' : # ex. [/*] - state = 2 - elif state == 1 and c == '/' : # ex. [#] - state = 4 - elif state == 1 : # ex. [ or 5/3] - state = 0 - - elif state == 3 and c == '*': # ex. [/*he**] - state = 3 - elif state == 2 and c == '*': # ex. [/*he*] - state = 3 - elif state == 2: # ex. [/*heh] - state = 2 - - elif state == 3 and c == '/': # ex. [/*heh*/] - state = 0 - elif state == 3: # ex. [/*heh*e] - state = 2 - - elif state == 4 and c == '\\': # ex. [//hehe\] - state = 9 - elif state == 9 and c == '\\': # ex. [//hehe\\\\\] - state = 9 - elif state == 9: # ex. [//hehe\ or //hehe\a] - state = 4 - elif state == 4 and c == '\n': # ex. [//hehe] - state = 0 - - elif state == 0 and c == '\'': # ex. ['] - state = 5 - elif state == 5 and c == '\\': # ex. ['\] - state = 6 - elif state == 6: # ex. ['\n or '\' or '\t etc.] - state = 5 - elif state == 5 and c == '\'': # ex. ['\n' or '\'' or '\t' ect.] - state = 0 - - elif state == 0 and c == '\"': # ex. ["] - state = 7 - elif state == 7 and c == '\\': # ex. ["\] - state = 8 - elif state == 8: # ex. ["\n or "\" or "\t ect.] - state = 7 - elif state == 7 and c == '\"': # ex. ["\n" or "\"" or "\t" ect.] - state = 0 - - if (state == 0 and c != '/') or state == 5 or\ - state == 6 or state == 7 or state == 8 : - strOutput += c - else: - # removed chareters - strRemoved += c - - return strOutput +def removeCppComment(strInput): + state = 0 + strOutput = "" + strRemoved = "" + + for c in strInput: + if state == 0 and c == "/": # ex. [/] + state = 1 + elif state == 1 and c == "*": # ex. [/*] + state = 2 + elif state == 1 and c == "/": # ex. [#] + state = 4 + elif state == 1: # ex. [ or 5/3] + state = 0 + + elif state == 3 and c == "*": # ex. [/*he**] + state = 3 + elif state == 2 and c == "*": # ex. [/*he*] + state = 3 + elif state == 2: # ex. [/*heh] + state = 2 + + elif state == 3 and c == "/": # ex. [/*heh*/] + state = 0 + elif state == 3: # ex. [/*heh*e] + state = 2 + + elif state == 4 and c == "\\": # ex. [//hehe\] + state = 9 + elif state == 9 and c == "\\": # ex. [//hehe\\\\\] + state = 9 + elif state == 9: # ex. [//hehe\ or //hehe\a] + state = 4 + elif state == 4 and c == "\n": # ex. [//hehe] + state = 0 + + elif state == 0 and c == "'": # ex. ['] + state = 5 + elif state == 5 and c == "\\": # ex. ['\] + state = 6 + elif state == 6: # ex. ['\n or '\' or '\t etc.] + state = 5 + elif state == 5 and c == "'": # ex. ['\n' or '\'' or '\t' ect.] + state = 0 + + elif state == 0 and c == '"': # ex. ["] + state = 7 + elif state == 7 and c == "\\": # ex. ["\] + state = 8 + elif state == 8: # ex. ["\n or "\" or "\t ect.] + state = 7 + elif state == 7 and c == '"': # ex. ["\n" or "\"" or "\t" ect.] + state = 0 + + if ( + (state == 0 and c != "/") + or state == 5 + or state == 6 + or state == 7 + or state == 8 + ): + strOutput += c + else: + # removed chareters + strRemoved += c + + return strOutput files = [] # r=root, d=directories, f = files for r, d, f in os.walk(sys.argv[1]): - for file in f: - validate = 0 - if '.cxx' in file: -# print ( file ) - with open(os.path.join(r, file), encoding="utf-8") as fin: - if '::InitFromConfigFile' in fin.read(): - validate = 1 - with open(os.path.join(r, file), encoding="utf-8") as fin: - if '::LoadDefaultConfig' in fin.read(): - validate = 1 - with open(os.path.join(r, file), encoding="utf-8") as fin: - if '::Initialize' in fin.read(): - validate = validate + 1 - if validate == 2: - files.append(os.path.join(r, file)) - validateClass(os.path.join(r, file)) - -#for f in files: + for file in f: + validate = 0 + if ".cxx" in file: + # print ( file ) + with open(os.path.join(r, file), encoding="utf-8") as fin: + if "::InitFromConfigFile" in fin.read(): + validate = 1 + with open(os.path.join(r, file), encoding="utf-8") as fin: + if "::LoadDefaultConfig" in fin.read(): + validate = 1 + with open(os.path.join(r, file), encoding="utf-8") as fin: + if "::Initialize" in fin.read(): + validate = validate + 1 + if validate == 2: + files.append(os.path.join(r, file)) + validateClass(os.path.join(r, file)) + +# for f in files: # print(f) -#validateProcess(sys.argv[1]); +# validateProcess(sys.argv[1]); sys.exit(0) diff --git a/src/TRestDetectorElectronDiffusionProcess.cxx b/src/TRestDetectorElectronDiffusionProcess.cxx index 1f8e8ee3b..ebe805258 100644 --- a/src/TRestDetectorElectronDiffusionProcess.cxx +++ b/src/TRestDetectorElectronDiffusionProcess.cxx @@ -70,25 +70,28 @@ void TRestDetectorElectronDiffusionProcess::InitProcess() { if (fGas == nullptr) { if (fLonglDiffCoeff == -1 || fTransDiffCoeff == -1) { RESTWarning << "Gas has not been initialized" << RESTendl; - RESTError << "TRestDetectorElectronDiffusionProcess: diffusion parameters are not defined in the rml " - "file!" - << RESTendl; + RESTError + << "TRestDetectorElectronDiffusionProcess: diffusion parameters are not defined in the rml " + "file!" + << RESTendl; exit(-1); } if (fWvalue == -1) { RESTWarning << "Gas has not been initialized" << RESTendl; - RESTError << "TRestDetectorElectronDiffusionProcess: gas work function has not been defined in the " - "rml file!" - << RESTendl; + RESTError + << "TRestDetectorElectronDiffusionProcess: gas work function has not been defined in the " + "rml file!" + << RESTendl; exit(-1); } } else { #ifndef USE_Garfield RESTError << "A TRestDetectorGas definition was found but REST was not linked to Garfield libraries." - << RESTendl; - RESTError << "Please, remove the TRestDetectorGas definition, and add gas parameters inside the process " - "TRestDetectorElectronDiffusionProcess" - << RESTendl; + << RESTendl; + RESTError + << "Please, remove the TRestDetectorGas definition, and add gas parameters inside the process " + "TRestDetectorElectronDiffusionProcess" + << RESTendl; exit(1); #endif if (fGasPressure <= 0) fGasPressure = fGas->GetPressure(); diff --git a/src/TRestDetectorReadoutChannel.cxx b/src/TRestDetectorReadoutChannel.cxx index 1455d762f..64ae1696c 100644 --- a/src/TRestDetectorReadoutChannel.cxx +++ b/src/TRestDetectorReadoutChannel.cxx @@ -95,7 +95,8 @@ void TRestDetectorReadoutChannel::Print(int DetailLevel) { else if (GetType() == Channel_W) typestr = "W"; - RESTMetadata << " Total pixels : " << GetNumberOfPixels() << " Channel type : " << typestr << RESTendl; + RESTMetadata << " Total pixels : " << GetNumberOfPixels() << " Channel type : " << typestr + << RESTendl; RESTMetadata << "+++++++++++++++++++++++++++++++++++++++++++++++++" << RESTendl; if (DetailLevel - 1 >= 0) diff --git a/src/TRestDetectorReadoutPixel.cxx b/src/TRestDetectorReadoutPixel.cxx index 526e96a59..591f55e36 100644 --- a/src/TRestDetectorReadoutPixel.cxx +++ b/src/TRestDetectorReadoutPixel.cxx @@ -154,9 +154,9 @@ TVector2 TRestDetectorReadoutPixel::TransformToPixelCoordinates(TVector2 p) { /// void TRestDetectorReadoutPixel::Print() { RESTMetadata << " ## Pixel position : (" << GetOriginX() << "," << GetOriginY() << ") mm size : (" - << GetSizeX() << "," << GetSizeY() << ") mm" << RESTendl; + << GetSizeX() << "," << GetSizeY() << ") mm" << RESTendl; RESTMetadata << " rotation : " << fRotation << " degrees" - << " type : "; + << " type : "; if (fTriangle) RESTMetadata << "triangle" << RESTendl; else diff --git a/src/TRestDetectorSignal.cxx b/src/TRestDetectorSignal.cxx index ea41b7478..2fa54a533 100644 --- a/src/TRestDetectorSignal.cxx +++ b/src/TRestDetectorSignal.cxx @@ -24,6 +24,7 @@ ///_______________________________________________________________________________ #include "TRestDetectorSignal.h" + #include "TFitResult.h" using namespace std; @@ -31,6 +32,7 @@ using namespace std; #include #include #include + #include "TCanvas.h" ClassImp(TRestDetectorSignal); diff --git a/src/TRestDetectorSignalChannelActivityProcess.cxx b/src/TRestDetectorSignalChannelActivityProcess.cxx index a1f154856..be60a3eb4 100644 --- a/src/TRestDetectorSignalChannelActivityProcess.cxx +++ b/src/TRestDetectorSignalChannelActivityProcess.cxx @@ -155,8 +155,10 @@ void TRestDetectorSignalChannelActivityProcess::LoadConfig(const string& configF void TRestDetectorSignalChannelActivityProcess::InitProcess() { fReadout = GetMetadata(); - RESTDebug << "TRestDetectorSignalChannelActivityProcess::InitProcess. Readout pointer : " << fReadout << RESTendl; - if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Info && fReadout) fReadout->PrintMetadata(); + RESTDebug << "TRestDetectorSignalChannelActivityProcess::InitProcess. Readout pointer : " << fReadout + << RESTendl; + if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Info && fReadout) + fReadout->PrintMetadata(); if (!fReadOnly) { fDaqChannelsHisto = new TH1D("daqChannelActivity", "daqChannelActivity", fDaqHistogramChannels, @@ -252,7 +254,8 @@ TRestEvent* TRestDetectorSignalChannelActivityProcess::ProcessEvent(TRestEvent* } } - if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) fAnalysisTree->PrintObservables(); + if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) + fAnalysisTree->PrintObservables(); return fSignalEvent; } diff --git a/src/TRestDetectorSignalViewerProcess.cxx b/src/TRestDetectorSignalViewerProcess.cxx index 62feffd4a..3e47d28e7 100644 --- a/src/TRestDetectorSignalViewerProcess.cxx +++ b/src/TRestDetectorSignalViewerProcess.cxx @@ -98,8 +98,8 @@ TRestEvent* TRestDetectorSignalViewerProcess::ProcessEvent(TRestEvent* inputEven RESTcout.setborder(""); RESTcout.setorientation(TRestStringOutput::REST_Display_Orientation::kLeft); RESTcout << "Press Enter to continue\nPress Esc to stop viewing\nPress n/p to " - "switch signals" - << RESTendl; + "switch signals" + << RESTendl; while (true) { int a = GetChar("");