/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/stable/src/util/include/RAT/TransitTimeCalculator.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/stable/src/util/include/RAT/TransitTimeCalculator.hh Source File
Ratpac-two
TransitTimeCalculator.hh
1 #ifndef __RAT_TRANSITTIMECALCULATOR_HH__
2 #define __RAT_TRANSITTIMECALCULATOR_HH__
3 
4 #include <TVector3.h>
5 
6 #include <G4VPhysicalVolume.hh>
7 #include <RAT/GroupVelocityCalculator.hh>
8 #include <RAT/LightPathCalculator.hh>
9 #include <string>
10 #include <vector>
11 
12 namespace RAT {
13 
15  public:
16  struct Segment {
17  double velocity;
18  std::string materialName;
19  TVector3 startPos;
20  TVector3 endPos;
21  };
22 
23  struct Result {
24  double totalTime = 0.;
25  double totalLength = 0.;
26  std::vector<Segment> segments;
27  };
28 
29  explicit TransitTimeCalculator(const std::string& pathCalcId = "g4", const std::string& velocityCalcId = "rindex",
30  G4VPhysicalVolume* worldVolume = nullptr, double defaultRindex = 1.0);
31 
33 
34  // No copying or moving (owns opaque sub-calculators).
36  TransitTimeCalculator& operator=(const TransitTimeCalculator&) = delete;
38  TransitTimeCalculator& operator=(TransitTimeCalculator&&) = delete;
39 
40  // Walk the straight line from start to end and return the transit time breakdown.
41  // wavelength_nm is the photon wavelength in nanometres.
42  // If full_output is true the per-segment breakdown is populated with material
43  // name, start/end positions, length, and velocity.
44  Result Compute(const TVector3& start, const TVector3& end, double wavelength_nm = 400,
45  bool full_output = false) const;
46 
47  void SetVerbose(bool v) { fVerbose = v; }
48  void SetDefaultRindex(double n);
49 
50  private:
51  std::unique_ptr<LightPathCalculator> fPathCalc;
52  std::unique_ptr<GroupVelocityCalculator> fVelocityCalc;
53  bool fVerbose = false;
54 };
55 
56 } // namespace RAT
57 
58 #endif
Definition: TransitTimeCalculator.hh:14
Definition: CCCrossSecMessenger.hh:29
Definition: TransitTimeCalculator.hh:23
Definition: TransitTimeCalculator.hh:16