Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
np
nptool
Commits
cf0dcf9c
Commit
cf0dcf9c
authored
Jun 11, 2021
by
Pierre Morfouace
Browse files
Updating SofTofW Physics analysis
parent
013ced64
Pipeline
#123742
passed with stages
in 8 minutes and 27 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
135 additions
and
33 deletions
+135
-33
NPLib/Detectors/Sofia/TSofSciPhysics.cxx
NPLib/Detectors/Sofia/TSofSciPhysics.cxx
+1
-1
NPLib/Detectors/Sofia/TSofTofWPhysics.cxx
NPLib/Detectors/Sofia/TSofTofWPhysics.cxx
+100
-18
NPLib/Detectors/Sofia/TSofTofWPhysics.h
NPLib/Detectors/Sofia/TSofTofWPhysics.h
+16
-5
Projects/s455/Analysis.cxx
Projects/s455/Analysis.cxx
+12
-4
Projects/s455/calibration.txt
Projects/s455/calibration.txt
+2
-0
Projects/s455/s455.detector
Projects/s455/s455.detector
+4
-5
No files found.
NPLib/Detectors/Sofia/TSofSciPhysics.cxx
View file @
cf0dcf9c
...
@@ -235,7 +235,7 @@ double TSofSciPhysics::CalculateTimeNs(int det, int pmt, int ft, int ct){
...
@@ -235,7 +235,7 @@ double TSofSciPhysics::CalculateTimeNs(int det, int pmt, int ft, int ct){
double
par
=
Cal
->
GetValue
(
"SofSci/DET"
+
NPL
::
itoa
(
det
)
+
"_SIGNAL"
+
NPL
::
itoa
(
pmt
)
+
"_TIME"
,
ft
);
double
par
=
Cal
->
GetValue
(
"SofSci/DET"
+
NPL
::
itoa
(
det
)
+
"_SIGNAL"
+
NPL
::
itoa
(
pmt
)
+
"_TIME"
,
ft
);
double
r
=
(
double
)
rand
.
Rndm
()
-
0.5
;
double
r
=
(
double
)
rand
.
Rndm
()
-
0.5
;
double
ClockOffset
=
Cal
->
GetValue
(
"SofSci/DET"
+
NPL
::
itoa
(
det
)
+
"_SIGNAL"
+
NPL
::
itoa
(
pmt
)
+
"_CLOCKOFFSET"
,
0
);
double
ClockOffset
=
Cal
->
GetValue
(
"SofSci/DET"
+
NPL
::
itoa
(
det
)
+
"_SIGNAL"
+
NPL
::
itoa
(
pmt
)
+
"_CLOCKOFFSET"
,
0
);
double
ict_ns
=
((
double
)
ct
-
ClockOffset
)
*
5.
;
// to do... take care of the clock offset
double
ict_ns
=
((
double
)
ct
-
ClockOffset
)
*
5.
;
double
ift_ns
;
double
ift_ns
;
if
(
r
<
0
){
if
(
r
<
0
){
...
...
NPLib/Detectors/Sofia/TSofTofWPhysics.cxx
View file @
cf0dcf9c
...
@@ -49,6 +49,9 @@ TSofTofWPhysics::TSofTofWPhysics()
...
@@ -49,6 +49,9 @@ TSofTofWPhysics::TSofTofWPhysics()
m_EventPhysics
(
this
),
m_EventPhysics
(
this
),
m_E_RAW_Threshold
(
0
),
// adc channels
m_E_RAW_Threshold
(
0
),
// adc channels
m_E_Threshold
(
0
),
// MeV
m_E_Threshold
(
0
),
// MeV
m_NumberOfPlastics
(
28
),
m_StartTime
(
-
1
),
m_TofAlignedValue
(
0
),
// ns
m_NumberOfDetectors
(
0
)
{
m_NumberOfDetectors
(
0
)
{
}
}
...
@@ -79,14 +82,88 @@ void TSofTofWPhysics::BuildSimplePhysicalEvent() {
...
@@ -79,14 +82,88 @@ void TSofTofWPhysics::BuildSimplePhysicalEvent() {
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
void
TSofTofWPhysics
::
BuildPhysicalEvent
()
{
void
TSofTofWPhysics
::
BuildPhysicalEvent
()
{
// apply thresholds and calibration
// apply thresholds and calibration
if
(
m_StartTime
==
-
1
)
return
;
PreTreat
();
PreTreat
();
// match energy and time together
double
T1
[
28
][
10
],
T2
[
28
][
10
];
int
mult1
[
28
],
mult2
[
28
];
for
(
int
i
=
0
;
i
<
28
;
i
++
){
mult1
[
i
]
=
0
;
mult2
[
i
]
=
0
;
for
(
int
j
=
0
;
j
<
10
;
j
++
){
T1
[
i
][
j
]
=
0
;
T2
[
i
][
j
]
=
0
;
}
}
unsigned
int
mysizeE
=
m_PreTreatedData
->
GetMultiplicity
();
unsigned
int
mysizeE
=
m_PreTreatedData
->
GetMultiplicity
();
for
(
UShort_t
e
=
0
;
e
<
mysizeE
;
e
++
)
{
for
(
UShort_t
i
=
0
;
i
<
mysizeE
;
i
++
)
{
PlasticNumber
.
push_back
(
m_PreTreatedData
->
GetPlasticNbr
(
e
));
int
plastic
=
m_PreTreatedData
->
GetPlasticNbr
(
i
);
Energy
.
push_back
(
m_PreTreatedData
->
GetEnergy
(
e
));
int
pmt
=
m_PreTreatedData
->
GetPmt
(
i
);
int
FT
=
m_PreTreatedData
->
GetFineTime
(
i
);
int
CT
=
m_PreTreatedData
->
GetCoarseTime
(
i
);
double
T
=
CalculateTimeNs
(
plastic
,
pmt
,
FT
,
CT
);
if
(
pmt
==
1
){
T1
[
plastic
-
1
][
mult1
[
plastic
-
1
]]
=
T
;
mult1
[
plastic
-
1
]
++
;
}
else
if
(
pmt
==
2
){
T2
[
plastic
-
1
][
mult2
[
plastic
-
1
]]
=
T
;
mult2
[
plastic
-
1
]
++
;
}
}
static
CalibrationManager
*
Cal
=
CalibrationManager
::
getInstance
();
for
(
int
p
=
0
;
p
<
m_NumberOfPlastics
;
p
++
){
if
(
mult1
[
p
]
==
1
&&
mult2
[
p
]
==
1
){
for
(
int
i
=
0
;
i
<
mult1
[
p
];
i
++
){
for
(
int
j
=
0
;
j
<
mult2
[
p
];
j
++
){
double
time_ns
=
0.5
*
(
T1
[
p
][
i
]
+
T2
[
p
][
j
]);
double
rawpos
=
T1
[
p
][
i
]
-
T2
[
p
][
j
];
double
calpos
=
Cal
->
ApplyCalibration
(
"SofTofW/TOFW"
+
NPL
::
itoa
(
p
+
1
)
+
"_POSPAR"
,
rawpos
);
double
rawtof
=
time_ns
-
m_StartTime
;
double
caltof
=
Cal
->
ApplyCalibration
(
"SofTofW/TOFW"
+
NPL
::
itoa
(
p
+
1
)
+
"_TOFPAR"
,
rawtof
)
+
m_TofAlignedValue
;
PlasticNbr
.
push_back
(
p
+
1
);
TimeNs
.
push_back
(
time_ns
);
RawPosY
.
push_back
(
rawpos
);
CalPosY
.
push_back
(
calpos
);
RawTof
.
push_back
(
rawtof
);
CalTof
.
push_back
(
caltof
);
}
}
}
}
}
m_StartTime
=
-
1
;
}
///////////////////////////////////////////////////////////////////////////
double
TSofTofWPhysics
::
CalculateTimeNs
(
int
det
,
int
pmt
,
int
ft
,
int
ct
){
static
CalibrationManager
*
Cal
=
CalibrationManager
::
getInstance
();
double
par
=
Cal
->
GetValue
(
"SofTofW/TOFW"
+
NPL
::
itoa
(
det
)
+
"_PMT"
+
NPL
::
itoa
(
pmt
)
+
"_TIME"
,
ft
);
double
r
=
(
double
)
rand
.
Rndm
()
-
0.5
;
double
ClockOffset
=
Cal
->
GetValue
(
"SofTofW/TOFW"
+
NPL
::
itoa
(
det
)
+
"_PMT"
+
NPL
::
itoa
(
pmt
)
+
"_CLOCKOFFSET"
,
0
);
double
ict_ns
=
((
double
)
ct
-
ClockOffset
)
*
5.
;
double
ift_ns
;
if
(
r
<
0
){
double
par_prev
=
Cal
->
GetValue
(
"SofTofW/TOFW"
+
NPL
::
itoa
(
det
)
+
"_PMT"
+
NPL
::
itoa
(
pmt
)
+
"_TIME"
,
ft
-
1
);
ift_ns
=
par
+
r
*
(
par
-
par_prev
);
}
else
{
double
par_next
=
Cal
->
GetValue
(
"SofSci/TOFW"
+
NPL
::
itoa
(
det
)
+
"_PMT"
+
NPL
::
itoa
(
pmt
)
+
"_TIME"
,
ft
+
1
);
ift_ns
=
par
+
r
*
(
par_next
-
par
);
}
double
time_ns
=
(
double
)
ict_ns
-
ift_ns
;
return
time_ns
;
}
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
...
@@ -103,13 +180,11 @@ void TSofTofWPhysics::PreTreat() {
...
@@ -103,13 +180,11 @@ void TSofTofWPhysics::PreTreat() {
// Energy
// Energy
unsigned
int
mysize
=
m_EventData
->
GetMultiplicity
();
unsigned
int
mysize
=
m_EventData
->
GetMultiplicity
();
for
(
UShort_t
i
=
0
;
i
<
mysize
;
++
i
)
{
for
(
UShort_t
i
=
0
;
i
<
mysize
;
++
i
)
{
if
(
m_EventData
->
GetEnergy
(
i
)
>
m_E_RAW_Threshold
)
{
m_PreTreatedData
->
SetPlasticNbr
(
m_EventData
->
GetPlasticNbr
(
i
));
Double_t
Energy
=
Cal
->
ApplyCalibration
(
"SofTofW/ENERGY"
+
NPL
::
itoa
(
m_EventData
->
GetPlasticNbr
(
i
)),
m_EventData
->
GetEnergy
(
i
));
m_PreTreatedData
->
SetPmt
(
m_EventData
->
GetPmt
(
i
));
if
(
Energy
>
m_E_Threshold
)
{
m_PreTreatedData
->
SetCoarseTime
(
m_EventData
->
GetCoarseTime
(
i
));
m_PreTreatedData
->
SetPlasticNbr
(
m_EventData
->
GetPlasticNbr
(
i
));
m_PreTreatedData
->
SetFineTime
(
m_EventData
->
GetFineTime
(
i
));
m_PreTreatedData
->
SetEnergy
(
Energy
);
m_PreTreatedData
->
SetWhichFlag
(
m_EventData
->
GetWhichFlag
(
i
));
}
}
}
}
}
}
...
@@ -181,10 +256,12 @@ void TSofTofWPhysics::ReadAnalysisConfig() {
...
@@ -181,10 +256,12 @@ void TSofTofWPhysics::ReadAnalysisConfig() {
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
void
TSofTofWPhysics
::
Clear
()
{
void
TSofTofWPhysics
::
Clear
()
{
PlasticNumber
.
clear
();
PlasticNbr
.
clear
();
Energy
.
clear
();
TimeNs
.
clear
();
Time
.
clear
();
RawPosY
.
clear
();
PosY
.
clear
();
CalPosY
.
clear
();
RawTof
.
clear
();
CalTof
.
clear
();
}
}
...
@@ -225,9 +302,14 @@ void TSofTofWPhysics::ReadConfiguration(NPL::InputParser parser) {
...
@@ -225,9 +302,14 @@ void TSofTofWPhysics::ReadConfiguration(NPL::InputParser parser) {
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
void
TSofTofWPhysics
::
AddParameterToCalibrationManager
()
{
void
TSofTofWPhysics
::
AddParameterToCalibrationManager
()
{
CalibrationManager
*
Cal
=
CalibrationManager
::
getInstance
();
CalibrationManager
*
Cal
=
CalibrationManager
::
getInstance
();
for
(
int
i
=
0
;
i
<
m_NumberOfDetectors
;
++
i
)
{
for
(
int
i
=
0
;
i
<
m_NumberOfPlastics
;
++
i
)
{
Cal
->
AddParameter
(
"SofTofW"
,
"D"
+
NPL
::
itoa
(
i
+
1
)
+
"_ENERGY"
,
"SofTofW_D"
+
NPL
::
itoa
(
i
+
1
)
+
"_ENERGY"
);
Cal
->
AddParameter
(
"SofTofW"
,
"TOFW"
+
NPL
::
itoa
(
i
+
1
)
+
"_POSPAR"
,
"SofTofW_TOFW"
+
NPL
::
itoa
(
i
+
1
)
+
"_POSPAR"
);
Cal
->
AddParameter
(
"SofTofW"
,
"D"
+
NPL
::
itoa
(
i
+
1
)
+
"_TIME"
,
"SofTofW_D"
+
NPL
::
itoa
(
i
+
1
)
+
"_TIME"
);
Cal
->
AddParameter
(
"SofTofW"
,
"TOFW"
+
NPL
::
itoa
(
i
+
1
)
+
"_TOFPAR"
,
"SofTofW_TOFW"
+
NPL
::
itoa
(
i
+
1
)
+
"_TOFPAR"
);
for
(
int
j
=
0
;
j
<
2
;
j
++
){
Cal
->
AddParameter
(
"SofTofW"
,
"TOFW"
+
NPL
::
itoa
(
i
+
1
)
+
"_PMT"
+
NPL
::
itoa
(
j
+
1
)
+
"_TIME"
,
"SofTofW_TOFW"
+
NPL
::
itoa
(
i
+
1
)
+
"_PMT"
+
NPL
::
itoa
(
j
+
1
)
+
"_TIME"
);
Cal
->
AddParameter
(
"SofTofW"
,
"TOFW"
+
NPL
::
itoa
(
i
+
1
)
+
"_PMT"
+
NPL
::
itoa
(
j
+
1
)
+
"_CLOCKOFFSET"
,
"SofTofW_TOFW"
+
NPL
::
itoa
(
i
+
1
)
+
"_PMT"
+
NPL
::
itoa
(
j
+
1
)
+
"_CLOCKOFFSET"
);
}
}
}
}
}
...
...
NPLib/Detectors/Sofia/TSofTofWPhysics.h
View file @
cf0dcf9c
...
@@ -32,6 +32,7 @@ using namespace std;
...
@@ -32,6 +32,7 @@ using namespace std;
#include "TObject.h"
#include "TObject.h"
#include "TH1.h"
#include "TH1.h"
#include "TVector3.h"
#include "TVector3.h"
#include "TRandom3.h"
// NPTool headers
// NPTool headers
#include "TSofTofWData.h"
#include "TSofTofWData.h"
#include "NPCalibrationManager.h"
#include "NPCalibrationManager.h"
...
@@ -59,10 +60,12 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
...
@@ -59,10 +60,12 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
// data obtained after BuildPhysicalEvent() and stored in
// data obtained after BuildPhysicalEvent() and stored in
// output ROOT file
// output ROOT file
public:
public:
vector
<
int
>
PlasticNumber
;
vector
<
int
>
PlasticNbr
;
vector
<
double
>
Energy
;
vector
<
double
>
TimeNs
;
vector
<
double
>
Time
;
vector
<
double
>
RawPosY
;
vector
<
double
>
PosY
;
vector
<
double
>
CalPosY
;
vector
<
double
>
RawTof
;
vector
<
double
>
CalTof
;
/// A usefull method to bundle all operation to add a detector
/// A usefull method to bundle all operation to add a detector
void
AddDetector
(
TVector3
POS
);
void
AddDetector
(
TVector3
POS
);
...
@@ -105,6 +108,11 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
...
@@ -105,6 +108,11 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
void
ClearEventPhysics
()
{
Clear
();}
void
ClearEventPhysics
()
{
Clear
();}
void
ClearEventData
()
{
m_EventData
->
Clear
();}
void
ClearEventData
()
{
m_EventData
->
Clear
();}
double
CalculateTimeNs
(
int
,
int
,
int
,
int
);
double
GetStartTime
()
{
return
m_StartTime
;}
double
GetTofAlignedValue
()
{
return
m_TofAlignedValue
;}
void
SetStartTime
(
double
val
)
{
m_StartTime
=
val
;}
void
SetTofAlignedValue
(
double
val
)
{
m_TofAlignedValue
=
val
;}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
// specific methods to SofTofW array
// specific methods to SofTofW array
...
@@ -135,10 +143,13 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
...
@@ -135,10 +143,13 @@ class TSofTofWPhysics : public TObject, public NPL::VDetector {
// parameters used in the analysis
// parameters used in the analysis
private:
private:
// thresholds
double
m_StartTime
;
//!
double
m_TofAlignedValue
;
//!
int
m_NumberOfPlastics
;
//!
double
m_E_RAW_Threshold
;
//!
double
m_E_RAW_Threshold
;
//!
double
m_E_Threshold
;
//!
double
m_E_Threshold
;
//!
TRandom3
rand
;
//!
// number of detectors
// number of detectors
private:
private:
int
m_NumberOfDetectors
;
//!
int
m_NumberOfDetectors
;
//!
...
...
Projects/s455/Analysis.cxx
View file @
cf0dcf9c
...
@@ -40,7 +40,7 @@ void Analysis::Init(){
...
@@ -40,7 +40,7 @@ void Analysis::Init(){
SofSci
=
(
TSofSciPhysics
*
)
m_DetectorManager
->
GetDetector
(
"SofSci"
);
SofSci
=
(
TSofSciPhysics
*
)
m_DetectorManager
->
GetDetector
(
"SofSci"
);
SofTrim
=
(
TSofTrimPhysics
*
)
m_DetectorManager
->
GetDetector
(
"SofTrim"
);
SofTrim
=
(
TSofTrimPhysics
*
)
m_DetectorManager
->
GetDetector
(
"SofTrim"
);
SofTwim
=
(
TSofTwimPhysics
*
)
m_DetectorManager
->
GetDetector
(
"SofTwim"
);
SofTwim
=
(
TSofTwimPhysics
*
)
m_DetectorManager
->
GetDetector
(
"SofTwim"
);
//
SofTofW= (TSofTofWPhysics*) m_DetectorManager->GetDetector("SofTofW");
SofTofW
=
(
TSofTofWPhysics
*
)
m_DetectorManager
->
GetDetector
(
"SofTofW"
);
InitParameter
();
InitParameter
();
InitOutputBranch
();
InitOutputBranch
();
...
@@ -54,7 +54,13 @@ void Analysis::TreatEvent(){
...
@@ -54,7 +54,13 @@ void Analysis::TreatEvent(){
ReInitValue
();
ReInitValue
();
//cout << "************" << endl;
//cout << "************" << endl;
BeamAnalysis
();
BeamAnalysis
();
unsigned
int
sofsci_size
=
SofSci
->
DetectorNbr
.
size
();
if
(
sofsci_size
==
2
){
double
start_time
=
SofSci
->
TimeNs
[
1
];
SofTofW
->
SetTofAlignedValue
(
36
);
SofTofW
->
SetStartTime
(
start_time
);
SofTofW
->
BuildPhysicalEvent
();
}
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
...
@@ -165,8 +171,10 @@ void Analysis::End(){
...
@@ -165,8 +171,10 @@ void Analysis::End(){
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
void
Analysis
::
InitParameter
(){
void
Analysis
::
InitParameter
(){
fLS2_0
=
136.3706933
;
fLS2_0
=
136.3706933
;
fDS2
=
9500
;
//fDS2 = 9500;
fDCC
=
-
30000
;
fDS2
=
10000
;
//fDCC = -30000;
fDCC
=
-
40000
;
fK_LS2
=
-
2.5e-8
;
fK_LS2
=
-
2.5e-8
;
fBrho0
=
10.8183
;
// run401 -> 182Hg
fBrho0
=
10.8183
;
// run401 -> 182Hg
...
...
Projects/s455/calibration.txt
View file @
cf0dcf9c
...
@@ -14,6 +14,8 @@ CalibrationFilePath
...
@@ -14,6 +14,8 @@ CalibrationFilePath
./calibration/SofSci/SofSci_physics.cal
./calibration/SofSci/SofSci_physics.cal
./calibration/SofTwim/SofTwim_Energy.cal
./calibration/SofTwim/SofTwim_Energy.cal
./calibration/SofTwim/SofTwim_Time.cal
./calibration/SofTwim/SofTwim_Time.cal
./calibration/SofTofW/ClockOffset.cal
./calibration/SofTofW/SofTofW_physics.cal
./calibration/SofTofW/VFTX_TOFW1_PMT1.cal
./calibration/SofTofW/VFTX_TOFW1_PMT1.cal
./calibration/SofTofW/VFTX_TOFW2_PMT1.cal
./calibration/SofTofW/VFTX_TOFW2_PMT1.cal
./calibration/SofTofW/VFTX_TOFW3_PMT1.cal
./calibration/SofTofW/VFTX_TOFW3_PMT1.cal
...
...
Projects/s455/s455.detector
View file @
cf0dcf9c
...
@@ -20,10 +20,9 @@ SofTrim
...
@@ -20,10 +20,9 @@ SofTrim
SofTwim
SofTwim
POS= 0 0 2 m
POS= 0 0 2 m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SofTofW
%SofTofW
R= 8 m
% R= 8 m
THETA= -9.5 deg
% THETA= -9.5 deg
PHI= 0 deg
% PHI= 0 deg
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment