1#ifndef __JAANET__JEVTWEIGHTFACTORMEFFRATIO__
2#define __JAANET__JEVTWEIGHTFACTORMEFFRATIO__
70 public JClonable<JEvtWeightFactor, JEvtWeightFactorMeffRatio>
93 hMeff (
"",
"default"),
103 for (Int_t i = 1; i <=
pMeff->GetNbinsX(); ++i) {
104 pMeff->SetBinContent(i, 1.0);
107 pMeff->SetDirectory(0);
161 pMeff->SetDirectory(0);
188 pMeff->SetDirectory(0);
283 const Int_t Nbins =
pMeff->GetNbinsX();
285 const Int_t i0 = max(1, min(Nbins,
pMeff->FindBin(x)));
287 const Double_t x0 =
pMeff->GetBinCenter (i0);
288 const Double_t y0 =
pMeff->GetBinContent(i0);
290 const Int_t i1 = max(2, min(Nbins-1, (x > x0 ? i0+1 : i0-1)));
292 const Double_t x1 =
pMeff->GetBinCenter(i1);
293 const Double_t y1 =
pMeff->GetBinCenter(i1);
295 return y0 + (x-x0) * (y1-y0)/(x1-x0);
307 const double x2)
const
327 const double X = log10(E0);
343 const double E0 =
getE0(event);
358 const double X = log10(Enu);
391 const double X = log10(Evis);
424 const double EvisLL)
const
463 const double EvisLL)
const
499 return (this->*
mfp)(evt);
531 std::istream&
read(std::istream& in)
override final
538 if (getFileStatus(is.str().c_str())) {
572 template<
class JEvtWeightFactorMeffRatio_t>
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
I/O formatting auxiliaries.
Utility class to parse parameter values.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Auxiliary class to define a range between two values.
Utility class to parse parameter values.
double getVolume() const
Get volume.
Auxiliary class to handle file name, ROOT directory and object name.
TString getObjectName() const
Get object name.
const std::string & getFilename() const
Get file name.
bool is_valid() const
Check validity.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Exception for opening of file.
Exception for null pointer operation.
Wrapper class around STL stringstream class to facilitate optional loading of data from file.
void load()
Load data from file with name corresponding to current contents.
Exception for accessing a value in a collection that is outside of its range.
Extensions to Evt data format.
double getE0(const Evt &evt)
Get initial state energy of a neutrino interaction.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const JCylinder3D getMaximumContainmentVolume()
Forward function declarations.
double getVisibleEnergyLeadingLepton(const Trk &, const JCylinder3D &)
double getVisibleEnergy(const Trk &, const JCylinder3D &)
Get the visible energy of a track.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Auxiliary class for I/O of effective mass ratio factor.
JEvtWeightFactorMeffRatioHelper(JEvtWeightFactorMeffRatio_t &factor, const JEquationParameters &eqpars)
Constructor.
Implementation of reweighting factor for effective mass ratios.
double(JEvtWeightFactorMeffRatio::*) pFunction(const Evt &) const
Type definition of pointer to member function for calculating effective mass ratios.
void configure()
Configure effective mass ratio factor.
JRootObjectID hMeff
Effective mass histogram OID.
double getMeffRatio2(const Evt &event) const
Get effective mass ratio based on a scaling of the primary neutrino energy.
double interpolate(const double x) const
Perform linear inter- or extrapolation of effective mass for given abscissa value.
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
Get properties of this class.
std::istream & read(std::istream &in) override final
Read event-weight factor from input.
bool is_valid() const override final
Check if this effective mass ratio weight factor is valid.
JCylinder3D fiducialVolume
Fiducial volume (for visible energy computation)
JMeffRatioOption
Indices of options for calculating effective mass ratios.
@ ENERGY_INITIAL_STATE
Compute effective mass ratio based on scaling of the initial state energy.
@ EVIS
Compute effective mass ratio based on scaling of the total visible energy.
@ NUMBER_OF_OPTIONS
N.B.: This enum value needs to be specified last!
@ EVIS_HADRONIC_CONTR
Compute effective mass ratio based on scaling of the visible energy contribution of the hadronic show...
@ ENERGY_NEUTRINO
Compute effective mass ratio based on scaling of theprimary neutrino energy.
@ EVIS_LEADING_LEPTON_CONTR
Compute effective mass ratio based on scaling of the visible energy contribution of the leading lepto...
JCylinder3D getFiducialVolume() const
Retrieve fiducial volume.
JEvtWeightFactorMeffRatio(const JRootObjectID &objectID, const JMeffRatioOption option, const double ratio, const JRange_t &range, const bool logE, const JCylinder3D &fiducialVolume)
Constructor.
double getMeffRatio4(const Evt &event) const
Get effective mass ratio based on a scaling of the leading leptonic contribution to the total visible...
double getMeffRatio2(const double Enu) const
Get effective mass ratio based on a scaling of the primary neutrino energy.
double getFactor(const Evt &evt) const override final
Get weighting factor for given event.
JEvtWeightFactorMeffRatio(const JEvtWeightFactorMeffRatio &factor)
Copy constructor.
bool logE
Toggle logarithmic abscissa.
double getMeffRatio3(const Evt &event) const
Get effective mass ratio based on a scaling of the total visible energy.
int option
Effective mass ratio option.
double getMeffRatio1(const double E0) const
Get effective mass ratio based on a scaling of the initial state energy.
double getMeffRatio5(const Evt &event) const
Get effective mass ratio based on a scaling of the hadronic contribution to the total visible energy.
double getMeffRatio(const double x1, const double x2) const
Get effective mass ratio based on a scaling of the initial state energy.
void setFiducialVolume(const JCylinder3D &fiducialVolume)
Set fiducial volume.
const double MeffMin
Minimum effective mass.
JRange_t range
Applicable range.
std::unique_ptr< TH1 > pMeff
Unique pointer to effective mass ratio histogram.
JRange< double > JRange_t
JEvtWeightFactorMeffRatio()
Default constructor.
double getMeffRatio5(const double Evis, const double EvisLL) const
Get effective mass ratio based on a scaling of the hadronic contribution to the total visible energy.
double getMeffRatio4(const double Evis, const double EvisLL) const
Get effective mass ratio based on a scaling of the leading leptonic contribution to the total visible...
double getMeffRatio3(const double Evis) const
Get effective mass ratio based on a scaling of the total visible energy.
const TH1 & getHistogram() const
Retrieve effective mass histogram.
double ratio
Abscissa ratio.
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) const override final
Get properties of this class.
pFunction mfp
Pointer to member method for calculating effective mass ratios.
double getMeffRatio1(const Evt &event) const
Get effective mass ratio based on a scaling of the initial state energy.
static const char *const getTypeKey()
Get type keyword.
static JEquationParameters & getEquationParameters()
Get equation parameters.
Template class for object cloning.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.