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
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
np
nptool
Commits
df633594
Commit
df633594
authored
9 years ago
by
adrien-matta
Browse files
Options
Downloads
Patches
Plain Diff
* Fixing error in S1 position calculation
parent
cb535d9d
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
NPLib/Detectors/AnnularS1/TAnnularS1Physics.cxx
+8
-9
8 additions, 9 deletions
NPLib/Detectors/AnnularS1/TAnnularS1Physics.cxx
Projects/S1554/macro/MgCS2.cxx
+15
-9
15 additions, 9 deletions
Projects/S1554/macro/MgCS2.cxx
with
23 additions
and
18 deletions
NPLib/Detectors/AnnularS1/TAnnularS1Physics.cxx
+
8
−
9
View file @
df633594
...
...
@@ -490,16 +490,16 @@ void TAnnularS1Physics::InitializeRootOutput(){
///// Specific to AnnularS1Array ////
void
TAnnularS1Physics
::
AddDetector
(
double
Z
){
double
R_Min
=
2
3
;
double
R_Max
=
50
;
double
R_Min
=
2
4
;
double
R_Max
=
48
;
double
Phi_Min
=
0
;
double
Phi_Max
=
360
;
int
Ring_NumberOfStrip
=
16
;
int
Ring_NumberOfQuadrant
=
4
;
int
Sector_NumberOfStrip
=
16
;
int
Ring_NumberOfQuadrant
=
4
;
double
StripPitchSector
=
(
Phi_Max
-
Phi_Min
)
/
Sector_NumberOfStrip
;
//radial strip spacing in rad
double
StripPitchRing
=
(
R_Max
-
R_Min
)
/
Ring_NumberOfStrip
;
// ring strip spacing in mm
...
...
@@ -516,17 +516,16 @@ void TAnnularS1Physics::AddDetector(double Z){
vector
<
vector
<
double
>
>
OneStripPositionZ
;
TVector3
StripCenter
=
Strip_1_1
;
for
(
int
f
=
0
;
f
<
Ring_NumberOf
Strip
;
f
++
){
for
(
int
q
=
0
;
q
<
Ring_NumberOf
Quadrant
;
q
++
){
for
(
int
q
=
0
;
q
<
Ring_NumberOf
Quadrant
;
q
++
){
for
(
int
f
=
0
;
f
<
Ring_NumberOf
Strip
;
f
++
){
lineX
.
clear
()
;
lineY
.
clear
()
;
lineZ
.
clear
()
;
for
(
int
b
=
0
;
b
<
Sector_NumberOfStrip
;
b
++
){
StripCenter
=
Strip_1_1
;
StripCenter
.
SetY
(
R_Min
+
f
*
StripPitchRing
);
StripCenter
.
SetZ
(
Z
);
StripCenter
.
RotateZ
(
Phi_Min
+
b
*
StripPitchSector
);
StripCenter
=
TVector3
(
0
,
R_Min
+
f
*
StripPitchRing
+
StripPitchRing
*
0.5
,
Z
);
StripCenter
.
RotateZ
((
Phi_Min
+
b
*
StripPitchSector
+
StripPitchSector
*
0.5
));
lineX
.
push_back
(
StripCenter
.
X
()
);
lineY
.
push_back
(
StripCenter
.
Y
()
);
lineZ
.
push_back
(
StripCenter
.
Z
()
);
...
...
This diff is collapsed.
Click to expand it.
Projects/S1554/macro/MgCS2.cxx
+
15
−
9
View file @
df633594
...
...
@@ -2,7 +2,7 @@ void Scale(TGraph* g , TGraphErrors* ex);
TGraph
*
TWOFNR
(
double
E
,
double
J0
,
double
J
,
double
n
,
double
l
,
double
j
);
TH1
*
Region
(
double
Emin
,
double
Emax
,
TH2
*
h
,
TCanvas
*
c
,
int
pad
,
TH2
*
Eff
);
double
ToMininize
(
const
double
*
parameter
);
TGraph
*
FindNormalisation
(
TGraph
*
cs1
,
TGraph
*
cs2
,
TH1
*
hexp
);
TGraph
*
FindNormalisation
(
TGraph
*
cs1
,
TGraph
*
cs2
,
TH1
*
hexp
,
double
&
s1
,
double
&
s2
);
TGraph
*
g1
;
TGraph
*
g2
;
...
...
@@ -45,34 +45,37 @@ void MgCS2(){
c
->
Divide
(
2
,
2
);
// Region
double
s1
,
s2
;
current
=
Region
(
-
0.1
,
0.4
,
h
,
c
,
nn
++
,
Eff
);
g1
=
TWOFNR
(
0.000
,
0
,
0.5
,
1
,
0
,
0.5
);
g2
=
TWOFNR
(
0.054
,
0
,
1.5
,
0
,
2
,
1.5
);
g1
->
SetLineStyle
(
2
);
g1
->
Draw
(
"c"
);
g2
->
SetLineStyle
(
3
);
g2
->
Draw
(
"c"
);
FindNormalisation
(
g1
,
g2
,
current
)
->
Draw
(
"c"
);
FindNormalisation
(
g1
,
g2
,
current
,
s1
,
s2
)
->
Draw
(
"c"
);
double
s3
,
s4
;
current
=
Region
(
0.6
,
1.8
,
h
,
c
,
nn
++
,
Eff
);
g1
=
TWOFNR
(
1.095
,
0
,
1.5
,
1
,
1
,
1.5
);
g2
=
TWOFNR
(
1.431
,
0
,
3.5
,
0
,
3
,
3.5
);
g1
->
SetLineStyle
(
2
);
g1
->
Draw
(
"c"
);
g2
->
SetLineStyle
(
3
);
g2
->
Draw
(
"c"
);
FindNormalisation
(
g1
,
g2
,
current
)
->
Draw
(
"c"
);
FindNormalisation
(
g1
,
g2
,
current
,
s3
,
s4
)
->
Draw
(
"c"
);
double
s5
,
s6
;
current
=
Region
(
2
,
3
,
h
,
c
,
nn
++
,
Eff
);
g1
=
TWOFNR
(
2.266
,
0
,
0.5
,
1
,
1
,
0.5
);
g2
=
TWOFNR
(
2.500
,
0
,
1.5
,
0
,
2
,
1.5
);
g1
->
SetLineStyle
(
2
);
g1
->
Draw
(
"c"
);
g2
->
SetLineStyle
(
3
);
g2
->
Draw
(
"c"
);
FindNormalisation
(
g1
,
g2
,
current
)
->
Draw
(
"c"
);
FindNormalisation
(
g1
,
g2
,
current
,
s5
,
s6
)
->
Draw
(
"c"
);
double
s7
,
s8
;
current
=
Region
(
3
,
4.8
,
h
,
c
,
nn
++
,
Eff
);
g1
=
TWOFNR
(
3.2
,
0
,
2.5
,
0
,
2
,
2.5
);
g2
=
TWOFNR
(
3.2
,
0
,
3.5
,
0
,
3
,
3.5
);
g1
->
SetLineStyle
(
2
);
g1
->
Draw
(
"c"
);
g2
->
SetLineStyle
(
3
);
g2
->
Draw
(
"c"
);
FindNormalisation
(
g1
,
g2
,
current
)
->
Draw
(
"c"
);
FindNormalisation
(
g1
,
g2
,
current
,
s7
,
s8
)
->
Draw
(
"c"
);
}
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -190,7 +193,7 @@ TGraph* TWOFNR(double E, double J0, double J, double n, double l, double j){
}
////////////////////////////////////////////////////////////////////////////////
TGraph
*
FindNormalisation
(
TGraph
*
cs1
,
TGraph
*
cs2
,
TH1
*
hexp
){
TGraph
*
FindNormalisation
(
TGraph
*
cs1
,
TGraph
*
cs2
,
TH1
*
hexp
,
double
&
s1
,
double
&
s2
){
// Set global variable
g1
=
cs1
;
g2
=
cs2
;
...
...
@@ -233,6 +236,9 @@ TGraph* FindNormalisation(TGraph* cs1, TGraph* cs2, TH1* hexp){
for
(
int
i
=
0
;
i
<
cs1
->
GetN
()
;
i
++
){
g
->
SetPoint
(
g
->
GetN
(),
X
[
i
],
xs
[
0
]
*
Y
[
i
]
+
xs
[
1
]
*
cs2
->
Eval
(
X
[
i
])
);
}
s1
=
xs
[
0
];
s2
=
xs
[
1
];
return
g
;
}
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