1#ifndef __JAANET__JNEUTRINOINTERACTIONCATEGORY__
2#define __JAANET__JNEUTRINOINTERACTIONCATEGORY__
59 const int absType = abs(type);
80 for (vector<JAANET::physics>::const_iterator i = header.
physics.cbegin(); i != header.
physics.cend(); ++i) {
82 istringstream iss(i->buffer);
84 for (
string buffer; iss >> buffer ;) {
118 if (! (iss.peek() == (
int)
'A' &&
119 iss.ignore() && iss >> A &&
120 iss.peek() == (
int)
'Z' &&
121 iss.ignore() && iss >> Z &&
127 return make_pair(Z,A);
135 public JClonable<JEvtCategory, JNeutrinoInteractionCategory>
166 this->primaryType = neutrinoType;
189 this->primaryType = neutrinoType;
220 this->primaryType = neutrinoType;
233 const int primaryType) :
241 vector<JAANET::flux>::const_iterator i = find_if(header.
flux.cbegin(), header.
flux.cend(),
245 this->primaryType = primaryType;
247 THROW(
JValueOutOfRange,
"JNeutrinoInteractionCategory::JNeutrinoInteractionCategory(): Given header does not match with given primary type " << primaryType <<
".");
339 return (this->primaryType == cat.primaryType &&
342 this->targetZ == cat.
targetZ &&
343 this->targetA == cat.
targetA &&
344 this->Erange .overlap(cat.
Erange) &&
345 this->coszRange .overlap(cat.
coszRange));
408#define RETURN_IF_DIFFERENT(A, B) \
409 if (A != B) { return A < B; }
415 if (p == NULL) {
return false; }
422 if (p->
Erange != this->Erange) {
431#undef RETURN_IF_DIFFERENT
479 template<
class JNeutrinoInteractionCategory_t>
484 (*this)[
"neutrinoType"] = cat.primaryType;
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition of GENIE neutrino interaction types.
#define RETURN_IF_DIFFERENT(A, B)
Definition of particle types.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Auxiliary class to define a range between two values.
std::vector< JAANET::flux > flux
std::vector< JAANET::physics > physics
Utility class to parse parameter values.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Exception for accessing a value in a collection that is outside of its range.
Extensions to Evt data format.
JScatteringTypeGENIE_t
Enumeration of GENIE scattering types.
@ DARK_MATTER_SCATTERING_TYPES_END
End of dark matter scattering types.
@ NEUTRINO_SCATTERING_TYPES_END
End of standard scattering types.
@ DARK_MATTER_SCATTERING_TYPES_START
Start of dark matter scattering types.
@ NEUTRINO_SCATTERING_TYPES_START
Start of standard scattering types.
std::pair< JParameter< int >, JParameter< int > > getTargetInfo(const JHead &header)
Auxiliary function to retrieve the target atomic number and mass number.
static const char *const CHARGED_CURRENT
Charged current header string identifier.
JInteractionTypeGENIE_t getInteractionType(const int intType)
Auxiliary function to convert interaction types.
const Trk & get_primary(const Evt &evt)
Auxiliary function to retrieve the primary track of an event.
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
JInteractionTypeGENIE_t
Enumeration of GENIE interaction types.
@ UNDEFINED
Unknown interaction type.
@ INTERACTION_TYPES_END
End of interaction types.
@ WEAK_NEUTRAL_CURRENT
Weak neutral current interaction.
@ WEAK_CHARGED_CURRENT
Weak charged current interaction.
@ INTERACTION_TYPES_START
Start of interaction types.
static const char *const NEUTRAL_CURRENT
Neutral current header string identifier.
bool is_gseagen(const JHead &header)
Check for generator.
static const JRange< double > DEFAULT_NEUTRINO_ENERGY_RANGE
Default neutrino energy range [GeV].
bool is_neutrino_primary(const int type)
Auxiliary function to check if given PDG code corresponds to a neutrino.
static const JRange< double > DEFAULT_NEUTRINO_COSINE_ZENITH_ANGLE_RANGE
Default neutrino cosine zenith angle range [-].
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Low-level interface for event categories.
static JEquationParameters & getEquationParameters()
Get equation parameters.
Auxiliary class for I/O of neutrino interaction category.
JNeutrinoInteractionCategoryHelper(JNeutrinoInteractionCategory_t &cat, const JEquationParameters &eqpars)
Constructor.
Class for neutrino interaction categories.
JNeutrinoInteractionCategory(const JHead &header, const int primaryType)
Constructor.
bool is_valid() const override final
Check if neutrino interaction categories is valid.
JProperties getProperties(const JEquationParameters &eqpars=JEvtCategory::getEquationParameters()) override final
Get properties of this class.
bool match(const Evt &event) const override final
Check whether given event matches with this event category.
JParameter< int > interactionType
interaction type
JNeutrinoInteractionCategory(const int neutrinoType, const JRange_t &Erange, const JRange_t &coszRange)
Constructor.
JNeutrinoInteractionCategory(const JHead &header)
Constructor.
JRange_t coszRange
cosine zenith range
JNeutrinoInteractionCategory(const int neutrinoType, const JInteractionTypeGENIE_t interactionType, const JScatteringTypeGENIE_t scatteringType, const int targetZ, const int targetA, const JRange_t &Erange, const JRange_t &coszRange)
Constructor.
bool less(const JEvtCategory &category) const override final
Less-than method.
JTOOLS::JRange< double > JRange_t
JNeutrinoInteractionCategory()
Default constructor.
JNeutrinoInteractionCategory(const int neutrinoType)
Constructor.
JParameter< int > targetZ
target atomic number
JProperties getProperties(const JEquationParameters &eqpars=JEvtCategory::getEquationParameters()) const override final
Get properties of this class.
JRange_t Erange
neutrino energy range
bool match(const JHead &header) const override final
Check whether this event category matches with the given MC header.
JParameter< int > targetA
target mass number
JParameter< int > scatteringType
scattering type
std::string buffer
General purpose name.
General purpose class of phase space generation.
JRange_t cosT
Cosine zenith angle range
JRange_t E
Energy range [GeV].
Template class for object cloning.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
static const int W2LIST_GSEAGEN_CC
Charged current interaction flag.
static const int W2LIST_GSEAGEN_TARGETZ
number of protons in the target
static const int W2LIST_GSEAGEN_TARGETA
number of nuclons in the target
static const int W2LIST_GSEAGEN_ICHAN
Interaction channel.