30 #include "EvtGenBase/EvtComplex.hh"
31 #include "EvtGenBase/EvtTensor4C.hh"
32 #include "EvtGenBase/EvtVector4C.hh"
33 #include "EvtGenBase/EvtVector4R.hh"
34 #include "EvtGenBase/EvtVectorParticle.hh"
35 #include "EvtGenBase/EvtDiracSpinor.hh"
36 #include "EvtGenBase/EvtParticle.hh"
37 #include "EvtGenBase/EvtKine.hh"
38 #include "EvtGenBase/EvtGammaMatrix.hh"
39 #include "EvtGenBase/EvtRandom.hh"
40 #include "EvtGenBase/EvtRandomEngine.hh"
41 #include "EvtGenBase/EvtDecayTable.hh"
42 #include "EvtGenBase/EvtReport.hh"
43 #include "EvtGenBase/EvtPDL.hh"
44 #include "EvtGenBase/EvtStdHep.hh"
45 #include "EvtGenBase/EvtSecondary.hh"
46 #include "EvtGenBase/EvtConst.hh"
47 #include "EvtGen/EvtGen.hh"
48 #include "EvtGenBase/EvtParticleFactory.hh"
49 #include "EvtGenBase/EvtSimpleRandomEngine.hh"
50 #include "EvtGenBase/EvtMTRandomEngine.hh"
51 #include "EvtGenBase/EvtIdSet.hh"
52 #include "EvtGenBase/EvtParser.hh"
54 #include "EvtGenBase/EvtAbsRadCorr.hh"
55 #include "EvtGenBase/EvtDecayBase.hh"
57 #ifdef EVTGEN_EXTERNAL
58 #include "EvtGenExternal/EvtExternalGenList.hh"
72 #include "TApplication.h"
77 void runFile(
int nevent,
char* fname,
EvtGen& myGenerator);
78 void runPrint(
int nevent,
char* fname,
EvtGen& myGenerator);
79 void runFileVpho(
int nevent,
char* fname,
EvtGen& myGenerator);
80 void runTest1(
int nevent,
EvtGen& myGenerator);
81 void runTest2(
int nevent,
EvtGen& myGenerator);
82 void runOmega(
int nevent,
EvtGen& myGenerator);
83 void runChi1Kstar(
int nevent,
EvtGen& myGenerator);
84 void runPi0Dalitz(
int nevent,
EvtGen& myGenerator);
85 void runMix(
int nevent,
EvtGen& myGenerator);
86 void runBMix(
int nevent,
EvtGen& myGenerator,std::string userFile,std::string rootFile);
87 void runDDalitz(
int nevent,
EvtGen& myGenerator);
88 void runPiPiCPT(
int nevent,
EvtGen& myGenerator);
89 void runPiPiPiPi(
int nevent,
EvtGen& myGenerator);
90 void runD2Pi(
int nevent,
EvtGen& myGenerator);
91 void runJetsetTab3(
int nevent,
EvtGen& myGenerator);
92 void runHelAmp(
int nevent,
EvtGen& myGenerator,std::string userFile,std::string rootFile);
93 void runHelAmp2(
int nevent,
EvtGen& myGenerator);
94 void runJpsiKs(
int nevent,
EvtGen& myGenerator);
95 void runDump(
int nevent,
EvtGen& myGenerator);
96 void runD1(
int nevent,
EvtGen& myGenerator);
97 void runGenericCont(
int nevent,
EvtGen& myGenerator);
98 void runPiPiPi(
int nevent,
EvtGen& myGenerator);
99 void runBHadronic(
int nevent,
EvtGen& myGenerator);
100 void runSingleB(
int nevent,
EvtGen& myGenerator);
101 void runA2Pi(
int nevent,
EvtGen& myGenerator);
103 void runRepeat(
int nevent);
104 void runPhotos(
int nevent,
EvtGen& myGenerator);
105 void runTrackMult(
int nevent,
EvtGen& myGenerator);
106 void runGeneric(
int neventOrig,
EvtGen& myGenerator,
107 std::string listfile);
108 void runFinalStates(
int nevent,
EvtGen& myGenerator);
109 std::vector<std::string> findFinalState(
EvtParticle *p);
110 void runKstarnunu(
int nevent,
EvtGen& myGenerator);
111 void runBsmix(
int nevent,
EvtGen& myGenerator);
112 void runTauTauPiPi(
int nevent,
EvtGen& myGenerator);
113 void runTauTauEE(
int nevent,
EvtGen& myGenerator);
114 void runTauTau2Pi2Pi(
int nevent,
EvtGen& myGenerator);
115 void runTauTau3Pi3Pi(
int nevent,
EvtGen& myGenerator);
116 void runJPsiKstar(
int nevent,
EvtGen& myGenerator,
int modeInt);
117 void runSVVCPLH(
int nevent,
EvtGen& myGenerator);
118 void runSVSCPLH(
int nevent,
EvtGen& myGenerator);
119 void runSSDCP(
int nevent,
EvtGen& myGenerator);
120 void runKstarstargamma(
int nevent,
EvtGen& myGenerator);
121 void runDSTARPI(
int nevent,
EvtGen& myGenerator);
122 void runETACPHIPHI(
int nevent,
EvtGen& myGenerator);
123 void runVVPiPi(
int nevent,
EvtGen& myGenerator);
124 void runSVVHelAmp(
int nevent,
EvtGen& myGenerator);
125 void runSVVHelAmp2(
int nevent,
EvtGen& myGenerator);
126 void runPartWave(
int nevent,
EvtGen& myGenerator);
127 void runPartWave2(
int nevent,
EvtGen& myGenerator);
128 void runTwoBody(
int nevent,
EvtGen& myGenerator,std::string decfile,std::string rootFile);
129 void runPiPi(
int nevent,
EvtGen& myGenerator);
130 void runA1Pi(
int nevent,
EvtGen& myGenerator);
131 void runCPTest(
int nevent,
EvtGen& myGenerator);
132 void runSemic(
int nevent,
EvtGen& myGenerator);
133 void runKstarll(
int nevent,
EvtGen& myGenerator);
134 void runKll(
int nevent,
EvtGen& myGenerator);
135 void runHll(
int nevent,
EvtGen& myGenerator,
char* mode);
136 void runVectorIsr(
int nevent,
EvtGen& myGenerator);
137 void runBsquark(
int nevent,
EvtGen& myGenerator);
138 void runK3gamma(
int nevent,
EvtGen& myGenerator);
139 void runLambda(
int nevent,
EvtGen& myGenerator);
140 void runBtoXsgamma(
int nevent,
EvtGen& myGenerator);
141 void runBtoK1273gamma(
int nevent,
EvtGen& myGenerator);
142 void runCheckRotBoost();
143 void runMassCheck(
int nevent,
EvtGen& myGenerator,
int partnum);
144 void runJpsiPolarization(
int nevent,
EvtGen& myGenerator);
145 void runDDK(
int nevent,
EvtGen &myGenerator);
147 int countInclusive(std::string name,
EvtParticle *root,TH1F* mom=0,TH1F* mass=0 );
152 void runBaryonic(
int nEvent,
EvtGen& myGenerator);
155 int main(
int argc,
char* argv[]){
162 myRandomEngine =
new EvtMTRandomEngine();
167 if (!TROOT::Initialized()) {
168 static TROOT root(
"RooTuple",
"RooTuple ROOT in EvtGen");
175 EvtTensor4C T=dual(EvtGenFunctions::directProd(p,k));
177 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"p:"<<p<<std::endl;
178 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"k:"<<k<<std::endl;
179 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"T=dual(directProd(p,k)):"<<T<<std::endl;
180 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"T03:"<<T.get(0,3)<<std::endl;
185 std::list<EvtDecayBase*> extraModels;
187 #ifdef EVTGEN_EXTERNAL
189 radCorrEngine = genList.getPhotosModel();
190 extraModels = genList.getListOfModels();
193 EvtGen myGenerator(
"../DECAY_2010.DEC",
"../evt.pdl", myRandomEngine,
194 radCorrEngine, &extraModels);
196 if (!strcmp(argv[1],
"file")) {
197 int nevent=atoi(argv[2]);
198 runFile(nevent,argv[3],myGenerator);
201 if (!strcmp(argv[1],
"print")) {
202 int nevent=atoi(argv[2]);
203 runPrint(nevent,argv[3],myGenerator);
206 if (!strcmp(argv[1],
"filevpho")) {
207 int nevent=atoi(argv[2]);
208 runFileVpho(nevent,argv[3],myGenerator);
211 if (!strcmp(argv[1],
"test1")) {
212 int nevent=atoi(argv[2]);
213 runTest1(nevent,myGenerator);
216 if (!strcmp(argv[1],
"chi1kstar")) {
217 int nevent=atoi(argv[2]);
218 runChi1Kstar(nevent,myGenerator);
221 if (!strcmp(argv[1],
"test2")) {
222 int nevent=atoi(argv[2]);
223 runTest2(nevent,myGenerator);
226 if (!strcmp(argv[1],
"omega")) {
227 int nevent=atoi(argv[2]);
228 runOmega(nevent,myGenerator);
231 if (!strcmp(argv[1],
"alias")) {
235 if (!strcmp(argv[1],
"repeat")) {
236 int nevent=atoi(argv[2]);
240 if (!strcmp(argv[1],
"photos")) {
241 int nevent=atoi(argv[2]);
242 runPhotos(nevent,myGenerator);
245 if (!strcmp(argv[1],
"trackmult")) {
246 int nevent=atoi(argv[2]);
247 runTrackMult(nevent,myGenerator);
250 if (!strcmp(argv[1],
"generic")) {
251 int nevent=atoi(argv[2]);
252 std::string listfile(
"");
253 if ( argc==4) listfile=argv[3];
254 runGeneric(nevent,myGenerator,listfile);
257 if (!strcmp(argv[1],
"finalstates")) {
258 int nevent=atoi(argv[2]);
259 runFinalStates(nevent,myGenerator);
262 if (!strcmp(argv[1],
"kstarnunu")) {
263 int nevent=atoi(argv[2]);
264 runKstarnunu(nevent,myGenerator);
267 if (!strcmp(argv[1],
"bsmix")) {
268 int nevent=atoi(argv[2]);
269 runBsmix(nevent,myGenerator);
272 if (!strcmp(argv[1],
"BtoXsgamma")) {
273 int nevent=atoi(argv[2]);
274 runBtoXsgamma(nevent,myGenerator);
277 if (!strcmp(argv[1],
"BtoK1273gamma")) {
278 int nevent=atoi(argv[2]);
279 runBtoK1273gamma(nevent,myGenerator);
282 if (!strcmp(argv[1],
"pi0dalitz")) {
283 int nevent=atoi(argv[2]);
284 runPi0Dalitz(nevent,myGenerator);
287 if (!strcmp(argv[1],
"ddalitz")) {
288 int nevent=atoi(argv[2]);
289 runDDalitz(nevent,myGenerator);
293 if (!strcmp(argv[1],
"kstarll")) {
294 int nevent=atoi(argv[2]);
295 runKstarll(nevent, myGenerator);
297 if (!strcmp(argv[1],
"kll")) {
298 int nevent=atoi(argv[2]);
299 runKll(nevent, myGenerator);
301 if (!strcmp(argv[1],
"hll")) {
302 int nevent=atoi(argv[2]);
303 runHll(nevent, myGenerator, argv[3]);
306 if (!strcmp(argv[1],
"vectorisr")) {
307 int nevent=atoi(argv[2]);
308 runVectorIsr(nevent, myGenerator);
312 if (!strcmp(argv[1],
"bsquark")) {
313 int nevent=atoi(argv[2]);
314 runBsquark(nevent, myGenerator);
318 if (!strcmp(argv[1],
"k3gamma")) {
319 int nevent=atoi(argv[2]);
320 runK3gamma(nevent, myGenerator);
323 if (!strcmp(argv[1],
"lambda")) {
324 int nevent=atoi(argv[2]);
325 runLambda(nevent, myGenerator);
329 if (!strcmp(argv[1],
"tautaupipi")) {
330 int nevent=atoi(argv[2]);
331 runTauTauPiPi(nevent, myGenerator);
334 if (!strcmp(argv[1],
"tautauee")) {
335 int nevent=atoi(argv[2]);
336 runTauTauEE(nevent, myGenerator);
339 if (!strcmp(argv[1],
"tautau2pi2pi")) {
340 int nevent=atoi(argv[2]);
341 runTauTau2Pi2Pi(nevent, myGenerator);
343 if (!strcmp(argv[1],
"tautau3pi3pi")) {
344 int nevent=atoi(argv[2]);
345 runTauTau3Pi3Pi(nevent, myGenerator);
348 if (!strcmp(argv[1],
"jpsikstar")) {
349 int nevent=atoi(argv[2]);
350 int modeInt=atoi(argv[3]);
351 runJPsiKstar(nevent, myGenerator,modeInt);
355 if (!strcmp(argv[1],
"svvcplh")) {
356 int nevent=atoi(argv[2]);
357 runSVVCPLH(nevent, myGenerator);
361 if (!strcmp(argv[1],
"svscplh")) {
362 int nevent=atoi(argv[2]);
363 runSVSCPLH(nevent, myGenerator);
367 if (!strcmp(argv[1],
"ssdcp")) {
368 int nevent=atoi(argv[2]);
369 runSSDCP(nevent, myGenerator);
373 if (!strcmp(argv[1],
"kstarstargamma")) {
374 int nevent=atoi(argv[2]);
375 runKstarstargamma(nevent, myGenerator);
379 if (!strcmp(argv[1],
"dstarpi")) {
380 int nevent=atoi(argv[2]);
381 runDSTARPI(nevent, myGenerator);
385 if (!strcmp(argv[1],
"etacphiphi")) {
386 int nevent=atoi(argv[2]);
387 runETACPHIPHI(nevent, myGenerator);
390 if (!strcmp(argv[1],
"vvpipi")) {
391 int nevent=atoi(argv[2]);
392 runVVPiPi(nevent, myGenerator);
395 if (!strcmp(argv[1],
"svvhelamp")) {
396 int nevent=atoi(argv[2]);
397 runSVVHelAmp(nevent, myGenerator);
400 if (!strcmp(argv[1],
"partwave")) {
401 int nevent=atoi(argv[2]);
402 runPartWave(nevent, myGenerator);
405 if (!strcmp(argv[1],
"partwave2")) {
406 int nevent=atoi(argv[2]);
407 runPartWave2(nevent, myGenerator);
410 if (!strcmp(argv[1],
"twobody")) {
411 int nevent=atoi(argv[2]);
412 runTwoBody(nevent, myGenerator, argv[3], argv[4]);
415 if (!strcmp(argv[1],
"pipipi")) {
416 int nevent=atoi(argv[2]);
417 runPiPiPi(nevent, myGenerator);
420 if (!strcmp(argv[1],
"bhadronic")) {
421 int nevent=atoi(argv[2]);
422 runBHadronic(nevent, myGenerator);
425 if (!strcmp(argv[1],
"singleb")) {
426 int nevent=atoi(argv[2]);
427 runSingleB(nevent, myGenerator);
430 if (!strcmp(argv[1],
"pipi")) {
431 int nevent=atoi(argv[2]);
432 runPiPi(nevent, myGenerator);
435 if (!strcmp(argv[1],
"pipipipi")) {
436 int nevent=atoi(argv[2]);
437 runPiPiPiPi(nevent, myGenerator);
440 if (!strcmp(argv[1],
"a2pi")) {
441 int nevent=atoi(argv[2]);
442 runA2Pi(nevent, myGenerator);
445 if (!strcmp(argv[1],
"helamp")) {
446 int nevent=atoi(argv[2]);
447 runHelAmp(nevent, myGenerator, argv[3], argv[4]);
451 if (!strcmp(argv[1],
"helamp2")) {
452 int nevent=atoi(argv[2]);
453 runHelAmp2(nevent, myGenerator);
456 if (!strcmp(argv[1],
"d2pi")) {
457 int nevent=atoi(argv[2]);
458 runD2Pi(nevent, myGenerator);
461 if (!strcmp(argv[1],
"a1pi")) {
462 int nevent=atoi(argv[2]);
463 runA1Pi(nevent, myGenerator);
466 if (!strcmp(argv[1],
"cptest")) {
467 int nevent=atoi(argv[2]);
468 runCPTest(nevent, myGenerator);
471 if (!strcmp(argv[1],
"pipicpt")) {
472 int nevent=atoi(argv[2]);
473 runPiPiCPT(nevent, myGenerator);
476 if (!strcmp(argv[1],
"jpsiks")) {
477 int nevent=atoi(argv[2]);
478 runJpsiKs(nevent, myGenerator);
481 if (!strcmp(argv[1],
"dump")) {
482 int nevent=atoi(argv[2]);
483 runDump(nevent, myGenerator);
486 if (!strcmp(argv[1],
"genericcont")) {
487 int nevent=atoi(argv[2]);
488 runGenericCont(nevent, myGenerator);
492 if (!strcmp(argv[1],
"d1")) {
493 int nevent=atoi(argv[2]);
494 runD1(nevent, myGenerator);
497 if (!strcmp(argv[1],
"mix")) {
498 int nevent=atoi(argv[2]);
499 runMix(nevent, myGenerator);
502 if (!strcmp(argv[1],
"bmix")) {
503 int nevent=atoi(argv[2]);
504 runBMix(nevent, myGenerator, argv[3], argv[4]);
507 if (!strcmp(argv[1],
"semic")) {
508 int nevent=atoi(argv[2]);
509 runSemic(nevent,myGenerator);
512 if (!strcmp(argv[1],
"ddk")) {
513 int nevent=atoi(argv[2]);
514 runDDK(nevent,myGenerator);
517 if (!strcmp(argv[1],
"checkmass")) {
518 int nevent=atoi(argv[2]);
519 int partnum=atoi(argv[3]);
520 runMassCheck(nevent,myGenerator,partnum);
523 if (!strcmp(argv[1],
"jpsipolarization")) {
524 int nevent=atoi(argv[2]);
525 runJpsiPolarization(nevent,myGenerator);
533 if (!strcmp(argv[1],
"checkrotboost")) {
537 if ( !strcmp(argv[1],
"baryonic") )
539 runBaryonic( atoi(argv[2]), myGenerator );
542 delete myRandomEngine;
548 void runFile(
int nevent,
char* fname,
EvtGen &myGenerator) {
550 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
554 char udecay_name[100];
556 strcpy(udecay_name,fname);
558 myGenerator.readUDecay(udecay_name);
564 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
566 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
570 myGenerator.generateDecay(root_part);
574 }
while (count++<nevent);
575 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
578 void runPrint(
int nevent,
char* fname,
EvtGen &myGenerator) {
580 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
584 char udecay_name[100];
586 strcpy(udecay_name,fname);
588 myGenerator.readUDecay(udecay_name);
594 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
596 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
600 myGenerator.generateDecay(root_part);
606 }
while (count++<nevent);
607 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
610 void runFileVpho(
int nevent,
char* fname,
EvtGen &myGenerator) {
612 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
613 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
617 char udecay_name[100];
619 strcpy(udecay_name,fname);
621 myGenerator.readUDecay(udecay_name);
627 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
629 EvtParticle* root_part=EvtParticleFactory::particleFactory(VPHO,
633 myGenerator.generateDecay(root_part);
637 }
while (count++<nevent);
638 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
644 void runJpsiPolarization(
int nevent,
EvtGen &myGenerator) {
646 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
647 static EvtId JPSI=EvtPDL::getId(std::string(
"J/psi"));
651 myGenerator.readUDecay(
"exampleFiles/GENERIC.DEC");
652 myGenerator.readUDecay(
"exampleFiles/JPSITOLL.DEC");
653 TFile *file=
new TFile(
"jpsipolar.root",
"RECREATE");
655 TH1F* coshel =
new TH1F(
"h1",
"cos hel",50,-1.0,1.0);
656 TH1F* coshelHigh =
new TH1F(
"h2",
"cos hel pstar gt 1.1",50,-1.0,1.0);
657 TH1F* coshelLow =
new TH1F(
"h3",
"cos hel pstar lt 1.1",50,-1.0,1.0);
663 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
664 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
668 myGenerator.generateDecay(root_part);
673 if (p->
getId()==JPSI) {
676 double dcostheta=EvtDecayAngle(p_init,p4psi,p4Daug);
677 coshel->Fill(dcostheta);
678 if ( p4psi.d3mag() > 1.1 ) {
679 coshelHigh->Fill(dcostheta);
682 coshelLow->Fill(dcostheta);
689 }
while (count++<nevent);
691 file->Write(); file->Close();
693 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
697 void runMassCheck(
int nevent,
EvtGen &myGenerator,
701 static EvtId myPart=EvtPDL::evtIdFromStdHep(partnum);
702 TFile *file=
new TFile(
"checkmass.root",
"RECREATE");
704 TH1F* mass =
new TH1F(
"h1",
"Mass",500,0.0,2.5);
708 mass->Fill(EvtPDL::getMass(myPart));
709 }
while (count++<nevent);
710 file->Write(); file->Close();
712 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
716 void runPi0Dalitz(
int nevent,
EvtGen &myGenerator) {
718 static EvtId PI0=EvtPDL::getId(std::string(
"pi0"));
720 TFile *file=
new TFile(
"pi0dalitz.root",
"RECREATE");
722 TH1F* q2 =
new TH1F(
"h1",
"q2",50,0.0,0.02);
727 myGenerator.readUDecay(
"exampleFiles/PI0DALITZ.DEC");
734 EvtVector4R p_init(EvtPDL::getMass(PI0),0.0,0.0,0.0);
736 EvtParticle* root_part=EvtParticleFactory::particleFactory(PI0,
741 myGenerator.generateDecay(root_part);
747 q2->Fill( (ep+em).mass2() );
751 }
while (count++<nevent);
753 file->Write(); file->Close();
755 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
762 void runTest1(
int nevent,
EvtGen &myGenerator) {
764 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
769 TFile *file =
new TFile(
"test1.root",
"RECREATE",
"Example");
770 TH1F * costhetaB =
new TH1F(
"hcosthetaB",
"costhetaB",50,-1.0,1.0);
771 TH1F* phiB =
new TH1F(
"hphiB",
"phiB",50,-EvtConst::pi,EvtConst::pi);
772 TH1F* Elep =
new TH1F(
"hEl",
"E?l!",50,0.0,2.5);
773 TH1F* q2 =
new TH1F(
"hq2",
"q^2!",44,0.0,11.0);
774 TH1F* ctv =
new TH1F(
"hctv",
"ctv",50,-1.0,1.0);
775 TH1F* chi_low_ctv =
new TH1F(
"hcostv1",
"[h] for cos[Q]?V!\"L#0",50,0.0,EvtConst::twoPi);
776 TH1F* chi_high_ctv =
new TH1F(
"hcostv2",
"[h] for cos[Q]?V!\"G#0",50,0.0,EvtConst::twoPi);
777 TH1F* dt =
new TH1F(
"hdt",
"dt",50,-5.0,5.0);
782 EvtVector4R p4b0,p4b0b,p4dstar,p4e,p4nu,p4d,p4pi,p4pip,p4pim;
783 char udecay_name[100];
785 strcpy(udecay_name,
"exampleFiles/TEST1.DEC");
789 myGenerator.readUDecay(udecay_name);
796 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
798 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
802 myGenerator.generateDecay(root_part);
819 costhetaB->Fill(p4b0.get(3)/p4b0.d3mag());
820 phiB->Fill(atan2(p4b0.get(1),p4b0.get(2)));
821 Elep->Fill(p4b0*p4e/p4b0.mass());
822 q2->Fill((p4e+p4nu).mass2());
824 costhetaV=EvtDecayAngle(p4b0,p4d+p4pi,p4d);
825 ctv->Fill(costhetaV);
827 chi_low_ctv->Fill(EvtDecayAngleChi(p4b0,p4d,p4pi,p4e,p4nu));
830 chi_high_ctv->Fill(EvtDecayAngleChi(p4b0,p4d,p4pi,p4e,p4nu));
835 }
while (count++<nevent);
841 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
845 void runDDK(
int nevent,
EvtGen &myGenerator) {
847 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
851 char udecay_name[100];
853 strcpy(udecay_name,
"exampleFiles/GENERIC.DEC");
855 myGenerator.readUDecay(udecay_name);
859 static EvtId kp=EvtPDL::getId(std::string(
"K+"));
860 static EvtId km=EvtPDL::getId(std::string(
"K-"));
861 static EvtId ks=EvtPDL::getId(std::string(
"K_S0"));
862 static EvtId kl=EvtPDL::getId(std::string(
"K_L0"));
863 static EvtId k0=EvtPDL::getId(std::string(
"K0"));
864 static EvtId kb=EvtPDL::getId(std::string(
"anti-K0"));
866 static EvtId d0=EvtPDL::getId(std::string(
"D0"));
867 static EvtId dp=EvtPDL::getId(std::string(
"D+"));
868 static EvtId dm=EvtPDL::getId(std::string(
"D-"));
869 static EvtId db=EvtPDL::getId(std::string(
"anti-D0"));
871 static EvtIdSet theKs(kp,km,ks,kl,k0,kb);
874 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
875 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
876 static EvtId BP=EvtPDL::getId(std::string(
"B+"));
877 static EvtId BM=EvtPDL::getId(std::string(
"B-"));
879 static EvtIdSet theBs(B0B,B0,BP,BM);
884 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
886 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
890 myGenerator.generateDecay(root_part);
902 if (theDs.contains(type)) nD++;
903 if (theKs.contains(type) && theBs.contains(typePar)) nK++;
906 if ( nD==2 && nK==1 ) nDDK++;
915 if (theDs.contains(type)) nD++;
916 if (theKs.contains(type) && theBs.contains(typePar)) nK++;
919 if ( nD==2 && nK==1 ) nDDK++;
923 }
while (count++<nevent);
925 EvtGenReport(EVTGEN_INFO,
"EvtGen") << nDDK <<
" " << (count-1) <<
" " << nDDK/
float(2*(count-1)) << std::endl;
926 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
931 void runTest2(
int nevent,
EvtGen &myGenerator) {
933 TFile *file=
new TFile(
"test2.root",
"RECREATE");
934 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
935 TH1F* costhetaB =
new TH1F(
"h1",
"cos[Q]?B!",50,-1.0,1.0);
936 TH1F* phiB =
new TH1F(
"h2",
"[f]?B!",50,-EvtConst::pi,
939 TH1F* dt =
new TH1F(
"h3",
"[D]t",100,-5.0,5.0);
940 TH1F* costhetaJpsi =
new TH1F(
"h4",
"cos[Q]?J/[y]!",
942 TH1F* costhetaKstar =
new TH1F(
"h5",
"cos[Q]?K*!",
944 TH1F* chi =
new TH1F(
"h6",
"[h]",50,0.0,EvtConst::twoPi);
945 TH1F* chi1 =
new TH1F(
"h26",
"[h] [D]t\"L#0",50,0.0,
947 TH1F* chi2 =
new TH1F(
"h27",
"[h] [D]t\"G#0",50,0.0,
950 TH1F* costhetaomega =
new TH1F(
"h7",
"costhetaomega",50,-1.0,1.0);
951 TH1F* costhetaomega1 =
new TH1F(
"h20",
"costhetaomega1",50,-1.0,1.0);
952 TH1F* costhetaomega2 =
new TH1F(
"h21",
"costhetaomega2",50,-1.0,1.0);
953 TH1F* costhetaomega3 =
new TH1F(
"h22",
"costhetaomega3",50,-1.0,1.0);
954 TH1F* omegaamp =
new TH1F(
"h8",
"omegaamp",50,0.0,0.05);
955 TH1F* omegaamp1 =
new TH1F(
"h9",
"omegaamp1",50,0.0,0.05);
956 TH1F* omegaamp2 =
new TH1F(
"h10",
"omegaamp2",50,0.0,0.05);
957 TH1F* omegaamp3 =
new TH1F(
"h11",
"omegaamp3",50,0.0,0.05);
959 TH2F* chi1vscoskstarl =
960 new TH2F(
"h30",
"[h] vs. cos[Q]?J/[y]! [D]t\"L#0",
961 20,0.0,EvtConst::twoPi,20,-1.0,1.0);
963 TH2F* chi1vscoskstarg =
964 new TH2F(
"h31",
"[h] vs. cos[Q]?J/[y]! [D]t\"G#0",
965 20,0.0,EvtConst::twoPi,20,-1.0,1.0);
969 EvtVector4R p4_b0,p4_b0b,p4_psi,p4_kstar,p4_mup,p4_mum;
970 EvtVector4R p4_kz,p4_pi0,p4_pi1,p4_pi2,p4_pi3,p4_omega;
971 EvtVector4R p4_pi1_omega,p4_pi2_omega,p4_pi3_omega;
972 char udecay_name[100];
974 strcpy(udecay_name,
"exampleFiles/TEST2.DEC");
976 myGenerator.readUDecay(udecay_name);
980 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
982 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
986 myGenerator.generateDecay(root_part);
1008 p4_pi2_omega.get(1),
1009 p4_pi2_omega.get(2)),
1011 p4_pi3_omega.get(1),
1012 p4_pi3_omega.get(2)));
1014 EvtVector4R p4_perp(p3_perp.d3mag(),p3_perp.get(0),
1015 p3_perp.get(1),p3_perp.get(2));
1023 double d_omegaamp=
EvtVector3R(p4_pi1_omega.get(0),
1024 p4_pi1_omega.get(1),
1025 p4_pi1_omega.get(2))*p3_perp;
1027 d_omegaamp*=d_omegaamp;
1032 double d_costhetaJpsi=EvtDecayAngle(p4_b0b,p4_mup+p4_mum,p4_mup);
1033 double d_costhetaKstar=EvtDecayAngle(p4_b0b,p4_pi0+p4_kz,p4_pi0);
1034 double d_chi=EvtDecayAngleChi(p4_b0b,p4_pi0,p4_kz,p4_mup, p4_mum );
1035 costhetaB->Fill(p4_b0.get(3)/p4_b0.d3mag());
1036 phiB->Fill(atan2(p4_b0.get(1),p4_b0.get(2)));
1039 costhetaJpsi->Fill(d_costhetaJpsi);
1040 costhetaKstar->Fill(d_costhetaKstar);
1045 chi1vscoskstarl->Fill(d_chi,d_costhetaJpsi,1.0);
1050 chi1vscoskstarg->Fill(d_chi,d_costhetaJpsi,1.0);
1053 double d_costhetaomega=EvtDecayAngle(p4_b0b,p4_perp+p4_perpprime,p4_perp);
1056 costhetaomega->Fill(d_costhetaomega);
1057 if (d_omegaamp<0.001) costhetaomega1->Fill(d_costhetaomega);
1058 if (d_omegaamp>0.02) costhetaomega2->Fill(d_costhetaomega);
1059 if (std::fabs(d_omegaamp-0.015)<0.005) costhetaomega3->Fill(d_costhetaomega);
1061 omegaamp->Fill(d_omegaamp);
1062 if (d_costhetaomega<-0.5) omegaamp1->Fill(d_omegaamp);
1063 if (d_costhetaomega>0.5) omegaamp2->Fill(d_omegaamp);
1064 if (std::fabs(d_costhetaomega)<0.5) omegaamp3->Fill(d_omegaamp);
1068 }
while (count++<nevent);
1070 file->Write(); file->Close();
1071 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1076 void runOmega(
int nevent,
EvtGen &myGenerator) {
1078 TFile *file=
new TFile(
"omega.root",
"RECREATE");
1079 static EvtId OMEGA=EvtPDL::getId(std::string(
"omega"));
1081 TH2F* dalitz =
new TH2F(
"h1",
"E1 vs E2",50,0.0,0.5,50,0.0,0.5);
1085 char udecay_name[100];
1088 strcpy(udecay_name,
"exampleFiles/OMEGA.DEC");
1089 myGenerator.readUDecay(udecay_name);
1093 EvtVector4R p_init(EvtPDL::getMeanMass(OMEGA),0.0,0.0,0.0);
1095 EvtParticle* root_part=EvtParticleFactory::particleFactory(OMEGA,
1100 myGenerator.generateDecay(root_part);
1108 }
while (count++<nevent);
1110 file->Write(); file->Close();
1111 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1117 void runChi1Kstar(
int nevent,
EvtGen &myGenerator) {
1119 TFile *file=
new TFile(
"chi1kstar.root",
"RECREATE");
1120 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
1122 TH1F* costhetaChi1 =
new TH1F(
"h1",
"cos[Q]?J/[x]!",
1124 TH1F* costhetaKstar =
new TH1F(
"h2",
"cos[Q]?K*!",
1126 TH1F* chi =
new TH1F(
"h3",
"[x]",50,-EvtConst::pi,EvtConst::pi);
1131 EvtVector4R p4_b,p4_chi,p4_kstar,p4_gamma,p4_psi,p4_k,p4_p;
1133 char udecay_name[100];
1135 strcpy(udecay_name,
"exampleFiles/CHI1KSTAR.DEC");
1137 myGenerator.readUDecay(udecay_name);
1141 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
1143 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
1145 myGenerator.generateDecay(root_part);
1155 double d_costhetaChi1=EvtDecayAngle(p4_b,p4_chi,p4_psi);
1156 double d_costhetaKstar=EvtDecayAngle(p4_b,p4_kstar,p4_k);
1157 double d_chi=EvtDecayAngleChi(p4_b,p4_k,p4_p,p4_psi, p4_gamma );
1159 if (d_chi>EvtConst::pi) d_chi-=EvtConst::twoPi;
1163 costhetaChi1->Fill(d_costhetaChi1);
1164 costhetaKstar->Fill(d_costhetaKstar);
1169 }
while (count++<nevent);
1171 file->Write(); file->Close();
1172 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1177 EvtId idpip=EvtPDL::getId(std::string(
"pi+"));
1178 EvtPDL::alias(idpip,std::string(
"my_pi+"));
1179 EvtId myidpip=EvtPDL::getId(std::string(
"my_pi+"));
1181 EvtId idpim=EvtPDL::getId(std::string(
"pi-"));
1182 EvtPDL::alias(idpim,std::string(
"my_pi-"));
1183 EvtId myidpim=EvtPDL::getId(std::string(
"my_pi-"));
1185 EvtId idpi0=EvtPDL::getId(std::string(
"pi0"));
1186 EvtPDL::alias(idpi0,std::string(
"my_pi0"));
1187 EvtId myidpi0=EvtPDL::getId(std::string(
"my_pi0"));
1191 EvtPDL::aliasChgConj(myidpip,myidpim);
1193 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Id pi+:" << idpip << std::endl;
1194 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Id pi-:" << idpim << std::endl;
1195 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Id pi0:" << idpi0 << std::endl;
1196 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Id my_pi+:" << myidpip << std::endl;
1197 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Id my_pi-:" << myidpim << std::endl;
1198 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Id my_pi0:" << myidpi0 << std::endl;
1200 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Chg conj pi+:" <<
1201 EvtPDL::chargeConj(idpip) << std::endl;
1202 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Chg conj pi-:" <<
1203 EvtPDL::chargeConj(idpim) << std::endl;
1204 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Chg conj pi0:" <<
1205 EvtPDL::chargeConj(idpi0) << std::endl;
1206 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Chg conj my_pi+:" <<
1207 EvtPDL::chargeConj(myidpip) << std::endl;
1208 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Chg conj my_pi-:" <<
1209 EvtPDL::chargeConj(myidpim) << std::endl;
1210 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Chg conj my_pi0:" <<
1211 EvtPDL::chargeConj(myidpi0) << std::endl;
1212 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1216 void runRepeat(
int nevent) {
1219 for(i=0;i<nevent;i++){
1221 EvtDecayTable::getInstance()->readDecayFile(std::string(
"../DECAY_2010.DEC"));
1224 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1228 void runPhotos(
int nevent,
EvtGen &myGenerator) {
1230 static EvtId PSI=EvtPDL::getId(std::string(
"J/psi"));
1232 TFile *file=
new TFile(
"photos.root",
"RECREATE");
1234 TH1F* mee =
new TH1F(
"h1",
"mee",60,3.0,3.12);
1240 char udecay_name[100];
1241 strcpy(udecay_name,
"exampleFiles/PHOTOS.DEC");
1243 myGenerator.readUDecay(udecay_name);
1247 EvtVector4R p_init(EvtPDL::getMass(PSI),0.0,0.0,0.0);
1249 EvtParticle* root_part=EvtParticleFactory::particleFactory(PSI,
1253 myGenerator.generateDecay(root_part);
1258 mee->Fill( (e1+e2).mass() );
1262 }
while (count++<nevent);
1264 file->Write(); file->Close();
1265 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1268 void runFinalStates(
int nevent,
EvtGen &myGenerator) {
1275 parser.read(std::string(
"exampleFiles/finalstates.list"));
1277 std::vector< std::string > dList[20];
1279 std::vector< std::string > *dListItem = 0;
1280 std::string dListName[20];
1285 for(ik=0;ik<parser.getNToken();ik++){
1287 tline=parser.getLineofToken(ik);
1288 tk=parser.getToken(ik);
1290 if ( lk!=tline&&tline>2) {
1292 dList[tline-3]=*dListItem;
1293 dListItem=
new std::vector<std::string>;
1294 dListNum[tline-3]=0;
1295 dListName[tline-2]=parser.getToken(ik);
1301 parent=parser.getToken(ik);
1302 dListItem=
new std::vector<std::string>;
1306 if ( tline!=2 || (lk==tline) ) {
1307 dListItem->push_back(parser.getToken(ik));
1309 if ( tline==2 && (lk!=tline) ) {
1310 dListName[tline-2]=parser.getToken(ik);
1315 dList[tline-2]=*dListItem;
1316 dListNum[tline-2]=0;
1319 static EvtId parId=EvtPDL::getId(parent);
1323 if (count==1000*(count/1000)) {
1325 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Event:"<< count << std::endl;
1328 EvtVector4R p_init(EvtPDL::getMass(parId),0.0,0.0,0.0);
1330 EvtParticle* root_part=EvtParticleFactory::particleFactory(parId,
1332 if ( parent==
"Upsilon(4S)") {
1340 myGenerator.generateDecay(root_part);
1344 std::vector<std::string> fs=findFinalState(p);
1347 for(j=0; j<(tline-1); j++) {
1348 std::vector<std::string> temp=dList[j];
1349 if ( temp.size() == fs.size() ) {
1352 std::vector<bool> alreadyUsed(temp.size());
1353 for(k=0; k<temp.size(); k++) {
1354 bool foundThisOne=
false;
1355 for(l=0; l<temp.size(); l++) {
1356 if ( k==0 ) alreadyUsed[l]=
false;
1357 if ( foundThisOne||alreadyUsed[l] )
continue;
1358 if ( temp[k]==fs[l] ) {
1359 alreadyUsed[l]=
true;
1364 if ( !foundThisOne ) foundIt=
false;
1376 }
while(count<nevent);
1378 for (j=0; j<(tline-1) ; j++) EvtGenReport(EVTGEN_INFO,
"EvtGen") << dListName[j].c_str() <<
" " << j <<
" " << dListNum[j] <<
" " << count <<
" "<< (dListNum[j]/(1.0*count)) << std::endl;
1380 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1384 std::vector<std::string> findFinalState(
EvtParticle *tree){
1387 std::vector<std::string> fs;
1388 static EvtId ep=EvtPDL::getId(std::string(
"e+"));
1389 static EvtId em=EvtPDL::getId(std::string(
"e-"));
1390 static EvtId kp=EvtPDL::getId(std::string(
"K+"));
1391 static EvtId km=EvtPDL::getId(std::string(
"K-"));
1392 static EvtId mup=EvtPDL::getId(std::string(
"mu+"));
1393 static EvtId mum=EvtPDL::getId(std::string(
"mu-"));
1394 static EvtId pip=EvtPDL::getId(std::string(
"pi+"));
1395 static EvtId pim=EvtPDL::getId(std::string(
"pi-"));
1396 static EvtId pi0=EvtPDL::getId(std::string(
"pi0"));
1397 static EvtId pr=EvtPDL::getId(std::string(
"p+"));
1398 static EvtId apr=EvtPDL::getId(std::string(
"anti-p-"));
1399 static EvtId ne=EvtPDL::getId(std::string(
"n0"));
1400 static EvtId ane=EvtPDL::getId(std::string(
"anti-n0"));
1406 if (type==ep) fs.push_back(std::string(
"e+"));
1407 if (type==em) fs.push_back(std::string(
"e-"));
1408 if (type==mup) fs.push_back(std::string(
"mu+"));
1409 if (type==mum) fs.push_back(std::string(
"mu-"));
1410 if (type==kp) fs.push_back(std::string(
"K+"));
1411 if (type==km) fs.push_back(std::string(
"K-"));
1412 if (type==pip) fs.push_back(std::string(
"pi+"));
1413 if (type==pim) fs.push_back(std::string(
"pi-"));
1414 if (type==pi0) fs.push_back(std::string(
"pi0"));
1415 if (type==pr) fs.push_back(std::string(
"p+"));
1416 if (type==apr) fs.push_back(std::string(
"anti-p-"));
1417 if (type==ne) fs.push_back(std::string(
"n0"));
1418 if (type==ane) fs.push_back(std::string(
"anti-n0"));
1427 void runTrackMult(
int nevent,
EvtGen &myGenerator) {
1429 TFile *file=
new TFile(
"trackmult.root",
"RECREATE");
1431 TH1F* trackAll =
new TH1F(
"trackAll",
"trackAll",12,1.0,25.0);
1432 TH1F* trackNoSL =
new TH1F(
"trackNoSL",
"trackNoSL",12,1.0,25.0);
1433 TH1F* track1SL =
new TH1F(
"track1SL",
"track1SL",12,1.0,25.0);
1434 TH1F* track2SL =
new TH1F(
"track2SL",
"track2SL",12,1.0,25.0);
1436 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
1438 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
1439 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
1440 static EvtId BP=EvtPDL::getId(std::string(
"B+"));
1441 static EvtId BM=EvtPDL::getId(std::string(
"B-"));
1444 static EvtId ep=EvtPDL::getId(std::string(
"e+"));
1445 static EvtId em=EvtPDL::getId(std::string(
"e-"));
1446 static EvtId mup=EvtPDL::getId(std::string(
"mu+"));
1447 static EvtId mum=EvtPDL::getId(std::string(
"mu-"));
1448 static EvtId pip=EvtPDL::getId(std::string(
"pi+"));
1449 static EvtId pim=EvtPDL::getId(std::string(
"pi-"));
1450 static EvtId kp=EvtPDL::getId(std::string(
"K+"));
1451 static EvtId km=EvtPDL::getId(std::string(
"K-"));
1452 static EvtId pp=EvtPDL::getId(std::string(
"p+"));
1453 static EvtId pm=EvtPDL::getId(std::string(
"anti-p-"));
1455 static EvtIdSet theTracks(ep,em,mup,mum,pip,pim,kp,km,pp,pm);
1456 static EvtIdSet theLeptons(ep,em,mup,mum);
1457 static EvtIdSet theBs(B0,B0B,BP,BM);
1463 myGenerator.readUDecay(
"exampleFiles/GENERIC.DEC");
1466 int totTracksNoSL=0;
1477 if (count==1000*(count/1000)) {
1478 EvtGenReport(EVTGEN_INFO,
"EvtGen") << count << std::endl;
1481 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
1483 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
1488 myGenerator.generateDecay(root_part);
1495 if (theTracks.contains(p->
getId())) {
1499 if ( theLeptons.contains(p->
getId())) {
1509 trackAll->Fill(evTracks);
1510 if ( howManySL==0 ) {trackNoSL->Fill(evTracks); totNoSL+=1; totTracksNoSL+=evTracks;}
1511 if ( howManySL==1 ) {track1SL->Fill(evTracks); tot1SL+=1; totTracks1SL+=evTracks;}
1512 if ( howManySL==2 ) {track2SL->Fill(evTracks); tot2SL+=1; totTracks2SL+=evTracks;}
1515 }
while (count++<nevent);
1517 double aveMulti=float(totTracks)/float(nevent);
1518 double aveMultiNoSL=float(totTracksNoSL)/float(totNoSL);
1519 double aveMulti1SL=float(totTracks1SL)/float(tot1SL);
1520 double aveMulti2SL=float(totTracks2SL)/float(tot2SL);
1521 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Your average multiplicity="<<aveMulti<<std::endl;
1522 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Your average multiplicity for no B->semileptonic events="<<aveMultiNoSL<<std::endl;
1523 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Your average multiplicity for 1 B->semileptonic events="<<aveMulti1SL<<std::endl;
1524 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Your average multiplicity for 2 B->semileptonic events="<<aveMulti2SL<<std::endl;
1525 file->Write(); file->Close();
1526 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1531 void runGeneric(
int neventOrig,
EvtGen &myGenerator,
1532 std::string listfile) {
1534 int nevent=abs(neventOrig);
1539 TFile *file=
new TFile(
"generic.root",
"RECREATE");
1541 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
1542 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
1544 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
1545 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
1546 static EvtId BP=EvtPDL::getId(std::string(
"B+"));
1547 static EvtId BM=EvtPDL::getId(std::string(
"B-"));
1549 static EvtIdSet theBs(B0B,B0,BP,BM);
1555 static EvtId D0=EvtPDL::getId(std::string(
"D0"));
1556 static EvtId D0B=EvtPDL::getId(std::string(
"anti-D0"));
1557 static EvtId DP=EvtPDL::getId(std::string(
"D+"));
1558 static EvtId DM=EvtPDL::getId(std::string(
"D-"));
1560 static EvtIdSet theDs(D0B,D0,DP,DM);
1573 char udecay_name[100];
1575 strcpy(udecay_name,
"exampleFiles/GENERIC.DEC");
1576 myGenerator.readUDecay(udecay_name);
1580 if (parser.read(listfile)!=0){
1581 EvtGenReport(EVTGEN_ERROR,
"EvtGen") <<
"Will terminate."<<std::endl;
1586 std::vector<TH1F*> histo1(parser.getNToken());
1587 std::vector<TH1F*> histo2(parser.getNToken());
1588 std::vector<TH1F*> massHisto(parser.getNToken());
1591 std::string tk,tkname;
1592 for(ik=0;ik<(parser.getNToken()/2);ik++){
1593 tk=parser.getToken(2*ik);
1594 tkname=parser.getToken(1+2*ik);
1595 histo1[ik] =
new TH1F(tkname.c_str(),tkname.c_str(), 30,0.0,3.0);
1597 directName=
new char[(strlen(tkname.c_str())+8)];
1598 directName = strcpy(directName,tkname.c_str());
1599 directName = strcat(directName,
"Direct");
1600 histo2[ik] =
new TH1F(directName,directName,
1605 massName=
new char[(strlen(tkname.c_str())+4)];
1606 massName = strcpy(massName,tkname.c_str());
1607 massName = strcat(massName,
"Mass");
1608 massHisto[ik] =
new TH1F(massName,massName, 3000,0.0,5.0);
1613 std::vector<int> temp(parser.getNToken()/2,0);
1614 std::vector<int> tempB(parser.getNToken()/2,0);
1615 std::vector<int> tempB0B(parser.getNToken()/2,0);
1616 std::vector<int> tempB0(parser.getNToken()/2,0);
1617 std::vector<int> tempBP(parser.getNToken()/2,0);
1618 std::vector<int> tempBM(parser.getNToken()/2,0);
1619 std::vector<int> tempD(parser.getNToken()/2,0);
1620 std::vector<int> tempD0B(parser.getNToken()/2,0);
1621 std::vector<int> tempD0(parser.getNToken()/2,0);
1622 std::vector<int> tempDP(parser.getNToken()/2,0);
1623 std::vector<int> tempDM(parser.getNToken()/2,0);
1627 if (count==1000*(count/1000)) {
1628 EvtGenReport(EVTGEN_INFO,
"EvtGen") << count << std::endl;
1631 EvtVector4R p_init(sqrt(EvtPDL::getMass(UPS4)*EvtPDL::getMass(UPS4)+5.9*5.9),0.0,0.0,5.9);
1634 if ( neventOrig > 0 ) {
1635 root_part=EvtParticleFactory::particleFactory(UPS4,p_init);
1638 root_part=EvtParticleFactory::particleFactory(VPHO, p_init);
1643 myGenerator.generateDecay(root_part);
1654 for(itok=0;itok<(parser.getNToken()/2);itok++){
1656 token=parser.getToken(2*itok);
1658 temp[itok]+=countInclusive(token,root_part,histo1[itok],massHisto[itok]);
1659 tempB[itok]+=countInclusiveParent(token,root_part,theBs,histo2[itok]);
1660 tempB0[itok]+=countInclusiveSubTree(token,root_part,theB0);
1661 tempB0B[itok]+=countInclusiveSubTree(token,root_part,theB0B);
1662 tempBP[itok]+=countInclusiveSubTree(token,root_part,theBP);
1663 tempBM[itok]+=countInclusiveSubTree(token,root_part,theBM);
1680 }
while (count++<nevent);
1684 for(itok=0;itok<(parser.getNToken()/2);itok++){
1686 token=parser.getToken(2*itok);
1687 float br=0.5*float(temp[itok])/float(nevent);
1688 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Found "<<temp[itok]<<
" "<<token.c_str()
1689 <<
" in " << nevent <<
" events. Average number of "
1690 << token.c_str()<<
" per B meson="<<br<<std::endl;
1692 br=0.5*float(tempB[itok])/float(nevent);
1693 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Found "<<tempB[itok]<<
" "<<token.c_str()
1694 <<
" produced directly in decays of B mesons avg. br.fr.="
1696 br=2.0*float(tempB0[itok])/float(nevent);
1697 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Found "<<tempB0[itok]<<
" "<<token.c_str()
1698 <<
" in decay tree of B0, br.fr.="<<br<<std::endl;
1699 br=2.0*float(tempB0B[itok])/float(nevent);
1700 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Found "<<tempB0B[itok]<<
" "<<token.c_str()
1701 <<
" in decay tree of anti-B0, br.fr.="<<br<<std::endl;
1702 br=2.0*float(tempBP[itok])/float(nevent);
1703 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Found "<<tempBP[itok]<<
" "<<token.c_str()
1704 <<
" in decay tree of B+, br.fr.="<<br<<std::endl;
1705 br=2.0*float(tempBM[itok])/float(nevent);
1706 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Found "<<tempBM[itok]<<
" "<<token.c_str()
1707 <<
" in decay tree of B-, br.fr.="<<br<<std::endl;
1725 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"*******************************************\n";
1732 if (count==1000*(count/1000)) {
1733 EvtGenReport(EVTGEN_INFO,
"EvtGen") << count << std::endl;
1736 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
1740 if ( neventOrig > 0 ) {
1741 root_part=EvtParticleFactory::particleFactory(UPS4,p_init);
1744 root_part=EvtParticleFactory::particleFactory(VPHO, p_init);
1750 myGenerator.generateDecay(root_part);
1756 }
while (count++<nevent);
1760 file->Write(); file->Close();
1762 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1766 void runKstarnunu(
int nevent,
EvtGen &myGenerator) {
1768 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
1769 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
1771 TFile *file=
new TFile(
"kstarnunu.root",
"RECREATE");
1773 TH1F* q2 =
new TH1F(
"h1",
"q2",
1775 TH1F* enu =
new TH1F(
"h2",
"Neutrino energy",
1777 TH1F* x =
new TH1F(
"h3",
"Total neutrino energy/B mass",
1784 char udecay_name[100];
1786 strcpy(udecay_name,
"exampleFiles/KSTARNUNU.DEC");
1788 myGenerator.readUDecay(udecay_name);
1794 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
1796 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
1800 myGenerator.generateDecay(root_part);
1806 q2->Fill( (nu+nub).mass2() );
1807 enu->Fill( nu.get(0) );
1808 x->Fill( (nu.get(0)+nub.get(0))/root_part->
mass() );
1812 }
while (count++<nevent);
1814 file->Write(); file->Close();
1815 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1818 void runBsmix(
int nevent,
EvtGen &myGenerator) {
1820 static EvtId BS0=EvtPDL::getId(std::string(
"B_s0"));
1821 static EvtId BSB=EvtPDL::getId(std::string(
"anti-B_s0"));
1823 TFile *file=
new TFile(
"bsmix.root",
"RECREATE");
1825 TH1F* tmix =
new TH1F(
"h1",
"tmix (mm)",100,0.0,5.0);
1826 TH1F* tnomix =
new TH1F(
"h2",
"tnomix (mm)",100,0.0,5.0);
1831 char udecay_name[100];
1832 strcpy(udecay_name,
"exampleFiles/BSMIX.DEC");
1834 myGenerator.readUDecay(udecay_name);
1840 EvtVector4R p_init(EvtPDL::getMass(BS0),0.0,0.0,0.0);
1842 EvtParticle* root_part=EvtParticleFactory::particleFactory(BS0,
1846 myGenerator.generateDecay(root_part);
1857 if (mix==0) tnomix->Fill(t);
1858 if (mix==1) tmix->Fill(t);
1862 }
while (count++<nevent);
1864 file->Write(); file->Close();
1865 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
1869 void runSemic(
int nevent,
EvtGen &myGenerator) {
1871 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
1872 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
1873 static EvtId GAMM=EvtPDL::getId(std::string(
"gamma"));
1874 static EvtId PSI=EvtPDL::getId(std::string(
"J/psi"));
1875 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
1876 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
1877 static EvtId BS0=EvtPDL::getId(std::string(
"B_s0"));
1878 static EvtId BSB=EvtPDL::getId(std::string(
"anti-B_s0"));
1880 static EvtId PI0=EvtPDL::getId(std::string(
"pi0"));
1881 static EvtId PIP=EvtPDL::getId(std::string(
"pi+"));
1882 static EvtId PIM=EvtPDL::getId(std::string(
"pi-"));
1884 static EvtId EP=EvtPDL::getId(std::string(
"e+"));
1885 static EvtId KP=EvtPDL::getId(std::string(
"K+"));
1886 static EvtId MUP=EvtPDL::getId(std::string(
"mu+"));
1887 static EvtId EM=EvtPDL::getId(std::string(
"e-"));
1888 static EvtId KM=EvtPDL::getId(std::string(
"K-"));
1889 static EvtId MUM=EvtPDL::getId(std::string(
"mu-"));
1891 static EvtId DST0=EvtPDL::getId(std::string(
"D*0"));
1892 static EvtId DSTB=EvtPDL::getId(std::string(
"anti-D*0"));
1893 static EvtId DSTP=EvtPDL::getId(std::string(
"D*+"));
1894 static EvtId DSTM=EvtPDL::getId(std::string(
"D*-"));
1895 static EvtId D0=EvtPDL::getId(std::string(
"D0"));
1896 static EvtId D0B=EvtPDL::getId(std::string(
"anti-D0"));
1897 static EvtId DP=EvtPDL::getId(std::string(
"D+"));
1898 static EvtId DM=EvtPDL::getId(std::string(
"D-"));
1900 static EvtId K0L=EvtPDL::getId(std::string(
"K_L0"));
1902 static EvtId D1P1P=EvtPDL::getId(std::string(
"D_1+"));
1903 static EvtId D1P1N=EvtPDL::getId(std::string(
"D_1-"));
1904 static EvtId D1P10=EvtPDL::getId(std::string(
"D_10"));
1905 static EvtId D1P1B=EvtPDL::getId(std::string(
"anti-D_10"));
1907 static EvtId D3P2P=EvtPDL::getId(std::string(
"D_2*+"));
1908 static EvtId D3P2N=EvtPDL::getId(std::string(
"D_2*-"));
1909 static EvtId D3P20=EvtPDL::getId(std::string(
"D_2*0"));
1910 static EvtId D3P2B=EvtPDL::getId(std::string(
"anti-D_2*0"));
1912 static EvtId D3P1P=EvtPDL::getId(std::string(
"D'_1+"));
1913 static EvtId D3P1N=EvtPDL::getId(std::string(
"D'_1-"));
1914 static EvtId D3P10=EvtPDL::getId(std::string(
"D'_10"));
1915 static EvtId D3P1B=EvtPDL::getId(std::string(
"anti-D'_10"));
1917 static EvtId D3P0P=EvtPDL::getId(std::string(
"D_0*+"));
1918 static EvtId D3P0N=EvtPDL::getId(std::string(
"D_0*-"));
1919 static EvtId D3P00=EvtPDL::getId(std::string(
"D_0*0"));
1920 static EvtId D3P0B=EvtPDL::getId(std::string(
"anti-D_0*0"));
1922 static EvtId D21S0P=EvtPDL::getId(std::string(
"D(2S)+"));
1923 static EvtId D21S0N=EvtPDL::getId(std::string(
"D(2S)-"));
1924 static EvtId D21S00=EvtPDL::getId(std::string(
"D(2S)0"));
1925 static EvtId D21S0B=EvtPDL::getId(std::string(
"anti-D(2S)0"));
1927 static EvtId D23S1P=EvtPDL::getId(std::string(
"D*(2S)+"));
1928 static EvtId D23S1N=EvtPDL::getId(std::string(
"D*(2S)-"));
1929 static EvtId D23S10=EvtPDL::getId(std::string(
"D*(2S)0"));
1930 static EvtId D23S1B=EvtPDL::getId(std::string(
"anti-D*(2S)0"));
1932 static EvtIdSet radExitDstar(D23S1P,D23S1N,D23S10,D23S1B);
1935 TFile *file=
new TFile(
"semic.root",
"RECREATE");
1937 TH1F* Dpe_q2 =
new TH1F(
"h11",
"q2 for B0B ->D+ e- nu",50,0.0,12.0);
1938 TH1F* Dpe_elep =
new TH1F(
"h12",
"Elep for B0B ->D+ e- nu",50,0.0,2.5);
1939 TH1F* Dme_q2 =
new TH1F(
"h13",
"q2 for B0 ->D- e+ nu",50,0.0,12.0);
1940 TH1F* Dme_elep =
new TH1F(
"h14",
"Elep for B0 ->D- e+ nu",50,0.0,2.5);
1941 TH1F* D0e_q2 =
new TH1F(
"h15",
"q2 for B- ->D0 e- nu",50,0.0,12.0);
1942 TH1F* D0e_elep =
new TH1F(
"h16",
"Elep for B- ->D0 e- nu",50,0.0,2.5);
1943 TH1F* D0Be_q2 =
new TH1F(
"h17",
"q2 for B+ ->D0B e+ nu",50,0.0,12.0);
1944 TH1F* D0Be_elep =
new TH1F(
"h18",
"Elep for B+ ->D0B e+ nu",50,0.0,2.5);
1946 TH1F* Dstpe_q2 =
new TH1F(
"h21",
"q2 for B0B ->D*+ e- nu",50,0.0,12.0);
1947 TH1F* Dstpe_elep =
new TH1F(
"h22",
"Elep for B0B ->D*+ e- nu",50,0.0,2.5);
1948 TH1F* Dstme_q2 =
new TH1F(
"h23",
"q2 for B0 ->D*- e+ nu",50,0.0,12.0);
1949 TH1F* Dstme_elep =
new TH1F(
"h24",
"Elep for B0 ->D*- e+ nu",50,0.0,2.5);
1950 TH1F* Dst0e_q2 =
new TH1F(
"h25",
"q2 for B- ->D*0 e- nu",50,0.0,12.0);
1951 TH1F* Dst0e_elep =
new TH1F(
"h26",
"Elep for B*- ->D*0 e- nu",50,0.0,2.5);
1952 TH1F* Dst0Be_q2 =
new TH1F(
"h27",
"q2 for B+ ->D*0B e+ nu",50,0.0,12.0);
1953 TH1F* Dst0Be_elep =
new TH1F(
"h28",
"Elep for B+ ->D*0B e+ nu",50,0.0,2.5);
1955 TH1F* D1P1pe_q2 =
new TH1F(
"h31",
"q2 for B0B ->1P1+ e- nu",50,0.0,12.0);
1956 TH1F* D1P1pe_elep =
new TH1F(
"h32",
"Elep for B0B ->1P1+ e- nu",50,0.0,2.5);
1957 TH1F* D1P1me_q2 =
new TH1F(
"h33",
"q2 for B0 ->1P1- e+ nu",50,0.0,12.0);
1958 TH1F* D1P1me_elep =
new TH1F(
"h34",
"Elep for B0 ->1P1- e+ nu",50,0.0,2.5);
1959 TH1F* D1P10e_q2 =
new TH1F(
"h35",
"q2 for B- ->1P10 e- nu",50,0.0,12.0);
1960 TH1F* D1P10e_elep =
new TH1F(
"h36",
"Elep for B*- ->1P10 e- nu",50,0.0,2.5);
1961 TH1F* D1P10Be_q2 =
new TH1F(
"h37",
"q2 for B+ ->1P1B e+ nu",50,0.0,12.0);
1962 TH1F* D1P10Be_elep =
new TH1F(
"h38",
"Elep for B+ ->1P1B e+ nu",50,0.0,2.5);
1964 TH1F* D3P0pe_q2 =
new TH1F(
"h41",
"q2 for B0B ->3P0+ e- nu",50,0.0,12.0);
1965 TH1F* D3P0pe_elep =
new TH1F(
"h42",
"Elep for B0B ->3P0+ e- nu",50,0.0,2.5);
1966 TH1F* D3P0me_q2 =
new TH1F(
"h43",
"q2 for B0 ->3P0- e+ nu",50,0.0,12.0);
1967 TH1F* D3P0me_elep =
new TH1F(
"h44",
"Elep for B0 ->3P0- e+ nu",50,0.0,2.5);
1968 TH1F* D3P00e_q2 =
new TH1F(
"h45",
"q2 for B- ->3P00 e- nu",50,0.0,12.0);
1969 TH1F* D3P00e_elep =
new TH1F(
"h46",
"Elep for B*- ->3P00 e- nu",50,0.0,2.5);
1970 TH1F* D3P00Be_q2 =
new TH1F(
"h47",
"q2 for B+ ->3P0B e+ nu",50,0.0,12.0);
1971 TH1F* D3P00Be_elep =
new TH1F(
"h48",
"Elep for B+ ->3P0B e+ nu",50,0.0,2.5);
1973 TH1F* D3P1pe_q2 =
new TH1F(
"h51",
"q2 for B0B ->3P1+ e- nu",50,0.0,12.0);
1974 TH1F* D3P1pe_elep =
new TH1F(
"h52",
"Elep for B0B ->3P1+ e- nu",50,0.0,2.5);
1975 TH1F* D3P1me_q2 =
new TH1F(
"h53",
"q2 for B0 ->3P1- e+ nu",50,0.0,12.0);
1976 TH1F* D3P1me_elep =
new TH1F(
"h54",
"Elep for B0 ->3P1- e+ nu",50,0.0,2.5);
1977 TH1F* D3P10e_q2 =
new TH1F(
"h55",
"q2 for B- ->3P10 e- nu",50,0.0,12.0);
1978 TH1F* D3P10e_elep =
new TH1F(
"h56",
"Elep for B*- ->3P10 e- nu",50,0.0,2.5);
1979 TH1F* D3P10Be_q2 =
new TH1F(
"h57",
"q2 for B+ ->3P1B e+ nu",50,0.0,12.0);
1980 TH1F* D3P10Be_elep =
new TH1F(
"h58",
"Elep for B+ ->3P1B e+ nu",50,0.0,2.5);
1982 TH1F* D3P2pe_q2 =
new TH1F(
"h61",
"q2 for B0B ->3P2+ e- nu",50,0.0,12.0);
1983 TH1F* D3P2pe_elep =
new TH1F(
"h62",
"Elep for B0B ->3P2+ e- nu",50,0.0,2.5);
1984 TH1F* D3P2me_q2 =
new TH1F(
"h63",
"q2 for B0 ->3P2- e+ nu",50,0.0,12.0);
1985 TH1F* D3P2me_elep =
new TH1F(
"h64",
"Elep for B0 ->3P2- e+ nu",50,0.0,2.5);
1986 TH1F* D3P20e_q2 =
new TH1F(
"h65",
"q2 for B- ->3P20 e- nu",50,0.0,12.0);
1987 TH1F* D3P20e_elep =
new TH1F(
"h66",
"Elep for B*- ->3P20 e- nu",50,0.0,2.5);
1988 TH1F* D3P20Be_q2 =
new TH1F(
"h67",
"q2 for B+ ->3P2B e+ nu",50,0.0,12.0);
1989 TH1F* D3P20Be_elep =
new TH1F(
"h68",
"Elep for B+ ->3P2B e+ nu",50,0.0,2.5);
1992 TH1F* phiL =
new TH1F(
"h69",
"phi",50,-3.1416,3.1416);
1997 char udecay_name[100];
1998 strcpy(udecay_name,
"exampleFiles/SEMIC.DEC");
2000 myGenerator.readUDecay(udecay_name);
2006 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
2008 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
2012 myGenerator.generateDecay(root_part);
2021 phiL->Fill(atan2(lep.get(1),lep.get(2)));
2023 double q2=(lep+nu).mass2();
2025 if (meson==DP&&lepton==EM){
2027 Dpe_elep->Fill(elep);
2029 if (meson==DM&&lepton==EP){
2031 Dme_elep->Fill(elep);
2033 if (meson==D0&&lepton==EM){
2035 D0e_elep->Fill(elep);
2037 if (meson==D0B&&lepton==EP){
2039 D0Be_elep->Fill(elep);
2043 if (meson==DSTP&&lepton==EM){
2045 Dstpe_elep->Fill(elep);
2047 if (meson==DSTM&&lepton==EP){
2049 Dstme_elep->Fill(elep);
2051 if (meson==DST0&&lepton==EM){
2053 Dst0e_elep->Fill(elep);
2055 if (meson==DSTB&&lepton==EP){
2056 Dst0Be_q2->Fill(q2);
2057 Dst0Be_elep->Fill(elep);
2061 if (meson==D1P1P&&lepton==EM){
2062 D1P1pe_q2->Fill(q2);
2063 D1P1pe_elep->Fill(elep);
2065 if (meson==D1P1N&&lepton==EP){
2066 D1P1me_q2->Fill(q2);
2067 D1P1me_elep->Fill(elep);
2069 if (meson==D1P10&&lepton==EM){
2070 D1P10e_q2->Fill(q2);
2071 D1P10e_elep->Fill(elep);
2073 if (meson==D1P1B&&lepton==EP){
2074 D1P10Be_q2->Fill(q2);
2075 D1P10Be_elep->Fill(elep);
2078 if (meson==D3P0P&&lepton==EM){
2079 D3P0pe_q2->Fill(q2);
2080 D3P0pe_elep->Fill(elep);
2082 if (meson==D3P0N&&lepton==EP){
2083 D3P0me_q2->Fill(q2);
2084 D3P0me_elep->Fill(elep);
2086 if (meson==D3P00&&lepton==EM){
2087 D3P00e_q2->Fill(q2);
2088 D3P00e_elep->Fill(elep);
2090 if (meson==D3P0B&&lepton==EP){
2091 D3P00Be_q2->Fill(q2);
2092 D3P00Be_elep->Fill(elep);
2095 if (meson==D3P1P&&lepton==EM){
2096 D3P1pe_q2->Fill(q2);
2097 D3P1pe_elep->Fill(elep);
2099 if (meson==D3P1N&&lepton==EP){
2100 D3P1me_q2->Fill(q2);
2101 D3P1me_elep->Fill(elep);
2103 if (meson==D3P10&&lepton==EM){
2104 D3P10e_q2->Fill(q2);
2105 D3P10e_elep->Fill(elep);
2107 if (meson==D3P1B&&lepton==EP){
2108 D3P10Be_q2->Fill(q2);
2109 D3P10Be_elep->Fill(elep);
2112 if (meson==D3P2P&&lepton==EM){
2113 D3P2pe_q2->Fill(q2);
2114 D3P2pe_elep->Fill(elep);
2116 if (meson==D3P2N&&lepton==EP){
2117 D3P2me_q2->Fill(q2);
2118 D3P2me_elep->Fill(elep);
2120 if (meson==D3P20&&lepton==EM){
2121 D3P20e_q2->Fill(q2);
2122 D3P20e_elep->Fill(elep);
2124 if (meson==D3P2B&&lepton==EP){
2125 D3P20Be_q2->Fill(q2);
2126 D3P20Be_elep->Fill(elep);
2134 }
while (count++<nevent);
2136 file->Write(); file->Close();
2137 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2141 void runKstarll(
int nevent,
EvtGen &myGenerator) {
2142 TFile *file=
new TFile(
"kstkmm.root",
"RECREATE");
2144 TH2F* _dalitz =
new TH2F(
"h1",
"q^2! vs Elep",
2145 70,0.0,3.5,60,0.0,30.0);
2148 TH1F* _ctl =
new TH1F(
"h2",
"ctl",50,-1.0,1.0);
2151 TH1F* _q2 =
new TH1F(
"h3",
"q2",50,0.0,25.0);
2153 TH1F* _q2low =
new TH1F(
"h4",
"q2 (low)",
2155 TH1F* _q2lowlow =
new TH1F(
"h5",
"q2 (lowlow)",
2158 TH1F* _phi =
new TH1F(
"h6",
"phi",50,-EvtConst::pi,EvtConst::pi);
2160 TH1F* _chi =
new TH1F(
"h7",
"chi",50,0.0,EvtConst::twoPi);
2162 TH1F* _chictl =
new TH1F(
"h8",
"chictl",50,0.0,EvtConst::twoPi);
2165 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
2166 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
2173 char udecay_name[100];
2174 strcpy(udecay_name,
"exampleFiles/KSTARLL.DEC");
2177 myGenerator.readUDecay(udecay_name);
2179 std::vector<double> q2low(5);
2180 std::vector<double> q2high(5);
2181 std::vector<int> counts(5);
2199 q2low[0]=0.0; q2high[0]=0.1;
2200 q2low[1]=0.1; q2high[1]=4.5;
2201 q2low[2]=4.5; q2high[2]=8.41;
2202 q2low[3]=10.24; q2high[3]=12.96;
2203 q2low[4]=14.06; q2high[4]=30.0;
2216 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
2218 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
2222 myGenerator.generateDecay(root_part);
2233 b=root_part->
getP4();
2237 double qsq=(l1+l2).mass2();
2239 for (
int j=0;j<n;j++){
2240 if (qsq>q2low[j]&&qsq<q2high[j]) counts[j]++;
2243 _q2->Fill( (l1+l2).mass2() );
2244 _q2low->Fill( (l1+l2).mass2() );
2245 _q2lowlow->Fill( (l1+l2).mass2() );
2247 _ctl->Fill(EvtDecayAngle((l1+l2+kstar),(l1+l2),l1));
2249 _dalitz->Fill(l1.get(0),(l1+l2).mass2(),1.0);
2253 _phi->Fill(atan2(l1.get(1),l1.get(2)));
2255 _chi->Fill(EvtDecayAngleChi(b,k,pi,l1,l2));
2257 if (EvtDecayAngle((l1+l2+kstar),(l1+l2),l1)>0){
2258 _chictl->Fill(EvtDecayAngleChi(b,k,pi,l1,l2));
2260 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"count:"<<count<<
" "<<(l1+l2).mass2()<<std::endl;
2262 }
while (count++<nevent);
2264 for (
int j=0;j<n;j++){
2265 std::cout <<
"["<<q2low[j]<<
".."<<q2high[j]<<
"]="<<counts[j]<<std::endl;
2268 file->Write(); file->Close();
2269 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2273 void runKll(
int nevent,
EvtGen &myGenerator) {
2274 TFile *file=
new TFile(
"ksem.root",
"RECREATE");
2276 TH2F* _dalitz =
new TH2F(
"h1",
"q^2! vs Elep",
2277 70,0.0,3.5,60,0.0,30.0);
2280 TH1F* _ctl =
new TH1F(
"h2",
"ctl",50,-1.0,1.0);
2283 TH1F* _q2 =
new TH1F(
"h3",
"q2",50,0.0,25.0);
2285 TH1F* _q2low =
new TH1F(
"h4",
"q2 (low)",
2287 TH1F* _q2lowlow =
new TH1F(
"h5",
"q2 (lowlow)",
2290 TH1F* _phi =
new TH1F(
"h6",
"phi",50,-EvtConst::pi,EvtConst::pi);
2297 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
2298 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
2304 char udecay_name[100];
2305 strcpy(udecay_name,
"exampleFiles/KLL.DEC");
2308 myGenerator.readUDecay(udecay_name);
2310 std::vector<double> q2low(5);
2311 std::vector<double> q2high(5);
2312 std::vector<int> counts(5);
2323 q2low[0]=0.0; q2high[0]=4.5;
2324 q2low[1]=4.5; q2high[1]=9.0;
2325 q2low[2]=10.24; q2high[2]=12.96;
2326 q2low[3]=14.06; q2high[3]=30.0;
2347 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
2349 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
2353 myGenerator.generateDecay(root_part);
2368 double qsq=(l1+l2).mass2();
2370 for (
int j=0;j<n;j++){
2371 if (qsq>q2low[j]&&qsq<q2high[j]) counts[j]++;
2374 _q2->Fill( (l1+l2).mass2() );
2375 _q2low->Fill( (l1+l2).mass2() );
2376 _q2lowlow->Fill( (l1+l2).mass2() );
2378 _ctl->Fill(EvtDecayAngle((l1+l2+k),(l1+l2),l1));
2380 _dalitz->Fill(l1.get(0),(l1+l2).mass2(),1.0);
2384 _phi->Fill(atan2(l1.get(1),l1.get(2)));
2391 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"count:"<<count<<
" "<<(l1+l2).mass2()<<std::endl;
2393 }
while (count++<nevent);
2395 for (
int j=0;j<n;j++){
2396 std::cout <<
"["<<q2low[j]<<
".."<<q2high[j]<<
"]="<<counts[j]<<std::endl;
2399 file->Write(); file->Close();
2400 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2405 void runHll(
int nevent,
EvtGen &myGenerator,
char* mode) {
2406 TString modename = mode;
2408 filename = modename;
2409 filename = filename +
"_nnlo.root";
2410 TFile *file=
new TFile(filename,
"RECREATE");
2412 decname += modename;
2414 decname =
"exampleFiles/" + decname +
".DEC";
2415 char udecay_name[100];
2416 strcpy(udecay_name,decname);
2418 TH2F* _dalitz =
new TH2F(
"h1",
"q^2! vs Elep",
2419 70,0.0,3.5,60,0.0,30.0);
2422 TH1F* _ctl =
new TH1F(
"h2",
"ctl",50,-1.0,1.0);
2425 TH1F* _q2 =
new TH1F(
"h3",
"q2",50,0.0,25.0);
2427 TH1F* _q2low =
new TH1F(
"h4",
"q2 (low)",
2429 TH1F* _q2lowlow =
new TH1F(
"h5",
"q2 (lowlow)",
2432 TH1F* _phi =
new TH1F(
"h6",
"phi",50,-EvtConst::pi,EvtConst::pi);
2434 TH1F* _chi =
new TH1F(
"h7",
"chi",50,0.0,EvtConst::twoPi);
2436 TH1F* _chictl =
new TH1F(
"h8",
"chictl",50,0.0,EvtConst::twoPi);
2439 if (modename ==
"kee" || modename ==
"kmm" ||
2440 modename ==
"kstksee" || modename ==
"kstksmm" ||
2441 modename ==
"piee" || modename ==
"pimm" ||
2442 modename ==
"rhoee" || modename ==
"rhomm")
2444 B=EvtPDL::getId(std::string(
"B+"));
2448 B=EvtPDL::getId(std::string(
"B0"));
2455 myGenerator.readUDecay(udecay_name);
2457 std::vector<double> q2low(7);
2458 std::vector<double> q2high(7);
2459 std::vector<int> counts(7);
2461 if (modename ==
"kee" || modename ==
"ksee" ||
2462 modename ==
"piee" || modename ==
"pi0ee" ||
2463 modename ==
"etaee" || modename ==
"etapee")
2467 q2low[0] = 0.0; q2high[0] = 4.5;
2468 q2low[1] = 4.5; q2high[1] = 8.41;
2469 q2low[2] = 8.41; q2high[2] = 10.24;
2470 q2low[3] = 10.24; q2high[3] = 12.96;
2471 q2low[4] = 12.96; q2high[4] = 14.06;
2472 q2low[5] = 14.06; q2high[5] = 30.0;
2474 else if (modename ==
"kmm" || modename ==
"ksmm" ||
2475 modename ==
"pimm" || modename ==
"pi0mm" ||
2476 modename ==
"etamm" || modename ==
"etapmm")
2480 q2low[0] = 0.0; q2high[0] = 4.5;
2481 q2low[1] = 4.5; q2high[1] = 9.0;
2482 q2low[2] = 9.0; q2high[2] = 10.24;
2483 q2low[3] = 10.24; q2high[3] = 12.96;
2484 q2low[4] = 12.96; q2high[4] = 14.06;
2485 q2low[5] = 14.06; q2high[5] = 30.0;
2487 else if (modename ==
"kstkee" || modename ==
"kstksee" ||
2488 modename ==
"rhoee" || modename ==
"rho0ee" || modename ==
"omegaee")
2492 q2low[0] = 0.0; q2high[0] = 0.1;
2493 q2low[1] = 0.1; q2high[1] = 4.5;
2494 q2low[2] = 4.5; q2high[2] = 8.41;
2495 q2low[3] = 8.41; q2high[3] = 10.24;
2496 q2low[4] = 10.24; q2high[4] = 12.96;
2497 q2low[5] = 12.96; q2high[5] = 14.06;
2498 q2low[6] = 14.06; q2high[6] = 30.0;
2500 else if (modename ==
"kstkmm" || modename ==
"kstksmm" ||
2501 modename ==
"rhomm" || modename ==
"rho0mm" || modename ==
"omegamm")
2505 q2low[0] = 0.0; q2high[0] = 0.1;
2506 q2low[1] = 0.1; q2high[1] = 4.5;
2507 q2low[2] = 4.5; q2high[2] = 9.0;
2508 q2low[3] = 9.0; q2high[3] = 10.24;
2509 q2low[4] = 10.24; q2high[4] = 12.96;
2510 q2low[5] = 12.96; q2high[5] = 14.06;
2511 q2low[6] = 14.06; q2high[6] = 30.0;
2513 float q2binlow[n+1];
2514 for (
int i = 0; i < n; i++)
2516 q2binlow[i] = q2low[i];
2520 TH1F* _q2var =
new TH1F(
"h9",
"q2var", n, q2binlow);
2524 EvtVector4R p_init(EvtPDL::getMass(B),0.0,0.0,0.0);
2525 EvtParticle* root_part = EvtParticleFactory::particleFactory(B,p_init);
2527 myGenerator.generateDecay(root_part);
2537 double qsq=(l1+l2).mass2();
2539 for (
int j = 0 ; j < n; j++)
2541 if (qsq > q2low[j] && qsq < q2high[j]) counts[j]++;
2544 _q2->Fill( (l1+l2).mass2() );
2545 _q2var->Fill( (l1+l2).mass2() );
2546 _q2low->Fill( (l1+l2).mass2() );
2547 _q2lowlow->Fill( (l1+l2).mass2() );
2549 _ctl->Fill(EvtDecayAngle((l1+l2+h),(l1+l2),l1));
2551 _dalitz->Fill(l1.get(0),(l1+l2).mass2(),1.0);
2553 _phi->Fill(atan2(l1.get(1),l1.get(2)));
2555 if (modename ==
"kstkee" || modename ==
"kstkmm" ||
2556 modename ==
"kstksee" || modename ==
"kstksmm" ||
2557 modename ==
"rhoee" || modename ==
"rhomm" ||
2558 modename ==
"rho0ee" || modename ==
"rho0mm")
2560 b = root_part->
getP4();
2563 _chi->Fill(EvtDecayAngleChi(b,hdaug1,hdaug2,l1,l2));
2564 if (EvtDecayAngle((l1+l2+h),(l1+l2),l1) > 0)
2566 _chictl->Fill(EvtDecayAngleChi(b,hdaug1,hdaug2,l1,l2));
2569 if (count % 1000 == 0)
2571 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"count:"<<count<<
" "<<(l1+l2).mass2()<<std::endl;
2575 while (count++ < nevent);
2577 for (
int j = 0;j < n; j++)
2579 std::cout <<
"[" << q2low[j] <<
".." << q2high[j] <<
"] = " << counts[j] << std::endl;
2583 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2586 void runVectorIsr(
int nevent,
EvtGen &myGenerator) {
2588 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
2589 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
2591 TFile *file=
new TFile(
"vectorisr.root",
"RECREATE");
2593 TH1F* cosv =
new TH1F(
"h1",
"Cos vector in e+e- frame",
2596 TH1F* cosd1 =
new TH1F(
"h2",
"Cos helang 1st dau of vector",
2599 TH1F* cosd1d1 =
new TH1F(
"h3",
"Cos helang 1st dau of 1st dau",
2602 TH1F* cosd2d1 =
new TH1F(
"h4",
"Cos helang 1st dau of 2nd dau",
2605 TH2F* d1vsd1d1 =
new TH2F(
"h5",
"Cos helangs d1 vs d1d1",
2606 20,-1.0,1.0,20,-1.0,1.0);
2608 TH2F* d2vsd2d1 =
new TH2F(
"h6",
"Cos helangs d2 vs d2d1",
2609 20,-1.0,1.0,20,-1.0,1.0);
2611 TH2F* d1d1vsd2d1 =
new TH2F(
"h7",
"Cos helangs d1d1 vs d2d1",
2612 20,-1.0,1.0,20,-1.0,1.0);
2614 TH1F* chidd =
new TH1F(
"h8",
"Chi - angle between decay planes",
2617 TH2F* chi12vsd1d1 =
new TH2F(
"h9",
"Chi 1-2 vs d1d1",
2618 30,0.,360.0,20,-1.0,1.0);
2620 TH2F* chi12vsd2d1 =
new TH2F(
"h10",
"Chi 1-2 vs d2d1",
2621 30,0.,360.0,20,-1.0,1.0);
2623 TH2F* chi21vsd1d1 =
new TH2F(
"h11",
"Chi 2-1 vs d1d1",
2624 30,0.,360.0,20,-1.0,1.0);
2626 TH2F* chi21vsd2d1 =
new TH2F(
"h12",
"Chi 2-1 vs d2d1",
2627 30,0.,360.0,20,-1.0,1.0);
2630 char udecay_name[100];
2631 EvtVector4R cm, v, d1, d2, d1d1, d1d2, d2d1, d2d2;
2633 strcpy(udecay_name,
"exampleFiles/VECTORISR.DEC");
2634 myGenerator.readUDecay(udecay_name);
2637 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
2639 EvtParticle* root_part=EvtParticleFactory::particleFactory(VPHO,
2644 myGenerator.generateDecay(root_part);
2651 cosv->Fill(v.get(3)/v.d3mag());
2653 double cosdecayd1=EvtDecayAngle(cm,v,d1);
2654 double cosdecayd2=EvtDecayAngle(cm,v,d2);
2655 cosd1->Fill(cosdecayd1);
2662 double cosdecayd1d1=EvtDecayAngle(v,d1,d1d1);
2663 cosd1d1->Fill(cosdecayd1d1);
2664 d1vsd1d1->Fill(cosdecayd1,cosdecayd1d1,1.0);
2670 double cosdecayd2d1=EvtDecayAngle(v,d2,d2d1);
2671 cosd2d1->Fill(cosdecayd2d1);
2672 d2vsd2d1->Fill(cosdecayd2,cosdecayd2d1,1.0);
2676 double cosdecayd1d1=EvtDecayAngle(v,d1,d1d1);
2677 d1d1vsd2d1->Fill(cosdecayd1d1,cosdecayd2d1,1.0);
2682 double chi21=57.29578*EvtDecayAngleChi(v,d2d1,d2d2,d1d1,d1d2);
2683 double chi12=57.29578*EvtDecayAngleChi(v,d1d1,d1d2,d2d1,d2d2);
2686 chi12vsd1d1->Fill(chi12,cosdecayd1d1,1.0);
2687 chi12vsd2d1->Fill(chi12,cosdecayd2d1,1.0);
2689 chi21vsd1d1->Fill(chi21,cosdecayd1d1,1.0);
2690 chi21vsd2d1->Fill(chi21,cosdecayd2d1,1.0);
2697 }
while (count++<nevent);
2699 file->Write(); file->Close();
2700 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2705 void runBsquark(
int nevent,
EvtGen &myGenerator) {
2707 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
2708 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
2709 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
2711 TFile *file=
new TFile(
"bsquark.root",
"RECREATE");
2713 TH1F* elep =
new TH1F(
"h1",
"Elep",50,0.0,1.5);
2715 TH1F* q2 =
new TH1F(
"h2",
"q2",50,0.0,3.0);
2717 TH2F* dalitz=
new TH2F(
"h3",
"q2 vs. Elep",50,0.0,1.5,50,0.0,3.0);
2719 TH1F* elepbar =
new TH1F(
"h11",
"Elep bar",
2722 TH1F* q2bar =
new TH1F(
"h12",
"q2 bar",
2725 TH2F* dalitzbar=
new TH2F(
"h13",
"q2 vs. Elep bar",50,0.0,1.5,50,0.0,3.0);
2728 char udecay_name[100];
2729 EvtVector4R cm, v, d1, d2, d1d1, d1d2, d2d1, d2d2;
2731 strcpy(udecay_name,
"exampleFiles/BSQUARK.DEC");
2732 myGenerator.readUDecay(udecay_name);
2737 EvtParticle* root_part=EvtParticleFactory::particleFactory(VPHO,
2742 myGenerator.generateDecay(root_part);
2748 if (p->
getId()==B0) {
2758 elep->Fill(p4lepton.get(0));
2759 q2->Fill((p4lepton+p4sneutrino).mass2());
2761 dalitz->Fill(p4lepton.get(0),(p4lepton+p4sneutrino).mass2(),1.0);
2765 if (p->
getId()==B0B) {
2775 elepbar->Fill(p4lepton.get(0));
2776 q2bar->Fill((p4lepton+p4sneutrino).mass2());
2778 dalitzbar->Fill(p4lepton.get(0),(p4lepton+p4sneutrino).mass2(),1.0);
2788 }
while (count++<nevent);
2790 file->Write(); file->Close();
2791 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2796 void runK3gamma(
int nevent,
EvtGen &myGenerator) {
2798 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
2800 TFile *file=
new TFile(
"k3gamma.root",
"RECREATE");
2802 TH1F* costheta =
new TH1F(
"h1",
"cosTheta", 100,-1.0,1.0);
2806 char udecay_name[100];
2807 EvtVector4R cm, v, d1, d2, d1d1, d1d2, d2d1, d2d2;
2809 strcpy(udecay_name,
"exampleFiles/K3GAMMA.DEC");
2810 myGenerator.readUDecay(udecay_name);
2813 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
2815 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,p_init);
2819 myGenerator.generateDecay(root_part);
2828 costheta->Fill(EvtDecayAngle(p4b,p4k3,p4k));
2832 }
while (count++<nevent);
2834 file->Write(); file->Close();
2835 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2840 void runLambda(
int nevent,
EvtGen &myGenerator) {
2842 static EvtId LAMBDA=EvtPDL::getId(std::string(
"Lambda0"));
2844 TFile *file=
new TFile(
"lambda.root",
"RECREATE");
2846 TH1F* costheta =
new TH1F(
"h1",
"cosTheta",100,-1.0,1.0);
2850 char udecay_name[100];
2851 EvtVector4R cm, v, d1, d2, d1d1, d1d2, d2d1, d2d2;
2853 strcpy(udecay_name,
"exampleFiles/LAMBDA.DEC");
2854 myGenerator.readUDecay(udecay_name);
2857 EvtVector4R p_init(EvtPDL::getMass(LAMBDA),0.0,0.0,0.0);
2859 EvtParticle* root_part=EvtParticleFactory::particleFactory(LAMBDA,p_init);
2871 myGenerator.generateDecay(root_part);
2878 costheta->Fill(p4p.get(3)/p4p.d3mag());
2882 }
while (count++<nevent);
2884 file->Write(); file->Close();
2885 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2891 void runTauTauPiPi(
int nevent,
EvtGen &myGenerator) {
2893 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
2894 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
2895 TFile *file=
new TFile(
"tautaupipi.root",
"RECREATE");
2897 TH1F* cospi1 =
new TH1F(
"h1",
"cos theta pi1", 50,-1.0,1.0);
2898 TH1F* cospi2 =
new TH1F(
"h2",
"cos theta pi2", 50,-1.0,1.0);
2899 TH1F* costheta =
new TH1F(
"h3",
"cos theta", 50,-1.0,1.0);
2901 std::ofstream outmix;
2902 outmix.open(
"tautaupipi.dat");
2907 char udecay_name[100];
2909 strcpy(udecay_name,
"exampleFiles/TAUTAUPIPI.DEC");
2910 myGenerator.readUDecay(udecay_name);
2914 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
2916 EvtParticle* root_part=EvtParticleFactory::particleFactory(VPHO,
2920 myGenerator.generateDecay(root_part);
2928 cospi1->Fill( EvtDecayAngle(tau1+tau2,tau1,pi1) );
2929 cospi2->Fill( EvtDecayAngle(tau1+tau2,tau2,pi2) );
2930 costheta->Fill(tau1.get(3)/tau1.d3mag());
2934 }
while (count++<nevent);
2936 file->Write(); file->Close();
2939 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2943 void runTauTauEE(
int nevent,
EvtGen &myGenerator) {
2945 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
2946 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
2947 TFile *file=
new TFile(
"tautauee.root",
"RECREATE");
2949 TH1F* e1 =
new TH1F(
"h1",
"e1",55,0.0,5.5);
2950 TH1F* e2 =
new TH1F(
"h2",
"e2",55,0.0,5.5);
2951 TH2F* e1vse2 =
new TH2F(
"h3",
"e1 vs e2",55,0.0,5.5,
2955 char udecay_name[100];
2957 strcpy(udecay_name,
"exampleFiles/TAUTAUEE.DEC");
2958 myGenerator.readUDecay(udecay_name);
2962 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
2964 EvtParticle* root_part=EvtParticleFactory::particleFactory(VPHO, p_init);
2967 myGenerator.generateDecay(root_part);
2976 }
while (count++<nevent);
2978 file->Write(); file->Close();
2979 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
2983 void runTauTau2Pi2Pi(
int nevent,
EvtGen &myGenerator) {
2985 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
2986 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
2987 TFile *file=
new TFile(
"tautau2pi2pi.root",
"RECREATE");
2989 TH1F* e1 =
new TH1F(
"h1",
"mrho",200,0.0,2.0);
2990 TH1F* e2 =
new TH1F(
"h2",
"coshel",200,-1.0,1.0);
2993 char udecay_name[100];
2995 strcpy(udecay_name,
"exampleFiles/TAUTAU2PI2PI.DEC");
2996 myGenerator.readUDecay(udecay_name);
3000 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
3002 EvtParticle* root_part=EvtParticleFactory::particleFactory(VPHO, p_init);
3005 myGenerator.generateDecay(root_part);
3012 e1->Fill(p4rho.mass());
3013 double dcostheta=EvtDecayAngle(p4tau,p4rho,p4pi);
3014 e2->Fill(dcostheta);
3021 e1->Fill(p4rho.mass());
3022 dcostheta=EvtDecayAngle(p4tau,p4rho,p4pi);
3023 e2->Fill(dcostheta);
3027 }
while (count++<nevent);
3029 file->Write(); file->Close();
3030 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3034 void runTauTau3Pi3Pi(
int nevent,
EvtGen &myGenerator) {
3036 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
3037 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
3038 TFile *file=
new TFile(
"tautau3pi3pi.root",
"RECREATE");
3040 TH1F* e1 =
new TH1F(
"h1",
"a1",200,0.0,2.0);
3043 char udecay_name[100];
3045 strcpy(udecay_name,
"exampleFiles/TAUTAU3PI3PI.DEC");
3046 myGenerator.readUDecay(udecay_name);
3050 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
3052 EvtParticle* root_part=EvtParticleFactory::particleFactory(VPHO, p_init);
3055 myGenerator.generateDecay(root_part);
3062 e1->Fill(p4a1.mass());
3069 e1->Fill(p4a1.mass());
3073 }
while (count++<nevent);
3075 file->Write(); file->Close();
3076 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3081 void runJPsiKstar(
int nevent,
EvtGen &myGenerator,
int modeInt) {
3083 std::ofstream outmix;
3084 outmix.open(
"jpsikstar.dat");
3088 char udecay_name[100];
3089 if (modeInt==0) strcpy(udecay_name,
"exampleFiles/JPSIKSTAR.DEC");
3090 if (modeInt==1) strcpy(udecay_name,
"exampleFiles/JPSIKSTAR1.DEC");
3091 if (modeInt==2) strcpy(udecay_name,
"exampleFiles/JPSIKSTAR2.DEC");
3092 if (modeInt==3) strcpy(udecay_name,
"exampleFiles/JPSIKSTAR3.DEC");
3093 if (modeInt==4) strcpy(udecay_name,
"exampleFiles/JPSIKSTAR4.DEC");
3095 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
3096 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
3097 static EvtId GAMM=EvtPDL::getId(std::string(
"gamma"));
3098 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3099 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
3101 myGenerator.readUDecay(udecay_name);
3105 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
3107 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
3111 myGenerator.generateDecay(root_part);
3126 if (btag->
getId()==B0B){
3133 EvtParticle *p_b,*p_psi,*p_kstar,*p_pi0,*p_kz,*p_ep,*p_em;
3134 EvtVector4R p4_b,p4_psi,p4_kstar,p4_pi0,p4_kz,p4_ep,p4_em;
3155 outmix << tag.getId() <<
" ";
3158 outmix << EvtDecayAngle(p4_b,p4_ep+p4_em,p4_ep) <<
" " ;
3159 outmix << EvtDecayAngle(p4_b,p4_pi0+p4_kz,p4_pi0) <<
" " ;
3160 outmix << EvtDecayAngleChi(p4_b,p4_pi0,p4_kz,
3161 p4_ep, p4_em ) <<
"\n" ;
3165 }
while (count++<10000);
3168 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3172 void runSVVCPLH(
int nevent,
EvtGen &myGenerator) {
3174 TFile *file=
new TFile(
"svvcplh.root",
"RECREATE");
3176 TH1F* t =
new TH1F(
"h1",
"t",50,0.0,5.0);
3177 TH1F* cospsi =
new TH1F(
"h2",
"cos theta e+",50,-1.0,1.0);
3178 TH1F* cosphi =
new TH1F(
"h3",
"cos theta k+",50,-1.0,1.0);
3179 TH1F* chi =
new TH1F(
"h4",
"chi",50,0.0,2.0*EvtConst::pi);
3183 char udecay_name[100];
3184 strcpy(udecay_name,
"exampleFiles/SVVCPLH.DEC");
3185 myGenerator.readUDecay(udecay_name);
3187 static EvtId BS0=EvtPDL::getId(std::string(
"B_s0"));
3188 static EvtId BSB=EvtPDL::getId(std::string(
"anti-B_s0"));
3191 EvtVector4R p_init(EvtPDL::getMass(BS0),0.0,0.0,0.0);
3193 EvtParticle* root_part=EvtParticleFactory::particleFactory(BS0,
3197 myGenerator.generateDecay(root_part);
3199 EvtParticle *p_b,*p_psi,*p_phi,*p_kp,*p_km,*p_ep,*p_em;
3200 EvtVector4R p4_b,p4_psi,p4_phi,p4_kp,p4_km,p4_ep,p4_em;
3224 cospsi->Fill(EvtDecayAngle(p4_b,p4_ep+p4_em,p4_ep));
3225 cosphi->Fill(EvtDecayAngle(p4_b,p4_kp+p4_km,p4_kp));
3226 chi->Fill(EvtDecayAngleChi(p4_b,p4_kp,p4_km,
3231 }
while (count++<nevent);
3233 file->Write(); file->Close();
3234 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3239 void runSVSCPLH(
int nevent,
EvtGen &myGenerator) {
3241 TFile *file=
new TFile(
"svscplh.root",
"RECREATE");
3243 TH1F* t =
new TH1F(
"h1",
"t",200,-5.0,5.0);
3244 TH1F* tB0tag =
new TH1F(
"h2",
"dt B0 tag (ps)",200,-15.0,15.0);
3245 TH1F* tB0Btag =
new TH1F(
"h3",
"dt B0B tag (ps)",200,-15.0,15.0);
3246 TH1F* ctheta =
new TH1F(
"h4",
"costheta",50,-1.0,1.0);
3250 char udecay_name[100];
3251 strcpy(udecay_name,
"exampleFiles/SVSCPLH.DEC");
3252 myGenerator.readUDecay(udecay_name);
3255 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
3256 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3257 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
3259 std::ofstream outmix;
3260 outmix.open(
"svscplh.dat");
3264 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
3266 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
3270 myGenerator.generateDecay(root_part);
3293 if (p_tag->
getId()==B0){
3295 outmix << dt <<
" 1"<<std::endl;
3297 if (p_tag->
getId()==B0B){
3299 outmix << dt <<
" -1"<<std::endl;
3301 ctheta->Fill(EvtDecayAngle(p4_cp,p4_jpsi,p4_ep));
3306 }
while (count++<nevent);
3308 file->Write(); file->Close();
3310 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3314 void runSSDCP(
int nevent,
EvtGen &myGenerator) {
3316 TFile *file=
new TFile(
"ssdcp.root",
"RECREATE");
3318 TH1F* t =
new TH1F(
"h1",
"dt",100,-15.0,15.0);
3319 TH1F* tB0tag =
new TH1F(
"h2",
"dt B0 tag (ps)",100,-15.0,15.0);
3320 TH1F* tB0Btag =
new TH1F(
"h3",
"dt B0B tag (ps)",100,-15.0,15.0);
3324 char udecay_name[100];
3325 strcpy(udecay_name,
"exampleFiles/SSDCP.DEC");
3326 myGenerator.readUDecay(udecay_name);
3329 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
3330 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3331 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
3333 std::ofstream outmix;
3337 EvtVector4R pinit(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
3339 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,pinit);
3343 myGenerator.generateDecay(root_part);
3362 dt=dt/(1e-12*EvtConst::c);
3366 if (p_tag->
getId()==B0){
3369 if (p_tag->
getId()==B0B){
3375 }
while (count++<nevent);
3377 file->Write(); file->Close();
3378 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3382 void runKstarstargamma(
int nevent,
EvtGen &myGenerator) {
3384 TFile *file=
new TFile(
"kstarstargamma.root",
"RECREATE");
3386 TH1F* m =
new TH1F(
"h1",
"mkpi",100,0.5,2.5);
3388 TH1F* ctheta =
new TH1F(
"h2",
"ctheta",100,-1.0,1.0);
3392 myGenerator.readUDecay(
"exampleFiles/KSTARSTARGAMMA.DEC");
3395 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3397 std::ofstream outmix;
3401 EvtVector4R pinit(EvtPDL::getMass(B0),0.0,0.0,0.0);
3403 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,pinit);
3407 myGenerator.generateDecay(root_part);
3420 m->Fill((p4_kaon+p4_pion).mass());
3422 ctheta->Fill(EvtDecayAngle(pinit,p4_kaon+p4_pion,p4_kaon));
3428 }
while (count++<nevent);
3430 file->Write(); file->Close();
3431 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3436 void runDSTARPI(
int nevent,
EvtGen &myGenerator) {
3438 TFile *file=
new TFile(
"dstarpi.root",
"RECREATE");
3440 TH1F* t =
new TH1F(
"h1",
"dt",100,-15.0,15.0);
3441 TH1F* tB0tagpip =
new TH1F(
"h2",
"dt B0 tag pi+ (ps)",100,-15.0,15.0);
3442 TH1F* tB0Btagpip =
new TH1F(
"h3",
"dt B0B tag pi+(ps)",100,-15.0,15.0);
3443 TH1F* tB0tagpim =
new TH1F(
"h4",
"dt B0 tag pi- (ps)",100,-15.0,15.0);
3444 TH1F* tB0Btagpim =
new TH1F(
"h5",
"dt B0B tag pi- (ps)",100,-15.0,15.0);
3448 myGenerator.readUDecay(
"exampleFiles/DSTARPI.DEC");
3450 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
3451 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3452 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
3453 static EvtId PIP=EvtPDL::getId(std::string(
"pi+"));
3454 static EvtId PIM=EvtPDL::getId(std::string(
"pi-"));
3456 std::ofstream outmix;
3460 EvtVector4R pinit(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
3462 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,pinit);
3466 myGenerator.generateDecay(root_part);
3478 dt=dt/(1e-12*EvtConst::c);
3482 if (p_tag->
getId()==B0){
3483 if (p_pi->
getId()==PIP) tB0tagpip->Fill(dt);
3484 if (p_pi->
getId()==PIM) tB0tagpim->Fill(dt);
3486 if (p_tag->
getId()==B0B){
3487 if (p_pi->
getId()==PIP) tB0Btagpip->Fill(dt);
3488 if (p_pi->
getId()==PIM) tB0Btagpim->Fill(dt);
3493 }
while (count++<nevent);
3495 file->Write(); file->Close();
3496 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3502 void runETACPHIPHI(
int nevent,
EvtGen &myGenerator) {
3504 TFile *file=
new TFile(
"etacphiphi.root",
"RECREATE");
3506 TH2F* cosphi12 =
new TH2F(
"h1",
"cos phi1 vs phi2",
3507 50,-1.0,1.0,50,-1.0,1.0);
3508 TH1F* cosphi1 =
new TH1F(
"h2",
"cos phi1",50,-1.0,1.0);
3509 TH1F* cosphi2 =
new TH1F(
"h3",
"cos phi2",50,-1.0,1.0);
3510 TH1F* chi =
new TH1F(
"h4",
"chi",50,0.0,2.0*EvtConst::pi);
3514 char udecay_name[100];
3515 strcpy(udecay_name,
"exampleFiles/ETACPHIPHI.DEC");
3516 myGenerator.readUDecay(udecay_name);
3518 static EvtId ETAC=EvtPDL::getId(std::string(
"eta_c"));
3521 EvtVector4R p_init(EvtPDL::getMass(ETAC),0.0,0.0,0.0);
3523 EvtParticle* root_part=EvtParticleFactory::particleFactory(ETAC,
3527 myGenerator.generateDecay(root_part);
3529 EvtParticle *p_etac,*p_phi1,*p_phi2,*p_kp1,*p_km1,*p_kp2,*p_km2;
3530 EvtVector4R p4_etac,p4_phi1,p4_phi2,p4_kp1,p4_km1,p4_kp2,p4_km2;
3553 cosphi12->Fill(EvtDecayAngle(p4_etac,p4_phi1,p4_kp1),
3554 EvtDecayAngle(p4_etac,p4_phi2,p4_kp2),1.0);
3556 cosphi1->Fill(EvtDecayAngle(p4_etac,p4_phi1,p4_kp1));
3557 cosphi2->Fill(EvtDecayAngle(p4_etac,p4_phi2,p4_kp2));
3558 chi->Fill(EvtDecayAngleChi(p4_etac,p4_kp1,p4_km1,
3563 }
while (count++<nevent);
3565 file->Write(); file->Close();
3566 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3575 void runVVPiPi(
int nevent,
EvtGen &myGenerator) {
3576 TFile *file=
new TFile(
"vvpipi.root",
"RECREATE");
3578 TH1F* cospsi =
new TH1F(
"h1",
"cos theta J/psi ",50,-1.0,1.0);
3579 TH1F* cose =
new TH1F(
"h2",
"cos theta e+ ",50,-1.0,1.0);
3580 TH1F* mpipi =
new TH1F(
"h3",
"m pipi ",50,0.0,1.0);
3581 TH2F* cosevspsi =
new TH2F(
"h4",
"cos theta e+vs cos thete J/psi ",
3582 25,-1.0,1.0,25,-1.0,1.0);
3583 TH1F* cose1 =
new TH1F(
"h5",
"cos theta e+ 1 ",50,-1.0,1.0);
3584 TH1F* cose2 =
new TH1F(
"h6",
"cos theta e+ 2 ",50,-1.0,1.0);
3589 char udecay_name[100];
3590 strcpy(udecay_name,
"exampleFiles/VVPIPI.DEC");
3591 myGenerator.readUDecay(udecay_name);
3593 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3594 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
3597 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
3599 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
3603 myGenerator.generateDecay(root_part);
3605 EvtParticle *p_b,*p_psip,*p_psi,*p_ep,*p_pi1,*p_pi2;
3606 EvtVector4R p4_b,p4_psip,p4_psi,p4_ep,p4_pi1,p4_pi2;
3623 cospsi->Fill(EvtDecayAngle(p4_b,p4_psip,p4_psi));
3624 cose->Fill(EvtDecayAngle(p4_psip,p4_psi,p4_ep));
3625 mpipi->Fill((p4_pi1+p4_pi2).mass());
3626 cosevspsi->Fill(EvtDecayAngle(p4_b,p4_psip,p4_psi),
3627 EvtDecayAngle(p4_psip,p4_psi,p4_ep),1.0);
3628 if (std::fabs(EvtDecayAngle(p4_b,p4_psip,p4_psi))>0.95){
3629 cose1->Fill(EvtDecayAngle(p4_psip,p4_psi,p4_ep));
3631 if (std::fabs(EvtDecayAngle(p4_b,p4_psip,p4_psi))<0.05){
3632 cose2->Fill(EvtDecayAngle(p4_psip,p4_psi,p4_ep));
3637 }
while (count++<nevent);
3639 file->Write(); file->Close();
3640 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3644 void runSVVHelAmp(
int nevent,
EvtGen &myGenerator) {
3645 TFile *file=
new TFile(
"svvhelamp.root",
"RECREATE");
3647 TH1F* cospip =
new TH1F(
"h1",
"cos theta pi+",
3649 TH1F* cospim =
new TH1F(
"h2",
"cos theta pi-",
3651 TH1F* chi =
new TH1F(
"h3",
"chi pi+ to pi- in D+ direction",
3652 50,0.0,EvtConst::twoPi);
3653 TH1F* chicospipp =
new TH1F(
"h4",
"chi pi+ to pi- in D+ direction (cospip>0)",
3654 50,0.0,EvtConst::twoPi);
3655 TH1F* chicospipn =
new TH1F(
"h5",
"chi pi+ to pi- in D+ direction (cospip<0",
3656 50,0.0,EvtConst::twoPi);
3658 TH1F* chipp =
new TH1F(
"h6",
"chi pi+ to pi- in D+ direction (cospip>0,cospim>0)",
3659 50,0.0,EvtConst::twoPi);
3661 TH1F* chipn =
new TH1F(
"h7",
"chi pi+ to pi- in D+ direction (cospip>0,cospim<0)",
3662 50,0.0,EvtConst::twoPi);
3664 TH1F* chinp =
new TH1F(
"h8",
"chi pi+ to pi- in D+ direction (cospip<0,cospim>0)",
3665 50,0.0,EvtConst::twoPi);
3667 TH1F* chinn =
new TH1F(
"h9",
"chi pi+ to pi- in D+ direction (cospip<0,cospim<0)",
3668 50,0.0,EvtConst::twoPi);
3671 TH1F* chinnnn =
new TH1F(
"h10",
"chi pi+ to pi- in D+ direction (cospip<-0.5,cospim<-0.5)",
3672 50,0.0,EvtConst::twoPi);
3676 char udecay_name[100];
3677 strcpy(udecay_name,
"exampleFiles/SVVHELAMP.DEC");
3678 myGenerator.readUDecay(udecay_name);
3680 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3681 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
3684 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
3686 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
3690 myGenerator.generateDecay(root_part);
3692 EvtParticle *p_b,*p_dstp,*p_dstm,*p_pip,*p_pim,*p_d0,*p_d0b;
3693 EvtVector4R p4_b,p4_dstp,p4_dstm,p4_pip,p4_pim,p4_d0,p4_d0b;
3714 double costhpip=EvtDecayAngle(p4_b,p4_pip+p4_d0,p4_pip);
3715 double costhpim=EvtDecayAngle(p4_b,p4_pim+p4_d0b,p4_pim);
3716 double chiang=EvtDecayAngleChi(p4_b,p4_pip,p4_d0,p4_pim,p4_d0b);
3718 cospip->Fill( costhpip );
3719 cospim->Fill( costhpim );
3720 chi->Fill( chiang );
3721 if (costhpip>0) chicospipp->Fill( chiang );
3722 if (costhpip<0) chicospipn->Fill( chiang );
3724 if (costhpip>0 && costhpim>0) chipp->Fill( chiang );
3725 if (costhpip>0 && costhpim<0) chipn->Fill( chiang );
3726 if (costhpip<0 && costhpim>0) chinp->Fill( chiang );
3727 if (costhpip<0 && costhpim<0) chinn->Fill( chiang );
3728 if (costhpip<-0.5 && costhpim<-0.5) chinnnn->Fill( chiang );
3731 }
while (count++<nevent);
3733 file->Write(); file->Close();
3734 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3738 void runPartWave(
int nevent,
EvtGen &myGenerator) {
3740 TFile *file=
new TFile(
"partwave.root",
"RECREATE");
3742 TH1F* cospip =
new TH1F(
"h1",
"cos theta pi+",
3744 TH1F* cospim =
new TH1F(
"h2",
"cos theta pi-",
3746 TH1F* chi =
new TH1F(
"h3",
"chi pi+ to pi- in D+ direction",
3747 50,0.0,EvtConst::twoPi);
3748 TH1F* chicospipp =
new TH1F(
"h4",
"chi pi+ to pi- in D+ direction (cospip>0)",
3749 50,0.0,EvtConst::twoPi);
3750 TH1F* chicospipn =
new TH1F(
"h5",
"chi pi+ to pi- in D+ direction (cospip<0",
3751 50,0.0,EvtConst::twoPi);
3753 TH1F* chipp =
new TH1F(
"h6",
"chi pi+ to pi- in D+ direction (cospip>0,cospim>0)",
3754 50,0.0,EvtConst::twoPi);
3756 TH1F* chipn =
new TH1F(
"h7",
"chi pi+ to pi- in D+ direction (cospip>0,cospim<0)",
3757 50,0.0,EvtConst::twoPi);
3759 TH1F* chinp =
new TH1F(
"h8",
"chi pi+ to pi- in D+ direction (cospip<0,cospim>0)",
3760 50,0.0,EvtConst::twoPi);
3762 TH1F* chinn =
new TH1F(
"h9",
"chi pi+ to pi- in D+ direction (cospip<0,cospim<0)",
3763 50,0.0,EvtConst::twoPi);
3766 TH1F* chinnnn =
new TH1F(
"h10",
"chi pi+ to pi- in D+ direction (cospip<-0.5,cospim<-0.5)",
3767 50,0.0,EvtConst::twoPi);
3771 char udecay_name[100];
3772 strcpy(udecay_name,
"exampleFiles/PARTWAVE.DEC");
3773 myGenerator.readUDecay(udecay_name);
3775 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3776 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
3779 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
3781 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
3785 myGenerator.generateDecay(root_part);
3787 EvtParticle *p_b,*p_dstp,*p_dstm,*p_pip,*p_pim,*p_d0,*p_d0b;
3788 EvtVector4R p4_b,p4_dstp,p4_dstm,p4_pip,p4_pim,p4_d0,p4_d0b;
3809 double costhpip=EvtDecayAngle(p4_b,p4_pip+p4_d0,p4_pip);
3810 double costhpim=EvtDecayAngle(p4_b,p4_pim+p4_d0b,p4_pim);
3811 double chiang=EvtDecayAngleChi(p4_b,p4_pip,p4_d0,p4_pim,p4_d0b);
3813 cospip->Fill( costhpip );
3814 cospim->Fill( costhpim );
3815 chi->Fill( chiang );
3816 if (costhpip>0) chicospipp->Fill( chiang );
3817 if (costhpip<0) chicospipn->Fill( chiang );
3819 if (costhpip>0 && costhpim>0) chipp->Fill( chiang );
3820 if (costhpip>0 && costhpim<0) chipn->Fill( chiang );
3821 if (costhpip<0 && costhpim>0) chinp->Fill( chiang );
3822 if (costhpip<0 && costhpim<0) chinn->Fill( chiang );
3823 if (costhpip<-0.5 && costhpim<-0.5) chinnnn->Fill( chiang );
3826 }
while (count++<nevent);
3828 file->Write(); file->Close();
3829 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3832 void runPartWave2(
int nevent,
EvtGen &myGenerator) {
3834 TFile file(
"partwave2.root",
"RECREATE");
3836 TH1F* cthetapi =
new TH1F(
"h1",
"cos theta pi",
3839 TH1F* cthetapi2 =
new TH1F(
"h2",
"cos theta pi (|cosrho|<0.1)",
3843 TH1F* cthetan =
new TH1F(
"h3",
"cos thetan",
3850 TH1F* cthetarho =
new TH1F(
"h4",
"cos thetarho ",
3854 char udecay_name[100];
3855 strcpy(udecay_name,
"exampleFiles/PARTWAVE2.DEC");
3856 myGenerator.readUDecay(udecay_name);
3858 static EvtId JPSI=EvtPDL::getId(std::string(
"J/psi"));
3859 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3862 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
3864 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
3868 myGenerator.generateDecay(root_part);
3898 double costhetan=EvtDecayPlaneNormalAngle(p4_b,p4_jpsi,p4_pi1,p4_pi2);
3902 cthetan->Fill( costhetan );
3904 double costhpi=EvtDecayAngle(p4_jpsi,p4_rho,p4_pi1);
3906 double costhrho=EvtDecayAngle(p4_b,p4_jpsi,p4_rho);
3910 cthetarho->Fill( costhrho );
3914 cthetapi->Fill( costhpi );
3916 if ((p4_rho.get(3)/p4_rho.d3mag())>0.9) {
3917 cthetapi2->Fill( costhpi );
3922 }
while (count++<nevent);
3924 file.Write(); file.Close();
3925 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
3929 void runTwoBody(
int nevent,
EvtGen &myGenerator, std::string decFile,
3930 std::string rootFile) {
3932 TFile *file=
new TFile(rootFile.c_str(),
"RECREATE");
3936 myGenerator.readUDecay(decFile.c_str());
3938 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
3940 vector<TH1F*> histograms;
3943 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
3945 EvtParticle* root_part=EvtParticleFactory::particleFactory(B0,
3949 myGenerator.generateDecay(root_part);
3953 myGenerator.generateDecay(root_part);
3962 if (!(nDaug==0||nDaug==2)) {
3963 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"nDaug="<<nDaug<<
" but can only handle 0 or 2!"<<std::endl;
3970 double ctheta=p4.get(3)/p4.d3mag();
3971 double phi=atan2(p4.get(2),p4.get(1));
3973 histograms.push_back(
new TH1F(
"h1",
"cos theta",50,-1.0,1.0));
3974 histograms.push_back(
new TH1F(
"h2",
"phi",50,-EvtConst::pi
3977 histograms[nhist++]->Fill(ctheta);
3978 histograms[nhist++]->Fill(phi);
3989 std::ostringstream strm;
3991 histograms.push_back(
new TH1F(TString(
"h") + strm.str(),
3992 TString(
"cos theta") + strm.str(),
3995 histograms[nhist++]->Fill(ctheta);
4006 std::ostringstream strm;
4008 histograms.push_back(
new TH1F(TString(
"h") + strm.str(),
4009 TString(
"cos theta") + strm.str(),
4012 histograms[nhist++]->Fill(costhetan);
4024 std::ostringstream strm;
4026 histograms.push_back(
new TH1F(TString(
"h") + strm.str(),
4027 TString(
"cos theta") + strm.str(),
4030 histograms[nhist++]->Fill(costhetan);
4041 }
while (count++<nevent);
4043 file->Write(); file->Close();
4044 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4048 void runPiPi(
int nevent,
EvtGen &myGenerator) {
4049 std::ofstream outmix;
4050 outmix.open(
"pipi.dat");
4052 TFile *file=
new TFile(
"pipi.root",
"RECREATE");
4054 TH1F* tB0Hist =
new TH1F(
"h1",
"dt in B->pipi with B0 tag",50,-5.0,5.0);
4055 TH1F* tB0BHist =
new TH1F(
"h2",
"dt in B->pipi with B0B tag",50,-5.0,5.0);
4057 TH1F* tB0 =
new TH1F(
"h3",
"t in B->pipi for B0 tag",25,0.0,5.0);
4058 TH1F* tB0B =
new TH1F(
"h4",
"t in B->pipi for B0B tag",25,0.0,5.0);
4060 char udecay_name[100];
4061 strcpy(udecay_name,
"exampleFiles/PIPI.DEC");
4063 myGenerator.readUDecay(udecay_name);
4069 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
4070 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
4071 static EvtId GAMM=EvtPDL::getId(std::string(
"gamma"));
4072 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
4073 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
4076 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
4078 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
4082 myGenerator.generateDecay(root_part);
4095 if (btag->
getId()==B0B){
4109 btag->
getLifetime() <<
" " << tag.getId() << std::endl;
4113 }
while (count++<nevent);
4116 file->Write(); file->Close();
4117 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4120 void runA1Pi(
int nevent,
EvtGen &myGenerator) {
4122 std::ofstream outmix;
4123 outmix.open(
"a1pi.dat");
4127 char udecay_name[100];
4128 strcpy(udecay_name,
"exampleFiles/A1PI.DEC");
4129 myGenerator.readUDecay(udecay_name);
4133 EvtVector4R p4bcp,p4a1,p4rho0,p4pi1,p4pi2,p4pi3,p4pi4;
4134 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
4135 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
4136 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
4139 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
4141 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
4144 myGenerator.generateDecay(root_part);
4176 if (btag->
getId()==B0B){
4185 EvtDecayAngle(p4bcp,p4rho0+p4pi2,p4rho0) <<
" "<<
4186 EvtDecayAngle(p4a1,p4pi3+p4pi4,p4pi3) <<
" "<<
4187 EvtPDL::getStdHep(tag) << std::endl;
4191 }
while (count++<1000);
4194 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4197 void runCPTest(
int nevent,
EvtGen &myGenerator) {
4199 std::ofstream outmix;
4200 outmix.open(
"cptest.dat");
4204 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
4205 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
4206 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
4208 char udecay_name[100];
4209 strcpy(udecay_name,
"exampleFiles/CPTEST.DEC");
4211 myGenerator.readUDecay(udecay_name);
4217 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
4219 EvtParticle* root_part=EvtParticleFactory::particleFactory(UPS4,
4223 myGenerator.generateDecay(root_part);
4236 if (btag->
getId()==B0B){
4244 btag->
getLifetime() <<
" " << tag.getId() << std::endl;
4248 }
while (count++<nevent);
4251 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4256 void runBtoXsgamma(
int nevent,
EvtGen &myGenerator) {
4258 static EvtId UPS4 = EvtPDL::getId(std::string(
"Upsilon(4S)"));
4259 TFile *file=
new TFile(
"BtoXsgamma.root",
"RECREATE");
4266 char udecay_name[100];
4267 strcpy(udecay_name,
"exampleFiles/BTOXSGAMMA.DEC");
4269 myGenerator.readUDecay(udecay_name);
4272 int strangeid,antistrangeid;
4273 int Bmulti,bId1a,bId1b,bId2a,bId2b,b1Id,b2Id;
4276 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
4278 vector_part->init(UPS4,p_init);
4283 myGenerator.generateDecay(root_part);
4287 if (Bmulti==1) B1 = B1->
getDaug(0);
4289 bId1a = EvtPDL::getStdHep(BId1a);
4291 bId1b = EvtPDL::getStdHep(BId1b);
4293 if (Bmulti==1) EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"B1" <<
" bId1a=" << bId1a <<
" bId1b=" << bId1b <<
" ndaug=" << B1->
getNDaug() <<
" Bid=" << EvtPDL::getStdHep(B1->
getId()) << std::endl;
4297 if (Bmulti==1) B2 = B2->getDaug(0);
4298 EvtId BId2a = B2->getDaug(0)->getId();
4299 bId2a = EvtPDL::getStdHep(BId2a);
4300 EvtId BId2b = B2->getDaug(1)->getId();
4301 bId2b = EvtPDL::getStdHep(BId2b);
4303 if (Bmulti==1) EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"B2" <<
" bId2a=" << bId2a <<
" bId2b=" << bId2b <<
" ndaug=" << B2->getNDaug() <<
" Bid=" << EvtPDL::getStdHep(B2->getId()) << std::endl;
4306 b1Id = EvtPDL::getStdHep(B1Id);
4307 EvtId B2Id = B2->getId();
4308 b2Id = EvtPDL::getStdHep(B2Id);
4312 if ((b1Id == 511) || (b1Id == -511) || (b2Id == 511) || (b2Id == -511)) {
4313 strangeid=30343; antistrangeid=-30343;
4314 }
else if ((b1Id == 521) || (b1Id == -521) || (b2Id == 521) || (b2Id == -521)) {
4315 strangeid=30353; antistrangeid=-30353;
4316 }
else if ((b1Id == 531) || (b1Id == -531) || (b2Id == 531) || (b2Id == -531)) {
4317 strangeid=30363; antistrangeid=-30363;
4319 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"bId1a "<<bId1a<<
" bId1b "<<bId1b<<
" bId2a "<<bId2a<<
" bId2b "<<bId2b<<
" for event "<<count<<std::endl;
4324 if (((bId1a == strangeid) && (bId1b == 22)) || ((bId1a == antistrangeid) && (bId1b == 22))|| ((bId1b == strangeid) && (bId1a == 22)) || ((bId1b == antistrangeid) && (bId1a == 22))) {
4329 if (((bId2a == strangeid) && (bId2b == 22)) || ((bId2a == antistrangeid) && (bId2b == 22)) || ((bId2b == strangeid) && (bId2a == 22)) || ((bId2b == antistrangeid) && (bId2a == 22))) {
4334 if (pengcount == 0) {
4336 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"No penguin decay for event "<<count<<std::endl;
4338 }
else if (pengcount == 2) {
4340 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Two penguin decays in event "<<count<<std::endl;
4379 for(
int i=0;i<Xsmulti;i++){
4387 if(abs(EvtPDL::getStdHep(XsDaugId))==321||EvtPDL::getStdHep(XsDaugId)==310||EvtPDL::getStdHep(XsDaugId)==111||abs(EvtPDL::getStdHep(XsDaugId))==211||Daumulti==0){
4394 }
else if(Daumulti!=0){
4396 for(
int k=0;k<Daumulti;k++){
4398 EvtId XsDaugNephewId = XsDaugNephew->
getId();
4399 int Nephmulti = XsDaugNephew->
getNDaug();
4401 if(Nephmulti==0||abs(EvtPDL::getStdHep(XsDaugNephewId))==321||EvtPDL::getStdHep(XsDaugNephewId)==310||EvtPDL::getStdHep(XsDaugNephewId)==111||abs(EvtPDL::getStdHep(XsDaugNephewId))==211) {
4407 for(
int g=0;g<Nephmulti;g++){
4411 EvtId XsDaugNephewNephewId = XsDaugNephewNephew->
getId();
4430 }
while (count++<nevent);
4432 file->Write(); file->Close();
4434 EvtGenReport(EVTGEN_INFO,
"EvtGen")<<
"End EvtGen. Ran on "<<nevent<<
" events."<<std::endl;
4435 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4439 void runBtoK1273gamma(
int nevent,
EvtGen &myGenerator) {
4441 static EvtId UPS4 = EvtPDL::getId(std::string(
"Upsilon(4S)"));
4442 TFile *file=
new TFile(
"BtoK1273gamma.root",
"RECREATE");
4450 char udecay_name[100];
4451 strcpy(udecay_name,
"exampleFiles/BTOK1273GAMMA.DEC");
4453 myGenerator.readUDecay(udecay_name);
4456 int strangeid,antistrangeid;
4457 int Bmulti,bId1a,bId1b,bId2a,bId2b,b1Id,b2Id;
4460 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
4462 vector_part->init(UPS4,p_init);
4467 myGenerator.generateDecay(root_part);
4471 if (Bmulti==1) B1 = B1->
getDaug(0);
4473 bId1a = EvtPDL::getStdHep(BId1a);
4475 bId1b = EvtPDL::getStdHep(BId1b);
4477 if (Bmulti==1) EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"B1" <<
" bId1a=" << bId1a <<
" bId1b=" << bId1b <<
" ndaug=" << B1->
getNDaug() <<
" Bid=" << EvtPDL::getStdHep(B1->
getId()) << std::endl;
4481 if (Bmulti==1) B2 = B2->getDaug(0);
4482 EvtId BId2a = B2->getDaug(0)->getId();
4483 bId2a = EvtPDL::getStdHep(BId2a);
4484 EvtId BId2b = B2->getDaug(1)->getId();
4485 bId2b = EvtPDL::getStdHep(BId2b);
4487 if (Bmulti==1) EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"B2" <<
" bId2a=" << bId2a <<
" bId2b=" << bId2b <<
" ndaug=" << B2->getNDaug() <<
" Bid=" << EvtPDL::getStdHep(B2->getId()) << std::endl;
4490 b1Id = EvtPDL::getStdHep(B1Id);
4491 EvtId B2Id = B2->getId();
4492 b2Id = EvtPDL::getStdHep(B2Id);
4496 if ((b1Id == 511) || (b1Id == -511) || (b2Id == 511) || (b2Id == -511)) {
4497 strangeid=10313; antistrangeid=-10313;
4498 }
else if ((b1Id == 521) || (b1Id == -521) || (b2Id == 521) || (b2Id == -521)) {
4499 strangeid=10323; antistrangeid=-10323;
4501 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"bId1a "<<bId1a<<
" bId1b "<<bId1b<<
" bId2a "<<bId2a<<
" bId2b "<<bId2b<<
" for event "<<count<<std::endl;
4506 if (((bId1a == strangeid) && (bId1b == 22)) || ((bId1a == antistrangeid) && (bId1b == 22))|| ((bId1b == strangeid) && (bId1a == 22)) || ((bId1b == antistrangeid) && (bId1a == 22))) {
4511 if (((bId2a == strangeid) && (bId2b == 22)) || ((bId2a == antistrangeid) && (bId2b == 22)) || ((bId2b == strangeid) && (bId2a == 22)) || ((bId2b == antistrangeid) && (bId2a == 22))) {
4516 if (pengcount == 0) {
4518 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"No penguin decay for event "<<count<<std::endl;
4520 }
else if (pengcount == 2) {
4522 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Two penguin decays in event "<<count<<std::endl;
4559 for(
int i=0;i<Ksmulti;i++){
4573 }
while (count++<nevent);
4575 file->Write(); file->Close();
4577 EvtGenReport(EVTGEN_INFO,
"EvtGen")<<
"End EvtGen. Ran on "<<nevent<<
" events."<<std::endl;
4578 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4583 void runCheckRotBoost(){
4609 EvtComplex sBoost=EvtLeptonSCurrent(sp1Boost,sp2Boost);
4610 EvtComplex pBoost=EvtLeptonPCurrent(sp1Boost,sp2Boost);
4611 EvtVector4C aBoost=EvtLeptonACurrent(sp1Boost,sp2Boost);
4612 EvtVector4C vBoost=EvtLeptonVCurrent(sp1Boost,sp2Boost);
4613 EvtVector4C vaBoost=EvtLeptonVACurrent(sp1Boost,sp2Boost);
4614 EvtTensor4C tBoost=EvtLeptonTCurrent(sp1Boost,sp2Boost);
4620 tDirBoost.applyBoostTo(ranBoost);
4622 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Comparing after doing a random boost"<<std::endl;
4623 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Scalar "<<s<<
" "<<sBoost<<s-sBoost<<std::endl;
4624 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"PseudoScalar "<<p<<
" "<<pBoost<<p-pBoost<<std::endl;
4625 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"AxialVector "<<aDirBoost<<
" "<<aBoost<<aDirBoost-aBoost<<std::endl;
4626 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Vector "<<vDirBoost<<
" "<<vBoost<<vDirBoost-vBoost<<std::endl;
4627 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"V-A "<<vaDirBoost<<
" "<<vaBoost<<vaDirBoost-vaBoost<<std::endl;
4628 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Tensor "<<tDirBoost<<
" "<<tBoost<<tDirBoost-tBoost<<std::endl;
4629 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Done comparing after doing a random boost"<<std::endl;
4641 EvtComplex sRot=EvtLeptonSCurrent(sp1Rot,sp2Rot);
4642 EvtComplex pRot=EvtLeptonPCurrent(sp1Rot,sp2Rot);
4643 EvtVector4C aRot=EvtLeptonACurrent(sp1Rot,sp2Rot);
4644 EvtVector4C vRot=EvtLeptonVCurrent(sp1Rot,sp2Rot);
4645 EvtVector4C vaRot=EvtLeptonVACurrent(sp1Rot,sp2Rot);
4646 EvtTensor4C tRot=EvtLeptonTCurrent(sp1Rot,sp2Rot);
4652 aDirRot.applyRotateEuler(alpha,beta,gamma);
4653 vDirRot.applyRotateEuler(alpha,beta,gamma);
4654 vaDirRot.applyRotateEuler(alpha,beta,gamma);
4655 tDirRot.applyRotateEuler(alpha,beta,gamma);
4657 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Comparing after doing a random rotation"<<std::endl;
4658 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Scalar "<<s<<
" "<<sRot<<s-sRot<<std::endl;
4659 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"PseudoScalar "<<p<<
" "<<pRot<<p-pRot<<std::endl;
4660 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"AxialVector "<<aDirRot<<
" "<<aRot<<aDirRot-aRot<<std::endl;
4661 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Vector "<<vDirRot<<
" "<<vRot<<vDirRot-vRot<<std::endl;
4662 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"V-A "<<vaDirRot<<
" "<<vaRot<<vaDirRot-vaRot<<std::endl;
4663 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Tensor "<<tDirRot<<
" "<<tRot<<tDirRot-tRot<<std::endl;
4664 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Done comparing after doing a random rotation"<<std::endl;
4665 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4669 int countInclusive(std::string name,
EvtParticle *root_part,TH1F* mom, TH1F* mass){
4673 EvtId searchFor=EvtPDL::getId(name);
4677 if (type==searchFor) {
4679 if ( mom) mom->Fill(p->
getP4Lab().d3mag());
4680 if ( mass) mass->Fill(p->
mass());
4694 int countInclusiveSubTree(std::string name,
EvtParticle *root_part,
4701 if ( setIds.contains(p->
getId()) ) {
4702 temp+=countInclusive(name,p);
4717 int countInclusiveParent(std::string name,
EvtParticle *root_part,
4725 EvtId searchFor=EvtPDL::getId(name);
4729 if (type==searchFor) {
4733 if ( mom) mom->Fill(p->
getP4Lab().d3mag());
4747 void runBMix(
int nevent,
EvtGen &myGenerator,std::string userFile,std::string rootFile) {
4749 TFile *file=
new TFile(rootFile.c_str(),
"RECREATE");
4751 TH1F* b0_b0 =
new TH1F(
"h1",
"dt B0-B0",100,-15.0,15.0);
4752 TH1F* b0b_b0b =
new TH1F(
"h2",
"dt B0B-B0B",100,-15.0,15.0);
4753 TH1F* b0b_b0 =
new TH1F(
"h3",
"dt B0B-B0",100,-15.0,15.0);
4754 TH1F* b0_b0b =
new TH1F(
"h4",
"dt B0-B0B",100,-15.0,15.0);
4758 myGenerator.readUDecay(userFile.c_str());
4760 EvtId b0=EvtPDL::getId(
"B0");
4761 EvtId b0b=EvtPDL::getId(
"anti-B0");
4763 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
4765 std::ofstream outmix;
4766 TString outFileName(rootFile);
4767 outFileName.ReplaceAll(
".root",
".dat");
4768 outmix.open(outFileName.Data());
4771 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
4773 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
4777 myGenerator.generateDecay(root_part);
4785 double dt=(t1-t2)/(1e-12*3e11);
4787 if (id1==b0&&id2==b0) { b0_b0->Fill(dt); outmix << dt <<
" 1"<<std::endl;}
4788 if (id1==b0b&&id2==b0b) {b0b_b0b->Fill(dt); outmix << dt <<
" 2"<<std::endl;}
4789 if (id1==b0b&&id2==b0) {b0b_b0->Fill(dt); outmix << dt <<
" 0"<<std::endl;}
4790 if (id1==b0&&id2==b0b) {b0_b0b->Fill(dt); outmix << dt <<
" 0"<<std::endl;}
4794 }
while (count++<nevent);
4796 file->Write(); file->Close();
4799 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4806 void runDDalitz(
int nevent,
EvtGen &myGenerator) {
4808 TFile *file=
new TFile(
"ddalitz.root",
"RECREATE");
4810 TH2F* dalitz =
new TH2F(
"h1",
"m^2!?[K-[p]+! vs m^2!?[K-[p]0!",
4811 70,0.0,3.5,70,0.0,3.5);
4812 TH2F* dalitz2 =
new TH2F(
"h5",
"m^2!([p]^-![p]^0!) vs m^2!([K-[p]+!",
4813 100,0.0,3.5,100,0.0,2.0);
4815 TH1F* m12=
new TH1F(
"h2",
"m?[K-[p]+!",100,0.0,3.0);
4816 TH1F* m13=
new TH1F(
"h3",
"m?[K-[p]0!",100,0.0,3.0);
4817 TH1F* m23=
new TH1F(
"h4",
"m?[[p]+[p]0!",100,0.0,2.0);
4822 myGenerator.readUDecay(
"exampleFiles/DDALITZ.DEC");
4825 static EvtId D0=EvtPDL::getId(std::string(
"D0"));
4827 std::ofstream outmix;
4828 outmix.open(
"ddalitz.dat");
4833 EvtVector4R p_init(EvtPDL::getMass(D0),0.0,0.0,0.0);
4835 EvtParticle *root_part=EvtParticleFactory::particleFactory(D0,
4839 myGenerator.generateDecay(root_part);
4845 dalitz->Fill((p1+p2).mass2(),(p1+p3).mass2(),1.0);
4846 dalitz2->Fill((p1+p2).mass2(),(p2+p3).mass2(),1.0);
4848 m12->Fill((p1+p2).mass2());
4849 m13->Fill((p1+p3).mass2());
4850 m23->Fill((p2+p3).mass2());
4851 outmix << (p1+p2).mass2() <<
" "<<(p2+p3).mass2()<<
" "<<(p1+p3).mass2()<<std::endl;
4854 if(count == nevent-1) {
4855 std::ofstream testi(
"testi.dat");
4856 double val = m12->GetMean();
4857 double errval = m12->GetMeanError();
4858 testi <<
"evtgenlhc_test1 1 " << val <<
" " << errval << std::endl;
4860 val = m23->GetMean();
4861 errval = m23->GetMeanError();
4862 testi <<
"evtgenlhc_test1 2 " << val <<
" " << errval << std::endl;
4865 }
while (count++<nevent);
4867 file->Write(); file->Close();
4869 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4874 void runPiPiPi(
int nevent,
EvtGen &myGenerator) {
4876 std::ofstream outmix;
4877 outmix.open(
"pipipi.dat");
4882 myGenerator.readUDecay(
"exampleFiles/PIPIPI.DEC");
4886 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
4891 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
4893 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
4897 myGenerator.generateDecay(root_part);
4905 outmix << (p4pip+p4pim).mass2()<<
" "<<
4906 (p4pip+p4pi0).mass2()<<std::endl;
4910 }
while (count++<10000);
4913 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4918 void runBHadronic(
int nevent,
EvtGen &myGenerator) {
4920 std::ofstream outmix;
4921 outmix.open(
"bhadronic.dat");
4925 myGenerator.readUDecay(
"exampleFiles/BHADRONIC.DEC");
4927 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
4934 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
4936 EvtParticle *root_part=EvtParticleFactory::particleFactory(B0,
4940 myGenerator.generateDecay(root_part);
4950 outmix << p->
getId().getId()<<
" "<< p->
getP4Lab().d3mag() << std::endl;
4957 }
while (count++<nevent);
4960 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4964 void runSingleB(
int nevent,
EvtGen &myGenerator) {
4968 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
4973 EvtVector4R p_init(EvtPDL::getMass(B0),0.0,0.0,0.0);
4975 EvtParticle *root_part=EvtParticleFactory::particleFactory(B0,
4979 myGenerator.generateDecay(root_part);
4984 }
while (count++<nevent);
4986 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
4992 void runPiPiPiPi(
int nevent,
EvtGen &myGenerator) {
4994 std::ofstream outmix;
4995 outmix.open(
"pipipipi.dat");
5002 myGenerator.readUDecay(
"exampleFiles/PIPIPIPI.DEC");
5008 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5009 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
5010 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
5015 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5017 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5021 myGenerator.generateDecay(root_part);
5034 if (btag->
getId()==B0B){
5054 << (p4pi1+p4pi2+p4pi3).mass() <<
" " <<
5055 (p4pi1+p4pi2).mass() <<
" " <<
5056 EvtDecayAngle(p4bcp,p4rho0+p4pi3,p4rho0) <<
" "<<
5057 EvtDecayAngle(p4a2,p4pi1+p4pi2,p4pi1) << std::endl;
5061 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"count:"<<count<<std::endl;
5063 }
while (count++<1000);
5066 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5070 void runA2Pi(
int nevent,
EvtGen &myGenerator) {
5072 std::ofstream outmix;
5073 outmix.open(
"a2pi.dat");
5077 myGenerator.readUDecay(
"exampleFiles/A2PI.DEC");
5081 EvtVector4R p4bcp,p4a2,p4rho0,p4pi1,p4pi2,p4pi3,p4pi4;
5085 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5086 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
5087 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
5092 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5094 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5098 myGenerator.generateDecay(root_part);
5130 if (btag->
getId()==B0B){
5140 EvtDecayAngle(p4bcp,p4rho0+p4pi2,p4rho0) <<
" "<<
5141 EvtDecayAngle(p4a2,p4pi3+p4pi4,p4pi3) <<
" "<<
5142 EvtPDL::getStdHep(tag) << std::endl;
5146 }
while (count++<1000);
5150 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5155 void runHelAmp(
int nevent,
EvtGen &myGenerator, std::string userFile,
5156 std::string rootFile) {
5158 TFile *file=
new TFile(rootFile.c_str(),
"RECREATE");
5160 TH1F* costheta =
new TH1F(
"h1",
"costheta",100,-1.0,1.0);
5161 TH1F* costheta2 =
new TH1F(
"h2",
"costheta2",100,-1.0,1.0);
5165 myGenerator.readUDecay(userFile.c_str());
5169 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5174 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5176 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5180 myGenerator.generateDecay(root_part);
5183 double c=d14.get(3)/d14.d3mag();
5190 costheta2->Fill(EvtDecayAngle(p,q,d));
5194 }
while (count++<nevent);
5197 file->Write(); file->Close();
5198 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5202 void runHelAmp2(
int nevent,
EvtGen &myGenerator) {
5204 TFile *file=
new TFile(
"helamp2.root",
"RECREATE");
5206 TH1F* costheta =
new TH1F(
"h1",
"costheta",100,-1.0,1.0);
5210 myGenerator.readUDecay(
"exampleFiles/HELAMP2.DEC");
5214 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5219 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5221 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5225 myGenerator.generateDecay(root_part);
5232 costheta->Fill(EvtDecayAngle(p,q,d));
5236 }
while (count++<nevent);
5239 file->Write(); file->Close();
5240 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5244 void runD2Pi(
int nevent,
EvtGen &myGenerator) {
5246 TFile *file=
new TFile(
"d2pi.root",
"RECREATE");
5248 TH1F* cospi =
new TH1F(
"h1",
"cos[Q]?[p]!",50,-1.0,1.0);
5249 TH1F* ptpi =
new TH1F(
"h2",
"Pt of pion",50,0.0,1.5);
5250 TH1F* ppi =
new TH1F(
"h3",
"P?[p]! in [Y](4S) rest frame",50,0.0,1.5);
5254 myGenerator.readUDecay(
"exampleFiles/D2PI.DEC");
5263 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5269 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5271 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5275 myGenerator.generateDecay(root_part);
5288 cospi->Fill(EvtDecayAngle(p4b,p4d2,p4pi));
5289 ptpi->Fill(sqrt(p4pi.get(2)*p4pi.get(2)+p4pi.get(3)*p4pi.get(3)));
5290 ppi->Fill(p4pi.d3mag());
5295 }
while (count++<nevent);
5297 file->Write(); file->Close();
5298 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5303 void runPiPiCPT(
int nevent,
EvtGen &myGenerator) {
5305 std::ofstream outmix;
5306 outmix.open(
"pipicpt.dat");
5310 myGenerator.readUDecay(
"exampleFiles/PIPICPT.DEC");
5316 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5317 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
5318 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
5324 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5326 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5330 myGenerator.generateDecay(root_part);
5343 if (btag->
getId()==B0B){
5351 btag->
getLifetime() <<
" " << tag.getId() << std::endl;
5355 }
while (count++<10000);
5358 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5363 void runJpsiKs(
int nevent,
EvtGen &myGenerator) {
5365 std::ofstream outmix;
5366 outmix.open(
"jpsiks.dat");
5370 myGenerator.readUDecay(
"exampleFiles/JPSIKS.DEC");
5376 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5377 static EvtId B0=EvtPDL::getId(std::string(
"B0"));
5378 static EvtId B0B=EvtPDL::getId(std::string(
"anti-B0"));
5383 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5385 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5389 myGenerator.generateDecay(root_part);
5402 if (btag->
getId()==B0B){
5410 btag->
getLifetime() <<
" " << tag.getId() << std::endl;
5414 }
while (count++<10000);
5417 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5421 void runDump(
int nevent,
EvtGen &myGenerator) {
5430 std::ofstream outmix;
5431 outmix.open(
"dump.dat");
5435 myGenerator.readUDecay(
"exampleFiles/DUMP.DEC");
5439 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5441 static EvtId PI0=EvtPDL::getId(std::string(
"pi0"));
5442 static EvtId PIP=EvtPDL::getId(std::string(
"pi+"));
5443 static EvtId PIM=EvtPDL::getId(std::string(
"pi-"));
5445 static EvtId EP=EvtPDL::getId(std::string(
"e+"));
5446 static EvtId KP=EvtPDL::getId(std::string(
"K+"));
5447 static EvtId MUP=EvtPDL::getId(std::string(
"mu+"));
5448 static EvtId EM=EvtPDL::getId(std::string(
"e-"));
5449 static EvtId KM=EvtPDL::getId(std::string(
"K-"));
5450 static EvtId MUM=EvtPDL::getId(std::string(
"mu-"));
5451 static EvtId GAMM=EvtPDL::getId(std::string(
"gamma"));
5452 static EvtId K0L=EvtPDL::getId(std::string(
"K_L0"));
5457 if (count==100*(count/100)) {
5458 EvtGenReport(EVTGEN_INFO,
"EvtGen") << count << std::endl;
5460 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5462 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5466 myGenerator.generateDecay(root_part);
5472 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Event:"<<count<<std::endl;
5479 <<
" "<<otherb->
getP4Lab().get(3)<<std::endl;
5484 if (p->
getId()==PIP||
5491 <<
" "<<p->
getP4Lab().get(3)<<std::endl;
5494 if (p->
getId()==PIM||
5501 <<
" "<<p->
getP4Lab().get(3)<<std::endl;
5504 if (p->
getId()==GAMM||
5509 <<
" "<<p->
getP4Lab().get(3)<<std::endl;
5517 outmix <<
"event"<<std::endl;
5521 }
while (count++<nevent);
5524 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5529 void runGenericCont(
int nevent,
EvtGen &myGenerator) {
5533 std::ofstream outmix;
5534 outmix.open(
"genericcont.dat");
5538 myGenerator.readUDecay(
"exampleFiles/GENERIC.DEC");
5542 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5543 static EvtId VPHO=EvtPDL::getId(std::string(
"vpho"));
5547 if (count==1000*(count/1000)) {
5548 EvtGenReport(EVTGEN_DEBUG,
"EvtGen") << count << std::endl;
5552 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5554 EvtParticle *root_part=EvtParticleFactory::particleFactory(VPHO,
5558 myGenerator.generateDecay(root_part);
5564 outmix << p->
getId().getId()<<
" "<< p->
getP4Lab().d3mag() << std::endl;
5574 }
while (count++<nevent);
5578 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5583 void runD1(
int nevent,
EvtGen &myGenerator) {
5585 std::ofstream outmix;
5586 outmix.open(
"d1.dat");
5590 myGenerator.readUDecay(
"exampleFiles/D1.DEC");
5592 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5595 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5596 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5600 myGenerator.generateDecay(root_part);
5602 EvtParticle *p_b,*p_d1,*p_e,*p_nu,*p_pi1,*p_dstar,*p_pi2,*p_d;
5603 EvtVector4R p4_b,p4_d1,p4_e,p4_nu,p4_pi1,p4_dstar,p4_pi2,p4_d;
5628 outmix << p4_e.get(0)<<
" ";
5629 outmix << (p4_e+p4_nu)*(p4_e+p4_nu)<<
" ";
5630 outmix << EvtDecayAngle(p4_b,p4_e+p4_nu,p4_e) <<
" " ;
5631 outmix << EvtDecayAngle(p4_b,p4_dstar+p4_pi1,p4_dstar) <<
" " ;
5632 outmix << EvtDecayAngle(p4_d1,p4_d+p4_pi2,p4_d) <<
" " ;
5633 outmix << EvtDecayAngleChi(p4_b,p4_e,p4_nu,
5634 p4_dstar, p4_pi1 ) <<
"\n" ;
5638 EvtGenReport(EVTGEN_DEBUG,
"EvtGen") <<
"count:"<<count<<std::endl;
5640 }
while (count++<nevent);
5643 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5648 void runMix(
int nevent,
EvtGen &myGenerator) {
5650 std::ofstream outmix;
5651 outmix.open(
"mix.dat");
5655 myGenerator.readUDecay(
"exampleFiles/MIX.DEC");
5657 static EvtId UPS4=EvtPDL::getId(std::string(
"Upsilon(4S)"));
5661 EvtVector4R p_init(EvtPDL::getMass(UPS4),0.0,0.0,0.0);
5662 EvtParticle *root_part=EvtParticleFactory::particleFactory(UPS4,
5666 myGenerator.generateDecay(root_part);
5668 outmix << root_part->
getDaug(0)->
getId().getId() <<
" ";
5670 outmix << root_part->
getDaug(1)->
getId().getId() <<
" ";
5675 }
while (count++<10000);
5678 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
5683 void runBaryonic(
int nEvent,
EvtGen& myGenerator)
5685 TFile* f =
new TFile(
"baryonic.root",
"RECREATE");
5686 TH1D* q2Hist =
new TH1D(
"q2Hist",
"q square", 50, 0.0, 25.00);
5688 EvtId BMINUS = EvtPDL::getId(
"B-");
5689 EvtVector4R p_init(EvtPDL::getMass(BMINUS), 0.0, 0.0, 0.0);
5691 myGenerator.readUDecay(
"exampleFiles/BARYONIC.DEC");
5698 for (
int i=0; i<nEvent; ++i)
5700 root_part = EvtParticleFactory::particleFactory(BMINUS, p_init);
5702 myGenerator.generateDecay(root_part);
5707 q2Hist->Fill( sum.mass2() );
5712 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"SUCCESS\n";
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
EvtVector4R getP4Lab() const
EvtParticle * getParent() const
void setP4(const EvtVector4R &p4)
void setSpinDensityForwardHelicityBasis(const EvtSpinDensity &rho)
void setDiagonalSpinDensity()
EvtParticle * nextIter(EvtParticle *rootOfTree=0)
void setVectorSpinDensity()