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
Guillaume Baulieu
agapro
Commits
14bcfb9e
Commit
14bcfb9e
authored
Apr 02, 2020
by
Jérémie Dudouet
Browse files
Add a parameter to activate or not the dump of the bases
parent
a1638a54
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
35 deletions
+23
-35
filters/PSA/PSAFilter.cpp
filters/PSA/PSAFilter.cpp
+2
-0
filters/PSA/PSAFilter.h
filters/PSA/PSAFilter.h
+2
-0
filters/PSA/PSAFilterGridSearch.cpp
filters/PSA/PSAFilterGridSearch.cpp
+16
-21
filters/PSA/includePSA/SignalBasis.cpp
filters/PSA/includePSA/SignalBasis.cpp
+1
-12
filters/PSA/includePSA/SignalBasis.h
filters/PSA/includePSA/SignalBasis.h
+2
-2
No files found.
filters/PSA/PSAFilter.cpp
View file @
14bcfb9e
...
...
@@ -261,6 +261,8 @@ UInt_t PSAFilter::GetParameters(const std::string& confFile, Bool_t doList)
,
&
fUseMultiHist
);
conf
.
Add
(
"Verbose"
,
"verbosity of printouts"
,
&
fVerbose
);
conf
.
Add
(
"DumpADLBase"
,
"Dump a binary file contaning the corrected bases (after preampli treatment etc.)"
,
&
gDumpADLBase
);
AlgoParameters
(
conf
);
// daughter class can add further commands
...
...
filters/PSA/PSAFilter.h
View file @
14bcfb9e
...
...
@@ -265,6 +265,8 @@ protected:
Bool_t
GenerateSlots
();
Bool_t
gDumpADLBase
=
false
;
public:
static
std
::
string
gMotherClass
;
// Static string containing the name of the base class
static
std
::
string
gActualClass
;
// Static string to choose daughter class at run time
...
...
filters/PSA/PSAFilterGridSearch.cpp
View file @
14bcfb9e
...
...
@@ -471,7 +471,7 @@ int PSAFilterGridSearch::MakeSignalBasis()
return
rval
;
// error
//WriteBasisVoxels();
WriteBasisFull
(
"_raw"
);
// The complete basis as a <short> spectrum. 2 mm packed. Normalization is 30000.
if
(
gDumpADLBase
)
WriteBasisFull
(
"_raw"
);
// The complete basis as a <short> spectrum. 2 mm packed. Normalization is 30000.
WriteBasisSegAverage
(
1000.
f
/
MAXNORM
,
"aver_raw"
);
// Read and apply x-talk corrections
...
...
@@ -499,7 +499,7 @@ int PSAFilterGridSearch::MakeSignalBasis()
fBasis
.
CalculateSumOfSignals
();
//Write basis and various other
WriteBasisFull
(
""
);
// The complete basis as a <short> spectrum. 2 mm packed. Normalization is 30000.
if
(
gDumpADLBase
)
WriteBasisFull
(
""
);
// The complete basis as a <short> spectrum. 2 mm packed. Normalization is 30000.
//WriteBasisSegments(0, 5); // The complete basis of the given segments [first,last] as a <float> spectrum. Normalization is 1000.
//WriteBasisSegSum(); // 3D distribution sum of segment signals (2 mm packed)
//WriteBasisSlopes(); // 3D distribution of net-charge SG, CC and NC+CC signal slopes
...
...
@@ -2788,11 +2788,10 @@ bool PSAFilterGridSearch::WriteBasisFull(const std::string& ext)
const
int
detRadius
=
40
;
const
int
detLength
=
90
;
const
int
numTraces
=
NCHAN
;
//cout<<"laaaaaaaaaaaaa"<<endl;
//cout<<fineStep<<" "<<numTraces<<endl;
ofstream
OutputFile
(
fOdirPrefix
+
"PSA_BaseXYZ"
+
ext
+
".dat"
);
SignalBasis
::
Newbbhit_t
trace
;
ofstream
ADLBase_OutputFile
;
if
(
gDumpADLBase
)
ADLBase_OutputFile
.
open
(
fOdirPrefix
+
"PSA_BaseXYZ"
+
ext
+
".dat"
);
SignalBasis
::
ADLDump_bbhit_t
trace
;
MultiHist
<
short
>
*
baseXYZ
=
new
MultiHist
<
short
>
((
2
*
detRadius
)
/
fineStep
,
(
2
*
detRadius
)
/
fineStep
,
detLength
/
fineStep
,
numTraces
,
BSIZE
);
baseXYZ
->
setFileName
(
fOdirPrefix
+
"Psa?BaseXYZ.spec"
+
ext
);
...
...
@@ -2801,18 +2800,17 @@ bool PSAFilterGridSearch::WriteBasisFull(const std::string& ext)
float
fact
=
30000.
f
/
MAXNORM
;
for
(
int
ns
=
0
;
ns
<
NSEGS
;
ns
++
)
{
for
(
int
np
=
0
;
np
<
fBasis
.
numPts
[
ns
];
np
++
)
{
//cout<<fBasis.numPts[ns]<<endl;
pointPsa
*
bpt
=
&
fBasis
.
segPts
[
ns
][
np
];
memcpy
(
bb
,
bpt
->
amplitude
,
sizeof
(
bb
));
if
(
gDumpADLBase
)
{
trace
.
SegTrig
=
ns
;
trace
.
Pos
[
0
]
=
bpt
->
x
;
trace
.
Pos
[
1
]
=
bpt
->
y
;
trace
.
Pos
[
2
]
=
bpt
->
z
;
memcpy
(
trace
.
Tr
,
bb
,
sizeof
(
trace
.
Tr
));
OutputFile
.
write
((
char
*
)
&
trace
,
sizeof
(
trace
));
ADLBase_OutputFile
.
write
((
char
*
)
&
trace
,
sizeof
(
trace
));
}
// copy exactly as is
//for(int ii = 0; ii < BSIZE; ii++) {
...
...
@@ -2829,18 +2827,15 @@ bool PSAFilterGridSearch::WriteBasisFull(const std::string& ext)
short
*
pd
=
baseXYZ
->
getData
(
ix
,
iy
,
iz
,
0
);
if
(
pd
)
{
for
(
int
is
=
0
;
is
<
numTraces
;
is
++
)
{
//if(ns==1) cout<<endl;
for
(
int
it
=
0
;
it
<
BSIZE
;
it
++
)
{
*
pd
++
=
short
(
bb
[
is
][
it
]
*
fact
);
//if(ns==1) cout<<"iseg: "<<ns<<" - seg: "<<is<<" "<<it<<" "<<bb[is][it]<<" "<<bpt->x<<" "<<bpt->y<<" "<<bpt->z<<endl;
}
}
}
//if(ns==1) cin.get();
}
}
baseXYZ
->
write
();
OutputFile
.
close
();
if
(
gDumpADLBase
)
ADLBase_
OutputFile
.
close
();
delete
baseXYZ
;
#endif
return
true
;
...
...
filters/PSA/includePSA/SignalBasis.cpp
View file @
14bcfb9e
...
...
@@ -402,9 +402,7 @@ int SignalBasis::ReadBasisFormatBartB(FILE * ofp1, bool keep, int numSignals)
last
=
ptf
[
bnn
]
*
MAXNORM
;
}
segPts
[
ii
][
jj
].
amplitude
[
ns
][
ann
]
=
last
;
//cout<<" seg trig: "<<ii<< " - pos " <<jj<< " - seg " <<ns<< " - bin " <<ann<<" "<<last<<" "<<ptf[bnn]<<endl;
}
//cin.get();
if
(
ns
==
ii
)
{
// neutron damage correction parameters
segPts
[
ii
][
jj
].
ePath
=
ptf
[
1
];
// distance travelled by the electrons
segPts
[
ii
][
jj
].
eS_SG
=
ptf
[
2
];
// sensitivity for electrons
...
...
@@ -414,14 +412,6 @@ int SignalBasis::ReadBasisFormatBartB(FILE * ofp1, bool keep, int numSignals)
segPts
[
ii
][
jj
].
hE_SG
=
ptf
[
7
];
// E-dependent sensitivity for holes
}
}
/* if(ii==0){
cout<<"test ici"<<endl;cin.get();
for(int i=0 ; i<37 ; i++){
for(int j=0 ; j<56 ; j++) cout<<"id 0, pos 0, seg" << i<<" bin " << j << " val: " <<segPts[0][0].amplitude[i][j]<<endl;
cin.get();
}
}
*/
// in Bart's files, CC is in the first position
{
//float *ptf = file_trace;
...
...
@@ -446,7 +436,6 @@ int SignalBasis::ReadBasisFormatBartB(FILE * ofp1, bool keep, int numSignals)
numPts
[
ii
]
++
;
}
delete
[]
whichSeg
;
return
0
;
...
...
filters/PSA/includePSA/SignalBasis.h
View file @
14bcfb9e
...
...
@@ -92,7 +92,7 @@ public:
int
SegTrig
;
// Segment containing the interaction
float
Pos
[
3
];
// x y z (mm)
float
Tr
[(
NSEGS
+
1
)
*
BSIZE
];
// CC+nSeg traces given in steps of 10 ns.
}
New
bbhit_t
;
}
ADLDump_
bbhit_t
;
// coarse grid
typedef
struct
{
...
...
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