Jpp  16.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
JAANET::JEvtWeightFactorMupage Struct Reference

Implementation of reweighting factor for mupage events according to a specifiable ROOT TFormula. More...

#include <JEvtWeightFactorMupage.hh>

Inheritance diagram for JAANET::JEvtWeightFactorMupage:

Public Types

enum  variables {
  MUON_MULTIPLICITY, MEAN_ZENITH_ANGLE, TOTAL_MUON_ENERGY, LATERAL_SPREAD,
  NUMBER_OF_VARIABLES
}
 Indices of reweighting variables for MUPAGE. More...
 

Public Member Functions

 JEvtWeightFactorMupage ()
 Default constructor. More...
 
 JEvtWeightFactorMupage (const char *name, const char *formula)
 Constructor. More...
 
double operator() (const Evt &evt) const
 Get weighting factor for given event. More...
 

Detailed Description

Implementation of reweighting factor for mupage events according to a specifiable ROOT TFormula.

Note: The ROOT TFormula may assume any number of parameters, but should be restricted to
the physical variables listed among JEvtWeightFactorMupage::variables.
These variables may be specified within the ROOT TFormula as 'x[<index>]',
where <index> corresponds to the index of the desired physical variable within JEvtWeightFactorMupage::variables.

Definition at line 32 of file JEvtWeightFactorMupage.hh.

Member Enumeration Documentation

Indices of reweighting variables for MUPAGE.

Enumerator
MUON_MULTIPLICITY 

Muon multiplicity.

MEAN_ZENITH_ANGLE 

Average cosine of zenith angle.

TOTAL_MUON_ENERGY 

Muon bundle total energy [GeV].

LATERAL_SPREAD 

Muon bundle lateral spread [m].

NUMBER_OF_VARIABLES 

Number of reweighting variables;
N.B. This enum value needs to be specified last!

Definition at line 38 of file JEvtWeightFactorMupage.hh.

38  {
39  MUON_MULTIPLICITY, //!< Muon multiplicity
40  MEAN_ZENITH_ANGLE, //!< Average cosine of zenith angle
41  TOTAL_MUON_ENERGY, //!< Muon bundle total energy [GeV]
42  LATERAL_SPREAD, //!< Muon bundle lateral spread [m]
43 
44  NUMBER_OF_VARIABLES //!< Number of reweighting variables; \n
45  //!< N.B.\ This enum value needs to be specified last!
46  };
Number of reweighting variables; N.B. This enum value needs to be specified last! ...

Constructor & Destructor Documentation

JAANET::JEvtWeightFactorMupage::JEvtWeightFactorMupage ( )
inline

Default constructor.

Definition at line 52 of file JEvtWeightFactorMupage.hh.

52  :
53  TFormula()
54  {}
JAANET::JEvtWeightFactorMupage::JEvtWeightFactorMupage ( const char *  name,
const char *  formula 
)
inline

Constructor.

Parameters
namename
formulaformula

Definition at line 63 of file JEvtWeightFactorMupage.hh.

64  :
65  TFormula(name, formula)
66  {}
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42

Member Function Documentation

double JAANET::JEvtWeightFactorMupage::operator() ( const Evt evt) const
inline

Get weighting factor for given event.

Parameters
evtevent
Returns
weighting factor

Definition at line 75 of file JEvtWeightFactorMupage.hh.

76  {
77  using namespace std;
78  using namespace JPP;
79 
80  vector<JTrack3E> muons;
81 
83 
84  for (vector<Trk>::const_iterator i = evt.mc_trks.cbegin(); i != evt.mc_trks.cend(); ++i) {
85 
86  if (is_muon(*i)) {
87 
88  vars[MEAN_ZENITH_ANGLE] += i->dir.z / i->dir.len();
89  vars[TOTAL_MUON_ENERGY] += i->E;
90 
91  muons.push_back(getTrack(*i));
92  }
93  }
94 
95  if (muons.size() > 0) {
96 
97  vars[MUON_MULTIPLICITY] = (Double_t) muons.size();
98  vars[MEAN_ZENITH_ANGLE] /= vars[MUON_MULTIPLICITY];
99 
100  if (this->GetNdim() > (int) LATERAL_SPREAD) {
101 
102  JCircle2D circle = JCircle2D(muons.cbegin(), muons.cend()); // smallest enclosing circle
103  vars[LATERAL_SPREAD] = (Double_t) circle.getRadius();
104  }
105 
106  return this->DoEval(&vars[0]);
107 
108  } else {
109 
110  THROW(JNullPointerException, "JEvtWeightFactorMupage::operator(): No muon for event " << evt.id << '.' << endl);
111  }
112  }
JTrack3E getTrack(const Trk &track)
Get track.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
Number of reweighting variables; N.B. This enum value needs to be specified last! ...
int id
offline event identifier
Definition: Evt.hh:21
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:46

The documentation for this struct was generated from the following file: