Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:17:09

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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0028 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0029 
0030 #include "XrayFluoActionInitializer.hh"
0031 #include "XrayFluoDetectorConstruction.hh"
0032 #include "XrayFluoPlaneDetectorConstruction.hh"
0033 #include "XrayFluoMercuryDetectorConstruction.hh"
0034 #include "XrayFluoPrimaryGeneratorAction.hh"
0035 #include "XrayFluoPlanePrimaryGeneratorAction.hh"
0036 #include "XrayFluoMercuryPrimaryGeneratorAction.hh"
0037 #include "XrayFluoRunAction.hh"
0038 #include "XrayFluoEventAction.hh"
0039 #include "XrayFluoSteppingAction.hh"
0040 #include "XrayFluoSteppingVerbose.hh"
0041 
0042 #include "G4RunManager.hh"
0043 
0044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0045 
0046 XrayFluoActionInitializer::XrayFluoActionInitializer(G4int geometryFlag) : 
0047   G4VUserActionInitialization(),fGeometryFlag(geometryFlag)
0048 {;}
0049 
0050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0051 
0052 void XrayFluoActionInitializer::Build() const 
0053 {
0054   //Actual version will depend on the geometry
0055   XrayFluoEventAction* eventAction = 0;
0056   XrayFluoSteppingAction* stepAction = new XrayFluoSteppingAction();
0057 
0058    //Selecting the PrimaryGenerator depending upon Geometry setup selected
0059   if (fGeometryFlag == 1 || fGeometryFlag == 4) 
0060     {  
0061       const XrayFluoDetectorConstruction* testBeamDetector = 
0062     static_cast<const XrayFluoDetectorConstruction*>
0063     (G4RunManager::GetRunManager()->GetUserDetectorConstruction());  
0064       
0065       eventAction = new XrayFluoEventAction(testBeamDetector);
0066       SetUserAction(new XrayFluoPrimaryGeneratorAction(testBeamDetector));
0067     }
0068   else if (fGeometryFlag == 2) 
0069     {      
0070       const XrayFluoPlaneDetectorConstruction* planeDetector = 
0071     static_cast<const XrayFluoPlaneDetectorConstruction*>
0072     (G4RunManager::GetRunManager()->GetUserDetectorConstruction());  
0073 
0074       eventAction = new XrayFluoEventAction(planeDetector);
0075       SetUserAction(new XrayFluoPlanePrimaryGeneratorAction(planeDetector));
0076     }
0077   else if (fGeometryFlag == 3) 
0078     {      
0079       const XrayFluoMercuryDetectorConstruction* mercuryDetector = 
0080     static_cast<const XrayFluoMercuryDetectorConstruction*>
0081     (G4RunManager::GetRunManager()->GetUserDetectorConstruction());  
0082       eventAction = new XrayFluoEventAction(mercuryDetector);
0083       stepAction->SetMercuryFlag(true);
0084       SetUserAction(new XrayFluoMercuryPrimaryGeneratorAction(mercuryDetector));
0085   }
0086   SetUserAction(eventAction);
0087   SetUserAction(new XrayFluoRunAction());
0088   SetUserAction(stepAction);
0089 
0090 }
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0093 
0094 void XrayFluoActionInitializer::BuildForMaster() const
0095 {
0096   SetUserAction(new XrayFluoRunAction());
0097 }
0098 
0099 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0100 
0101 
0102 G4VSteppingVerbose* XrayFluoActionInitializer::InitializeSteppingVerbose() const
0103 {
0104   //XrayFluo Verbose output class
0105   return new XrayFluoSteppingVerbose();
0106 }