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
50da89cb
Commit
50da89cb
authored
Jan 12, 2017
by
Muzalevsky I.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
script for painting integral form of signal modifed and moved to other directory
parent
6855412b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
integralFormSignal.cpp
macros/integralFormSignal.cpp
+71
-0
No files found.
macros/integralFormSignal.cpp
0 → 100644
View file @
50da89cb
void
integralFormSignal
()
{
gSystem
->
Load
(
"../libData.so"
);
TFile
*
f
=
new
TFile
(
"../data/dataTektronix/exp2.root"
);
TTree
*
tr
=
(
TTree
*
)
f
->
Get
(
"atree"
);
const
Int_t
noBranches
=
4
;
Double_t
ZeroTime
[
4
];
Int_t
iZero
[
4
],
PosZero
[
4
],
deltaT
[
4
];
TString
bName
;
AEvent
*
aevent
[
noBranches
];
// pointer to the array (of RawEvent class) in which raw data for each channel will be put
for
(
Int_t
j
=
0
;
j
<
noBranches
;
j
++
)
{
aevent
[
j
]
=
new
AEvent
();
//each raw event element is of class RawEvent()
bName
.
Form
(
"Ach%d."
,
j
);
tr
->
SetBranchAddress
(
bName
.
Data
(),
&
aevent
[
j
]);
//read the tree tr with raw data and fill array revent with raw data
}
TH1F
*
hist0
=
new
TH1F
(
"hist1"
,
"h1 title"
,
2000
,
-
100
,
100
);
TH1F
*
hist1
=
new
TH1F
(
"hist2"
,
"h2 title"
,
2000
,
-
100
,
100
);
TH1F
*
hist2
=
new
TH1F
(
"hist3"
,
"h3 title"
,
2000
,
-
100
,
100
);
TH1F
*
hist3
=
new
TH1F
(
"hist4"
,
"h4 title"
,
2000
,
-
100
,
100
);
TF1
*
fit1
=
new
TF1
(
"fit1"
,
"-[0]*exp(-x*[1])"
);
fit1
->
SetRange
(
-
15
,
-
5
);
fit1
->
SetParName
(
1
,
"tD"
);
Long64_t
nEntries
=
tr
->
GetEntries
();
//loop over events
for
(
j
=
0
;
j
<
nEntries
;
j
++
)
{
tr
->
GetEntry
(
j
);
for
(
Int_t
k
=
0
;
k
<
4
;
k
++
)
{
// loop for channels
ZeroTime
[
k
]
=
aevent
[
k
]
->
GetfCFD
();
// get fCFD for channel №k
iZero
[
k
]
=
ZeroTime
[
k
]
*
10
;
if
(
j
==
0
)
{
PosZero
[
k
]
=
iZero
[
k
];
}
deltaT
[
k
]
=
iZero
[
k
]
-
PosZero
[
k
];
}
//for(k=0;k<4;k++) {
for
(
Int_t
i
=
0
;
i
<
1000
;
i
++
){
if
(
((
i
+
deltaT
[
0
])
>-
1
)
&&
((
i
+
deltaT
[
0
])
<
1000
))
hist0
->
AddBinContent
(
i
+
500
,
aevent
[
0
]
->
GetOnefAmpPos
(
i
+
deltaT
[
0
]));
if
(
((
i
+
deltaT
[
1
])
>-
1
)
&&
((
i
+
deltaT
[
1
])
<
1000
))
hist1
->
AddBinContent
(
i
+
500
,
aevent
[
1
]
->
GetOnefAmpPos
(
i
+
deltaT
[
1
]));
hist2
->
AddBinContent
(
i
+
500
,
aevent
[
0
]
->
GetOnefAmpPos
(
i
));
hist3
->
AddBinContent
(
i
+
500
,
aevent
[
1
]
->
GetOnefAmpPos
(
i
));
}
//}
}
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"test"
,
10
,
10
,
1000
,
600
);
c1
->
Divide
(
2
,
2
);
c1
->
cd
(
1
);
hist0
->
Draw
();
//hist1->Fit("fit1","R","");
c1
->
cd
(
2
);
//hist2->Draw();
//hist2->Fit("fit1","R","");
//tr->Draw("Ach1.fCFD");
hist1
->
Draw
();
c1
->
cd
(
3
);
hist2
->
Draw
();
c1
->
cd
(
4
);
hist3
->
Draw
();
}
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