Geant4 examples
basic/B4/B4d/include/B4dEventAction.hh
Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00030 
00031 #ifndef B4dEventAction_h
00032 #define B4dEventAction_h 1
00033 
00034 #include "G4UserEventAction.hh"
00035 
00036 #include "B4dEventActionMessenger.hh"
00037 
00038 #include "G4THitsMap.hh"
00039 #include "globals.hh"
00040 
00050 
00051 class B4dEventAction : public G4UserEventAction
00052 {
00053 public:
00054   B4dEventAction();
00055   virtual ~B4dEventAction();
00056 
00057   virtual void  BeginOfEventAction(const G4Event* event);
00058   virtual void    EndOfEventAction(const G4Event* event);
00059                      
00060   // set methods
00061   void SetPrintModulo(G4int value);
00062     
00063 private:
00064   // methods
00065   G4THitsMap<G4double>* GetHitsCollection(const G4String& hcName,
00066                                           const G4Event* event) const;
00067   G4double GetSum(G4THitsMap<G4double>* hitsMap) const;
00068   void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength,
00069                             G4double gapEdep, G4double gapTrackLength) const;
00070   
00071   // data members                   
00072   B4dEventActionMessenger  fMessenger;
00073   G4int  fPrintModulo;
00074 };
00075 
00076 // inline functions
00077 
00078 inline void B4dEventAction::SetPrintModulo(G4int value) {
00079   fPrintModulo = value;
00080 }
00081                      
00082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00083 
00084 #endif
00085 
00086     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines