File indexing completed on 2025-01-31 09:21:49
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
0036
0037
0038
0039
0040
0041
0042
0043
0044 #ifndef CEXMC_EVENT_ACTION_HH
0045 #define CEXMC_EVENT_ACTION_HH
0046
0047 #include <G4UserEventAction.hh>
0048 #include "CexmcAngularRange.hh"
0049
0050 class G4Event;
0051 class CexmcPhysicsManager;
0052 class CexmcEnergyDepositDigitizer;
0053 struct CexmcEnergyDepositStore;
0054 class CexmcTrackPointsDigitizer;
0055 struct CexmcTrackPointsStore;
0056 class CexmcEventActionMessenger;
0057 struct CexmcProductionModelData;
0058 class CexmcChargeExchangeReconstructor;
0059
0060
0061 class CexmcEventAction : public G4UserEventAction
0062 {
0063 public:
0064 explicit CexmcEventAction( CexmcPhysicsManager * physicsManager,
0065 G4int verbose = 0 );
0066
0067 virtual ~CexmcEventAction();
0068
0069 public:
0070 void BeginOfEventAction( const G4Event * event );
0071
0072 void EndOfEventAction( const G4Event * event );
0073
0074 public:
0075 void BeamParticleChangeHook( void );
0076
0077 void SetVerboseOnCexmcLevel( G4int value );
0078
0079 void SetVerboseDrawLevel( G4int value );
0080
0081 CexmcChargeExchangeReconstructor * GetReconstructor( void );
0082
0083 private:
0084 void PrintReconstructedData(
0085 const CexmcAngularRangeList & angularRanges,
0086 const CexmcAngularRange & angularGap ) const;
0087
0088 #ifdef CEXMC_USE_ROOT
0089 void FillEDTHistos( const CexmcEnergyDepositStore * edStore,
0090 const CexmcAngularRangeList & triggeredAngularRanges ) const;
0091
0092 void FillTPTHistos( const CexmcTrackPointsStore * tpStore,
0093 const CexmcProductionModelData & pmData,
0094 const CexmcAngularRangeList & triggeredAngularRanges ) const;
0095
0096 void FillRTHistos( G4bool reconstructorHasFullTrigger,
0097 const CexmcEnergyDepositStore * edStore,
0098 const CexmcTrackPointsStore * tpStore,
0099 const CexmcProductionModelData & pmData,
0100 const CexmcAngularRangeList & triggeredAngularRanges ) const;
0101 #endif
0102
0103 void DrawTrajectories( const G4Event * event );
0104
0105 void DrawTrackPoints( const CexmcTrackPointsStore * tpStore ) const;
0106
0107 void DrawReconstructionData( void );
0108
0109 void UpdateRunHits( const CexmcAngularRangeList & aRangesReal,
0110 const CexmcAngularRangeList & aRangesRec,
0111 G4bool tpDigitizerHasTriggered,
0112 G4bool edDigitizerHasTriggered,
0113 G4bool edDigitizerMonitorHasTriggered,
0114 G4bool reconstructorHasTriggered,
0115 const CexmcAngularRange & aGap );
0116
0117 #ifdef CEXMC_USE_PERSISTENCY
0118 void SaveEvent( const G4Event * event,
0119 G4bool edDigitizerMonitorHasTriggered,
0120 const CexmcEnergyDepositStore * edStore,
0121 const CexmcTrackPointsStore * tpStore,
0122 const CexmcProductionModelData & pmData );
0123
0124 void SaveEventFast( const G4Event * event,
0125 G4bool tpDigitizerHasTriggered,
0126 G4bool edDigitizerHasTriggered,
0127 G4bool edDigitizerMonitorHasTriggered,
0128 G4double opCosThetaSCM );
0129 #endif
0130
0131 public:
0132 static CexmcEnergyDepositStore * MakeEnergyDepositStore(
0133 const CexmcEnergyDepositDigitizer * digitizer );
0134
0135 static CexmcTrackPointsStore * MakeTrackPointsStore(
0136 const CexmcTrackPointsDigitizer * digitizer );
0137
0138 static void PrintEnergyDeposit(
0139 const CexmcEnergyDepositStore * edStore );
0140
0141 static void PrintTrackPoints(
0142 const CexmcTrackPointsStore * tpStore );
0143
0144 static void PrintProductionModelData(
0145 const CexmcAngularRangeList & angularRanges,
0146 const CexmcProductionModelData & pmData );
0147
0148 private:
0149 CexmcPhysicsManager * physicsManager;
0150
0151 CexmcChargeExchangeReconstructor * reconstructor;
0152
0153 #ifdef CEXMC_USE_ROOT
0154 G4double opKinEnergy;
0155 #endif
0156
0157 private:
0158 G4int verbose;
0159
0160 G4int verboseDraw;
0161
0162 CexmcEventActionMessenger * messenger;
0163 };
0164
0165
0166 inline void CexmcEventAction::SetVerboseOnCexmcLevel( G4int value )
0167 {
0168 verbose = value;
0169 }
0170
0171
0172 inline void CexmcEventAction::SetVerboseDrawLevel( G4int value )
0173 {
0174 verboseDraw = value;
0175 }
0176
0177
0178 inline CexmcChargeExchangeReconstructor *
0179 CexmcEventAction::GetReconstructor( void )
0180 {
0181 return reconstructor;
0182 }
0183
0184
0185 #endif
0186