Deprecated: Array and string offset access syntax with curly braces is deprecated in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/init.php on line 542
ja:root:wantto16 [GiriWiki]

ユーザ用ツール

サイト用ツール


ja:root:wantto16

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

次のリビジョン
前のリビジョン
ja:root:wantto16 [2018/09/05 12:35]
kota 作成
ja:root:wantto16 [2018/09/05 12:47] (現在)
kota
ライン 7: ライン 7:
 最後の場合を、TH1を使って簡単に求める方法を考える。 最後の場合を、TH1を使って簡単に求める方法を考える。
  
-鍵は,TH1::​IntegralAndError().+鍵はTH1::​IntegralAndError().
  
 以下のコードに例を示す。 以下のコードに例を示す。
ライン 45: ライン 45:
   }   }
 } }
 +</​code>​
  
 +
 +例えばtreeからある条件を満たすweight付きのイベント数およびその統計誤差を求めたければ、
 +<code cpp>
 +  const TCut cut    = "​...";/////​ カット条件
 +  const TCut weight = "​...";/////​ weight ​
 +  TH1D *h = new TH1D("​h","",​1,​0,​1);​
 +  h->​Sumw2();​
 +  tree->​Project("​h","​val",​cut*weight);/////​ val は適当な変数名(treeが持っているbranch名の1つ)
 +  Double_t eIntegral;
 +  Double_t Integral = h->​IntegralAndError(0,​2,​eIntegral);​
 +  cout << " Integral = " << Integral << " +/- " << eIntegral << " ( " << eIntegral/​Integral *100 << " % )" << endl;
 </​code>​ </​code>​
 +のようにすれば良い。
ja/root/wantto16.1536150939.txt.gz · 最終更新: 2018/09/05 12:35 by kota