AnalysisInfo Class Reference
Collaboration diagram for AnalysisInfo:
Detailed DescriptionDefinition at line 11 of file AnalysisInfo.hh. Constructor & Destructor Documentation
The default constructor. Definition at line 21 of file AnalysisInfo.hh. References AnalysisInfo::clear(). Referenced by AnalysisInfo::make(). { clear(); }
Member Function Documentation
Names & emails of paper/analysis authors. Names and email of authors in 'NAME <EMAIL>' format. The first name in the list should be the primary contact person. Definition at line 71 of file AnalysisInfo.hh. References AnalysisInfo::_authors. Referenced by Analysis::authors(), AnalysisInfo::make(), and AnalysisInfo::setAuthors(). { return _authors; } Beam particle types. Definition at line 109 of file AnalysisInfo.hh. References AnalysisInfo::_beams. Referenced by AnalysisInfo::make(), Analysis::requiredBeams(), and AnalysisInfo::setBeams(). { return _beams; }
BibTeX citation key for this article. Definition at line 153 of file AnalysisInfo.hh. References AnalysisInfo::_bibKey. Referenced by Analysis::bibKey(), AnalysisInfo::make(), and AnalysisInfo::setBibKey(). { return _bibKey;}
BibTeX citation entry for this article. Definition at line 160 of file AnalysisInfo.hh. References AnalysisInfo::_bibTeX. Referenced by Analysis::bibTeX(), AnalysisInfo::make(), and AnalysisInfo::setBibTeX(). { return _bibTeX; }
Definition at line 210 of file AnalysisInfo.hh. References AnalysisInfo::_authors, AnalysisInfo::_beams, AnalysisInfo::_bibKey, AnalysisInfo::_bibTeX, AnalysisInfo::_collider, AnalysisInfo::_description, AnalysisInfo::_energies, AnalysisInfo::_experiment, AnalysisInfo::_inspireId, AnalysisInfo::_name, AnalysisInfo::_needsCrossSection, AnalysisInfo::_references, AnalysisInfo::_runInfo, AnalysisInfo::_spiresId, AnalysisInfo::_status, AnalysisInfo::_summary, AnalysisInfo::_todos, and AnalysisInfo::_year. Referenced by AnalysisInfo::AnalysisInfo(). { _name = ""; _spiresId = ""; _inspireId = ""; _authors.clear(); _summary = ""; _description = ""; _runInfo = ""; _experiment = ""; _collider = ""; _beams.clear(); _energies.clear(); _year = ""; _references.clear(); _bibKey = ""; _bibTeX = ""; //_bibTeXBody = ""; _status = ""; _todos.clear(); _needsCrossSection = false; }
Collider on which the experiment ran. Definition at line 130 of file AnalysisInfo.hh. References AnalysisInfo::_collider. Referenced by Analysis::collider(), AnalysisInfo::make(), and AnalysisInfo::setCollider(). { return _collider; }
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 at line 92 of file AnalysisInfo.hh. References AnalysisInfo::_description. Referenced by Analysis::description(), AnalysisInfo::make(), and AnalysisInfo::setDescription(). { return _description; }
Sets of valid beam energies. Definition at line 116 of file AnalysisInfo.hh. References AnalysisInfo::_energies. Referenced by AnalysisInfo::make(), Analysis::requiredEnergies(), and AnalysisInfo::setEnergies(). { return _energies; }
Experiment which performed and published this analysis. Definition at line 123 of file AnalysisInfo.hh. References AnalysisInfo::_experiment. Referenced by Analysis::experiment(), AnalysisInfo::make(), AnalysisInfo::name(), and AnalysisInfo::setExperiment(). { return _experiment; }
Get the Inspire (SPIRES replacement) ID code for this analysis. Definition at line 55 of file AnalysisInfo.hh. References AnalysisInfo::_inspireId. Referenced by Analysis::inspireId(), AnalysisInfo::make(), AnalysisInfo::name(), and AnalysisInfo::setInspireId(). { return _inspireId; }
Static factory method: returns null pointer if no metadata found. Static factory method. If no ana data file found, return null AI Definition at line 27 of file AnalysisInfo.cc. References AnalysisInfo::_beams, AnalysisInfo::_energies, AnalysisInfo::_name, AnalysisInfo::_needsCrossSection, AnalysisInfo::AnalysisInfo(), Rivet::PID::ANY, AnalysisInfo::authors(), AnalysisInfo::beams(), AnalysisInfo::bibKey(), AnalysisInfo::bibTeX(), AnalysisInfo::collider(), AnalysisInfo::description(), AnalysisInfo::energies(), AnalysisInfo::experiment(), Rivet::findAnalysisInfoFile(), AnalysisInfo::inspireId(), Rivet::PID::make_pdgid_pair(), MSG_DEBUG, MSG_ERROR, MSG_TRACE, Rivet::PID::n, AnalysisInfo::name(), AnalysisInfo::references(), AnalysisInfo::runInfo(), AnalysisInfo::spiresId(), AnalysisInfo::status(), AnalysisInfo::summary(), THROW_INFOERR, AnalysisInfo::todos(), and AnalysisInfo::year(). Referenced by Analysis::Analysis(). { // Returned AI, in semi-null state AnalysisInfo* ai = new AnalysisInfo(); ai->_beams += make_pair(PID::ANY, PID::ANY); ai->_name = ananame; /// If no ana data file found, return null AI const string datapath = findAnalysisInfoFile(ananame + ".info"); if (datapath.empty()) { MSG_DEBUG("No datafile " << ananame + ".info found"); return ai; } // Read data from YAML document MSG_DEBUG("Reading analysis data from " << datapath); YAML::Node doc; try { #if YAMLCPP_API == 3 std::ifstream file(datapath.c_str()); YAML::Parser parser(file); parser.GetNextDocument(doc); #elif YAMLCPP_API == 5 doc = YAML::LoadFile(datapath); #endif } catch (const YAML::ParserException& ex) { MSG_ERROR("Parse error when reading analysis data from " << datapath << " (" << ex.what() << ")"); return ai; } #define THROW_INFOERR(KEY) throw InfoError("Problem in info parsing while accessing key " + string(KEY) + " in file " + datapath) // Simple scalars (test for nullness before casting) #if YAMLCPP_API == 3 #define TRY_GETINFO(KEY, VAR) try { if (doc.FindValue(KEY)) { string val; doc[KEY] >> val; ai->_ ## VAR = val; } } catch (...) { THROW_INFOERR(KEY); } #elif YAMLCPP_API == 5 #define TRY_GETINFO(KEY, VAR) try { if (doc[KEY] && !doc[KEY].IsNull()) ai->_ ## VAR = doc[KEY].as<string>(); } catch (...) { THROW_INFOERR(KEY); } #endif TRY_GETINFO("Name", name); TRY_GETINFO("Summary", summary); TRY_GETINFO("Status", status); TRY_GETINFO("RunInfo", runInfo); TRY_GETINFO("Description", description); TRY_GETINFO("Experiment", experiment); TRY_GETINFO("Collider", collider); TRY_GETINFO("Year", year); TRY_GETINFO("SpiresID", spiresId); TRY_GETINFO("InspireID", inspireId); TRY_GETINFO("BibKey", bibKey); TRY_GETINFO("BibTeX", bibTeX); #undef TRY_GETINFO // Sequences (test the seq *and* each entry for nullness before casting) #if YAMLCPP_API == 3 #define TRY_GETINFO_SEQ(KEY, VAR) try { \ if (const YAML::Node* VAR = doc.FindValue(KEY)) { \ for (size_t i = 0; i < VAR->size(); ++i) { \ string val; (*VAR)[i] >> val; ai->_ ## VAR += val; \ } } } catch (...) { THROW_INFOERR(KEY); } #elif YAMLCPP_API == 5 #define TRY_GETINFO_SEQ(KEY, VAR) try { \ if (doc[KEY] && !doc[KEY].IsNull()) { \ const YAML::Node& VAR = doc[KEY]; \ for (size_t i = 0; i < VAR.size(); ++i) \ if (!VAR[i].IsNull()) ai->_ ## VAR += VAR[i].as<string>(); \ } } catch (...) { THROW_INFOERR(KEY); } #endif TRY_GETINFO_SEQ("Authors", authors); TRY_GETINFO_SEQ("References", references); TRY_GETINFO_SEQ("ToDo", todos); #undef TRY_GETINFO_SEQ // A boolean with some name flexibility try { #if YAMLCPP_API == 3 bool val; if (const YAML::Node* n = doc.FindValue("NeedsCrossSection")) { *n >> val; ai->_needsCrossSection = val; } if (const YAML::Node* n = doc.FindValue("NeedCrossSection")) { *n >> val; ai->_needsCrossSection = val; } #elif YAMLCPP_API == 5 if (doc["NeedsCrossSection"]) ai->_needsCrossSection = doc["NeedsCrossSection"].as<bool>(); else if (doc["NeedCrossSection"]) ai->_needsCrossSection = doc["NeedCrossSection"].as<bool>(); #endif } catch (...) { THROW_INFOERR("NeedsCrossSection|NeedCrossSection"); } // Beam particle identities try { #if YAMLCPP_API == 3 if (const YAML::Node* pbeampairs = doc.FindValue("Beams")) { const YAML::Node& beampairs = *pbeampairs; vector<PdgIdPair> beam_pairs; if (beampairs.size() == 2 && beampairs[0].Type() == YAML::NodeType::Scalar && beampairs[1].Type() == YAML::NodeType::Scalar) { string bstr0, bstr1; beampairs[0] >> bstr0; beampairs[1] >> bstr1; beam_pairs += PID::make_pdgid_pair(bstr0, bstr1); } else { for (YAML::Iterator bpi = beampairs.begin(); bpi != beampairs.end(); ++bpi) { const YAML::Node& bp = *bpi; if (bp.size() == 2 && bp[0].Type() == YAML::NodeType::Scalar && bp[1].Type() == YAML::NodeType::Scalar) { string bstr0, bstr1; bp[0] >> bstr0; bp[1] >> bstr1; beam_pairs += PID::make_pdgid_pair(bstr0, bstr1); } else { throw InfoError("Beam ID pairs have to be either a 2-tuple or a list of 2-tuples of particle names"); } } } ai->_beams = beam_pairs; } #elif YAMLCPP_API == 5 if (doc["Beams"]) { const YAML::Node& beams = doc["Beams"]; vector<PdgIdPair> beam_pairs; if (beams.size() == 2 && beams[0].IsScalar() && beams[0].IsScalar()) { beam_pairs += PID::make_pdgid_pair(beams[0].as<string>(), beams[1].as<string>()); } else { for (size_t i = 0; i < beams.size(); ++i) { const YAML::Node& bp = beams[i]; if (bp.size() != 2 || !bp[0].IsScalar() || !bp[0].IsScalar()) throw InfoError("Beam ID pairs have to be either a 2-tuple or a list of 2-tuples of particle names"); beam_pairs += PID::make_pdgid_pair(bp[0].as<string>(), bp[1].as<string>()); } } ai->_beams = beam_pairs; } #endif } catch (...) { THROW_INFOERR("Beams"); } // Beam energies try { #if YAMLCPP_API == 3 if (const YAML::Node* penergies = doc.FindValue("Energies")) { const YAML::Node& energies = *penergies; vector<pair<double,double> > beam_energy_pairs; for (YAML::Iterator be = energies.begin(); be != energies.end(); ++be) { if (be->Type() == YAML::NodeType::Scalar) { // If beam energy is a scalar, then assume symmetric beams each with half that energy double sqrts; *be >> sqrts; beam_energy_pairs += make_pair(sqrts/2.0, sqrts/2.0); } else if (be->Type() == YAML::NodeType::Sequence) { const YAML::Node& beseq = *be; // If the sub-sequence is of length 1, then it's another scalar sqrt(s)! if (beseq.size() == 1) { double sqrts; (*be)[0] >> sqrts; beam_energy_pairs += make_pair(sqrts/2.0, sqrts/2.0); } else if (beseq.size() == 2) { vector<double> beamenergies; double beamenergy0, beamenergy1; beseq[0] >> beamenergy0; beseq[1] >> beamenergy1; beam_energy_pairs += make_pair(beamenergy0, beamenergy1); } else { throw InfoError("Beam energies have to be a list of either numbers or pairs of numbers"); } } else { throw InfoError("Beam energies have to be a list of either numbers or pairs of numbers"); } } ai->_energies = beam_energy_pairs; } #elif YAMLCPP_API == 5 if (doc["Energies"]) { vector< pair<double,double> > beam_energy_pairs; for (size_t i = 0; i < doc["Energies"].size(); ++i) { const YAML::Node& be = doc["Energies"][i]; if (be.IsScalar()) { // If beam energy is a scalar, then assume symmetric beams each with half that energy beam_energy_pairs += make_pair(be.as<double>()/2.0, be.as<double>()/2.0); } else if (be.IsSequence()) { if (be.size() != 2) throw InfoError("Beam energies have to be a list of either numbers or pairs of numbers"); beam_energy_pairs += make_pair(be[0].as<double>(), be[1].as<double>()); } else { throw InfoError("Beam energies have to be a list of either numbers or pairs of numbers"); } } ai->_energies = beam_energy_pairs; } #endif } catch (...) { THROW_INFOERR("Energies"); } #undef THROW_INFOERR MSG_TRACE("AnalysisInfo pointer = " << ai); return ai; }
Get the name of the analysis. By default this is computed using the experiment, year and Inspire/Spires ID metadata methods. Definition at line 38 of file AnalysisInfo.hh. References AnalysisInfo::_name, AnalysisInfo::experiment(), AnalysisInfo::inspireId(), AnalysisInfo::spiresId(), and AnalysisInfo::year(). Referenced by AnalysisInfo::make(), Analysis::name(), AnalysisInfo::setName(), and Rivet::toString(). { if (!_name.empty()) return _name; if (!experiment().empty() && !year().empty()) { if (!inspireId().empty()) { return experiment() + "_" + year() + "_I" + inspireId(); } else if (!spiresId().empty()) { return experiment() + "_" + year() + "_S" + spiresId(); } } return ""; }
Return true if this analysis needs to know the process cross-section. Definition at line 181 of file AnalysisInfo.hh. References AnalysisInfo::_needsCrossSection. Referenced by Analysis::needsCrossSection(). { return _needsCrossSection; }
Journal and preprint references. Definition at line 146 of file AnalysisInfo.hh. References AnalysisInfo::_references. Referenced by AnalysisInfo::make(), Analysis::references(), and AnalysisInfo::setReferences(). { return _references; }
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 at line 102 of file AnalysisInfo.hh. References AnalysisInfo::_runInfo. Referenced by AnalysisInfo::make(), Analysis::runInfo(), and AnalysisInfo::setRunInfo(). { return _runInfo; }
Set the author list. Definition at line 74 of file AnalysisInfo.hh. References AnalysisInfo::_authors, and AnalysisInfo::authors(). Set beam particle types. Definition at line 112 of file AnalysisInfo.hh. References AnalysisInfo::_beams, and AnalysisInfo::beams(). Referenced by Analysis::setRequiredBeams().
Set the BibTeX citation key for this article. Definition at line 156 of file AnalysisInfo.hh. References AnalysisInfo::_bibKey, and AnalysisInfo::bibKey().
Set the BibTeX citation entry for this article. Definition at line 163 of file AnalysisInfo.hh. References AnalysisInfo::_bibTeX, and AnalysisInfo::bibTeX().
Set the collider on which the experiment ran. Definition at line 133 of file AnalysisInfo.hh. References AnalysisInfo::_collider, and AnalysisInfo::collider().
Set the full description for this analysis. Definition at line 95 of file AnalysisInfo.hh. References AnalysisInfo::_description, and AnalysisInfo::description(). { _description = description; }
Set the valid beam energies. Definition at line 119 of file AnalysisInfo.hh. References AnalysisInfo::_energies, and AnalysisInfo::energies(). Referenced by Analysis::setRequiredEnergies().
Set the experiment which performed and published this analysis. Definition at line 126 of file AnalysisInfo.hh. References AnalysisInfo::_experiment, and AnalysisInfo::experiment(). { _experiment = experiment; }
Set the Inspire (SPIRES replacement) ID code for this analysis. Definition at line 58 of file AnalysisInfo.hh. References AnalysisInfo::_inspireId, and AnalysisInfo::inspireId(). { _inspireId = inspireId; }
Set the name of the analysis. Definition at line 51 of file AnalysisInfo.hh. References AnalysisInfo::_name, and AnalysisInfo::name().
Return true if this analysis needs to know the process cross-section. Definition at line 184 of file AnalysisInfo.hh. References AnalysisInfo::_needsCrossSection. Referenced by Analysis::setNeedsCrossSection(). { _needsCrossSection = needXsec; }
Set the journal and preprint reference list. Definition at line 149 of file AnalysisInfo.hh. References AnalysisInfo::_references, and AnalysisInfo::references(). { _references = references; }
Set the full description for this analysis. Definition at line 105 of file AnalysisInfo.hh. References AnalysisInfo::_runInfo, and AnalysisInfo::runInfo().
Set the SPIRES ID code for this analysis. Definition at line 65 of file AnalysisInfo.hh. References AnalysisInfo::_spiresId, and AnalysisInfo::spiresId().
Set the analysis code status. Definition at line 170 of file AnalysisInfo.hh. References AnalysisInfo::_status, and AnalysisInfo::status().
Set the short description for this analysis. Definition at line 84 of file AnalysisInfo.hh. References AnalysisInfo::_summary, and AnalysisInfo::summary().
Set the to-do list. Definition at line 177 of file AnalysisInfo.hh. References AnalysisInfo::_todos, and AnalysisInfo::todos().
Set the year in which the original experimental analysis was published. Definition at line 142 of file AnalysisInfo.hh. References AnalysisInfo::_year, and AnalysisInfo::year().
Get the SPIRES ID code for this analysis. Definition at line 62 of file AnalysisInfo.hh. References AnalysisInfo::_spiresId. Referenced by AnalysisInfo::make(), AnalysisInfo::name(), AnalysisInfo::setSpiresId(), and Analysis::spiresId(). { return _spiresId; }
Whether this analysis is trusted (in any way!) Definition at line 167 of file AnalysisInfo.hh. References AnalysisInfo::_status. Referenced by AnalysisInfo::make(), AnalysisInfo::setStatus(), Analysis::status(), and Rivet::toString(). { return _status; }
Get a short description of the analysis. Short (one sentence) description used as an index entry. Use description() to provide full descriptive paragraphs of analysis details. Definition at line 81 of file AnalysisInfo.hh. References AnalysisInfo::_summary. Referenced by AnalysisInfo::make(), AnalysisInfo::setSummary(), Analysis::summary(), and Rivet::toString(). { return _summary; }
Any work to be done on this analysis. Definition at line 174 of file AnalysisInfo.hh. References AnalysisInfo::_todos. Referenced by AnalysisInfo::make(), AnalysisInfo::setTodos(), and Analysis::todos(). { return _todos; }
When the original experimental analysis was published. When the refereed paper on which this is based was published, according to SPIRES. Definition at line 139 of file AnalysisInfo.hh. References AnalysisInfo::_year. Referenced by AnalysisInfo::make(), AnalysisInfo::name(), AnalysisInfo::setYear(), and Analysis::year(). { return _year; } Member Data Documentation
Definition at line 193 of file AnalysisInfo.hh. Referenced by AnalysisInfo::authors(), AnalysisInfo::clear(), and AnalysisInfo::setAuthors(). Definition at line 199 of file AnalysisInfo.hh. Referenced by AnalysisInfo::beams(), AnalysisInfo::clear(), AnalysisInfo::make(), and AnalysisInfo::setBeams().
Definition at line 203 of file AnalysisInfo.hh. Referenced by AnalysisInfo::bibKey(), AnalysisInfo::clear(), and AnalysisInfo::setBibKey().
Definition at line 204 of file AnalysisInfo.hh. Referenced by AnalysisInfo::bibTeX(), AnalysisInfo::clear(), and AnalysisInfo::setBibTeX().
Definition at line 198 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::collider(), and AnalysisInfo::setCollider().
Definition at line 195 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::description(), and AnalysisInfo::setDescription().
Definition at line 200 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::energies(), AnalysisInfo::make(), and AnalysisInfo::setEnergies().
Definition at line 197 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::experiment(), and AnalysisInfo::setExperiment().
Definition at line 192 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::inspireId(), and AnalysisInfo::setInspireId().
Definition at line 191 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::make(), AnalysisInfo::name(), and AnalysisInfo::setName().
Definition at line 208 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::make(), AnalysisInfo::needsCrossSection(), and AnalysisInfo::setNeedsCrossSection().
Definition at line 202 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::references(), and AnalysisInfo::setReferences().
Definition at line 196 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::runInfo(), and AnalysisInfo::setRunInfo().
Definition at line 192 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::setSpiresId(), and AnalysisInfo::spiresId().
Definition at line 206 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::setStatus(), and AnalysisInfo::status().
Definition at line 194 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::setSummary(), and AnalysisInfo::summary().
Definition at line 207 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::setTodos(), and AnalysisInfo::todos().
Definition at line 201 of file AnalysisInfo.hh. Referenced by AnalysisInfo::clear(), AnalysisInfo::setYear(), and AnalysisInfo::year(). The documentation for this class was generated from the following files: Generated on Thu Feb 6 2014 17:38:57 for The Rivet MC analysis system by 1.7.6.1 |