Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
JAANET::JFluxMapParser Struct Reference

Auxiliary class for parsing multiparticle fluxes. More...

#include <JEvtWeightToolkit.hh>

Inheritance diagram for JAANET::JFluxMapParser:
JEEP::JProperties JOSCPROB::JOscProbHelper std::map< std::string, JPropertiesElement > JLANG::JEquationParameters JEEP::JMessage< JProperties > JLANG::JSharedPointer< JClass_t, JMemory_t > JLANG::JSharedCounter JLANG::JStorage< JClass_t, JMemory_t > JLANG::JPointer< JClass_t > JLANG::JAbstractPointer< JClass_t > JLANG::JEquals< JAbstractPointer< JClass_t > >

Public Types

typedef std::map< std::string,
JPropertiesElement
JMap_t
 
typedef JPointer< JClass_t > pointer_type
 
typedef JStorage< JClass_t,
JMemory_t > 
storage_type
 
typedef JMemory_t< JClass_t > memory_type
 

Public Member Functions

 JFluxMapParser ()
 Constructor. More...
 
JFluxMultiParticle getMultiParticleFlux () const
 Get multiparticle flux function. More...
 
 operator JFluxMultiParticle () const
 Conversion operator. More...
 
template<class T >
void put (const std::string &key, T &object)
 Put object at given key. More...
 
JPropertiesjoin (const JProperties &properties)
 Join properties objects. More...
 
JEquationParametersjoin (const JEquationParameters &value)
 Join equation parameters. More...
 
bool read (const JEquation &equation)
 Read equation. More...
 
bool read (const std::string &buffer)
 Read from input string. More...
 
std::istream & read (std::istream &in)
 Read from input stream. More...
 
std::istream & read (std::istream &in, const std::string &format)
 Read from input stream according given format. More...
 
template<class T >
std::istream & read (std::istream &in, T __begin, T __end)
 Read from input stream according given format. More...
 
std::ostream & write (std::ostream &out) const
 Write the current parameter values. More...
 
std::ostream & write (std::ostream &out, const std::string &format)
 Write to output stream according given format. More...
 
template<class T >
std::ostream & write (std::ostream &out, T __begin, T __end)
 Write to output stream according given format. More...
 
std::string sed (const std::string &format, const std::string &prefix="", const std::string &postfix="")
 Stream editing of input format. More...
 
template<class T >
const TgetValue (const std::string &key) const
 Get value. More...
 
template<class T >
TgetValue (const std::string &key)
 Get value. More...
 
template<class T >
void setValue (const std::string &key, const T &value)
 Set value. More...
 
std::string getString (const std::string &key) const
 Get string value. More...
 
std::ostream & print (std::ostream &out) const
 Print the current parameter values. More...
 
const JEquationParametersgetEquationParameters () const
 Get equation parameters. More...
 
void setEquationParameters (const JEquationParameters &buffer)
 Set equation parameters. More...
 
const char getDefaultSeparator () const
 Get default separator character. More...
 
const std::stringgetSeparator () const
 Get separator characters. More...
 
std::stringgetSeparator ()
 Get separator characters. More...
 
void setSeparator (const std::string &sep)
 Set separator character(s). More...
 
const char getDefaultEndOfLine () const
 Get default end of line character. More...
 
const char getPreferredEndOfLine (const unsigned int index) const
 Get preferred end of line character. More...
 
const std::stringgetEndOfLine () const
 Get end of line characters. More...
 
std::stringgetEndOfLine ()
 Get end of line characters. More...
 
void setEndOfLine (const std::string &eol)
 Set end of line characters. More...
 
const char getDefaultDivision () const
 Get default division character. More...
 
const std::stringgetDivision () const
 Get division characters. More...
 
std::stringgetDivision ()
 Get division characters. More...
 
void setDivision (const std::string &div)
 Set division characters. More...
 
const char getDefaultSkipLine () const
 Get default skip line character. More...
 
const std::stringgetSkipLine () const
 Get skip line characters. More...
 
std::stringgetSkipLine ()
 Get skip line characters. More...
 
void setSkipLine (const std::string &skip)
 Set skip line characters. More...
 
void setBrackets (const char left, const char right)
 Set brackets. More...
 
char getLeftBracket () const
 Get left bracket. More...
 
char & getLeftBracket ()
 Get left bracket. More...
 
char getRightBracket () const
 Get right bracket. More...
 
char & getRightBracket ()
 Get right bracket. More...
 
const char getDefaultWhiteSpace () const
 Get default white space character. More...
 
const std::stringgetWhiteSpace () const
 Get white space characters. More...
 
std::stringgetWhiteSpace ()
 Get white space characters. More...
 
void setWhiteSpace (const std::string &ws)
 Set white space characters. More...
 
const std::stringgetComment () const
 Get comment string. More...
 
std::stringgetComment ()
 Get comment string. More...
 
void setComment (const std::string &comment)
 Set comment string. More...
 
bool isSeparator (const char c) const
 Test for separator character. More...
 
bool isEndOfLine (const char c) const
 Test for end of line character. More...
 
bool isDivision (const char c) const
 Test for division character. More...
 
bool isSkipLine (const char c) const
 Test for skip line character. More...
 
bool isLeftBracket (const char c) const
 Test for left bracket character. More...
 
bool isRightBracket (const char c) const
 Test for right bracket character. More...
 
bool isWhiteSpace (const char c) const
 Test for white space character. More...
 
virtual void configure (const JOscProb &oscProb)
 Configure oscillation probability function. More...
 
virtual double getOscProb (const JOscChannel &oscChannel, const double energy, const double costh) const
 Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith angle. More...
 
const JSharedPointergetSharedPointer () const
 Get shared pointer. More...
 
JSharedPointergetSharedPointer ()
 Get shared pointer. More...
 
void setSharedPointer (const JSharedPointer &object)
 Set shared pointer. More...
 
virtual void reset () override
 Reset pointer. More...
 
template<class T >
void reset (const JPointer< T > &pointer)
 Reset pointer. More...
 
void reset (JClass_t *p)
 Reset pointer. More...
 
template<class T >
void set (const JPointer< T > &pointer)
 Set pointer. More...
 
void initialise ()
 Initialise counter. More...
 
void attach (const JSharedCounter &object)
 Attach this counter to given shared counter object. More...
 
bool detach ()
 Detach. More...
 
const int getCount ()
 Get count. More...
 
void recreate ()
 Recreate object in memory. More...
 
void create ()
 Create object in memory. More...
 
void create (const unsigned int size)
 Create array of objects in memory. More...
 
virtual JClass_t * get () const override
 Get pointer. More...
 
JClass_t *const & getReference () const
 Get rereference to internal pointer. More...
 
JClass_t *& getReference ()
 Get rereference to internal pointer. More...
 
virtual bool equals (const JAbstractPointer &object) const
 Equals. More...
 
bool is_valid () const
 Check validity of pointer. More...
 
JClass_t * operator-> () const
 Smart pointer operator. More...
 
 operator JClass_t * () const
 Type conversion operator. More...
 

Static Public Member Functions

static std::string getKey (const std::string &buffer, const std::string &sep)
 Utility method to strip off all leading characters from a string until specified character(s). More...
 

Public Attributes

std::map< int, JFlatFluxflatFluxes
 Uniform flux functions. More...
 
std::map< int, JPowerLawFluxpowerLawFluxes
 Power-law flux functions. More...
 
JNeutrinoTypeCollection atmosphericFluxes
 Atmospheric neutrino flux functions. More...
 

Static Public Attributes

static int debug
 

Protected Member Functions

void set (const JSharedPointer &object)
 Set pointer. More...
 
virtual void set (JClass_t *p) override
 Set pointer. More...
 
void release ()
 Release memory. More...
 

Protected Attributes

std::string sep
 
std::string eol
 
std::string div
 
std::string skip
 
char left
 
char right
 
std::string ws
 
std::string comment
 
int * counter
 
JClass_t * __p
 pointer to object More...
 

Friends

std::istream & operator>> (std::istream &in, JFluxMapParser &fluxMapParser)
 Stream input. More...
 
std::ostream & operator<< (std::ostream &out, const JFluxMapParser &fluxMapParser)
 Stream output. More...
 

Detailed Description

Auxiliary class for parsing multiparticle fluxes.

Definition at line 145 of file JEvtWeightToolkit.hh.

Member Typedef Documentation

Definition at line 504 of file JProperties.hh.

template<class JClass_t, template< class > class JMemory_t = JNew>
typedef JPointer<JClass_t> JLANG::JSharedPointer< JClass_t, JMemory_t >::pointer_type
inherited

Definition at line 34 of file JSharedPointer.hh.

template<class JClass_t, template< class > class JMemory_t = JNew>
typedef JStorage<JClass_t, JMemory_t> JLANG::JSharedPointer< JClass_t, JMemory_t >::storage_type
inherited

Definition at line 35 of file JSharedPointer.hh.

template<class JClass_t, template< class > class JMemory_t = JNew>
typedef JMemory_t<JClass_t> JLANG::JStorage< JClass_t, JMemory_t >::memory_type
inherited

Definition at line 33 of file JStorage.hh.

Constructor & Destructor Documentation

JAANET::JFluxMapParser::JFluxMapParser ( )
inline

Constructor.

Definition at line 152 of file JEvtWeightToolkit.hh.

153  {
154  this->put("flat", flatFluxes);
155  this->put("powerlaw", powerLawFluxes);
156  this->put("atmospheric", atmosphericFluxes);
157  }
void put(const std::string &key, T &object)
Put object at given key.
Definition: JProperties.hh:651
std::map< int, JFlatFlux > flatFluxes
Uniform flux functions.
std::map< int, JPowerLawFlux > powerLawFluxes
Power-law flux functions.
JNeutrinoTypeCollection atmosphericFluxes
Atmospheric neutrino flux functions.

Member Function Documentation

JFluxMultiParticle JAANET::JFluxMapParser::getMultiParticleFlux ( ) const
inline

Get multiparticle flux function.

Returns
multiparticle flux function

Definition at line 165 of file JEvtWeightToolkit.hh.

166  {
167  using namespace std;
168  using namespace JPP;
169 
170  JFluxMultiParticle multiFlux;
171 
172  for (map<int, JFlatFlux>::const_iterator i = flatFluxes.cbegin(); i != flatFluxes.cend(); ++i) {
173  multiFlux.insert(i->first, make_fluxFunction(i->second));
174  }
175 
177  multiFlux.insert(i->first, make_fluxFunction(i->second));
178  }
179 
180  if (is_valid()) {
181 
182  const JOscProb& oscProbInterface = *(this->get());
183 
184  const JAtmosphericNeutrinoFlux atmFlux(oscProbInterface);
185 
187 
188  for (vector<int>::const_iterator i = atmosphericFluxes.cbegin(); i != atmosphericFluxes.cend(); ++i) {
189  multiFlux.insert(*i, atmFluxFunction);
190  }
191  }
192 
193  return multiFlux;
194  }
void insert(const int type, const JEvtWeightFactor_t &factor)
Insert pair of particle code and event-weight factor.
Implementation of event-weight factor interface.
std::map< int, JFlatFlux > flatFluxes
Uniform flux functions.
JEvtWeightFactorFunction< JFunction_t, JFlux > make_fluxFunction(const JFunction_t &flux)
Auxiliary method for creating an interface to a flux function.
bool is_valid() const
Check validity of pointer.
Implementation of atmospheric neutrino flux using official KM3NeT atmospheric flux function...
Implementation of event-weight factor for multiple particle types.
std::map< int, JPowerLawFlux > powerLawFluxes
Power-law flux functions.
JNeutrinoTypeCollection atmosphericFluxes
Atmospheric neutrino flux functions.
JAANET::JFluxMapParser::operator JFluxMultiParticle ( ) const
inline

Conversion operator.

Returns
multiparticle flux function

Definition at line 202 of file JEvtWeightToolkit.hh.

203  {
204  return getMultiParticleFlux();
205  }
JFluxMultiParticle getMultiParticleFlux() const
Get multiparticle flux function.
static std::string JEEP::JProperties::getKey ( const std::string buffer,
const std::string sep 
)
inlinestaticinherited

Utility method to strip off all leading characters from a string until specified character(s).

Parameters
bufferinput string
seplast character(s) to strip
Returns
modified string

Definition at line 516 of file JProperties.hh.

517  {
518  using namespace std;
519 
520  const size_type pos = buffer.find_last_of(sep);
521 
522  if (pos != string::npos)
523  return buffer.substr(pos + 1);
524  else
525  return buffer;
526  }
template<class T >
void JEEP::JProperties::put ( const std::string key,
T object 
)
inlineinherited

Put object at given key.

Parameters
keykey
objectobject

Definition at line 651 of file JProperties.hh.

652  {
653  this->insert(value_type(key, JPropertiesElement(object)));
654  }
The property value class.
Definition: JProperties.hh:293
JProperties& JEEP::JProperties::join ( const JProperties properties)
inlineinherited

Join properties objects.

Parameters
propertiesproperties

Definition at line 662 of file JProperties.hh.

663  {
664  JEquationParameters::join(properties);
665 
666  insert(properties.begin(), properties.end());
667 
668  return *this;
669  }
JEquationParameters & join(const JEquationParameters &value)
Join equation parameters.
JEquationParameters& JLANG::JEquationParameters::join ( const JEquationParameters value)
inlineinherited

Join equation parameters.

Parameters
valueequation parameters

Definition at line 439 of file JEquationParameters.hh.

440  {
441  using namespace std;
442 
443  for (string::const_iterator i = value.sep.begin(); i != value.sep.end(); ++i) {
444  if (!isSeparator(*i)) {
445  sep += *i;
446  }
447  }
448 
449  for (string::const_iterator i = value.eol.begin(); i != value.eol.end(); ++i) {
450  if (!isEndOfLine(*i)) {
451  eol += *i;
452  }
453  }
454 
455  for (string::const_iterator i = value.div.begin(); i != value.div.end(); ++i) {
456  if (!isDivision(*i)) {
457  div += *i;
458  }
459  }
460 
461  for (string::const_iterator i = value.skip.begin(); i != value.skip.end(); ++i) {
462  if (!isSkipLine(*i)) {
463  skip += *i;
464  }
465  }
466 
467  for (string::const_iterator i = value.ws.begin(); i != value.ws.end(); ++i) {
468  if (!isWhiteSpace(*i)) {
469  ws += *i;
470  }
471  }
472 
473  return *this;
474  }
bool isEndOfLine(const char c) const
Test for end of line character.
bool isWhiteSpace(const char c) const
Test for white space character.
bool isSkipLine(const char c) const
Test for skip line character.
bool isSeparator(const char c) const
Test for separator character.
bool isDivision(const char c) const
Test for division character.
bool JEEP::JProperties::read ( const JEquation equation)
inlineinherited

Read equation.

Parameters
equationequation
Returns
status

Definition at line 678 of file JProperties.hh.

679  {
680  using namespace std;
681 
682  iterator p = find(equation.getKey());
683 
684  DEBUG("Processing key: " << equation.getKey() << ' ' << (p != end()) << endl);
685 
686  if (p != end()) {
687 
688  istringstream is(equation.getValue());
689 
690  if (isDivision(equation.getSeparator())) {
691 
692  if (p->second->is_properties()) {
693 
694  p->second->read(is);
695 
696  } else {
697 
698  ERROR("JProperties::read(): no properties object after division <" << equation.getKey() << ">" << endl);
699  }
700 
701  } else if (isSeparator(equation.getSeparator())) {
702 
703  try {
704  p->second->read(is);
705  }
706  catch(const exception& error) {
707  ERROR("JProperties::read(): read error at key <" << equation.getKey() << "> " << error.what() << endl);
708  }
709 
710  } else {
711 
712  ERROR("JProperties::read(): illegal character following key <" << equation.getKey() << "> " << equation.getSeparator() << endl);
713  }
714 
715  if (p->second.getEndMarker()) {
716  return false;
717  }
718 
719  if (fail(is)) {
720 
721  ERROR("JProperties::read(): error reading data for key <" << equation.getKey() << "> " << equation.getValue() << endl);
722  }
723 
724  } else {
725 
726  WARNING("JProperties::read(): unknown key <" << equation.getKey() << ">" << endl);
727  }
728 
729  return true;
730  }
#define WARNING(A)
Definition: JMessage.hh:65
is
Definition: JDAQCHSM.chsm:167
#define ERROR(A)
Definition: JMessage.hh:66
bool fail(std::istream &in)
Check for stream state.
Definition: JProperties.hh:57
bool isSeparator(const char c) const
Test for separator character.
bool isDivision(const char c) const
Test for division character.
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
bool JEEP::JProperties::read ( const std::string buffer)
inlineinherited

Read from input string.

Parameters
bufferinput string
Returns
read status

Definition at line 739 of file JProperties.hh.

740  {
741  std::istringstream in(buffer);
742 
743  return !fail(read(in));
744  }
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:678
bool fail(std::istream &in)
Check for stream state.
Definition: JProperties.hh:57
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::istream& JEEP::JProperties::read ( std::istream &  in)
inlineinherited

Read from input stream.

The input format is:

   [<key><sub>]<key><sep><value><eol>
   [<key><sub>]<key><sep><value><eol>

In this, white spaces are ignored. The reading of key and value pairs is controlled by the JLANG::JEquationFacet class.

Parameters
ininput stream
Returns
input stream

Definition at line 761 of file JProperties.hh.

762  {
763  using namespace std;
764 
765  in.imbue(locale(in.getloc(), new JEquationFacet(*this)));
766 
767  for (JEquation equation; in >> equation && read(equation); ) {}
768 
769  return in;
770  }
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:678
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::istream& JEEP::JProperties::read ( std::istream &  in,
const std::string format 
)
inlineinherited

Read from input stream according given format.

For each key in the format specification, a corresponding value will be read from the input stream.

Parameters
ininput stream
formatformat
Returns
input stream

Definition at line 783 of file JProperties.hh.

784  {
785  using namespace std;
786 
787  istringstream is(format);
788 
789  vector<string> buffer;
790 
791  for (string key; is >> key; ) {
792  buffer.push_back(key);
793  }
794 
795  return read(in, buffer.begin(), buffer.end());
796  }
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:678
is
Definition: JDAQCHSM.chsm:167
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class T >
std::istream& JEEP::JProperties::read ( std::istream &  in,
T  __begin,
T  __end 
)
inlineinherited

Read from input stream according given format.

For each key in the format specification, a corresponding value will be read from the input stream.

Parameters
ininput stream
__beginbegin of format
__endend of format
Returns
input stream

Definition at line 811 of file JProperties.hh.

812  {
813  using namespace std;
814 
815  for (T i = __begin; i != __end; ++i) {
816 
817  iterator p = find(*i);
818 
819  if (p != end()) {
820 
821  p->second->read(in);
822 
823  } else {
824 
825  WARNING("JProperties::read(): unknown key <" << *i << ">" << endl);
826  }
827  }
828 
829  return in;
830  }
#define WARNING(A)
Definition: JMessage.hh:65
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& JEEP::JProperties::write ( std::ostream &  out) const
inlineinherited

Write the current parameter values.

The output format is

[<key><sub>]<key><sep><value><eol> [<key><sub>]<key><sep><value><eol>

in this, white spaces are omitted.

Parameters
outoutput stream
Returns
output stream

Definition at line 846 of file JProperties.hh.

847  {
848  using namespace std;
849 
850  for (const_iterator i = begin(); i != end(); ++i) {
851 
852  char c = ' ';
853 
854  if (i->second->is_properties()) {
855  c = getDefaultDivision ();
856  } else {
857  c = getDefaultSeparator();
858  }
859 
860  i->second->write(out, (i->first + c).c_str(), getDefaultEndOfLine());
861  }
862 
863  out << flush;
864 
865  return out;
866  }
const char getDefaultSeparator() const
Get default separator character.
const char getDefaultDivision() const
Get default division character.
const char getDefaultEndOfLine() const
Get default end of line character.
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
std::ostream& JEEP::JProperties::write ( std::ostream &  out,
const std::string format 
)
inlineinherited

Write to output stream according given format.

For each key in the format specification, a corresponding value will be written to the output stream.

Parameters
outoutput stream
formatformat
Returns
output stream

Definition at line 879 of file JProperties.hh.

880  {
881  using namespace std;
882 
883  istringstream is(format);
884 
885  vector<string> buffer;
886 
887  for (string key; is >> key; ) {
888  buffer.push_back(key);
889  }
890 
891  return write(out, buffer.begin(), buffer.end());
892  }
is
Definition: JDAQCHSM.chsm:167
std::ostream & write(std::ostream &out) const
Write the current parameter values.
Definition: JProperties.hh:846
template<class T >
std::ostream& JEEP::JProperties::write ( std::ostream &  out,
T  __begin,
T  __end 
)
inlineinherited

Write to output stream according given format.

For each key in the format specification, a corresponding value will be written to the output stream.

Parameters
outoutput stream
__beginbegin of format
__endend of format
Returns
output stream

Definition at line 907 of file JProperties.hh.

908  {
909  using namespace std;
910 
911  for (T i = __begin; i != __end; ++i) {
912 
913  iterator p = find(*i);
914 
915  if (p != end()) {
916 
917  out << getDefaultWhiteSpace();
918 
919  p->second->write(out);
920 
921  } else {
922 
923  WARNING("JProperties::write(): unknown key <" << *i << ">" << endl);
924  }
925  }
926 
927  return out;
928  }
#define WARNING(A)
Definition: JMessage.hh:65
const char getDefaultWhiteSpace() const
Get default white space character.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
std::string JEEP::JProperties::sed ( const std::string format,
const std::string prefix = "",
const std::string postfix = "" 
)
inlineinherited

Stream editing of input format.

For each key in the format specification, a corresponding value will be written to the output stream.

Parameters
formatformat
prefixprefix key word
postfixpostfix key word
Returns
output stream

Definition at line 942 of file JProperties.hh.

945  {
946  using namespace std;
947 
948  string buffer = format;
949 
950  for (iterator i = begin(); i != end(); ++i) {
951 
952  string::size_type ipos = 0;
953 
954  while ((ipos = buffer.find(prefix + i->first + postfix, ipos)) != string::npos) {
955 
956  ostringstream out;
957 
958  i->second->write(out);
959 
960  buffer.replace(ipos, prefix.length() + i->first.length() + postfix.length(), out.str());
961  }
962  }
963 
964  return buffer;
965  }
template<class T >
const T& JEEP::JProperties::getValue ( const std::string key) const
inlineinherited

Get value.

Parameters
keykey
Returns
value of this JPropertiesElement

Definition at line 975 of file JProperties.hh.

976  {
977  const_iterator i = find(key);
978 
979  if (i != end())
980  return i->second.getValue<T>();
981  else
982  THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getValue()");
983  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
do set_variable OUTPUT_DIRECTORY $WORKDIR T
template<class T >
T& JEEP::JProperties::getValue ( const std::string key)
inlineinherited

Get value.

Parameters
keykey
Returns
value of this JPropertiesElement

Definition at line 993 of file JProperties.hh.

994  {
995  iterator i = find(key);
996 
997  if (i != end())
998  return i->second.getValue<T>();
999  else
1000  THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getValue()");
1001  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
do set_variable OUTPUT_DIRECTORY $WORKDIR T
template<class T >
void JEEP::JProperties::setValue ( const std::string key,
const T value 
)
inlineinherited

Set value.

Parameters
keykey
valuevalue

Definition at line 1011 of file JProperties.hh.

1012  {
1013  iterator i = find(key);
1014 
1015  if (i != end())
1016  return i->second.setValue<T>(value);
1017  else
1018  THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::setValue()");
1019  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
do set_variable OUTPUT_DIRECTORY $WORKDIR T
std::string JEEP::JProperties::getString ( const std::string key) const
inlineinherited

Get string value.

Parameters
keykey
Returns
value

Definition at line 1028 of file JProperties.hh.

1029  {
1030  const_iterator i = find(key);
1031 
1032  if (i != end())
1033  return i->second.toString();
1034  else
1035  THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getString()");
1036  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
std::ostream& JEEP::JProperties::print ( std::ostream &  out) const
inlineinherited

Print the current parameter values.

Parameters
outoutput stream
Returns
output stream

Definition at line 1045 of file JProperties.hh.

1046  {
1047  write(out);
1048 
1049  return out;
1050  }
std::ostream & write(std::ostream &out) const
Write the current parameter values.
Definition: JProperties.hh:846
const JEquationParameters& JLANG::JEquationParameters::getEquationParameters ( ) const
inlineinherited

Get equation parameters.

Returns
equation parameters

Definition at line 75 of file JEquationParameters.hh.

76  {
77  return *this;
78  }
void JLANG::JEquationParameters::setEquationParameters ( const JEquationParameters buffer)
inlineinherited

Set equation parameters.

Parameters
bufferequation parameters

Definition at line 86 of file JEquationParameters.hh.

87  {
88  static_cast<JEquationParameters&>(*this) = buffer;
89  }
Simple data structure to support I/O of equations (see class JLANG::JEquation).
const char JLANG::JEquationParameters::getDefaultSeparator ( ) const
inlineinherited

Get default separator character.

Returns
separator between parameter and its value

Definition at line 97 of file JEquationParameters.hh.

98  {
99  if (sep.empty())
100  return '=';
101  else
102  return sep[0];
103  }
const std::string& JLANG::JEquationParameters::getSeparator ( ) const
inlineinherited

Get separator characters.

Returns
separator between parameter and its value

Definition at line 111 of file JEquationParameters.hh.

112  {
113  return sep;
114  }
std::string& JLANG::JEquationParameters::getSeparator ( )
inlineinherited

Get separator characters.

Returns
separator between parameter and its value

Definition at line 122 of file JEquationParameters.hh.

123  {
124  return sep;
125  }
void JLANG::JEquationParameters::setSeparator ( const std::string sep)
inlineinherited

Set separator character(s).

Parameters
sepseparator between parameter and its value

Definition at line 133 of file JEquationParameters.hh.

134  {
135  this->sep = sep;
136  }
const char JLANG::JEquationParameters::getDefaultEndOfLine ( ) const
inlineinherited

Get default end of line character.

Returns
end of line character

Definition at line 144 of file JEquationParameters.hh.

145  {
146  if (eol.empty())
147  return '\n';
148  else
149  return eol[0];
150  }
const char JLANG::JEquationParameters::getPreferredEndOfLine ( const unsigned int  index) const
inlineinherited

Get preferred end of line character.

Parameters
indexindex
Returns
end of line character

Definition at line 159 of file JEquationParameters.hh.

160  {
161  if (eol.empty())
162  return '\n';
163  else if (index < eol.size())
164  return eol[index];
165  else
166  return eol[0];
167  }
const std::string& JLANG::JEquationParameters::getEndOfLine ( ) const
inlineinherited

Get end of line characters.

Returns
end of line characters

Definition at line 175 of file JEquationParameters.hh.

176  {
177  return eol;
178  }
std::string& JLANG::JEquationParameters::getEndOfLine ( )
inlineinherited

Get end of line characters.

Returns
end of line characters

Definition at line 186 of file JEquationParameters.hh.

187  {
188  return eol;
189  }
void JLANG::JEquationParameters::setEndOfLine ( const std::string eol)
inlineinherited

Set end of line characters.

Parameters
eolend of line character

Definition at line 197 of file JEquationParameters.hh.

198  {
199  this->eol = eol;
200  }
const char JLANG::JEquationParameters::getDefaultDivision ( ) const
inlineinherited

Get default division character.

Returns
division character

Definition at line 208 of file JEquationParameters.hh.

209  {
210  if (div.empty())
211  return '.';
212  else
213  return div[0];
214  }
const std::string& JLANG::JEquationParameters::getDivision ( ) const
inlineinherited

Get division characters.

Returns
division characters

Definition at line 222 of file JEquationParameters.hh.

223  {
224  return div;
225  }
std::string& JLANG::JEquationParameters::getDivision ( )
inlineinherited

Get division characters.

Returns
division characters

Definition at line 233 of file JEquationParameters.hh.

234  {
235  return div;
236  }
void JLANG::JEquationParameters::setDivision ( const std::string div)
inlineinherited

Set division characters.

Parameters
divdivision characters

Definition at line 244 of file JEquationParameters.hh.

245  {
246  this->div = div;
247  }
const char JLANG::JEquationParameters::getDefaultSkipLine ( ) const
inlineinherited

Get default skip line character.

Returns
skip line character

Definition at line 255 of file JEquationParameters.hh.

256  {
257  if (skip.empty())
258  return '#';
259  else
260  return skip[0];
261  }
const std::string& JLANG::JEquationParameters::getSkipLine ( ) const
inlineinherited

Get skip line characters.

Returns
skip line characters

Definition at line 269 of file JEquationParameters.hh.

270  {
271  return skip;
272  }
std::string& JLANG::JEquationParameters::getSkipLine ( )
inlineinherited

Get skip line characters.

Returns
skip line characters

Definition at line 280 of file JEquationParameters.hh.

281  {
282  return skip;
283  }
void JLANG::JEquationParameters::setSkipLine ( const std::string skip)
inlineinherited

Set skip line characters.

Parameters
skipskip line characters

Definition at line 291 of file JEquationParameters.hh.

292  {
293  this->skip = skip;
294  }
void JLANG::JEquationParameters::setBrackets ( const char  left,
const char  right 
)
inlineinherited

Set brackets.

Parameters
leftleft bracket
rightright bracket

Definition at line 303 of file JEquationParameters.hh.

304  {
305  this->left = left;
306  this->right = right;
307  }
char JLANG::JEquationParameters::getLeftBracket ( ) const
inlineinherited

Get left bracket.

Returns
left bracket

Definition at line 315 of file JEquationParameters.hh.

316  {
317  return left;
318  }
char& JLANG::JEquationParameters::getLeftBracket ( )
inlineinherited

Get left bracket.

Returns
left bracket

Definition at line 326 of file JEquationParameters.hh.

327  {
328  return left;
329  }
char JLANG::JEquationParameters::getRightBracket ( ) const
inlineinherited

Get right bracket.

Returns
right bracket

Definition at line 337 of file JEquationParameters.hh.

338  {
339  return right;
340  }
char& JLANG::JEquationParameters::getRightBracket ( )
inlineinherited

Get right bracket.

Returns
right bracket

Definition at line 348 of file JEquationParameters.hh.

349  {
350  return right;
351  }
const char JLANG::JEquationParameters::getDefaultWhiteSpace ( ) const
inlineinherited

Get default white space character.

Returns
white space character

Definition at line 359 of file JEquationParameters.hh.

360  {
361  if (ws.empty())
362  return ' ';
363  else
364  return ws[0];
365  }
const std::string& JLANG::JEquationParameters::getWhiteSpace ( ) const
inlineinherited

Get white space characters.

Returns
white space characters

Definition at line 373 of file JEquationParameters.hh.

374  {
375  return ws;
376  }
std::string& JLANG::JEquationParameters::getWhiteSpace ( )
inlineinherited

Get white space characters.

Returns
white space characters

Definition at line 384 of file JEquationParameters.hh.

385  {
386  return ws;
387  }
void JLANG::JEquationParameters::setWhiteSpace ( const std::string ws)
inlineinherited

Set white space characters.

Parameters
wswhite space characters

Definition at line 395 of file JEquationParameters.hh.

396  {
397  this->ws = ws;
398  }
const std::string& JLANG::JEquationParameters::getComment ( ) const
inlineinherited

Get comment string.

Returns
comment string

Definition at line 406 of file JEquationParameters.hh.

407  {
408  return comment;
409  }
std::string& JLANG::JEquationParameters::getComment ( )
inlineinherited

Get comment string.

Returns
comment string

Definition at line 417 of file JEquationParameters.hh.

418  {
419  return comment;
420  }
void JLANG::JEquationParameters::setComment ( const std::string comment)
inlineinherited

Set comment string.

Parameters
commentcomment string

Definition at line 428 of file JEquationParameters.hh.

429  {
430  this->comment = comment;
431  }
bool JLANG::JEquationParameters::isSeparator ( const char  c) const
inlineinherited

Test for separator character.

Parameters
ccharacter
Returns
true if separator; else false

Definition at line 483 of file JEquationParameters.hh.

484  {
485  return sep .find(c) != std::string::npos;
486  }
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
bool JLANG::JEquationParameters::isEndOfLine ( const char  c) const
inlineinherited

Test for end of line character.

Parameters
ccharacter
Returns
true if end of line; else false

Definition at line 495 of file JEquationParameters.hh.

495 { return eol .find(c) != std::string::npos; }
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
bool JLANG::JEquationParameters::isDivision ( const char  c) const
inlineinherited

Test for division character.

Parameters
ccharacter
Returns
true if division; else false

Definition at line 504 of file JEquationParameters.hh.

505  {
506  return div .find(c) != std::string::npos;
507  }
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
bool JLANG::JEquationParameters::isSkipLine ( const char  c) const
inlineinherited

Test for skip line character.

Parameters
ccharacter
Returns
true if skip line; else false

Definition at line 516 of file JEquationParameters.hh.

517  {
518  return skip.find(c) != std::string::npos;
519  }
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
bool JLANG::JEquationParameters::isLeftBracket ( const char  c) const
inlineinherited

Test for left bracket character.

Parameters
ccharacter
Returns
true if left bracket; else false

Definition at line 528 of file JEquationParameters.hh.

529  {
530  return c == left;
531  }
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
bool JLANG::JEquationParameters::isRightBracket ( const char  c) const
inlineinherited

Test for right bracket character.

Parameters
ccharacter
Returns
true if right bracket; else false

Definition at line 540 of file JEquationParameters.hh.

541  {
542  return c == right;
543  }
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
bool JLANG::JEquationParameters::isWhiteSpace ( const char  c) const
inlineinherited

Test for white space character.

Parameters
ccharacter
Returns
true if white space; else false

Definition at line 552 of file JEquationParameters.hh.

553  {
554  return ws .find(c) != std::string::npos;
555  }
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
virtual void JOSCPROB::JOscProbHelper::configure ( const JOscProb oscProb)
inlinevirtualinherited

Configure oscillation probability function.

Parameters
oscProboscillation probability function

Definition at line 55 of file JOscProbHelper.hh.

56  {
57  reset(oscProb.clone());
58  }
virtual clone_type clone() const override
Get clone of this object.
Definition: JClonable.hh:69
virtual void reset() override
Reset pointer.
virtual double JOSCPROB::JOscProbHelper::getOscProb ( const JOscChannel oscChannel,
const double  energy,
const double  costh 
) const
inlinevirtualinherited

Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith angle.

Parameters
oscChanneloscillation channel
energyneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 70 of file JOscProbHelper.hh.

73  {
74  if (is_valid()) {
75  return get()->getOscProb(oscChannel, energy, costh);
76  } else {
77  THROW(JNullPointerException, "JOscProbHelper::getOscProb(): Unspecified oscillation probability function.");
78  }
79  }
virtual double getOscProb(const JOscChannel &oscChannel, const double energy, const double costh) const
Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith an...
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
bool is_valid() const
Check validity of pointer.
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
template<class JClass_t, template< class > class JMemory_t = JNew>
const JSharedPointer& JLANG::JSharedPointer< JClass_t, JMemory_t >::getSharedPointer ( ) const
inlineinherited

Get shared pointer.

Returns
this shared pointer

Definition at line 95 of file JSharedPointer.hh.

96  {
97  return static_cast<const JSharedPointer&>(*this);
98  }
The template JSharedPointer class can be used to share a pointer to an object.
template<class JClass_t, template< class > class JMemory_t = JNew>
JSharedPointer& JLANG::JSharedPointer< JClass_t, JMemory_t >::getSharedPointer ( )
inlineinherited

Get shared pointer.

Returns
this shared pointer

Definition at line 106 of file JSharedPointer.hh.

107  {
108  return static_cast<JSharedPointer&>(*this);
109  }
The template JSharedPointer class can be used to share a pointer to an object.
template<class JClass_t, template< class > class JMemory_t = JNew>
void JLANG::JSharedPointer< JClass_t, JMemory_t >::setSharedPointer ( const JSharedPointer< JClass_t, JMemory_t > &  object)
inlineinherited

Set shared pointer.

Parameters
objectshared pointer

Definition at line 117 of file JSharedPointer.hh.

118  {
119  if (this->get() != object.get()) {
120 
121  this->reset();
122 
123  if (object.is_valid()) {
124  this->set(object);
125  }
126  }
127  }
void set(const JSharedPointer &object)
Set pointer.
bool is_valid() const
Check validity of pointer.
virtual void reset() override
Reset pointer.
template<class JClass_t, template< class > class JMemory_t = JNew>
virtual void JLANG::JSharedPointer< JClass_t, JMemory_t >::reset ( )
inlineoverridevirtualinherited

Reset pointer.

The reference counter is decremented by one and the object pointed to previously is deleted when its reference counter is zero.

Reimplemented from JLANG::JStorage< JClass_t, JMemory_t >.

Definition at line 171 of file JSharedPointer.hh.

172  {
173  if (this->detach()) {
175  }
176 
178  }
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
bool detach()
Detach.
virtual void reset() override
Reset pointer.
Definition: JPointer.hh:84
template<class JClass_t>
template<class T >
void JLANG::JPointer< JClass_t >::reset ( const JPointer< T > &  pointer)
inlineinherited

Reset pointer.

Parameters
pointerpointer to object

Definition at line 108 of file JPointer.hh.

109  {
110  this->reset(pointer.get());
111  }
virtual JClass_t * get() const override
Get pointer.
Definition: JPointer.hh:64
virtual void reset() override
Reset pointer.
Definition: JPointer.hh:84
template<class JClass_t>
void JLANG::JAbstractPointer< JClass_t >::reset ( JClass_t *  p)
inlineinherited

Reset pointer.

Parameters
ppointer to object

Definition at line 94 of file JAbstractPointer.hh.

95  {
96  if (this->get() != p) {
97 
98  this->reset();
99 
100  if (p != NULL) {
101  this->set(p);
102  }
103  }
104  }
virtual void reset()=0
Reset pointer.
virtual void set(JClass_t *p)=0
Set pointer.
template<class JClass_t, template< class > class JMemory_t = JNew>
void JLANG::JSharedPointer< JClass_t, JMemory_t >::set ( const JSharedPointer< JClass_t, JMemory_t > &  object)
inlineprotectedinherited

Set pointer.

The reference counter of the shared object pointed to is incremented by one.

Parameters
objectshared pointer

Definition at line 188 of file JSharedPointer.hh.

189  {
190  pointer_type::set(object.get());
191 
192  this->attach(object);
193  }
void attach(const JSharedCounter &object)
Attach this counter to given shared counter object.
virtual void set(JClass_t *p) override
Set pointer.
Definition: JPointer.hh:75
template<class JClass_t, template< class > class JMemory_t = JNew>
virtual void JLANG::JSharedPointer< JClass_t, JMemory_t >::set ( JClass_t *  p)
inlineoverrideprotectedvirtualinherited

Set pointer.

The reference counter of the shared object pointed to is initialised to one.

Parameters
ppointer to derived class object

Reimplemented from JLANG::JPointer< JClass_t >.

Definition at line 202 of file JSharedPointer.hh.

203  {
205 
206  this->initialise();
207  }
void initialise()
Initialise counter.
virtual void set(JClass_t *p) override
Set pointer.
Definition: JPointer.hh:75
template<class JClass_t>
template<class T >
void JLANG::JPointer< JClass_t >::set ( const JPointer< T > &  pointer)
inlineinherited

Set pointer.

Parameters
pointerpointer to object

Definition at line 96 of file JPointer.hh.

97  {
98  this->set(pointer.get());
99  }
virtual void set(JClass_t *p) override
Set pointer.
Definition: JPointer.hh:75
virtual JClass_t * get() const override
Get pointer.
Definition: JPointer.hh:64
void JLANG::JSharedCounter::initialise ( )
inlineinherited

Initialise counter.

Definition at line 33 of file JSharedCounter.hh.

34  {
35  detach();
36 
37  counter = new int(1);
38  }
bool detach()
Detach.
void JLANG::JSharedCounter::attach ( const JSharedCounter object)
inlineinherited

Attach this counter to given shared counter object.

Parameters
objectshared counter

Definition at line 46 of file JSharedCounter.hh.

47  {
48  detach();
49 
50  counter = object.counter;
51 
52  if (counter != NULL) {
53  ++(*counter);
54  }
55  }
bool detach()
Detach.
bool JLANG::JSharedCounter::detach ( )
inlineinherited

Detach.

Returns
true if counter at zero; else false

Definition at line 63 of file JSharedCounter.hh.

64  {
65  if (counter != NULL) {
66 
67  if (--(*counter) == 0) {
68 
69  delete counter;
70 
71  counter = NULL;
72 
73  return true;
74  }
75 
76  counter = NULL;
77  }
78 
79  return false;
80  }
const int JLANG::JSharedCounter::getCount ( )
inlineinherited

Get count.

Returns
count

Definition at line 88 of file JSharedCounter.hh.

89  {
90  return (counter != NULL ? *counter : 0);
91  }
template<class JClass_t, template< class > class JMemory_t = JNew>
void JLANG::JStorage< JClass_t, JMemory_t >::recreate ( )
inlineinherited

Recreate object in memory.

A new object is created if no memory is allocated yet, else the previously created object is maintained.

Definition at line 57 of file JStorage.hh.

58  {
59  if (!this->is_valid()) {
60  this->set(memory_type::create());
61  }
62  }
bool is_valid() const
Check validity of pointer.
virtual void set(JClass_t *p) override
Set pointer.
Definition: JPointer.hh:75
template<class JClass_t, template< class > class JMemory_t = JNew>
void JLANG::JStorage< JClass_t, JMemory_t >::create ( )
inlineinherited

Create object in memory.

The memory allocated by a previously created object will be released.

Definition at line 69 of file JStorage.hh.

70  {
71  this->reset(memory_type::create());
72  }
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
template<class JClass_t, template< class > class JMemory_t = JNew>
void JLANG::JStorage< JClass_t, JMemory_t >::create ( const unsigned int  size)
inlineinherited

Create array of objects in memory.

The memory allocated by previously created objects will be released.

Parameters
sizenumber of elements

Definition at line 81 of file JStorage.hh.

82  {
83  this->reset(memory_type::create(size));
84  }
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
template<class JClass_t, template< class > class JMemory_t = JNew>
void JLANG::JStorage< JClass_t, JMemory_t >::release ( )
inlineprotectedinherited

Release memory.

Definition at line 91 of file JStorage.hh.

92  {
93  memory_type::release(this->get());
94  }
template<class JClass_t>
virtual JClass_t* JLANG::JPointer< JClass_t >::get ( ) const
inlineoverridevirtualinherited
template<class JClass_t>
JClass_t* const& JLANG::JPointer< JClass_t >::getReference ( ) const
inlineinherited

Get rereference to internal pointer.

Returns
reference to internal pointer

Definition at line 119 of file JPointer.hh.

120  {
121  return __p;
122  }
JClass_t * __p
pointer to object
Definition: JPointer.hh:136
template<class JClass_t>
JClass_t* & JLANG::JPointer< JClass_t >::getReference ( )
inlineinherited

Get rereference to internal pointer.

Returns
reference to internal pointer

Definition at line 130 of file JPointer.hh.

131  {
132  return __p;
133  }
JClass_t * __p
pointer to object
Definition: JPointer.hh:136
template<class JClass_t>
virtual bool JLANG::JAbstractPointer< JClass_t >::equals ( const JAbstractPointer< JClass_t > &  object) const
inlinevirtualinherited

Equals.

The equality is evaluated by comparison of the internal pointers.

Parameters
objectabstract pointer
Returns
true if equals; else false

Definition at line 50 of file JAbstractPointer.hh.

51  {
52  return this->get() == object.get();
53  }
template<class JClass_t>
bool JLANG::JAbstractPointer< JClass_t >::is_valid ( ) const
inlineinherited

Check validity of pointer.

Returns
true if pointer not null; else false

Definition at line 83 of file JAbstractPointer.hh.

84  {
85  return this->get() != NULL;
86  }
template<class JClass_t>
JClass_t* JLANG::JAbstractPointer< JClass_t >::operator-> ( ) const
inlineinherited

Smart pointer operator.

Returns
pointer to object

Definition at line 112 of file JAbstractPointer.hh.

113  {
114  if (!is_valid())
115  THROW(JNullPointerException, "JAbstractPointer::operator->()");
116  else
117  return this->get();
118  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
bool is_valid() const
Check validity of pointer.
Exception for null pointer operation.
Definition: JException.hh:232
template<class JClass_t>
JLANG::JAbstractPointer< JClass_t >::operator JClass_t * ( ) const
inlineinherited

Type conversion operator.

Returns
pointer to object

Definition at line 126 of file JAbstractPointer.hh.

127  {
128  return this->get();
129  }

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JFluxMapParser fluxMapParser 
)
friend

Stream input.

Parameters
ininput stream
fluxMapParserflux map parser
Returns
input stream

Definition at line 215 of file JEvtWeightToolkit.hh.

216  {
217  using namespace std;
218  using namespace JPP;
219 
220  JStringStream is(in);
221 
222  if (getFileStatus(is.str().c_str())) {
223  is.load();
224  }
225 
226  is >> static_cast<JProperties&>(fluxMapParser);
227 
228  return in;
229  }
Utility class to parse parameter values.
Definition: JProperties.hh:497
is
Definition: JDAQCHSM.chsm:167
static JStat getFileStatus
Function object for file status.
Definition: JStat.hh:173
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& operator<< ( std::ostream &  out,
const JFluxMapParser fluxMapParser 
)
friend

Stream output.

Parameters
outoutput stream
fluxMapParserflux map parser
Returns
output stream

Definition at line 239 of file JEvtWeightToolkit.hh.

240  {
241  return out << static_cast<const JProperties&>(fluxMapParser);
242  }

Member Data Documentation

std::map<int, JFlatFlux> JAANET::JFluxMapParser::flatFluxes

Uniform flux functions.

Definition at line 245 of file JEvtWeightToolkit.hh.

std::map<int, JPowerLawFlux> JAANET::JFluxMapParser::powerLawFluxes

Power-law flux functions.

Definition at line 246 of file JEvtWeightToolkit.hh.

JNeutrinoTypeCollection JAANET::JFluxMapParser::atmosphericFluxes

Atmospheric neutrino flux functions.

Definition at line 248 of file JEvtWeightToolkit.hh.

std::string JLANG::JEquationParameters::sep
protectedinherited

Definition at line 558 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::eol
protectedinherited

Definition at line 559 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::div
protectedinherited

Definition at line 560 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::skip
protectedinherited

Definition at line 561 of file JEquationParameters.hh.

char JLANG::JEquationParameters::left
protectedinherited

Definition at line 562 of file JEquationParameters.hh.

char JLANG::JEquationParameters::right
protectedinherited

Definition at line 563 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::ws
protectedinherited

Definition at line 564 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::comment
protectedinherited

Definition at line 565 of file JEquationParameters.hh.

int JEEP::JMessage< JProperties >::debug
staticinherited

debug level (default is off).

Definition at line 45 of file JMessage.hh.

int* JLANG::JSharedCounter::counter
protectedinherited

Definition at line 94 of file JSharedCounter.hh.

template<class JClass_t>
JClass_t* JLANG::JPointer< JClass_t >::__p
protectedinherited

pointer to object

Definition at line 136 of file JPointer.hh.


The documentation for this struct was generated from the following file: