GENIEGenerator
Loading...
Searching...
No Matches
TuneId.h
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\class genie::TuneId
5
6\brief GENIE tune ID
7
8\author Marco Roda <Marco.Roda \at liverpool.ac.uk>
9 University of Liverpool
10
11 Costas Andreopoulos <c.andreopoulos \at cern.ch>
12 University of Liverpool
13
14\created April 19, 2018
15
16\cpright Copyright (c) 2003-2025, The GENIE Collaboration
17 For the full text of the license visit http://copyright.genie-mc.org
18*/
19//____________________________________________________________________________
20
21#ifndef _TUNE_ID_H_
22#define _TUNE_ID_H_
23
24#include <string>
25#include <iostream>
26
27using std::string;
28using std::ostream;
29
30namespace genie {
31
32class TuneId;
33ostream & operator << (ostream & stream, const TuneId & id);
34bool operator == (const TuneId & id1, const TuneId & id2);
35bool operator != (const TuneId & id1, const TuneId & id2);
36
37class TuneId {
38
39public:
40
41 TuneId(const string & id_str, bool failOnInvalid=true);
42 TuneId(const TuneId & id);
43 ~TuneId() {;}
44
45 // The typical tune name in neutrino mode is : Gdd_MMv_PP_xxx
46 string Name (void) const { return fName; } // Gdd_MMv_PP_xxx
47 string Prefix (void) const { return fPrefix; } // G
48 string Year (void) const { return fYear; } // dd
49 string ModelId (void) const { return fMajorModelId + fMinorModelId; } // MMv
50 string MajorModelId (void) const { return fMajorModelId; } // MM
51 string MinorModelId (void) const { return fMinorModelId; } // v
52 string TunedParamSetId (void) const { return fTunedParamSetId; } // PP
53 string FitDataSetId (void) const { return fFitDataSetId; } // xxx
54
55 bool IsConfigured (void) const { return fIsConfigured; }
56 // this is true if the name of the tune (correctly) has been decoded into its parts
57 // must match pattern: "([A-Za-z]+)(\\d{2})_(\\d{2})([a-z])_([a-z0-9]{2})_([a-z0-9]{3})"
58
59 bool IsValidated (void) const { return fIsValidated; }
60 // this is true if the existence of the tune directory in the system has been checked
61
62 bool IsCustom (void) const { return fCustomSource.size() > 0 ; }
63 // this check if the configuration had a GXMLPATH configuration that took priority
64 // over the standard $GXMLPATH
65 // This boolean is reliable only if IsValidated() is true
66
67 // A tune can be a simple configuration of models or the ouput of a complete tuning procedure
68 // This changes the position the tune files are stored so we need a quick way to know this
69 bool OnlyConfiguration() const { return (TunedParamSetId() == "00") ; }
70
71 // Methods related to config directory
72 string CMC (void) const ; // Comprehensive Model Confguration
73 string Tail (void) const ;
74 string CMCDirectory (void) const ;
75 string TuneDirectory (void) const ;
76 string BaseDirectory (void) const { return fBaseDirectory; }
77 string CustomSource (void) const { return fCustomSource; }
78
79 void Build (const string & name = "" ) ;
80 void Decode (string id_str);
81 void Copy (const TuneId & id);
82 bool Compare (const TuneId & id) const;
83 void Print (ostream & stream) const;
84
85 friend ostream & operator << (ostream & stream, const TuneId & id);
86
87private:
88
89 TuneId() {;}
90
91 bool CheckDirectory() ;
92
93 string fName;
94
95 string fPrefix;
96 string fYear;
97 string fModelId;
102
105
108};
109
110} // genie namespace
111
112#endif // _TUNE_ID_H_
GENIE tune ID.
Definition TuneId.h:37
string fTunedParamSetId
Definition TuneId.h:100
string fPrefix
Definition TuneId.h:95
string CMC(void) const
Definition TuneId.cxx:90
bool fIsConfigured
Definition TuneId.h:106
string fModelId
Definition TuneId.h:97
string Prefix(void) const
Definition TuneId.h:47
bool fIsValidated
Definition TuneId.h:107
bool Compare(const TuneId &id) const
Definition TuneId.cxx:179
void Decode(string id_str)
Definition TuneId.cxx:140
bool CheckDirectory()
Definition TuneId.cxx:205
string fName
Definition TuneId.h:93
string fBaseDirectory
Definition TuneId.h:103
bool OnlyConfiguration() const
Definition TuneId.h:69
string fCustomSource
Definition TuneId.h:104
string FitDataSetId(void) const
Definition TuneId.h:53
void Print(ostream &stream) const
Definition TuneId.cxx:184
string CustomSource(void) const
Definition TuneId.h:77
string Year(void) const
Definition TuneId.h:48
string fMinorModelId
Definition TuneId.h:99
friend ostream & operator<<(ostream &stream, const TuneId &id)
Definition TuneId.cxx:35
string CMCDirectory(void) const
Definition TuneId.cxx:107
bool IsCustom(void) const
Definition TuneId.h:62
string TunedParamSetId(void) const
Definition TuneId.h:52
bool IsValidated(void) const
Definition TuneId.h:59
string fFitDataSetId
Definition TuneId.h:101
string BaseDirectory(void) const
Definition TuneId.h:76
string fYear
Definition TuneId.h:96
string ModelId(void) const
Definition TuneId.h:49
void Build(const string &name="")
Definition TuneId.cxx:124
string TuneDirectory(void) const
Definition TuneId.cxx:116
bool IsConfigured(void) const
Definition TuneId.h:55
string Name(void) const
Definition TuneId.h:46
TuneId(const string &id_str, bool failOnInvalid=true)
Definition TuneId.cxx:52
string MajorModelId(void) const
Definition TuneId.h:50
string MinorModelId(void) const
Definition TuneId.h:51
string Tail(void) const
Definition TuneId.cxx:100
string fMajorModelId
Definition TuneId.h:98
void Copy(const TuneId &id)
Definition TuneId.cxx:165
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
bool operator!=(const TuneId &id1, const TuneId &id2)
Definition TuneId.cxx:46
bool operator==(const TuneId &id1, const TuneId &id2)
Definition TuneId.cxx:41
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)