11 #include "TDatabasePDG.h"
12 #include "TParticlePDG.h"
17 #include "TParticle.h"
18 #include "TClonesArray.h"
39 const double fdE = 0.05;
118 12, 12, 20, 16, 90 };
138 CandList eplus,
eminus,
muplus,
muminus,
piplus,
piminus,
kplus,
kminus,
pplus,
pminus,
gam;
143 gStyle->SetPadTopMargin(0.13);
144 gStyle->SetPadBottomMargin(0.18);
145 gStyle->SetPadLeftMargin(0.2);
146 gStyle->SetPadRightMargin(0.015);
148 gStyle->SetLabelSize(0.075,
"X");
149 gStyle->SetLabelSize(0.07,
"Y");
151 gStyle->SetStatY(0.87);
152 gStyle->SetStatX(0.985);
153 gStyle->SetStatW(0.4);
154 gStyle->SetStatH(0.12);
155 gStyle->SetOptStat(
"e");
157 gStyle->SetTitleH(0.1);
158 gStyle->SetTitleX(0.08);
159 gStyle->SetTitleOffset(1.1,
"x");
160 gStyle->SetTitleXSize(0.075);
169 for (
unsigned int i=0;
i<N;
i++)
172 TLorentzVector lv(c.
P4());
175 boostlist.push_back(c);
183 return (n==11 || n==13 || n==211 || n==321 || n==2212 || n==22);
191 return f_res->Eval(v.Pt())/100.;
197 cout<<
"Using PID table:"<<endl;
199 if (pideff<0 && misid<0)
201 for (
int i=0;
i<5;++
i)
203 for (
int j=0;j<5;++j)
214 if (pideff<0) pideff=0;
215 if (pideff>100) pideff=100;
216 if (misid>100) misid=100;
222 for (
int i=0;
i<5;++
i)
224 for (
int j=0;j<5;++j)
235 void init(
double pideff,
double misid)
245 pdg_db=TDatabasePDG::Instance();
251 mE =
pdg_db->GetParticle(11)->Mass();
254 mK =
pdg_db->GetParticle(321)->Mass();
255 mP =
pdg_db->GetParticle(2212)->Mass();
260 f_res=
new TF1(
"f_res",
"pol2(0)");
261 f_res->SetParameters(2.367,1.3,0.133);
262 f_res->SetRange(0,10);
268 cout <<c.
Id()<<
" pid:"<<c.
Pid()<<
" ("<<c.
P4().X()<<
","<<c.
P4().Y()<<
","<<c.
P4().Z()<<
";"<<c.
P4().T()<<
") ";
271 cout <<
" mcpid:"<<c.
McPid()<<
" mct:"<<c.
Mct()<<endl;
277 if (tit!=
"") cout << tit<<endl;
278 for (
unsigned int j=0;j<l.size();++j)
printCand(l[j]);
310 for (
unsigned int i=0;
i<l.size();++
i)
312 double mass=l[
i].P4().M();
313 if (mass>m-w && mass<m+w) cnt++;
322 bool accepted =
false;
325 while (!accepted && i<l.size())
328 double mass = l[i++].P4().M();
329 if (mass>
m-w && mass<
m+w) accepted =
true;
337 int fillHisto(
CandList &l, TH1 *hall, TH1* hbg=0,
double m =0,
double w=0, TH1* hallsel=0, TH1* hbgsel=0, TH1* hsig=0, TH1* hmm=0, TH2* hmvsmm=0)
340 for (
unsigned int i=0;
i<l.size();++
i)
342 double mass = l[
i].P4().M();
343 double miss = (
fIni-l[
i].P4()).M();
347 if (hmm) hmm->Fill(miss);
348 if (hmvsmm) hmvsmm->Fill(mass, miss);
350 bool mct = l[
i].Mct();
351 if (hbg && !mct) hbg->Fill(mass);
352 if (hsig && mct) hsig->Fill(mass);
353 if (mass>
m-w && mass<
m+w)
356 if (hallsel) hallsel->Fill(mass);
357 if (hbgsel && !mct) hbgsel->Fill(mass);
367 bool sameList = (&l1 == &l2);
369 for (
unsigned int i=0;
i<l1.size();++
i)
371 for (
unsigned int j=0;j<l2.size();++j)
373 if (sameList && j<=
i)
continue;
374 if (l1[
i].Marker() & l2[j].Marker())
continue;
377 c.
SetP4(l1[
i].P4()+l2[j].P4());
379 c.
SetNFS(l1[
i].NFS()+l2[j].NFS());
384 int m1 = l1[
i].MotherIdx();
385 int m2 = l2[j].MotherIdx();
386 int ev1 = l1[
i].EvtId();
387 int ev2 = l2[j].EvtId();
391 (l1[i].McPid()||l1[i].Mct()) &&
392 (l2[j].McPid()||l2[j].Mct()) &&
394 matchPdg ==
mclist[m1].Pid() )
413 bool same12 = (&l1 == &l2);
414 bool same13 = (&l1 == &l3);
415 bool same23 = (&l2 == &l3);
417 for (
unsigned int i1=0;i1<l1.size();++i1)
419 for (
unsigned int i2=0;i2<l2.size();++i2)
421 if (same12 && i2<i1)
continue;
422 if (l1[i1].Marker() & l2[i2].Marker())
continue;
424 for (
unsigned int i3=0;i3<l3.size();++i3)
426 if ((same13 && i3<i1) || (same23 && i3<i2))
continue;
428 if ( l1[i1].Marker() & l3[i3].Marker() )
continue;
429 if ( l2[i2].Marker() & l3[i3].Marker() )
continue;
436 c.
SetP4( l1[i1].P4() + l2[i2].P4() + l3[i3].P4());
437 c.
SetCharge( l1[i1].Charge() + l2[i2].Charge() + l3[i3].Charge() );
438 c.
SetNFS( l1[i1].NFS() + l2[i2].NFS() + l3[i3].NFS());
439 c.
SetMarker( l1[i1].Marker() | l2[i2].Marker() | l3[i3].Marker() );
443 int m1 = l1[i1].MotherIdx();
444 int m2 = l2[i2].MotherIdx();
445 int m3 = l3[i3].MotherIdx();
447 int ev1 = l1[i1].EvtId();
448 int ev2 = l2[i2].EvtId();
449 int ev3 = l3[i3].EvtId();
451 if ( ev1==ev2 && ev2==ev3 &&
452 m1>=0 && m1 == m2 && m2 == m3 &&
453 (l1[i1].McPid()||l1[i1].Mct()) &&
454 (l2[i2].McPid()||l2[i2].Mct()) &&
455 (l3[i3].McPid()||l3[i3].Mct()) &&
457 matchPdg ==
mclist[m1].Pid() )
478 bool same12 = (&l1 == &l2);
479 bool same13 = (&l1 == &l3);
480 bool same14 = (&l1 == &l4);
482 bool same23 = (&l2 == &l3);
483 bool same24 = (&l2 == &l4);
485 bool same34 = (&l3 == &l4);
487 for (
unsigned int i1=0;i1<l1.size();++i1)
489 for (
unsigned int i2=0;i2<l2.size();++i2)
491 if (same12 && i2<i1)
continue;
492 if (l1[i1].Marker() & l2[i2].Marker())
continue;
494 for (
unsigned int i3=0;i3<l3.size();++i3)
496 if ((same13 && i3<i1) || (same23 && i3<i2))
continue;
498 if ( l1[i1].Marker() & l3[i3].Marker() )
continue;
499 if ( l2[i2].Marker() & l3[i3].Marker() )
continue;
501 for (
unsigned int i4=0;i4<l4.size();++i4)
503 if ((same14 && i4<i1) || (same24 && i4<i2) || (same34 && i4<i3))
continue;
505 if ( l1[i1].Marker() & l4[i4].Marker() )
continue;
506 if ( l2[i2].Marker() & l4[i4].Marker() )
continue;
507 if ( l3[i3].Marker() & l4[i4].Marker() )
continue;
514 c.
SetP4( l1[i1].P4() + l2[i2].P4() + l3[i3].P4() + l4[i4].P4() );
515 c.
SetCharge( l1[i1].Charge() + l2[i2].Charge() + l3[i3].Charge() + l4[i4].Charge() );
516 c.
SetNFS( l1[i1].NFS() + l2[i2].NFS() + l3[i3].NFS() + l4[i4].NFS() );
517 c.
SetMarker( l1[i1].Marker() | l2[i2].Marker() | l3[i3].Marker() | l4[i4].Marker() );
521 int m1 = l1[i1].MotherIdx();
522 int m2 = l2[i2].MotherIdx();
523 int m3 = l3[i3].MotherIdx();
524 int m4 = l4[i4].MotherIdx();
526 int ev1 = l1[i1].EvtId();
527 int ev2 = l2[i2].EvtId();
528 int ev3 = l3[i3].EvtId();
529 int ev4 = l4[i4].EvtId();
531 if ( ev1==ev2 && ev2==ev3 && ev3==ev4 &&
532 m1>=0 && m1 == m2 && m2 == m3 && m3 == m4 &&
533 (l1[i1].McPid()||l1[i1].Mct()) &&
534 (l2[i2].McPid()||l2[i2].Mct()) &&
535 (l3[i3].McPid()||l3[i3].Mct()) &&
536 (l4[i4].McPid()||l4[i4].Mct()) &&
538 matchPdg ==
mclist[m1].Pid() )
559 TLorentzVector p4=c.
P4();
571 while (newp<0) newp = p4.P() +
fRand.Gaus(0.0,dp);
573 p4.SetVectM( p4.Vect().Unit()*newp,
m );
575 double newtht = p4.Theta();
576 if (dtht!=0) newtht +=
fRand.Gaus(0.,dtht);
579 double newphi = p4.Phi();
580 if (dphi!=0) newphi +=
fRand.Gaus(0.,dphi);
590 if (
fRand.Rndm()<eff)
return true;
598 unsigned int marker = 1;
600 for (
unsigned int i=0;
i<mc.size();
i++)
632 for (
unsigned int i=0;
i<in.size();++
i)
633 if (
fabs(in[
i].P4().M()-mmean)<mw) out.push_back(in[
i]);
642 TParticlePDG *part =
pdg_db->GetParticle(pdg);
646 if (part) mass = part->Mass();
647 if (mass<0) mass = 0.139;
649 for (
unsigned int i=0;
i<in.size();++
i)
659 if (pdg==0 || pdg==22) out.push_back(c);
665 int selidx =
pdgidx[abs(pdg)];
667 double prob =
pidtab[5*selidx + partidx]/100.;
670 if (
fRand.Rndm()<prob) out.push_back(c);
699 double X = (s*s-2*
mP*
mP)/(2*
mP);
706 h->SetFillStyle(3001);
707 h->SetFillColor(602);
709 h->SetLineColor(602);
716 TLorentzVector l = c.
P4();
717 TVector3 boost =
fIni.BoostVector();
718 TLorentzVector lb = l;
721 n->
Column(pre+
"px", l.Px());
722 n->
Column(pre+
"py", l.Py());
723 n->
Column(pre+
"pz", l.Pz());
724 n->
Column(pre+
"p", l.P());
725 n->
Column(pre+
"e", l.E());
726 n->
Column(pre+
"m", l.M());
731 n->
Column(pre+
"pt", l.Pt());
732 n->
Column(pre+
"tht", l.Theta());
733 n->
Column(pre+
"phi", l.Phi());
734 n->
Column(pre+
"pcm", lb.P());
784 for (
int i=0;
i<l.size();++
i)
788 float mct = l[
i].Mct();
790 if (
fabs(l[i].P4().M()-mass)<win) tag=1.0;
798 for (
int j=0;j<l[
i].NDau();++j)
803 qaCand(TString::Format(
"%sd%d",pre.Data(),j),d, n);
841 int toy_core(
TString fsig,
int nev=2,
double sqrts=3.77,
bool simcut=
true,
bool evcut=
false,
double dp=0.05,
842 double trkeff=95.,
double pideff=95.,
double misid =5.,
double P_mix=0.00,
bool writentp=
false,
int mode =9999)
874 TFile *
f=
new TFile(fsig,
"READ");
877 cout <<
"File not found:"<<fsig<<endl;
881 bool dpm=fsig.Contains(
"DPM");
882 TString treename = dpm ?
"data" :
"ntp";
883 TTree *
t=(TTree*)f->Get(treename);
887 cout <<
"Tree '"<<treename<<
"' not found in '"<<fsig<<
"'."<<endl;
892 int Nevt = t->GetEntriesFast();
893 if (nev==0) nev = Nevt;
895 double mmean=0, mwsig=0, mwoff=0;
901 TCanvas *
c1=
new TCanvas(
"c1",
"c1",10,10,600,300);
903 TCanvas *
c2=
new TCanvas(
"c2",
"c2",20,20,1800,800);
904 c2->Divide(5,2,0.005,0.01);
911 double min=0,
max=6.0, min2=0.5;
914 TH1F *h_mom=
new TH1F(
"h_mom",
"Momenta",200,0,5);
915 TH1F *h_momc=
new TH1F(
"h_momc",
"Momenta charged",200,0,5);
916 TH1F *h_momn=
new TH1F(
"h_momn",
"Momenta neutral",200,0,5);
917 TH1F *h_mult=
new TH1F(
"h_mult",
"Multiplicity",50,-0.5,49.5);
918 TH1F *h_multrec=
new TH1F(
"h_multrec",
"Multiplicity reco",50,-0.5,49.5);
919 TH1F *h_multc=
new TH1F(
"h_multc",
"Multiplicity charged",30,-0.5,29.5);
920 TH1F *h_multn=
new TH1F(
"h_multn",
"Multiplicity neutral",50,-0.5,49.5);
921 TH1F *h_fw1=
new TH1F(
"h_fw1",
"Fox Wolfram R1",300,-1.1,1.1);
922 TH1F *h_pmax=
new TH1F(
"h_pmax",
"pmax cms",300,0,5);
924 TH1F *h_mult_k =
new TH1F(
"h_mult_k",
"Multiplicity Kaons",10,-0.5,9.5);
925 TH1F *h_mult_lep =
new TH1F(
"h_mult_lep",
"Multiplicity Leptons",10,-0.5,9.5);
926 TH1F *h_sum_klep =
new TH1F(
"h_sum_lep",
"Sum Kaons + Leptons",15,-0.5,14.5);
927 TH2F *h_mult_klep=
new TH2F(
"h_mult_klep",
"#Kaons vs. #Leptons",10,-0.5,9.5, 10, -0.5, 9.5);
928 h_mult_klep->SetYTitle(
"#Leptons");
929 h_mult_klep->SetXTitle(
"#Kaons");
932 TH1F *h_pi0=
new TH1F(
"h_pi0",
"#pi^{0} #rightarrow #gamma#gamma",200,min,0.4);
933 TH1F *h_pi0sel=
new TH1F(
"h_pi0sel",
"Pi0",200,min,0.4);
934 TH1F *h_pi0sig=
new TH1F(
"h_pi0sig",
"Pi0",200,min,0.4);
935 h_pi0sig->SetLineColor(2);
939 TH1F *h_ks=
new TH1F(
"h_ks",
"K_{S}^{0} #rightarrow #pi^{+}#pi^{-}",200,0.2,0.8);
940 TH1F *h_kssel=
new TH1F(
"h_kssel",
"Pi0",200,0.2,0.8);
941 TH1F *h_kssig=
new TH1F(
"h_kssig",
"Pi0",200,0.2,0.8);
942 h_kssig->SetLineColor(2);
946 TH1F *h_jpsi=
new TH1F(
"h_jpsi",
"J/#psi #rightarrow e^{+}e^{-}",
nbins,min,
max);
947 TH1F *h_jpsisel=
new TH1F(
"h_jpsisel",
"J/psi",
nbins,min,
max);
948 TH1F *h_jpsisig=
new TH1F(
"h_jpsisig",
"J/psi",
nbins,min,
max);
949 h_jpsisig->SetLineColor(2);
953 TH1F *h_jpsi2=
new TH1F(
"h_jpsi2",
"J/#psi #rightarrow #mu^{+}#mu^{-}",
nbins,min,
max);
954 TH1F *h_jpsi2sel=
new TH1F(
"h_jpsi2sel",
"J/psi",
nbins,min,
max);
955 TH1F *h_jpsi2sig=
new TH1F(
"h_jpsi2sig",
"J/psi",
nbins,min,
max);
956 h_jpsi2sig->SetLineColor(2);
960 TH1F *h_etac=
new TH1F(
"h_etac",
"#eta_{c} #rightarrow K_{S} K^{+} #pi^{-}",
nbins,min,
max);
961 TH1F *h_etacsel=
new TH1F(
"h_etacsel",
"etac",
nbins,min,
max);
962 TH1F *h_etacsig=
new TH1F(
"h_etacsig",
"etac",
nbins,min,
max);
963 h_etacsig->SetLineColor(2);
967 TH1F *h_d0=
new TH1F(
"h_d0",
"D^{0} #rightarrow K^{-}#pi^{+}",
nbins,min,
max);
968 TH1F *h_d0sel=
new TH1F(
"h_d0sel",
"D0",
nbins,min,
max);
969 TH1F *h_d0sig=
new TH1F(
"h_d0sig",
"D0",
nbins,min,
max);
970 h_d0sig->SetLineColor(2);
974 TH1F *h_dpm=
new TH1F(
"h_dpm",
"D^{+} #rightarrow K^{-}#pi^{+}#pi^{+}",
nbins,min,
max);
975 TH1F *h_dpmsel=
new TH1F(
"h_dpmsel",
"D#pm",
nbins,min,
max);
976 TH1F *h_dpmsig=
new TH1F(
"h_dpmsig",
"D#pm",
nbins,min,
max);
977 h_dpmsig->SetLineColor(2);
981 TH1F *h_ds=
new TH1F(
"h_ds",
"D_{s}^{+} #rightarrow K^{+}K^{-}#pi^{+}",
nbins,min,
max);
982 TH1F *h_dssel=
new TH1F(
"h_dssel",
"Ds",
nbins,min,
max);
983 TH1F *h_dssig=
new TH1F(
"h_dssig",
"Ds",
nbins,min,
max);
984 h_dssig->SetLineColor(2);
988 TH1F *h_phi=
new TH1F(
"h_phi",
"#phi #rightarrow K^{+}K^{-}",
nbins,min2,
max/2);
989 TH1F *h_phisel=
new TH1F(
"h_phisel",
"Phi",
nbins,min2,
max/2);
990 TH1F *h_phisig=
new TH1F(
"h_phisig",
"Phi",
nbins,min2,
max/2);
991 h_phisig->SetLineColor(2);
995 TH1F *h_lamc=
new TH1F(
"h_lamc",
"#Lambda_{c} #rightarrow pK^{-}#pi^{+}",
nbins,min,
max);
996 TH1F *h_lamcsel=
new TH1F(
"h_lamcsel",
"Lam_c",
nbins,min,
max);
997 TH1F *h_lamcsig=
new TH1F(
"h_lamcsig",
"Lam_c",
nbins,min,
max);
998 h_lamcsig->SetLineColor(2);
1002 TH1F *h_lam=
new TH1F(
"h_lam",
"#Lambda #rightarrow p#pi^{-}",
nbins,min2,
max/2);
1003 TH1F *h_lamsel=
new TH1F(
"h_lamsel",
"Lam",
nbins,min2,
max/2);
1004 TH1F *h_lamsig=
new TH1F(
"h_lamsig",
"Lam",
nbins,min2,
max/2);
1005 h_lamsig->SetLineColor(2);
1009 TH1F *h_ee=
new TH1F(
"h_ee",
"p#bar{p} #rightarrow e^{+}e^{-}",
nbins,min,
max*1.2);
1010 TH1F *h_eesel=
new TH1F(
"h_eesel",
"ee",
nbins,min,
max*1.2);
1011 TH1F *h_eesig=
new TH1F(
"h_eesig",
"ee",
nbins,min,
max*1.2);
1012 h_eesig->SetLineColor(2);
1016 h_jpsi->SetXTitle(
"m(e^{+}e^{-}) [GeV/c^{2}]");
1017 h_jpsi2->SetXTitle(
"m(#mu^{+}#mu^{-}) [GeV/c^{2}]");
1018 h_etac->SetXTitle(
"m(K_{S} K^{+}#pi^{-}) [GeV/c^{2}]");
1020 h_d0->SetXTitle(
"m(K^{-}#pi^{+}) [GeV/c^{2}]");
1022 h_dpm->SetXTitle(
"m(K^{-}#pi^{+}#pi^{+}) [GeV/c^{2}]");
1024 h_ds->SetXTitle(
"m(K^{+}K^{-}#pi^{+}) [GeV/c^{2}]");
1026 h_phi->SetXTitle(
"m(K^{+}K^{-}) [GeV/c^{2}]");
1027 h_lamc->SetXTitle(
"m(pK^{-}#pi^{+}) [GeV/c^{2}]");
1028 h_lam->SetXTitle(
"m(p#pi^{-}) [GeV/c^{2}]");
1029 h_ee->SetXTitle(
"m(e^{+}e^{-}) [GeV/c^{2}]");
1035 TClonesArray* DpmPart=0;
1039 DpmPart=
new TClonesArray(
"TParticle",100);
1040 t->SetBranchAddress(
"Npart",&nTrk);
1041 t->SetBranchAddress(
"Particles", &DpmPart);
1045 t->SetBranchAddress(
"nTrk",&nTrk);
1046 t->SetBranchAddress(
"Id",Id);
1047 t->SetBranchAddress(
"DF",DF);
1048 t->SetBranchAddress(
"DL",DL);
1049 t->SetBranchAddress(
"px",px);
1050 t->SetBranchAddress(
"py",py);
1051 t->SetBranchAddress(
"pz",pz);
1052 t->SetBranchAddress(
"E",E);
1053 t->SetBranchAddress(
"m",m);
1060 if (writentp) fn=
new TFile(filename,
"RECREATE");
1085 bool channelselect[10];
1086 double channelcount[10];
1087 TString channelname[10]={
"Phi(KK)",
"pp->ee" ,
"Lam(ppi)",
"etac(KS K pi)",
"J/psi(ee)",
"J/psi(mumu)",
"D+-(K2pi)",
"D0(Kpi)",
"Ds(KKpi)",
"Lamc(pKpi)"};
1089 for (i=0;i<10;++
i) channelcount[i]=0.;
1091 if (
fRand.Rndm()<P_mix) mixevts=2;
1098 if (i%5000==0) cout <<
"ev "<<i<<endl;
1114 for (j=0;j<nTrk;++j)
1116 TParticle *
pt=(TParticle*)DpmPart->At(j);
1117 Id[j] = pt->GetPdgCode();
1118 int pdg = abs(Id[j]);
1122 E[j] = pt->Energy();
1123 m[j] = pt->GetMass();
1126 if (pdg==211) npi++;
1132 if (!good)
continue;
1134 for (j=0;j<nTrk;++j)
1137 int pdg = abs(Id[j]);
1138 TParticlePDG *
p=
pdg_db->GetParticle(Id[j]);
1139 if (p) chrg = p->Charge();
1140 if (abs(chrg)>1) chrg/=3;
1142 SimpleCand c(px[j], py[j], pz[j], E[j], Id[j], j, chrg);
1145 for (k=0;k<j;++k) if (j>=DF[k] && j<=DL[k])
1159 if (++currmix<mixevts)
continue;
1172 TVector3 boost =
fIni.BoostVector();
1204 h_mult_lep->Fill(
nlep);
1205 h_mult_klep->Fill(
nk,
nlep);
1206 h_sum_klep->Fill(
nk +
nlep);
1215 CandList LDp, LDm, LDp2, LDm2, LDp3, LDm3, LDp4, LDm4;
1217 CandList LD0, LD02, LD0b, LD02b, LD03, LD03b;
1222 int ncomb1=0, ncomb2=0;
1223 bool selected=
false;
1225 for (j=0;j<13;++j) channelselect[j]=
false;
1237 bool accepted =
false;
1257 int npi0 = LPi0.size();
1258 int nks0 = LKs.size();
1266 double pmaxl = evsh.
PmaxLab();
1269 double ptmax = evsh.
Ptmax();
1275 double sumptl = sumpt;
1285 for (j=0; j<LPi0.size(); ++j)
1287 if (LPi0[j].P4().P()>0.5) npi005++;
1288 if (LPi0[j].P4().P()>1.0) npi010++;
1291 for (j=0; j<LKs.size(); ++j)
1293 if (LKs[j].P4().P()>0.5) nks005++;
1294 if (LKs[j].P4().P()>1.0) nks010++;
1305 || (sqrts==2.4 &&
nk>1 && npart<7 && pmax<0.648 )
1306 || (sqrts==3.77 &&
nk>1 && fw2>0.5456 )
1307 || (sqrts==4.28 &&
nk>1 && 1 )
1308 || (sqrts==5.0 &&
nk>1 && 1 )
1309 || (sqrts==5.5 &&
nk>1 && 1 )
1323 || (sqrts==2.4 && npart>3 &&
npr>0 &&
npi>0 && fw1>0.132 && fw4>0.2024 )
1324 || (sqrts==3.77 && npart>3 && pmax>1.056 && fw1>0.0 && fw2>0.6248 && fw5>0.22 )
1325 || (sqrts==4.28 && npart>3 && 1 )
1326 || (sqrts==5.0 && npart>3 && 1 )
1327 || (sqrts==5.5 && npart>3 && 1 )
1374 || (sqrts==3.77 && np10>1 &&
npi<4 && pmin<0.3 && sumpc>3.296 )
1375 || (sqrts==4.28 && 1 )
1376 || (sqrts==5.0 && 1 )
1377 || (sqrts==5.5 && 1 )
1390 || (sqrts==3.77 && np10>1 &&
npi<4 && pmin<0.3 && sumpc>3.296 )
1391 || (sqrts==4.28 && 1 )
1392 || (sqrts==5.0 && 1 )
1393 || (sqrts==5.5 && 1 )
1407 || (sqrts==3.77 &&
nk>0 && npart<12 && pmax<0.936 && sumpc>1.76 )
1408 || (sqrts==4.28 &&
nk>0 && 1 )
1409 || (sqrts==5.0 &&
nk>0 && 1 )
1410 || (sqrts==5.5 &&
nk>0 && 1 )
1427 || (sqrts==3.77 &&
nk>0 && sumpc05>3.18 && pmax>0.768 && pmax<1.056 && fw3<0.1848 )
1428 || (sqrts==4.28 &&
nk>0 && 1 )
1429 || (sqrts==5.0 &&
nk>0 && 1 )
1430 || (sqrts==5.5 &&
nk>0 && 1 )
1447 || (sqrts==4.28 &&
nk>1 && 1 )
1448 || (sqrts==5.0 &&
nk>1 && 1 )
1449 || (sqrts==5.5 &&
nk>1 && 1 )
1466 || (sqrts==5.0 && 1 )
1467 || (sqrts==5.5 && 1 )
1485 if (!simcut || accepted)
1492 if (ncomb1>0) {selected=
true; channelselect[0]=
true;}
1500 if (ncomb1>0) {selected=
true; channelselect[1]=
true;}
1508 combCnt += ncomb1 + ncomb2;
1509 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[2]=
true;}
1517 combCnt += ncomb1 + ncomb2;
1518 if (ncomb1>0 || ncomb2>0 ) {selected=
true; channelselect[3]=
true;}
1526 if (ncomb1>0 ) {selected=
true; channelselect[4]=
true;}
1534 if (ncomb1>0 ) {selected=
true; channelselect[5]=
true;}
1542 combCnt += ncomb1 +ncomb2;
1543 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[6]=
true;}
1551 combCnt += ncomb1 +ncomb2;
1552 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[7]=
true;}
1560 combCnt += ncomb1 +ncomb2;
1561 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[8]=
true;}
1567 ncomb1 =
fillHisto(LLamcp, h_lamc, 0,
fLamcMass, fLamcwin, h_lamcsel, 0, h_lamcsig );
1568 ncomb2 =
fillHisto(LLamcm, h_lamc, 0,
fLamcMass, fLamcwin, h_lamcsel, 0, h_lamcsig );
1569 combCnt += ncomb1 + ncomb2;
1570 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[9]=
true;}
1575 if (selected) evCnt+=mixevts;
1577 for (j=0;j<10;++j)
if (channelselect[j]) channelcount[j]+=mixevts;
1582 if (
fRand.Rndm()<P_mix) mixevts=2;
1587 cout<<
"#Combinations:"<<combCnt<<
" #Events:"<<evCnt<<
" ";
1588 cout <<
"Efficiency (ev):"<<(double)evCnt/(
double)nev<<endl;
1589 cout <<
"Mult Cut Eff (ev):"<<(double)evMultCut/(
double)nev<<endl;
1593 channelcount[
i]/=nev;
1594 cout <<channelname[
i]<<
":"<<channelcount[
i]<<endl;
1599 latex.SetTextSize(0.08);
1602 double pos=3.3, pos2=1.85;
1605 c1->cd(1); h_pi0->Draw(); h_pi0sel->Draw(
"same"); h_pi0sig->Draw(
"same");
1606 c1->cd(2); h_ks->Draw(); h_kssel->Draw(
"same"); h_kssig->Draw(
"same");
1608 c2->cd(1); h_phi->Draw(); h_phisel->Draw(
"same"); h_phisig->Draw(
"same");
1609 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[0]*100.);
1610 latex.DrawLatex(pos2,h_phi->GetMaximum()*hfac+
offset,tmp);
1612 c2->cd(2); h_ee->Draw(); h_eesel->Draw(
"same"); h_eesig->Draw(
"same");
1613 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[1]*100.);
1614 latex.DrawLatex(pos*1.2,h_ee->GetMaximum()*hfac+
offset,tmp);
1616 c2->cd(3); h_lam->Draw(); h_lamsel->Draw(
"same"); h_lamsig->Draw(
"same");
1617 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[2]*100.);
1618 latex.DrawLatex(pos2,h_lam->GetMaximum()*hfac+
offset,tmp);
1620 c2->cd(4); h_etac->Draw(); h_etacsel->Draw(
"same"); h_etacsig->Draw(
"same");
1621 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[3]*100.);
1622 latex.DrawLatex(pos,h_etac->GetMaximum()*hfac+
offset,tmp);
1624 c2->cd(5); h_jpsi->Draw(); h_jpsisel->Draw(
"same"); h_jpsisig->Draw(
"same");
1625 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[4]*100.);
1626 latex.DrawLatex(pos,h_jpsi->GetMaximum()*hfac+
offset,tmp);
1628 c2->cd(6); h_jpsi2->Draw(); h_jpsi2sel->Draw(
"same"); h_jpsi2sig->Draw(
"same");
1629 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[5]*100.);
1630 latex.DrawLatex(pos,h_jpsi2->GetMaximum()*hfac+
offset,tmp);
1632 c2->cd(7); h_dpm->Draw(); h_dpmsel->Draw(
"same"); h_dpmsig->Draw(
"same");
1633 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[6]*100.);
1634 latex.DrawLatex(pos,h_dpm->GetMaximum()*hfac+
offset,tmp);
1636 c2->cd(8); h_d0->Draw(); h_d0sel->Draw(
"same"); h_d0sig->Draw(
"same");
1637 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[7]*100.);
1638 latex.DrawLatex(pos,h_d0->GetMaximum()*hfac+
offset,tmp);
1640 c2->cd(9); h_ds->Draw(); h_dssel->Draw(
"same"); h_dssig->Draw(
"same");
1641 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[8]*100.);
1642 latex.DrawLatex(pos,h_ds->GetMaximum()*hfac+
offset,tmp);
1644 c2->cd(10); h_lamc->Draw(); h_lamcsel->Draw(
"same"); h_lamcsig->Draw(
"same");
1645 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[9]*100.);
1646 latex.DrawLatex(pos,h_lamc->GetMaximum()*hfac+
offset,tmp);
1650 double posy = h_jpsi->GetMaximum()*1.12;
1651 if (posy=0) posy=1.12;
1652 sprintf(tmp,
"(#epsilon_{t} = %4.1f%%)",
double(evCnt)/
double(nev)*100.);
1653 latex.SetTextColor(kMagenta+2);
1654 latex.DrawLatex(3.0,h_jpsi->GetMaximum()*1.12,tmp);
1671 h_mult_klep->Scale(1.0/nev);
1675 c2->SaveAs(
"fig/"+plotname+
"_core.gif");
1676 c2->SaveAs(
"fig/"+plotname+
"_core.pdf");
void select(CandList &in, CandList &out, int chrg=0, int pdg=0, double mass=0.139)
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void printList(CandList &l, TString tit="")
void SetP4(TLorentzVector lv)
void makePidSelection(CandList &l)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
void makePidTable(double pideff, double misid)
void makeRecoCands(CandList &mc, CandList &reco, double eff=0.90, double dp=0.05, double dtht=0.001, double dphi=0.001)
void SetMcPid(bool mct=true)
int combine(CandList &l1, CandList &l2, CandList &out, int matchPdg=0)
int fillHisto(CandList &l, TH1 *hall, TH1 *hbg=0, double m=0, double w=0, TH1 *hallsel=0, TH1 *hbgsel=0, TH1 *hsig=0, TH1 *hmm=0, TH2 *hmvsmm=0)
std::vector< SimpleCand > CandList
void writeTuple(TString pre, CandList &l, EventShape &evsh, SimpleNtp *n, double mass, double win)
std::map< int, int > pdgidx
double dponline(TLorentzVector &v)
void SetMarker(unsigned int i)
void SetMct(bool mct=true)
TString pt(TString pts, TString exts="px py pz")
int massCrit(CandList &l, double m, double w)
void qaCand(TString pre, SimpleCand &c, SimpleNtp *n)
TString m2(TString pts, TString exts="e px py pz")
void SetMass(double mass)
double NeutESumCms() const
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
int MultPminCms(double pmin)
TLorentzVector P4() const
friend F32vec4 fabs(const F32vec4 &a)
bool eventAccepted(CandList &l, double m=0, double w=0)
void smearMom(SimpleCand &c, double dpr=0.05, double dtht=0.000, double dphi=0.000)
void boostList(CandList &list, CandList &boostlist, TVector3 boost)
double ChrgPSumCms() const
double FoxWolfMomR(int order)
void AddDau(SimpleCand *c)
void printCand(TLorentzVector l, TVector3 p)
void selectMass(CandList &in, CandList &out, double mmean=0, double mw=0)
int toy_core(TString fsig, int nev=2, double sqrts=3.77, bool simcut=true, bool evcut=false, double dp=0.05, double trkeff=95., double pideff=95., double misid=5., double P_mix=0.00, bool writentp=false, int mode=9999)
double SumChrgPminCms(double pmin)
void SetMotherIdx(int idx)
bool isDetected(double eff=0.90)
double ChrgPtSumLab() const
void SetDau(int n, int m=0)
void Column(TString name, Float_t value)
void makeIni4Vector(TLorentzVector &l, double s)