REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestAxionTemplate.cxx
1 /*************************************************************************
2  * This file is part of the REST software framework. *
3  * *
4  * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5  * For more information see http://gifna.unizar.es/trex *
6  * *
7  * REST is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * REST is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have a copy of the GNU General Public License along with *
18  * REST in $REST_PATH/LICENSE. *
19  * If not, see http://www.gnu.org/licenses/. *
20  * For the list of contributors see $REST_PATH/CREDITS. *
21  *************************************************************************/
22 
51 
52 #include "TRestAxionTemplate.h"
53 using namespace std;
54 
55 ClassImp(TRestAxionTemplate);
56 //______________________________________________________________________________
57 TRestAxionTemplate::TRestAxionTemplate() : TRestMetadata() {
58  // TRestAxionTemplate default constructor
59  Initialize();
60 }
61 
62 //______________________________________________________________________________
63 TRestAxionTemplate::TRestAxionTemplate(const char* cfgFileName, string name) : TRestMetadata(cfgFileName) {
64  cout << "Entering TRestAxionTemplate constructor( cfgFileName, name )" << endl;
65 
66  Initialize();
67 
68  LoadConfigFromFile(fConfigFileName, name);
69 
70  PrintMetadata();
71 }
72 
73 //______________________________________________________________________________
74 TRestAxionTemplate::~TRestAxionTemplate() {
75  // TRestAxionTemplate destructor
76 }
77 
79  SetSectionName(this->ClassName());
80  SetLibraryVersion(LIBRARY_VERSION);
81 }
82 
83 //______________________________________________________________________________
85  this->Initialize();
86 
87  // Initialize the metadata members from a configfile
88  fDummyValue = StringToDouble(GetParameter("dummy", "317"));
89 
91 }
92 
95 
96  RESTMetadata << " - Dummy metadata member : " << fDummyValue << RESTendl;
97  RESTMetadata << "+++++++++++++++++++++++++++++++++++++++++++++++++" << RESTendl;
98 }
A metadata class to serve as example on the implementation of future metadata classes.
void Initialize()
Making default settings.
void PrintMetadata()
Implemented it in the derived metadata class to print out specific metadata information.
void InitFromConfigFile()
To make settings from rml file. This method must be implemented in the derived class.
A base class for any REST metadata class.
Definition: TRestMetadata.h:74
virtual void PrintMetadata()
Implemented it in the derived metadata class to print out specific metadata information.
endl_t RESTendl
Termination flag object for TRestStringOutput.
void SetLibraryVersion(TString version)
Set the library version of this metadata class.
TRestStringOutput::REST_Verbose_Level GetVerboseLevel()
returns the verboselevel in type of REST_Verbose_Level enumerator
void SetSectionName(std::string sName)
set the section name, clear the section content
std::string GetParameter(std::string parName, TiXmlElement *e, TString defaultValue=PARAMETER_NOT_FOUND_STR)
Returns the value for the parameter named parName in the given section.
@ REST_Debug
+show the defined debug messages
Double_t StringToDouble(std::string in)
Gets a double from a string.