10 #include "TDatabasePDG.h"
11 #include "TParticlePDG.h"
16 #include "TParticle.h"
17 #include "TClonesArray.h"
37 const double fdE = 0.05;
94 double pidtab [25] = { 80, 5, 5, 5, 5,
105 12, 12, 20, 16, 90 };
124 CandList eplus,
eminus,
muplus,
muminus,
piplus,
piminus,
kplus,
kminus,
pplus,
pminus,
gam;
132 for (
unsigned int i=0;
i<N;
i++)
135 TLorentzVector lv(c.
P4());
138 boostlist.push_back(c);
146 return (n==11 || n==13 || n==211 || n==321 || n==2212 || n==22);
154 return f_res->Eval(v.Pt())/100.;
160 cout<<
"Using PID table:"<<endl;
162 if (pideff<0 && misid<0)
164 for (
int i=0;
i<5;++
i)
166 for (
int j=0;j<5;++j)
177 if (pideff<0) pideff=0;
178 if (pideff>100) pideff=100;
179 if (misid>100) misid=100;
185 for (
int i=0;
i<5;++
i)
187 for (
int j=0;j<5;++j)
198 void init(
double pideff,
double misid)
208 pdg_db=TDatabasePDG::Instance();
214 mE =
pdg_db->GetParticle(11)->Mass();
217 mK =
pdg_db->GetParticle(321)->Mass();
218 mP =
pdg_db->GetParticle(2212)->Mass();
223 f_res=
new TF1(
"f_res",
"pol2(0)");
224 f_res->SetParameters(2.367,1.3,0.133);
225 f_res->SetRange(0,10);
231 cout <<c.
Id()<<
" pid:"<<c.
Pid()<<
" ("<<c.
P4().X()<<
","<<c.
P4().Y()<<
","<<c.
P4().Z()<<
";"<<c.
P4().T()<<
") ";
234 cout <<
" mcpid:"<<c.
McPid()<<
" mct:"<<c.
Mct()<<endl;
240 if (tit!=
"") cout << tit<<endl;
241 for (
unsigned int j=0;j<l.size();++j)
printCand(l[j]);
273 for (
unsigned int i=0;
i<l.size();++
i)
275 double mass=l[
i].P4().M();
276 if (mass>m-w && mass<m+w) cnt++;
285 bool accepted =
false;
288 while (!accepted && i<l.size())
291 double mass = l[i++].P4().M();
292 if (mass>
m-w && mass<
m+w) accepted =
true;
300 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)
303 for (
unsigned int i=0;
i<l.size();++
i)
305 double mass = l[
i].P4().M();
306 double miss = (
fIni-l[
i].P4()).M();
310 if (hmm) hmm->Fill(miss);
311 if (hmvsmm) hmvsmm->Fill(mass, miss);
313 bool mct = l[
i].Mct();
314 if (hbg && !mct) hbg->Fill(mass);
315 if (hsig && mct) hsig->Fill(mass);
316 if (mass>
m-w && mass<
m+w)
319 if (hallsel) hallsel->Fill(mass);
320 if (hbgsel && !mct) hbgsel->Fill(mass);
330 bool sameList = (&l1 == &l2);
332 for (
unsigned int i=0;
i<l1.size();++
i)
334 for (
unsigned int j=0;j<l2.size();++j)
336 if (sameList && j<=
i)
continue;
337 if (l1[
i].Marker() & l2[j].Marker())
continue;
340 c.
SetP4(l1[
i].P4()+l2[j].P4());
342 c.
SetNFS(l1[
i].NFS()+l2[j].NFS());
345 int m1 = l1[
i].MotherIdx();
346 int m2 = l2[j].MotherIdx();
347 int ev1 = l1[
i].EvtId();
348 int ev2 = l2[j].EvtId();
352 (l1[
i].McPid()||l1[
i].Mct()) &&
353 (l2[j].McPid()||l2[j].Mct()) &&
355 matchPdg ==
mclist[m1].Pid() )
374 bool same12 = (&l1 == &l2);
375 bool same13 = (&l1 == &l3);
376 bool same23 = (&l2 == &l3);
378 for (
unsigned int i1=0;i1<l1.size();++i1)
380 for (
unsigned int i2=0;i2<l2.size();++i2)
382 if (same12 && i2<i1)
continue;
383 if (l1[i1].Marker() & l2[i2].Marker())
continue;
385 for (
unsigned int i3=0;i3<l3.size();++i3)
387 if ((same13 && i3<i1) || (same23 && i3<i2))
continue;
389 if ( l1[i1].Marker() & l3[i3].Marker() )
continue;
390 if ( l2[i2].Marker() & l3[i3].Marker() )
continue;
397 c.
SetP4( l1[i1].P4() + l2[i2].P4() + l3[i3].P4());
398 c.
SetCharge( l1[i1].Charge() + l2[i2].Charge() + l3[i3].Charge() );
399 c.
SetNFS( l1[i1].NFS() + l2[i2].NFS() + l3[i3].NFS());
400 c.
SetMarker( l1[i1].Marker() | l2[i2].Marker() | l3[i3].Marker() );
402 int m1 = l1[i1].MotherIdx();
403 int m2 = l2[i2].MotherIdx();
404 int m3 = l3[i3].MotherIdx();
406 int ev1 = l1[i1].EvtId();
407 int ev2 = l2[i2].EvtId();
408 int ev3 = l3[i3].EvtId();
410 if ( ev1==ev2 && ev2==ev3 &&
411 m1>=0 && m1 == m2 && m2 == m3 &&
412 (l1[i1].McPid()||l1[i1].Mct()) &&
413 (l2[i2].McPid()||l2[i2].Mct()) &&
414 (l3[i3].McPid()||l3[i3].Mct()) &&
416 matchPdg ==
mclist[m1].Pid() )
437 bool same12 = (&l1 == &l2);
438 bool same13 = (&l1 == &l3);
439 bool same14 = (&l1 == &l4);
441 bool same23 = (&l2 == &l3);
442 bool same24 = (&l2 == &l4);
444 bool same34 = (&l3 == &l4);
446 for (
unsigned int i1=0;i1<l1.size();++i1)
448 for (
unsigned int i2=0;i2<l2.size();++i2)
450 if (same12 && i2<i1)
continue;
451 if (l1[i1].Marker() & l2[i2].Marker())
continue;
453 for (
unsigned int i3=0;i3<l3.size();++i3)
455 if ((same13 && i3<i1) || (same23 && i3<i2))
continue;
457 if ( l1[i1].Marker() & l3[i3].Marker() )
continue;
458 if ( l2[i2].Marker() & l3[i3].Marker() )
continue;
460 for (
unsigned int i4=0;i4<l4.size();++i4)
462 if ((same14 && i4<i1) || (same24 && i4<i2) || (same34 && i4<i3))
continue;
464 if ( l1[i1].Marker() & l4[i4].Marker() )
continue;
465 if ( l2[i2].Marker() & l4[i4].Marker() )
continue;
466 if ( l3[i3].Marker() & l4[i4].Marker() )
continue;
473 c.
SetP4( l1[i1].P4() + l2[i2].P4() + l3[i3].P4() + l4[i4].P4() );
474 c.
SetCharge( l1[i1].Charge() + l2[i2].Charge() + l3[i3].Charge() + l4[i4].Charge() );
475 c.
SetNFS( l1[i1].NFS() + l2[i2].NFS() + l3[i3].NFS() + l4[i4].NFS() );
476 c.
SetMarker( l1[i1].Marker() | l2[i2].Marker() | l3[i3].Marker() | l4[i4].Marker() );
478 int m1 = l1[i1].MotherIdx();
479 int m2 = l2[i2].MotherIdx();
480 int m3 = l3[i3].MotherIdx();
481 int m4 = l4[i4].MotherIdx();
483 int ev1 = l1[i1].EvtId();
484 int ev2 = l2[i2].EvtId();
485 int ev3 = l3[i3].EvtId();
486 int ev4 = l4[i4].EvtId();
488 if ( ev1==ev2 && ev2==ev3 && ev3==ev4 &&
489 m1>=0 && m1 == m2 && m2 == m3 && m3 == m4 &&
490 (l1[i1].McPid()||l1[i1].Mct()) &&
491 (l2[i2].McPid()||l2[i2].Mct()) &&
492 (l3[i3].McPid()||l3[i3].Mct()) &&
493 (l4[i4].McPid()||l4[i4].Mct()) &&
495 matchPdg ==
mclist[m1].Pid() )
516 TLorentzVector p4=c.
P4();
528 while (newp<0) newp = p4.P() +
fRand.Gaus(0.0,dp);
530 p4.SetVectM( p4.Vect().Unit()*newp,
m );
532 double newtht = p4.Theta();
533 if (dtht!=0) newtht +=
fRand.Gaus(0.,dtht);
536 double newphi = p4.Phi();
537 if (dphi!=0) newphi +=
fRand.Gaus(0.,dphi);
547 if (
fRand.Rndm()<eff)
return true;
555 for (
unsigned int i=0;
i<mc.size();
i++)
581 for (
unsigned int i=0;
i<in.size();++
i)
582 if (
fabs(in[
i].P4().M()-mmean)<mw) out.push_back(in[
i]);
591 TParticlePDG *part =
pdg_db->GetParticle(pdg);
595 if (part) mass = part->Mass();
596 if (mass<0) mass = 0.139;
598 for (
unsigned int i=0;
i<in.size();++
i)
607 if (pdg==0 || pdg==22) out.push_back(c);
613 int selidx =
pdgidx[abs(pdg)];
615 double prob =
pidtab[5*selidx + partidx]/100.;
618 if (
fRand.Rndm()<prob) out.push_back(c);
647 double X = (s*s-2*
mP*
mP)/(2*
mP);
654 h->SetFillStyle(3001);
655 h->SetFillColor(602);
657 h->SetLineColor(602);
661 double trkeff=100.,
double pideff=95.,
double misid =5.,
double P_mix=0.00)
676 TFile *
f=
new TFile(fsig,
"READ");
679 cout <<
"File not found:"<<fsig<<endl;
683 bool dpm=fsig.Contains(
"DPM");
684 TString treename = dpm ?
"data" :
"ntp";
685 TTree *
t=(TTree*)f->Get(treename);
689 cout <<
"Tree '"<<treename<<
"' not found in '"<<fsig<<
"'."<<endl;
694 int Nevt = t->GetEntriesFast();
695 if (nev==0) nev = Nevt;
697 double mmean=0, mwsig=0, mwoff=0;
703 TCanvas *
c2=
new TCanvas(
"c2",
"c2",10,10,1500,830);
714 TH1F *h_mom=
new TH1F(
"h_mom",
"Momenta",200,0,5);
715 TH1F *h_momc=
new TH1F(
"h_momc",
"Momenta charged",200,0,5);
716 TH1F *h_momn=
new TH1F(
"h_momn",
"Momenta neutral",200,0,5);
717 TH1F *h_mult=
new TH1F(
"h_mult",
"Multiplicity",50,-0.5,49.5);
718 TH1F *h_multrec=
new TH1F(
"h_multrec",
"Multiplicity reco",50,-0.5,49.5);
719 TH1F *h_multc=
new TH1F(
"h_multc",
"Multiplicity charged",30,-0.5,29.5);
720 TH1F *h_multn=
new TH1F(
"h_multn",
"Multiplicity neutral",50,-0.5,49.5);
721 TH1F *h_fw1=
new TH1F(
"h_fw1",
"Fox Wolfram R1",300,-1.1,1.1);
722 TH1F *h_pmax=
new TH1F(
"h_pmax",
"pmax cms",300,0,5);
724 TH1F *h_mult_k =
new TH1F(
"h_mult_k",
"Multiplicity Kaons",10,-0.5,9.5);
725 TH1F *h_mult_lep =
new TH1F(
"h_mult_lep",
"Multiplicity Leptons",10,-0.5,9.5);
726 TH1F *h_sum_klep =
new TH1F(
"h_sum_lep",
"Sum Kaons + Leptons",15,-0.5,14.5);
727 TH2F *h_mult_klep=
new TH2F(
"h_mult_klep",
"#Kaons vs. #Leptons",10,-0.5,9.5, 10, -0.5, 9.5);
728 h_mult_klep->SetYTitle(
"#Leptons");
729 h_mult_klep->SetXTitle(
"#Kaons");
732 TH1F *h_pi0=
new TH1F(
"h_pi0",
"#pi^{0} #rightarrow #gamma#gamma",200,min,0.4);
733 TH1F *h_pi0sel=
new TH1F(
"h_pi0sel",
"Pi0",200,min,0.4);
734 TH1F *h_pi0sig=
new TH1F(
"h_pi0sig",
"Pi0",200,min,0.4);
735 h_pi0sig->SetLineColor(2);
739 TH1F *h_ks=
new TH1F(
"h_ks",
"K_{S}^{0} #rightarrow #pi^{+}#pi^{-}",200,0.2,0.8);
740 TH1F *h_kssel=
new TH1F(
"h_kssel",
"Pi0",200,0.2,0.8);
741 TH1F *h_kssig=
new TH1F(
"h_kssig",
"Pi0",200,0.2,0.8);
742 h_kssig->SetLineColor(2);
746 TH1F *h_jpsi=
new TH1F(
"h_jpsi",
"J/#psi #rightarrow l^{+}l^{-}",200,min,
max);
747 TH1F *h_jpsisel=
new TH1F(
"h_jpsisel",
"J/psi",200,min,
max);
748 TH1F *h_jpsisig=
new TH1F(
"h_jpsisig",
"J/psi",200,min,
max);
749 h_jpsisig->SetLineColor(2);
753 TH1F *h_d0=
new TH1F(
"h_d0",
"D^{0} #rightarrow K^{-}#pi^{+}",200,min,
max);
754 TH1F *h_d0sel=
new TH1F(
"h_d0sel",
"D0",200,min,
max);
755 TH1F *h_d0sig=
new TH1F(
"h_d0sig",
"D0",200,min,
max);
756 h_d0sig->SetLineColor(2);
759 TH1F *h_d02=
new TH1F(
"h_d02",
"D^{0} #rightarrow K^{-}#pi^{+}#pi^{0}",200,min,
max);
760 TH1F *h_d02sel=
new TH1F(
"h_d02sel",
"D0",200,min,
max);
761 TH1F *h_d02sig=
new TH1F(
"h_d02sig",
"D0",200,min,
max);
762 h_d02sig->SetLineColor(2);
765 TH1F *h_d03=
new TH1F(
"h_d03",
"D^{0} #rightarrow K^{-}#pi^{+}#pi^{+}#pi^{-}",200,min,
max);
766 TH1F *h_d03sel=
new TH1F(
"h_d03sel",
"D0",200,min,
max);
767 TH1F *h_d03sig=
new TH1F(
"h_d03sig",
"D0",200,min,
max);
768 h_d03sig->SetLineColor(2);
772 TH1F *h_dpm=
new TH1F(
"h_dpm",
"D^{+} #rightarrow K^{-}#pi^{+}#pi^{+}",200,min,
max);
773 TH1F *h_dpmsel=
new TH1F(
"h_dpmsel",
"D#pm",200,min,
max);
774 TH1F *h_dpmsig=
new TH1F(
"h_dpmsig",
"D#pm",200,min,
max);
775 h_dpmsig->SetLineColor(2);
778 TH1F *h_dpm2=
new TH1F(
"h_dpm2",
"D^{+} #rightarrow K^{-}#pi^{+}#pi^{+}#pi^{0}",200,min,
max);
779 TH1F *h_dpm2sel=
new TH1F(
"h_dpm2sel",
"D#pm",200,min,
max);
780 TH1F *h_dpm2sig=
new TH1F(
"h_dpm2sig",
"D#pm",200,min,
max);
781 h_dpm2sig->SetLineColor(2);
784 TH1F *h_dpm3=
new TH1F(
"h_dpm3",
"D^{+} #rightarrow K_{S}^{0}#pi^{+}#pi^{0}",200,min,
max);
785 TH1F *h_dpm3sel=
new TH1F(
"h_dpm3sel",
"D#pm",200,min,
max);
786 TH1F *h_dpm3sig=
new TH1F(
"h_dpm3sig",
"D#pm",200,min,
max);
787 h_dpm3sig->SetLineColor(2);
790 TH1F *h_dpm4=
new TH1F(
"h_dpm4",
"D^{+} #rightarrow K_{S}^{0}#pi^{+}#pi^{+}#pi^{-}",200,min,
max);
791 TH1F *h_dpm4sel=
new TH1F(
"h_dpm4sel",
"D#pm",200,min,
max);
792 TH1F *h_dpm4sig=
new TH1F(
"h_dpm4sig",
"D#pm",200,min,
max);
793 h_dpm4sig->SetLineColor(2);
797 TH1F *h_ds=
new TH1F(
"h_ds",
"D_{s}^{+} #rightarrow K^{+}K^{-}#pi^{+}",200,min,
max);
798 TH1F *h_dssel=
new TH1F(
"h_dssel",
"Ds",200,min,
max);
799 TH1F *h_dssig=
new TH1F(
"h_dssig",
"Ds",200,min,
max);
800 h_dssig->SetLineColor(2);
803 TH1F *h_ds2=
new TH1F(
"h_ds2",
"D_{s}^{+} #rightarrow K^{+}K^{-}#pi^{+}#pi^{0}",200,min,
max);
804 TH1F *h_ds2sel=
new TH1F(
"h_ds2sel",
"Ds",200,min,
max);
805 TH1F *h_ds2sig=
new TH1F(
"h_ds2sig",
"Ds",200,min,
max);
806 h_ds2sig->SetLineColor(2);
810 TH1F *h_phi=
new TH1F(
"h_phi",
"#phi #rightarrow K^{+}K^{-}",200,min,
max);
811 TH1F *h_phisel=
new TH1F(
"h_phisel",
"Phi",200,min,
max);
812 TH1F *h_phisig=
new TH1F(
"h_phisig",
"Phi",200,min,
max);
813 h_phisig->SetLineColor(2);
817 TH1F *h_lamc=
new TH1F(
"h_lamc",
"#Lambda_{c} #rightarrow pK^{-}#pi^{+}",200,min,
max);
818 TH1F *h_lamcsel=
new TH1F(
"h_lamcsel",
"Lam_c",200,min,
max);
819 TH1F *h_lamcsig=
new TH1F(
"h_lamcsig",
"Lam_c",200,min,
max);
820 h_lamcsig->SetLineColor(2);
824 TH1F *h_lam=
new TH1F(
"h_lam",
"#Lambda #rightarrow p#pi^{-}",200,min,
max);
825 TH1F *h_lamsel=
new TH1F(
"h_lamsel",
"Lam",200,min,
max);
826 TH1F *h_lamsig=
new TH1F(
"h_lamsig",
"Lam",200,min,
max);
827 h_lamsig->SetLineColor(2);
830 TNtuple *ntp=
new TNtuple(
"ntp",
"ntp",
"m:tht:pt:p:d1tht:d1pt:d1p:d2tht:d2pt:d2p:d3tht:d3pt:d3p");
832 h_jpsi->SetXTitle(
"m(l^{+}l^{-}) [GeV/c^{2}]");
834 h_d0->SetXTitle(
"m(K^{-}#pi^{+}) [GeV/c^{2}]");
835 h_d02->SetXTitle(
"m(K^{-}#pi^{+}#pi^{0}) [GeV/c^{2}]");
836 h_d03->SetXTitle(
"m(K^{-}#pi^{+}#pi^{+}#pi^{-}) [GeV/c^{2}]");
838 h_dpm->SetXTitle(
"m(K^{-}#pi^{+}#pi^{+}) [GeV/c^{2}]");
840 h_ds->SetXTitle(
"m(K^{+}K^{-}#pi^{+}) [GeV/c^{2}]");
842 h_phi->SetXTitle(
"m(K^{+}K^{-}) [GeV/c^{2}]");
843 h_lamc->SetXTitle(
"m(pK^{-}#pi^{+}) [GeV/c^{2}]");
844 h_lam->SetXTitle(
"m(p#pi^{-}) [GeV/c^{2}]");
850 TClonesArray* DpmPart=0;
854 DpmPart=
new TClonesArray(
"TParticle",100);
855 t->SetBranchAddress(
"Npart",&nTrk);
856 t->SetBranchAddress(
"Particles", &DpmPart);
860 t->SetBranchAddress(
"nTrk",&nTrk);
861 t->SetBranchAddress(
"Id",Id);
862 t->SetBranchAddress(
"DF",DF);
863 t->SetBranchAddress(
"DL",DL);
864 t->SetBranchAddress(
"px",px);
865 t->SetBranchAddress(
"py",py);
866 t->SetBranchAddress(
"pz",pz);
867 t->SetBranchAddress(
"E",E);
868 t->SetBranchAddress(
"m",m);
884 bool channelselect[13];
885 double channelcount[13];
886 TString channelname[13]={
"Phi(KK)",
"Lam(ppi)",
"J/psi(ll)",
"D+-(K2pi)",
"D+-(K2pipi0)",
"D+-(KSpipi0)",
"D+-(KS3pi)",
"D0(Kpi)",
"D0(Kpipi0)",
"D0(K3pi)",
"Ds(KKpi)",
"Ds(KKpipi0)",
"Lamc(pKpi)"};
888 for (i=0;i<13;++
i) channelcount[i]=0.;
890 if (
fRand.Rndm()<P_mix) mixevts=2;
896 if (i%5000==0) cout <<
"ev "<<i<<endl;
914 TParticle *
pt=(TParticle*)DpmPart->At(j);
915 Id[j] = pt->GetPdgCode();
916 int pdg = abs(Id[j]);
921 m[j] = pt->GetMass();
935 int pdg = abs(Id[j]);
936 TParticlePDG *
p=
pdg_db->GetParticle(Id[j]);
937 if (p) chrg = p->Charge();
938 if (abs(chrg)>1) chrg/=3;
940 SimpleCand c(px[j], py[j], pz[j], E[j], Id[j], j, chrg);
943 for (k=0;k<j;++k) if (j>=DF[k] && j<=DL[k])
957 if (++currmix<mixevts)
continue;
970 TVector3 boost =
fIni.BoostVector();
992 for (j=0;j<
kplus.size();++j)
if (
kplus[j].P4().P()>1.0) nk10++;
993 for (j=0;j<
kminus.size();++j)
if (
kminus[j].P4().P()>1.0) nk10++;
996 for (j=0;j<
pplus.size();++j)
if (
pplus[j].P4().P()>1.0) npr10++;
997 for (j=0;j<
pminus.size();++j)
if (
pminus[j].P4().P()>1.0) npr10++;
1000 h_mult_lep->Fill(nlep);
1001 h_mult_klep->Fill(nk, nlep);
1002 h_sum_klep->Fill(nk + nlep);
1010 CandList LDp, LDm, LDp2, LDm2, LDp3, LDm3, LDp4, LDm4;
1012 CandList LD0, LD02, LD0b, LD02b, LD03, LD03b;
1017 int ncomb1=0, ncomb2=0;
1018 bool selected=
false;
1020 for (j=0;j<13;++j) channelselect[j]=
false;
1032 bool accepted =
false;
1052 int npi0 = LPi0.size();
1053 int nks0 = LKs.size();
1061 double pmaxl = evsh.
PmaxLab();
1064 double ptmax = evsh.
Ptmax();
1070 double sumptl = sumpt;
1080 for (j=0; j<LPi0.size(); ++j)
1082 if (LPi0[j].P4().P()>0.5) npi005++;
1083 if (LPi0[j].P4().P()>1.0) npi010++;
1086 for (j=0; j<LKs.size(); ++j)
1088 if (LKs[j].P4().P()>0.5) nks005++;
1089 if (LKs[j].P4().P()>1.0) nks010++;
1100 || (sqrts==2.4 && nk>1 && npart<7 && pmax<0.648 )
1101 || (sqrts==3.77 && nk>1 && fw2>0.5456 )
1102 || (sqrts==4.28 && nk>1 && 1 )
1103 || (sqrts==5.0 && nk>1 && 1 )
1104 || (sqrts==5.5 && nk>1 && 1 )
1116 || (sqrts==2.4 && npart>3 && npr>0 && npi>0 && fw1>0.132 && fw4>0.2024 )
1117 || (sqrts==3.77 && npart>3 && pmax>1.056 && fw1>0.0 && fw2>0.6248 && fw5>0.22 )
1118 || (sqrts==4.28 && npart>3 && 1 )
1119 || (sqrts==5.0 && npart>3 && 1 )
1120 || (sqrts==5.5 && npart>3 && 1 )
1134 || (sqrts==3.77 && np10>1 && npi<4 && pmin<0.3 && sumpc>3.296 )
1135 || (sqrts==4.28 && 1 )
1136 || (sqrts==5.0 && 1 )
1137 || (sqrts==5.5 && 1 )
1151 || (sqrts==3.77 && nk>0 && npart<12 && pmax<0.936 && sumpc>1.76 )
1152 || (sqrts==4.28 && nk>0 && 1 )
1153 || (sqrts==5.0 && nk>0 && 1 )
1154 || (sqrts==5.5 && nk>0 && 1 )
1167 || (sqrts==3.77 && nk>0 && nneut>1 && pmax<0.888 && pmaxl<2.76 && sumptc>0.84 )
1168 || (sqrts==4.28 && nk>0 )
1169 || (sqrts==5.0 && nk>0 )
1170 || (sqrts==5.5 && nk>0 )
1183 || (sqrts==3.77 && nks0>0 && npi0>0 && pmax<0.91 && sumen<1.62 )
1184 || (sqrts==4.28 && 1 )
1185 || (sqrts==5.0 && 1 )
1186 || (sqrts==5.5 && 1 )
1199 || (sqrts==3.77 && nchrg>5 && np05<4 && pmax<0.888 && pmaxl<2.64 && sumen<1.02)
1200 || (sqrts==4.28 && 1 )
1201 || (sqrts==5.0 && 1 )
1202 || (sqrts==5.5 && 1 )
1216 || (sqrts==3.77 && nk>0 && sumpc05>3.18 && pmax>0.768 && pmax<1.056 && fw3<0.1848 )
1217 || (sqrts==4.28 && nk>0 && 1 )
1218 || (sqrts==5.0 && nk>0 && 1 )
1219 || (sqrts==5.5 && nk>0 && 1 )
1232 || (sqrts==3.77 && nk>0 && nneut>1 && npi<6 && pmax<0.948 && sumpt>1.56 && sumen<1.92)
1233 || (sqrts==4.28 && nk>0 )
1234 || (sqrts==5.0 && nk>0 )
1235 || (sqrts==5.5 && nk>0 )
1248 || (sqrts==3.77 && nk>0 && nchrg>5 && npi>2 && pmax<0.96 && sumen<1.32)
1249 || (sqrts==4.28 && nk>0 )
1250 || (sqrts==5.0 && nk>0 )
1251 || (sqrts==5.5 && nk>0 )
1265 || (sqrts==4.28 && nk>1 && 1 )
1266 || (sqrts==5.0 && nk>1 && 1 )
1267 || (sqrts==5.5 && nk>1 && 1 )
1280 || (sqrts==4.28 && nk>1 )
1281 || (sqrts==5.0 && nk>1 )
1282 || (sqrts==5.5 && nk>1 )
1296 || (sqrts==5.0 && 1 )
1297 || (sqrts==5.5 && 1 )
1312 if (!simcut || accepted)
1319 if (ncomb1>0) {selected=
true; channelselect[0]=
true;}
1327 combCnt += ncomb1 + ncomb2;
1328 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[1]=
true;}
1336 combCnt += ncomb1 +ncomb2;
1337 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[2]=
true;}
1345 combCnt += ncomb1 +ncomb2;
1346 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[3]=
true;}
1350 combCnt += ncomb1 +ncomb2;
1351 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[4]=
true;}
1355 combCnt += ncomb1 +ncomb2;
1356 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[5]=
true;}
1360 combCnt += ncomb1 +ncomb2;
1361 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[6]=
true;}
1370 combCnt += ncomb1 +ncomb2;
1371 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[7]=
true;}
1375 combCnt += ncomb1 +ncomb2;
1376 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[8]=
true;}
1380 combCnt += ncomb1 +ncomb2;
1381 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[9]=
true;}
1389 combCnt += ncomb1 +ncomb2;
1390 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[10]=
true;}
1394 combCnt += ncomb1 +ncomb2;
1395 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[11]=
true;}
1403 combCnt += ncomb1 + ncomb2;
1404 if (ncomb1>0 || ncomb2>0) {selected=
true; channelselect[12]=
true;}
1409 if (selected) evCnt+=mixevts;
1411 for (j=0;j<13;++j)
if (channelselect[j]) channelcount[j]+=mixevts;
1416 if (
fRand.Rndm()<P_mix) mixevts=2;
1421 cout<<
"#Combinations:"<<combCnt<<
" #Events:"<<evCnt<<
" ";
1422 cout <<
"Efficiency (ev):"<<(double)evCnt/(
double)nev<<endl;
1423 cout <<
"Mult Cut Eff (ev):"<<(double)evMultCut/(
double)nev<<endl;
1427 channelcount[
i]/=nev;
1428 cout <<channelname[
i]<<
":"<<channelcount[
i]<<endl;
1433 latex.SetTextSize(0.055);
1437 c2->cd(1); h_pi0->Draw(); h_pi0sel->Draw(
"same"); h_pi0sig->Draw(
"same");
1438 c2->cd(2); h_ks->Draw(); h_kssel->Draw(
"same"); h_kssig->Draw(
"same");
1440 c2->cd(3); h_phi->Draw(); h_phisel->Draw(
"same"); h_phisig->Draw(
"same");
1441 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[0]*100.);
1442 latex.DrawLatex(2.5,h_phi->GetMaximum()*0.95+
offset,tmp);
1444 c2->cd(4); h_lam->Draw(); h_lamsel->Draw(
"same"); h_lamsig->Draw(
"same");
1445 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[1]*100.);
1446 latex.DrawLatex(2.5,h_lam->GetMaximum()*0.95+
offset,tmp);
1448 c2->cd(5); h_jpsi->Draw(); h_jpsisel->Draw(
"same"); h_jpsisig->Draw(
"same");
1449 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[2]*100.);
1450 latex.DrawLatex(2.5,h_jpsi->GetMaximum()*0.95+
offset,tmp);
1452 c2->cd(6); h_dpm->Draw(); h_dpmsel->Draw(
"same"); h_dpmsig->Draw(
"same");
1453 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[3]*100.);
1454 latex.DrawLatex(2.5,h_dpm->GetMaximum()*0.95+
offset,tmp);
1456 c2->cd(7); h_dpm2->Draw(); h_dpm2sel->Draw(
"same"); h_dpm2sig->Draw(
"same");
1457 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[4]*100.);
1458 latex.DrawLatex(2.5,h_dpm2->GetMaximum()*0.95+
offset,tmp);
1460 c2->cd(8); h_dpm3->Draw(); h_dpm3sel->Draw(
"same"); h_dpm3sig->Draw(
"same");
1461 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[5]*100.);
1462 latex.DrawLatex(2.5,h_dpm3->GetMaximum()*0.95+
offset,tmp);
1464 c2->cd(9); h_dpm4->Draw(); h_dpm4sel->Draw(
"same"); h_dpm4sig->Draw(
"same");
1465 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[6]*100.);
1466 latex.DrawLatex(2.5,h_dpm4->GetMaximum()*0.95+
offset,tmp);
1468 c2->cd(10); h_d0->Draw(); h_d0sel->Draw(
"same"); h_d0sig->Draw(
"same");
1469 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[7]*100.);
1470 latex.DrawLatex(2.5,h_d0->GetMaximum()*0.95+
offset,tmp);
1472 c2->cd(11); h_d02->Draw(); h_d02sel->Draw(
"same"); h_d02sig->Draw(
"same");
1473 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[8]*100.);
1474 latex.DrawLatex(2.5,h_d02->GetMaximum()*0.95+
offset,tmp);
1476 c2->cd(12); h_d03->Draw(); h_d03sel->Draw(
"same"); h_d03sig->Draw(
"same");
1477 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[9]*100.);
1478 latex.DrawLatex(2.5,h_d03->GetMaximum()*0.95+
offset,tmp);
1480 c2->cd(13); h_ds->Draw(); h_dssel->Draw(
"same"); h_dssig->Draw(
"same");
1481 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[10]*100.);
1482 latex.DrawLatex(2.5,h_ds->GetMaximum()*0.95+
offset,tmp);
1484 c2->cd(14); h_ds2->Draw(); h_ds2sel->Draw(
"same"); h_ds2sig->Draw(
"same");
1485 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[11]*100.);
1486 latex.DrawLatex(2.5,h_ds2->GetMaximum()*0.95+
offset,tmp);
1488 c2->cd(15); h_lamc->Draw(); h_lamcsel->Draw(
"same"); h_lamcsig->Draw(
"same");
1489 sprintf(tmp,
"#epsilon = %4.1f%%",channelcount[12]*100.);
1490 latex.DrawLatex(2.5,h_lamc->GetMaximum()*0.95+
offset,tmp);
1496 TPad *peff=
new TPad(
"peff",
"peff",0.46,0.665,0.54,0.70);
1499 sprintf(tmp,
"#epsilon_{tot} = %4.1f%%",
double(evCnt)/
double(nev)*100.);
1500 latex.SetTextSize(0.7);
1501 latex.SetTextColor(2);
1502 latex.DrawLatex(0.15,0.3,tmp);
1505 h_mult_klep->Scale(1.0/nev);
double dponline(TLorentzVector &v)
void select(CandList &in, CandList &out, int chrg=0, int pdg=0, double mass=0.139)
void makeIni4Vector(TLorentzVector &l, double s)
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void makePidTable(double pideff, double misid)
void SetP4(TLorentzVector lv)
void makeRecoCands(CandList &mc, CandList &reco, double eff=0.90, double dp=0.05, double dtht=0.001, double dphi=0.001)
std::vector< SimpleCand > CandList
int combine(CandList &l1, CandList &l2, CandList &out, int matchPdg=0)
int softtrigger_toy12(TString fsig, int nev=2, double sqrts=3.77, bool simcut=false, bool evcut=false, double dp=0.03, double trkeff=100., double pideff=95., double misid=5., double P_mix=0.00)
friend F32vec4 sqrt(const F32vec4 &a)
void makePidSelection(CandList &l)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
void SetMcPid(bool mct=true)
void printList(CandList &l, TString tit="")
std::vector< SimpleCand > CandList
void boostList(CandList &list, CandList &boostlist, TVector3 boost)
void SetMarker(unsigned int i)
void SetMct(bool mct=true)
TString pt(TString pts, TString exts="px py pz")
TString m2(TString pts, TString exts="e px py pz")
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)
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)
double ChrgPSumCms() const
double FoxWolfMomR(int order)
std::map< int, int > pdgidx
void init(double pideff, double misid)
double SumChrgPminCms(double pmin)
void SetMotherIdx(int idx)
void printCand(SimpleCand c)
double ChrgPtSumLab() const
void smearMom(SimpleCand &c, double dpr=0.05, double dtht=0.000, double dphi=0.000)
void SetDau(int n, int m=0)
void selectMass(CandList &in, CandList &out, double mmean=0, double mw=0)
bool isDetected(double eff=0.90)
int massCrit(CandList &l, double m, double w)