From 92e1c09543ebed7dd5d3216457b8039fbb8aef4e Mon Sep 17 00:00:00 2001 From: jgalan Date: Tue, 3 May 2022 14:03:24 +0200 Subject: [PATCH 01/11] REST_MakeMetadata.C Adding a macro to generate a metadata class template --- macros/REST_MakeMetadata.C | 242 +++++++++++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 macros/REST_MakeMetadata.C diff --git a/macros/REST_MakeMetadata.C b/macros/REST_MakeMetadata.C new file mode 100644 index 000000000..7ef25e475 --- /dev/null +++ b/macros/REST_MakeMetadata.C @@ -0,0 +1,242 @@ +#include + +#include "TRestReflector.h" +#include "TRestStringHelper.h" +#include "TString.h" + +#ifndef RESTTask_MakeMetadata +#define RESTTask_MakeMetadata + +//******************************************************************************************************* +//*** +//*** This macro will generate a source .cxx and a header file serving as a template for new +//*** metadata classes. Please, replace any REMOVE comment with useful information. +//*** +//******************************************************************************************************* +Int_t REST_MakeMetadata(TString name) { + if (name.First("TRest") != 0) { + ferr << "invalid process name! REST process name must be start with \"TRest\" " << endl; + return -1; + } + + ofstream headerfile(name + ".h"); + if (headerfile.fail()) { + ferr << "failed to create file!" << endl; + return -1; + } + + headerfile << "/*************************************************************************" << endl; + headerfile << " * This file is part of the REST software framework. *" << endl; + headerfile << " * *" << endl; + headerfile << " * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *" << endl; + headerfile << " * For more information see http://gifna.unizar.es/trex *" << endl; + headerfile << " * *" << endl; + headerfile << " * REST is free software: you can redistribute it and/or modify *" << endl; + headerfile << " * it under the terms of the GNU General Public License as published by *" << endl; + headerfile << " * the Free Software Foundation, either version 3 of the License, or *" << endl; + headerfile << " * (at your option) any later version. *" << endl; + headerfile << " * *" << endl; + headerfile << " * REST is distributed in the hope that it will be useful, *" << endl; + headerfile << " * but WITHOUT ANY WARRANTY; without even the implied warranty of *" << endl; + headerfile << " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *" << endl; + headerfile << " * GNU General Public License for more details. *" << endl; + headerfile << " * *" << endl; + headerfile << " * You should have a copy of the GNU General Public License along with *" << endl; + headerfile << " * REST in $REST_PATH/LICENSE. *" << endl; + headerfile << " * If not, see http://www.gnu.org/licenses/. *" << endl; + headerfile << " * For the list of contributors see $REST_PATH/CREDITS. *" << endl; + headerfile << " *************************************************************************/" << endl; + headerfile << endl; + headerfile << "#ifndef REST_" << name << endl; + headerfile << "#define REST_" << name << endl; + headerfile << endl; + headerfile << "#include \"TRestMetadata.h\"" << endl; + headerfile << endl; + headerfile << "/// UPDATE Write here a brief description. Just one line!" << endl; + headerfile << "class " << name << " : public TRestMetadata {" << endl; + headerfile << "private:" << endl; + headerfile << "" << endl; + headerfile << " // REMOVE COMMENT. Add here the members/parameters for your metadata class." << endl; + headerfile << " // You can set their default values here together. " << endl; + headerfile << " // Note: add \"//!\" mark at the end of the member definition" << endl; + headerfile + << " // if you don't want to save them to disk. The following dummy member are given as examples." + << endl; + headerfile << "" << endl; + headerfile << " /// REMOVE MEMBER. A dummy member that will be written to the ROOT file." << endl; + headerfile << " Double_t fDummy = 3.14; //<" << endl; + headerfile << "" << endl; + headerfile << " /// REMOVE MEMBER. A dummy member that will be NOT written to the ROOT file." << endl; + headerfile << " Double_t fDummyVar = 3.14; //!" << endl; + headerfile << endl; + headerfile << " void Initialize();" << endl; + headerfile << endl; + headerfile << "public:" << endl; + headerfile << " void PrintMetadata();" << endl; + headerfile << endl; + headerfile << " " << name << "();" << endl; + headerfile << " " << name << "(const char* cfgFileName, std::string name = \"\")" << endl; + headerfile << " ~" << name << "();" << endl; + headerfile << endl; + headerfile << " // REMOVE COMMENT. ROOT class definition helper. Increase the number in it every time" + << endl; + headerfile << " // you add/rename/remove the metadata members" << endl; + headerfile << " ClassDef(" << name << ", 1);" << endl; + headerfile << endl; + headerfile << "};" << endl; + headerfile << "#endif" << endl; + + headerfile.flush(); + headerfile.close(); + + ofstream sourcefile(name + ".cxx"); + if (headerfile.fail()) { + ferr << "failed to create file!" << endl; + return -1; + } + + sourcefile << "/*************************************************************************" << endl; + sourcefile << " * This file is part of the REST software framework. *" << endl; + sourcefile << " * *" << endl; + sourcefile << " * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *" << endl; + sourcefile << " * For more information see http://gifna.unizar.es/trex *" << endl; + sourcefile << " * *" << endl; + sourcefile << " * REST is free software: you can redistribute it and/or modify *" << endl; + sourcefile << " * it under the terms of the GNU General Public License as published by *" << endl; + sourcefile << " * the Free Software Foundation, either version 3 of the License, or *" << endl; + sourcefile << " * (at your option) any later version. *" << endl; + sourcefile << " * *" << endl; + sourcefile << " * REST is distributed in the hope that it will be useful, *" << endl; + sourcefile << " * but WITHOUT ANY WARRANTY; without even the implied warranty of *" << endl; + sourcefile << " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *" << endl; + sourcefile << " * GNU General Public License for more details. *" << endl; + sourcefile << " * *" << endl; + sourcefile << " * You should have a copy of the GNU General Public License along with *" << endl; + sourcefile << " * REST in $REST_PATH/LICENSE. *" << endl; + sourcefile << " * If not, see http://www.gnu.org/licenses/. *" << endl; + sourcefile << " * For the list of contributors see $REST_PATH/CREDITS. *" << endl; + sourcefile << " *************************************************************************/" << endl; + sourcefile << "" << endl; + sourcefile << "/////////////////////////////////////////////////////////////////////////" << endl; + sourcefile << "/// Write the class description Here " << endl; + sourcefile << "/// " << endl; + sourcefile << "/// ### Parameters" << endl; + sourcefile << "/// Describe any parameters this process receives: " << endl; + sourcefile << "/// * **parameter1**: This parameter ..." << endl; + sourcefile << "/// * **parameter2**: This parameter is ..." << endl; + sourcefile << "/// " << endl; + sourcefile << "/// " << endl; + sourcefile << "/// ### Examples" << endl; + sourcefile << "/// Give examples of usage and RML descriptions that can be tested. " << endl; + sourcefile << "/// \\code" << endl; + sourcefile << "/// " << endl; + sourcefile << "/// \\endcode" << endl; + sourcefile << "/// " << endl; + sourcefile << "/// ### Running pipeline example" << endl; + sourcefile << "/// Add the examples to a pipeline to guarantee the code will be running " << endl; + sourcefile << "/// on future framework upgrades. " << endl; + sourcefile << "/// " << endl; + sourcefile << "/// " << endl; + sourcefile << "/// Please, add any figure that may help to ilustrate the process " << endl; + sourcefile << "/// " << endl; + sourcefile + << "/// \\htmlonly \\endhtmlonly" + << endl; + sourcefile << "/// ![An ilustration of the trigger definition](trigger.png) " << endl; + sourcefile << "/// " << endl; + sourcefile << "/// The png image should be uploaded to the ./images/ directory " << endl; + sourcefile << "/// " << endl; + sourcefile << "///----------------------------------------------------------------------" << endl; + sourcefile << "/// " << endl; + sourcefile << "/// REST-for-Physics - Software for Rare Event Searches Toolkit " << endl; + sourcefile << "/// " << endl; + sourcefile << "/// History of developments: " << endl; + sourcefile << "/// " << endl; + sourcefile << "/// YEAR-Month: First implementation of " << name << endl; + sourcefile << "/// WRITE YOUR FULL NAME " << endl; + sourcefile << "/// " << endl; + sourcefile << "/// \\class " << name << " " << endl; + sourcefile << "/// \\author: TODO. Write full name and e-mail: " << getenv("USER") << endl; + sourcefile << "/// " << endl; + sourcefile << "///
" << endl; + sourcefile << "/// " << endl; + sourcefile << endl; + sourcefile << "#include \"" << name << ".h\"" << endl; + sourcefile << endl; + sourcefile << "ClassImp(" << name << ");" << endl; + sourcefile << endl; + sourcefile << "/////////////////////////////////////////////// " << endl; + sourcefile << "/// \\brief Default constructor " << endl; + sourcefile << "/// " << endl; + sourcefile << name << "::" << name << "() {" << endl; + sourcefile << " Initialize();" << endl; + sourcefile << "}" << endl; + sourcefile << endl; + sourcefile << "/////////////////////////////////////////////" << endl; + sourcefile << "/// \\brief Constructor loading data from a config file" << endl; + sourcefile << "///" << endl; + sourcefile << "/// If no configuration path is defined using TRestMetadata::SetConfigFilePath" << endl; + sourcefile << "/// the path to the config file must be specified using full path, absolute or" << endl; + sourcefile << "/// relative." << endl; + sourcefile << "///" << endl; + sourcefile << "/// The default behaviour is that the config file must be specified with" << endl; + sourcefile << "/// full path, absolute or relative." << endl; + sourcefile << "///" << endl; + sourcefile << "/// \\param cfgFileName A const char* giving the path to an RML file." << endl; + sourcefile << "/// \\param name The name of the specific metadata. It will be used to find the" << endl; + sourcefile << "/// corresponding TRestAxionMagneticField section inside the RML." << endl; + sourcefile << "///" << endl; + sourcefile << name << "::" << name + << "(const char* cfgFileName, string name) : TRestMetadata(cfgFileName) {" << endl; + sourcefile << " LoadConfigFromFile(fConfigFileName, name);" << endl; + sourcefile << "" << endl; + sourcefile << " if (GetVerboseLevel() >= REST_Info) PrintMetadata();" << endl; + sourcefile << "}" << endl; + sourcefile << endl; + sourcefile << "/////////////////////////////////////////////// " << endl; + sourcefile << "/// \\brief Default destructor " << endl; + sourcefile << "/// " << endl; + sourcefile << name << "::~" << name << "() {" << endl; + sourcefile << "}" << endl; + sourcefile << endl; + sourcefile << "/////////////////////////////////////////////// " << endl; + sourcefile << "/// \\brief Function to initialize input/output event members and define " << endl; + sourcefile << "/// the section name " << endl; + sourcefile << "/// " << endl; + sourcefile << "void " << name << "::Initialize() {" << endl; + sourcefile << " SetSectionName(this->ClassName());" << endl; + sourcefile << " SetLibraryVersion(LIBRARY_VERSION);" << endl; + sourcefile << endl; + sourcefile << " // REMOVE COMMENT. Initialize here any special data members if needed " << endl; + sourcefile << endl; + sourcefile << "}" << endl; + sourcefile << endl; + sourcefile << "/////////////////////////////////////////////" << endl; + sourcefile + << "/// \\brief Prints on screen the information about the metadata members of TRestAxionSolarFlux" + << endl; + sourcefile << "///" << endl; + sourcefile << "void " << name << "::PrintMetadata() {" << endl; + sourcefile << " TRestMetadata::PrintMetadata();" << endl; + sourcefile << endl; + sourcefile << " metadata << \" - Dummy member : \" << fDummy<< endl;" << endl; + sourcefile << "}" << endl; + sourcefile << endl; + + sourcefile.flush(); + sourcefile.close(); + + cout << endl; + cout << "--------------------------------" << endl; + cout << "Metadata class code generation complete!" << endl; + cout << "* " << name << ".h" << endl; + cout << "* " << name << ".cxx" << endl; + cout << endl; + cout << "Put the two files into proper directories and re-run cmake/make" << endl; + cout << "Remember to replace REMOVE/UPDATE statements by meaningfull documentation" << endl; + cout << "--------------------------------" << endl; + cout << endl; + + return 0; +} +#endif From e4725b7a1a6c0f2650f14c5499e32a4d268e0c38 Mon Sep 17 00:00:00 2001 From: jgalan Date: Tue, 3 May 2022 14:04:51 +0200 Subject: [PATCH 02/11] Disabling ctest pipeline --- .gitlab-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b113cc2e..23aa5d6dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,16 +78,16 @@ Validate Code: - python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} - python3 pipeline/validateProcesses.py source/libraries/ -Build and Test: - stage: test - script: - - cd ${CI_PROJECT_DIR} - - python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} - - mkdir ${CI_PROJECT_DIR}/build && cd ${CI_PROJECT_DIR}/build - - cmake ${CI_PROJECT_DIR} - -DTEST=ON -DREST_GARFIELD=ON -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON - - make -j2 - - ctest --verbose -O ${CI_PROJECT_DIR}/build/Testing/summary.txt + #Build and Test: + # stage: test + # script: + # - cd ${CI_PROJECT_DIR} + # - python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} + # - mkdir ${CI_PROJECT_DIR}/build && cd ${CI_PROJECT_DIR}/build + # - cmake ${CI_PROJECT_DIR} + # -DTEST=ON -DREST_GARFIELD=ON -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON + # - make -j2 + # - ctest --verbose -O ${CI_PROJECT_DIR}/build/Testing/summary.txt artifacts: name: "Testing" From 5743fd43087c1ed4f17cbbe7de952a2e27c9ce15 Mon Sep 17 00:00:00 2001 From: Luis Obis <35803280+lobis@users.noreply.github.com> Date: Tue, 3 May 2022 14:35:26 +0200 Subject: [PATCH 03/11] .gitlab-ci.yml - enabled back testing but disabled Garfield --- .gitlab-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23aa5d6dc..94659ab1b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,16 +78,16 @@ Validate Code: - python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} - python3 pipeline/validateProcesses.py source/libraries/ - #Build and Test: - # stage: test - # script: - # - cd ${CI_PROJECT_DIR} - # - python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} - # - mkdir ${CI_PROJECT_DIR}/build && cd ${CI_PROJECT_DIR}/build - # - cmake ${CI_PROJECT_DIR} - # -DTEST=ON -DREST_GARFIELD=ON -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON - # - make -j2 - # - ctest --verbose -O ${CI_PROJECT_DIR}/build/Testing/summary.txt +Build and Test: + stage: test + script: + - cd ${CI_PROJECT_DIR} + - python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} + - mkdir ${CI_PROJECT_DIR}/build && cd ${CI_PROJECT_DIR}/build + - cmake ${CI_PROJECT_DIR} + -DTEST=ON -DREST_GARFIELD=OFF -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON + - make -j2 + - ctest --verbose -O ${CI_PROJECT_DIR}/build/Testing/summary.txt artifacts: name: "Testing" From ae7e0ee6f61b8cda61d354a31c5fdc3ef5941edc Mon Sep 17 00:00:00 2001 From: jgalan Date: Tue, 3 May 2022 17:02:37 +0200 Subject: [PATCH 04/11] Fixing basic-readouts pipeline --- .gitlab-ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23aa5d6dc..d514535f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -89,11 +89,11 @@ Validate Code: # - make -j2 # - ctest --verbose -O ${CI_PROJECT_DIR}/build/Testing/summary.txt - artifacts: - name: "Testing" - paths: - - ${CI_PROJECT_DIR}/build/Testing - expire_in: 1 day + # artifacts: + # name: "Testing" + # paths: + # - ${CI_PROJECT_DIR}/build/Testing + # expire_in: 1 day Build and Install: stage: build @@ -220,9 +220,9 @@ Basic Readout: script: - source ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/projects/basic-readouts/ + - git submodule update --init + - git pull - ls - - git status - - git log - restRoot --m 1 -b -q GenerateReadouts.C'("basic.root")' - restRoot -b -q BasicValidation.C'("basic.root", "pixelDecoding")' From b1ec8e3ffc290b9a7896e9f0f1f76178988bd679 Mon Sep 17 00:00:00 2001 From: Javier Galan Date: Tue, 3 May 2022 17:30:29 +0200 Subject: [PATCH 05/11] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f149e115e..8aca683e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -223,7 +223,7 @@ Basic Readout: - git submodule update --init - git pull - ls - - restRoot --m 1 -b -q GenerateReadouts.C'("basic.root")' + - restRoot -b -q GenerateReadouts.C'("basic.root")' - restRoot -b -q BasicValidation.C'("basic.root", "pixelDecoding")' Test Metadata: From acd34daa32d15fe18dcdb6d2a319c9c3c9252dfc Mon Sep 17 00:00:00 2001 From: jgalan Date: Tue, 3 May 2022 17:38:41 +0200 Subject: [PATCH 06/11] Fixing basic-readouts --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8aca683e8..cb2fae945 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -219,9 +219,9 @@ Basic Readout: stage: metadata script: - source ${CI_PROJECT_DIR}/install/thisREST.sh - - cd ${CI_PROJECT_DIR}/projects/basic-readouts/ - - git submodule update --init - - git pull + - cd ${CI_PROJECT_DIR}/projects/ + - git clone --recurse-submodules="basic-readouts" + - cd basic-readouts - ls - restRoot -b -q GenerateReadouts.C'("basic.root")' - restRoot -b -q BasicValidation.C'("basic.root", "pixelDecoding")' From 81e1de6c97404343c0b15bf75b082289081d5669 Mon Sep 17 00:00:00 2001 From: Javier Galan Date: Tue, 3 May 2022 19:43:04 +0200 Subject: [PATCH 07/11] Fixing basic-readouts --- .gitlab-ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb2fae945..3c0a5f195 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -219,10 +219,8 @@ Basic Readout: stage: metadata script: - source ${CI_PROJECT_DIR}/install/thisREST.sh - - cd ${CI_PROJECT_DIR}/projects/ - - git clone --recurse-submodules="basic-readouts" - - cd basic-readouts - - ls + - cd ${CI_PROJECT_DIR}/projects/basic-readouts + - git submodule update --init . - restRoot -b -q GenerateReadouts.C'("basic.root")' - restRoot -b -q BasicValidation.C'("basic.root", "pixelDecoding")' From 88cdc5f15f4f2afa867a1892942207de1a2e0934 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 4 May 2022 11:27:50 +0200 Subject: [PATCH 08/11] .gitlab-ci.yml - added back testing artifacts, updated .gitlab-ci.yml following deprecation warnings --- .gitlab-ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c0a5f195..c995d191e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics -variables: +# variables: # GIT_SUBMODULE_STRATEGY: recursive stages: @@ -13,7 +13,7 @@ stages: # Project compilation validation - build - # REST libraries installed as sub-modules + # REST libraries installed as submodules - libraries # Basic validation tests of installation @@ -34,7 +34,7 @@ stages: # Stage to validate data chain processing constructions (TREX-DM data, PandaX-III topology, etc). - restManager_process - # Stage to validate tasks or executions over preprocessed data filesx + # Stage to validate tasks or executions over preprocessed data files - postProcessing # Stage to validate other restManager tasks (metadata generation, script loading, etc). @@ -89,11 +89,11 @@ Build and Test: - make -j2 - ctest --verbose -O ${CI_PROJECT_DIR}/build/Testing/summary.txt - # artifacts: - # name: "Testing" - # paths: - # - ${CI_PROJECT_DIR}/build/Testing - # expire_in: 1 day + artifacts: + name: "Testing" + paths: + - ${CI_PROJECT_DIR}/build/Testing + expire_in: 1 day Build and Install: stage: build @@ -152,7 +152,7 @@ List REST Macros: expire_in: 1 day 08_alphas: - type: restG4 + stage: restG4 script: - source ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/08.Alphas/ @@ -166,8 +166,8 @@ List REST Macros: expire_in: 1 day 01_alphaTrack: - type: examples - script: + stage: examples + script: - source ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/01.alphaTrack/ - mkdir data From cf38b423caa1de72d632b61516d18f92ee238d94 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 4 May 2022 11:29:38 +0200 Subject: [PATCH 09/11] REST_MakeMetadata.C - fix typos --- macros/REST_MakeMetadata.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros/REST_MakeMetadata.C b/macros/REST_MakeMetadata.C index 7ef25e475..6c10d4f4c 100644 --- a/macros/REST_MakeMetadata.C +++ b/macros/REST_MakeMetadata.C @@ -142,7 +142,7 @@ Int_t REST_MakeMetadata(TString name) { sourcefile << "/// \\htmlonly \\endhtmlonly" << endl; - sourcefile << "/// ![An ilustration of the trigger definition](trigger.png) " << endl; + sourcefile << "/// ![An illustration of the trigger definition](trigger.png) " << endl; sourcefile << "/// " << endl; sourcefile << "/// The png image should be uploaded to the ./images/ directory " << endl; sourcefile << "/// " << endl; @@ -233,7 +233,7 @@ Int_t REST_MakeMetadata(TString name) { cout << "* " << name << ".cxx" << endl; cout << endl; cout << "Put the two files into proper directories and re-run cmake/make" << endl; - cout << "Remember to replace REMOVE/UPDATE statements by meaningfull documentation" << endl; + cout << "Remember to replace REMOVE/UPDATE statements by meaningful documentation" << endl; cout << "--------------------------------" << endl; cout << endl; From 396e7a70b4bbdabcbeec566154d72eedf8a62a8f Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 4 May 2022 11:33:03 +0200 Subject: [PATCH 10/11] REST_MakeMetadata.C - using https in links, typos, aligned things, using <> imports instead of "" --- macros/REST_MakeMetadata.C | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/macros/REST_MakeMetadata.C b/macros/REST_MakeMetadata.C index 6c10d4f4c..ce2a2653f 100644 --- a/macros/REST_MakeMetadata.C +++ b/macros/REST_MakeMetadata.C @@ -1,8 +1,9 @@ -#include -#include "TRestReflector.h" -#include "TRestStringHelper.h" -#include "TString.h" +#include +#include +#include + +#include #ifndef RESTTask_MakeMetadata #define RESTTask_MakeMetadata @@ -29,7 +30,7 @@ Int_t REST_MakeMetadata(TString name) { headerfile << " * This file is part of the REST software framework. *" << endl; headerfile << " * *" << endl; headerfile << " * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *" << endl; - headerfile << " * For more information see http://gifna.unizar.es/trex *" << endl; + headerfile << " * For more information see https://gifna.unizar.es/trex *" << endl; headerfile << " * *" << endl; headerfile << " * REST is free software: you can redistribute it and/or modify *" << endl; headerfile << " * it under the terms of the GNU General Public License as published by *" << endl; @@ -43,7 +44,7 @@ Int_t REST_MakeMetadata(TString name) { headerfile << " * *" << endl; headerfile << " * You should have a copy of the GNU General Public License along with *" << endl; headerfile << " * REST in $REST_PATH/LICENSE. *" << endl; - headerfile << " * If not, see http://www.gnu.org/licenses/. *" << endl; + headerfile << " * If not, see https://www.gnu.org/licenses/. *" << endl; headerfile << " * For the list of contributors see $REST_PATH/CREDITS. *" << endl; headerfile << " *************************************************************************/" << endl; headerfile << endl; @@ -99,7 +100,7 @@ Int_t REST_MakeMetadata(TString name) { sourcefile << " * This file is part of the REST software framework. *" << endl; sourcefile << " * *" << endl; sourcefile << " * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *" << endl; - sourcefile << " * For more information see http://gifna.unizar.es/trex *" << endl; + sourcefile << " * For more information see https://gifna.unizar.es/trex *" << endl; sourcefile << " * *" << endl; sourcefile << " * REST is free software: you can redistribute it and/or modify *" << endl; sourcefile << " * it under the terms of the GNU General Public License as published by *" << endl; @@ -113,12 +114,12 @@ Int_t REST_MakeMetadata(TString name) { sourcefile << " * *" << endl; sourcefile << " * You should have a copy of the GNU General Public License along with *" << endl; sourcefile << " * REST in $REST_PATH/LICENSE. *" << endl; - sourcefile << " * If not, see http://www.gnu.org/licenses/. *" << endl; + sourcefile << " * If not, see https://www.gnu.org/licenses/. *" << endl; sourcefile << " * For the list of contributors see $REST_PATH/CREDITS. *" << endl; sourcefile << " *************************************************************************/" << endl; sourcefile << "" << endl; sourcefile << "/////////////////////////////////////////////////////////////////////////" << endl; - sourcefile << "/// Write the class description Here " << endl; + sourcefile << "/// Write the class description Here " << endl; sourcefile << "/// " << endl; sourcefile << "/// ### Parameters" << endl; sourcefile << "/// Describe any parameters this process receives: " << endl; @@ -137,7 +138,7 @@ Int_t REST_MakeMetadata(TString name) { sourcefile << "/// on future framework upgrades. " << endl; sourcefile << "/// " << endl; sourcefile << "/// " << endl; - sourcefile << "/// Please, add any figure that may help to ilustrate the process " << endl; + sourcefile << "/// Please, add any figure that may help to illustrate the process " << endl; sourcefile << "/// " << endl; sourcefile << "/// \\htmlonly \\endhtmlonly" @@ -148,7 +149,7 @@ Int_t REST_MakeMetadata(TString name) { sourcefile << "/// " << endl; sourcefile << "///----------------------------------------------------------------------" << endl; sourcefile << "/// " << endl; - sourcefile << "/// REST-for-Physics - Software for Rare Event Searches Toolkit " << endl; + sourcefile << "/// REST-for-Physics - Software for Rare Event Searches Toolkit " << endl; sourcefile << "/// " << endl; sourcefile << "/// History of developments: " << endl; sourcefile << "/// " << endl; @@ -200,14 +201,14 @@ Int_t REST_MakeMetadata(TString name) { sourcefile << "}" << endl; sourcefile << endl; sourcefile << "/////////////////////////////////////////////// " << endl; - sourcefile << "/// \\brief Function to initialize input/output event members and define " << endl; + sourcefile << "/// \\brief Function to initialize input/output event members and define " << endl; sourcefile << "/// the section name " << endl; sourcefile << "/// " << endl; sourcefile << "void " << name << "::Initialize() {" << endl; sourcefile << " SetSectionName(this->ClassName());" << endl; sourcefile << " SetLibraryVersion(LIBRARY_VERSION);" << endl; sourcefile << endl; - sourcefile << " // REMOVE COMMENT. Initialize here any special data members if needed " << endl; + sourcefile << " // REMOVE COMMENT. Initialize here any special data members if needed" << endl; sourcefile << endl; sourcefile << "}" << endl; sourcefile << endl; @@ -219,7 +220,7 @@ Int_t REST_MakeMetadata(TString name) { sourcefile << "void " << name << "::PrintMetadata() {" << endl; sourcefile << " TRestMetadata::PrintMetadata();" << endl; sourcefile << endl; - sourcefile << " metadata << \" - Dummy member : \" << fDummy<< endl;" << endl; + sourcefile << " metadata << \" - Dummy member : \" << fDummy << endl;" << endl; sourcefile << "}" << endl; sourcefile << endl; From f0e4959a2ec1e1a584adc967a15d4feecc48114b Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 4 May 2022 11:34:31 +0200 Subject: [PATCH 11/11] REST_MakeMetadata.C - using camelCase for variables --- macros/REST_MakeMetadata.C | 374 ++++++++++++++++++------------------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/macros/REST_MakeMetadata.C b/macros/REST_MakeMetadata.C index ce2a2653f..190dc6982 100644 --- a/macros/REST_MakeMetadata.C +++ b/macros/REST_MakeMetadata.C @@ -20,212 +20,212 @@ Int_t REST_MakeMetadata(TString name) { return -1; } - ofstream headerfile(name + ".h"); - if (headerfile.fail()) { + ofstream headerFile(name + ".h"); + if (headerFile.fail()) { ferr << "failed to create file!" << endl; return -1; } - headerfile << "/*************************************************************************" << endl; - headerfile << " * This file is part of the REST software framework. *" << endl; - headerfile << " * *" << endl; - headerfile << " * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *" << endl; - headerfile << " * For more information see https://gifna.unizar.es/trex *" << endl; - headerfile << " * *" << endl; - headerfile << " * REST is free software: you can redistribute it and/or modify *" << endl; - headerfile << " * it under the terms of the GNU General Public License as published by *" << endl; - headerfile << " * the Free Software Foundation, either version 3 of the License, or *" << endl; - headerfile << " * (at your option) any later version. *" << endl; - headerfile << " * *" << endl; - headerfile << " * REST is distributed in the hope that it will be useful, *" << endl; - headerfile << " * but WITHOUT ANY WARRANTY; without even the implied warranty of *" << endl; - headerfile << " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *" << endl; - headerfile << " * GNU General Public License for more details. *" << endl; - headerfile << " * *" << endl; - headerfile << " * You should have a copy of the GNU General Public License along with *" << endl; - headerfile << " * REST in $REST_PATH/LICENSE. *" << endl; - headerfile << " * If not, see https://www.gnu.org/licenses/. *" << endl; - headerfile << " * For the list of contributors see $REST_PATH/CREDITS. *" << endl; - headerfile << " *************************************************************************/" << endl; - headerfile << endl; - headerfile << "#ifndef REST_" << name << endl; - headerfile << "#define REST_" << name << endl; - headerfile << endl; - headerfile << "#include \"TRestMetadata.h\"" << endl; - headerfile << endl; - headerfile << "/// UPDATE Write here a brief description. Just one line!" << endl; - headerfile << "class " << name << " : public TRestMetadata {" << endl; - headerfile << "private:" << endl; - headerfile << "" << endl; - headerfile << " // REMOVE COMMENT. Add here the members/parameters for your metadata class." << endl; - headerfile << " // You can set their default values here together. " << endl; - headerfile << " // Note: add \"//!\" mark at the end of the member definition" << endl; - headerfile + headerFile << "/*************************************************************************" << endl; + headerFile << " * This file is part of the REST software framework. *" << endl; + headerFile << " * *" << endl; + headerFile << " * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *" << endl; + headerFile << " * For more information see https://gifna.unizar.es/trex *" << endl; + headerFile << " * *" << endl; + headerFile << " * REST is free software: you can redistribute it and/or modify *" << endl; + headerFile << " * it under the terms of the GNU General Public License as published by *" << endl; + headerFile << " * the Free Software Foundation, either version 3 of the License, or *" << endl; + headerFile << " * (at your option) any later version. *" << endl; + headerFile << " * *" << endl; + headerFile << " * REST is distributed in the hope that it will be useful, *" << endl; + headerFile << " * but WITHOUT ANY WARRANTY; without even the implied warranty of *" << endl; + headerFile << " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *" << endl; + headerFile << " * GNU General Public License for more details. *" << endl; + headerFile << " * *" << endl; + headerFile << " * You should have a copy of the GNU General Public License along with *" << endl; + headerFile << " * REST in $REST_PATH/LICENSE. *" << endl; + headerFile << " * If not, see https://www.gnu.org/licenses/. *" << endl; + headerFile << " * For the list of contributors see $REST_PATH/CREDITS. *" << endl; + headerFile << " *************************************************************************/" << endl; + headerFile << endl; + headerFile << "#ifndef REST_" << name << endl; + headerFile << "#define REST_" << name << endl; + headerFile << endl; + headerFile << "#include \"TRestMetadata.h\"" << endl; + headerFile << endl; + headerFile << "/// UPDATE Write here a brief description. Just one line!" << endl; + headerFile << "class " << name << " : public TRestMetadata {" << endl; + headerFile << "private:" << endl; + headerFile << "" << endl; + headerFile << " // REMOVE COMMENT. Add here the members/parameters for your metadata class." << endl; + headerFile << " // You can set their default values here together. " << endl; + headerFile << " // Note: add \"//!\" mark at the end of the member definition" << endl; + headerFile << " // if you don't want to save them to disk. The following dummy member are given as examples." << endl; - headerfile << "" << endl; - headerfile << " /// REMOVE MEMBER. A dummy member that will be written to the ROOT file." << endl; - headerfile << " Double_t fDummy = 3.14; //<" << endl; - headerfile << "" << endl; - headerfile << " /// REMOVE MEMBER. A dummy member that will be NOT written to the ROOT file." << endl; - headerfile << " Double_t fDummyVar = 3.14; //!" << endl; - headerfile << endl; - headerfile << " void Initialize();" << endl; - headerfile << endl; - headerfile << "public:" << endl; - headerfile << " void PrintMetadata();" << endl; - headerfile << endl; - headerfile << " " << name << "();" << endl; - headerfile << " " << name << "(const char* cfgFileName, std::string name = \"\")" << endl; - headerfile << " ~" << name << "();" << endl; - headerfile << endl; - headerfile << " // REMOVE COMMENT. ROOT class definition helper. Increase the number in it every time" + headerFile << "" << endl; + headerFile << " /// REMOVE MEMBER. A dummy member that will be written to the ROOT file." << endl; + headerFile << " Double_t fDummy = 3.14; //<" << endl; + headerFile << "" << endl; + headerFile << " /// REMOVE MEMBER. A dummy member that will be NOT written to the ROOT file." << endl; + headerFile << " Double_t fDummyVar = 3.14; //!" << endl; + headerFile << endl; + headerFile << " void Initialize();" << endl; + headerFile << endl; + headerFile << "public:" << endl; + headerFile << " void PrintMetadata();" << endl; + headerFile << endl; + headerFile << " " << name << "();" << endl; + headerFile << " " << name << "(const char* cfgFileName, std::string name = \"\")" << endl; + headerFile << " ~" << name << "();" << endl; + headerFile << endl; + headerFile << " // REMOVE COMMENT. ROOT class definition helper. Increase the number in it every time" << endl; - headerfile << " // you add/rename/remove the metadata members" << endl; - headerfile << " ClassDef(" << name << ", 1);" << endl; - headerfile << endl; - headerfile << "};" << endl; - headerfile << "#endif" << endl; + headerFile << " // you add/rename/remove the metadata members" << endl; + headerFile << " ClassDef(" << name << ", 1);" << endl; + headerFile << endl; + headerFile << "};" << endl; + headerFile << "#endif" << endl; - headerfile.flush(); - headerfile.close(); + headerFile.flush(); + headerFile.close(); - ofstream sourcefile(name + ".cxx"); - if (headerfile.fail()) { + ofstream sourceFile(name + ".cxx"); + if (headerFile.fail()) { ferr << "failed to create file!" << endl; return -1; } - sourcefile << "/*************************************************************************" << endl; - sourcefile << " * This file is part of the REST software framework. *" << endl; - sourcefile << " * *" << endl; - sourcefile << " * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *" << endl; - sourcefile << " * For more information see https://gifna.unizar.es/trex *" << endl; - sourcefile << " * *" << endl; - sourcefile << " * REST is free software: you can redistribute it and/or modify *" << endl; - sourcefile << " * it under the terms of the GNU General Public License as published by *" << endl; - sourcefile << " * the Free Software Foundation, either version 3 of the License, or *" << endl; - sourcefile << " * (at your option) any later version. *" << endl; - sourcefile << " * *" << endl; - sourcefile << " * REST is distributed in the hope that it will be useful, *" << endl; - sourcefile << " * but WITHOUT ANY WARRANTY; without even the implied warranty of *" << endl; - sourcefile << " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *" << endl; - sourcefile << " * GNU General Public License for more details. *" << endl; - sourcefile << " * *" << endl; - sourcefile << " * You should have a copy of the GNU General Public License along with *" << endl; - sourcefile << " * REST in $REST_PATH/LICENSE. *" << endl; - sourcefile << " * If not, see https://www.gnu.org/licenses/. *" << endl; - sourcefile << " * For the list of contributors see $REST_PATH/CREDITS. *" << endl; - sourcefile << " *************************************************************************/" << endl; - sourcefile << "" << endl; - sourcefile << "/////////////////////////////////////////////////////////////////////////" << endl; - sourcefile << "/// Write the class description Here " << endl; - sourcefile << "/// " << endl; - sourcefile << "/// ### Parameters" << endl; - sourcefile << "/// Describe any parameters this process receives: " << endl; - sourcefile << "/// * **parameter1**: This parameter ..." << endl; - sourcefile << "/// * **parameter2**: This parameter is ..." << endl; - sourcefile << "/// " << endl; - sourcefile << "/// " << endl; - sourcefile << "/// ### Examples" << endl; - sourcefile << "/// Give examples of usage and RML descriptions that can be tested. " << endl; - sourcefile << "/// \\code" << endl; - sourcefile << "/// " << endl; - sourcefile << "/// \\endcode" << endl; - sourcefile << "/// " << endl; - sourcefile << "/// ### Running pipeline example" << endl; - sourcefile << "/// Add the examples to a pipeline to guarantee the code will be running " << endl; - sourcefile << "/// on future framework upgrades. " << endl; - sourcefile << "/// " << endl; - sourcefile << "/// " << endl; - sourcefile << "/// Please, add any figure that may help to illustrate the process " << endl; - sourcefile << "/// " << endl; - sourcefile + sourceFile << "/*************************************************************************" << endl; + sourceFile << " * This file is part of the REST software framework. *" << endl; + sourceFile << " * *" << endl; + sourceFile << " * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *" << endl; + sourceFile << " * For more information see https://gifna.unizar.es/trex *" << endl; + sourceFile << " * *" << endl; + sourceFile << " * REST is free software: you can redistribute it and/or modify *" << endl; + sourceFile << " * it under the terms of the GNU General Public License as published by *" << endl; + sourceFile << " * the Free Software Foundation, either version 3 of the License, or *" << endl; + sourceFile << " * (at your option) any later version. *" << endl; + sourceFile << " * *" << endl; + sourceFile << " * REST is distributed in the hope that it will be useful, *" << endl; + sourceFile << " * but WITHOUT ANY WARRANTY; without even the implied warranty of *" << endl; + sourceFile << " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *" << endl; + sourceFile << " * GNU General Public License for more details. *" << endl; + sourceFile << " * *" << endl; + sourceFile << " * You should have a copy of the GNU General Public License along with *" << endl; + sourceFile << " * REST in $REST_PATH/LICENSE. *" << endl; + sourceFile << " * If not, see https://www.gnu.org/licenses/. *" << endl; + sourceFile << " * For the list of contributors see $REST_PATH/CREDITS. *" << endl; + sourceFile << " *************************************************************************/" << endl; + sourceFile << "" << endl; + sourceFile << "/////////////////////////////////////////////////////////////////////////" << endl; + sourceFile << "/// Write the class description Here " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// ### Parameters" << endl; + sourceFile << "/// Describe any parameters this process receives: " << endl; + sourceFile << "/// * **parameter1**: This parameter ..." << endl; + sourceFile << "/// * **parameter2**: This parameter is ..." << endl; + sourceFile << "/// " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// ### Examples" << endl; + sourceFile << "/// Give examples of usage and RML descriptions that can be tested. " << endl; + sourceFile << "/// \\code" << endl; + sourceFile << "/// " << endl; + sourceFile << "/// \\endcode" << endl; + sourceFile << "/// " << endl; + sourceFile << "/// ### Running pipeline example" << endl; + sourceFile << "/// Add the examples to a pipeline to guarantee the code will be running " << endl; + sourceFile << "/// on future framework upgrades. " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// Please, add any figure that may help to illustrate the process " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// \\htmlonly \\endhtmlonly" << endl; - sourcefile << "/// ![An illustration of the trigger definition](trigger.png) " << endl; - sourcefile << "/// " << endl; - sourcefile << "/// The png image should be uploaded to the ./images/ directory " << endl; - sourcefile << "/// " << endl; - sourcefile << "///----------------------------------------------------------------------" << endl; - sourcefile << "/// " << endl; - sourcefile << "/// REST-for-Physics - Software for Rare Event Searches Toolkit " << endl; - sourcefile << "/// " << endl; - sourcefile << "/// History of developments: " << endl; - sourcefile << "/// " << endl; - sourcefile << "/// YEAR-Month: First implementation of " << name << endl; - sourcefile << "/// WRITE YOUR FULL NAME " << endl; - sourcefile << "/// " << endl; - sourcefile << "/// \\class " << name << " " << endl; - sourcefile << "/// \\author: TODO. Write full name and e-mail: " << getenv("USER") << endl; - sourcefile << "/// " << endl; - sourcefile << "///
" << endl; - sourcefile << "/// " << endl; - sourcefile << endl; - sourcefile << "#include \"" << name << ".h\"" << endl; - sourcefile << endl; - sourcefile << "ClassImp(" << name << ");" << endl; - sourcefile << endl; - sourcefile << "/////////////////////////////////////////////// " << endl; - sourcefile << "/// \\brief Default constructor " << endl; - sourcefile << "/// " << endl; - sourcefile << name << "::" << name << "() {" << endl; - sourcefile << " Initialize();" << endl; - sourcefile << "}" << endl; - sourcefile << endl; - sourcefile << "/////////////////////////////////////////////" << endl; - sourcefile << "/// \\brief Constructor loading data from a config file" << endl; - sourcefile << "///" << endl; - sourcefile << "/// If no configuration path is defined using TRestMetadata::SetConfigFilePath" << endl; - sourcefile << "/// the path to the config file must be specified using full path, absolute or" << endl; - sourcefile << "/// relative." << endl; - sourcefile << "///" << endl; - sourcefile << "/// The default behaviour is that the config file must be specified with" << endl; - sourcefile << "/// full path, absolute or relative." << endl; - sourcefile << "///" << endl; - sourcefile << "/// \\param cfgFileName A const char* giving the path to an RML file." << endl; - sourcefile << "/// \\param name The name of the specific metadata. It will be used to find the" << endl; - sourcefile << "/// corresponding TRestAxionMagneticField section inside the RML." << endl; - sourcefile << "///" << endl; - sourcefile << name << "::" << name + sourceFile << "/// ![An illustration of the trigger definition](trigger.png) " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// The png image should be uploaded to the ./images/ directory " << endl; + sourceFile << "/// " << endl; + sourceFile << "///----------------------------------------------------------------------" << endl; + sourceFile << "/// " << endl; + sourceFile << "/// REST-for-Physics - Software for Rare Event Searches Toolkit " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// History of developments: " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// YEAR-Month: First implementation of " << name << endl; + sourceFile << "/// WRITE YOUR FULL NAME " << endl; + sourceFile << "/// " << endl; + sourceFile << "/// \\class " << name << " " << endl; + sourceFile << "/// \\author: TODO. Write full name and e-mail: " << getenv("USER") << endl; + sourceFile << "/// " << endl; + sourceFile << "///
" << endl; + sourceFile << "/// " << endl; + sourceFile << endl; + sourceFile << "#include \"" << name << ".h\"" << endl; + sourceFile << endl; + sourceFile << "ClassImp(" << name << ");" << endl; + sourceFile << endl; + sourceFile << "/////////////////////////////////////////////// " << endl; + sourceFile << "/// \\brief Default constructor " << endl; + sourceFile << "/// " << endl; + sourceFile << name << "::" << name << "() {" << endl; + sourceFile << " Initialize();" << endl; + sourceFile << "}" << endl; + sourceFile << endl; + sourceFile << "/////////////////////////////////////////////" << endl; + sourceFile << "/// \\brief Constructor loading data from a config file" << endl; + sourceFile << "///" << endl; + sourceFile << "/// If no configuration path is defined using TRestMetadata::SetConfigFilePath" << endl; + sourceFile << "/// the path to the config file must be specified using full path, absolute or" << endl; + sourceFile << "/// relative." << endl; + sourceFile << "///" << endl; + sourceFile << "/// The default behaviour is that the config file must be specified with" << endl; + sourceFile << "/// full path, absolute or relative." << endl; + sourceFile << "///" << endl; + sourceFile << "/// \\param cfgFileName A const char* giving the path to an RML file." << endl; + sourceFile << "/// \\param name The name of the specific metadata. It will be used to find the" << endl; + sourceFile << "/// corresponding TRestAxionMagneticField section inside the RML." << endl; + sourceFile << "///" << endl; + sourceFile << name << "::" << name << "(const char* cfgFileName, string name) : TRestMetadata(cfgFileName) {" << endl; - sourcefile << " LoadConfigFromFile(fConfigFileName, name);" << endl; - sourcefile << "" << endl; - sourcefile << " if (GetVerboseLevel() >= REST_Info) PrintMetadata();" << endl; - sourcefile << "}" << endl; - sourcefile << endl; - sourcefile << "/////////////////////////////////////////////// " << endl; - sourcefile << "/// \\brief Default destructor " << endl; - sourcefile << "/// " << endl; - sourcefile << name << "::~" << name << "() {" << endl; - sourcefile << "}" << endl; - sourcefile << endl; - sourcefile << "/////////////////////////////////////////////// " << endl; - sourcefile << "/// \\brief Function to initialize input/output event members and define " << endl; - sourcefile << "/// the section name " << endl; - sourcefile << "/// " << endl; - sourcefile << "void " << name << "::Initialize() {" << endl; - sourcefile << " SetSectionName(this->ClassName());" << endl; - sourcefile << " SetLibraryVersion(LIBRARY_VERSION);" << endl; - sourcefile << endl; - sourcefile << " // REMOVE COMMENT. Initialize here any special data members if needed" << endl; - sourcefile << endl; - sourcefile << "}" << endl; - sourcefile << endl; - sourcefile << "/////////////////////////////////////////////" << endl; - sourcefile + sourceFile << " LoadConfigFromFile(fConfigFileName, name);" << endl; + sourceFile << "" << endl; + sourceFile << " if (GetVerboseLevel() >= REST_Info) PrintMetadata();" << endl; + sourceFile << "}" << endl; + sourceFile << endl; + sourceFile << "/////////////////////////////////////////////// " << endl; + sourceFile << "/// \\brief Default destructor " << endl; + sourceFile << "/// " << endl; + sourceFile << name << "::~" << name << "() {" << endl; + sourceFile << "}" << endl; + sourceFile << endl; + sourceFile << "/////////////////////////////////////////////// " << endl; + sourceFile << "/// \\brief Function to initialize input/output event members and define " << endl; + sourceFile << "/// the section name " << endl; + sourceFile << "/// " << endl; + sourceFile << "void " << name << "::Initialize() {" << endl; + sourceFile << " SetSectionName(this->ClassName());" << endl; + sourceFile << " SetLibraryVersion(LIBRARY_VERSION);" << endl; + sourceFile << endl; + sourceFile << " // REMOVE COMMENT. Initialize here any special data members if needed" << endl; + sourceFile << endl; + sourceFile << "}" << endl; + sourceFile << endl; + sourceFile << "/////////////////////////////////////////////" << endl; + sourceFile << "/// \\brief Prints on screen the information about the metadata members of TRestAxionSolarFlux" << endl; - sourcefile << "///" << endl; - sourcefile << "void " << name << "::PrintMetadata() {" << endl; - sourcefile << " TRestMetadata::PrintMetadata();" << endl; - sourcefile << endl; - sourcefile << " metadata << \" - Dummy member : \" << fDummy << endl;" << endl; - sourcefile << "}" << endl; - sourcefile << endl; + sourceFile << "///" << endl; + sourceFile << "void " << name << "::PrintMetadata() {" << endl; + sourceFile << " TRestMetadata::PrintMetadata();" << endl; + sourceFile << endl; + sourceFile << " metadata << \" - Dummy member : \" << fDummy << endl;" << endl; + sourceFile << "}" << endl; + sourceFile << endl; - sourcefile.flush(); - sourcefile.close(); + sourceFile.flush(); + sourceFile.close(); cout << endl; cout << "--------------------------------" << endl;