Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file hadronic/Hadr00/include/EventAction. << 26 // $Id: EventAction.hh,v 1.1 2008/07/07 16:37:26 vnivanch Exp $ 27 /// \brief Definition of the EventAction class << 27 // GEANT4 tag $Name: geant4-09-03-patch-01 $ 28 // << 29 // 28 // 30 ////////////////////////////////////////////// 29 ///////////////////////////////////////////////////////////////////////// 31 // 30 // 32 // EventAction 31 // EventAction 33 // 32 // 34 // Created: 21.06.2008 V.Ivanchenko 33 // Created: 21.06.2008 V.Ivanchenko 35 // 34 // 36 // Modified: 35 // Modified: 37 // 36 // 38 ////////////////////////////////////////////// 37 //////////////////////////////////////////////////////////////////////// 39 // << 38 // 40 39 41 #ifndef EventAction_h 40 #ifndef EventAction_h 42 #define EventAction_h 1 41 #define EventAction_h 1 43 << 42 44 #include "G4UserEventAction.hh" 43 #include "G4UserEventAction.hh" 45 #include "globals.hh" 44 #include "globals.hh" 46 << 47 #include <vector> 45 #include <vector> 48 46 49 //....oooOO0OOooo........oooOO0OOooo........oo 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 50 48 51 class G4Event; 49 class G4Event; 52 class EventActionMessenger; 50 class EventActionMessenger; 53 class G4UImanager; 51 class G4UImanager; 54 52 55 class EventAction : public G4UserEventAction 53 class EventAction : public G4UserEventAction 56 { 54 { 57 public: // Without description << 55 public: // Without description 58 EventAction(); << 59 virtual ~EventAction(); << 60 56 61 virtual void BeginOfEventAction(const G4Ev << 57 EventAction(); 62 virtual void EndOfEventAction(const G4Even << 58 virtual ~EventAction(); 63 59 64 inline void SetPrintModulo(G4int val); << 60 virtual void BeginOfEventAction(const G4Event*); 65 inline void AddEventToDebug(G4int val); << 61 virtual void EndOfEventAction(const G4Event*); 66 62 67 private: << 63 void SetPrintModulo(G4int val) {printModulo = val;}; 68 EventAction& operator=(const EventAction& << 64 void SetDrawFlag(G4String val) {drawFlag = val;}; 69 EventAction(const EventAction&); << 65 void AddEventToDebug(G4int val) {selectedEvents.push_back(val); >> 66 nSelected++;}; 70 67 71 EventActionMessenger* fEventMessenger; << 68 private: 72 G4UImanager* fUI; << 73 std::vector<G4int> fSelectedEvents; << 74 69 75 G4int fPrintModulo; << 70 EventAction & operator=(const EventAction &right); 76 G4int fSelected; << 71 EventAction(const EventAction&); 77 72 78 G4bool fDebugStarted; << 73 EventActionMessenger* eventMessenger; 79 }; << 74 G4UImanager* UI; >> 75 std::vector<G4int> selectedEvents; 80 76 81 //....oooOO0OOooo........oooOO0OOooo........oo << 77 G4int printModulo; >> 78 G4int nSelected; 82 79 83 inline void EventAction::SetPrintModulo(G4int << 80 // drawFlags = all, charged, neutral, charged+n 84 { << 81 G4String drawFlag; 85 fPrintModulo = val; << 82 G4bool debugStarted; 86 } << 87 83 88 //....oooOO0OOooo........oooOO0OOooo........oo << 84 }; 89 85 90 inline void EventAction::AddEventToDebug(G4int << 86 #endif 91 { << 92 fSelectedEvents.push_back(val); << 93 ++fSelected; << 94 } << 95 87 96 //....oooOO0OOooo........oooOO0OOooo........oo << 97 88 98 #endif << 99 89