LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CRYHelper.h
Go to the documentation of this file.
1 #ifndef EVGB_CRYHELPER_H
13 #define EVGB_CRYHELPER_H
14 #include <string>
15 #include <vector>
16 #include "CLHEP/Random/RandEngine.h"
17 
18 namespace simb { class MCTruth; }
19 
20 class CRYSetup;
21 class CRYGenerator;
22 class CRYParticle;
23 
24 namespace evgb {
26  class CRYHelper {
27  public:
28  CRYHelper();
29  explicit CRYHelper(fhicl::ParameterSet const& pset,
30  CLHEP::HepRandomEngine& engine,
31  std::string const& worldVol="vWorld");
32  ~CRYHelper();
33 
34  double Sample(simb::MCTruth& mctruth,
35  double const& surfaceY,
36  double const& detectorLength,
37  double* w,
38  double rantime=0);
39 
40  private:
41 
42  void WorldBox(double* xlo_cm,
43  double* xhi_cm,
44  double* ylo_cm,
45  double* yhi_cm,
46  double* zlo_cm,
47  double* zhi_cm) const;
48 
49  void ProjectToBoxEdge(const double xyz[],
50  const double dxyz[],
51  double &xlo, double &xhi,
52  double &ylo, double &yhi,
53  double &zlo, double &zhi,
54  double xyzout[]);
55 
56  CRYSetup* fSetup;
57  CRYGenerator* fGen;
58  double fSampleTime;
59  double fToffset;
60  double fEthresh;
61  std::string fWorldVolume;
62  std::string fLatitude;
63  std::string fAltitude;
64  std::string fSubBoxL;
65  double fBoxDelta;
66  bool fSingleEventMode;
68  };
69 
70  // The following stuff is for the random number gererator
71  template<class T> class RNGWrapper {
72  public:
73  static void set(T* object, double (T::*func)(void));
74  static double rng(void);
75  private:
76  static T* m_obj;
77  static double (T::*m_func)(void);
78  };// end of RNGWrapper class
79 
80  template<class T> T* RNGWrapper<T>::m_obj;
81 
82  template<class T> double (T::*RNGWrapper<T>::m_func)(void);
83 
84  template<class T> void RNGWrapper<T>::set(T* object, double (T::*func)(void)) {
85  m_obj = object; m_func = func;
86  }
87 
88  template<class T> double RNGWrapper<T>::rng(void) { return (m_obj->*m_func)(); }
89 
90 }
91 #endif // EVGB_CRYHELPER_H
92 
double fSampleTime
Amount of time to sample (seconds)
Definition: CRYHelper.h:58
Interface to the CRY cosmic-ray generator.
Definition: CRYHelper.h:26
static T * m_obj
Definition: CRYHelper.h:76
CRYSetup * fSetup
CRY configuration.
Definition: CRYHelper.h:56
std::string fLatitude
Latitude of detector need space after value.
Definition: CRYHelper.h:62
CRYGenerator * fGen
The CRY generator.
Definition: CRYHelper.h:57
std::string fWorldVolume
Name of the world volume.
Definition: CRYHelper.h:61
double fBoxDelta
Definition: CRYHelper.h:65
std::string fAltitude
Altitude of detector need space after value.
Definition: CRYHelper.h:63
ART objects.
std::string fSubBoxL
Length of subbox (m) need space after value.
Definition: CRYHelper.h:64
double fEthresh
Cut on kinetic energy (GeV)
Definition: CRYHelper.h:60
Physics generators for neutrinos, cosmic rays, and others.
Definition: CRYHelper.cxx:33
void ProjectToBoxEdge(const double xyz[], const double dxyz[], double xlo, double xhi, double ylo, double yhi, double zlo, double zhi, double xyzout[])
Definition: geo.h:54
Event generator information.
Definition: MCTruth.h:32
Float_t w
Definition: plot.C:20
double fToffset
Shift in time of particles (s)
Definition: CRYHelper.h:59