Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:41

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 //
0027 // --------------------------------------------------------------
0028 //   GEANT 4 - Underground Dark Matter Detector Advanced Example
0029 //
0030 //      For information related to this code contact: Alex Howard
0031 //      e-mail: alexander.howard@cern.ch
0032 // --------------------------------------------------------------
0033 // Comments
0034 //
0035 //                  Underground Advanced
0036 //               by A. Howard and H. Araujo 
0037 //                    (27th November 2001)
0038 //
0039 // EventAction header
0040 // --------------------------------------------------------------
0041 
0042 #ifndef DMXEventAction_h
0043 #define DMXEventAction_h 1
0044 
0045 #include "G4UserEventAction.hh"
0046 #include "globals.hh"
0047 #include "G4ios.hh"
0048 
0049 #include "DMXScintHit.hh"
0050 #include "DMXPmtHit.hh"
0051 
0052 class DMXRunAction;
0053 class DMXPrimaryGeneratorAction;
0054 class DMXEventActionMessenger;
0055 class DMXAnalysisManager;
0056 
0057 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0058 class DMXEventAction : public G4UserEventAction {
0059 
0060   public:
0061     DMXEventAction();
0062     virtual ~DMXEventAction();
0063     virtual void BeginOfEventAction(const G4Event*);
0064     virtual void EndOfEventAction(const G4Event*);
0065 
0066   private:
0067     void writeScintHitsToFile();
0068     void writePmtHitsToFile(const DMXPmtHitsCollection*);
0069     void drawTracks(const G4Event*);
0070 
0071   public:
0072     void SetDrawTrksFlag (G4String val)     {drawTrksFlag    = val;};
0073     G4String GetDrawTrksFlag() const         {return drawTrksFlag;};
0074 
0075     void SetDrawColsFlag (G4String val)     {drawColsFlag    = val;};
0076     G4String GetDrawColsFlag() const  {return drawColsFlag;};
0077 
0078     void SetDrawHitsFlag (G4int val)        {drawHitsFlag    = val;};
0079     void SetSavePmtFlag  (G4int val)        {savePmtFlag     = val;};
0080     void SetSaveHitsFlag (G4int val)        {saveHitsFlag    = val;};
0081     void SetPrintModulo  (G4int val)        {printModulo     = val;};
0082 
0083   private:
0084     G4int event_id;
0085 
0086     const long* seeds;
0087     G4double energy_pri;
0088 
0089     // hits collections
0090     G4int scintillatorCollID;                
0091     G4int pmtCollID;
0092     G4int S_hits;
0093     G4int P_hits;
0094 
0095     // event summary
0096     G4double aveTimePmtHits;
0097     G4double totEnergy;
0098     G4double totEnergyGammas;
0099     G4double totEnergyNeutrons;
0100     G4double hitEnergy;
0101     G4double firstLXeHitTime;
0102     G4double firstParticleE;
0103     G4double particleEnergy;
0104     G4String particleName;
0105     G4String firstParticleName;
0106 
0107     G4bool gamma_ev;
0108     G4bool neutron_ev;
0109     G4bool positron_ev;
0110     G4bool electron_ev;
0111     G4bool proton_ev;
0112     G4bool other_ev;
0113     G4bool start_gamma;
0114     G4bool start_neutron;
0115 
0116     // messenger
0117     G4String drawTrksFlag;
0118     G4String drawColsFlag;
0119     G4int drawHitsFlag;         
0120     G4int savePmtFlag;         
0121     G4int saveHitsFlag;         
0122     G4int printModulo;                         
0123     DMXEventActionMessenger*  eventMessenger;
0124 
0125     const DMXRunAction*    runAct;  //pointer to run action
0126     const DMXPrimaryGeneratorAction* genAction; // pointer to particle generator
0127   std::ofstream *hitsfile;
0128   std::ofstream *pmtfile;
0129 };
0130 
0131 #endif
0132