@@ -59,7 +59,8 @@ WCSimEventAction::WCSimEventAction(WCSimRunAction* myRun,
59
59
WCSimPrimaryGeneratorAction* myGenerator)
60
60
:runAction(myRun), generatorAction(myGenerator),
61
61
detectorConstructor(myDetector),
62
- ConstructedDAQClasses(false )
62
+ ConstructedDAQClasses(false ),
63
+ SavedDAQOptions(false )
63
64
{
64
65
DAQMessenger = new WCSimWCDAQMessenger (this );
65
66
@@ -120,8 +121,13 @@ void WCSimEventAction::CreateDAQInstances()
120
121
121
122
void WCSimEventAction::BeginOfEventAction (const G4Event*)
122
123
{
123
- if (!ConstructedDAQClasses)
124
+ if (!ConstructedDAQClasses) {
124
125
CreateDAQInstances ();
126
+
127
+ // and save options in output file
128
+ G4DigiManager* DMman = G4DigiManager::GetDMpointer ();
129
+
130
+ }
125
131
}
126
132
127
133
void WCSimEventAction::EndOfEventAction (const G4Event* evt)
@@ -393,6 +399,15 @@ void WCSimEventAction::EndOfEventAction(const G4Event* evt)
393
399
WCDC_hits,
394
400
WCDC);
395
401
402
+ // save DAQ options here. This ensures that when the user selects a default option
403
+ // (e.g. with -99), the saved option value in the output reflects what was run
404
+ if (!SavedDAQOptions) {
405
+ WCSimRootOptions * wcsimopt = runAction->GetRootOptions ();
406
+ // Dark noise
407
+ WCDNM->SaveOptionsToOutput (wcsimopt);
408
+
409
+ SavedDAQOptions = true ;
410
+ }
396
411
}
397
412
398
413
G4int WCSimEventAction::WCSimEventFindStartingVolume (G4ThreeVector vtx)
0 commit comments