Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:16:57

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 
0029 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0031 
0032 #include "FCALTBEventAction.hh"
0033 #include "FCALTBEventActionMessenger.hh"
0034 #include "FCALRunAction.hh"
0035 #include "FCALCalorHit.hh"
0036 #include <vector>
0037 
0038 #include "G4Event.hh"
0039 #include "G4EventManager.hh"
0040 #include "G4HCofThisEvent.hh"
0041 #include "G4VHitsCollection.hh"
0042 #include "G4SDManager.hh"
0043 #include "G4UImanager.hh"
0044 #include "G4ios.hh"
0045 #include "G4AnalysisManager.hh"
0046 #include "G4UnitsTable.hh"
0047 #include "Randomize.hh"
0048 #include "FCALSteppingAction.hh"
0049 
0050 
0051 #include "G4ios.hh"
0052 
0053 #include <iostream>
0054 
0055 #include "G4SystemOfUnits.hh"
0056 
0057 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0058 
0059 FCALTBEventAction::FCALTBEventAction(FCALSteppingAction* SA)
0060   :drawFlag("all"),printModulo(10), StepAction(SA), eventMessenger(0)
0061 {
0062   eventMessenger = new FCALTBEventActionMessenger(this);
0063 }
0064 
0065 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0066 
0067 FCALTBEventAction::~FCALTBEventAction()
0068 {
0069   delete eventMessenger;
0070   eventMessenger = 0;
0071 }
0072 
0073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0074 
0075 void FCALTBEventAction::BeginOfEventAction(const G4Event* evt)
0076 {  
0077   G4int evtNb = evt->GetEventID();
0078     if (evtNb%printModulo == 0)
0079     { 
0080       G4cout << "\n---> Begin of event: " << evtNb+1 << G4endl;
0081 //      HepRandom::showEngineStatus();
0082     }
0083     
0084   NTracksOutOfWorld = 0;
0085   NSecondaries = 0;
0086  
0087   StepAction->initialize(evtNb+1);
0088 }
0089 
0090 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0091 
0092 void FCALTBEventAction::EndOfEventAction(const G4Event*)
0093 {
0094   // Fill histograms
0095   G4AnalysisManager* man = G4AnalysisManager::Instance();
0096 
0097   NTracksOutOfWorld = StepAction->GetOutOfWorldTracks(0, 0); 
0098   G4cout << "N Tracks out of world " << NTracksOutOfWorld << G4endl;
0099   
0100   man->FillH1(1,NTracksOutOfWorld);
0101 
0102   NSecondaries = StepAction->GetSecondaries(0,0);
0103   G4cout << "N Secondaries " << NSecondaries << G4endl;   
0104     
0105   man->FillH1(2,NSecondaries);
0106 
0107   G4double EmEdep  = StepAction->GetEdepFCAL("FCALEm");
0108   G4double HadEdep = StepAction->GetEdepFCAL("FCALHad");
0109 
0110 
0111   man->FillH1(3,EmEdep/MeV);
0112   man->FillH1(4,HadEdep/MeV);
0113 
0114 
0115   G4cout<<"EmEdep is="<<EmEdep/MeV << " MeV " << G4endl;
0116   G4cout<<"HadEdep is="<<HadEdep << " MeV" << G4endl;
0117 
0118   G4cout << "Edep in FCAL1 FCAl2 : " << StepAction->GetEdepFCAL("FCALEm") << " ";
0119   G4cout << StepAction->GetEdepFCAL("FCALHad") << G4endl;
0120 }
0121   
0122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0123