Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
WLSEventAction.cc
이 파일의 문서화 페이지로 가기
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 // $Id: WLSEventAction.cc 90240 2015-05-21 09:08:13Z gcosmo $
27 //
30 //
31 //
32 #include "WLSEventAction.hh"
33 
34 #include "WLSRunAction.hh"
35 
37 
38 #include "WLSPhotonDetHit.hh"
39 
40 #include "G4Event.hh"
41 #include "G4EventManager.hh"
42 #include "WLSTrajectory.hh"
43 #include "G4TrajectoryContainer.hh"
44 #include "G4VVisManager.hh"
45 #include "G4SDManager.hh"
46 
47 #include "Randomize.hh"
48 
49 // Purpose: Accumulates statistics regarding hits
50 // in the PhotonDet detector
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55  : fRunAction(runaction), fVerboseLevel(0)
56 {
57  fMPPCCollID = 0;
58 
60 }
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63 
65 {
66  delete fEventMessenger;
67 }
68 
69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70 
72 {
73  G4int evtNb = evt->GetEventID();
74 
75  if(fVerboseLevel>0)
76  G4cout << "<<< Event " << evtNb << " started." << G4endl;
77 }
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
81 #include "G4Threading.hh"
82 
84 {
85  if (fVerboseLevel>0)
86  G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
87 
88  if (fRunAction->GetRndmFreq() == 2)
89  {
90  std::ostringstream os;
91  os<<"endOfEvent_"<<G4Threading::G4GetThreadId()<<".rndm";
92  G4Random::saveEngineStatus(os.str().c_str());
93  }
94 
95  // Get Hits from the detector if any
97  G4String colName = "PhotonDetHitCollection";
98  fMPPCCollID = SDman->GetCollectionID(colName);
99 
100  G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
101  WLSPhotonDetHitsCollection* mppcHC = 0;
102 
103  // Get the hit collections
104  if (HCE)
105  {
106  if (fMPPCCollID>=0) mppcHC =
108  }
109 
110  // Get hit information about photons that reached the detector in this event
111  if (mppcHC)
112  {
113 // G4int n_hit = mppcHC->entries();
114  }
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
118 
120 {
122 }
123 
124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
125 
127 {
128  fVerboseLevel = level;
129 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
void SetEventVerbose(G4int)
WLSEventActionMessenger * fEventMessenger
G4int GetEventID() const
Definition: G4Event.hh:151
WLSRunAction * fRunAction
#define G4endl
Definition: G4ios.hh:61
virtual void BeginOfEventAction(const G4Event *)
virtual void EndOfEventAction(const G4Event *)
Definition of the WLSEventActionMessenger class.
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
G4EventManager * fpEventManager
const G4Event * GetConstCurrentEvent()
Definition of the WLSRunAction class.
Definition of the WLSPhotonDetHit class.
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
int G4int
Definition: G4Types.hh:78
G4int GetRndmFreq()
Definition: WLSRunAction.hh:59
G4GLOB_DLL std::ostream G4cout
Definition of the WLSEventAction class.
virtual ~WLSEventAction()
Definition of the WLSTrajectory class.
WLSEventAction(WLSRunAction *)
G4int G4GetThreadId()
Definition: G4Threading.cc:128