Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
F02CalorimeterSD.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 //
28 //
29 //
30 // $Id: F02CalorimeterSD.cc 76247 2013-11-08 11:18:52Z gcosmo $
31 //
32 //
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 #include "F02CalorimeterSD.hh"
37 
38 #include "F02CalorHit.hh"
40 
41 #include "G4VPhysicalVolume.hh"
42 #include "G4Step.hh"
43 #include "G4VTouchable.hh"
44 #include "G4TouchableHistory.hh"
45 #include "G4SDManager.hh"
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
51 : G4VSensitiveDetector(name),
52  fCalCollection(0),
53  fDetector(det),
54  fHitID(new G4int[500])
55 {
56  collectionName.insert("CalCollection");
57 }
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60 
62 {
63  delete [] fHitID;
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69 {
72  for (G4int j=0;j<1; j++) {fHitID[j] = -1;};
73 }
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
78 {
80  G4double stepl = 0.;
81 
82  stepl = step->GetStepLength();
83 
84  if ((edep == 0.) && (stepl == 0.) ) return false;
85 
86  G4TouchableHistory* theTouchable
88 
89  G4VPhysicalVolume* physVol = theTouchable->GetVolume();
90 
91  G4int number = 0;
92  if (fHitID[number]==-1)
93  {
94  F02CalorHit* calHit = new F02CalorHit();
95  if (physVol == fDetector->GetAbsorber()) calHit->AddAbs(edep,stepl);
96  fHitID[number] = fCalCollection->insert(calHit) - 1;
97  if (verboseLevel>0)
98  G4cout << " New Calorimeter Hit on F02: " << number << G4endl;
99  }
100  else
101  {
102  if (physVol == fDetector->GetAbsorber())
103  (*fCalCollection)[fHitID[number]]->AddAbs(edep,stepl);
104  if (verboseLevel>0)
105  G4cout << " Energy added to F02: " << number << G4endl;
106  }
107 
108  return true;
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 
114 {
115  static G4int hcID = -1;
116  if (hcID<0)
119 }
120 
121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
const XML_Char * name
Definition: expat.h:151
F02DetectorConstruction * fDetector
const G4VTouchable * GetTouchable() const
virtual void Initialize(G4HCofThisEvent *)
G4StepPoint * GetPreStepPoint() const
#define G4endl
Definition: G4ios.hh:61
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
G4THitsCollection< F02CalorHit > F02CalorHitsCollection
Definition: F02CalorHit.hh:80
F02CalorimeterSD(G4String, F02DetectorConstruction *)
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *)
Definition of the F02CalorHit class.
void AddAbs(G4double de, G4double dl)
Definition: F02CalorHit.hh:61
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4double GetStepLength() const
const G4VPhysicalVolume * GetAbsorber()
virtual ~F02CalorimeterSD()
G4double GetTotalEnergyDeposit() const
Definition: G4Step.hh:76
Double_t edep
Definition of the F02DetectorConstruction class.
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
G4GLOB_DLL std::ostream G4cout
F02CalorHitsCollection * fCalCollection
virtual void EndOfEvent(G4HCofThisEvent *)
Definition of the F02CalorimeterSD class.