Template file scanner with event weight.
More...
#include <JWeightFileScanner.hh>
|
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" |
|
|
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...
|
|
template<class JFileScanner_t = JMultipleFileScanner<Evt>>
struct JAANET::JWeightFileScanner< JFileScanner_t >
Template file scanner with event weight.
Definition at line 22 of file JWeightFileScanner.hh.
◆ pointer_type
template<class JClass_t, template< class > class JMemory_t = JNew>
◆ storage_type
template<class JClass_t, template< class > class JMemory_t = JNew>
◆ memory_type
template<class JClass_t, template< class > class JMemory_t = JNew>
◆ JWeightFileScanner() [1/2]
template<class JFileScanner_t = JMultipleFileScanner<Evt>>
◆ JWeightFileScanner() [2/2]
template<class JFileScanner_t = JMultipleFileScanner<Evt>>
Constructor.
- Parameters
-
input_files | input files |
weight | event weight |
limit | limit |
Definition at line 40 of file JWeightFileScanner.hh.
◆ configure() [1/2]
template<class JFileScanner_t = JMultipleFileScanner<Evt>>
Configure.
- Parameters
-
input_files | input files |
weight | event weight |
limit | limit |
Definition at line 55 of file JWeightFileScanner.hh.
63 this->
reset(weight.clone());
◆ configure() [2/2]
◆ getWeight()
double JAANET::JWeightEventHelper::getWeight |
( |
const Evt & |
evt | ) |
const |
|
inlineinherited |
Get weight of given event.
- Parameters
-
- Returns
- weight [1/s]
Definition at line 50 of file JWeightEventHelper.hh.
53 return get()->getWeight(evt);
55 THROW(JNullPointerException,
"JWeightEventHelper::getWeight(): null pointer.");
◆ getHeader() [1/2]
const JHead& JAANET::JHead::getHeader |
( |
| ) |
const |
|
inlineinherited |
Get header.
- Returns
- header
Definition at line 884 of file JHead.hh.
886 return static_cast<const JHead&>(*
this);
◆ getHeader() [2/2]
JHead& JAANET::JHead::getHeader |
( |
| ) |
|
|
inlineinherited |
Get header.
- Returns
- header
Definition at line 895 of file JHead.hh.
897 return static_cast<JHead&>(*
this);
◆ setHeader()
void JAANET::JHead::setHeader |
( |
const JHead & |
header | ) |
|
|
inlineinherited |
Set header.
- Parameters
-
Definition at line 906 of file JHead.hh.
908 static_cast<JHead&>(*
this) = header;
◆ pull() [1/2]
template<class T >
const_iterator JAANET::JHead::pull |
( |
T JHead::* |
pd | ) |
const |
|
inlineinherited |
Pull given data member from Head.
- Parameters
-
- Returns
- iterator of Head
Definition at line 919 of file JHead.hh.
◆ pull() [2/2]
template<class T >
iterator JAANET::JHead::pull |
( |
T JHead::* |
pd | ) |
|
|
inlineinherited |
Pull given data member from Head.
- Parameters
-
- Returns
- iterator of Head
Definition at line 932 of file JHead.hh.
◆ push()
template<class T >
void JAANET::JHead::push |
( |
T JHead::* |
pd | ) |
|
|
inlineinherited |
Push given data member to Head.
- Parameters
-
Definition at line 944 of file JHead.hh.
◆ erase()
template<class T >
void JAANET::JHead::erase |
( |
T JHead::* |
pd | ) |
|
|
inlineinherited |
Remove given data member from Head.
- Parameters
-
Definition at line 956 of file JHead.hh.
960 if (p != this->end()) {
964 static_cast<Head*>(
this)->erase(p);
◆ 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
-
header | second header |
option | option |
- Returns
- true if matches; else false
Definition at line 979 of file JHead.hh.
◆ match() [2/4]
template<class T >
static bool JAANET::JHead::match |
( |
const T & |
first, |
|
|
const T & |
second |
|
) |
| |
|
inlinestaticprivateinherited |
Test match.
- Parameters
-
first | first object |
second | second object |
- Returns
- true if matches; else false
Definition at line 1164 of file JHead.hh.
1167 return first.match(second);
◆ match() [3/4]
template<class T >
|
inlinestaticprivateinherited |
Test one container is subset of other container or vice versa.
- Parameters
-
first | first object |
second | second object |
- Returns
- true if first (second) is subset of second (first); else false
Definition at line 1179 of file JHead.hh.
1186 if (
match(*ix, *iy)) {
1192 return ns == first.size() || ns == second.size();
◆ 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
-
first | first header |
second | second header |
option | option |
pd | pointer to data member
|
- Returns
- true if matches; else false
Definition at line 1209 of file JHead.hh.
1214 if (option || second.
pull(pd) != second.end())
1215 return match(first.*pd, second.*pd);
◆ less()
bool JAANET::JHead::less |
( |
const JHead & |
header | ) |
const |
|
inlineinherited |
Comparison of headers.
- Parameters
-
- Returns
- true if this header less than given header; else false
Definition at line 1006 of file JHead.hh.
◆ add()
Addition of headers.
- Parameters
-
- Returns
- this header
Definition at line 1023 of file JHead.hh.
1025 if (
match(header)) {
1034 THROW(JException,
"JHead::add() headers do not match.");
◆ getEquationParameters()
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.
◆ setEquationParameters()
Set equation parameters.
- Parameters
-
equation | equation parameters |
Definition at line 1119 of file JHead.hh.
◆ read()
std::istream & JAANET::JHead::read |
( |
std::istream & |
in | ) |
|
|
inherited |
Read header from input.
- Parameters
-
- Returns
- input stream
Definition at line 41 of file JHead.cc.
54 JRootReadableClass cls(*
this);
56 for (JEquation equation; reader >> equation && equation.getKey() != end_event::Class_Name(); ) {
58 JRedirectString redirect(reader, equation.getValue());
60 const JRootReadableClass abc = cls.find(equation.getKey().c_str());
63 reader.getObject(abc);
66 (*this)[equation.getKey()] = equation.getValue();
◆ write()
std::ostream & JAANET::JHead::write |
( |
std::ostream & |
out | ) |
const |
|
inherited |
Write header to output.
- Parameters
-
out | output stream |
header | header |
- Returns
- output stream
- Parameters
-
- Returns
- output stream
Definition at line 79 of file JHead.cc.
86 JRootWritableClass cls(*
this);
88 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
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() ||
95 writer.put(p->GetName(), cls.get(*p),
true);
◆ print()
std::ostream & JAANET::JHead::print |
( |
std::ostream & |
out | ) |
const |
|
inherited |
Print header to output.
- Parameters
-
- Returns
- output stream
Definition at line 110 of file JHead.cc.
119 JRootWritableClass cls(*
this);
121 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
125 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
126 if (!JRootClass::is_static(*p)) {
128 writer.put(p->GetName(), cls.get(*p),
true);
130 end_event = make_pair(p->GetName(), cls.get(*p));
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();
◆ ClassDef()
JAANET::JHead::ClassDef |
( |
JHead |
, |
|
|
3 |
|
|
) |
| |
|
inherited |
◆ getSharedPointer() [1/2]
template<class JClass_t, template< class > class JMemory_t = JNew>
Get shared pointer.
- Returns
- this shared pointer
Definition at line 95 of file JSharedPointer.hh.
97 return static_cast<const JSharedPointer&>(*
this);
◆ getSharedPointer() [2/2]
template<class JClass_t, template< class > class JMemory_t = JNew>
Get shared pointer.
- Returns
- this shared pointer
Definition at line 106 of file JSharedPointer.hh.
108 return static_cast<JSharedPointer&>(*
this);
◆ setSharedPointer()
template<class JClass_t, template< class > class JMemory_t = JNew>
◆ reset() [1/5]
template<class JClass_t, template< class > class JMemory_t = JNew>
◆ reset() [2/5]
template<class JClass_t, template< class > class JMemory_t = JNew>
◆ reset() [3/5]
template<class JClass_t, template< class > class JMemory_t = JNew>
template<class T >
Reset pointer.
- Parameters
-
Definition at line 108 of file JPointer.hh.
110 this->
reset(pointer.get());
◆ reset() [4/5]
template<class JClass_t>
template<class T >
◆ reset() [5/5]
◆ set() [1/3]
template<class JClass_t, template< class > class JMemory_t = JNew>
Set pointer.
The reference counter of the shared object pointed to is incremented by one.
- Parameters
-
Definition at line 188 of file JSharedPointer.hh.
◆ set() [2/3]
template<class JClass_t, template< class > class JMemory_t = JNew>
|
inlineprotectedvirtualinherited |
◆ set() [3/3]
template<class JClass_t>
template<class T >
Set pointer.
- Parameters
-
Definition at line 96 of file JPointer.hh.
◆ initialise()
void JLANG::JSharedCounter::initialise |
( |
| ) |
|
|
inlineinherited |
◆ attach()
Attach this counter to given shared counter object.
- Parameters
-
Definition at line 46 of file JSharedCounter.hh.
◆ detach()
bool JLANG::JSharedCounter::detach |
( |
| ) |
|
|
inlineinherited |
Detach.
- Returns
- true if counter at zero; else false
Definition at line 63 of file JSharedCounter.hh.
◆ recreate()
template<class JClass_t, template< class > class JMemory_t = JNew>
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.
60 this->
set(memory_type::create());
◆ create() [1/2]
template<class JClass_t, template< class > class JMemory_t = JNew>
Create object in memory.
The memory allocated by a previously created object will be released.
Definition at line 69 of file JStorage.hh.
71 this->
reset(memory_type::create());
◆ 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
-
Definition at line 81 of file JStorage.hh.
83 this->
reset(memory_type::create(size));
◆ release()
template<class JClass_t, template< class > class JMemory_t = JNew>
Release memory.
Definition at line 91 of file JStorage.hh.
93 memory_type::release(this->
get());
◆ get()
◆ getReference() [1/2]
Get rereference to internal pointer.
- Returns
- reference to internal pointer
Definition at line 119 of file JPointer.hh.
◆ getReference() [2/2]
Get rereference to internal pointer.
- Returns
- reference to internal pointer
Definition at line 130 of file JPointer.hh.
◆ equals()
Equals.
The equality is evaluated by comparison of the internal pointers.
- Parameters
-
- Returns
- true if equals; else false
Definition at line 50 of file JAbstractPointer.hh.
52 return this->
get() ==
object.get();
◆ is_valid()
Check validity of pointer.
- Returns
- true if pointer not null; else false
Definition at line 83 of file JAbstractPointer.hh.
85 return this->
get() != NULL;
◆ operator->()
◆ operator JClass_t *()
◆ 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 |
◆ GSEAGEN
const std::string JAANET::JHead::GSEAGEN = "gSeaGen" |
|
staticinherited |
◆ MUPAGE
const std::string JAANET::JHead::MUPAGE = "HEMAS-DPM" |
|
staticinherited |
◆ JSIRENE
const std::string JAANET::JHead::JSIRENE = "JSirene" |
|
staticinherited |
◆ KM3
const std::string JAANET::JHead::KM3 = "KM3" |
|
staticinherited |
◆ KM3SIM
const std::string JAANET::JHead::KM3SIM = "KM3Sim" |
|
staticinherited |
◆ start_run
◆ XSecFile
◆ detector
◆ muon_desc_file
◆ target
◆ physics
◆ simul
◆ cut_primary
◆ cut_seamuon
◆ cut_in
◆ cut_nu
◆ spectrum
◆ can
◆ fixedcan
◆ genvol
◆ coord_origin
◆ genhencut
◆ norma
◆ livetime
◆ seabottom
◆ DAQ
◆ tgen
◆ primary
◆ end_event
◆ counter
int* JLANG::JSharedCounter::counter |
|
protectedinherited |
◆ __p
The documentation for this struct was generated from the following file:
std::vector< JAANET::physics > physics
std::vector< JAANET::simul > simul
virtual void set(JClass_t *p)
Set pointer.
bool match(const JHead &header, const bool option=true) const
Test match of headers.
JAANET::end_event end_event
JAANET::fixedcan fixedcan
virtual JClass_t * get() const
Get pointer.
bool less(const cut &object) const
Comparison.
JClass_t * __p
pointer to object
void set(const JSharedPointer &object)
Set pointer.
livetime & add(const livetime &object)
Addition.
JAANET::livetime livetime
T & getInstance(const T &object)
Get static instance from temporary object.
JAANET::coord_origin coord_origin
bool is_valid(const T &value)
Check validity of given value.
JAANET::seabottom seabottom
bool less(const primary &object) const
Comparison.
Exception for null pointer operation.
JAANET::start_run start_run
virtual void reset()=0
Reset pointer.
genvol & add(const genvol &object)
Addition.
void attach(const JSharedCounter &object)
Attach this counter to given shared counter object.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
virtual void reset()
Reset pointer.
const TDataMember * getDataMember(const JRootClass &parent, const JRootClass &member)
Get ROOT data member for given parent and member class.
const_iterator pull(T JHead::*pd) const
Pull given data member from Head.
static JStat getFileStatus
Function object for file status.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Phase space of primary particle.
void initialise()
Initialise counter.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
virtual JClass_t * get() const =0
Get pointer.
virtual void reset()
Reset pointer.
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
bool configure(const JMultipleFileScanner_t &input_files)
Configuration.
Normalisation of MUPAGE events.
JAANET::cut_seamuon cut_seamuon
const JHead & getHeader() const
Get header.
norma & add(const norma &object)
Addition.
JAANET::spectrum spectrum
bool configure(const JMultipleFileScanner_t &input_files, const JWeightEvent &weight, const JLimit &limit=JLimit())
Configure.
void setHeader(const JHead &header)
Set header.
virtual void reset()
Reset pointer.
Normlisation of CORSIKA events.
JAANET::cut_primary cut_primary
bool is_valid() const
Check validity of pointer.
virtual void set(JClass_t *p)=0
Set pointer.
DAQ & add(const DAQ &object)
Addition.