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
ExN02TrackerSD.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ExN02TrackerSD.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
//
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34
#include "
ExN02TrackerSD.hh
"
35
#include "G4HCofThisEvent.hh"
36
#include "
G4Step.hh
"
37
#include "
G4ThreeVector.hh
"
38
#include "
G4SDManager.hh
"
39
#include "
G4ios.hh
"
40
41
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43
ExN02TrackerSD::ExN02TrackerSD
(
G4String
name
)
44
:
G4VSensitiveDetector
(name)
45
{
46
G4String
HCname;
47
collectionName
.
insert
(HCname=
"trackerCollection"
);
48
}
49
50
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51
52
ExN02TrackerSD::~ExN02TrackerSD
(){ }
53
54
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55
56
void
ExN02TrackerSD::Initialize
(
G4HCofThisEvent
* HCE)
57
{
58
trackerCollection
=
new
ExN02TrackerHitsCollection
59
(
SensitiveDetectorName
,
collectionName
[0]);
60
static
G4int
HCID = -1;
61
if
(HCID<0)
62
{ HCID =
G4SDManager::GetSDMpointer
()->
GetCollectionID
(
collectionName
[0]); }
63
HCE->
AddHitsCollection
( HCID,
trackerCollection
);
64
}
65
66
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68
G4bool
ExN02TrackerSD::ProcessHits
(
G4Step
* aStep,
G4TouchableHistory
*)
69
{
70
G4double
edep
= aStep->
GetTotalEnergyDeposit
();
71
72
if
(edep==0.)
return
false
;
73
74
ExN02TrackerHit
* newHit =
new
ExN02TrackerHit
();
75
newHit->
SetTrackID
(aStep->
GetTrack
()->
GetTrackID
());
76
newHit->
SetChamberNb
(aStep->
GetPreStepPoint
()->
GetTouchableHandle
()
77
->
GetCopyNumber
());
78
newHit->
SetEdep
(edep);
79
newHit->
SetPos
(aStep->
GetPostStepPoint
()->
GetPosition
());
80
trackerCollection
->
insert
( newHit );
81
82
//newHit->Print();
83
//newHit->Draw();
84
85
return
true
;
86
}
87
88
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89
90
void
ExN02TrackerSD::EndOfEvent
(
G4HCofThisEvent
*)
91
{
92
if
(
verboseLevel
>0) {
93
G4int
NbHits =
trackerCollection
->
entries
();
94
G4cout
<<
"\n-------->Hits Collection: in this event they are "
<< NbHits
95
<<
" hits in the tracker chambers: "
<<
G4endl
;
96
for
(
G4int
i=0;i<NbHits;i++) (*
trackerCollection
)[i]->Print();
97
}
98
}
99
100
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101
geant4
tree
geant4-10.6-release
examples
extended
parallel
TopC
ParN02
src
ExN02TrackerSD.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:09
using
1.8.2 with
ECCE GitHub integration