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
FCALHadModuleSD.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: FCALHadModuleSD.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 "
FCALHadModuleSD.hh
"
37
38
#include "
FCALCalorHit.hh
"
39
40
#include "
FCALTestbeamSetup.hh
"
41
#include "
FCALHadModule.hh
"
42
43
#include "
G4SystemOfUnits.hh
"
44
#include "
G4VPhysicalVolume.hh
"
45
#include "
G4Step.hh
"
46
#include "
G4Track.hh
"
47
#include "
G4VTouchable.hh
"
48
#include "
G4TouchableHistory.hh
"
49
#include "
G4SDManager.hh
"
50
51
#include "
G4ios.hh
"
52
53
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
54
55
FCALHadModuleSD::FCALHadModuleSD
(
G4String
name
) :
G4VSensitiveDetector
(name),
56
InitF2(0)
57
{
58
HadModule =
new
FCALHadModule
();
59
}
60
61
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
62
63
FCALHadModuleSD::~FCALHadModuleSD
()
64
{
65
delete
HadModule;
66
}
67
68
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
69
70
void
FCALHadModuleSD::Initialize
(
G4HCofThisEvent
*)
71
{
72
if
(InitF2 == 0) {
73
HadModule->
InitializeGeometry
();
74
InitF2++;
75
}
76
for
(
G4int
j=0; j<2330; j++) {
EvisF2Tile
[j]=0.;}
77
}
78
79
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
80
81
G4bool
FCALHadModuleSD::ProcessHits
(
G4Step
* aStep,
G4TouchableHistory
*)
82
{
83
84
G4double
edep = aStep->
GetTotalEnergyDeposit
();
85
if
(edep==0.)
return
false
;
86
87
G4TouchableHistory
* theTouchable
88
= (
G4TouchableHistory
*)(aStep->
GetPreStepPoint
()->
GetTouchable
());
89
G4VPhysicalVolume
* physVol = theTouchable->
GetVolume
();
90
91
92
if
(strcmp(physVol->
GetName
(),
"F2LArGapPhysical"
)==0){
93
G4int
F2LArGapId = physVol->
GetCopyNo
();
94
G4int
F2TileId = HadModule->
GetF2TileID
(F2LArGapId);
95
EvisF2Tile
[F2TileId] =
EvisF2Tile
[F2TileId] + edep;
96
};
97
98
return
true
;
99
}
100
101
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
102
103
void
FCALHadModuleSD::EndOfEvent
(
G4HCofThisEvent
*)
104
{
105
G4int
NF2Tile = 0;
106
G4int
AddTileP[300];
107
G4double
EvisTileP[300];
108
G4int
i=0;
109
110
for
(i=0; i<2330; i++){
111
if
(
EvisF2Tile
[i] > 0.) {
112
NF2Tile++;
113
AddTileP[NF2Tile] = i;
114
EvisTileP[NF2Tile] =
EvisF2Tile
[i];
115
};};
116
117
G4cout
<<
"Number of F2 tiles with Positive energy : "
<< NF2Tile <<
G4endl
;
118
119
// Write data in File
120
//-------------------
121
G4String
FileName =
"HadModule_802_1mm.dat"
;
122
std::ios::openmode iostemp;
123
if
(InitF2 == 1) {
124
iostemp = std::ios::out;
125
InitF2++;
126
}
else
{
127
iostemp = std::ios::out|
std::ios::app
;
// std::ios::app;
128
};
129
130
std::ofstream HadDatafile(FileName, iostemp);
131
// EmDatafile.precision(5);
132
133
HadDatafile << NF2Tile << std::endl;
134
for
(i=1; i <= NF2Tile; i++) {
135
HadDatafile << AddTileP[i] <<
" "
<< EvisTileP[i]/
MeV
<< std::endl;
136
}
137
HadDatafile.close();
138
139
140
141
142
}
143
144
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
145
146
void
FCALHadModuleSD::clear
()
147
{}
148
149
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
150
151
void
FCALHadModuleSD::DrawAll
()
152
{}
153
154
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
155
156
void
FCALHadModuleSD::PrintAll
()
157
{}
158
159
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
160
FCALHadModuleSD::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
Definition:
FCALHadModuleSD.cc:81
testem0.app
tuple app
Definition:
python3/testem0.py:189
FCALHadModuleSD::EndOfEvent
void EndOfEvent(G4HCofThisEvent *)
Definition:
FCALHadModuleSD.cc:103
FCALHadModule
Definition:
FCALHadModule.hh:45
G4TouchableHistory.hh
FCALHadModuleSD::clear
void clear()
Definition:
FCALHadModuleSD.cc:146
FCALHadModule::GetF2TileID
G4int GetF2TileID(G4int)
Definition:
FCALHadModule.cc:269
G4TouchableHistory::GetVolume
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4Track.hh
G4VPhysicalVolume
Definition:
G4VPhysicalVolume.hh:80
python.hepunit.MeV
MeV
Definition:
hepunit.py:117
G4VSensitiveDetector
Definition:
G4VSensitiveDetector.hh:50
FCALHadModuleSD::EvisF2Tile
G4double EvisF2Tile[2330]
Definition:
FCALHadModuleSD.hh:71
G4Step.hh
name
const XML_Char * name
Definition:
include/expat.h:151
FCALHadModule::InitializeGeometry
void InitializeGeometry()
Definition:
FCALHadModule.cc:83
G4StepPoint::GetTouchable
const G4VTouchable * GetTouchable() const
G4int
int G4int
Definition:
G4Types.hh:78
G4Step::GetPreStepPoint
G4StepPoint * GetPreStepPoint() const
FCALHadModuleSD::Initialize
void Initialize(G4HCofThisEvent *)
Definition:
FCALHadModuleSD.cc:70
G4cout
G4GLOB_DLL std::ostream G4cout
G4VPhysicalVolume::GetName
const G4String & GetName() const
G4SDManager.hh
G4bool
bool G4bool
Definition:
G4Types.hh:79
FCALCalorHit.hh
FCALHadModuleSD::FCALHadModuleSD
FCALHadModuleSD(G4String)
Definition:
FCALHadModuleSD.cc:55
G4Step
Definition:
G4Step.hh:76
FCALHadModuleSD::PrintAll
void PrintAll()
Definition:
FCALHadModuleSD.cc:156
G4Step::GetTotalEnergyDeposit
G4double GetTotalEnergyDeposit() const
FCALHadModule.hh
FCALHadModuleSD.hh
G4TouchableHistory
Definition:
G4TouchableHistory.hh:53
G4ios.hh
G4VPhysicalVolume::GetCopyNo
virtual G4int GetCopyNo() const =0
G4HCofThisEvent
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4HCofThisEvent.hh:64
FCALTestbeamSetup.hh
G4VTouchable.hh
G4endl
#define G4endl
Definition:
G4ios.hh:61
FCALHadModuleSD::~FCALHadModuleSD
~FCALHadModuleSD()
Definition:
FCALHadModuleSD.cc:63
G4VPhysicalVolume.hh
G4double
double G4double
Definition:
G4Types.hh:76
FCALHadModuleSD::DrawAll
void DrawAll()
Definition:
FCALHadModuleSD.cc:151
G4SystemOfUnits.hh
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