• 検索結果がありません。

2 HBOOK の作成 module で histogram/ntuple を定義 作成 #include "tuple/belletuplemanager.h" class User_ana : public Module { public: void hist_def ( void ); pri

N/A
N/A
Protected

Academic year: 2021

シェア "2 HBOOK の作成 module で histogram/ntuple を定義 作成 #include "tuple/belletuplemanager.h" class User_ana : public Module { public: void hist_def ( void ); pri"

Copied!
23
0
0

読み込み中.... (全文を見る)

全文

(1)

2000.04.22 Software Festa

PAW/HBOOK

戸村友宣

(東京大学)

(2)

HBOOKの作成

• moduleでhistogram/ntupleを定義、

作成

#include "tuple/BelleTupleManager.h" class User_ana : public Module { public:

void hist_def ( void ); … private: BelleHistogram* H1; BelleHIstogram* H2; BelleTuple* T1; … }

void User_ana::hist_def ( void ) {

extern BelleTupleManager* BASF_Histogram; BelleTupleManager* tm = BASF_Histogram;

H1 = tm->histogram("title", Nbin, min, max, id); //id は指定しなければ順番 H2 = tm->histogram("title", Nbinx, xmin, xmax, Nbiny, ymin, ymax, id); T1 = tm->ntuple("title", "var1 var2 …", id);

}

void User_ana::event ( BelleEvent* evptr, int* status ) { … H1->accumulate(x, 1.0);  //weight は指定しなければ 1.0 H2->accumulate(x, y, 1.0); T1->column("var1", val1); T1->column("var2", val2); … T1->dumpData();  //これをしないと保存されない }

(3)

HBOOKの作成(続き)

• BASFでHBOOK fileを指定

basf> path add_module main user_ana

basf> initialize

basf> histogram define test.hbook

basf> process_event test.bbs 0

basf> terminate

– test.hbookというファイルができる。

– PAW, Mn_Fit, DISPLAY45など

(4)

PAW

• 参考文献

– PAW An Introductory Tutorial

• CERN Program Library Long

Writeup Q121

– PAW Which Even Monkeys Can

Use (猿でも使えるPAW)

• 起動

– pathが通っているものとして

xxxxxx [DCE:bwgxxx]% paw Calling 96a version of paw-X11

****************************************************** * * * W E L C O M E to P A W * * * * Version 2.07/23 13 May 1996 * * * ****************************************************** Workstation type (?=HELP) <CR>=1 : ←普通はただreturn Version 1.23/07 of HIGZ started

*** No default PAWLOGON file "/home/users/xxx/xxxxxx/.pawlogon.kumac" f ound

(5)

• 終了

PAW > quit

Exiting from PAW.

xxxxxx [DCE:bwgxxx]%

• ヘルプ

– command(指定しなければカテゴ

リーから選択)についてのヘルプ

を表示。表示手段はhost_pagerで

変更。($PAGER,$EDITORが

default。なければvi。)

– commandの使い方の表示。

• HBOOKファイルを開く

– lun : Logical Unit Number

• 0なら次に空いている番号。

– //LUNlun というdirectoryができる。

PAW > help [

command

]

PAW > usage

command

(6)

– PAWのdirectory

• // : Top

– //PAWC : memory上のPAWの作業領

– //LUN1など : userが開いたファイル

• directory関連のcommand(zebra/rz/)

– ldir : directoryの中身を表示。

– cdir : 指定したdirectoryへ移動。何も

指定しなければ今いるdirectoryを表示。

• ファイルを閉じる

– LUNがlunのファイルを閉じる。0

なら全て閉じる。

• histogram/ntupleの一覧を表示

P AW > c lo s e

lu n

PAW > histogram/list [

option

]

===> Directory :

1 (1) Mass difference

2 (1) Mass

3 (1) Proper time

4 (1) Proper time(3[s])

5 (1) Proper time(sideband)

6 (N)

(7)

D+-• histogramを表示する

– 範囲指定はid(min:max)のように

しておこなう。

• min,maxが整数ならbinの数、実数

なら横軸の値。

PAW > h is to g ra m /p lo t [id o p tion]

(8)

• ntupleの一覧を表示

• ntupleのsummaryを表示

• ntupleのplot

– varをhistogramとしてplot。結果

はidh(defaultは1000000に保存。)

– 引数は!でdefaultを指定。

– で2次元plot。(縦軸var1、横軸

var2。)

PAW > ntuple/print id ******************************************************** * NTUPLE ID= id ENTRIES= xx name

******************************************************** * Var numb * Name * Lower * Upper * ******************************************************** * 1 * var1 * 0.600000E+01 * 0.800000E+01 * * 2 * var2 * 0.250000E+03 * 0.223860E+05 * * 3 * var3 * 0.174913E+01 * 0.199489E+01 * ********************************************************

PAW > ntuple/list

===> Directory :

6 (N)

D+-PAW > ntuple/plot

id

.

var

[

uwfunc nevent ifirst nupd option idh

]

(9)

– まずhistoramを作る。

– projectする。

• ntupleをdumpする

– ファイル(指定しなければ画面)

にvarの値を書き出す。

– 変数の区切りはsep2。

• cut(uwfunc)について

– 指定することでuwfuncが1となる

eventだけを選ぶことができる。

• 例

–  

–  

としておいて

– これらのcombinationも可。

PAW > h istog ra m /cre a te /1 d h isto id title n b in m in m a x [v a lm a x] PAW > h is to g ra m /crea te /2 d h is to id title x n b in x m in x m a x y n b in y m in y m a x [v a lm a x]

PAW > n tu p le /p r o je c t id h id n .v a r [u w fu n c n e v e n t ifirs t]

PAW > n tu p le/d u m p id n .v a r(% v a r2 … ) [u w fu n c n e v e n t ifirst file n a m e se p 1 se p 2]

x>1.5.and.y>2.0

PAW > ntuple/cuts $1 x>1.5.and.y>2.0

(10)

• histogramのfit

– 簡単な場合

• g :

• e :

• pn :

PAW > histogram/fit

id func

[

option np par step pmin pmax

errpar

]

( )

( )

( )

°¿ ° ¾ ½ °¯ ° ® ­ ¸¸¹ · ¨¨© § − ∗ − ∗ 2 3 2 5 . 0 exp 1 par par x par

( )

( )

(

par

1

+

par

2

x

)

exp

( )

( )

(

)

n

x

n

par

x

par

par

1

+

2

+



+

+

1

PAW > histogram/fit 1 g 1 ********************************************** * * * Function minimization by SUBROUTINE HFITGA * * Variable-metric method * * ID = 1 CHOPT = TU * * * **********************************************

Convergence when estimated distance to minimum (EDM) .LT. 0.10E+01

FCN= 0.5793983E-09 FROM MIGRAD STATUS=CONVERGED 40 CALLS 41 TOTAL EDM= 0.14E-05 STRATEGY=1 ERROR MATRIX UNCERTAINTY= 6.1%

EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 Constant 300.00 3.8190 -0.20826E-02 -0.37340E-05 2 Mean 0.28181E-05 0.11532E-01 0.19468E-06 0.12987E-07 3 Sigma 1.0000 0.53840E-02 0.73329E-05 0.28646

(11)

– 高度な場合

• functionをfortranで書く。

• fit用のvectorを作る。

– typeはI(Integer)かR(Real)。

– 例えば

• fitする。例えば

• optionの例

– e : better error estimation

– l : likelihood fit

REAL FUNCTION MASS(X) COMMON/PAWPAR/PAR(5)

DOUBLE PRECISION M_PI,MEAN

PARAMETER(M_PI=3.14159265358979323846D+00) MASS=PAR(1)*0.14/50/SQRT(2.0*M_PI)/PAR(3)*

& EXP(-0.5*((X-PAR(2))/PAR(3))**2)+PAR(4)+PAR(5)*X END

PAW > vector/create

name

(

size

)

[

type values

]

PAW > vector/create par(5) R 800 1.87 0.005 10 -0.01

PAW > histogram/fit 1 mass.for ! 5 par

(12)

• vectorを使う

– ファイルから読みこむ。

• vectorが定義されていなければ新

たに作られる。

• formatはFortran形式で指定。

– ‘F10.5,2X,F10.5’など

• matchによりmatchした行だけを読

むことも可能。

– vectorの一覧を表示。

– vectorの中身を表示。

– vectorを消す。

• vlist : vectorを‘,’で区切ったもの。

末尾の*はwild-card。

– vectorに値を代入。

PAW > vector/read

vec1,vec2,… filename

[

format option match

]

PAW > v e c t o r /lis t

P A W > v e c t o r /p r in t

v e c

[

d e n s e

]

P A W > v e c t o r /d e le t e

v lis t

(13)

– ファイルに書き出す。

• ファイルを指定しなければ画面に

書き出される。

– vec(i) vs. i をplotする。

– vectorをhistogramにおとす。

• binや範囲は自動的に決まる。

• 既存のhistogramにfillする。

– scatter plot

• n : 点の数。 x,y : vector。

– error bar付きscatter plot

• n : 点の数。 x,y : vextor。

• ex,ey : x,yのエラー。

PAW > vector/write

vec1,vec2,…

[

filename format option

]

PAW > v e c t o r /d r a w

v e c

[

id o p tio n

]

P A W > v e c t o r /p lo t

v e c

(%

v e c 2

) [

id o p t io n

]

P A W > v e c t o r /h fill

v e c

(%

v e c 2

)

id

PAW > graphics/primitives/graph

n x y

[

option

]

(14)

– 演算 vector/operations/

• vbias : vec2(i) = vec1(i)+bias

• vscale : vec2(i) = scale*vec1(i)

• vadd : vec3(i) = vec1(i)+vec2(i)

• vsubtract : vec3(i) = vec1(i)-vec2(i)

• vmultiply : vec3(i) = vec1(i)*vec2(i)

• vdivide : vec3(i) = vec1(i)/vec2(i)

– SIGMA

• vector を作る。

• 要素同士の演算

– 四則演算、べき乗、三角関数、Bessel

関数など

• SIGMA functions

– vmin, vmax, vsumなど

PAW > sig m a v e c1 = a rra y (1 0 , -p i# p i)

PAW > sig m a v e c2 = a rra y (5 , 1 & 2 & 3 & 4 & 5 )

PAW > sigm a vec1 = exp(-0.5*vec1**2)*sin(vec1)

(15)

• functionのplot

– ufuncはsin(x)/xなどと書くか、

Fortranの関数(関数名.for)。

– 一次元のみ。

– 三次元。範囲、視点、点の数は

で設定。

– histogramを作ってfillする。

PAW > function/plot

ufunc xmin xmax

[

option

]

PAW > function/draw

ufunc

[

option

]

PAW > function/range [

xmin xmax ymin ymax zmin zmax

]

PAW > function/angle [

theta phi

]

PAW > function/points [

nx ny nz

]

PAW > function/fun1

id ufunc bin min max

[

option

]

(16)

• (多少)高度な図の書き方

– 画面の分割

• 画面をnx x nyに分割。

• option sにより途中から変更可能。

• 例

PAW > g ra ph ics/v iew in g /zon e [

n x n y ifirst op tion

]

PAW > graphics/veiwing/zone 1 4

PAW > histogram /plot 1

PAW > histogram /plot 2

PAW > graphics/viewing/zone 2 2 3 s

PAW > histogram /plot 3

(17)

– グラフの重ね書き

• opstionにs(superimpose)があるもの

はこれを指定することで可能。

• optionにw(window)があるものはこ

れを指定しないことで可能。

– 空のframeを書く

– 全体のタイトルをつける

• optionでuを指定すると個々の

histogramのタイトルになる。ただし

表示するにはgraphics/optionでutit

を指定する必要がある。

– 軸にラベルをつける

• ialgn : ラベルの位置 nnn

– 1: はじめ 2: 中

3: おわり

• option

– r: yのラベルが右

t: xのラベルが上

PAW > graphics/hplot/null [

xmin xmax ymin ymax option

]

PAW > histogram/create/title_global [

title option

]

(18)

– 図形を書く

• 直線

• 矢印

• Box

• 円弧

• 螺旋

• テキスト

PAW > graphics/primitives/line

x1 y1 x2 y2

PAW > graphics/primitives/arrow

x1 y1 x2 y2

[

size

]

PAW > graphics/primitives/box

x1 y1 x2 y2

PAW > graphics/primitives/arc

x y r1

[

r2 phimin phimax

]

PAW > graphics/primitives/helix [

x1 y1 x2 y2 r n phi

]

PAW > graphics/primitives/text

x y text size

[

angle option

]

(19)

– 属性、オプションの設定

• いずれも引数がなければ現在の設

定を表示。

• *を引数に指定することでdefaultに

戻る。

• 例

– opt liny/logy : linear/log scale

– opt grid/ngri : grid

– opt A4 : page size

– opt stat/nsta : print statistics

– opt fit/nfit : print fit parameters

– opt htit/utit : histogram/user title

– opt date/ndat : print date

– opt file/nfil : print filename

– set *fon -130 : change font

– set *wid 2 : change line width

– set *col 2: change color

– igset mtyp 24 : marker type

PAW > g ra p h ics/se t [

a ttrib u te v a lu e

]

PAW > p ictu re /ig se t [

a ttrib u te v a lu e

]

PAW > g ra p h ics/o p tio n [

o p tio n

]

(20)

• 結果をpostscript(eps)に出す

– 出力先のファイルを開く。

– タイプを設定する。

• type=–111 : postscript(portrait)

• type=–113 : EPS

– プロットする。

– ファイルを閉じる。

– 例えば

PAW > fortran/file

lun

name

[

status

]

PAW > graphics/metafile [

lun type chmeta

]

PAW > fo r t r a n /c lo s e

lu n

PAW > fortran/file 23 test.eps

PAW > graphics/metafile 23 -113

PAW > histogram/plot 1

(21)
(22)

• macroを使う

– filename.kumacというファイルを

作る。

– 実行する。

• 1つのファイルに複数のマクロを定

義した場合は

– 変数

• name=valueで定義。値を参照する

には[name]のようにする。

• [n]でargsが参照できる。

– flow control

• goto, if, do loop, for loop, whileなど

が使える。

macro

name

commands

return

PAW > macro/exec

filename

[

args

]

(23)

• その他

– command名は一意に決まるなら

省略可。(h/pl,g/hp/errなど)

– shellを呼び出す。

– kuip/functions

• $date, $time

• $vdim(vec, idim)

• $sigma(expression)

• $format(num, format)

• $shell(cmd[, n])

• $hinfo(id, ‘...’)

• $grafinfo(‘wnxmin’), …

– !でhistoryが使える。

参照

関連したドキュメント

ホーム &gt;政策について &gt;分野別の政策一覧 &gt;福祉・介護 &gt;介護・高齢者福祉

Joshi; Existence and nonexistence of solutions of sublinear problems with prescribed num- ber of zeros on exterior domains, Electronic Journal of Differential Equations, 2017 No..

Thus, Fujita’s result says that there are no global, nontrivial solutions of (1.3) whenever the blow up rate for y(t) is not smaller than the decay rate for w(x, t) while there are

る無機顔料 ASP® 101 Mineral pigment used in Coating or Filling. ASP®

(The definition of this invariant given in [13] is somewhat different from the one we use, which comes from [23], but the two definitions can be readily shown to agree.) Furuta and

&lt; &gt;内は、30cm角 角穴1ヶ所に必要量 セメント:2.5(5)&lt;9&gt;kg以上 砂 :4.5(9)&lt;16&gt;l以上 砂利 :6 (12)&lt;21&gt; l

Section 3 discusses the connection to automorphic forms, states the needed form of the Langlands conjecture, and gives the reduction of Theorem 1.6 to showing the non-existence

Applying the gluing formula to the above decomposition instead of the sum theorem, we can obtain a simpler method to compute the Reidemeister torsion for the pair.. We will now