source: trunk/examples/advanced/raredecay_calorimetry/src/PhotInRunAction.cc @ 1309

Last change on this file since 1309 was 807, checked in by garnier, 16 years ago

update

File size: 5.1 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: PhotInRunAction.cc,v 1.5 2006/06/29 16:25:25 gunter Exp $
28// GEANT4 tag $Name:  $
29//
30
31//#define debug
32
33#include "PhotInRunAction.hh"
34
35PhotInRunAction::PhotInRunAction() {}
36
37PhotInRunAction::~PhotInRunAction() {}
38
39G4Run* PhotInRunAction::GenerateRun() 
40{
41#ifdef debug
42  G4cout<<"PhotInRunAction::GenerateRun: New Run is created"<<G4endl;
43#endif
44  return new PhotInRun; // @@ Who deletes it? (M.K.) What about previous Runs?
45}
46
47void PhotInRunAction::EndOfRunAction(const G4Run* aRun)
48{
49#ifdef debug
50  G4cout<<"PhotInRunAction::EndOfRunAction is called"<<G4endl;
51#endif
52  const PhotInRun* theRun = (const PhotInRun*) aRun; // change the type
53  // @@ Writing without any conditions (? M.K.)
54  G4cout<<"##############################################################"<< G4endl;
55  G4cout<<" Run Summary - Number of events : "<<theRun->GetNumberOfEvent()<<G4endl;
56  G4cout<<"##############################################################"<< G4endl;
57  G4double nEvt = (G4double)(theRun->GetNumberOfEvent());
58  for(G4int i=0; i<PhotInNumSections; i++)
59  {
60    G4int ih1 = i+i;
61    G4int ih2 = ih1+1;
62    G4Region* region = G4RegionStore::GetInstance()->GetRegion(PhotInRegName[i]);
63    G4ProductionCuts* cuts = region->GetProductionCuts();
64    G4cout<<"Region "<<region->GetName()<<G4endl;
65    G4cout<<"===================="<<G4endl;
66    G4cout<<" Production thresholds :"<<G4endl;
67    G4cout<<" -----------------------"<<G4endl;
68    G4cout<<" gamma " <<G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
69          <<"    e- " <<G4BestUnit(cuts->GetProductionCut("e-"),"Length")
70          <<"    e+ " <<G4BestUnit(cuts->GetProductionCut("e+"),"Length")<<G4endl;
71    G4cout<<" Energy deposition in Absorber "
72          <<G4BestUnit((theRun->GetTotalE(ih1))/nEvt,"Energy")<<", in Gap "
73          <<G4BestUnit((theRun->GetTotalE(ih2))/nEvt,"Energy")<<G4endl;
74    G4cout<<" Number of secondaries in the event :"<<G4endl;
75    G4cout<<" ------------------------------------"<<G4endl;
76    G4cout<<" gamma in Absorber " << (theRun->GetNGamma(ih1))/nEvt
77          <<", in Gap      " << (theRun->GetNGamma(ih2))/nEvt<<G4endl;
78    G4cout<<" e-    in Absorber " << (theRun->GetNElectron(ih1))/nEvt
79          <<", in Gap " << (theRun->GetNElectron(ih2))/nEvt<<G4endl;
80    G4cout<<" e+    in Absorber " << (theRun->GetNPositron(ih1))/nEvt
81          <<", in Gap " << (theRun->GetNPositron(ih2))/nEvt<<G4endl;
82    G4cout<<" Minimum kinetic energy of generated secondaries :"<<G4endl;
83    G4cout<<" -------------------------------------------------"<<G4endl;
84    G4cout<<" gamma in Absorber = "<<G4BestUnit(theRun->GetEMinGamma(ih1),"Energy")
85          <<", in Gap = "<<G4BestUnit(theRun->GetEMinGamma(ih2),"Energy")<<G4endl;
86    G4cout<<" e-    in Absorber = "<<G4BestUnit(theRun->GetEMinElectron(ih1),"Energy")
87          <<", in Gap = " << G4BestUnit(theRun->GetEMinElectron(ih2),"Energy")<<G4endl;
88    G4cout<<" e+    in Absorber = " << G4BestUnit(theRun->GetEMinPositron(ih1),"Energy")
89          <<"    in Gap = " << G4BestUnit(theRun->GetEMinPositron(ih2),"Energy")<<G4endl;
90    G4cout<<" Mean total track length of neutrons in the event : in Absorber = "
91          <<G4BestUnit((theRun->GetTotalL(ih1))/nEvt,"Length")<<", in Gap = "
92          <<G4BestUnit((theRun->GetTotalL(ih2))/nEvt,"Length")<<G4endl;
93    G4cout<<" Mean number of steps of charged particles in the event : in Absorber ="
94          <<theRun->GetNStep(ih1)/nEvt<<", in Gap = "<<theRun->GetNStep(ih2)/nEvt<<G4endl;
95    G4cout<<"##############################################################"<<G4endl;
96  }
97}
98
Note: See TracBrowser for help on using the repository browser.