Geant4.10
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4.10.00.p01
examples
advanced
lAr_calorimeter
src
FCALEMModuleSD.cc
Go to the documentation of this file.
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: FCALEMModuleSD.cc 67976 2013-03-13 10:23:17Z gcosmo $
27
//
28
//
29
30
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
32
33
#include <iostream>
34
#include <fstream>
35
36
#include "
FCALEMModuleSD.hh
"
37
38
#include "
FCALCalorHit.hh
"
39
40
#include "
FCALTestbeamSetup.hh
"
41
#include "
FCALEMModule.hh
"
42
#include "
FCALSteppingAction.hh
"
43
44
#include "
G4SystemOfUnits.hh
"
45
#include "
G4VPhysicalVolume.hh
"
46
#include "
G4Step.hh
"
47
#include "
G4Track.hh
"
48
#include "
G4VTouchable.hh
"
49
#include "
G4TouchableHistory.hh
"
50
#include "
G4SDManager.hh
"
51
52
#include "
G4ios.hh
"
53
54
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
55
56
FCALEMModuleSD::FCALEMModuleSD
(
G4String
name
) :
G4VSensitiveDetector
(name),
57
Init_state(0)
58
{
59
EmModule =
new
FCALEMModule
();
60
}
61
62
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63
64
FCALEMModuleSD::~FCALEMModuleSD
()
65
{
66
delete
EmModule;
67
}
68
69
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
70
71
void
FCALEMModuleSD::Initialize
(
G4HCofThisEvent
*)
72
{
73
if
(Init_state==0)
74
{
75
EmModule->
InitializeGeometry
();
76
Init_state++;
77
};
78
79
for
(
G4int
j=0 ; j<1131 ; j++) {
EvisF1Tile
[j] = 0.;}
80
}
81
82
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
83
84
G4bool
FCALEMModuleSD::ProcessHits
(
G4Step
* aStep,
G4TouchableHistory
*)
85
{
86
87
G4double
edep = aStep->
GetTotalEnergyDeposit
();
88
if
(edep==0.)
return
false
;
89
90
G4TouchableHistory
* theTouchable
91
= (
G4TouchableHistory
*)(aStep->
GetPreStepPoint
()->
GetTouchable
());
92
G4VPhysicalVolume
* physVol = theTouchable->
GetVolume
();
93
94
95
if
(strcmp(physVol->
GetName
(),
"F1LArGapPhysical"
)==0){
96
G4int
F1LArGapId = physVol->
GetCopyNo
();
97
G4int
F1TileId = EmModule->
GetF1TileID
(F1LArGapId);
98
EvisF1Tile
[F1TileId] =
EvisF1Tile
[F1TileId] + edep;
99
};
100
101
return
true
;
102
}
103
104
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
105
106
void
FCALEMModuleSD::EndOfEvent
(
G4HCofThisEvent
*)
107
{
108
G4int
NF1Tile = 0;
109
G4int
AddTileP[300];
110
G4double
EvisTileP[300];
111
G4int
i=0;
112
for
(i=1; i <= 1130; i++){
113
if
(
EvisF1Tile
[i] > 0.) {
114
NF1Tile++;
115
AddTileP[NF1Tile] = i;
116
EvisTileP[NF1Tile] =
EvisF1Tile
[i];
117
}
118
}
119
120
G4cout
<<
"Number of F1 Tiles with Positive energy : "
<< NF1Tile <<
G4endl
;
121
122
// Write in File
123
//--------------
124
const
char
* FileName =
"EmModule_802_1mm.dat"
;
125
std::ios::openmode iostemp;
126
if
(Init_state == 1) {
127
iostemp = std::ios::out;
128
Init_state++;
129
}
else
{
130
iostemp = std::ios::out|
std::ios::app
;
// std::ios::app;
131
}
132
133
std::ofstream EmDatafile(FileName, iostemp);
134
// EmDatafile.precision(5);
135
136
EmDatafile << NF1Tile << std::endl;
137
for
(i=1; i <= NF1Tile; i++) {
138
EmDatafile << AddTileP[i] <<
" "
<< EvisTileP[i]/
MeV
<< std::endl;
139
}
140
EmDatafile.close();
141
142
}
143
144
145
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
146
147
void
FCALEMModuleSD::clear
()
148
{}
149
150
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
151
152
void
FCALEMModuleSD::DrawAll
()
153
{}
154
155
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
156
157
void
FCALEMModuleSD::PrintAll
()
158
{}
159
160
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
161
FCALEMModuleSD.hh
testem0.app
tuple app
Definition:
python3/testem0.py:189
G4TouchableHistory.hh
FCALEMModule
Definition:
FCALEMModule.hh:45
G4TouchableHistory::GetVolume
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4Track.hh
FCALEMModuleSD::PrintAll
void PrintAll()
Definition:
FCALEMModuleSD.cc:157
G4VPhysicalVolume
Definition:
G4VPhysicalVolume.hh:80
python.hepunit.MeV
MeV
Definition:
hepunit.py:117
G4VSensitiveDetector
Definition:
G4VSensitiveDetector.hh:50
FCALEMModule::InitializeGeometry
void InitializeGeometry()
Definition:
FCALEMModule.cc:83
FCALSteppingAction.hh
FCALEMModuleSD::EndOfEvent
void EndOfEvent(G4HCofThisEvent *)
Definition:
FCALEMModuleSD.cc:106
G4Step.hh
FCALEMModuleSD::EvisF1Tile
G4double EvisF1Tile[1131]
Definition:
FCALEMModuleSD.hh:74
name
const XML_Char * name
Definition:
include/expat.h:151
G4StepPoint::GetTouchable
const G4VTouchable * GetTouchable() const
FCALEMModuleSD::clear
void clear()
Definition:
FCALEMModuleSD.cc:147
G4int
int G4int
Definition:
G4Types.hh:78
FCALEMModuleSD::DrawAll
void DrawAll()
Definition:
FCALEMModuleSD.cc:152
FCALEMModuleSD::~FCALEMModuleSD
~FCALEMModuleSD()
Definition:
FCALEMModuleSD.cc:64
G4Step::GetPreStepPoint
G4StepPoint * GetPreStepPoint() const
G4cout
G4GLOB_DLL std::ostream G4cout
G4VPhysicalVolume::GetName
const G4String & GetName() const
G4SDManager.hh
FCALEMModule.hh
G4bool
bool G4bool
Definition:
G4Types.hh:79
FCALCalorHit.hh
FCALEMModule::GetF1TileID
G4int GetF1TileID(G4int)
Definition:
FCALEMModule.cc:201
G4Step
Definition:
G4Step.hh:76
G4Step::GetTotalEnergyDeposit
G4double GetTotalEnergyDeposit() const
G4TouchableHistory
Definition:
G4TouchableHistory.hh:53
G4ios.hh
G4VPhysicalVolume::GetCopyNo
virtual G4int GetCopyNo() const =0
FCALEMModuleSD::FCALEMModuleSD
FCALEMModuleSD(G4String)
Definition:
FCALEMModuleSD.cc:56
G4HCofThisEvent
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4HCofThisEvent.hh:64
FCALTestbeamSetup.hh
G4VTouchable.hh
G4endl
#define G4endl
Definition:
G4ios.hh:61
FCALEMModuleSD::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
Definition:
FCALEMModuleSD.cc:84
G4VPhysicalVolume.hh
G4double
double G4double
Definition:
G4Types.hh:76
G4SystemOfUnits.hh
FCALEMModuleSD::Initialize
void Initialize(G4HCofThisEvent *)
Definition:
FCALEMModuleSD.cc:71
G4String
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4String.hh:45
Generated on Wed Apr 30 2014 15:54:35 for Geant4.10 by
1.8.7