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
184ec904
Commit
184ec904
authored
11 years ago
by
adrien-matta
Browse files
Options
Downloads
Patches
Plain Diff
* Adding resistive scorrer file, compiling but still not doing the job
parent
8df167d1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NPSimulation/include/ResistiveStripScorers.hh
+76
-0
76 additions, 0 deletions
NPSimulation/include/ResistiveStripScorers.hh
NPSimulation/src/ResistiveStripScorers.cc
+121
-0
121 additions, 0 deletions
NPSimulation/src/ResistiveStripScorers.cc
with
197 additions
and
0 deletions
NPSimulation/include/ResistiveStripScorers.hh
0 → 100644
+
76
−
0
View file @
184ec904
#ifndef SharcScorers_h
#define SharcScorers_h 1
/*****************************************************************************
* Copyright (C) 2009-2013 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Adrien MATTA contact address: matta@ipno.in2p3.fr *
* *
* Creation Date : February 2013 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* File old the scorer specific to the Sharc Detector *
* *
*---------------------------------------------------------------------------*
* Comment: *
* This new style of scorer is aim to become the standard way of doing scorer*
* in NPTool. *
*The index is build using the TrackID, Detector Number and Strip Number. *
*The scorer Hold Energy and time together *
*Only one scorer is needed for a detector *
*****************************************************************************/
#include
"G4VPrimitiveScorer.hh"
#include
"G4THitsMap.hh"
#include
<map>
using
namespace
std
;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class
PS_Silicon_Resistive
:
public
G4VPrimitiveScorer
{
public:
// with description
PS_Silicon_Resistive
(
G4String
name
,
G4double
StripPlaneLength
,
G4double
StripPlaneWidth
,
G4int
NumberOfStripWidth
,
G4int
depth
=
0
);
~
PS_Silicon_Resistive
();
protected:
// with description
G4bool
ProcessHits
(
G4Step
*
,
G4TouchableHistory
*
);
public:
void
Initialize
(
G4HCofThisEvent
*
);
void
EndOfEvent
(
G4HCofThisEvent
*
);
void
clear
();
void
DrawAll
();
void
PrintAll
();
private:
// Threshold
G4double
m_TriggerThreshold
;
private:
// Geometry of the detector
G4double
m_StripPlaneLength
;
G4double
m_StripPlaneWidth
;
G4int
m_NumberOfStripWidth
;
G4double
m_StripPitchWidth
;
private:
// inherited from G4VPrimitiveScorer
G4int
HCID
;
G4THitsMap
<
G4double
*>*
EvtMap
;
private:
// Needed for intermediate calculation (avoid multiple instantiation in Processing Hit)
G4ThreeVector
m_Position
;
G4int
m_DetectorNumber
;
G4int
m_StripWidthNumber
;
G4int
m_Index
;
};
#endif
This diff is collapsed.
Click to expand it.
NPSimulation/src/ResistiveStripScorers.cc
0 → 100644
+
121
−
0
View file @
184ec904
/****************************************************************************
* Copyright (C) 2009-2013 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Adrien MATTA contact address: matta@ipno.in2p3.fr *
* *
* Creation Date : December 2013 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* Generic scorer for Resistive Strip Silicon detector *
* *
*---------------------------------------------------------------------------*
* Comment: *
* Energy Sharing and Balistic deficit effect. *
* *
*****************************************************************************/
#include
"ResistiveStripScorers.hh"
#include
"G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PS_Silicon_Resistive
::
PS_Silicon_Resistive
(
G4String
name
,
G4double
StripPlaneLength
,
G4double
StripPlaneWidth
,
G4int
NumberOfStripWidth
,
G4int
depth
)
:
G4VPrimitiveScorer
(
name
,
depth
),
HCID
(
-
1
){
m_StripPlaneLength
=
StripPlaneLength
;
m_StripPlaneWidth
=
StripPlaneWidth
;
m_NumberOfStripWidth
=
NumberOfStripWidth
;
m_StripPitchWidth
=
m_StripPlaneWidth
/
m_NumberOfStripWidth
;
m_Position
=
G4ThreeVector
(
-
1000
,
-
1000
,
-
1000
);
m_DetectorNumber
=
-
1
;
m_StripWidthNumber
=
-
1
;
m_Index
=
-
1
;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PS_Silicon_Resistive
::~
PS_Silicon_Resistive
(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool
PS_Silicon_Resistive
::
ProcessHits
(
G4Step
*
aStep
,
G4TouchableHistory
*
){
// contain Energy Total, E1, E2, Time, DetNbr, and StripWidth
G4double
*
EnergyAndTime
=
new
G4double
[
10
];
EnergyAndTime
[
0
]
=
aStep
->
GetTotalEnergyDeposit
();
EnergyAndTime
[
1
]
=
aStep
->
GetPreStepPoint
()
->
GetGlobalTime
();
m_DetectorNumber
=
aStep
->
GetPreStepPoint
()
->
GetTouchableHandle
()
->
GetCopyNumber
(
0
);
m_Position
=
aStep
->
GetPreStepPoint
()
->
GetPosition
();
// Interaction coordinates (used to fill the InteractionCoordinates branch)
EnergyAndTime
[
5
]
=
m_Position
.
x
();
EnergyAndTime
[
6
]
=
m_Position
.
y
();
EnergyAndTime
[
7
]
=
m_Position
.
z
();
EnergyAndTime
[
8
]
=
m_Position
.
theta
();
EnergyAndTime
[
9
]
=
m_Position
.
phi
();
m_Position
=
aStep
->
GetPreStepPoint
()
->
GetTouchableHandle
()
->
GetHistory
()
->
GetTopTransform
().
TransformPoint
(
m_Position
);
m_StripWidthNumber
=
(
int
)((
m_Position
.
y
()
+
m_StripPlaneWidth
/
2.
)
/
m_StripPitchWidth
)
+
1
;
m_StripWidthNumber
=
m_NumberOfStripWidth
-
m_StripWidthNumber
+
1
;
EnergyAndTime
[
2
]
=
m_DetectorNumber
;
EnergyAndTime
[
4
]
=
m_StripWidthNumber
;
//Rare case where particle is close to edge of silicon plan
if
(
m_StripWidthNumber
>
m_NumberOfStripWidth
)
m_StripWidthNumber
=
m_NumberOfStripWidth
;
m_Index
=
aStep
->
GetTrack
()
->
GetTrackID
()
+
m_DetectorNumber
*
1e3
+
m_StripWidthNumber
*
1e6
;
// Check if the particle has interact before, if yes, add up the energies.
map
<
G4int
,
G4double
**>::
iterator
it
;
it
=
EvtMap
->
GetMap
()
->
find
(
m_Index
);
if
(
it
!=
EvtMap
->
GetMap
()
->
end
()){
G4double
*
dummy
=
*
(
it
->
second
);
EnergyAndTime
[
0
]
+=
dummy
[
0
];
}
EvtMap
->
set
(
m_Index
,
EnergyAndTime
);
return
TRUE
;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
PS_Silicon_Resistive
::
Initialize
(
G4HCofThisEvent
*
HCE
){
EvtMap
=
new
G4THitsMap
<
G4double
*>
(
GetMultiFunctionalDetector
()
->
GetName
(),
GetName
());
if
(
HCID
<
0
)
{
HCID
=
GetCollectionID
(
0
);
}
HCE
->
AddHitsCollection
(
HCID
,
(
G4VHitsCollection
*
)
EvtMap
);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
PS_Silicon_Resistive
::
EndOfEvent
(
G4HCofThisEvent
*
){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
PS_Silicon_Resistive
::
clear
(){
std
::
map
<
G4int
,
G4double
**>::
iterator
MapIterator
;
for
(
MapIterator
=
EvtMap
->
GetMap
()
->
begin
()
;
MapIterator
!=
EvtMap
->
GetMap
()
->
end
()
;
MapIterator
++
){
delete
*
(
MapIterator
->
second
);
}
EvtMap
->
clear
();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
PS_Silicon_Resistive
::
DrawAll
(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
PS_Silicon_Resistive
::
PrintAll
(){
G4cout
<<
" MultiFunctionalDet "
<<
detector
->
GetName
()
<<
G4endl
;
G4cout
<<
" PrimitiveScorer "
<<
GetName
()
<<
G4endl
;
G4cout
<<
" Number of entries "
<<
EvtMap
->
entries
()
<<
G4endl
;
}
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