ParticleInjectorNEU/ParticleInjector.h
Go to the documentation of this file.
1 #ifndef _ParticleInjectorNEU_ParticleInjector_h_
2 #define _ParticleInjectorNEU_ParticleInjector_h_
3 
4 #include <string>
5 #include <vector>
6 
7 #include <fwk/VModule.h>
8 
9 #include <utl/Particle.h>
10 #include <utl/TimeStamp.h>
11 
12 
13 namespace evt {
14  class Event;
15 }
16 
17 namespace sevt {
18  class Station;
19 }
20 
21 namespace utl {
22  class Branch;
23  class RandomEngine;
24  class VRandomSampler;
25 }
26 
27 
28 namespace ParticleInjectorNEU {
29 
40  class ParticleInjector : public fwk::VModule {
41 
42  public:
44  virtual ~ParticleInjector() { }
45 
49 
50  static const double fgFarAway2;
51 
52  private:
53  enum PositionFlag {
59  };
60 
61  struct RandomPart {
62  int fSecondaryId = 0;
63  double fPx = 0;
64  double fPy = 0;
65  double fPz = 0;
66  };
67 
70 
71  void InjectParticles(sevt::Station& station);
72 
73  double GenerateAzimuth();
74  double GenerateZenith();
75  double GenerateEnergy(const utl::Particle::Type particle, const int i);
76  double GenerateTime();
77 
78  void GeneratePosition(double& x, double& y, double& z);
79 
80  // switches
82  bool fUseSingleTank = false;
83 
84  bool fCreateEvent = false;
85  unsigned int fSingleTankID = 0;
86 
87  double fX = 0;
88  double fY = 0;
89  double fZ = 0;
90 
91  std::vector<double> fDiscreteAzimuth;
92  std::vector<double> fDiscreteZenith;
93  std::vector<double> fDiscreteParticleTime;
94 
95  std::vector<double> fFixedEnergy;
96 
99  std::string fContinuousTimeString;
100 
104 
107 
108  std::vector<utl::Particle::Type> fParticles;
109 
111 
113 
114  double fRadius = 5*utl::meter;
115  double fHeight = 1.5*utl::meter;
120 
121  std::string fPropagate = "no";
122 
123  // tree and structure for the particles backgound
124  // file from Xavier transformed in a TTree file
125 
126  TChain* fRandomTree = nullptr;
128  bool fRandomEntries = false;
129  unsigned int fNumberOfEntries = 0;
130  unsigned int fMinMomentum = 0;
131 
132  REGISTER_MODULE("ParticleInjectorNEU", ParticleInjector);
133 
134  };
135 
136 }
137 
138 
139 #endif
REGISTER_MODULE("ParticleInjectorNEU", ParticleInjector)
fwk::VModule::ResultFlag Run(evt::Event &theEvent)
Run: invoked once per event.
Type
Particle types.
Definition: Particle.h:48
Module to inject particles into a tank.
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
void GeneratePosition(double &x, double &y, double &z)
Class representing a document branch.
Definition: Branch.h:107
class to hold data at Station level
utl::VRandomSampler * LoadRandomSampler(const utl::Branch &branch)
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
constexpr double meter
Definition: AugerUnits.h:81
Module interface.
Definition: VModule.h:53
double GenerateEnergy(const utl::Particle::Type particle, const int i)
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
struct particle_info particle[80]
CLHEP::HepRandomEngine RandomEngineType
Definition: RandomEngine.h:30
utl::RandomEngine::RandomEngineType & fRandomEngine
Class to shoot random numbers given by a user-defined distribution function.
Definition: XbArray.h:7

, generated on Tue Sep 26 2023.