Go to the documentation of this file. 1 #ifndef __JDETECTOR__JPMTPARAMETERSMAP__
2 #define __JDETECTOR__JPMTPARAMETERSMAP__
91 public JThrow<JPMTParametersMap>
120 ifstream in(file_name);
143 JPMTParametersMap_t::const_iterator i = find(
id);
146 parameters = i->second;
150 parameters.
QE *= this->
QE;
258 for (const_iterator i = this->begin(); i != this->end(); ++i) {
260 if (!i->second.is_valid()) {
264 if (i->second.QE * this->QE > 1.0 ||
265 i->second.QE * this->QE < 0.0) {
266 THROW(
JException,
"Invalid PMT QE at " << i->first <<
' ' << i->second.QE * this->QE);
301 for (JPMTParametersMap::const_iterator i = this->begin(); i != this->end(); ++i) {
302 if (i->second.QE > Pmax) {
303 THROW(
JValueOutOfRange,
"Hit probability PMT " << i->first <<
' ' << i->second.QE <<
" > maximum probability given expectation value " << this->mu << endl);
307 for (JPMTParametersMap::iterator i = this->begin(); i != this->end(); ++i) {
311 if (i->second.QE > 0.0 && P > 0.0)
312 i->second.QE =
getQE(i->second.QE, this->mu) / P;
331 JStringStream is(in);
340 JProperties demo =
object.defaultPMTParameters.getProperties();
342 properties[
"PMT"] = static_cast<JPMTParametersMap_t&>(
object);
343 properties[
"pmt"] = helper;
344 properties[
"%"] = demo;
345 properties[
"QE"] =
object.QE;
346 properties[
"mu"] =
object.mu;
348 is >>
object.comment;
364 using namespace JLANG;
368 JProperties demo =
object.defaultPMTParameters.getProperties();
370 properties[
"PMT"] = static_cast<const JPMTParametersMap_t&>(
object);
371 properties[
"%"] = demo;
373 out <<
object.comment;
456 helper.
object[id].getProperties().read(in);
472 for (JPMTParametersMap::const_iterator i = helper.
object.begin(); i != helper.
object.end(); ++i) {
476 i->second.getProperties(helper.
equation).write(out);
friend std::ostream & operator<<(std::ostream &out, const JPMTParametersMapHelper &helper)
Stream output PMT parameters map helper.
double getHitProbability(const double QE, const double mu)
Get ratio of hit probabilities for given QE and expectation value of the number of photo-electrons.
JPMTParameters defaultPMTParameters
Default PMT parameters.
friend std::istream & operator>>(std::istream &in, JPMTParametersMapHelper &helper)
Stream input PMT parameters map helper.
const JEquationParameters & equation
static JEquationParameters & getEquationParameters()
Get equation parameters.
Exception for reading of file.
double getQE(const JPMTIdentifier &id) const
Get QE of given PMT.
double getSurvivalProbability(const JPMTParameters ¶meters)
Get model dependent probability that a one photo-electron hit survives the simulation of the PMT assu...
Exception for opening of file.
bool is_valid() const
Check validity of PMT parameters.
Auxiliary base class for controling the throwing of exceptions.
static void setEquationParameters(const JEquationParameters &equation)
Set equation parameters.
Auxiliary class for I/O of PMT parameters map.
double getQE(const double R, const double mu)
Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons.
std::map< JPMTIdentifier, JPMTParameters > JPMTParametersMap_t
Type definition of map PMT identifier to PMT parameters.
double getQE() const
Get global QE.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
friend std::istream & operator>>(std::istream &in, JPMTParametersMap &object)
Stream input.
static JStat getFileStatus
Function object for file status.
void setQE(const double QE)
Set global QE.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Auxiliary class for map of PMT parameters.
Exception for accessing a value in a collection that is outside of its range.
const JPMTParameters & getPMTParameters(const JPMTIdentifier &id) const
Get PMT parameters.
JPMTParametersMapHelper(JPMTParametersMap &__object, const JEquationParameters &__equation)
Constructor.
static void Throw(const bool option)
Enable/disable throw option.
const JPMTParameters & getDefaultPMTParameters() const
Get default PMT parameters.
JPMTParametersMap & object
Simple data structure to support I/O of equations (see class JLANG::JEquation).
JLANG::JEquationFacet setequation
Type definition of stream manipulator for equational I/O.
double getHitProbability(const JPMTIdentifier &id) const
Get ratio of hit probabilities of given PMT.
JPMTParametersMap(const char *const file_name)
Constructor.
Utility class to parse parameter values.
JPMTParametersMap(const JPMTParameters ¶meters=JPMTParameters())
Constructor.
friend std::ostream & operator<<(std::ostream &out, const JPMTParametersMap &object)
Stream output.
bool is_valid() const
Check validity of PMT parameters.
double getMu() const
Get expectation value for number of photo-electrons given two-fold (or higher) coincidence rate.
static equation_type< T > make_equation(const std::string &key, const T &value)
Auxiliary method to create equation type.
double mu
Expectation value for number of photo-electrons given two-fold (or higher) coincidence rate.
Auxiliary base class for storing and loading a single object to and from an ASCII file,...
Auxiliary classes and methods for language specific functionality.
void convertHitProbabilityToQE(const double mu)
Convert the hit probabilities to QEs for given expectation value.
double QE
relative quantum efficiency
Data structure for PMT parameters.
Auxiliary classes and methods for detector calibration.
double getMaximalHitProbability(const double mu)
Get maximal ratio of hit probabilities for given QE and expectation value of the number of photo-elec...
void setDefaultPMTParameters(const JPMTParameters ¶meters)
Set default PMT parameters.