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
38e4b2e5
Commit
38e4b2e5
authored
Dec 29, 2016
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Names of event classes changed.
parent
8525a0b7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
301 deletions
+14
-301
read_binary.cpp
convertDRS4/read_binary.cpp
+3
-3
AnalyzeData.cpp
dataClasses/AnalyzeData.cpp
+0
-97
AnalyzeData.h
dataClasses/AnalyzeData.h
+0
-68
Data.mk
dataClasses/Data.mk
+8
-8
RawData.cpp
dataClasses/RawData.cpp
+0
-64
RawData.h
dataClasses/RawData.h
+0
-58
linkdef.h
dataClasses/linkdef.h
+2
-2
makefile
makefile
+1
-1
No files found.
convertDRS4/read_binary.cpp
View file @
38e4b2e5
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#include "TH1F.h"
#include "TH1F.h"
//our code
//our code
#include "../dataClasses/Raw
Data
.h"
#include "../dataClasses/Raw
Event
.h"
typedef
struct
{
typedef
struct
{
char
tag
[
3
];
char
tag
[
3
];
...
@@ -123,8 +123,8 @@ int main(int argc, const char * argv[])
...
@@ -123,8 +123,8 @@ int main(int argc, const char * argv[])
rtree
->
Branch
(
"amp_ch1"
,
amp_ch1
,
"amp_ch1[ncell]/D"
);
rtree
->
Branch
(
"amp_ch1"
,
amp_ch1
,
"amp_ch1[ncell]/D"
);
rtree
->
Branch
(
"time_ch1"
,
time_ch1
,
"time_ch1[ncell]/D"
);
rtree
->
Branch
(
"time_ch1"
,
time_ch1
,
"time_ch1[ncell]/D"
);
Raw
Data
*
event
=
new
RawData
();
Raw
Event
*
event
=
new
RawEvent
();
rtree
->
Bronch
(
"rawEvent"
,
"Raw
Data
"
,
&
event
);
rtree
->
Bronch
(
"rawEvent"
,
"Raw
Event
"
,
&
event
);
//------for other channels
//------for other channels
// rtree->Branch("amp_ch2", amp_ch2, "amp_ch2[ncell]/D");
// rtree->Branch("amp_ch2", amp_ch2, "amp_ch2[ncell]/D");
...
...
dataClasses/AnalyzeData.cpp
deleted
100644 → 0
View file @
8525a0b7
/*
* AnalyzeData.cpp
*
* Created on: Dec 28, 2016
* Author: daria
*/
#include "AnalyzeData.h"
AnalyzeData
::
AnalyzeData
()
{
// TODO Auto-generated constructor stub
// TGraph gr;
}
AnalyzeData
::~
AnalyzeData
()
{
// TODO Auto-generated destructor stub
}
void
AnalyzeData
::
SetRawDataFile
(
const
char
*
inprawfile
,
const
char
*
treename
)
{
TString
iFileName
=
inprawfile
;
TFile
*
fraw
=
new
TFile
(
iFileName
.
Data
());
if
(
!
fraw
->
IsOpen
()
)
{
Error
(
"SetRawDataFile"
,
"File %s was not opened and won't be processed"
,
iFileName
.
Data
());
// return 0;
}
TTree
*
traw
=
(
TTree
*
)
fraw
->
Get
(
treename
);
if
(
!
traw
)
{
Error
(
"SetRawDataFile"
,
"Tree %s was not found in file %s"
,
treename
,
iFileName
.
Data
());
// return 0;
}
//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() {
for (Int_t i = 0; i < NCELLS; i++) {
Amp[i] = 0;
Time[i] = 0;
}
}
void RawData::PrintTime(Int_t i) {
cout << Time[i] << endl;
}
void RawData::PrintAmp(Int_t i) {
cout << Amp[i] << endl;
}
void RawData::SetAmp(Double_t a, Int_t i) {
if (i >=NCELLS) {
cout << "Error: array with raw amplitudes is overloaded!" << endl;
return;
}
Amp[i] = a;
return;
}
void RawData::SetTime(Double_t t, Int_t i) {
if (i >=NCELLS) {
cout << "Error: array with raw times is overloaded!" << endl;
return;
}
Time[i] = t;
return;
}*/
dataClasses/AnalyzeData.h
deleted
100644 → 0
View file @
8525a0b7
/*
* AnalyzeData.h
*
* Created on: Dec 28, 2016
* Author: daria
*/
#ifndef DATACLASSES_ANALYZEDATA_H_
#define DATACLASSES_ANALYZEDATA_H_
#include <iostream>
#include <fstream>
#include <iomanip>
#include <sstream>
#include "TString.h"
#include "TTree.h"
#include "TFile.h"
#include "TMath.h"
#include "RawData.h"
#define NCELLS 1024
using
std
::
cout
;
using
std
::
endl
;
class
AnalyzeData
{
private
:
Double_t
fAmpPos
[
NCELLS
];
//array for raw amplitudes
Double_t
fTime
[
NCELLS
];
//array for raw times*/
Double_t
fAmpMax
;
Double_t
fTimeAmpMax
;
public
:
AnalyzeData
();
virtual
~
AnalyzeData
();
ClassDef
(
AnalyzeData
,
1
);
void
SetRawDataFile
(
const
char
*
inprawfile
,
const
char
*
treename
);
void
ProcessEvent
(
RawData
*
event
);
// void Integral()
/* void Reset();
//Resets arrays to zeros
const Double_t* GetAmp() const {
return Amp;
}
const Double_t* GetTime() const {
return Time;
}
void SetAmp(Double_t a, Int_t i);
//Takes amplitude (raw data, voltage from binary file)
//and places it in the array Amp[NCELLS]
void SetTime(Double_t t, Int_t i);
//Takes time (raw data, times from binary file)
//and places it in the array Time[NCELLS]
void PrintAmp(Int_t i);
void PrintTime(Int_t i);*/
};
#endif
/* DATACLASSES_ANALYZEDATA_H_ */
dataClasses/Data.mk
View file @
38e4b2e5
...
@@ -6,22 +6,22 @@ DATALIBS := -lHist #-lCore #-lCint -lRIO -lTree -lNet -lThread -lMatrix -lMathCo
...
@@ -6,22 +6,22 @@ DATALIBS := -lHist #-lCore #-lCint -lRIO -lTree -lNet -lThread -lMatrix -lMathCo
# Add inputs and outputs from these tool invocations to the build variables
# Add inputs and outputs from these tool invocations to the build variables
DATA_HEADERS += \
DATA_HEADERS += \
$(DATA)/Raw
Data
.h \
$(DATA)/Raw
Event
.h \
$(DATA)/A
nalyzeData
.h \
$(DATA)/A
Event
.h \
$(DATA)/linkdef.h
$(DATA)/linkdef.h
DATACPP_SRCS += \
DATACPP_SRCS += \
$(DATA)/Raw
Data
.cpp \
$(DATA)/Raw
Event
.cpp \
$(DATA)/A
nalyzeData
.cpp \
$(DATA)/A
Event
.cpp \
$(DATA)/DataCint.cpp
$(DATA)/DataCint.cpp
DATAOBJS += \
DATAOBJS += \
$(DATA)/Raw
Data
.o \
$(DATA)/Raw
Event
.o \
$(DATA)/A
nalyzeData
.o \
$(DATA)/A
Event
.o \
$(DATA)/DataCint.o
$(DATA)/DataCint.o
DATACPP_DEPS += \
DATACPP_DEPS += \
$(DATA)/Raw
Data
.d \
$(DATA)/Raw
Event
.d \
$(DATA)/A
nalyzeData
.d \
$(DATA)/A
Event
.d \
$(DATA)/DataCint.d
$(DATA)/DataCint.d
dataClasses/RawData.cpp
deleted
100644 → 0
View file @
8525a0b7
/*
* RawData.cpp
*
* Created on: Dec 27, 2016
* Author: vratik
*/
#include "RawData.h"
RawData
::
RawData
()
{
// TODO Auto-generated constructor stub
TGraph
gr
;
}
RawData
::~
RawData
()
{
// TODO Auto-generated destructor stub
}
void
RawData
::
Reset
()
{
for
(
Int_t
i
=
0
;
i
<
NCELLS
;
i
++
)
{
Amp
[
i
]
=
0
;
Time
[
i
]
=
0
;
}
}
void
RawData
::
PrintTime
(
Int_t
i
)
{
cout
<<
Time
[
i
]
<<
endl
;
}
void
RawData
::
PrintAmp
(
Int_t
i
)
{
cout
<<
Amp
[
i
]
<<
endl
;
}
void
RawData
::
SetAmp
(
Double_t
a
,
Int_t
i
)
{
if
(
i
>=
NCELLS
)
{
cout
<<
"Error: array with raw amplitudes is overloaded!"
<<
endl
;
return
;
}
Amp
[
i
]
=
a
;
return
;
}
void
RawData
::
SetTime
(
Double_t
t
,
Int_t
i
)
{
if
(
i
>=
NCELLS
)
{
cout
<<
"Error: array with raw times is overloaded!"
<<
endl
;
return
;
}
Time
[
i
]
=
t
;
return
;
}
/*void RawData::InvertAmp(Double_t a,Int_t i) {
if (i >=NCELLS) {
cout << "Error: array with raw amplitudes for turn over is overloaded!" << endl;
return;
}
Amplitude[i] = a*(-1.);
return;
}*/
dataClasses/RawData.h
deleted
100644 → 0
View file @
8525a0b7
/*
* RawData.h
*
* Created on: Dec 27, 2016
* Author: vratik
*/
#ifndef DATACLASSES_RAWDATA_H_
#define DATACLASSES_RAWDATA_H_
#include <iostream>
#include "TGraph.h"
#define NCELLS 1024
using
std
::
cout
;
using
std
::
endl
;
class
RawData
{
private
:
Double_t
Amp
[
NCELLS
];
//array for raw amplitudes
Double_t
Time
[
NCELLS
];
//array for raw times
// Double_t Amplitude[NCELLS]; //array for inverted amplitudes
public
:
RawData
();
virtual
~
RawData
();
ClassDef
(
RawData
,
1
);
void
Reset
();
//Resets arrays to zeros
const
Double_t
*
GetAmp
()
const
{
return
Amp
;
}
const
Double_t
*
GetTime
()
const
{
return
Time
;
}
void
SetAmp
(
Double_t
a
,
Int_t
i
);
//Takes amplitude (raw data, voltage from binary file)
//and places it in the array Amp[NCELLS]
void
SetTime
(
Double_t
t
,
Int_t
i
);
//Takes time (raw data, times from binary file)
//and places it in the array Time[NCELLS]
void
PrintAmp
(
Int_t
i
);
//Prints i amplitudes (to make sense i shold be NCELLS)
void
PrintTime
(
Int_t
i
);
// void InvertAmp(Double_t a, Int_t i);
//Inverts the amplitudes i.e. makes from negative singals
//posititve signals and vise versa.
};
#endif
/* DATACLASSES_RAWDATA_H_ */
dataClasses/linkdef.h
View file @
38e4b2e5
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
#pragma link off all classes;
#pragma link off all classes;
#pragma link off all functions;
#pragma link off all functions;
#pragma link C++ class Raw
Data
;
#pragma link C++ class Raw
Event
;
#pragma link C++ class A
nalyzeData
;
#pragma link C++ class A
Event
;
//#pragma link C++ class ConfigDictionary;
//#pragma link C++ class ConfigDictionary;
...
...
makefile
View file @
38e4b2e5
...
@@ -59,7 +59,7 @@ libData.so: $(DATAOBJS)
...
@@ -59,7 +59,7 @@ libData.so: $(DATAOBJS)
@
echo
'Finished building target: $@'
@
echo
'Finished building target: $@'
@
echo
' '
@
echo
' '
read_binary_DRS4
:
libData.so $(CONVERTDRS4)/read_binary.cpp
read_binary_DRS4
:
$(CONVERTDRS4)/read_binary.cpp libData.so
@
echo
'Building target: $@'
@
echo
'Building target: $@'
@
echo
'Invoking: GCC C++ Linker'
@
echo
'Invoking: GCC C++ Linker'
# $(CC) -L $(ROOTLIBS) -shared -o"libData.so" $(DATAOBJS) $(DATALIBS)
# $(CC) -L $(ROOTLIBS) -shared -o"libData.so" $(DATAOBJS) $(DATALIBS)
...
...
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