Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/xray_telescope/src/XrayTelSteppingAction.cc 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 //
0027 // **********************************************************************
0028 // *                                                                    *
0029 // *                    GEANT 4 xray_telescope advanced example         *
0030 // *                                                                    *
0031 // * MODULE:            XrayTelSteppingAction.cc                        *
0032 // * -------                                                            *
0033 // *                                                                    *
0034 // * Version:           0.4                                             *
0035 // * Date:              06/11/00                                        *
0036 // * Author:            R Nartallo                                      *
0037 // * Organisation:      ESA/ESTEC, Noordwijk, THe Netherlands           *
0038 // *                                                                    *
0039 // **********************************************************************
0040 // 
0041 // CHANGE HISTORY
0042 // --------------
0043 //
0044 // 05.12.2001 R. Nartallo
0045 // - Return condition for entering detector (cf LowEnTest)
0046 // - Remove line to kill track if too many steps
0047 //
0048 // 07.11.2001 M.G. Pia
0049 // - Modified the analysis management
0050 // - Small design iteration
0051 //
0052 // 30.11.2000 R. Nartallo
0053 // - Add pre-processor directives to compile without analysis option
0054 //
0055 // 16.11.2000 A. Pfeiffer
0056 // - Implementation of analysis manager call
0057 //
0058 // 06.11.2000 R.Nartallo
0059 // - First implementation of xray_telescope Physics list
0060 // - Based on Chandra and XMM models
0061 // 
0062 // **********************************************************************
0063 
0064 #include "XrayTelSteppingAction.hh"
0065 #include "globals.hh"
0066 #include "G4Track.hh"
0067 #include "G4Step.hh"
0068 #include "G4Threading.hh"
0069 
0070 #include "XrayTelAnalysis.hh"
0071 
0072 XrayTelSteppingAction::XrayTelSteppingAction() 
0073 {;}
0074 
0075 
0076 XrayTelSteppingAction::~XrayTelSteppingAction()
0077 { }
0078 
0079 
0080 void XrayTelSteppingAction::UserSteppingAction(const G4Step* step)
0081 {
0082   G4bool entering = false;
0083   G4Track* track = step->GetTrack();
0084 
0085   G4String volName; 
0086   if (track->GetVolume()) volName =  track->GetVolume()->GetName(); 
0087   G4String nextVolName;
0088   if (track->GetNextVolume()) nextVolName =  track->GetNextVolume()->GetName();
0089 
0090   XrayTelAnalysis* analysis = XrayTelAnalysis::getInstance();
0091  
0092   // Entering Detector
0093   if (volName != "Detector_P" && nextVolName == "Detector_P") 
0094     {
0095       entering = true;
0096       analysis->Update(track->GetKineticEnergy(),G4Threading::G4GetThreadId());
0097     }
0098 
0099   // Do the analysis related to this step
0100  
0101   analysis->analyseStepping(*track,entering);
0102 
0103 }
0104 
0105 
0106 
0107