Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AculUtils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AccullinaGroup
AculUtils
Commits
fa30d6f2
Commit
fa30d6f2
authored
Oct 25, 2016
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parameters for scintillator have been sligthly optimized.
parent
8bd7b5f0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
63 deletions
+72
-63
AculCalPars.h
AculCalib/AculCalPars.h
+3
-6
AculCalParsScint.cpp
AculCalib/AculCalParsScint.cpp
+38
-51
AculCalParsScint.h
AculCalib/AculCalParsScint.h
+4
-5
AculCalib.mk
AculCalib/AculCalib.mk
+4
-0
linkdef.h
AculCalib/linkdef.h
+1
-1
parTest.cxx
macros/myMacros/parTest.cxx
+22
-0
No files found.
AculCalib/AculCalPars.h
View file @
fa30d6f2
...
...
@@ -12,15 +12,11 @@
#include <fstream>
#include <vector>
//#include "TObject.h"
#include "TString.h"
#include "TArrayD.h"
#include "TArrayI.h"
#include "TCutG.h"
//todo ommit this constant
#define NOCALFILES 5
using
std
::
cout
;
using
std
::
endl
;
using
std
::
vector
;
...
...
@@ -31,6 +27,9 @@ protected:
//general
TString
fParFileName
;
//todo energies used for calibration should be in this class
//CsI parameters
// Int_t fNoCrystals;
//
...
...
@@ -63,14 +62,12 @@ public:
virtual
const
char
*
GetParticleName
()
{
return
0
;}
virtual
Int_t
GetNoRawFiles
()
{
return
0
;};
virtual
const
char
*
GetFileName
(
Int_t
i
)
{
return
0
;};
// const char* GetCutName(Int_t i);
virtual
Int_t
GetNoEPoints
()
{
return
0
;}
virtual
Double_t
GetCalEnergy
(
Int_t
i
)
{
return
0
.;};
virtual
const
char
*
GetCutsFileName
()
{
return
0
;}
virtual
Int_t
GetNoCuts
()
{
return
0
;}
virtual
TCutG
*
GetCut
(
Int_t
i
)
{
return
0
;};
virtual
TCutG
*
GetCut
(
const
char
*
cutName
)
{
return
0
;};
// virtual TCutG* GetCutName(Int_t i) {return 0;};
virtual
Int_t
GetMinChannel
(
Int_t
energy
,
Int_t
crystal
)
{
return
0
;};
virtual
Int_t
GetMaxChannel
(
Int_t
energy
,
Int_t
crystal
)
{
return
0
;};
...
...
AculCalib/AculCalParsScint.cpp
View file @
fa30d6f2
...
...
@@ -72,11 +72,14 @@ void AculCalParsScint::SetPars() {
if
(
line
.
BeginsWith
(
"files"
)
)
{
sscanf
(
line
.
Data
(),
"%*s %d"
,
&
i
);
fNoFiles
=
i
;
fFilePars
.
resize
(
fNoFiles
);
for
(
Int_t
j
=
0
;
j
<
fNoFiles
;
j
++
)
{
line
.
ReadLine
(
infile
);
sscanf
(
line
,
"%s"
,
fname
);
word
=
fname
;
fFileName
.
push_back
(
fname
);
fFilePars
[
j
].
SetRawFileName
(
fname
);
fFilePars
[
j
].
SetNoCrystals
(
fNoCrystals
);
fFilePars
[
j
].
Init
();
}
continue
;
}
...
...
@@ -101,17 +104,16 @@ void AculCalParsScint::SetPars() {
if
(
line
.
BeginsWith
(
"energy"
)
)
{
sscanf
(
line
.
Data
(),
"%*s %lf"
,
&
en
);
f
E
.
push_back
(
en
);
f
FilePars
[
fEnergyPoints
].
SetEnergy
(
en
);
fEnergyPoints
++
;
vector
<
Int_t
>
newM
;
fPeakMin
.
push_back
(
newM
);
fPeakMax
.
push_back
(
newM
);
continue
;
}
sscanf
(
line
.
Data
(),
"%d %d %d"
,
&
i
,
&
min
,
&
max
);
fPeakMin
.
at
(
fEnergyPoints
-
1
).
push_back
(
min
);
fPeakMax
.
at
(
fEnergyPoints
-
1
).
push_back
(
max
);
fFilePars
.
at
(
fEnergyPoints
-
1
).
SetPeakMin
(
i
,
min
);
fFilePars
.
at
(
fEnergyPoints
-
1
).
SetPeakMax
(
i
,
max
);
}
//while
infile
.
close
();
...
...
@@ -124,24 +126,20 @@ void AculCalParsScint::PrintParameters(const char* option) {
cout
<<
"Parameters read from file
\"
"
<<
fParFileName
.
Data
()
<<
"
\"
."
<<
endl
;
cout
<<
"
\t
Calibration of detector
\"
"
<<
fDetName
<<
"
\"
with "
<<
fNoCrystals
<<
" crystals."
<<
endl
;
// cout << "\tNumber of crystals: " << fNoCrystals << endl;
cout
<<
"
\t
Particle: "
<<
fPartName
<<
endl
;
cout
<<
"
\t
Input files with raw data ("
<<
fNoFiles
<<
"):"
<<
endl
;
for
(
Int_t
i
=
0
;
i
<
(
Int_t
)
fFileName
.
size
();
i
++
)
{
// cout << i << endl;
cout
<<
"
\t
"
<<
fFileName
[
i
]
<<
endl
;
for
(
Int_t
i
=
0
;
i
<
(
Int_t
)
fFilePars
.
size
();
i
++
)
{
cout
<<
"
\t
"
<<
GetFileName
(
i
)
<<
endl
;
}
cout
<<
"
\t
Input energies ("
<<
fNoFiles
<<
"):"
<<
endl
;
for
(
Int_t
i
=
0
;
i
<
(
Int_t
)
fE
.
size
();
i
++
)
{
// cout << i << endl;
cout
<<
"
\t
"
<<
fE
[
i
]
<<
" MeV"
<<
endl
;
for
(
Int_t
i
=
0
;
i
<=
(
Int_t
)
fFilePars
.
size
();
i
++
)
{
cout
<<
"
\t
"
<<
fFilePars
[
i
].
GetEnergy
()
<<
" MeV"
<<
endl
;
}
cout
<<
"
\t
Input file with "
<<
fNoCuts
<<
" cuts:
\"
"
<<
fCutsFileName
<<
"
\"
"
<<
endl
;
if
(
opt
.
Contains
(
"all"
))
{
for
(
Int_t
i
=
0
;
i
<
(
Int_t
)
fCutName
.
size
();
i
++
)
{
// cout << i << endl;
cout
<<
"
\t
cut:
\"
"
<<
fCutName
[
i
]
<<
"
\"
"
<<
endl
;
}
}
...
...
@@ -149,13 +147,10 @@ void AculCalParsScint::PrintParameters(const char* option) {
if
(
!
opt
.
Contains
(
"all"
))
return
;
cout
<<
"
\t
Peak limits for particular channels and energies:"
<<
endl
;
for
(
Int_t
k
=
0
;
k
<
(
Int_t
)
fPeakMin
.
size
();
k
++
)
{
cout
<<
"
\t
Set number: "
<<
k
<<
"; energy: "
<<
fE
[
k
]
<<
" MeV"
<<
endl
;
for
(
Int_t
i
=
0
;
i
<
(
Int_t
)
fPeakMin
[
k
].
size
();
i
++
)
{
// cout << i << endl;
cout
<<
"
\t\t
"
<<
fPeakMin
[
k
][
i
]
<<
"
\t
"
<<
fPeakMax
[
k
][
i
]
<<
endl
;
for
(
Int_t
k
=
0
;
k
<
(
Int_t
)
fFilePars
.
size
();
k
++
)
{
cout
<<
"
\t
Set number: "
<<
k
<<
"; energy: "
<<
fFilePars
[
k
].
GetEnergy
()
<<
" MeV"
<<
endl
;
for
(
Int_t
i
=
0
;
i
<
(
Int_t
)
fFilePars
[
k
].
GetNoCrystals
();
i
++
)
{
cout
<<
"
\t\t
"
<<
fFilePars
[
k
].
GetPeakMin
(
i
)
<<
"
\t
"
<<
fFilePars
[
k
].
GetPeakMax
(
i
)
<<
endl
;
}
}
...
...
@@ -170,29 +165,24 @@ void AculCalParsScint::Reset() {
fPartName
=
""
;
fNoFiles
=
0
;
fFilePars
.
clear
();
fEnergyPoints
=
0
;
fE
.
clear
();
fCutsFileName
=
""
;
fNoCuts
=
0
;
//number of cuts
fFileName
.
clear
();
fCutName
.
clear
();
fPeakMin
.
clear
();
fPeakMax
.
clear
();
return
;
}
const
char
*
AculCalParsScint
::
GetFileName
(
Int_t
i
)
{
if
(
i
>
(
Int_t
)
fFileName
.
size
()
-
1
)
{
cerr
<<
"
\"
AculCalParsScint::GetFileName
\"
index i cannot be higher than "
<<
fFile
Name
.
size
()
-
1
<<
endl
;
if
(
i
>
=
(
Int_t
)
fFilePars
.
size
()
)
{
cerr
<<
"
\"
AculCalParsScint::GetFileName
\"
index i cannot be higher than "
<<
fFile
Pars
.
size
()
-
1
<<
endl
;
return
0
;
}
return
fFile
Name
[
i
].
Data
();
return
fFile
Pars
[
i
].
GetRawFileName
();
}
const
char
*
AculCalParsScint
::
GetCutName
(
Int_t
i
)
{
...
...
@@ -214,11 +204,6 @@ TCutG* AculCalParsScint::GetCut(Int_t i) {
TCutG
*
AculCalParsScint
::
GetCut
(
const
char
*
cutName
)
{
// TClonesArray cutsCol;
//
// for (Int_t i = 0; i < nCuts; i++) {
// cutsCol[i] = (TCutG*)fCuts->Get(cutNames[i]);
// }
const
TString
cName
=
cutName
;
for
(
Int_t
i
=
0
;
i
<=
(
Int_t
)
fCuts
.
size
();
i
++
)
{
...
...
@@ -232,43 +217,45 @@ TCutG* AculCalParsScint::GetCut(const char* cutName) {
Double_t
AculCalParsScint
::
GetCalEnergy
(
Int_t
i
)
{
if
(
i
>
(
Int_t
)
fE
.
size
()
-
1
)
{
cerr
<<
"
\"
AculCalParsScint::GetCalEnergy
\"
index i cannot be higher than "
<<
f
E
.
size
()
-
1
<<
endl
;
if
(
i
>
=
(
Int_t
)
fFilePars
.
size
()
)
{
cerr
<<
"
\"
AculCalParsScint::GetCalEnergy
\"
index i cannot be higher than "
<<
f
FilePars
.
size
()
-
1
<<
endl
;
return
0
;
}
return
f
E
[
i
]
;
return
f
FilePars
[
i
].
GetEnergy
()
;
}
Int_t
AculCalParsScint
::
GetMinChannel
(
Int_t
energy
,
Int_t
crystal
)
{
if
(
energy
>
(
Int_t
)
fPeakMin
.
size
()
-
1
)
{
cerr
<<
"
\"
AculCalParsScint::GetMinChannel
\"
index
\"
energy
\"
cannot be higher than "
<<
fPeakMin
.
size
()
-
1
<<
endl
;
if
(
energy
>=
(
Int_t
)
fFilePars
.
size
()
)
{
cerr
<<
"
\"
AculCalParsScint::GetMinChannel
\"
index
\"
energy
\"
cannot be higher than "
<<
fFilePars
.
size
()
-
1
<<
endl
;
return
0
;
}
vector
<
Int_t
>
v
=
fPeakMin
[
energy
];
if
(
crystal
>
(
Int_t
)
v
.
size
()
-
1
)
{
cerr
<<
"
\"
AculCalParsScint::GetMinChannel
\"
index
\"
crystal
\"
cannot be higher than "
<<
v
.
size
()
-
1
<<
endl
;
if
(
crystal
>=
fFilePars
[
energy
].
GetNoCrystals
()
)
{
cerr
<<
"
\"
AculCalParsScint::GetMinChannel
\"
index
\"
crystal
\"
cannot be higher than "
<<
fFilePars
[
energy
].
GetNoCrystals
()
-
1
<<
endl
;
return
0
;
}
return
f
PeakMin
[
energy
][
crystal
]
;
return
f
FilePars
[
energy
].
GetPeakMin
(
crystal
)
;
}
Int_t
AculCalParsScint
::
GetMaxChannel
(
Int_t
energy
,
Int_t
crystal
)
{
if
(
energy
>
(
Int_t
)
fPeakMax
.
size
()
-
1
)
{
cerr
<<
"
\"
AculCalParsScint::GetMinChannel
\"
index
\"
energy
\"
cannot be higher than "
<<
fPeakMax
.
size
()
-
1
<<
endl
;
if
(
energy
>=
(
Int_t
)
fFilePars
.
size
()
)
{
cerr
<<
"
\"
AculCalParsScint::GetMinChannel
\"
index
\"
energy
\"
cannot be higher than "
<<
fFilePars
.
size
()
-
1
<<
endl
;
return
0
;
}
vector
<
Int_t
>
v
=
fPeakMax
[
energy
];
if
(
crystal
>
(
Int_t
)
v
.
size
()
-
1
)
{
cerr
<<
"
\"
AculCalParsScint::GetMinChannel
\"
index
\"
crystal
\"
cannot be higher than "
<<
v
.
size
()
-
1
<<
endl
;
if
(
crystal
>=
fFilePars
[
energy
].
GetNoCrystals
()
)
{
cerr
<<
"
\"
AculCalParsScint::GetMinChannel
\"
index
\"
crystal
\"
cannot be higher than "
<<
fFilePars
[
energy
].
GetNoCrystals
()
-
1
<<
endl
;
return
0
;
}
return
f
PeakMax
[
energy
][
crystal
]
;
return
f
FilePars
[
energy
].
GetPeakMax
(
crystal
)
;
}
void
AculCalParsScint
::
LoadCuts
()
{
...
...
AculCalib/AculCalParsScint.h
View file @
fa30d6f2
...
...
@@ -9,6 +9,7 @@
#define ACULCALIB_ACULCALPARSSCINT_H_
#include "AculCalPars.h"
#include "AculCalParsScintFile.h"
//#include "TCutG.h"
using
std
::
cerr
;
...
...
@@ -22,19 +23,17 @@ private:
TString
fPartName
;
Int_t
fNoFiles
;
vector
<
TString
>
fFileName
;
vector
<
AculCalParsScintFile
>
fFilePars
;
//todo following parameters should be probably moved to AculCalParsScintFile
//as far as they are related to each file separately
vector
<
TString
>
fCutName
;
vector
<
TCutG
>
fCuts
;
Int_t
fEnergyPoints
;
vector
<
Double_t
>
fE
;
TString
fCutsFileName
;
Int_t
fNoCuts
;
//number of cuts
vector
<
vector
<
Int_t
>
>
fPeakMin
;
vector
<
vector
<
Int_t
>
>
fPeakMax
;
public
:
AculCalParsScint
();
AculCalParsScint
(
const
char
*
parFile
);
...
...
AculCalib/AculCalib.mk
View file @
fa30d6f2
...
...
@@ -10,6 +10,7 @@ $(ACULCALIB)/AculCalib.h \
$(ACULCALIB)/AculCalibScint.h \
$(ACULCALIB)/AculCalPars.h \
$(ACULCALIB)/AculCalParsScint.h \
$(ACULCALIB)/AculCalParsScintFile.h \
$(ACULCALIB)/linkdef.h
ACULCALIBCPP_SRCS += \
...
...
@@ -17,6 +18,7 @@ $(ACULCALIB)/AculCalib.cpp \
$(ACULCALIB)/AculCalibScint.cpp \
$(ACULCALIB)/AculCalPars.cpp \
$(ACULCALIB)/AculCalParsScint.cpp \
$(ACULCALIB)/AculCalParsScintFile.cpp \
$(ACULCALIB)/AculCalibCint.cpp
ACULCALIBOBJS += \
...
...
@@ -24,6 +26,7 @@ $(ACULCALIB)/AculCalib.o \
$(ACULCALIB)/AculCalibScint.o \
$(ACULCALIB)/AculCalPars.o \
$(ACULCALIB)/AculCalParsScint.o \
$(ACULCALIB)/AculCalParsScintFile.o \
$(ACULCALIB)/AculCalibCint.o
ACULCALIBCPP_DEPS += \
...
...
@@ -31,4 +34,5 @@ $(ACULCALIB)/AculCalib.d \
$(ACULCALIB)/AculCalibScint.d \
$(ACULCALIB)/AculCalPars.d \
$(ACULCALIB)/AculCalParsScint.d \
$(ACULCALIB)/AculCalParsScintFile.d \
$(ACULCALIB)/AculCalibCint.d
\ No newline at end of file
AculCalib/linkdef.h
View file @
fa30d6f2
...
...
@@ -9,7 +9,7 @@
#pragma link C++ class AculCalibScint;
#pragma link C++ class AculCalPars;
#pragma link C++ class AculCalParsScint;
#pragma link C++ class AculCalParsScintFile;
#endif
macros/myMacros/parTest.cxx
View file @
fa30d6f2
//#include "../../AculCalib/AculCalPars.h"
//#include "../../AculCalib/AculCalibScint.h"
//#include "TSystem.h"
//#include <iostream>
//
using
std
::
cout
;
using
std
::
endl
;
void
parTest
()
{
gSystem
->
Load
(
"../../libAculCalib.so"
);
AculCalParsScintFile
pp
;
pp
.
SetNoCrystals
(
16
);
pp
.
Init
();
// return;
cout
<<
"-----------------------"
<<
endl
;
AculCalParsScint
p
;
p
.
SetParFile
(
"SQ13Alpha.par"
);
p
.
Init
();
// cout << p.GetFileName(0) << endl;
// cout << p.GetFileName(1) << endl;
// cout << p.GetFileName(2) << endl;
// cout << p.GetFileName(3) << endl;
// cout << p.GetFileName(4) << endl;
p
.
PrintParameters
(
"all"
);
// return;
p
.
Reset
();
p
.
PrintParameters
(
""
);
// return;
AculCalibScint
c
;
c
.
SetParFile
(
"SQ13Alpha.par"
);
...
...
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