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
8580a1c0
Commit
8580a1c0
authored
4 years ago
by
Adrien Matta
Browse files
Options
Downloads
Patches
Plain Diff
* adding Rshift in catana as an option in input file
parent
8e54726d
No related branches found
No related tags found
No related merge requests found
Pipeline
#77438
passed
4 years ago
Stage: build-NPLib
Stage: build-NPSimulation
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NPSimulation/Detectors/Catana/Catana.cc
+8
-6
8 additions, 6 deletions
NPSimulation/Detectors/Catana/Catana.cc
NPSimulation/Detectors/Catana/Catana.hh
+8
-2
8 additions, 2 deletions
NPSimulation/Detectors/Catana/Catana.hh
Projects/Catana/Catana.detector
+1
-0
1 addition, 0 deletions
Projects/Catana/Catana.detector
with
17 additions
and
8 deletions
NPSimulation/Detectors/Catana/Catana.cc
+
8
−
6
View file @
8580a1c0
...
@@ -96,7 +96,7 @@ Catana::~Catana(){
...
@@ -96,7 +96,7 @@ Catana::~Catana(){
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
Catana
::
AddDetector
(
double
X
,
double
Y
,
double
Z
,
double
Theta
,
double
Phi
,
int
ID
,
int
Type
){
void
Catana
::
AddDetector
(
double
X
,
double
Y
,
double
Z
,
double
Theta
,
double
Phi
,
int
ID
,
int
Type
,
double
Rshift
){
m_X
.
push_back
(
X
);
m_X
.
push_back
(
X
);
m_Y
.
push_back
(
Y
);
m_Y
.
push_back
(
Y
);
m_Z
.
push_back
(
Z
);
m_Z
.
push_back
(
Z
);
...
@@ -104,10 +104,11 @@ void Catana::AddDetector(double X,double Y, double Z, double Theta, double Phi,
...
@@ -104,10 +104,11 @@ void Catana::AddDetector(double X,double Y, double Z, double Theta, double Phi,
m_Phi
.
push_back
(
Phi
);
m_Phi
.
push_back
(
Phi
);
m_ID
.
push_back
(
ID
);
m_ID
.
push_back
(
ID
);
m_Type
.
push_back
(
Type
);
m_Type
.
push_back
(
Type
);
m_Rshift
.
push_back
(
Rshift
);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
Catana
::
ReadCSV
(
string
path
){
void
Catana
::
ReadCSV
(
string
path
,
double
Rshift
){
std
::
ifstream
csv
(
path
);
std
::
ifstream
csv
(
path
);
if
(
!
csv
.
is_open
()){
if
(
!
csv
.
is_open
()){
std
::
ostringstream
message
;
std
::
ostringstream
message
;
...
@@ -122,7 +123,7 @@ void Catana::ReadCSV(string path){
...
@@ -122,7 +123,7 @@ void Catana::ReadCSV(string path){
getline
(
csv
,
buffer
);
getline
(
csv
,
buffer
);
while
(
csv
>>
ID
>>
buffer
>>
type
>>
buffer
>>
layer
>>
buffer
>>
X
>>
buffer
>>
Y
>>
buffer
>>
Z
>>
buffer
>>
Theta
>>
buffer
>>
Phi
){
while
(
csv
>>
ID
>>
buffer
>>
type
>>
buffer
>>
layer
>>
buffer
>>
X
>>
buffer
>>
Y
>>
buffer
>>
Z
>>
buffer
>>
Theta
>>
buffer
>>
Phi
){
if
(
type
<
6
)
if
(
type
<
6
)
AddDetector
(
X
,
Y
,
Z
,
Theta
*
deg
,
Phi
*
deg
,
ID
,
type
);
AddDetector
(
X
,
Y
,
Z
,
Theta
*
deg
,
Phi
*
deg
,
ID
,
type
,
Rshift
);
else
{
else
{
// ignore other type for which I don't have the geometry
// ignore other type for which I don't have the geometry
}
}
...
@@ -390,14 +391,15 @@ void Catana::ReadConfiguration(NPL::InputParser parser){
...
@@ -390,14 +391,15 @@ void Catana::ReadConfiguration(NPL::InputParser parser){
if
(
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
())
if
(
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
())
cout
<<
"//// "
<<
blocks
.
size
()
<<
" CSV block found "
<<
endl
;
cout
<<
"//// "
<<
blocks
.
size
()
<<
" CSV block found "
<<
endl
;
vector
<
string
>
token
=
{
"Path"
};
vector
<
string
>
token
=
{
"Path"
,
"Rshift"
};
for
(
unsigned
int
i
=
0
;
i
<
blocks
.
size
()
;
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
blocks
.
size
()
;
i
++
){
if
(
blocks
[
i
]
->
HasTokenList
(
token
)){
if
(
blocks
[
i
]
->
HasTokenList
(
token
)){
if
(
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
())
if
(
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
())
cout
<<
endl
<<
"//// Catana "
<<
i
+
1
<<
endl
;
cout
<<
endl
<<
"//// Catana "
<<
i
+
1
<<
endl
;
string
path
=
blocks
[
i
]
->
GetString
(
"Path"
);
string
path
=
blocks
[
i
]
->
GetString
(
"Path"
);
ReadCSV
(
path
);
double
Rshift
=
blocks
[
i
]
->
GetDouble
(
"Rshift"
,
"micrometer"
);
ReadCSV
(
path
,
Rshift
);
}
}
else
{
else
{
cout
<<
"ERROR: check your input file formatting "
<<
endl
;
cout
<<
"ERROR: check your input file formatting "
<<
endl
;
...
@@ -450,7 +452,7 @@ void Catana::ConstructDetector(G4LogicalVolume* world){
...
@@ -450,7 +452,7 @@ void Catana::ConstructDetector(G4LogicalVolume* world){
Det_dir
.
unit
();
Det_dir
.
unit
();
// had to add a 70micron in radius to avoid overlap when using official
// had to add a 70micron in radius to avoid overlap when using official
// csv simulation file
// csv simulation file
Det_dir
.
setMag
(
m_Zoffset
[
m_Type
[
i
]]
+
0.07
);
Det_dir
.
setMag
(
m_Zoffset
[
m_Type
[
i
]]
+
m_Rshift
[
i
]
);
Det_pos
+=
Det_dir
;
Det_pos
+=
Det_dir
;
G4RotationMatrix
*
Rot
=
new
G4RotationMatrix
();
G4RotationMatrix
*
Rot
=
new
G4RotationMatrix
();
Rot
->
rotateX
(
-
m_Theta
[
i
]);
Rot
->
rotateX
(
-
m_Theta
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/Detectors/Catana/Catana.hh
+
8
−
2
View file @
8580a1c0
...
@@ -52,8 +52,8 @@ class Catana : public NPS::VDetector{
...
@@ -52,8 +52,8 @@ class Catana : public NPS::VDetector{
////////////////////////////////////////////////////
////////////////////////////////////////////////////
public:
public:
// Cartesian
// Cartesian
void
AddDetector
(
double
X
,
double
Y
,
double
Z
,
double
Theta
,
double
Phi
,
int
ID
,
int
Type
);
void
AddDetector
(
double
X
,
double
Y
,
double
Z
,
double
Theta
,
double
Phi
,
int
ID
,
int
Type
,
double
Rshift
=
0
);
void
ReadCSV
(
string
path
);
void
ReadCSV
(
string
path
,
double
Rshift
);
G4LogicalVolume
*
BuildDetector
(
int
Type
);
G4LogicalVolume
*
BuildDetector
(
int
Type
);
...
@@ -109,6 +109,12 @@ class Catana : public NPS::VDetector{
...
@@ -109,6 +109,12 @@ class Catana : public NPS::VDetector{
vector
<
double
>
m_Phi
;
vector
<
double
>
m_Phi
;
vector
<
int
>
m_ID
;
vector
<
int
>
m_ID
;
vector
<
int
>
m_Type
;
vector
<
int
>
m_Type
;
// this parameter is here because some csv file have very small overlap
// due to difference between mechanical design and reality of the detector
// a shift is apply to the position of the crystal to slightly icrease the radius
// and avoid shift. Typical value shoulde be < 100um
vector
<
double
>
m_Rshift
;
// additional shift to apply to csv file
// relative shift of crystal w/r to the housing
map
<
int
,
double
>
m_Zoffset
;
map
<
int
,
double
>
m_Zoffset
;
// Visualisation Attribute
// Visualisation Attribute
...
...
This diff is collapsed.
Click to expand it.
Projects/Catana/Catana.detector
+
1
−
0
View file @
8580a1c0
...
@@ -11,6 +11,7 @@ Target
...
@@ -11,6 +11,7 @@ Target
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Catana CSV
Catana CSV
Path= Catana.csv
Path= Catana.csv
Rshift= 70 micrometer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Catana Detector
%Catana Detector
...
...
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