Implementation of event weighting for Genhen data.  
 More...
#include <JEvtWeightGenhen.hh>
Implementation of event weighting for Genhen data. 
Definition at line 34 of file JEvtWeightGenhen.hh.
 
◆ pointer_type
◆ clone_type
template<class JClonable_t , class JDerived_t > 
 
 
◆ JEvtWeightGenhen() [1/3]
  
  
      
        
          | JAANET::JEvtWeightGenhen::JEvtWeightGenhen  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Default Constructor. 
Definition at line 41 of file JEvtWeightGenhen.hh.
   41                       :
   43    {}
JFluxHelper()
Default constructor.
 
 
 
 
◆ JEvtWeightGenhen() [2/3]
  
  
      
        
          | JAANET::JEvtWeightGenhen::JEvtWeightGenhen  | 
          ( | 
          const JHead & |           header | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
  
 
Definition at line 51 of file JEvtWeightGenhen.hh.
   51                                          :
   53    {
   55    }
void configure(const JHead &header) override final
Weight normalisation configuration.
 
 
 
 
◆ JEvtWeightGenhen() [3/3]
  
  
      
        
          | JAANET::JEvtWeightGenhen::JEvtWeightGenhen  | 
          ( | 
          const JHead & |           header,  | 
         
        
           | 
           | 
          const JFlux & |           flux ) | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
  
 
Definition at line 64 of file JEvtWeightGenhen.hh.
   65                                         :
   67    {
   70    }
void configure(const pointer_type &p)
Configure event-weight factor.
 
 
 
 
◆ getName()
  
  
      
        
          | const char *const JAANET::JEvtWeightGenhen::getName  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlinefinaloverride   | 
  
 
 
◆ configure() [1/3]
  
  
      
        
          | void JAANET::JEvtWeightGenhen::configure  | 
          ( | 
          const JHead & |           header | ) | 
           | 
         
       
   | 
  
inlinefinaloverride   | 
  
 
Weight normalisation configuration. 
- Parameters
 - 
  
  
 
Definition at line 89 of file JEvtWeightGenhen.hh.
   90    {
   92      
   94 
   95        const double Nevents = header.genvol.numberOfEvents;
   96 
   97        setNormalisation(1.0 / Nevents / (60*60*24*365));
   98        
   99      } else {
  100 
  101        THROW(
JValueOutOfRange, 
"JEvtWeightGenhen::configure(): Provided header is inconsistent with Genhen.");
 
  102      }
  103    }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
 
Exception for accessing a value in a collection that is outside of its range.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
bool check(const JHead &header) const override final
Check whether header is consistent with this event weighter.
 
 
 
 
◆ check()
  
  
      
        
          | bool JAANET::JEvtWeightGenhen::check  | 
          ( | 
          const JHead & |           header | ) | 
           const | 
         
       
   | 
  
inlinefinaloverride   | 
  
 
Check whether header is consistent with this event weighter. 
- Parameters
 - 
  
  
 
- Returns
 - true if consistent; else false 
 
Definition at line 112 of file JEvtWeightGenhen.hh.
  113    {
  115    }
bool is_genhen(const JHead &header)
Check for generator.
 
 
 
 
◆ getWeight()
  
  
      
        
          | double JAANET::JEvtWeightGenhen::getWeight  | 
          ( | 
          const Evt & |           evt | ) | 
           const | 
         
       
   | 
  
inlinefinaloverride   | 
  
 
Get weight of given event. 
- Parameters
 - 
  
  
 
- Returns
 - weight [Hz] 
 
Definition at line 124 of file JEvtWeightGenhen.hh.
  125    {
  127      
  130 
  132        
  134 
  136        
  138 
  140        
  141      } else {
  142 
  145        } else {
  146          THROW(
JIndexOutOfRange,      
"JEvtWeightGenhen::getWeight(): Empty " << (evt.
w.size() < 3 ? 
"w2-" : 
"w3-") << 
"weight.");
 
  147        }
  148      }
  149    }
Exception for accessing an index in a collection that is outside of its range.
 
Exception for null pointer operation.
 
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions)
 
JEvtWeightFactor & getFactor() const
Get reference to event-weight factor.
 
Helper class for flux function.
 
static const int WEIGHTLIST_DIFFERENTIAL_EVENT_RATE
Event rate per unit of flux (c.f. taglist document) [GeV m2 sr].
 
static const int WEIGHTLIST_RESCALED_EVENT_RATE
Rescaled event rate [s-1].
 
static const int WEIGHTLIST_EVENT_RATE
Event rate [s-1].
 
 
 
 
◆ getFlux() [1/2]
  
  
      
        
          | JFlux & JAANET::JFluxHelper::getFlux  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get reference to flux function. 
- Returns
 - reference to flux function 
 
Definition at line 62 of file JFluxHelper.hh.
   63    {
   65 
   66      JEvtWeightFactor& factor = this->
getFactor();
 
   67 
   68      JFlux* p = dynamic_cast<JFlux*>(&factor);
   69 
   70      if (p != NULL) {
   71        return *p;
   72      } else {
   74      }
   75    }
 
 
 
◆ getFlux() [2/2]
  
  
      
        
          | double JAANET::JFluxHelper::getFlux  | 
          ( | 
          const Evt & |           evt | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get flux of given event. 
- Parameters
 - 
  
  
 
- Returns
 - flux [GeV^-1 * m^-2 * sr^-1 * s^-1] 
 
Definition at line 84 of file JFluxHelper.hh.
 
 
◆ configure() [2/3]
  
  
      
        
          | void JAANET::JEvtWeightFactorHelper::configure  | 
          ( | 
          const pointer_type & |           p | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Configure event-weight factor. 
- Parameters
 - 
  
    | p | pointer to event-weight factor  | 
  
   
Definition at line 68 of file JEvtWeightFactorHelper.hh.
   69    {
   71    }
std::shared_ptr< JEvtWeightFactor > pointer_type
 
 
 
 
◆ configure() [3/3]
  
  
      
        
          | void JAANET::JEvtWeightFactorHelper::configure  | 
          ( | 
          const JEvtWeightFactor & |           factor | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Configure event-weight factor. 
- Parameters
 - 
  
    | factor | event-weight factor  | 
  
   
Definition at line 79 of file JEvtWeightFactorHelper.hh.
   80    {
   82      
   83      JEvtWeightFactor* p = dynamic_cast<JEvtWeightFactor*>(factor.clone());
   84 
   85      if (p != NULL) {
   87      } else {
   89      }
   90    }
 
 
 
◆ getFactor() [1/2]
Get reference to event-weight factor. 
- Returns
 - reference to event-weight factor 
 
Definition at line 98 of file JEvtWeightFactorHelper.hh.
   99    {
  101 
  103        return *(this->get());
  104      } else {
  106      }
  107    }
Helper class for event-weight factor.
 
 
 
 
◆ getFactor() [2/2]
  
  
      
        
          | double JAANET::JEvtWeightFactorHelper::getFactor  | 
          ( | 
          const Evt & |           evt | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get weight-factor of given event. 
- Parameters
 - 
  
  
 
- Returns
 - event-weight factor 
 
Definition at line 129 of file JEvtWeightFactorHelper.hh.
  130    {
  131      const JEvtWeightFactor& weightFactor = 
getFactor();
 
  132 
  133      return weightFactor.getFactor(evt);
  134    }
 
 
 
◆ is_valid()
  
  
      
        
          | bool JAANET::JEvtWeightFactorHelper::is_valid  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Check whether this event-weight factor is valid. 
- Returns
 - true if valid; else false 
 
Definition at line 115 of file JEvtWeightFactorHelper.hh.
  116    {
  118      
  119      return (helper && helper->is_valid());
  120    }
JEvtWeightFactorHelper()
Default constructor.
 
 
 
 
◆ operator()()
  
  
      
        
          | double JAANET::JEvtWeightFactorHelper::operator()  | 
          ( | 
          const Evt & |           evt | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ getProperties() [1/2]
Get properties of this class. 
- Parameters
 - 
  
    | eqpars | equation parameters  | 
  
   
Definition at line 154 of file JEvtWeightFactorHelper.hh.
  155    {
  156      const JEvtWeightFactor& weightFactor = 
getFactor();
 
  157      
  158      return weightFactor.getProperties(eqpars);
  159    }
 
 
 
◆ getProperties() [2/2]
Get properties of this class. 
- Parameters
 - 
  
    | eqpars | equation parameters  | 
  
   
Definition at line 167 of file JEvtWeightFactorHelper.hh.
  168    {
  169      const JEvtWeightFactor& weightFactor = 
getFactor();
 
  170      
  171      return weightFactor.getProperties(eqpars);
  172    }
 
 
 
◆ clone()
template<class JClonable_t , class JDerived_t > 
  
  | 
      
   | 
  
inlineoverridevirtualinherited   | 
  
 
Get clone of this object. 
- Returns
 - pointer to newly created object 
 
Reimplemented in JPHYSICS::JPD0Transformer_t< JArgument_t >, JPHYSICS::JPDFTransformer< 2, JArgument_t >, JPHYSICS::JPDFTransformer< 3, JArgument_t >, JPHYSICS::JPDFTransformer< 4, JArgument_t >, JPHYSICS::JPDFTransformer< 5, JArgument_t >, JPHYSICS::JPDFTransformer_t< JArgument_t >, JPHYSICS::JPDGTransformer_t< JArgument_t >, and JTOOLS::JMultiMapTransformer< N, JArgument_t >::JMultiMapDefaultTransformer.
Definition at line 69 of file JClonable.hh.
   70    {
   71      return new JDerived_t(static_cast<const JDerived_t&>(*this));
   72    }
 
 
 
The documentation for this struct was generated from the following file: