Rivet  1.8.3
AnalysisInfo.hh
1 // -*- C++ -*-
2 #ifndef RIVET_AnalysisInfo_HH
3 #define RIVET_AnalysisInfo_HH
4 
5 #include "Rivet/Rivet.hh"
6 #include <ostream>
7 
8 namespace Rivet {
9 
10 
11  class AnalysisInfo {
12  public:
13 
15  static AnalysisInfo* make(const std::string& name);
16 
18 
19 
21  AnalysisInfo() { clear(); }
22 
25 
27 
28 
29  public:
30 
34 
35 
38  std::string name() const {
39  if (!_name.empty()) return _name;
40  if (!experiment().empty() && !year().empty()) {
41  if (!inspireId().empty()) {
42  return experiment() + "_" + year() + "_I" + inspireId();
43  } else if (!spiresId().empty()) {
44  return experiment() + "_" + year() + "_S" + spiresId();
45  }
46  }
47  return "";
48  }
49 
51  void setName(const std::string& name) { _name = name; }
52 
53 
55  const std::string& inspireId() const { return _inspireId; }
56 
58  void setInspireId(const std::string& inspireId) { _inspireId = inspireId; }
59 
60 
62  const std::string& spiresId() const { return _spiresId; }
63 
65  void setSpiresId(const std::string& spiresId) { _spiresId = spiresId; }
66 
67 
71  const std::vector<std::string>& authors() const { return _authors; }
72 
74  void setAuthors(const std::vector<std::string>& authors) { _authors = authors; }
75 
76 
81  const std::string& summary() const { return _summary; }
82 
84  void setSummary(const std::string& summary) { _summary = summary; }
85 
86 
92  const std::string& description() const { return _description; }
93 
95  void setDescription(const std::string& description) { _description = description; }
96 
97 
102  const std::string& runInfo() const { return _runInfo; }
103 
105  void setRunInfo(const std::string& runInfo) { _runInfo = runInfo; }
106 
107 
109  const std::vector<PdgIdPair>& beams() const { return _beams; }
110 
112  void setBeams(const std::vector<PdgIdPair>& beams) { _beams = beams; }
113 
114 
116  const std::vector<std::pair<double,double> >& energies() const { return _energies; }
117 
119  void setEnergies(const std::vector<std::pair<double, double> >& energies) { _energies = energies; }
120 
121 
123  const std::string& experiment() const { return _experiment; }
124 
126  void setExperiment(const std::string& experiment) { _experiment = experiment; }
127 
128 
130  const std::string& collider() const { return _collider; }
131 
133  void setCollider(const std::string& collider) { _collider = collider; }
134 
135 
139  const std::string& year() const { return _year; }
140 
142  void setYear(const std::string& year) { _year = year; }
143 
144 
146  const std::vector<std::string>& references() const { return _references; }
147 
149  void setReferences(const std::vector<std::string>& references) { _references = references; }
150 
151 
153  const std::string& bibKey() const { return _bibKey;}
154 
156  void setBibKey(const std::string& bibKey) { _bibKey = bibKey; }
157 
158 
160  const std::string& bibTeX() const { return _bibTeX; }
161 
163  void setBibTeX(const std::string& bibTeX) { _bibTeX = bibTeX; }
164 
165 
167  const std::string& status() const { return _status; }
168 
170  void setStatus(const std::string& status) { _status = status; }
171 
172 
174  const std::vector<std::string>& todos() const { return _todos; }
175 
177  void setTodos(const std::vector<std::string>& todos) { _todos = todos; }
178 
179 
181  bool needsCrossSection() const { return _needsCrossSection; }
182 
184  void setNeedsCrossSection(bool needXsec) { _needsCrossSection = needXsec; }
185 
187 
188 
189  private:
190 
191  std::string _name;
192  std::string _spiresId, _inspireId;
193  std::vector<std::string> _authors;
194  std::string _summary;
195  std::string _description;
196  std::string _runInfo;
197  std::string _experiment;
198  std::string _collider;
199  std::vector<std::pair<PdgId, PdgId> > _beams;
200  std::vector<std::pair<double, double> > _energies;
201  std::string _year;
202  std::vector<std::string> _references;
203  std::string _bibKey;
204  std::string _bibTeX;
205  //std::string _bibTeXBody; //< Was thinking of avoiding duplication of BibKey...
206  std::string _status;
207  std::vector<std::string> _todos;
208  bool _needsCrossSection;
209 
210  void clear() {
211  _name = "";
212  _spiresId = "";
213  _inspireId = "";
214  _authors.clear();
215  _summary = "";
216  _description = "";
217  _runInfo = "";
218  _experiment = "";
219  _collider = "";
220  _beams.clear();
221  _energies.clear();
222  _year = "";
223  _references.clear();
224  _bibKey = "";
225  _bibTeX = "";
226  //_bibTeXBody = "";
227  _status = "";
228  _todos.clear();
229  _needsCrossSection = false;
230  }
231 
232  };
233 
234 
236  std::string toString(const AnalysisInfo& ai);
237 
239  inline std::ostream& operator<<(std::ostream& os, const AnalysisInfo& ai) {
240  os << toString(ai);
241  return os;
242  }
243 
244 
245 }
246 
247 #endif
Definition: MC_JetAnalysis.hh:9
const std::string & summary() const
Get a short description of the analysis. Short (one sentence) description used as an index entry...
Definition: AnalysisInfo.hh:81
AnalysisInfo()
The default constructor.
Definition: AnalysisInfo.hh:21
void setSpiresId(const std::string &spiresId)
Set the SPIRES ID code for this analysis.
Definition: AnalysisInfo.hh:65
void setNeedsCrossSection(bool needXsec)
Return true if this analysis needs to know the process cross-section.
Definition: AnalysisInfo.hh:184
Definition: AnalysisInfo.hh:11
const std::string & status() const
Whether this analysis is trusted (in any way!)
Definition: AnalysisInfo.hh:167
void setDescription(const std::string &description)
Set the full description for this analysis.
Definition: AnalysisInfo.hh:95
~AnalysisInfo()
The destructor.
Definition: AnalysisInfo.hh:24
void setBibTeX(const std::string &bibTeX)
Set the BibTeX citation entry for this article.
Definition: AnalysisInfo.hh:163
const std::string & bibTeX() const
BibTeX citation entry for this article.
Definition: AnalysisInfo.hh:160
void setExperiment(const std::string &experiment)
Set the experiment which performed and published this analysis.
Definition: AnalysisInfo.hh:126
void setYear(const std::string &year)
Set the year in which the original experimental analysis was published.
Definition: AnalysisInfo.hh:142
const std::string & bibKey() const
BibTeX citation key for this article.
Definition: AnalysisInfo.hh:153
std::string name() const
Definition: AnalysisInfo.hh:38
const std::vector< std::string > & todos() const
Any work to be done on this analysis.
Definition: AnalysisInfo.hh:174
void setRunInfo(const std::string &runInfo)
Set the full description for this analysis.
Definition: AnalysisInfo.hh:105
void setTodos(const std::vector< std::string > &todos)
Set the to-do list.
Definition: AnalysisInfo.hh:177
const std::vector< std::string > & authors() const
Names & emails of paper/analysis authors. Names and email of authors in &#39;NAME <EMAIL>&#39; format...
Definition: AnalysisInfo.hh:71
const std::vector< PdgIdPair > & beams() const
Beam particle types.
Definition: AnalysisInfo.hh:109
static AnalysisInfo * make(const std::string &name)
Static factory method: returns null pointer if no metadata found.
Definition: AnalysisInfo.cc:23
const std::string & experiment() const
Experiment which performed and published this analysis.
Definition: AnalysisInfo.hh:123
const std::string & spiresId() const
Get the SPIRES ID code for this analysis.
Definition: AnalysisInfo.hh:62
void setStatus(const std::string &status)
Set the analysis code status.
Definition: AnalysisInfo.hh:170
void setReferences(const std::vector< std::string > &references)
Set the journal and preprint reference list.
Definition: AnalysisInfo.hh:149
void setName(const std::string &name)
Set the name of the analysis.
Definition: AnalysisInfo.hh:51
void setInspireId(const std::string &inspireId)
Set the Inspire (SPIRES replacement) ID code for this analysis.
Definition: AnalysisInfo.hh:58
void setCollider(const std::string &collider)
Set the collider on which the experiment ran.
Definition: AnalysisInfo.hh:133
const std::vector< std::string > & references() const
Journal and preprint references.
Definition: AnalysisInfo.hh:146
bool needsCrossSection() const
Return true if this analysis needs to know the process cross-section.
Definition: AnalysisInfo.hh:181
void setBibKey(const std::string &bibKey)
Set the BibTeX citation key for this article.
Definition: AnalysisInfo.hh:156
const std::string & year() const
When the original experimental analysis was published. When the refereed paper on which this is based...
Definition: AnalysisInfo.hh:139
const std::string & description() const
Get a full description of the analysis. Full textual description of this analysis, what it is useful for, what experimental techniques are applied, etc. Should be treated as a chunk of restructuredText (http://docutils.sourceforge.net/rst.html), with equations to be rendered as LaTeX with amsmath operators.
Definition: AnalysisInfo.hh:92
void setSummary(const std::string &summary)
Set the short description for this analysis.
Definition: AnalysisInfo.hh:84
std::string toString(const AnalysisInfo &ai)
String representation.
Definition: AnalysisInfo.cc:234
const std::string & runInfo() const
Information about the events needed as input for this analysis. Event types, energies, kinematic cuts, particles to be considered stable, etc. etc. Should be treated as a restructuredText bullet list (http://docutils.sourceforge.net/rst.html)
Definition: AnalysisInfo.hh:102
std::ostream & operator<<(std::ostream &os, const AnalysisInfo &ai)
Stream an AnalysisInfo as a text description.
Definition: AnalysisInfo.hh:239
void setBeams(const std::vector< PdgIdPair > &beams)
Set beam particle types.
Definition: AnalysisInfo.hh:112
const std::string & inspireId() const
Get the Inspire (SPIRES replacement) ID code for this analysis.
Definition: AnalysisInfo.hh:55
const std::string & collider() const
Collider on which the experiment ran.
Definition: AnalysisInfo.hh:130
void setAuthors(const std::vector< std::string > &authors)
Set the author list.
Definition: AnalysisInfo.hh:74
void setEnergies(const std::vector< std::pair< double, double > > &energies)
Set the valid beam energies.
Definition: AnalysisInfo.hh:119
const std::vector< std::pair< double, double > > & energies() const
Sets of valid beam energies.
Definition: AnalysisInfo.hh:116