File indexing completed on 2025-01-18 09:58:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4LOCATOR_CHANGE_RECORD_HH
0036 #define G4LOCATOR_CHANGE_RECORD_HH
0037
0038 #include <vector>
0039 #include "G4FieldTrack.hh"
0040
0041 class G4LocatorChangeRecord
0042 {
0043 public:
0044
0045 enum EChangeLocation { kInvalidCL = 0, kUnknownCL = 1,
0046 kInitialisingCL, kIntersectsAF, kIntersectsFB,
0047 kNoIntersectAForFB, kRecalculatedB,
0048 kInsertingMidPoint, kRecalculatedBagn,
0049 kLevelPop };
0050
0051 static const char* fNameChangeLocation[];
0052 static const char* GetNameChangeLocation( EChangeLocation );
0053
0054 G4LocatorChangeRecord( EChangeLocation codeLocation,
0055 G4int iter,
0056 unsigned int count,
0057 const G4FieldTrack& fieldTrack )
0058 : fCodeLocation( codeLocation), fIteration(iter), fEventCount(count),
0059 fFieldTrack( fieldTrack ) {}
0060 G4LocatorChangeRecord( const G4LocatorChangeRecord & ) = default;
0061 G4LocatorChangeRecord( G4LocatorChangeRecord && ) = default;
0062
0063
0064
0065
0066
0067
0068
0069 inline EChangeLocation GetLocation() const { return fCodeLocation; }
0070 inline unsigned int GetCount() const { return fEventCount; }
0071 inline G4int GetIteration() const { return fIteration; }
0072 inline G4double GetLength() const { return fFieldTrack.GetCurveLength(); }
0073
0074 friend std::ostream& operator<< ( std::ostream& os,
0075 const G4LocatorChangeRecord& r );
0076
0077
0078 friend std::ostream& operator<< ( std::ostream& os,
0079 const std::vector<G4LocatorChangeRecord> & vecR );
0080
0081 std::ostream& StreamInfo(std::ostream& os) const;
0082
0083 static std::ostream& ReportVector ( std::ostream& os,
0084 const std::string & nameOfRecord,
0085 const std::vector<G4LocatorChangeRecord> & lcr );
0086
0087 static std::ostream& ReportEndChanges ( std::ostream& os,
0088 const std::vector<G4LocatorChangeRecord> & startA,
0089 const std::vector<G4LocatorChangeRecord> & endB );
0090
0091 private:
0092
0093 EChangeLocation fCodeLocation = kInvalidCL;
0094 G4int fIteration = -1;
0095 unsigned int fEventCount = 0;
0096 G4FieldTrack fFieldTrack;
0097 };
0098
0099 #endif