ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ExGflashSensitiveDetector.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ExGflashSensitiveDetector.cc
1
// ********************************************************************
2
// * License and Disclaimer *
3
// * *
4
// * The Geant4 software is copyright of the Copyright Holders of *
5
// * the Geant4 Collaboration. It is provided under the terms and *
6
// * conditions of the Geant4 Software License, included in the file *
7
// * LICENSE and available at http://cern.ch/geant4/license . These *
8
// * include a list of copyright holders. *
9
// * *
10
// * Neither the authors of this software system, nor their employing *
11
// * institutes,nor the agencies providing financial support for this *
12
// * work make any representation or warranty, express or implied, *
13
// * regarding this software system or assume any liability for its *
14
// * use. Please see the license in the file LICENSE and URL above *
15
// * for the full disclaimer and the limitation of liability. *
16
// * *
17
// * This code implementation is the result of the scientific and *
18
// * technical work of the GEANT4 collaboration. *
19
// * By using, copying, modifying or distributing the software (or *
20
// * any work based on the software) you agree to acknowledge its *
21
// * use in resulting scientific publications, and indicate your *
22
// * acceptance of all terms of the Geant4 Software license. *
23
// ********************************************************************
24
//
25
//
28
//
29
// Created by Joanna Weng 26.11.2004
30
#include "
ExGflashSensitiveDetector.hh
"
31
#include "ExGflashHit.hh"
32
#include "
G4GFlashSpot.hh
"
33
#include "
ExGflashDetectorConstruction.hh
"
34
#include "
G4VPhysicalVolume.hh
"
35
#include "
G4Step.hh
"
36
#include "
G4VTouchable.hh
"
37
#include "
G4TouchableHistory.hh
"
38
39
//WARNING : You have to use also G4VGFlashSensitiveDetector() as base class
40
41
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43
ExGflashSensitiveDetector::ExGflashSensitiveDetector
(
G4String
name
,
44
ExGflashDetectorConstruction
*
/* det */
)
45
// : G4VSensitiveDetector(name), G4VGFlashSensitiveDetector(), fDetector(det), fHCID(-1)
46
:
G4VSensitiveDetector
(name),
G4VGFlashSensitiveDetector
(), fHCID(-1)
47
{
48
G4String
caloname=
"ExGflashCollection"
;
49
collectionName
.
insert
(caloname);
50
}
51
52
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53
54
ExGflashSensitiveDetector::~ExGflashSensitiveDetector
()
55
{}
56
57
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58
59
void
ExGflashSensitiveDetector::Initialize
(
G4HCofThisEvent
* HCE)
60
{
61
if
(
fHCID
<0){
fHCID
=
GetCollectionID
(0); }
62
fCaloHitsCollection
=
new
63
ExGflashHitsCollection
(
SensitiveDetectorName
,
collectionName
[0]);
// first collection
64
HCE->
AddHitsCollection
(
fHCID
,
fCaloHitsCollection
);
65
}
66
67
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68
69
void
ExGflashSensitiveDetector::EndOfEvent
(
G4HCofThisEvent
*)
70
{}
71
72
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73
74
G4bool
ExGflashSensitiveDetector::ProcessHits
(
G4Step
* aStep,
G4TouchableHistory
*
/* ROhist */
)
75
{
76
G4double
e
=aStep->
GetTotalEnergyDeposit
();
77
if
(e<=0.)
return
false
;
78
79
ExGflashHit
* caloHit=
new
ExGflashHit
();
80
caloHit->
SetEdep
(e);
81
caloHit->
SetPos
(aStep->
GetPreStepPoint
()->
GetPosition
());
82
fCaloHitsCollection
->
insert
(caloHit);
83
84
return
true
;
85
}
86
87
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88
89
// Separate GFLASH interface
90
G4bool
ExGflashSensitiveDetector::ProcessHits
(
G4GFlashSpot
*aSpot ,
G4TouchableHistory
*
/* ROhist */
)
91
{
//cout<<"This is ProcessHits GFLASH"<<endl;
92
G4double
e
=aSpot->
GetEnergySpot
()->
GetEnergy
();
93
if
(e<=0.)
return
false
;
94
95
// G4VPhysicalVolume* pCurrentVolume = aSpot->GetTouchableHandle()->GetVolume();
96
97
ExGflashHit
* caloHit=
new
ExGflashHit
();
98
caloHit->
SetEdep
(e);
99
caloHit->
SetPos
(aSpot->
GetEnergySpot
()->
GetPosition
());
100
fCaloHitsCollection
->
insert
(caloHit);
101
// if (ROhist){;}
102
103
return
true
;
104
}
105
106
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
parameterisations
gflash
gflasha
src
ExGflashSensitiveDetector.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:09
using
1.8.2 with
ECCE GitHub integration