All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
evgen::ldm::IMeVPrtlFlux Class Referenceabstract

IMeVPrtlFlux interface class definiton. More...

#include <IMeVPrtlFlux.h>

Inheritance diagram for evgen::ldm::IMeVPrtlFlux:
evgen::ldm::IMeVPrtlStage evgen::ldm::Kaon2HiggsFlux evgen::ldm::Kaon2HNLFlux evgen::ldm::MonoEnergyHiggsFlux

Public Member Functions

virtual ~IMeVPrtlFlux () noexcept=default
 Virtual Destructor. More...
 
virtual bool MakeFlux (const simb::MCFlux &mcflux, MeVPrtlFlux &flux, double &weight)=0
 
 IMeVPrtlFlux (const fhicl::ParameterSet &pset)
 
- Public Member Functions inherited from evgen::ldm::IMeVPrtlStage
virtual ~IMeVPrtlStage () noexcept
 Virtual Destructor. More...
 
 IMeVPrtlStage (const char *name)
 
virtual void configure (const fhicl::ParameterSet &)=0
 Interface for configuring the particular algorithm tool. More...
 
virtual double MaxWeight ()=0
 
TVector3 RandomUnitVector ()
 
double GetRandom ()
 
const char * Name ()
 

Protected Member Functions

TLorentzVector BeamOrigin ()
 
double EnuLab (double enucm, TLorentzVector meson_mom, TLorentzVector meson_pos)
 

Protected Attributes

evgb::EvtTimeShiftI * fTimeShiftMethod
 
TRotation fBeam2Det
 
TVector3 fBeamOrigin
 
std::string fSpillTimeConfig
 
- Protected Attributes inherited from evgen::ldm::IMeVPrtlStage
CLHEP::HepRandomEngine * fEngine
 
const char * fName
 

Detailed Description

IMeVPrtlFlux interface class definiton.

Definition at line 39 of file IMeVPrtlFlux.h.

Constructor & Destructor Documentation

virtual evgen::ldm::IMeVPrtlFlux::~IMeVPrtlFlux ( )
virtualdefaultnoexcept

Virtual Destructor.

evgen::ldm::IMeVPrtlFlux::IMeVPrtlFlux ( const fhicl::ParameterSet &  pset)
inline

Definition at line 49 of file IMeVPrtlFlux.h.

50  {
51  // rotation matrix
52  std::vector<double> rotation = pset.get<std::vector<double>>("Beam2DetectorRotation");
53  assert(rotation.size() == 9);
54  // get the three axes
55  TVector3 beam2DetX(rotation[0], rotation[3], rotation[6]);
56  TVector3 beam2DetY(rotation[1], rotation[4], rotation[7]);
57  TVector3 beam2DetZ(rotation[2], rotation[5], rotation[8]);
58 
59  fBeam2Det.RotateAxes(beam2DetX, beam2DetY, beam2DetZ);
60 
61  // beam origin
62  std::vector<double> origin = pset.get<std::vector<double>>("BeamOrigin");
63  assert(origin.size() == 3 || origin.size() == 6);
64  // beam origin specified in detector rotation-frame
65  if (origin.size() == 3) {
66  fBeamOrigin.SetXYZ(origin[0], origin[1], origin[2]);
67  }
68  // beam origin specified in beam rotation-frame
69  else if (origin.size() == 6) {
70  TVector3 userpos = TVector3(origin[0], origin[1], origin[2]);
71  TVector3 beampos = TVector3(origin[3], origin[4], origin[5]);
72  fBeamOrigin = userpos - fBeam2Det * beampos;
73  }
74 
75  // get random seed for stuff
76  unsigned seed = art::ServiceHandle<rndm::NuRandomService>()->getSeed();
77 
78  // use the time-shifting tools from GENIE
79  fTimeShiftMethod = NULL;
80  if (fSpillTimeConfig != "") {
81  fTimeShiftMethod = evgb::EvtTimeShiftFactory::Instance().GetEvtTimeShift(fSpillTimeConfig);
82  if ( fTimeShiftMethod ) {
83  if ( ! fTimeShiftMethod->IsRandomGeneratorSeeded() ) {
84  fTimeShiftMethod->GetRandomGenerator()->SetSeed(seed);
85  }
86  fTimeShiftMethod->PrintConfig();
87  }
88  else {
89  evgb::EvtTimeShiftFactory::Instance().Print();
90  }
91  }
92  if (fTimeShiftMethod) {
93  std::cout << "Timing Config:\n";
94  fTimeShiftMethod->PrintConfig();
95  std::cout << std::endl;
96  }
97  std::cout << "Neutrino TIF: " << (fBeamOrigin.Mag()/Constants::Instance().c_cm_per_ns) << std::endl;
98  }
std::string fSpillTimeConfig
Definition: IMeVPrtlFlux.h:105
unsigned int seed
static const Constants & Instance()
Definition: Constants.h:68
evgb::EvtTimeShiftI * fTimeShiftMethod
Definition: IMeVPrtlFlux.h:102
BEGIN_PROLOG could also be cout
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227

Member Function Documentation

TLorentzVector evgen::ldm::IMeVPrtlFlux::BeamOrigin ( )
inlineprotected

Definition at line 107 of file IMeVPrtlFlux.h.

107  {
108  double toff = fTimeShiftMethod ? fTimeShiftMethod->TimeOffset() : 0.;
109 
110  // TODO: what to do here? For now -- don't shift time at all
111  //
112  // subtract out the delay of neutrinos reaching the beam
113  // double neutrino_tif = fBeamOrigin.Mag()/Constants::Instance().c_cm_per_ns;
114  // toff -= neutrino_tif;
115  return TLorentzVector(fBeamOrigin, toff);
116  }
evgb::EvtTimeShiftI * fTimeShiftMethod
Definition: IMeVPrtlFlux.h:102
double evgen::ldm::IMeVPrtlFlux::EnuLab ( double  enucm,
TLorentzVector  meson_mom,
TLorentzVector  meson_pos 
)
inlineprotected

Definition at line 119 of file IMeVPrtlFlux.h.

119  { // all in detector coordinates
120  // Assume neutrino travels to center of detector
121  double costh = meson_mom.Vect().Unit().Dot(-meson_pos.Vect().Unit());
122 
123  // Scale factor
124  double M = 1. / (meson_mom.Gamma() * (1 - meson_mom.Beta() * costh));
125 
126  return M * enucm;
127  }
virtual bool evgen::ldm::IMeVPrtlFlux::MakeFlux ( const simb::MCFlux &  mcflux,
MeVPrtlFlux flux,
double &  weight 
)
pure virtual

Member Data Documentation

TRotation evgen::ldm::IMeVPrtlFlux::fBeam2Det
protected

Definition at line 103 of file IMeVPrtlFlux.h.

TVector3 evgen::ldm::IMeVPrtlFlux::fBeamOrigin
protected

Definition at line 104 of file IMeVPrtlFlux.h.

std::string evgen::ldm::IMeVPrtlFlux::fSpillTimeConfig
protected

Definition at line 105 of file IMeVPrtlFlux.h.

evgb::EvtTimeShiftI* evgen::ldm::IMeVPrtlFlux::fTimeShiftMethod
protected

Definition at line 102 of file IMeVPrtlFlux.h.


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