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
96538c9e
Commit
96538c9e
authored
Dec 28, 2016
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Class for analyzed event modified. Script for analysis added.
parent
8f6e3e68
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
28 deletions
+50
-28
read_binary.cpp
convertDRS4/read_binary.cpp
+1
-1
analysis_07_1.root
data/dataDSR4/analysis_07_1.root
+0
-0
NeuRad_test_07_1.root
data/rawDataDSR4/NeuRad_test_07_1.root
+0
-0
AnalyzeData.cpp
dataClasses/AnalyzeData.cpp
+30
-4
AnalyzeData.h
dataClasses/AnalyzeData.h
+15
-19
RawData.cpp
dataClasses/RawData.cpp
+2
-2
RawData.h
dataClasses/RawData.h
+2
-2
No files found.
convertDRS4/read_binary.cpp
View file @
96538c9e
...
@@ -254,7 +254,7 @@ int main(int argc, const char * argv[])
...
@@ -254,7 +254,7 @@ int main(int argc, const char * argv[])
if
(
chn_index
==
0
)
{
if
(
chn_index
==
0
)
{
amp_ch1
[
i
]
=
waveform
[
b
][
chn_index
][
i
];
amp_ch1
[
i
]
=
waveform
[
b
][
chn_index
][
i
];
event
->
SetAmp
(
waveform
[
b
][
chn_index
][
i
],
i
);
event
->
SetAmp
(
waveform
[
b
][
chn_index
][
i
],
i
);
event
->
InvertAmp
(
waveform
[
b
][
chn_index
][
i
],
i
);
//
event->InvertAmp(waveform[b][chn_index][i], i);
/*printf("old ampl %f ",amp_ch1[i]);
/*printf("old ampl %f ",amp_ch1[i]);
event->PrintAmp(i);
event->PrintAmp(i);
printf("\n");*/
printf("\n");*/
...
...
data/dataDSR4/analysis_07_1.root
View file @
96538c9e
No preview for this file type
data/rawDataDSR4/NeuRad_test_07_1.root
View file @
96538c9e
No preview for this file type
dataClasses/AnalyzeData.cpp
View file @
96538c9e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
AnalyzeData
::
AnalyzeData
()
{
AnalyzeData
::
AnalyzeData
()
{
// TODO Auto-generated constructor stub
// TODO Auto-generated constructor stub
TGraph
gr
;
//
TGraph gr;
}
}
...
@@ -18,21 +18,47 @@ AnalyzeData::~AnalyzeData() {
...
@@ -18,21 +18,47 @@ AnalyzeData::~AnalyzeData() {
// TODO Auto-generated destructor stub
// TODO Auto-generated destructor stub
}
}
Bool_t
AnalyzeData
::
SetRawDataFile
(
const
char
*
inprawfile
,
const
char
*
treename
)
{
void
AnalyzeData
::
SetRawDataFile
(
const
char
*
inprawfile
,
const
char
*
treename
)
{
TString
iFileName
=
inprawfile
;
TString
iFileName
=
inprawfile
;
TFile
*
fraw
=
new
TFile
(
iFileName
.
Data
());
TFile
*
fraw
=
new
TFile
(
iFileName
.
Data
());
if
(
!
fraw
->
IsOpen
()
)
{
if
(
!
fraw
->
IsOpen
()
)
{
Error
(
"SetRawDataFile"
,
"File %s was not opened and won't be processed"
,
iFileName
.
Data
());
Error
(
"SetRawDataFile"
,
"File %s was not opened and won't be processed"
,
iFileName
.
Data
());
return
0
;
//
return 0;
}
}
TTree
*
traw
=
(
TTree
*
)
fraw
->
Get
(
treename
);
TTree
*
traw
=
(
TTree
*
)
fraw
->
Get
(
treename
);
if
(
!
traw
)
{
if
(
!
traw
)
{
Error
(
"SetRawDataFile"
,
"Tree %s was not found in file %s"
,
treename
,
iFileName
.
Data
());
Error
(
"SetRawDataFile"
,
"Tree %s was not found in file %s"
,
treename
,
iFileName
.
Data
());
return
0
;
//
return 0;
}
}
//traw->Draw
//traw->Draw
}
}
void
AnalyzeData
::
ProcessEvent
(
RawData
*
event
)
{
const
Double_t
*
amp
=
event
->
GetAmp
();
const
Double_t
*
time
=
event
->
GetTime
();
for
(
Int_t
j
=
0
;
j
<
NCELLS
;
j
++
)
{
fAmpPos
[
j
]
=
amp
[
j
]
*
(
-
1.
);
fTime
[
j
]
=
time
[
j
];
}
Double_t
maxAmp
=
0.
;
Double_t
maxAmpT
=
0.
;
maxAmp
=
fAmpPos
[
0
];
for
(
Int_t
j
=
0
;
j
<
NCELLS
;
j
++
)
{
if
(
fAmpPos
[
j
]
>
maxAmp
)
{
maxAmp
=
fAmpPos
[
j
];
maxAmpT
=
fTime
[
j
];
}
}
fAmpMax
=
maxAmp
;
fTimeAmpMax
=
maxAmpT
;
}
/*
/*
void RawData::Reset() {
void RawData::Reset() {
...
...
dataClasses/AnalyzeData.h
View file @
96538c9e
...
@@ -7,26 +7,19 @@
...
@@ -7,26 +7,19 @@
#ifndef DATACLASSES_ANALYZEDATA_H_
#ifndef DATACLASSES_ANALYZEDATA_H_
#define DATACLASSES_ANALYZEDATA_H_
#define DATACLASSES_ANALYZEDATA_H_
#include <iostream>
#include <iostream>
#include <fstream>
#include <fstream>
#include <iomanip>
#include <iomanip>
#include <sstream>
#include <sstream>
#include "TGraph.h"
#include <TObject.h>
#include "TString.h"
#include <TFile.h>
#include "TTree.h"
#include <TTree.h>
#include "TFile.h"
#include <TH1I.h>
#include "TMath.h"
#include <TPolyMarker.h>
#include <TF1.h>
#include "RawData.h"
#include <TH1F.h>
#include <TH2F.h>
#include <TCanvas.h>
#include <TMath.h>
#include <TGraph.h>
#include <TObjArray.h>
#include <THStack.h>
#include <TString.h>
#include <TSpectrum.h>
#define NCELLS 1024
#define NCELLS 1024
using
std
::
cout
;
using
std
::
cout
;
...
@@ -36,15 +29,18 @@ class AnalyzeData {
...
@@ -36,15 +29,18 @@ class AnalyzeData {
private
:
private
:
/* Double_t Amp[NCELLS]; //array for raw amplitudes
Double_t
fAmpPos
[
NCELLS
];
//array for raw amplitudes
Double_t Time[NCELLS]; //array for raw times*/
Double_t
fTime
[
NCELLS
];
//array for raw times*/
Double_t
fAmpMax
;
Double_t
fTimeAmpMax
;
public
:
public
:
AnalyzeData
();
AnalyzeData
();
virtual
~
AnalyzeData
();
virtual
~
AnalyzeData
();
ClassDef
(
AnalyzeData
,
1
);
ClassDef
(
AnalyzeData
,
1
);
Bool_t
SetRawDataFile
(
const
char
*
inprawfile
,
const
char
*
treename
);
void
SetRawDataFile
(
const
char
*
inprawfile
,
const
char
*
treename
);
void
ProcessEvent
(
RawData
*
event
);
// void Integral()
// void Integral()
/* void Reset();
/* void Reset();
//Resets arrays to zeros
//Resets arrays to zeros
...
...
dataClasses/RawData.cpp
View file @
96538c9e
...
@@ -53,12 +53,12 @@ void RawData::SetTime(Double_t t, Int_t i) {
...
@@ -53,12 +53,12 @@ void RawData::SetTime(Double_t t, Int_t i) {
return
;
return
;
}
}
void
RawData
::
InvertAmp
(
Double_t
a
,
Int_t
i
)
{
/*
void RawData::InvertAmp(Double_t a,Int_t i) {
if (i >=NCELLS) {
if (i >=NCELLS) {
cout << "Error: array with raw amplitudes for turn over is overloaded!" << endl;
cout << "Error: array with raw amplitudes for turn over is overloaded!" << endl;
return;
return;
}
}
Amplitude[i] = a*(-1.);
Amplitude[i] = a*(-1.);
return;
return;
}
}
*/
dataClasses/RawData.h
View file @
96538c9e
...
@@ -19,7 +19,7 @@ class RawData {
...
@@ -19,7 +19,7 @@ class RawData {
private
:
private
:
Double_t
Amp
[
NCELLS
];
//array for raw amplitudes
Double_t
Amp
[
NCELLS
];
//array for raw amplitudes
Double_t
Time
[
NCELLS
];
//array for raw times
Double_t
Time
[
NCELLS
];
//array for raw times
Double_t
Amplitude
[
NCELLS
];
//array for inverted amplitudes
//
Double_t Amplitude[NCELLS]; //array for inverted amplitudes
public
:
public
:
RawData
();
RawData
();
virtual
~
RawData
();
virtual
~
RawData
();
...
@@ -49,7 +49,7 @@ public:
...
@@ -49,7 +49,7 @@ public:
void
PrintTime
(
Int_t
i
);
void
PrintTime
(
Int_t
i
);
void
InvertAmp
(
Double_t
a
,
Int_t
i
);
//
void InvertAmp(Double_t a, Int_t i);
//Inverts the amplitudes i.e. makes from negative singals
//Inverts the amplitudes i.e. makes from negative singals
//posititve signals and vise versa.
//posititve signals and vise versa.
...
...
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