Online analysis
This section explain the example of the online analysis in the CRIB experiment.
This section explain the example of the online analysis in the CRIB experiment.
From here, we would like to explain in detail how to analyze the actual experiment. We assume that you have already prepared your the analysis environment. It is okay either your own directory or the default directory (see CRIB configuration). If you are not ready yet, please see here.
So let’s start to check the data.
At the F1 focal plane, there is (charge-divition) PPAC.
The steering file to analyze f1 data is chkf1.yaml
.
We usually use “chk” (check) as a prefix of the steering files to analyze from raw binaly data.
$ artlogin (username)
$ a
artemis [0] add steering/chkf1.yaml NAME=hoge NUM=0000
artemis [1] res
The important data is “X position” at the F1PPAC. The histogram can be check by following step:
artemis [2] sus
artemis [3] ls
artemis
> 0 art::TTreeProjGroup f1check f1_check
1 art::TAnalysisInfo analysisInfo
artemis [4] cd 0
artemis [5] ls
f1check
> 0 art::TH1FTreeProj f1ppac_X f1ppac X
1 art::TH1FTreeProj f1ppac_Y f1ppac Y
2 art::TH1FTreeProj f1ppac_X1raw f1ppac X1raw
3 art::TH1FTreeProj f1ppac_X2raw f1ppac X2raw
4 art::TH1FTreeProj f1ppac_Y1raw f1ppac Y1raw
5 art::TH1FTreeProj f1ppac_Y2raw f1ppac Y2raw
6 art::TH2FTreeProj f1ppac_x_y f1ppac X vs Y
7 art::TH2FTreeProj f1ppac_x_rf f1ppac X vs RF
8 art::TH2FTreeProj f1ppac_x1_x2 f1ppac x1 vs x2
9 art::TH2FTreeProj f1ppac_y1_y2 f1ppac y1 vs y2
Many histograms are defined, but in practice it’s enough to check the first X position. Sometimes we check other raw data histograms to see if the behavior of F1PPAC is correct or not.
artemis [6] ht 0
Usually a gaussian fit is performed to get center the position.
artemis [7] xf
For the commane “xf” (xfitg), please check here.
When you think the signals from F1PPAC is okay, but position seems wrong (the X position is different from the setting of F1 slit), pleace modify the parameter files.
It is actually charge-divition PPAC, but the structure of parameter file is the same with dl-PPAC, so please also check PPAC preparation.
The basic usage is the same.
We use this steering file to check F2 data.
$ artlogin (username)
$ a
artemis [0] add steering/chkf2.yaml NAME=hoge NUM=0000
artemis [1] res
artemis [2] sus
artemis [3] ls
artemis
> 0 art::TTreeProjGroup f2check f2_check
1 art::TAnalysisInfo analysisInfo
artemis [4] cd 0
artemis [5] ls
f2check
> 0 art::TH1FTreeProj f2PPAC X f2ppac x
1 art::TH1FTreeProj f2PPAC Y f2ppac y
2 art::TH1FTreeProj f2SSD raw f2ssd raw
3 art::TH1FTreeProj f2SSD raw (low) f2ssd raw (low)
4 art::TH1FTreeProj f2SSD cal f2ssd cal
5 art::TH2FTreeProj f2PPAC X vs Y f2ppac X vs Y
6 art::TH2FTreeProj F2PPAC X vs RF0 f2ppac X vs rf0
7 art::TH2FTreeProj F2PPAC Y vs RF0 f2ppac Y vs rf0
8 art::TH2FTreeProj RF0 vs F2SSD raw rf0 vs f2ssd raw
9 art::TH2FTreeProj RF0 vs F2SSD cal rf0 vs f2ssd cal
10 art::TH2FTreeProj RF1 vs F2SSD cal rf1 vs f2ssd cal
11 art::TH2FTreeProj F2PPAC X vs F2SSD raw f2ppac x vs f2ssd raw
12 art::TH2FTreeProj F2PPAC X vs F2SSD cal f2ppac x vs f2ssd cal
13 art::TH2FTreeProj F2PPAC Y vs F2SSD cal f2ppac y vs f2ssd cal
14 art::TH1FTreeProj RF0 rf0
As you know, you can check the histograms
# for 1D histograms
artemis [*] ht [id]
artemis [*] hn # histogram next
artemis [*] hb # histogram before (back?)
# for 2D histograms
artemis [*] ht [id] colz # colz is option
artemis [*] hn colz
artemis [*] hb colz
If you want to save,
artemis [*] sa
artemis [*] pri
updating…
updating…
In the CRIB experiment, we often use a “telescope” consisting of DSSSD (Double-Sided SSD) and SSD (Single-Pad SSD).
The combination of these multiple Si detectors as a dE-E detector is called a telescope
.
To analyze the data as telescope data rather than individual detectors, I created a data class called TTelescopeData. This section describes its data structure and usage.
Please assume that one of the name of TTelescopeData object is “tel1”
# after some process
artemis [*] br tel1
art::TTelescopeData
Data Members
TVector3 fPos detected position (X, Y, Z)
int fXID X strip number
int fYID Y strip number
int fNE number of all SSDs
double fdE energy at first layor
double fdEX X side energy (=~ fdEY)
double fdEY Y side energy (=~ fdEX)
double fE added energy at thick SSDs
double fEtotal all energy deposit in the telescope
double fTiming timing information at the first layor (X side)
double fYTiming for case that X side have trouble (Y side)
double fTheta_L reaction angle in LAB system
vector<double> fEnergyArray energy array for each SSD
vector<double> fTimingArray timing array for each SSD
ESortType kID
ESortType kTiming
ESortOrder kASC
ESortOrder kDESC
# snip for Method as for now
These are the all data members of the “TTelescopeData”. The most commonly used variables are “fXID”, “fYID”, “fdE” and “fE”. Other variables are accessed by using methods (explain later). The meaning of these variables are written the upper code block.
We use them like,
artemis [*] tree->Draw("tel1.fYID:tel1.fXID>>strip(16,-0.5,15.5, 16,-0.5,15.5)","","colz")
artemis [*] tree->Draw("tel1.fdE:tel1.fE","","")
or we can use in histogram definition file of course.
The following are the methods of the TTelescopeData object:
# after some process
artemis [*] br tel1
# snip for Data Members
Methods
TTelescopeData& operator=
TVector3 GetPosition
Double_t X
Double_t Y
Double_t Z
void SetPosition
void SetPosition
Int_t GetN
void SetN
Int_t GetXID
void SetXID
Int_t GetYID
void SetYID
Double_t GetdE
void SetdE
Double_t GetdEX
void SetdEX
Double_t GetdEY
void SetdEY
Double_t GetE
void SetE
Double_t GetEtotal
void SetEtotal
Double_t GetTelTiming
void SetTelTiming
Double_t GetTelYTiming
void SetTelYTiming
Double_t GetTheta_L
void SetTheta_L
Double_t A
DoubleVec_t GetEnergyArray
Double_t GetEnergyArray
void PushEnergyArray
DoubleVec_t GetTimingArray
Double_t GetTimingArray
void PushTimingArray
Double_t E
Double_t T
void Copy
void Clear
Bool_t CheckTObjectHashConsistency
See also
art::TDataObject base class for data object
The most commonly used methods are “X()”, “Y()”, “Z()”, “E()”, “T()” and “A()”. There are also longer name methods, but it is troublesome to write long methods, so I prepared short name methods. The longer name methods are mainly used in the source processor to make it more readable.
X()
: return fPos.X(), detected X positionY()
: return fPos.Y(), detected Y positionZ()
: return fPos.Z(), detected Z positionE()
: return fEtotal, total energy deposit in the telescopeE(id: int)
: return fEnergyArray[id], energy deposit of each Si layer, id=0 means dE, id=1 means second layerT()
: return fTiming, detected timing at first layerT(id: int)
: return fTimingArray[id], timing at the “id” th Si detectorA()
: return fTheta_L, the angle of the event, deg unitWe use them like:
artemis [*] tree->Draw("tel1.Y():tel1.X()","","colz")
artemis [*] tree->Draw("tel1.E(0):tel1.E()","","colz")
artemis [*] tree->Draw("tel1.E():tel1.A()","","colz")
In the physics run (production run or physics measurement), we check all the detector data like tracking detector (PPAC, MWDC), TOF (RF) and Telescope data. In order to analyse them, we prepared steering/chkf3.yaml steering file. This file includes all the information of F3 analysis.
$ artlogin (username)
$ a
artemis [0] add steering/chkf3.yaml NAME=hoge NUM=0000
artemis [1] res
artemis [2] sus
artemis [3] ls
artemis
> 0 art::TTreeProjGroup f3check f3check
1 art::TAnalysisInfo analysisInfo
2 art::TTreeProjGroup mwdca mwdca
3 art::TTreeProjGroup mwdcb mwdcb
4 art::TTreeProjGroup tel1 tel1
5 art::TTreeProjGroup tel2 tel2
6 art::TTreeProjGroup tel3 tel3
7 art::TTreeProjGroup tel4 tel4
8 art::TTreeProjGroup tel5 tel5
9 art::TTreeProjGroup tel6 tel6
10 art::TTreeProjGroup MUX MUX
11 TDirectory MWDCCalibHists MWDC calibration
# this is the situation at 2024/01/22
There are many histogram definition, and you can freely update the histogram files.
Because this file contains most of the knowledge about the steering file, so you can test your own histogram or something based on this file.
$ cd steering
$ cp chkf3.yaml chkYourOwnName.yaml
$ vi (emacs) chkYourOwnName.yaml
# change or test something
$ acd
$ a
artemis [0] add steering/chkYourOwnName.yaml NAME=hoge NUM=0000
artemis [1] res
artmeis [2] sus
# some analysis
It is very important to select events for online analysis as well. There are several options to do so, and I will cover all of them. If you know other useful way, please let me know.
For clearer understanding, we will use this figure, and we call this as default figure:
We explained in the Histograms page, but again we describe about histogram definition focus on the cut
part.
The default figure defined like this:
anchor:
- &f2ppacx ["f2ppac.fX",200,-50.,50.]
- &f2ppacy ["f2ppac.fY",200,-50.,50.]
alias:
group:
- name: f2check
title: f2_check
contents:
- name: f2PPAC X vs Y
title: f2ppac X vs Y
x: *f2ppacx
y: *f2ppacy
For example, let’s add the gate to select only “-10.0 < X < 10.0”. We can use alias node to define that.
anchor:
- &f2ppacx ["f2ppac.fX",200,-50.,50.]
- &f2ppacy ["f2ppac.fY",200,-50.,50.]
alias:
centerx: abs(f2ppac.fX) < 10.0;
group:
- name: f2check
title: f2_check
contents:
- name: f2PPAC X vs Y{centerx}
title: f2ppac X vs Y{centerx}
x: *f2ppacx
y: *f2ppacy
cut: centerx
Then the following histogram is created.
Also, multiple conditions can be specified at the same time.
anchor:
- &f2ppacx ["f2ppac.fX",200,-50.,50.]
- &f2ppacy ["f2ppac.fY",200,-50.,50.]
alias:
centerx: abs(f2ppac.fX) < 10.0;
centery: abs(f2ppac.fY) < 10.0;
group:
- name: f2check
title: f2_check
contents:
- name: f2PPAC X vs Y{centerx && centery}
title: f2ppac X vs Y{centerx && centery}
x: *f2ppacx
y: *f2ppacy
cut: centerx && centery
We can also use TCutG object to select the event.
As in new commands page, let’s assume we create this TCutG ROOT file by tcutg
command.
And the ROOT file and TCutG object name is f2star
.
If you want to use this object to select event, just add this line is fine, as long as you use userlogon.C.
anchor:
- &f2ppacx ["f2ppac.fX",200,-50.,50.]
- &f2ppacy ["f2ppac.fY",200,-50.,50.]
alias:
group:
- name: f2check
title: f2_check
contents:
- name: f2PPAC X vs Y{f2star}
title: f2ppac X vs Y{f2star}
x: *f2ppacx
y: *f2ppacy
cut: f2star
Of course we can use in “tree->Draw()” because this TCutG objects are automatically loaded. The following sentence generate the same figure.
artemis [] fcd 0
artemis [] zo
artemis [] tree->Draw("f2ppac.fY:f2ppac.fX>>(200,-50.,50., 200,-50.,50.)","f2star","colz")
The method used until now was to process just histograms and analyze them for all events in the event loop. If you know which events you don’t want, there are processors that allow you to skip the event loop under certain conditions. This may speed up the event loop.
For example. when we want to analyze only beam single
event (it means the events are not coincident with SSD, and let’s suppose that condition is given by single.fID==0
), let’s prepare the steering file.
Processor:
- name: proc_gateinit
type: art::TGateArrayInitializer
parameter:
OutputTransparency: 1
- name: proc_gate
type: art::TTreeFormulaGateProcessor
parameter:
Definitions:
- "beam_single; single.fID==0"
OutputTransparency: 1
Verbose: 1
- name: beam_single_gate
type: art::TGateStopProcessor
parameter:
GateName: beam_single
OutputTransparency: 1
StopIf: 0
Verbose: 1
To use TGateStopProcessor, we need to initialize the “gate” array object, so the first art::TGateArrayInitializer
is needed.
In the second processor, art::TTreeFormulaGateProcessor
, we define the gate condition.
Then the art::TGateStopProcessor
judges the event is skipped or not.
In the case of StopIf: 0
, artemis ignore the event that the condition become false
.
In other words, StopIf: 0
means artemis will analyze the event only when the condition is true
.
Then, including this yaml file to the main steering file, you can check only the selected events.
Anchor:
- &input ridf/@NAME@@NUM@.ridf
- &output output/@NAME@/@NUM@/hoge@NAME@@NUM@.root
- &histout output/@NAME@/@NUM@/hoge@NAME@@NUM@.hist.root
Processor:
- name: timer
type: art::TTimerProcessor
- name: ridf
type: art::TRIDFEventStore
parameter:
OutputTransparency: 1
InputFiles:
- *input
SHMID: 0
- name: mapper
type: art::TMappingProcessor
parameter:
OutputTransparency: 1
# include some other steering files
- include: gate/coin.yaml
- name: outputtree
type: art::TOutputTreeProcessor
parameter:
FileName:
- *output
We didn’t check if we can use the TCutG object in this process…
Artemis produces mainly TArtTree
and the branches are TClonesArray(art::hoge)
.
It means that all objects rely on the artemis library, and we cannot open and check the data by using normal ROOT.
Also, sometimes it is necessary top check the raw data obtained by ADC and TDC as it is. Of course, the real raw data is binary and therefore difficult to read, so we will check the raw data after the decoders.
Related processors;
We already prepared conf/map
files, but in this case, we need to prepare conf/seg
files.
There are two files.
This is an example, so please change it according to the experimental conditions.
#modulename:
# id: module id (it is module-specific)
# ch: channel number
# values:
# - name1: [Nbin: int, min: double, max: double] it is for 2D histogram (these values vs. ch)
# - name2: [Nbin: int, min: double, max: double] <= somehow two line needed...?
MADC32:
id: 32
ch: 32
values:
- adc: [4000, 0., 4000.]
- tdc: [4000, 0., 4000.] # no use, but seems it needed...
V1190A:
id: 24
ch: 128
values:
- tdcL: [300, -5000., 300000.]
- tdcT: [300, -5000., 300000.]
The module id list is here.
#segment_name:
# segid: [[dev], [fp], [det]] <= same as a map file
# type: V7XX <= defined type in modulelist.yaml
# modules:
# - id: geo1
# - id: geo2
V1190:
segid: [12, 0, 7]
type: V1190A
modules:
- id: 0
- id: 1
MADC:
segid: [12, 1, 6]
type: MADC32
modules:
- id: 0
- id: 1
- id: 2
Based on these two conf file, the steering/chkseg.yaml
file produce rawdata histograms and TTree object.
We can use steering/chkseg.yaml without any change I think.
This is an example from one CRIB experiment.
$ a
artemis [0] add steering/chkseg.yaml NAME=hoge NUM=0000
artemis [1] res
artemis [2] sus
artemis [3] ls
artemis
> 0 TDirectory SegmentHistogram art::TSegmentCheckProcessor
artemis [4] cd 0
artemis [5] ls
SegmentHistogram
> 0 TDirectory E7_V1190 E7_V1190
1 TDirectory J1_V785 J1_V785
2 TDirectory J1_MADC J1_MADC
3 TDirectory J1_V1190 J1_V1190
artemis [6] cd 0
artemis [7] ls
E7_V1190
> 0 TH2F E7_V1190_0_tdcL E7_V1190_0_tdcL
1 TH2F E7_V1190_0_tdcT E7_V1190_0_tdcT
2 TH2F E7_V1190_1_tdcL E7_V1190_1_tdcL
3 TH2F E7_V1190_1_tdcT E7_V1190_1_tdcT
# we can check these histograms by ht command
artemis [8] fcd 0
artemis [9] br
E7_V1190_0 vector<vector<int> >
E7_V1190_1 vector<vector<int> >
J1_V785_0 vector<int>
J1_V785_1 vector<int>
J1_V785_2 vector<int>
J1_MADC_3 vector<int>
J1_MADC_4 vector<int>
J1_MADC_5 vector<int>
J1_V1190_0 vector<vector<int> >
If the module ID = 24 or 25, it is multihit TDC, so the branch become 2D vector. When you want to use std::vector method, you can use by “@” like
artemis [*] tree->Draw("J1_V785_0@.size()")
Of course we can open this output ROOT file from normal ROOT.