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
d92d4eae
Commit
d92d4eae
authored
Jan 11, 2017
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Function AEvent::SetCFD() modified.
parent
3ac26a0b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
33 deletions
+54
-33
analysis_07_1.root
data/dataDSR4/analysis_07_1.root
+0
-0
AEvent.cpp
dataClasses/AEvent.cpp
+37
-28
AEvent.h
dataClasses/AEvent.h
+12
-4
analyse.C
macros/analyse.C
+4
-0
testShowCFD.cxx
macros/testShowCFD.cxx
+1
-1
No files found.
data/dataDSR4/analysis_07_1.root
View file @
d92d4eae
No preview for this file type
dataClasses/AEvent.cpp
View file @
d92d4eae
...
@@ -22,8 +22,8 @@ AEvent::AEvent(const Int_t npoints) : fNPoints(npoints) {
...
@@ -22,8 +22,8 @@ AEvent::AEvent(const Int_t npoints) : fNPoints(npoints) {
AEvent
::~
AEvent
()
{
AEvent
::~
AEvent
()
{
// TODO Auto-generated destructor stub
// TODO Auto-generated destructor stub
delete
g
Signal
;
delete
fGraph
Signal
;
delete
g
CFD
;
delete
fGraph
CFD
;
delete
fInputEvent
;
delete
fInputEvent
;
}
}
...
@@ -86,6 +86,7 @@ void AEvent::Reset() {
...
@@ -86,6 +86,7 @@ void AEvent::Reset() {
fAmpMax
=
0.
;
fAmpMax
=
0.
;
fTimeAmpMax
=
0.
;
fTimeAmpMax
=
0.
;
fCFD
=
0.
;
}
}
void
AEvent
::
SetInputEvent
(
RawEvent
**
event
)
{
void
AEvent
::
SetInputEvent
(
RawEvent
**
event
)
{
...
@@ -103,60 +104,68 @@ void AEvent::Init() {
...
@@ -103,60 +104,68 @@ void AEvent::Init() {
fTime
.
Set
(
fNPoints
);
fTime
.
Set
(
fNPoints
);
fAmpCFD
.
Set
(
fNPoints
);
fAmpCFD
.
Set
(
fNPoints
);
g
Signal
=
new
TGraph
();
fGraph
Signal
=
new
TGraph
();
g
CFD
=
new
TGraph
();
fGraph
CFD
=
new
TGraph
();
fInputEvent
=
0
;
fInputEvent
=
0
;
fCFratio
=
0.
;
fCFtimeDelay
=
0.
;
}
}
void
AEvent
::
SetGraphs
()
{
void
AEvent
::
SetGraphs
()
{
g
Signal
->
Set
(
fNPoints
);
fGraph
Signal
->
Set
(
fNPoints
);
for
(
Int_t
i
=
0
;
i
<
fNPoints
;
i
++
)
{
for
(
Int_t
i
=
0
;
i
<
fNPoints
;
i
++
)
{
g
Signal
->
SetPoint
(
i
,
fTime
[
i
],
fAmpPos
[
i
]);
fGraph
Signal
->
SetPoint
(
i
,
fTime
[
i
],
fAmpPos
[
i
]);
}
}
return
;
return
;
}
}
void
AEvent
::
SetCFD
(
/*Double_t c, Int_t td*/
)
{
void
AEvent
::
SetCFD
()
{
// Double_t c = 0.5; //attenuation coefficient
// Int_t td = 5; //time of delay in points
Double_t
level
=
100.
;
//todo what is it?
fGraphCFD
->
Set
(
fNPoints
);
//working variables
Double_t
maxCFD
=
0.
,
minCFD
=
0.
;
Int_t
imax
=
0
,
imin
=
0
;
gCFD
->
Set
(
fNPoints
);
Double_t
c
=
0.5
;
//attenuation coefficient
Int_t
td
=
5
;
//time of delay in points
Double_t
maxCFD
,
minCFD
,
imax
,
imin
,
tmax
,
tmin
,
level
;
maxCFD
=
0.
;
minCFD
=
0.
;
level
=
100.
;
for
(
Int_t
i
=
0
;
i
<
fNPoints
;
i
++
)
{
for
(
Int_t
i
=
0
;
i
<
fNPoints
;
i
++
)
{
//CFD method
//CFD method
if
(
i
>
td
)
{
if
(
i
>
fCFtimeDelay
)
{
fAmpCFD
[
i
]
=
fAmpPos
[
i
]
*
c
*
(
-
1
);
// fAmpCFD[i] = fAmpPos[i]*cfRatio*(-1);
fAmpCFD
[
i
]
=
fAmpCFD
[
i
]
+
fAmpPos
[
i
-
td
];
fAmpCFD
[
i
]
=
fAmpPos
[
i
]
*
fCFratio
*
(
-
1
);
gCFD
->
SetPoint
(
i
,
fTime
[
i
],
fAmpCFD
[
i
]);
// fAmpCFD[i] = fAmpCFD[i] + fAmpPos[i - timeDelay];
fAmpCFD
[
i
]
=
fAmpCFD
[
i
]
+
fAmpPos
[
i
-
fCFtimeDelay
];
fGraphCFD
->
SetPoint
(
i
,
fTime
[
i
],
fAmpCFD
[
i
]);
}
}
//point for max CFD amplitude
//point for max CFD amplitude
if
(
fAmpCFD
[
i
]
>
maxCFD
)
{
if
(
fAmpCFD
[
i
]
>
maxCFD
)
{
maxCFD
=
fAmpCFD
[
i
];
maxCFD
=
fAmpCFD
[
i
];
imax
=
i
;
imax
=
i
;
tmax
=
fTime
[
i
];
}
}
//point for min CFD amplitude
//point for min CFD amplitude
if
(
fAmpCFD
[
i
]
<
minCFD
)
{
if
(
fAmpCFD
[
i
]
<
minCFD
)
{
minCFD
=
fAmpCFD
[
i
];
minCFD
=
fAmpCFD
[
i
];
imin
=
i
;
imin
=
i
;
tmin
=
fTime
[
i
];
}
}
}
}
//finding "zero" of CFD amplitude
//finding "zero" of CFD amplitude
for
(
Int_t
j
=
imin
;
j
<
imax
;
j
++
)
{
for
(
Int_t
j
=
imin
;
j
<
imax
;
j
++
)
{
if
(
abs
(
fAmpCFD
[
j
])
<
level
)
{
level
=
abs
(
fAmpCFD
[
j
]);
fCFD
=
fTime
[
j
];}
if
(
abs
(
fAmpCFD
[
j
])
<
level
)
{
level
=
abs
(
fAmpCFD
[
j
]);
fCFD
=
fTime
[
j
];
}
}
}
return
;
return
;
...
...
dataClasses/AEvent.h
View file @
d92d4eae
...
@@ -41,11 +41,14 @@ private:
...
@@ -41,11 +41,14 @@ private:
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
fCFD
;
//zero-crossing time
TGraph
*
g
Signal
;
TGraph
*
fGraph
Signal
;
TGraph
*
g
CFD
;
TGraph
*
fGraph
CFD
;
RawEvent
*
fInputEvent
;
//!
RawEvent
*
fInputEvent
;
//!
Double_t
fCFratio
;
//!
Double_t
fCFtimeDelay
;
//!
public
:
public
:
AEvent
();
AEvent
();
AEvent
(
const
Int_t
npoints
);
AEvent
(
const
Int_t
npoints
);
...
@@ -56,18 +59,23 @@ public:
...
@@ -56,18 +59,23 @@ public:
void
ProcessEvent
();
void
ProcessEvent
();
// void Integral()
// void Integral()
void
SetInputEvent
(
RawEvent
**
event
);
void
SetInputEvent
(
RawEvent
**
event
);
void
SetCFratio
(
Double_t
ratio
)
{
fCFratio
=
ratio
;
};
void
SetCFtimeDelay
(
Double_t
timeDelay
)
{
fCFtimeDelay
=
timeDelay
;
};
void
Reset
();
void
Reset
();
//Resets arrays to zeros
//Resets arrays to zeros
TGraph
*
GetGraph
()
{
TGraph
*
GetGraph
()
{
return
gCFD
;
//todo
return
fGraphCFD
;
// return gSignal;
// return gSignal;
}
}
private
:
private
:
void
Init
();
void
Init
();
void
SetGraphs
();
void
SetGraphs
();
void
SetCFD
(
/*Double_t c = 0.5, Int_t td = 5*/
);
void
SetCFD
();
};
};
#endif
/* DATACLASSES_AEVENT_H_ */
#endif
/* DATACLASSES_AEVENT_H_ */
macros/analyse.C
View file @
d92d4eae
...
@@ -6,6 +6,8 @@ void analyse()
...
@@ -6,6 +6,8 @@ void analyse()
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"rtree"
);
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"rtree"
);
const
Int_t
noBranches
=
4
;
const
Int_t
noBranches
=
4
;
const
Double_t
cfRatio
=
0
.
5
;
const
Int_t
cfTD
=
5
;
TString
bName
;
TString
bName
;
RawEvent
*
revent
[
noBranches
];
// pointer to the array (of RawEvent class) in which raw data for each channel will be put
RawEvent
*
revent
[
noBranches
];
// pointer to the array (of RawEvent class) in which raw data for each channel will be put
...
@@ -25,6 +27,8 @@ void analyse()
...
@@ -25,6 +27,8 @@ void analyse()
wevent
[
j
]
=
new
AEvent
();
wevent
[
j
]
=
new
AEvent
();
bName
.
Form
(
"Ach%d."
,
j
);
bName
.
Form
(
"Ach%d."
,
j
);
wevent
[
j
]
->
SetInputEvent
(
&
revent
[
j
]);
//takes raw event from RawEvent
wevent
[
j
]
->
SetInputEvent
(
&
revent
[
j
]);
//takes raw event from RawEvent
wevent
[
j
]
->
SetCFratio
(
cfRatio
);
wevent
[
j
]
->
SetCFtimeDelay
(
cfTD
);
tw
->
Bronch
(
bName
.
Data
(),
"AEvent"
,
&
wevent
[
j
]);
// create branches in atree to hold analyzed data
tw
->
Bronch
(
bName
.
Data
(),
"AEvent"
,
&
wevent
[
j
]);
// create branches in atree to hold analyzed data
}
}
...
...
macros/testShowCFD.cxx
View file @
d92d4eae
...
@@ -26,7 +26,7 @@ void testShowCFD()
...
@@ -26,7 +26,7 @@ void testShowCFD()
for
(
Int_t
i
=
0
;
i
<
6
;
i
++
)
{
for
(
Int_t
i
=
0
;
i
<
6
;
i
++
)
{
c1
->
cd
(
i
+
1
);
c1
->
cd
(
i
+
1
);
gr
[
i
]
->
Draw
();
gr
[
i
]
->
Draw
(
""
);
}
}
// c1->cd(2);
// c1->cd(2);
...
...
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