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
98c8cb83
Commit
98c8cb83
authored
9 months ago
by
lheitz
Browse files
Options
Downloads
Patches
Plain Diff
Back to previous PS_Rectangle
parent
af122f3e
No related branches found
Branches containing commit
No related tags found
2 merge requests
!27
Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
,
!25
Np tool.2.dev
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NPSimulation/Scorers/DSSDScorers.cc
+9
-64
9 additions, 64 deletions
NPSimulation/Scorers/DSSDScorers.cc
NPSimulation/Scorers/DSSDScorers.hh
+2
-8
2 additions, 8 deletions
NPSimulation/Scorers/DSSDScorers.hh
with
11 additions
and
72 deletions
NPSimulation/Scorers/DSSDScorers.cc
+
9
−
64
View file @
98c8cb83
...
...
@@ -22,21 +22,7 @@
#include
"DSSDScorers.hh"
#include
"G4UnitsTable.hh"
using
namespace
DSSDScorers
;
/*
vector<DSSDData>::iterator DSSDDataVector::find(const unsigned int& index, const double& time , const double TimeThreshold = 0) {
for (vector<DSSDData>::iterator it = m_Data.begin(); it != m_Data.end(); it++) {
G4bool checkIndex =(*it).GetIndex() == index;
G4bool checkTime = 1;
if (TimeThreshold>0)
{
checkTime = std::abs((*it).GetTime() - time) < TimeThreshold;
};
if (checkIndex & checkTime)
return it; //Autre possibilité : rajouter Temps en argument, + check *it.GetTime() == Temps)
}
return m_Data.end();
}
*/
vector
<
DSSDData
>::
iterator
DSSDDataVector
::
find
(
const
unsigned
int
&
index
)
{
for
(
vector
<
DSSDData
>::
iterator
it
=
m_Data
.
begin
();
it
!=
m_Data
.
end
();
it
++
)
{
if
((
*
it
).
GetIndex
()
==
index
)
...
...
@@ -44,27 +30,7 @@ vector<DSSDData>::iterator DSSDDataVector::find(const unsigned int& index) {
}
return
m_Data
.
end
();
}
/*
vector<DSSDData>::iterator DSSDDataVector::find(const unsigned int& index) {
for (vector<DSSDData>::iterator it = m_Data.begin(); it != m_Data.end(); it++) {
G4bool checkIndex =(*it).GetIndex() == index;
if (checkIndex)
return it; //Autre possibilité : rajouter Temps en argument, + check *it.GetTime() == Temps)
}
return m_Data.end();
}
*/
/*
vector<DSSDData>::iterator DSSDDataVector::findTime(const unsigned int& index, const double& time, const double thresh = 1000* ns) {
for (vector<DSSDData>::iterator it = m_Data.begin(); it != m_Data.end(); it++) {
G4bool checkIndex =(*it).GetIndex() == index;
G4bool checkTime = std::abs((*it).GetTime() - time) < thresh;
if ( checkIndex && checkTime)
return it; //Autre possibilité : rajouter Temps en argument, + check *it.GetTime() == Temps)
}
return m_Data.end();
}
*/
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PS_Images
::
PS_Images
(
G4String
name
,
string
imageFront
,
string
imageBack
,
double
scalingFront
,
double
scalingBack
,
...
...
@@ -182,8 +148,7 @@ void PS_Images::GetARGBBack(unsigned int& i, unsigned int& a, unsigned int& r, u
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PS_Rectangle
::
PS_Rectangle
(
G4String
name
,
G4int
Level
,
G4double
StripPlaneLength
,
G4double
StripPlaneWidth
,
G4int
NumberOfStripLength
,
G4int
NumberOfStripWidth
,
G4int
depth
,
G4String
axis
,
G4double
TimeThreshold
,
G4double
InterStripLength
,
G4double
InterStripWidth
)
G4int
NumberOfStripLength
,
G4int
NumberOfStripWidth
,
G4int
depth
,
G4String
axis
)
:
G4VPrimitiveScorer
(
name
,
depth
)
{
m_StripPlaneLength
=
StripPlaneLength
;
...
...
@@ -193,9 +158,6 @@ PS_Rectangle::PS_Rectangle(G4String name, G4int Level, G4double StripPlaneLength
m_StripPitchLength
=
m_StripPlaneLength
/
m_NumberOfStripLength
;
m_StripPitchWidth
=
m_StripPlaneWidth
/
m_NumberOfStripWidth
;
m_Level
=
Level
;
m_TimeThreshold
=
TimeThreshold
;
m_InterStripLength
=
InterStripLength
;
m_InterStripWidth
=
InterStripWidth
;
if
(
axis
==
"xy"
)
m_Axis
=
ps_xy
;
else
if
(
axis
==
"yz"
)
...
...
@@ -218,20 +180,10 @@ G4bool PS_Rectangle::ProcessHits(G4Step* aStep, G4TouchableHistory*) {
t_Position
=
aStep
->
GetPreStepPoint
()
->
GetTouchableHandle
()
->
GetHistory
()
->
GetTopTransform
().
TransformPoint
(
t_Position
);
G4bool
checkInterStrip_x
=
1
;
G4bool
checkInterStrip_y
=
1
;
if
(
m_Axis
==
ps_xy
)
{
t_StripLengthNumber
=
(
int
)((
t_Position
.
x
()
+
m_StripPlaneLength
/
2.
)
/
m_StripPitchLength
)
+
1
;
t_StripWidthNumber
=
(
int
)((
t_Position
.
y
()
+
m_StripPlaneWidth
/
2.
)
/
m_StripPitchWidth
)
+
1
;
G4double
x0
=
t_Position
.
x
()
+
m_StripPlaneLength
/
2.
;
G4double
middle_x
=
(
2
*
t_StripLengthNumber
-
1
)
*
m_StripPitchLength
/
2
;
checkInterStrip_x
=
std
::
abs
(
x0
-
middle_x
)
<
(
m_StripPitchLength
-
m_InterStripLength
)
/
2
;
G4double
y0
=
t_Position
.
y
()
+
m_StripPlaneWidth
/
2.
;
G4double
middle_y
=
(
2
*
t_StripWidthNumber
-
1
)
*
m_StripPitchWidth
/
2
;
checkInterStrip_y
=
std
::
abs
(
y0
-
middle_y
)
<
(
m_StripPitchWidth
-
m_InterStripWidth
)
/
2
;
}
else
if
(
m_Axis
==
ps_yz
)
{
t_StripLengthNumber
=
(
int
)((
t_Position
.
y
()
+
m_StripPlaneLength
/
2.
)
/
m_StripPitchLength
)
+
1
;
...
...
@@ -251,31 +203,24 @@ G4bool PS_Rectangle::ProcessHits(G4Step* aStep, G4TouchableHistory*) {
// Check if the particle has interact before, if yes, add up the energies.
vector
<
DSSDData
>::
iterator
it
;
// Length
//it = m_HitLength.find(DSSDData::CalculateIndex(t_StripLengthNumber, t_DetectorNumber),t_Time,m_TimeThreshold);
it
=
m_HitLength
.
find
(
DSSDData
::
CalculateIndex
(
t_StripLengthNumber
,
t_DetectorNumber
));
//if(checkInterStrip_x!=0)
//{
/*
if
(
it
!=
m_HitLength
.
end
())
{
it
->
Add
(
t_Energy
);
}
else
*/
m_HitLength
.
Set
(
t_Energy
,
t_Time
,
t_StripLengthNumber
,
t_DetectorNumber
);
{
m_HitLength
.
Set
(
t_Energy
,
t_Time
,
t_StripWidthNumber
,
t_DetectorNumber
);
}
//it = m_HitWidth.find(DSSDData::CalculateIndex(t_StripWidthNumber, t_DetectorNumber),t_Time,m_TimeThreshold);
it
=
m_HitWidth
.
find
(
DSSDData
::
CalculateIndex
(
t_StripWidthNumber
,
t_DetectorNumber
));
//if(checkInterStrip_y!=0)
//{
// Width
//it = m_HitWidth.find(DSSDData::CalculateIndex(t_StripWidthNumber, t_DetectorNumber));
/*
if
(
it
!=
m_HitWidth
.
end
())
{
it
->
Add
(
t_Energy
);
}
else
*/
{
m_HitWidth
.
Set
(
t_Energy
,
t_Time
,
t_StripWidthNumber
,
t_DetectorNumber
);
}
//}
return
TRUE
;
}
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/Scorers/DSSDScorers.hh
+
2
−
8
View file @
98c8cb83
...
...
@@ -87,10 +87,8 @@ namespace DSSDScorers {
vector
<
DSSDData
>
m_Data
;
public
:
//vector<DSSDData>::iterator find(const unsigned int& index, const double& time, const double TimeThreshold);
vector
<
DSSDData
>::
iterator
find
(
const
unsigned
int
&
index
);
//vector<DSSDData>::iterator findTime(const unsigned int& index, const double& time, const double thresh) ;
//const unsigned int& index, const double& time, const double TimeThreshold
inline
void
clear
()
{
m_Data
.
clear
();
};
inline
vector
<
DSSDData
>::
iterator
end
()
{
return
m_Data
.
end
();
};
inline
vector
<
DSSDData
>::
iterator
begin
()
{
return
m_Data
.
begin
();
};
...
...
@@ -169,8 +167,7 @@ namespace DSSDScorers {
public:
// with description
PS_Rectangle
(
G4String
name
,
G4int
Level
,
G4double
StripPlaneLength
,
G4double
StripPlaneWidth
,
G4int
NumberOfStripLength
,
G4int
NumberOfStripWidth
,
G4int
depth
=
0
,
G4String
axis
=
"xy"
,
G4double
TimeThreshold
=
0
,
G4double
InterStripLength
=
0
,
G4double
InterStripWidth
=
0
);
G4int
NumberOfStripLength
,
G4int
NumberOfStripWidth
,
G4int
depth
=
0
,
G4String
axis
=
"xy"
);
~
PS_Rectangle
();
private:
...
...
@@ -194,9 +191,6 @@ namespace DSSDScorers {
unsigned
int
m_NumberOfStripWidth
;
double
m_StripPitchLength
;
double
m_StripPitchWidth
;
double
m_TimeThreshold
;
double
m_InterStripLength
;
double
m_InterStripWidth
;
// Level at which to find the copy number linked to the detector number
int
m_Level
;
...
...
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