#include <map>
#include <vector>
#include <iostream>
#include "TFile.h"
#include "TSystemFile.h"
#include "TSystemDirectory.h"
#include "TList.h"
#include "TString.h"
#include "TTree.h"
#include "TEventList.h"
Go to the source code of this file.
int cnt_events |
( |
TTree * |
t, |
|
|
TString |
cut, |
|
|
bool |
globcnt = false |
|
) |
| |
Definition at line 126 of file simu_tag.C.
References ev, and evcnt.
131 TEventList *el=(TEventList*)gDirectory->Get(
"el");
133 t->SetBranchStatus(
"*",0);
134 t->SetBranchStatus(
"ev",1);
135 t->SetBranchAddress(
"ev",&ev);
137 std::map<int, int> sigcnt;
138 for (
int j=0;j<el->GetN();++j)
140 t->GetEntry(el->GetEntry(j));
142 if (globcnt)
evcnt[(int)ev]+=1;
144 t->SetBranchStatus(
"*",1);
145 return sigcnt.size();
Definition at line 115 of file simu_tag.C.
References f, and n.
Referenced by simu_tag().
117 TFile *
f=
new TFile(fname,
"READ");
118 TTree *
n = (TTree*) f->Get(
"ntp");
120 int N0 = n->GetEntries(bgcut);
void get_tuples |
( |
TString |
beg = "" | ) |
|
Definition at line 88 of file simu_tag.C.
References cuts, file, files, lfiles, next, ntps, and TString.
Referenced by simu_tag().
90 TSystemDirectory dir(
".",
".");
91 TList *
files = dir.GetListOfFiles();
97 while ((file=(TSystemFile*)
next()))
99 fname = file->GetName();
100 if (!file->IsDirectory() && fname.BeginsWith(beg) && fname.EndsWith(
".root")) {
102 cout<<
"Found " << fname.Data() <<endl;
105 if (
cuts.count(nname)!=0){
106 ntps.push_back(nname);
std::map< int, TString > files
std::vector< TString > ntps
std::vector< TString > lfiles
Definition at line 23 of file simu_tag.C.
References cuts.
Referenced by simu_tag().
27 cuts[
"nphi"] =
"phipt>0.239374&&phid1pidpi<0.0114195&&npidkl>1.99";
28 cuts[
"nlam"] =
"fw1>0.2&&pla>0.15&&fw4>0.2&&prapmax<2.5";
32 cuts[
"nphi"] =
"phipcm>1.02899&&phipt>0.699287&&phid0pidk>0.40629";
33 cuts[
"nlam"] =
"thr>0.908013&&lampt>0.803121&&prapmax<3";
34 cuts[
"njpsi"] =
"jpsipcm<0.7";
35 cuts[
"nd01"] =
"d0pcm<0.386277&&d0d0pidk>0.661042";
38 cuts[
"ndpm1"] =
"dpmpcm<0.292203&&dpmd0pidk>0.630705";
45 cuts[
"nphi"] =
"phipcm>1.376&&fw2>0.631154&&npidkl>1";
46 cuts[
"nlam"] =
"fw2>0.603771&&lampt>0.881976&&fw2>0.8";
47 cuts[
"njpsi"] =
"npt10>1&&jpsid0pidpi<0.2&&jpsid1pidpi<0.2";
48 cuts[
"nd01"] =
"npt10>0&&d0d0pidk>0.453262&&prapmax<3";
51 cuts[
"ndpm1"] =
"dpmd0pidk>0.5&&dpmpt>1&&prapmax<3&&dpmd0p>1.2";
55 cuts[
"nds1"] =
"npidkl>1&&dsd1pidk>0.5&&dsd0pidk>0.5&&dsd1p>1.6";
59 cuts[
"nphi"] =
"phipcm>1.75195&&fw2>0.654609&&phid1pidk>0.292159";
60 cuts[
"nlam"] =
"fw2>0.8&&lampcm>2.15559&&lampt>1";
61 cuts[
"njpsi"] =
"jpsipcm<1.73971&&jpsid1pidpi<0.2";
62 cuts[
"nd01"] =
"d0d0pidk>0.394868&&prapmax<2.88343";
63 cuts[
"ndpm1"] =
"dpmd0pidk>0.4&&dpmpt>0.7&&prapmax<3";
64 cuts[
"nds1"] =
"npidkl>1&&dsd1pidk>0.642251&&dsd1p>1&&dsd0pidk>0.5";
65 cuts[
"nlamc"] =
"abs(lamcpcm-1)<0.1&&lamcd1pidk>0.5&&lamcd0pidp>0.5";
66 cuts[
"netac1"]=
"etacd1pidk>0.389332&&etacd0pidk>0.4";
int simu_tag |
( |
TString |
energy = "24" | ) |
|
Definition at line 148 of file simu_tag.C.
References cnt_events(), cuts, energy, evcnt, f, get_N0(), get_tuples(), i, init_cuts(), init_modes(), lfiles, modes, nsig, ntps, t, and TString.
158 cout <<
"\nn-tuples and cuts used: "<<endl;
162 int N0 =
get_N0(pref+
"ntp.root",bgcut);
164 cout <<
"Total Bkg N0 = "<<N0<<endl;
168 for (uint
i=0;
i<
ntps.size();++
i)
172 int sigN0 =
get_N0(pref+
"ntp.root",sigcut);
174 TFile *
f=
new TFile(
lfiles[
i],
"READ");
175 TTree *
t= (TTree*)f->Get(ntps[
i]);
183 double eff_bg = (double)nbg/N0;
184 double eff_sg = (double)nsig/sigN0;
187 ccut.ReplaceAll(
"&&",
" && ");
189 TString sout = TString::Format(
"%8s : BG = %5d/%6d = %7.5f SIG = %5d/%6d = %7.5f cut : %s\n",
190 ntps[i].Data(), nbg, N0, eff_bg, nsig, sigN0, eff_sg, ccut.Data());
199 double eff =
evcnt.size()/(double)N0;
200 cout <<
"\n\nN0_BG = "<<N0<<
" SUM = "<<sum<<
" SIMU TAG = "<<
evcnt.size()<<
" -> EFF = "<<eff<<
" SUPR-FAC = "<<1./eff<<endl;
int get_N0(TString fname, TString bgcut)
void init_cuts(TString energy)
std::vector< TString > ntps
int cnt_events(TChain *t, TString cut, bool globcnt=false)
std::vector< TString > lfiles
void get_tuples(TString beg="")