Jpp
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Private Member Functions | List of all members
JAANET::JWeightEventHelper Struct Reference

Helper class for event weighing. More...

#include <JWeightEventHelper.hh>

Inheritance diagram for JAANET::JWeightEventHelper:
JAANET::JHead 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 > > JAANET::JWeightFileScanner< JFileScanner_t >

Public Types

typedef JPointer< JClass_t > pointer_type
 
typedef JStorage< JClass_t, JMemory_t > storage_type
 
typedef JMemory_t< JClass_t > memory_type
 

Public Member Functions

bool configure (const JMultipleFileScanner_t &input_files)
 Configuration. More...
 
double getWeight (const Evt &evt) const
 Get weight of given event. More...
 
const JHeadgetHeader () const
 Get header. More...
 
JHeadgetHeader ()
 Get header. More...
 
void setHeader (const JHead &header)
 Set header. More...
 
template<class T >
const_iterator pull (T JHead::*pd) const
 Pull given data member from Head. More...
 
template<class T >
iterator pull (T JHead::*pd)
 Pull given data member from Head. More...
 
template<class T >
void push (T JHead::*pd)
 Push given data member to Head. More...
 
template<class T >
void erase (T JHead::*pd)
 Remove given data member from Head. More...
 
bool match (const JHead &header, const bool option=true) const
 Test match of headers. More...
 
bool less (const JHead &header) const
 Comparison of headers. More...
 
JHeadadd (const JHead &header)
 Addition of headers. More...
 
std::istream & read (std::istream &in)
 Read header from input. More...
 
std::ostream & write (std::ostream &out) const
 Write header to output. More...
 
std::ostream & print (std::ostream &out) const
 Print header to output. More...
 
 ClassDef (JHead, 3)
 
const JSharedPointergetSharedPointer () const
 Get shared pointer. More...
 
JSharedPointergetSharedPointer ()
 Get shared pointer. More...
 
void setSharedPointer (const JSharedPointer &object)
 Set shared pointer. More...
 
virtual void reset ()
 Reset pointer. More...
 
virtual void reset ()
 Reset pointer. More...
 
template<class T >
void reset (const JPointer< T > &pointer)
 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...
 
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
 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 JLANG::JEquationParametersgetEquationParameters ()
 Get equation parameters corresponding to Monte Carlo ASCII format, i.e: More...
 
static void setEquationParameters (const JLANG::JEquationParameters &equation)
 Set equation parameters. More...
 

Public Attributes

JAANET::start_run start_run
 
JAANET::XSecFile XSecFile
 
JAANET::detector detector
 
JAANET::muon_desc_file muon_desc_file
 
JAANET::target target
 
std::vector< JAANET::physicsphysics
 
std::vector< JAANET::simulsimul
 
JAANET::cut_primary cut_primary
 
JAANET::cut_seamuon cut_seamuon
 
JAANET::cut_in cut_in
 
JAANET::cut_nu cut_nu
 
JAANET::spectrum spectrum
 
JAANET::can can
 
JAANET::fixedcan fixedcan
 
JAANET::genvol genvol
 
JAANET::coord_origin coord_origin
 
JAANET::genhencut genhencut
 
JAANET::norma norma
 
JAANET::livetime livetime
 
JAANET::seabottom seabottom
 
JAANET::DAQ DAQ
 
JAANET::tgen tgen
 
JAANET::primary primary
 
JAANET::end_event end_event
 

Static Public Attributes

static const std::string GENHEN = "GENHEN"
 Generators. More...
 
static const std::string GENIE = "GENIE"
 
static const std::string GSEAGEN = "gSeaGen"
 
static const std::string MUPAGE = "HEMAS-DPM"
 
static const std::string JSIRENE = "JSirene"
 
static const std::string KM3 = "KM3"
 
static const std::string KM3SIM = "KM3Sim"
 

Protected Member Functions

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

Protected Attributes

int * counter
 
JClass_t * __p
 pointer to object More...
 

Static Private Member Functions

template<class T >
static bool match (const T &first, const T &second)
 Test match. More...
 
template<class T >
static bool match (const std::vector< T > &first, const std::vector< T > &second)
 Test one container is subset of other container or vice versa. More...
 
template<class T >
static bool match (const JHead &first, const JHead &second, const bool option, T JHead::*pd)
 Test match of given data member of headers. More...
 

Detailed Description

Helper class for event weighing.

Definition at line 23 of file JWeightEventHelper.hh.

Member Typedef Documentation

◆ pointer_type

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.

◆ storage_type

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.

◆ memory_type

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.

Member Function Documentation

◆ configure()

bool JAANET::JWeightEventHelper::configure ( const JMultipleFileScanner_t input_files)
inline

Configuration.

Parameters
input_filesinput files
Returns
true if okay; else false

Definition at line 33 of file JWeightEventHelper.hh.

34  {
35  setHeader(JSUPPORT::getHeader(input_files));
36 
37  if (is_valid())
38  return get()->configure(getHeader());
39  else
40  return false;
41  }

◆ getWeight()

double JAANET::JWeightEventHelper::getWeight ( const Evt &  evt) const
inline

Get weight of given event.

Parameters
evtevent
Returns
weight [1/s]

Definition at line 50 of file JWeightEventHelper.hh.

51  {
52  if (is_valid())
53  return get()->getWeight(evt);
54  else
55  THROW(JNullPointerException, "JWeightEventHelper::getWeight(): null pointer.");
56  }

◆ getHeader() [1/2]

const JHead& JAANET::JHead::getHeader ( ) const
inlineinherited

Get header.

Returns
header

Definition at line 884 of file JHead.hh.

885  {
886  return static_cast<const JHead&>(*this);
887  }

◆ getHeader() [2/2]

JHead& JAANET::JHead::getHeader ( )
inlineinherited

Get header.

Returns
header

Definition at line 895 of file JHead.hh.

896  {
897  return static_cast<JHead&>(*this);
898  }

◆ setHeader()

void JAANET::JHead::setHeader ( const JHead header)
inlineinherited

Set header.

Parameters
headerheader

Definition at line 906 of file JHead.hh.

907  {
908  static_cast<JHead&>(*this) = header;
909  }

◆ pull() [1/2]

template<class T >
const_iterator JAANET::JHead::pull ( T JHead::*  pd) const
inlineinherited

Pull given data member from Head.

Parameters
pdpointer to data member
Returns
iterator of Head

Definition at line 919 of file JHead.hh.

920  {
921  return this->find(JROOT::getDataMember(pd)->GetName());
922  }

◆ pull() [2/2]

template<class T >
iterator JAANET::JHead::pull ( T JHead::*  pd)
inlineinherited

Pull given data member from Head.

Parameters
pdpointer to data member
Returns
iterator of Head

Definition at line 932 of file JHead.hh.

933  {
934  return this->find(JROOT::getDataMember(pd)->GetName());
935  }

◆ push()

template<class T >
void JAANET::JHead::push ( T JHead::*  pd)
inlineinherited

Push given data member to Head.

Parameters
pdpointer to data member

Definition at line 944 of file JHead.hh.

945  {
946  (*this)[JROOT::getDataMember(pd)->GetName()] = "";
947  }

◆ erase()

template<class T >
void JAANET::JHead::erase ( T JHead::*  pd)
inlineinherited

Remove given data member from Head.

Parameters
pdpointer to data member

Definition at line 956 of file JHead.hh.

957  {
958  iterator p = this->pull(pd);
959 
960  if (p != this->end()) {
961 
962  this->*pd = T();
963 
964  static_cast<Head*>(this)->erase(p);
965  }
966  }

◆ match() [1/4]

bool JAANET::JHead::match ( const JHead header,
const bool  option = true 
) const
inlineinherited

Test match of headers.

Note that if option is set to false, the match applies only to data which have a corresponding entry in the underlying map of the given header.

Parameters
headersecond header
optionoption
Returns
true if matches; else false

Definition at line 979 of file JHead.hh.

980  {
981  return (match(*this, header, option, &JHead::cut_primary) &&
982  match(*this, header, option, &JHead::cut_seamuon) &&
983  match(*this, header, option, &JHead::cut_in) &&
984  match(*this, header, option, &JHead::cut_nu) &&
985  match(*this, header, option, &JHead::physics) &&
986  match(*this, header, option, &JHead::simul) &&
987  match(*this, header, option, &JHead::spectrum) &&
988  match(*this, header, option, &JHead::can) &&
989  match(*this, header, option, &JHead::fixedcan) &&
990  match(*this, header, option, &JHead::genvol) &&
991  match(*this, header, option, &JHead::coord_origin) &&
992  match(*this, header, option, &JHead::norma) &&
993  match(*this, header, option, &JHead::livetime) &&
994  match(*this, header, option, &JHead::seabottom) &&
995  match(*this, header, option, &JHead::primary) &&
996  match(*this, header, option, &JHead::DAQ));
997  }

◆ match() [2/4]

template<class T >
static bool JAANET::JHead::match ( const T &  first,
const T &  second 
)
inlinestaticprivateinherited

Test match.

Parameters
firstfirst object
secondsecond object
Returns
true if matches; else false

Definition at line 1164 of file JHead.hh.

1166  {
1167  return first.match(second);
1168  }

◆ match() [3/4]

template<class T >
static bool JAANET::JHead::match ( const std::vector< T > &  first,
const std::vector< T > &  second 
)
inlinestaticprivateinherited

Test one container is subset of other container or vice versa.

Parameters
firstfirst object
secondsecond object
Returns
true if first (second) is subset of second (first); else false

Definition at line 1179 of file JHead.hh.

1181  {
1182  size_t ns = 0;
1183 
1184  for (typename std::vector<T>::const_iterator ix = first.begin(); ix != first.end(); ++ix) {
1185  for (typename std::vector<T>::const_iterator iy = second.begin(); iy != second.end(); ++iy) {
1186  if (match(*ix, *iy)) {
1187  ++ns;
1188  }
1189  }
1190  }
1191 
1192  return ns == first.size() || ns == second.size();
1193  }

◆ match() [4/4]

template<class T >
static bool JAANET::JHead::match ( const JHead first,
const JHead second,
const bool  option,
T JHead::*  pd 
)
inlinestaticprivateinherited

Test match of given data member of headers.

Note that if option is set to false, the match applies only to data which have a corresponding tag in the underlying map of the second header.

Parameters
firstfirst header
secondsecond header
optionoption
pdpointer to data member
Returns
true if matches; else false

Definition at line 1209 of file JHead.hh.

1213  {
1214  if (option || second.pull(pd) != second.end())
1215  return match(first.*pd, second.*pd);
1216  else
1217  return true;
1218  }

◆ less()

bool JAANET::JHead::less ( const JHead header) const
inlineinherited

Comparison of headers.

Parameters
headerheader
Returns
true if this header less than given header; else false

Definition at line 1006 of file JHead.hh.

1007  {
1008  if (primary.less(header.primary))
1009  return true;
1010  else if (header.primary.less(primary))
1011  return false;
1012  else
1013  return cut_primary.less(header.cut_primary);
1014  }

◆ add()

JHead& JAANET::JHead::add ( const JHead header)
inlineinherited

Addition of headers.

Parameters
headerheader
Returns
this header

Definition at line 1023 of file JHead.hh.

1024  {
1025  if (match(header)) {
1026 
1027  genvol .add(header.genvol);
1028  norma .add(header.norma);
1029  livetime.add(header.livetime);
1030  DAQ .add(header.DAQ);
1031 
1032  } else {
1033 
1034  THROW(JException, "JHead::add() headers do not match.");
1035  }
1036 
1037  return *this;
1038  }

◆ getEquationParameters()

static JLANG::JEquationParameters& JAANET::JHead::getEquationParameters ( )
inlinestaticinherited

Get equation parameters corresponding to Monte Carlo ASCII format, i.e:

   <key>: <value> [<value>]*
   <key>: <value> [<value>]*
Returns
equation parameters

Definition at line 1106 of file JHead.hh.

1107  {
1108  static JLANG::JEquationParameters parameters(":", "\n", "", "");
1109 
1110  return parameters;
1111  }

◆ setEquationParameters()

static void JAANET::JHead::setEquationParameters ( const JLANG::JEquationParameters equation)
inlinestaticinherited

Set equation parameters.

Parameters
equationequation parameters

Definition at line 1119 of file JHead.hh.

1120  {
1121  getEquationParameters() = equation;
1122  }

◆ read()

std::istream & JAANET::JHead::read ( std::istream &  in)
inherited

Read header from input.

Parameters
ininput stream
Returns
input stream

Definition at line 41 of file JHead.cc.

42  {
43  using namespace std;
44  using namespace JPP;
45 
46  JStringStream is(in);
47 
48  if (getFileStatus(is.str().c_str())) {
49  is.load();
50  }
51 
53 
54  JRootReadableClass cls(*this);
55 
56  for (JEquation equation; reader >> equation && equation.getKey() != end_event::Class_Name(); ) {
57 
58  JRedirectString redirect(reader, equation.getValue());
59 
60  const JRootReadableClass abc = cls.find(equation.getKey().c_str());
61 
62  if (abc.is_valid()) {
63  reader.getObject(abc);
64  }
65 
66  (*this)[equation.getKey()] = equation.getValue();
67  }
68 
69  return in;
70  }

◆ write()

std::ostream & JAANET::JHead::write ( std::ostream &  out) const
inherited

Write header to output.

Parameters
outoutput stream
headerheader
Returns
output stream
Parameters
outoutput stream
Returns
output stream

Definition at line 79 of file JHead.cc.

80  {
81  using namespace std;
82  using namespace JPP;
83 
84  JRootWriter writer(out, JHead::getEquationParameters(), JAAnetDictionary::getInstance());
85 
86  JRootWritableClass cls(*this);
87 
88  TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
89 
90  for (const TDataMember* p; (p = (const TDataMember*) i->Next()) != NULL; ) {
91  if (!JRootClass::is_static(*p)) {
92  if (this->find(p->GetName()) != this->end() ||
93  cls.get(*p) == JRootClass(&JHead::start_run) ||
94  cls.get(*p) == JRootClass(&JHead::end_event)) {
95  writer.put(p->GetName(), cls.get(*p), true);
96  }
97  }
98  }
99 
100  return out << flush;
101  }

◆ print()

std::ostream & JAANET::JHead::print ( std::ostream &  out) const
inherited

Print header to output.

Parameters
outoutput stream
Returns
output stream

Definition at line 110 of file JHead.cc.

111  {
112  using namespace std;
113  using namespace JPP;
114 
115  const JEquationParameters& parameters = JHead::getEquationParameters();
116 
117  JRootWriter writer(out, parameters, JAAnetDictionary::getInstance());
118 
119  JRootWritableClass cls(*this);
120 
121  TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
122 
124 
125  for (const TDataMember* p; (p = (const TDataMember*) i->Next()) != NULL; ) {
126  if (!JRootClass::is_static(*p)) {
127  if (cls.get(*p) != JRootClass(&JHead::end_event))
128  writer.put(p->GetName(), cls.get(*p), true);
129  else
130  end_event = make_pair(p->GetName(), cls.get(*p));
131  }
132  }
133 
134  for (JHead::const_iterator i = this->begin(); i != this->end(); ++i) {
135  if (!cls.find(i->first.c_str()).is_valid()) {
136  out << i->first << parameters.getDefaultSeparator() << parameters.getDefaultWhiteSpace() << i->second << parameters.getDefaultEndOfLine();
137  }
138  }
139 
140  writer.put(end_event.first, end_event.second, true);
141 
142  return out << flush;
143  }

◆ ClassDef()

JAANET::JHead::ClassDef ( JHead  ,
 
)
inherited

◆ getSharedPointer() [1/2]

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  }

◆ getSharedPointer() [2/2]

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  }

◆ setSharedPointer()

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  }

◆ reset() [1/5]

template<class JClass_t, template< class > class JMemory_t = JNew>
virtual void JLANG::JSharedPointer< JClass_t, JMemory_t >::reset ( )
inlinevirtualinherited

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  }

◆ reset() [2/5]

template<class JClass_t, template< class > class JMemory_t = JNew>
virtual void JLANG::JPointer< JClass_t >::reset
inlineinherited

Reset pointer.

Definition at line 84 of file JPointer.hh.

85  {
86  this->__p = NULL;
87  }

◆ reset() [3/5]

template<class JClass_t, template< class > class JMemory_t = JNew>
template<class T >
void JLANG::JPointer< JClass_t >::reset ( class T  )
inlineinherited

Reset pointer.

Parameters
pointerpointer to object

Definition at line 108 of file JPointer.hh.

109  {
110  this->reset(pointer.get());
111  }

◆ reset() [4/5]

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  }

◆ reset() [5/5]

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  }

◆ set() [1/3]

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  }

◆ set() [2/3]

template<class JClass_t, template< class > class JMemory_t = JNew>
virtual void JLANG::JSharedPointer< JClass_t, JMemory_t >::set ( JClass_t *  p)
inlineprotectedvirtualinherited

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  }

◆ set() [3/3]

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  }

◆ initialise()

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  }

◆ attach()

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  }

◆ 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  }

◆ recreate()

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  }

◆ create() [1/2]

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  }

◆ create() [2/2]

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  }

◆ release()

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  }

◆ get()

template<class JClass_t>
virtual JClass_t* JLANG::JPointer< JClass_t >::get ( ) const
inlinevirtualinherited

◆ getReference() [1/2]

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  }

◆ getReference() [2/2]

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  }

◆ equals()

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  }

◆ is_valid()

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  }

◆ operator->()

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  }

◆ operator JClass_t *()

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  }

Member Data Documentation

◆ GENHEN

const std::string JAANET::JHead::GENHEN = "GENHEN"
staticinherited

Generators.

Applications.

Definition at line 845 of file JHead.hh.

◆ GENIE

const std::string JAANET::JHead::GENIE = "GENIE"
staticinherited

Definition at line 846 of file JHead.hh.

◆ GSEAGEN

const std::string JAANET::JHead::GSEAGEN = "gSeaGen"
staticinherited

Definition at line 847 of file JHead.hh.

◆ MUPAGE

const std::string JAANET::JHead::MUPAGE = "HEMAS-DPM"
staticinherited

Definition at line 848 of file JHead.hh.

◆ JSIRENE

const std::string JAANET::JHead::JSIRENE = "JSirene"
staticinherited

Definition at line 849 of file JHead.hh.

◆ KM3

const std::string JAANET::JHead::KM3 = "KM3"
staticinherited

Definition at line 850 of file JHead.hh.

◆ KM3SIM

const std::string JAANET::JHead::KM3SIM = "KM3Sim"
staticinherited

Definition at line 851 of file JHead.hh.

◆ start_run

JAANET::start_run JAANET::JHead::start_run
inherited

Definition at line 1071 of file JHead.hh.

◆ XSecFile

JAANET::XSecFile JAANET::JHead::XSecFile
inherited

Definition at line 1072 of file JHead.hh.

◆ detector

JAANET::detector JAANET::JHead::detector
inherited

Definition at line 1073 of file JHead.hh.

◆ muon_desc_file

JAANET::muon_desc_file JAANET::JHead::muon_desc_file
inherited

Definition at line 1074 of file JHead.hh.

◆ target

JAANET::target JAANET::JHead::target
inherited

Definition at line 1075 of file JHead.hh.

◆ physics

std::vector<JAANET::physics> JAANET::JHead::physics
inherited

Definition at line 1076 of file JHead.hh.

◆ simul

std::vector<JAANET::simul> JAANET::JHead::simul
inherited

Definition at line 1077 of file JHead.hh.

◆ cut_primary

JAANET::cut_primary JAANET::JHead::cut_primary
inherited

Definition at line 1078 of file JHead.hh.

◆ cut_seamuon

JAANET::cut_seamuon JAANET::JHead::cut_seamuon
inherited

Definition at line 1079 of file JHead.hh.

◆ cut_in

JAANET::cut_in JAANET::JHead::cut_in
inherited

Definition at line 1080 of file JHead.hh.

◆ cut_nu

JAANET::cut_nu JAANET::JHead::cut_nu
inherited

Definition at line 1081 of file JHead.hh.

◆ spectrum

JAANET::spectrum JAANET::JHead::spectrum
inherited

Definition at line 1082 of file JHead.hh.

◆ can

JAANET::can JAANET::JHead::can
inherited

Definition at line 1083 of file JHead.hh.

◆ fixedcan

JAANET::fixedcan JAANET::JHead::fixedcan
inherited

Definition at line 1084 of file JHead.hh.

◆ genvol

JAANET::genvol JAANET::JHead::genvol
inherited

Definition at line 1085 of file JHead.hh.

◆ coord_origin

JAANET::coord_origin JAANET::JHead::coord_origin
inherited

Definition at line 1086 of file JHead.hh.

◆ genhencut

JAANET::genhencut JAANET::JHead::genhencut
inherited

Definition at line 1087 of file JHead.hh.

◆ norma

JAANET::norma JAANET::JHead::norma
inherited

Definition at line 1088 of file JHead.hh.

◆ livetime

JAANET::livetime JAANET::JHead::livetime
inherited

Definition at line 1089 of file JHead.hh.

◆ seabottom

JAANET::seabottom JAANET::JHead::seabottom
inherited

Definition at line 1090 of file JHead.hh.

◆ DAQ

JAANET::DAQ JAANET::JHead::DAQ
inherited

Definition at line 1091 of file JHead.hh.

◆ tgen

JAANET::tgen JAANET::JHead::tgen
inherited

Definition at line 1092 of file JHead.hh.

◆ primary

JAANET::primary JAANET::JHead::primary
inherited

Definition at line 1093 of file JHead.hh.

◆ end_event

JAANET::end_event JAANET::JHead::end_event
inherited

Definition at line 1094 of file JHead.hh.

◆ counter

int* JLANG::JSharedCounter::counter
protectedinherited

Definition at line 83 of file JSharedCounter.hh.

◆ __p

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:
JAANET::JHead::physics
std::vector< JAANET::physics > physics
Definition: JHead.hh:1076
JLANG::JSharedCounter::detach
bool detach()
Detach.
Definition: JSharedCounter.hh:63
JAANET::JHead::simul
std::vector< JAANET::simul > simul
Definition: JHead.hh:1077
JLANG::JPointer::set
virtual void set(JClass_t *p)
Set pointer.
Definition: JPointer.hh:75
JAANET::JHead::match
bool match(const JHead &header, const bool option=true) const
Test match of headers.
Definition: JHead.hh:979
JAANET::JHead::end_event
JAANET::end_event end_event
Definition: JHead.hh:1094
std::iterator
Definition: JSTDTypes.hh:18
JAANET::JHead::fixedcan
JAANET::fixedcan fixedcan
Definition: JHead.hh:1084
JLANG::JPointer::get
virtual JClass_t * get() const
Get pointer.
Definition: JPointer.hh:64
JAANET::cut::less
bool less(const cut &object) const
Comparison.
Definition: JHead.hh:187
JLANG::JPointer::__p
JClass_t * __p
pointer to object
Definition: JPointer.hh:136
JLANG::JSharedPointer::set
void set(const JSharedPointer &object)
Set pointer.
Definition: JSharedPointer.hh:188
JAANET::livetime::add
livetime & add(const livetime &object)
Addition.
Definition: JHead.hh:621
JAANET::JHead::livetime
JAANET::livetime livetime
Definition: JHead.hh:1089
JAANET::DAQ
Livetime of DAQ data.
Definition: JHead.hh:706
JLANG::getInstance
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:73
JAANET::JHead::coord_origin
JAANET::coord_origin coord_origin
Definition: JHead.hh:1086
JAANET::JHead::DAQ
JAANET::DAQ DAQ
Definition: JHead.hh:1091
JAANET::is_valid
bool is_valid(const T &value)
Check validity of given value.
Definition: JHead.hh:823
JAANET::JHead::cut_nu
JAANET::cut_nu cut_nu
Definition: JHead.hh:1081
JLANG::JSharedCounter::counter
int * counter
Definition: JSharedCounter.hh:83
JAANET::JHead::seabottom
JAANET::seabottom seabottom
Definition: JHead.hh:1090
std::vector
Definition: JSTDTypes.hh:12
JAANET::primary::less
bool less(const primary &object) const
Comparison.
Definition: JHead.hh:780
JLANG::JNullPointerException
Exception for null pointer operation.
Definition: JException.hh:216
JAANET::JHead::start_run
JAANET::start_run start_run
Definition: JHead.hh:1071
JLANG::JAbstractPointer::reset
virtual void reset()=0
Reset pointer.
JAANET::genvol::add
genvol & add(const genvol &object)
Addition.
Definition: JHead.hh:451
JLANG::JSharedCounter::attach
void attach(const JSharedCounter &object)
Attach this counter to given shared counter object.
Definition: JSharedCounter.hh:46
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JAANET::JHead::cut_in
JAANET::cut_in cut_in
Definition: JHead.hh:1080
JSUPPORT::getHeader
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Definition: JMonteCarloFileSupportkit.hh:425
JLANG::JPointer::reset
virtual void reset()
Reset pointer.
Definition: JPointer.hh:84
JROOT::getDataMember
const TDataMember * getDataMember(const JRootClass &parent, const JRootClass &member)
Get ROOT data member for given parent and member class.
Definition: JRootClass.hh:634
JAANET::JHead::pull
const_iterator pull(T JHead::*pd) const
Pull given data member from Head.
Definition: JHead.hh:919
JSYSTEM::getFileStatus
static JStat getFileStatus
Function object for file status.
Definition: JStat.hh:173
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:669
JAANET::cut_primary
Phase space of primary particle.
Definition: JHead.hh:222
JLANG::JSharedCounter::initialise
void initialise()
Initialise counter.
Definition: JSharedCounter.hh:33
std::pair
Definition: JSTDTypes.hh:15
JAANET::JHead::genvol
JAANET::genvol genvol
Definition: JHead.hh:1085
JAANET::JHead::can
JAANET::can can
Definition: JHead.hh:1083
JLANG::JEquationParameters
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Definition: JEquationParameters.hh:20
JAANET::JHead::norma
JAANET::norma norma
Definition: JHead.hh:1088
std
Definition: jaanetDictionary.h:36
JLANG::JAbstractPointer::get
virtual JClass_t * get() const =0
Get pointer.
JLANG::JSharedPointer::reset
virtual void reset()
Reset pointer.
Definition: JSharedPointer.hh:171
JAANET::JHead::getEquationParameters
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
Definition: JHead.hh:1106
JAANET::livetime
Normalisation of MUPAGE events.
Definition: JHead.hh:594
JAANET::JHead::cut_seamuon
JAANET::cut_seamuon cut_seamuon
Definition: JHead.hh:1079
JAANET::JHead::getHeader
const JHead & getHeader() const
Get header.
Definition: JHead.hh:884
JAANET::norma::add
norma & add(const norma &object)
Addition.
Definition: JHead.hh:577
JAANET::JHead::spectrum
JAANET::spectrum spectrum
Definition: JHead.hh:1082
JAANET::genvol
Neutrino vertex volume.
Definition: JHead.hh:420
JAANET::primary
Primary particle.
Definition: JHead.hh:766
JAANET::JHead::setHeader
void setHeader(const JHead &header)
Set header.
Definition: JHead.hh:906
JLANG::JStorage::reset
virtual void reset()
Reset pointer.
Definition: JStorage.hh:42
JAANET::norma
Normlisation of CORSIKA events.
Definition: JHead.hh:551
JAANET::JHead::primary
JAANET::primary primary
Definition: JHead.hh:1093
JAANET::JHead::cut_primary
JAANET::cut_primary cut_primary
Definition: JHead.hh:1078
JLANG::JAbstractPointer::is_valid
bool is_valid() const
Check validity of pointer.
Definition: JAbstractPointer.hh:83
JLANG::JAbstractPointer::set
virtual void set(JClass_t *p)=0
Set pointer.
JAANET::DAQ::add
DAQ & add(const DAQ &object)
Addition.
Definition: JHead.hh:733