Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NeuRad_tests
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
0
Merge Requests
0
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
Vratislav Chudoba
NeuRad_tests
Commits
e45257b3
Commit
e45257b3
authored
Jan 12, 2017
by
Kostyleva D.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New function AEvent::SetChargeCFD added
parent
b3ddd8eb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
12 deletions
+40
-12
analysis_07_1.root
data/dataDSR4/analysis_07_1.root
+0
-0
AEvent.cpp
dataClasses/AEvent.cpp
+28
-5
AEvent.h
dataClasses/AEvent.h
+8
-1
analyse.C
macros/analyse.C
+4
-6
No files found.
data/dataDSR4/analysis_07_1.root
View file @
e45257b3
No preview for this file type
dataClasses/AEvent.cpp
View file @
e45257b3
...
@@ -55,9 +55,9 @@ void AEvent::ProcessEvent() {
...
@@ -55,9 +55,9 @@ void AEvent::ProcessEvent() {
fTime
[
j
]
=
time
[
j
];
fTime
[
j
]
=
time
[
j
];
}
}
const
Double_t
z
eroLevel
=
FindZeroLevel
();
fZ
eroLevel
=
FindZeroLevel
();
for
(
Int_t
j
=
0
;
j
<
fNPoints
;
j
++
)
{
for
(
Int_t
j
=
0
;
j
<
fNPoints
;
j
++
)
{
fAmpPos
[
j
]
=
fAmpPos
[
j
]
-
z
eroLevel
;
fAmpPos
[
j
]
=
fAmpPos
[
j
]
-
fZ
eroLevel
;
}
}
Double_t
maxAmp
=
0.
;
Double_t
maxAmp
=
0.
;
...
@@ -76,6 +76,7 @@ void AEvent::ProcessEvent() {
...
@@ -76,6 +76,7 @@ void AEvent::ProcessEvent() {
SetGraphs
();
SetGraphs
();
SetCFD
();
SetCFD
();
SetChargeCFD
();
return
;
return
;
...
@@ -91,7 +92,9 @@ void AEvent::Reset() {
...
@@ -91,7 +92,9 @@ void AEvent::Reset() {
fAmpMax
=
0.
;
fAmpMax
=
0.
;
fTimeAmpMax
=
0.
;
fTimeAmpMax
=
0.
;
fCFD
=
0.
;
fTimeCFD
=
0.
;
fZeroLevel
=
0.
;
fCharge
=
0.
;
}
}
void
AEvent
::
SetInputEvent
(
RawEvent
**
event
)
{
void
AEvent
::
SetInputEvent
(
RawEvent
**
event
)
{
...
@@ -166,7 +169,7 @@ void AEvent::SetCFD() {
...
@@ -166,7 +169,7 @@ void AEvent::SetCFD() {
for
(
Int_t
j
=
imin
;
j
<
imax
;
j
++
)
{
for
(
Int_t
j
=
imin
;
j
<
imax
;
j
++
)
{
if
(
abs
(
fAmpCFD
[
j
])
<
level
)
{
if
(
abs
(
fAmpCFD
[
j
])
<
level
)
{
level
=
abs
(
fAmpCFD
[
j
]);
level
=
abs
(
fAmpCFD
[
j
]);
fCFD
=
fTime
[
j
];
f
Time
CFD
=
fTime
[
j
];
}
}
}
}
}
}
...
@@ -190,8 +193,28 @@ Double_t AEvent::FindZeroLevel(Int_t pmin, Int_t pmax) {
...
@@ -190,8 +193,28 @@ Double_t AEvent::FindZeroLevel(Int_t pmin, Int_t pmax) {
return
correction
;
return
correction
;
}
}
void
AEvent
::
SetChargeCFD
(
Int_t
tmin
,
Int_t
tmax
)
{
Double_t
integral
=
0.
;
//voltage
Double_t
time_sig
=
0
;
//approximate signal duration in seconds
Double_t
res
=
50.
;
//resistance 50 Om
time_sig
=
(
double
)(
tmin
+
tmax
)
*
(
1e-9
);
for
(
Int_t
i
=
0
;
i
<
fNPoints
;
i
++
)
{
if
(
fTime
[
i
]
>
(
fTimeCFD
-
tmin
)
&&
fTime
[
i
]
<
(
fTimeCFD
+
tmax
)
)
{
integral
=
integral
+
fAmpPos
[
i
];
}
}
fCharge
=
integral
*
time_sig
/
res
;
// cout<<fCharge<<endl;
// printf("\nIntegral is %f , charge is %lf \n", integral, fCharge);
return
;
}
Double_t
AEvent
::
GetfCFD
()
{
Double_t
AEvent
::
GetfCFD
()
{
return
fCFD
;
return
f
Time
CFD
;
}
}
Double_t
AEvent
::
GetOnefTime
(
Int_t
i
)
{
Double_t
AEvent
::
GetOnefTime
(
Int_t
i
)
{
...
...
dataClasses/AEvent.h
View file @
e45257b3
...
@@ -38,9 +38,11 @@ private:
...
@@ -38,9 +38,11 @@ private:
Double_t
fAmpMax
;
Double_t
fAmpMax
;
Double_t
fTimeAmpMax
;
Double_t
fTimeAmpMax
;
Double_t
fZeroLevel
;
TArrayD
fAmpCFD
;
//array for CFD amplitudes (attenuated, inversed and delayed)
TArrayD
fAmpCFD
;
//array for CFD amplitudes (attenuated, inversed and delayed)
Double_t
fCFD
;
//zero-crossing time
Double_t
fTimeCFD
;
//zero-crossing time
Double_t
fCharge
;
//charge of the signal in Coulomb
TGraph
*
fGraphSignal
;
TGraph
*
fGraphSignal
;
TGraph
*
fGraphCFD
;
TGraph
*
fGraphCFD
;
...
@@ -88,6 +90,11 @@ public:
...
@@ -88,6 +90,11 @@ public:
//for zero level correction. one parameter fit between pmin and pmax
//for zero level correction. one parameter fit between pmin and pmax
//returns fit parameter i.e. number on which amplitude should be corrected
//returns fit parameter i.e. number on which amplitude should be corrected
void
SetChargeCFD
(
Int_t
tmin
=
3
,
Int_t
tmax
=
17
);
//calculates charge of the signal (i.e. its integral
//in range of (tmin,tmax) in ns)
//CFD time is taken as a start point
private
:
private
:
void
Init
();
void
Init
();
void
SetGraphs
();
void
SetGraphs
();
...
...
macros/analyse.C
View file @
e45257b3
...
@@ -2,7 +2,7 @@ void analyse()
...
@@ -2,7 +2,7 @@ void analyse()
{
{
gSystem
->
Load
(
"../libData.so"
);
gSystem
->
Load
(
"../libData.so"
);
TFile
*
f
=
new
TFile
(
"../data/rawDataDSR4/NeuRad_test_07_
3
.root"
);
TFile
*
f
=
new
TFile
(
"../data/rawDataDSR4/NeuRad_test_07_
1
.root"
);
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"rtree"
);
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"rtree"
);
const
Int_t
noBranches
=
4
;
const
Int_t
noBranches
=
4
;
...
@@ -19,7 +19,7 @@ void analyse()
...
@@ -19,7 +19,7 @@ void analyse()
// tr->SetMakeClass(1);
// tr->SetMakeClass(1);
TFile
*
fw
=
new
TFile
(
"../data/dataDSR4/analysis_07_
3
.root"
,
"RECREATE"
);
//create .root file with somehow analyzed data
TFile
*
fw
=
new
TFile
(
"../data/dataDSR4/analysis_07_
1
.root"
,
"RECREATE"
);
//create .root file with somehow analyzed data
TTree
*
tw
=
new
TTree
(
"atree"
,
"title of drs4 analysis tree"
);
//create analysis tree atree in it
TTree
*
tw
=
new
TTree
(
"atree"
,
"title of drs4 analysis tree"
);
//create analysis tree atree in it
AEvent
*
wevent
[
noBranches
];
// pointer to the array (of AEvent class) in which analyzed data for each channel will be put
AEvent
*
wevent
[
noBranches
];
// pointer to the array (of AEvent class) in which analyzed data for each channel will be put
...
@@ -37,19 +37,17 @@ void analyse()
...
@@ -37,19 +37,17 @@ void analyse()
for
(
Long64_t
i
=
0
;
i
<
nentries
;
i
++
)
{
for
(
Long64_t
i
=
0
;
i
<
nentries
;
i
++
)
{
tr
->
GetEntry
(
i
);
tr
->
GetEntry
(
i
);
if
(
!
(
tr
->
GetEntry
(
i
)
%
100
)
)
{
printf
(
"Found event #%d
\n
"
,
tr
->
GetEntry
(
i
));
}
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
wevent
[
j
]
->
Reset
();
wevent
[
j
]
->
Reset
();
wevent
[
j
]
->
ProcessEvent
();
//here all the analysis is going on so far
wevent
[
j
]
->
ProcessEvent
();
//here all the analysis is going on so far
}
}
if
(
!
(
i
%
100
)
)
{
printf
(
"Found event #%d
\n
"
,
i
);
}
tw
->
Fill
();
tw
->
Fill
();
}
}
//----end of event loop
//----end of event loop
printf
(
"%d events are processed
\n
"
,
nentries
);
tw
->
Write
();
tw
->
Write
();
fw
->
Close
();
fw
->
Close
();
...
...
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