Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/hadrontherapy/include/HadrontherapyEventAction.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Hadrontherapy advanced example for Geant4
0027 // See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
0028 
0029 #ifndef HadrontherapyEventAction_h
0030 #define HadrontherapyEventAction_h 1
0031 
0032 #include "G4UserEventAction.hh"
0033 #include "globals.hh"
0034 
0035 class HadrontherapyMatrix;
0036 class HadrontherapyEventActionMessenger;
0037 
0038 class HadrontherapyEventAction : public G4UserEventAction
0039 {
0040 public:
0041   HadrontherapyEventAction();
0042   ~HadrontherapyEventAction();
0043 
0044 public:
0045   void BeginOfEventAction(const G4Event*);
0046   void EndOfEventAction(const G4Event*);
0047 
0048   void SetPrintModulo(G4int val)
0049   {
0050     printModulo = val;
0051   };
0052 
0053   void SetDrawFlag(G4String val)
0054   {
0055     drawFlag = val;
0056   };
0057 
0058 private: 
0059   G4String drawFlag; //Visualisation flag
0060   G4int hitsCollectionID;
0061   //HadrontherapyMatrix *matrix; 
0062   G4int printModulo;  
0063   HadrontherapyEventActionMessenger* pointerEventMessenger;
0064 };
0065 
0066 class B4aEventAction : public G4UserEventAction
0067 {
0068 public:
0069     B4aEventAction();
0070     virtual ~B4aEventAction();
0071     
0072     virtual void  BeginOfEventAction(const G4Event* event);
0073     virtual void    EndOfEventAction(const G4Event* event);
0074     
0075     void AddAbs(G4double de, G4double dl);
0076     void AddGap(G4double de, G4double dl);
0077     
0078 private:
0079     G4double  fEnergyAbs;
0080     G4double  fEnergyGap;
0081     G4double  fTrackLAbs;
0082     G4double  fTrackLGap;
0083 };
0084 
0085 // inline functions
0086 
0087 inline void B4aEventAction::AddAbs(G4double de, G4double dl) {
0088     fEnergyAbs += de;
0089     fTrackLAbs += dl;
0090 }
0091 
0092 inline void B4aEventAction::AddGap(G4double de, G4double dl) {
0093     fEnergyGap += de;
0094     fTrackLGap += dl;
0095 }
0096 
0097 
0098 #endif
0099 
0100 
0101