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
Open sidebar
Guillaume Baulieu
agapro
Commits
a1667455
Commit
a1667455
authored
Apr 11, 2019
by
Jérémie Dudouet
Browse files
Merge branch 'preprod' into 'master'
Preprod See merge request IPNL_GAMMA/narval_emulator!50
parents
70ab6aab
cf28cd7b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
99 deletions
+107
-99
consumers/Histogramer/AGAPRO_HistoDefs.h
consumers/Histogramer/AGAPRO_HistoDefs.h
+2
-2
consumers/Histogramer/AGAPRO_Histogramer.h
consumers/Histogramer/AGAPRO_Histogramer.h
+9
-9
consumers/Histogramer/PreproHist/AGAPRO_PreproHist.cpp
consumers/Histogramer/PreproHist/AGAPRO_PreproHist.cpp
+91
-86
consumers/Histogramer/PreproHist/AGAPRO_PreproHist.h
consumers/Histogramer/PreproHist/AGAPRO_PreproHist.h
+5
-2
No files found.
consumers/Histogramer/AGAPRO_HistoDefs.h
View file @
a1667455
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
#define N_TH1HISTS_PROD 420
#define N_TH1HISTS_PROD 420
#define N_TH2HISTS_PROD 0
#define N_TH2HISTS_PROD 0
//38*ERaw + 38*Baseline + 38*T0 +
2
*timestamps + 1*DeltaT
//38*ERaw + 38*Baseline + 38*T0 +
4
*timestamps + 1*DeltaT
#define N_TH1HISTS_PREP 11
7
#define N_TH1HISTS_PREP 11
9
//1*EvsId
//1*EvsId
#define N_TH2HISTS_PREP 1
#define N_TH2HISTS_PREP 1
...
...
consumers/Histogramer/AGAPRO_Histogramer.h
View file @
a1667455
...
@@ -37,18 +37,18 @@ using namespace std;
...
@@ -37,18 +37,18 @@ using namespace std;
namespace
AGAPRO
{
namespace
AGAPRO
{
struct
binning_TH1
{
struct
binning_TH1
{
Int_t
NBins
;
Int_t
NBins
=
0
;
Float_t
Min
;
Float_t
Min
=
0.
;
Float_t
Max
;
Float_t
Max
=
0.
;
};
};
struct
binning_TH2
{
struct
binning_TH2
{
Int_t
NBinsX
;
Int_t
NBinsX
=
0
;
Float_t
XMin
;
Float_t
XMin
=
0.
;
Float_t
XMax
;
Float_t
XMax
=
0.
;
Int_t
NBinsY
;
Int_t
NBinsY
=
0
;
Float_t
YMin
;
Float_t
YMin
=
0.
;
Float_t
YMax
;
Float_t
YMax
=
0.
;
};
};
class
Histogramer
:
public
ADF
::
NarvalConsumer
class
Histogramer
:
public
ADF
::
NarvalConsumer
...
...
consumers/Histogramer/PreproHist/AGAPRO_PreproHist.cpp
View file @
a1667455
...
@@ -68,9 +68,11 @@ PreproHist::PreproHist() :
...
@@ -68,9 +68,11 @@ PreproHist::PreproHist() :
vector
<
void
*
>
TimeStampList
;
vector
<
void
*
>
TimeStampList
;
fListOfHists
.
push_back
(
TimeStampList
);
fListOfHists
.
push_back
(
TimeStampList
);
vector
<
void
*
>
GatedRatesList
;
fListOfHists
.
push_back
(
GatedRatesList
);
fNextCycleSec
=
3600.
;
fNextCycleSec
=
3600.
;
fNextCycleMin
=
720.
;
fNextCycleMin
=
720.
;
fNextCycleH
=
48.
;
fTraceLengthPSA
=
defTraceLengthPSA
;
fTraceLengthPSA
=
defTraceLengthPSA
;
...
@@ -81,7 +83,6 @@ PreproHist::PreproHist() :
...
@@ -81,7 +83,6 @@ PreproHist::PreproHist() :
PreproHist
::~
PreproHist
()
PreproHist
::~
PreproHist
()
{
{
cServer
.
Finish
();
cServer
.
Finish
();
for
(
int
nn
=
0
;
nn
<
kNSG
;
nn
++
)
{
for
(
int
nn
=
0
;
nn
<
kNSG
;
nn
++
)
{
if
(
fTracesSG
[
nn
])
if
(
fTracesSG
[
nn
])
delete
[]
fTracesSG
[
nn
];
delete
[]
fTracesSG
[
nn
];
...
@@ -90,7 +91,6 @@ PreproHist::~PreproHist()
...
@@ -90,7 +91,6 @@ PreproHist::~PreproHist()
if
(
fTracesCC
[
nn
])
if
(
fTracesCC
[
nn
])
delete
[]
fTracesCC
[
nn
];
delete
[]
fTracesCC
[
nn
];
}
}
// in principle not needed ... just in case reset it has not been called by narval
// in principle not needed ... just in case reset it has not been called by narval
UInt_t
error
=
0u
;
process_reset
(
&
error
)
;
UInt_t
error
=
0u
;
process_reset
(
&
error
)
;
}
}
...
@@ -103,29 +103,24 @@ UInt_t PreproHist::Process()
...
@@ -103,29 +103,24 @@ UInt_t PreproHist::Process()
Log
.
SetPID
(
GetPID
());
Log
.
SetPID
(
GetPID
());
vector
<
void
*
>
Amplilist
=
fListOfHists
[(
Int_t
)
HistLib
::
Ampli
];
vector
<
void
*
>
Amplilist
=
fListOfHists
[(
Int_t
)
HistLib
::
Ampli
];
if
(
fPlotAmpli
&&
Amplilist
.
size
()
==
(
kNSG
+
kNCC
))
if
(
fPlotAmpli
&&
Amplilist
.
size
()
==
(
kNSG
+
kNCC
))
{
{
for
(
int
nn
=
0
;
nn
<
kNSG
;
nn
++
)
{
for
(
int
nn
=
0
;
nn
<
kNSG
;
nn
++
)
{
if
(
SegE
[
nn
]
<
1
)
if
(
SegE
[
nn
]
<
1
)
continue
;
continue
;
auto
hist
=
(
Hist1F
*
)
Amplilist
[
nn
];
auto
hist
=
(
Hist1F
*
)
Amplilist
[
nn
];
FillHist1F
(
hist
,
SegE
[
nn
]);
FillHist1F
(
hist
,
SegE
[
nn
]);
if
(
fPlotAmplivsId
&&
fListOfHists
[(
Int_t
)
HistLib
::
Ampli_vs_Id
].
size
()
==
1
)
if
(
fPlotAmplivsId
&&
fListOfHists
[(
Int_t
)
HistLib
::
Ampli_vs_Id
].
size
()
==
1
)
{
{
auto
hist2d
=
(
Hist2F
*
)
fListOfHists
[(
Int_t
)
HistLib
::
Ampli_vs_Id
][
0
];
auto
hist2d
=
(
Hist2F
*
)
fListOfHists
[(
Int_t
)
HistLib
::
Ampli_vs_Id
][
0
];
FillHist2F
(
hist2d
,
SegE
[
nn
],
nn
);
FillHist2F
(
hist2d
,
SegE
[
nn
],
nn
);
}
}
}
}
for
(
int
nn
=
0
;
nn
<
kNCC
;
nn
++
)
for
(
int
nn
=
0
;
nn
<
kNCC
;
nn
++
)
{
{
auto
hist
=
(
Hist1F
*
)
Amplilist
[
kNSG
+
nn
];
auto
hist
=
(
Hist1F
*
)
Amplilist
[
kNSG
+
nn
];
FillHist1F
(
hist
,
CoreE
[
nn
]);
FillHist1F
(
hist
,
CoreE
[
nn
]);
if
(
fPlotAmplivsId
&&
fListOfHists
[(
Int_t
)
HistLib
::
Ampli_vs_Id
].
size
()
==
1
)
if
(
fPlotAmplivsId
&&
fListOfHists
[(
Int_t
)
HistLib
::
Ampli_vs_Id
].
size
()
==
1
)
{
{
auto
hist2d
=
(
Hist2F
*
)
fListOfHists
[(
Int_t
)
HistLib
::
Ampli_vs_Id
][
0
];
auto
hist2d
=
(
Hist2F
*
)
fListOfHists
[(
Int_t
)
HistLib
::
Ampli_vs_Id
][
0
];
FillHist2F
(
hist2d
,
CoreE
[
nn
],
kNSG
+
nn
);
FillHist2F
(
hist2d
,
CoreE
[
nn
],
kNSG
+
nn
);
}
}
...
@@ -133,12 +128,10 @@ UInt_t PreproHist::Process()
...
@@ -133,12 +128,10 @@ UInt_t PreproHist::Process()
}
}
vector
<
void
*
>
Baselinelist
=
fListOfHists
[(
Int_t
)
HistLib
::
Baseline
];
vector
<
void
*
>
Baselinelist
=
fListOfHists
[(
Int_t
)
HistLib
::
Baseline
];
if
(
fPlotBaseline
&&
Baselinelist
.
size
()
==
(
kNSG
+
kNCC
))
if
(
fPlotBaseline
&&
Baselinelist
.
size
()
==
(
kNSG
+
kNCC
))
{
{
int
baseLen
=
(
fTraceLengthPSA
+
4
)
/
5
;
int
baseLen
=
(
fTraceLengthPSA
+
4
)
/
5
;
baseLen
=
max
(
1
,
baseLen
);
baseLen
=
max
(
1
,
baseLen
);
for
(
int
nn
=
0
;
nn
<
kNSG
;
nn
++
)
for
(
int
nn
=
0
;
nn
<
kNSG
;
nn
++
)
{
{
Float_t
baseVal
=
0
;
Float_t
baseVal
=
0
;
Float_t
*
pW
=
fTracesSG
[
nn
];
Float_t
*
pW
=
fTracesSG
[
nn
];
for
(
int
ii
=
0
;
ii
<
baseLen
;
ii
++
)
for
(
int
ii
=
0
;
ii
<
baseLen
;
ii
++
)
...
@@ -149,8 +142,7 @@ UInt_t PreproHist::Process()
...
@@ -149,8 +142,7 @@ UInt_t PreproHist::Process()
auto
hist
=
(
Hist1F
*
)
Baselinelist
[
nn
];
auto
hist
=
(
Hist1F
*
)
Baselinelist
[
nn
];
FillHist1F
(
hist
,
SegBase
[
nn
]);
FillHist1F
(
hist
,
SegBase
[
nn
]);
}
}
for
(
int
nn
=
0
;
nn
<
kNCC
;
nn
++
)
for
(
int
nn
=
0
;
nn
<
kNCC
;
nn
++
)
{
{
Float_t
baseVal
=
0
;
Float_t
baseVal
=
0
;
Float_t
*
pW
=
fTracesCC
[
nn
];
Float_t
*
pW
=
fTracesCC
[
nn
];
for
(
int
ii
=
0
;
ii
<
baseLen
;
ii
++
)
for
(
int
ii
=
0
;
ii
<
baseLen
;
ii
++
)
...
@@ -164,14 +156,11 @@ UInt_t PreproHist::Process()
...
@@ -164,14 +156,11 @@ UInt_t PreproHist::Process()
}
}
vector
<
void
*
>
T0list
=
fListOfHists
[(
Int_t
)
HistLib
::
T0
];
vector
<
void
*
>
T0list
=
fListOfHists
[(
Int_t
)
HistLib
::
T0
];
if
(
fPlotT0
&&
T0list
.
size
()
==
(
kNSG
+
kNCC
))
if
(
fPlotT0
&&
T0list
.
size
()
==
(
kNSG
+
kNCC
))
{
{
vector
<
void
*
>
T0list
=
fListOfHists
[(
Int_t
)
HistLib
::
T0
];
vector
<
void
*
>
T0list
=
fListOfHists
[(
Int_t
)
HistLib
::
T0
];
int
T0
=
CalcT0
();
int
T0
=
CalcT0
();
if
(
T0
>
0
)
{
if
(
T0
>
0
)
{
auto
hist
=
(
Hist1F
*
)
T0list
[
netChargeSegs
[
0
]];
auto
hist
=
(
Hist1F
*
)
T0list
[
netChargeSegs
[
0
]];
FillHist1F
(
hist
,
T0
);
// relative time placed at the center of spectrum
FillHist1F
(
hist
,
T0
);
// relative time placed at the center of spectrum
...
@@ -184,43 +173,57 @@ UInt_t PreproHist::Process()
...
@@ -184,43 +173,57 @@ UInt_t PreproHist::Process()
}
}
vector
<
void
*
>
DeltaTlist
=
fListOfHists
[(
Int_t
)
HistLib
::
DeltaT
];
vector
<
void
*
>
DeltaTlist
=
fListOfHists
[(
Int_t
)
HistLib
::
DeltaT
];
if
(
fPlotDeltaT
&&
DeltaTlist
.
size
()
==
1
&&
fLastTS
!=
0
)
if
(
fPlotDeltaT
&&
DeltaTlist
.
size
()
==
1
&&
fLastTS
!=
0
)
{
{
auto
hist
=
(
Hist1F
*
)
DeltaTlist
[
0
];
auto
hist
=
(
Hist1F
*
)
DeltaTlist
[
0
];
FillHist1F
(
hist
,
timestamp
-
fLastTS
);
FillHist1F
(
hist
,
timestamp
-
fLastTS
);
}
}
vector
<
void
*
>
TSlist
=
fListOfHists
[(
Int_t
)
HistLib
::
TimeStamps
];
vector
<
void
*
>
TSlist
=
fListOfHists
[(
Int_t
)
HistLib
::
TimeStamps
];
if
(
fPlotTimeStamps
&&
TSlist
.
size
()
==
2
)
vector
<
void
*
>
TSGatedlist
=
fListOfHists
[(
Int_t
)
HistLib
::
GatedRates
];
{
if
(
fFirstTS
==
0
)
if
(
(
fPlotTimeStamps
&&
TSlist
.
size
()
==
2
)
||
(
fPlotGatedRates
&&
TSGatedlist
.
size
()
==
2
))
{
{
if
(
fFirstTS
==
0
)
{
fFirstTS
=
timestamp
;
fFirstTS
=
timestamp
;
}
}
if
(
timestamp
!=
0
&&
timestamp
>
fLastTS
)
{
auto
hists
=
(
Hist1F
*
)
TSlist
[
0
];
auto
histm
=
(
Hist1F
*
)
TSlist
[
1
];
Hist1F
*
hists
=
nullptr
;
Hist1F
*
histm
=
nullptr
;
Hist1F
*
hists_gated
=
nullptr
;
Hist1F
*
histm_gated
=
nullptr
;
if
(
fPlotTimeStamps
)
{
hists
=
(
Hist1F
*
)
TSlist
[
0
];
histm
=
(
Hist1F
*
)
TSlist
[
1
];
}
if
(
fPlotGatedRates
)
{
hists_gated
=
(
Hist1F
*
)
TSGatedlist
[
0
];
histm_gated
=
(
Hist1F
*
)
TSGatedlist
[
1
];
}
if
(
timestamp
!=
0
&&
timestamp
>
fLastTS
)
{
double
TSinSec
=
fmod
((
timestamp
-
fFirstTS
)
*
10
*
1e-9
,
3600
);
double
TSinSec
=
fmod
((
timestamp
-
fFirstTS
)
*
10
*
1e-9
,
3600
);
double
TSinMin
=
fmod
((
timestamp
-
fFirstTS
)
*
10
*
1e-9
/
60.
,
720
);
double
TSinMin
=
fmod
((
timestamp
-
fFirstTS
)
*
10
*
1e-9
/
60.
,
720
);
if
((
timestamp
-
fFirstTS
)
*
10
*
1e-9
>
fNextCycleSec
)
if
((
timestamp
-
fFirstTS
)
*
10
*
1e-9
>
fNextCycleSec
)
{
{
if
(
hists
)
ResetHist1F
(
hists
);
ResetHist1F
(
hists
);
if
(
hists_gated
)
ResetHist1F
(
hists
_gated
);
fNextCycleSec
+=
3600.
;
fNextCycleSec
+=
3600.
;
}
}
if
((
timestamp
-
fFirstTS
)
*
10
*
1e-9
/
60.
>
fNextCycleMin
)
if
((
timestamp
-
fFirstTS
)
*
10
*
1e-9
/
60.
>
fNextCycleMin
)
{
{
if
(
histm
)
ResetHist1F
(
histm
);
ResetHist1F
(
histm
);
if
(
histm_gated
)
ResetHist1F
(
histm
_gated
);
fNextCycleMin
+=
720.
;
fNextCycleMin
+=
720.
;
}
}
if
(
fPlotTimeStamps
)
{
FillHist1F
(
hists
,
TSinSec
,(
3600.
/
3600.
));
FillHist1F
(
hists
,
TSinSec
,(
3600.
/
3600.
));
FillHist1F
(
histm
,
TSinMin
,(
3600.
/
720.
)
/
60.
);
FillHist1F
(
histm
,
TSinMin
,(
3600.
/
720.
)
/
60.
);
}
}
else
if
(
fPlotGatedRates
&&
abs
(
CoreE
[
0
]
-
fGatedRateEnergy
)
<
fGatedRateWidth
)
{
{
FillHist1F
(
hists_gated
,
TSinSec
,(
3600.
/
3600.
));
FillHist1F
(
histm_gated
,
TSinMin
,(
3600.
/
720.
)
/
60.
);
}
}
else
{
Log
.
SetLevel
(
LogMessage
::
kWarning
);
Log
.
SetLevel
(
LogMessage
::
kWarning
);
Log
<<
"First TS : "
<<
fFirstTS
<<
" ; Last TS : "
<<
fLastTS
<<
" ; TS : "
<<
timestamp
<<
dolog
;
Log
<<
"First TS : "
<<
fFirstTS
<<
" ; Last TS : "
<<
fLastTS
<<
" ; TS : "
<<
timestamp
<<
dolog
;
}
}
...
@@ -237,14 +240,13 @@ void PreproHist::process_initialise (UInt_t *error_code)
...
@@ -237,14 +240,13 @@ void PreproHist::process_initialise (UInt_t *error_code)
Log
.
SetPID
(
GetPID
());
Log
.
SetPID
(
GetPID
());
*
error_code
=
GetParameters
(
GetConfPath
()
+
gActualClass
+
".conf"
);
*
error_code
=
GetParameters
(
GetConfPath
()
+
gActualClass
+
".conf"
);
if
(
*
error_code
)
if
(
*
error_code
)
{
{
Log
<<
dolog
;
Log
<<
dolog
;
return
;
return
;
}
}
// to get the input/output frames
// to get the input/output frames
if
(
fFrameCrystal
){
if
(
fFrameCrystal
)
{
delete
fFrameCrystal
;
delete
fFrameCrystal
;
fFrameCrystal
=
NULL
;
fFrameCrystal
=
NULL
;
}
}
...
@@ -253,8 +255,7 @@ void PreproHist::process_initialise (UInt_t *error_code)
...
@@ -253,8 +255,7 @@ void PreproHist::process_initialise (UInt_t *error_code)
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
fFrameCrystal
=
fTrigger
.
Add
(
"Agata"
,
"data:ccrystal"
);
// discard input data
fFrameCrystal
=
fTrigger
.
Add
(
"Agata"
,
"data:ccrystal"
);
// discard input data
if
(
!
fFrameCrystal
)
if
(
!
fFrameCrystal
)
{
{
rerr
|=
8
;
rerr
|=
8
;
}
}
...
@@ -262,8 +263,7 @@ void PreproHist::process_initialise (UInt_t *error_code)
...
@@ -262,8 +263,7 @@ void PreproHist::process_initialise (UInt_t *error_code)
if
(
!
fFrameIO
.
Register
(
&
fTrigger
)
)
if
(
!
fFrameIO
.
Register
(
&
fTrigger
)
)
rerr
|=
1
;
rerr
|=
1
;
if
(
rerr
)
if
(
rerr
)
{
{
std
::
cout
<<
"Trigger definition error "
<<
rerr
<<
" in PreproHist::process_initialise()"
<<
std
::
endl
;
std
::
cout
<<
"Trigger definition error "
<<
rerr
<<
" in PreproHist::process_initialise()"
<<
std
::
endl
;
*
error_code
=
100
+
rerr
;
*
error_code
=
100
+
rerr
;
Log
<<
dolog
;
Log
<<
dolog
;
...
@@ -279,9 +279,7 @@ void PreproHist::process_initialise (UInt_t *error_code)
...
@@ -279,9 +279,7 @@ void PreproHist::process_initialise (UInt_t *error_code)
// state set to kIdle so that the data can be treated
// state set to kIdle so that the data can be treated
fFrameIO
.
SetStatus
(
BaseFrameIO
::
kIdle
);
fFrameIO
.
SetStatus
(
BaseFrameIO
::
kIdle
);
cServer
.
SetCommandFile
(
GetConfPath
()
+
gActualClass
+
".live"
);
cServer
.
SetCommandFile
(
GetConfPath
()
+
gActualClass
+
".live"
);
cServer
.
Start
(
gActualClass
);
cServer
.
Start
(
gActualClass
);
InitSMZ
(
crystal_id
);
InitSMZ
(
crystal_id
);
...
@@ -292,7 +290,6 @@ void PreproHist::process_initialise (UInt_t *error_code)
...
@@ -292,7 +290,6 @@ void PreproHist::process_initialise (UInt_t *error_code)
Int_t
PreproHist
::
SetInput
()
Int_t
PreproHist
::
SetInput
()
{
{
Frame
*
frame_in
=
fFrameCrystal
->
GetFrame
();
Frame
*
frame_in
=
fFrameCrystal
->
GetFrame
();
CrystalInterface
*
cdata
=
GetDataPointer
<
CrystalInterface
>
(
frame_in
);
CrystalInterface
*
cdata
=
GetDataPointer
<
CrystalInterface
>
(
frame_in
);
// loads the values from the frame into the ADFObject attached to the frame
// loads the values from the frame into the ADFObject attached to the frame
...
@@ -301,16 +298,14 @@ Int_t PreproHist::SetInput()
...
@@ -301,16 +298,14 @@ Int_t PreproHist::SetInput()
// get the real length from the data (assuming all traces have the same length)
// get the real length from the data (assuming all traces have the same length)
fTraceLengthPSA
=
cdata
->
GetCore
(
0
)
->
GetSignal
()
->
GetLength
();
fTraceLengthPSA
=
cdata
->
GetCore
(
0
)
->
GetSignal
()
->
GetLength
();
for
(
int
iseg
=
0
;
iseg
<
kNSG
;
iseg
++
)
for
(
int
iseg
=
0
;
iseg
<
kNSG
;
iseg
++
)
{
{
seg
=
cdata
->
GetSegment
(
iseg
);
seg
=
cdata
->
GetSegment
(
iseg
);
SegE
[
iseg
]
=
(
Float_t
)
seg
->
GetE
();
SegE
[
iseg
]
=
(
Float_t
)
seg
->
GetE
();
seg
->
GetSignal
()
->
Get
(
fTracesSG
[
iseg
],
fTraceLengthPSA
);
seg
->
GetSignal
()
->
Get
(
fTracesSG
[
iseg
],
fTraceLengthPSA
);
}
}
for
(
UShort_t
icc
=
0
;
icc
<
kNCC
;
icc
++
)
for
(
UShort_t
icc
=
0
;
icc
<
kNCC
;
icc
++
)
{
{
core
=
cdata
->
GetCore
(
icc
);
core
=
cdata
->
GetCore
(
icc
);
CoreE
[
icc
]
=
(
Float_t
)
core
->
GetE
();
CoreE
[
icc
]
=
(
Float_t
)
core
->
GetE
();
core
->
GetSignal
()
->
Get
(
fTracesCC
[
icc
],
fTraceLengthPSA
);
core
->
GetSignal
()
->
Get
(
fTracesCC
[
icc
],
fTraceLengthPSA
);
...
@@ -342,6 +337,8 @@ UInt_t PreproHist::GetParameters(const std::string& confFile, Bool_t doList)
...
@@ -342,6 +337,8 @@ UInt_t PreproHist::GetParameters(const std::string& confFile, Bool_t doList)
,
&
fDeltaTBinning
.
NBins
,
&
fDeltaTBinning
.
Min
,
&
fDeltaTBinning
.
Max
);
,
&
fDeltaTBinning
.
NBins
,
&
fDeltaTBinning
.
Min
,
&
fDeltaTBinning
.
Max
);
conf
.
Add
(
"PlotTimeStamps"
,
"Plot Timestamp spectra, optionnal: define the ref T0 TimeStamp (1 TSRef)"
conf
.
Add
(
"PlotTimeStamps"
,
"Plot Timestamp spectra, optionnal: define the ref T0 TimeStamp (1 TSRef)"
,
&
fPlotTimeStamps
,
&
fFirstTS
).
SetRequired
(
1
);
,
&
fPlotTimeStamps
,
&
fFirstTS
).
SetRequired
(
1
);
conf
.
Add
(
"PlotGatedRates"
,
"Plot Rates gated on the specified energy and width"
,
&
fGatedRateEnergy
,
&
fGatedRateWidth
);
if
(
doList
)
{
conf
.
Show
(
gActualClass
);
return
0
;}
if
(
doList
)
{
conf
.
Show
(
gActualClass
);
return
0
;}
...
@@ -354,6 +351,7 @@ UInt_t PreproHist::GetParameters(const std::string& confFile, Bool_t doList)
...
@@ -354,6 +351,7 @@ UInt_t PreproHist::GetParameters(const std::string& confFile, Bool_t doList)
if
(
fBaselineBinning
.
NBins
>
0
)
fPlotBaseline
=
true
;
if
(
fBaselineBinning
.
NBins
>
0
)
fPlotBaseline
=
true
;
if
(
fT0Binning
.
NBins
>
0
)
fPlotT0
=
true
;
if
(
fT0Binning
.
NBins
>
0
)
fPlotT0
=
true
;
if
(
fDeltaTBinning
.
NBins
>
0
)
fPlotDeltaT
=
true
;
if
(
fDeltaTBinning
.
NBins
>
0
)
fPlotDeltaT
=
true
;
if
(
fGatedRateEnergy
>
0.
)
fPlotGatedRates
=
true
;
// To randomize the refresh time among the different crystals
// To randomize the refresh time among the different crystals
fRefreshTime
=
fRefreshTime
-
0.5
+
((
double
)
rand
()
/
(
RAND_MAX
));
fRefreshTime
=
fRefreshTime
-
0.5
+
((
double
)
rand
()
/
(
RAND_MAX
));
...
@@ -382,12 +380,10 @@ void PreproHist::InitSMZ(Int_t id)
...
@@ -382,12 +380,10 @@ void PreproHist::InitSMZ(Int_t id)
map_ptr
=
static_cast
<
PrepMap
*>
(
CreateNewSMz
(
mapname
.
str
().
data
(),
sizeof
(
PrepMap
),
PortNumber
));
map_ptr
=
static_cast
<
PrepMap
*>
(
CreateNewSMz
(
mapname
.
str
().
data
(),
sizeof
(
PrepMap
),
PortNumber
));
if
(
fPlotAmpli
)
if
(
fPlotAmpli
)
{
{
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
Ampli
];
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
Ampli
];
for
(
auto
i
=
0
;
i
<
kNSG
;
i
++
)
for
(
auto
i
=
0
;
i
<
kNSG
;
i
++
)
{
{
Name
<<
"Prepro_Ampli_Cry"
<<
id
<<
"_Seg"
<<
i
;
Name
<<
"Prepro_Ampli_Cry"
<<
id
<<
"_Seg"
<<
i
;
Title
<<
"Prepro_Ampli_Cry"
<<
CrystalName
.
data
()
<<
"_Seg"
<<
GetSegmentNameFromID
(
i
).
data
();
Title
<<
"Prepro_Ampli_Cry"
<<
CrystalName
.
data
()
<<
"_Seg"
<<
GetSegmentNameFromID
(
i
).
data
();
XTitle
<<
"Energy (keV)"
;
XTitle
<<
"Energy (keV)"
;
...
@@ -397,8 +393,7 @@ void PreproHist::InitSMZ(Int_t id)
...
@@ -397,8 +393,7 @@ void PreproHist::InitSMZ(Int_t id)
Name
.
str
(
""
);
Title
.
str
(
""
);
XTitle
.
str
(
""
);
GruName
.
str
(
""
);
Name
.
str
(
""
);
Title
.
str
(
""
);
XTitle
.
str
(
""
);
GruName
.
str
(
""
);
if
(
hist1F
)
list
.
push_back
(
hist1F
);
if
(
hist1F
)
list
.
push_back
(
hist1F
);
}
}
for
(
auto
i
=
0
;
i
<
kNCC
;
i
++
)
for
(
auto
i
=
0
;
i
<
kNCC
;
i
++
)
{
{
Name
<<
"Prepro_Ampli_Cry"
<<
id
<<
"_Core"
<<
i
;
Name
<<
"Prepro_Ampli_Cry"
<<
id
<<
"_Core"
<<
i
;
Title
<<
"Prepro_Ampli_Cry"
<<
CrystalName
.
data
()
<<
"_"
<<
GetCoreNameFromID
(
i
).
data
();
Title
<<
"Prepro_Ampli_Cry"
<<
CrystalName
.
data
()
<<
"_"
<<
GetCoreNameFromID
(
i
).
data
();
XTitle
<<
"Energy (keV)"
;
XTitle
<<
"Energy (keV)"
;
...
@@ -430,8 +425,7 @@ void PreproHist::InitSMZ(Int_t id)
...
@@ -430,8 +425,7 @@ void PreproHist::InitSMZ(Int_t id)
{
{
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
Baseline
];
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
Baseline
];
for
(
auto
i
=
0
;
i
<
kNSG
;
i
++
)
for
(
auto
i
=
0
;
i
<
kNSG
;
i
++
)
{
{
Name
<<
"Prepro_Baseline_Cry"
<<
id
<<
"_Seg"
<<
i
;
Name
<<
"Prepro_Baseline_Cry"
<<
id
<<
"_Seg"
<<
i
;
Title
<<
"Prepro_Baseline_Cry"
<<
CrystalName
.
data
()
<<
"_Seg"
<<
GetSegmentNameFromID
(
i
).
data
();
Title
<<
"Prepro_Baseline_Cry"
<<
CrystalName
.
data
()
<<
"_Seg"
<<
GetSegmentNameFromID
(
i
).
data
();
XTitle
<<
"Corrected Amplitude"
;
XTitle
<<
"Corrected Amplitude"
;
...
@@ -441,8 +435,7 @@ void PreproHist::InitSMZ(Int_t id)
...
@@ -441,8 +435,7 @@ void PreproHist::InitSMZ(Int_t id)
Name
.
str
(
""
);
Title
.
str
(
""
);
XTitle
.
str
(
""
);
GruName
.
str
(
""
);
Name
.
str
(
""
);
Title
.
str
(
""
);
XTitle
.
str
(
""
);
GruName
.
str
(
""
);
if
(
hist1F
)
list
.
push_back
(
hist1F
);
if
(
hist1F
)
list
.
push_back
(
hist1F
);
}
}
for
(
auto
i
=
0
;
i
<
kNCC
;
i
++
)
for
(
auto
i
=
0
;
i
<
kNCC
;
i
++
)
{
{
Name
<<
"Prepro_Baseline_Cry"
<<
id
<<
"_Core"
<<
i
;
Name
<<
"Prepro_Baseline_Cry"
<<
id
<<
"_Core"
<<
i
;
Title
<<
"Prepro_Baseline_Cry"
<<
CrystalName
.
data
()
<<
"_"
<<
GetCoreNameFromID
(
i
).
data
();
Title
<<
"Prepro_Baseline_Cry"
<<
CrystalName
.
data
()
<<
"_"
<<
GetCoreNameFromID
(
i
).
data
();
XTitle
<<
"Corrected Amplitude"
;
XTitle
<<
"Corrected Amplitude"
;
...
@@ -457,8 +450,7 @@ void PreproHist::InitSMZ(Int_t id)
...
@@ -457,8 +450,7 @@ void PreproHist::InitSMZ(Int_t id)
{
{
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
T0
];
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
T0
];
for
(
auto
i
=
0
;
i
<
kNSG
;
i
++
)
for
(
auto
i
=
0
;
i
<
kNSG
;
i
++
)
{
{
Name
<<
"Prepro_T0_Cry"
<<
id
<<
"_Seg"
<<
i
;
Name
<<
"Prepro_T0_Cry"
<<
id
<<
"_Seg"
<<
i
;
Title
<<
"Prepro_T0_Cry"
<<
CrystalName
.
data
()
<<
"_Seg"
<<
GetSegmentNameFromID
(
i
).
data
();
Title
<<
"Prepro_T0_Cry"
<<
CrystalName
.
data
()
<<
"_Seg"
<<
GetSegmentNameFromID
(
i
).
data
();
XTitle
<<
"relative time compared to Core0"
;
XTitle
<<
"relative time compared to Core0"
;
...
@@ -471,13 +463,11 @@ void PreproHist::InitSMZ(Int_t id)
...
@@ -471,13 +463,11 @@ void PreproHist::InitSMZ(Int_t id)
for
(
auto
i
=
0
;
i
<
kNCC
;
i
++
)
for
(
auto
i
=
0
;
i
<
kNCC
;
i
++
)
{
{
Name
<<
"Prepro_T0_Cry"
<<
id
<<
"_Core"
<<
i
;
Name
<<
"Prepro_T0_Cry"
<<
id
<<
"_Core"
<<
i
;
if
(
i
==
0
)
if
(
i
==
0
)
{
{
Title
<<
"Prepro_T0_Cry"
<<
CrystalName
.
data
()
<<
"_AllSegs"
;
Title
<<
"Prepro_T0_Cry"
<<
CrystalName
.
data
()
<<
"_AllSegs"
;
XTitle
<<
"relative time compared to Core0 for all segments"
;
XTitle
<<
"relative time compared to Core0 for all segments"
;
}
}
else
else
{
{
Title
<<
"Prepro_T0_Cry"
<<
CrystalName
.
data
()
<<
"_"
<<
GetCoreNameFromID
(
i
).
data
();
Title
<<
"Prepro_T0_Cry"
<<
CrystalName
.
data
()
<<
"_"
<<
GetCoreNameFromID
(
i
).
data
();
XTitle
<<
"relative time of Core1 compared to Core0"
;
XTitle
<<
"relative time of Core1 compared to Core0"
;
}
}
...
@@ -489,21 +479,19 @@ void PreproHist::InitSMZ(Int_t id)
...
@@ -489,21 +479,19 @@ void PreproHist::InitSMZ(Int_t id)
if
(
hist1F
)
list
.
push_back
(
hist1F
);
if
(
hist1F
)
list
.
push_back
(
hist1F
);
}
}
}
}
if
(
fPlotDeltaT
)
if
(
fPlotDeltaT
)
{
{
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
DeltaT
];
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
DeltaT
];
Name
<<
"Prepro_DeltaT_Cry"
<<
id
;
Name
<<
"Prepro_DeltaT_Cry"
<<
id
;
Title
<<
"Prepro_DeltaT_Cry"
<<
CrystalName
.
data
();
Title
<<
"Prepro_DeltaT_Cry"
<<
CrystalName
.
data
();
XTitle
<<
"
#
DeltaT (in ts units) between two successive events"
;
XTitle
<<
"DeltaT (in ts units) between two successive events"
;
GruName
<<
"Prepro/DeltaT/Cry"
<<
CrystalName
.
data
();
GruName
<<
"Prepro/DeltaT/Cry"
<<
CrystalName
.
data
();
Hist1F
*
hist1F
=
NewHist1F
(
Name
.
str
(),
Title
.
str
(),
XTitle
.
str
(),
GruName
.
str
(),
fDeltaTBinning
.
NBins
,
fDeltaTBinning
.
Min
,
fDeltaTBinning
.
Max
,
map_ptr
,
PortNumber
);
Hist1F
*
hist1F
=
NewHist1F
(
Name
.
str
(),
Title
.
str
(),
XTitle
.
str
(),
GruName
.
str
(),
fDeltaTBinning
.
NBins
,
fDeltaTBinning
.
Min
,
fDeltaTBinning
.
Max
,
map_ptr
,
PortNumber
);
Name
.
str
(
""
);
Title
.
str
(
""
);
XTitle
.
str
(
""
);
GruName
.
str
(
""
);
Name
.
str
(
""
);
Title
.
str
(
""
);
XTitle
.
str
(
""
);
GruName
.
str
(
""
);
if
(
hist1F
)
list
.
push_back
(
hist1F
);
if
(
hist1F
)
list
.
push_back
(
hist1F
);
}
}
if
(
fPlotTimeStamps
)
if
(
fPlotTimeStamps
)
{
{
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
TimeStamps
];
vector
<
void
*>&
list
=
fListOfHists
[(
Int_t
)
HistLib
::
TimeStamps
];
Name
<<
"Prepro_TimeStamp_Cry"
<<
id
<<
"_1h"
;
Name
<<
"Prepro_TimeStamp_Cry"
<<
id
<<
"_1h"
;
...
@@ -520,8 +508,28 @@ void PreproHist::InitSMZ(Int_t id)
...
@@ -520,8 +508,28 @@ void PreproHist::InitSMZ(Int_t id)
XTitle
<<
"Elapsed time on the last 12 hour (min)"
;
XTitle
<<
"Elapsed time on the last 12 hour (min)"
;
hist1F
=
NewHist1F
(
Name
.
str
(),
Title
.
str
(),
XTitle
.
str
(),
GruName
.
str
(),
3600
,
0
,
720
,
map_ptr
,
PortNumber
);
hist1F
=
NewHist1F
(
Name
.
str
(),
Title
.
str
(),
XTitle
.
str
(),
GruName
.
str
(),
3600
,
0
,
720
,
map_ptr
,
PortNumber
);
Name
.
str
(
""
);
Title
.
str
(
""
);
XTitle
.
str
(
""
);
GruName
.
str
(
""
);
if
(
hist1F
)
list
.
push_back
(
hist1F
);
}