Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
np
nptool
Commits
39889cec
Commit
39889cec
authored
12 years ago
by
matta
Browse files
Options
Downloads
Patches
Plain Diff
* Sharc scorer compile
parent
12e5a2fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NPSimulation/include/SharcScorers.hh
+7
-2
7 additions, 2 deletions
NPSimulation/include/SharcScorers.hh
NPSimulation/src/SharcScorers.cc
+21
-14
21 additions, 14 deletions
NPSimulation/src/SharcScorers.cc
with
28 additions
and
16 deletions
NPSimulation/include/SharcScorers.hh
+
7
−
2
View file @
39889cec
...
...
@@ -34,7 +34,7 @@ namespace SHARC {
class
PS_Silicon_Rectangle
:
public
G4VPrimitiveScorer
{
public:
// with description
PS_Silicon_Rectangle
(
G4String
name
,
G4double
StripPlaneLength
,
G4double
StripPlaneWidth
,
G4int
NumberOfStripLength
,
G4int
NumberOfStripWidth
,
G4int
depth
);
PS_Silicon_Rectangle
(
G4String
name
,
G4double
StripPlaneLength
,
G4double
StripPlaneWidth
,
G4int
NumberOfStripLength
,
G4int
NumberOfStripWidth
,
G4double
TriggerThreshold
,
G4int
depth
=
0
);
virtual
~
PS_Silicon_Rectangle
();
protected:
// with description
...
...
@@ -46,6 +46,9 @@ namespace SHARC {
virtual
void
clear
();
virtual
void
DrawAll
();
virtual
void
PrintAll
();
private:
// Threshold
G4double
m_TriggerThreshold
;
private:
// Geometry of the detector
G4double
m_StripPlaneLength
;
...
...
@@ -57,13 +60,15 @@ namespace SHARC {
private:
// inherited from G4VPrimitiveScorer
G4int
HCID
;
G4THitsMap
<
G4
int
>*
EvtMap
;
G4THitsMap
<
G4
double
*
>*
EvtMap
;
private:
// Needed for intermediate calculation (avoid multiple instantiation in Processing Hit)
G4ThreeVector
m_Position
;
G4int
m_DetectorNumber
;
G4int
m_StripLengthNumber
;
G4int
m_StripWidthNumber
;
G4int
m_Index
;
};
}
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/src/SharcScorers.cc
+
21
−
14
View file @
39889cec
...
...
@@ -24,8 +24,8 @@
using
namespace
SHARC
;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PS_Silicon_Rectangle
::
PS_Silicon_Rectangle
(
G4String
name
,
G4double
StripPlaneLength
,
G4double
StripPlaneWidth
,
G4int
NumberOfStripLength
,
G4int
NumberOfStripWidth
,
G4int
depth
)
:
G4VPrimitiveScorer
(
name
,
depth
),
HCID
(
-
1
){
PS_Silicon_Rectangle
::
PS_Silicon_Rectangle
(
G4String
name
,
G4double
StripPlaneLength
,
G4double
StripPlaneWidth
,
G4int
NumberOfStripLength
,
G4int
NumberOfStripWidth
,
G4double
TriggerThreshold
,
G4int
depth
)
:
G4VPrimitiveScorer
(
name
,
depth
),
m_TriggerThreshold
(
TriggerThreshold
),
HCID
(
-
1
){
m_StripPlaneLength
=
StripPlaneLength
;
m_StripPlaneWidth
=
StripPlaneWidth
;
m_NumberOfStripLength
=
NumberOfStripLength
;
...
...
@@ -37,6 +37,7 @@ PS_Silicon_Rectangle::PS_Silicon_Rectangle(G4String name, G4double StripPlaneLen
m_DetectorNumber
=
-
1
;
m_StripLengthNumber
=
-
1
;
m_StripWidthNumber
=
-
1
;
m_Index
=
-
1
;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...
...
@@ -45,32 +46,38 @@ PS_Silicon_Rectangle::~PS_Silicon_Rectangle(){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool
PS_Silicon_Rectangle
::
ProcessHits
(
G4Step
*
aStep
,
G4TouchableHistory
*
){
G4double
*
EnergyAndTime
=
new
G4double
[
2
];
EnergyAndTime
[
0
]
=
aStep
->
GetTotalEnergyDeposit
();
// If the energy deposit is below the threshold, the deposit is ignored
if
(
EnergyAndTime
[
0
]
<
m_TriggerThreshold
){
delete
EnergyAndTime
;
return
FALSE
;
}
EnergyAndTime
[
1
]
=
aStep
->
GetPreStepPoint
()
->
GetGlobalTime
();
m_DetectorNumber
=
aStep
->
GetPreStepPoint
()
->
GetTouchableHandle
()
->
GetCopyNumber
(
0
);
m_Position
=
aStep
->
GetPreStepPoint
()
->
GetPosition
();
m_Position
=
aStep
->
GetPreStepPoint
()
->
GetTouchableHandle
()
->
GetHistory
()
->
GetTopTransform
().
TransformPoint
(
POS
);
m_Position
=
aStep
->
GetPreStepPoint
()
->
GetTouchableHandle
()
->
GetHistory
()
->
GetTopTransform
().
TransformPoint
(
m_Position
);
m_StripLengthNumber
=
(
int
)((
m_Position
(
1
)
+
m_StripPlaneLength
/
2.
)
/
m_StripPitchLength
)
+
1
;
m_StripWidthNumber
=
(
int
)((
m_Position
(
2
)
+
m_StripPlaneWidth
/
2.
)
/
m_StripPitchWidth
)
+
1
;
//Rare case where particle is close to edge of silicon plan
if
(
m_StripLengthNumber
==
m_NumberOfStripLength
+
1
)
m_StripLengthNumber
=
m_StripLengthNumber
;
if
(
m_StripWidthNumber
==
m_NumberOfStripWidth
+
1
)
m_StripWidthhNumber
=
m_StripWidthNumber
;
G4double
[
2
]
EnergyAndTime
;
if
(
m_StripWidthNumber
==
m_NumberOfStripWidth
+
1
)
m_StripWidthNumber
=
m_StripWidthNumber
;
EnergyAndTime
[
0
]
=
aStep
->
GetTotalEnergyDeposit
();
EnergyAndTime
[
1
]
=
aStep
->
GetPreStepPoint
()
->
GetGlobalTime
();;
if
(
edep
<
TriggerThreshold
)
return
FALSE
;
G4int
index
=
aStep
->
GetTrack
()
->
GetTrackID
();
EvtMap
->
set
(
index
+
DetNbr
,
X
);
m_Index
=
aStep
->
GetTrack
()
->
GetTrackID
()
+
m_DetectorNumber
*
1e3
+
m_StripLengthNumber
*
1e6
+
m_StripWidthNumber
*
1e9
;
EvtMap
->
set
(
m_Index
,
EnergyAndTime
);
return
TRUE
;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
PS_Silicon_Rectangle
::
Initialize
(
G4HCofThisEvent
*
HCE
){
EvtMap
=
new
G4THitsMap
<
G4
int
>
(
GetMultiFunctionalDetector
()
->
GetName
(),
GetName
());
EvtMap
=
new
G4THitsMap
<
G4
double
*
>
(
GetMultiFunctionalDetector
()
->
GetName
(),
GetName
());
if
(
HCID
<
0
)
{
HCID
=
GetCollectionID
(
0
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment