Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
lem::PIDDetails Class Reference

Attach LEM-specific info to the base PID object. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/LEM/PIDDetails.h"

Inheritance diagram for lem::PIDDetails:
rb::PID

Public Member Functions

 PIDDetails ()
 
 PIDDetails (double pid)
 
std::string ToString () const
 
int Pdg () const
 
double Value () const
 
void SetPdg (int pdg)
 
void SetVal (double val)
 

Static Public Member Functions

static PIDDetails FromString (const std::string &s)
 

Public Attributes

MatchList matchList
 
PIDExtraVars vars
 

Protected Attributes

int fPdg
 pdg code More...
 
double fVal
 pid value More...
 

Detailed Description

Attach LEM-specific info to the base PID object.

Definition at line 20 of file PIDDetails.h.

Constructor & Destructor Documentation

lem::PIDDetails::PIDDetails ( )
inline

Definition at line 23 of file PIDDetails.h.

23 {}
lem::PIDDetails::PIDDetails ( double  pid)
inline

Definition at line 25 of file PIDDetails.h.

References FromString(), string, and ToString().

25 : PID(12, pid) {}
PID()
Definition: PID.cxx:13

Member Function Documentation

PIDDetails lem::PIDDetails::FromString ( const std::string s)
static

Definition at line 19 of file PIDDetails.cxx.

References om::cerr, allTimeWatchdog::endl, errno, rb::PID::fPdg, lem::PIDExtraVars::FromString(), rb::PID::fVal, elec2geo::pos, runNovaSAM::ret, and vars.

Referenced by PIDDetails(), and lem::LEMClient::produce().

20  {
22  ret.fPdg = 12;
23 
24  const size_t pos = s.find("pid=");
25  if(pos == std::string::npos){
26  std::cerr << "PIDExtraVars::FromString(): couldn't find pid"
27  << std::endl;
28  abort();
29  }
30  const size_t startpos = s.find("=", pos)+1;
31  const size_t endpos = s.find("\n", startpos);
32  if(endpos == std::string::npos){
33  std::cerr << "PIDExtraVars::FromString(): couldn't find "
34  << "newline after pid" << std::endl;
35  abort();
36  }
37 
38  errno = 0;
39  ret.fVal = strtod(s.substr(startpos, endpos-startpos).c_str(), 0);
40  if(errno != 0){
41  std::cerr << "PIDExtraVars::FromString(): failed to parse "
42  << "numerical value of pid" << std::endl;
43  abort();
44  }
45 
46  // Don't unserialize matchList as yet
47  ret.vars = PIDExtraVars::FromString(s);
48 
49  return ret;
50  }
OStream cerr
Definition: OStream.cxx:7
const XML_Char * s
Definition: expat.h:262
int errno
Definition: errno.cpp:12
static PIDExtraVars FromString(const std::string &s)
int rb::PID::Pdg ( ) const
inlineinherited

Definition at line 21 of file PID.h.

References rb::PID::fPdg.

Referenced by qeef::QeFinderVal::analyze().

21 {return fPdg; }
int fPdg
pdg code
Definition: PID.h:27
void rb::PID::SetPdg ( int  pdg)
inlineinherited
void rb::PID::SetVal ( double  val)
inlineinherited
std::string lem::PIDDetails::ToString ( ) const

Definition at line 9 of file PIDDetails.cxx.

References rb::PID::fVal, lem::PIDExtraVars::ToString(), and vars.

Referenced by PIDDetails(), and lem::LEMWorkerOutput::ReturnResults().

10  {
11  char buf[1024];
12  sprintf(buf, "pid=%.*e\n", DBL_DIG, fVal);
13 
14  // Don't bother to serialize the match list
15  return buf+vars.ToString();
16  }
std::string ToString() const
double fVal
pid value
Definition: PID.h:28
PIDExtraVars vars
Definition: PIDDetails.h:32
double rb::PID::Value ( ) const
inlineinherited

Member Data Documentation

int rb::PID::fPdg
protectedinherited

pdg code

Definition at line 27 of file PID.h.

Referenced by FromString(), rb::PID::Pdg(), and rb::PID::SetPdg().

double rb::PID::fVal
protectedinherited

pid value

Definition at line 28 of file PID.h.

Referenced by FromString(), rb::PID::SetVal(), ToString(), and rb::PID::Value().

MatchList lem::PIDDetails::matchList

Definition at line 31 of file PIDDetails.h.

Referenced by lem::MakePID::produce().

PIDExtraVars lem::PIDDetails::vars

Definition at line 32 of file PIDDetails.h.

Referenced by caf::FillLEMVars(), FromString(), lem::MakePID::produce(), and ToString().


The documentation for this class was generated from the following files: