28 , _areaIntegral(-9999.0)
40 , _areaIntegral(other._areaIntegral)
41 , _unWeightPs(other._unWeightPs)
42 , _coords(other._coords)
43 , _mappedCoords(other._mappedCoords)
62 , _areaIntegral(-9999.0)
72 cout <<
"DalitzBWArea::DalitzBWArea:" 73 <<
"\n Sorry, can only deal with 3 and 4 body decays. " 74 <<
"\n Please improve me so I can deal with decays like this: " 76 cout <<
" I'll crash now." << endl;
77 throw "DalitzBWArea: \"I'm no superman\"";
88 cout <<
"DalitzBWArea::DalitzBWArea:" 89 <<
"\n Sorry, can only deal with 3 or 4 body decays. " 90 <<
"\n Please improve me so I can deal with decays like this: " 92 cout <<
" I'll crash now." << endl;
93 throw "DalitzBWArea: \"I'm no superman\"";
114 std::pair<DalitzCoordinate, counted_ptr<IGenFct> > p (c, fcn);
120 std::pair<DalitzCoordinate, counted_ptr<IGenFct> > p (c, fcn);
131 double safetyFactor=1;
164 std::pair<DalitzCoordinate, counted_ptr<IGenFct> >&
166 map<DalitzCoordKey, pair<DalitzCoordinate, counted_ptr<IGenFct> > >::iterator it =
_coords.find(c.
myKey());
168 cout <<
"ERROR in DalitzBWArea::sf" 169 <<
" unknown coordinate: " << c
171 throw "CAN'T HANDLE THAT...";
176 const std::pair<DalitzCoordinate, counted_ptr<IGenFct> >&
178 map<DalitzCoordKey, pair<DalitzCoordinate, counted_ptr<IGenFct> > >::iterator it =
181 cout <<
"ERROR in DalitzBWArea::sf" 182 <<
" unknown coordinate: " << c
184 throw "CAN'T HANDLE THAT...";
189 std::pair<DalitzCoordinate, counted_ptr<IGenFct> >&
195 const std::pair<DalitzCoordinate, counted_ptr<IGenFct> >&
206 const std::pair<DalitzCoordinate, counted_ptr<IGenFct> >&
DalitzBWArea::sf(
int i,
int j)
const{
222 if(dbThis) cout <<
"patterns don't match in isInside" << endl;
226 std::vector<int> mappedValues;
231 cout <<
"old: " << evt.
sij(it->second.first)
232 <<
" new " << evt.
sij(mapping.
mapValues(it->second.first))
233 <<
" newer " << evt.
sij(it->second.first.mapMe(mapping))
238 mapping.
mapValues(it->second.first, mappedValues);
239 double val = evt.
sij(mappedValues);
240 if(val < it->
second.first.min() || val >= it->second.first.max())
return false;
248 double val = dc.
val();
249 map<DalitzCoordKey, pair<DalitzCoordinate, counted_ptr<IGenFct> > >::const_iterator it =
_coords.find(dc);
251 cout <<
"ERROR in DalitzBWArea::isInside - unknown coordinate " 255 if(it->second.first.min() <= val && it->second.first.max() > val){
262 for(
unsigned int i=0; i < dcList.size(); i++){
283 p *= (it->second.first.max() - it->second.first.min());
299 if(0 == evtPtr)
return 0;
316 if(0 == evtPtr)
return 0;
341 cout <<
"DalitzBWArea::genValue: factor for variable " 343 <<
" s with mapping = " << evtPtr->
sij(mapping.
mapValues(c))
344 <<
" s with new mapping = " << evtPtr->
sij(c.
mapMe(mapping))
345 <<
", and without= " << evtPtr->
sij(c)
346 <<
" fct->generatingPDFValue with mapping " 356 if(dbThis) cout <<
" p = " << p << endl;
358 if(dbThis) cout <<
" returning p " << p << endl;
367 if(0 == evtPtr)
return 0;
369 cout <<
"ERROR in DalitzBWArea::genValue(const IDalitzEvent* evtPtr) const" 370 <<
" patterns don't match!" 371 <<
" compare: " <<
_pat <<
" and " 383 if(dbThis)cout <<
"DalitzBWArea::genValueRho: factor for variable " 385 <<
" s = " << evtPtr->
sij(c)
386 <<
" fct->generatingPDFValue " 390 if(dbThis) cout <<
" p = " << p << endl;
392 if(dbThis) cout <<
" returning p " << p << endl;
406 cout <<
"ERROR in DalitzBWArea::integral() can only make events" 407 <<
" with 3 or 4 daughters. You want : " <<
_pat 422 if(dbThis && 0 != evtPtr){
423 cout <<
" DalitzBWArea::makeEventForOwner() " 424 <<
" returning event with weight " 429 cout <<
"ERROR in DalitzBWArea::tryEventForOwner() can only make events" 430 <<
" with 3 or 4 daughters. You want : " <<
_pat 435 if(dbThis && 0 != evtPtr) cout <<
"Event before P-con " << *evtPtr << endl;
447 if(dbThis && 0 != evtPtr) cout <<
"Event after P-con " << *evtPtr << endl;
455 if(dbThis && 0 != evtPtr){
456 cout <<
"weight in DalitzBWArea::make3Event() " 471 if(dbThis && 0 != evtPtr){
472 cout <<
"weight in DalitzBWArea::make4Event() " 486 int nearInfinity = 100000000;
493 if(nTries > nearInfinity){
494 cout <<
"DalitzBWArea::makeEventWithPhaseSpace() " 495 <<
" giving up after " << nTries
496 <<
" unsuccessful tries." << endl;
499 }
while(0 == evtPtr ||
_rnd->Rndm()*maxW > evtPtr->
getWeight());
510 for(
int i=0; i < N; i++){
512 if(0 == evtPtr)
continue;
517 double mean = sum/((double)N);
518 double meansq = sumsq/((double)N);
519 double variance = (meansq - mean*mean)/((
double)N);
520 double sigma = sqrt(variance);
521 precision = sigma/mean;
526 double xmi=0, xma=0, ymi=0, yma=0;
528 xmi =
sf(1,2).second->getRhoMi();
529 xma =
sf(1,2).second->getRhoMa();
530 ymi =
sf(3,4).second->getRhoMi();
531 yma =
sf(3,4).second->getRhoMa();
533 xmi =
sf(1,2,3).second->getRhoMi();
534 xma =
sf(1,2,3).second->getRhoMa();
535 ymi =
sf(1,2).second->getRhoMi();
536 yma =
sf(1,2).second->getRhoMa();
539 double intArea = (xma - xmi)*(yma - ymi);
541 cout <<
"DalitzBWArea::MC4Integral() negative area? " 542 <<
"\n x: ( " << xma <<
" - " << xmi <<
") = " 544 <<
"\n y: ( " << yma <<
" - " << ymi <<
") = " 549 cout <<
"DalitzBWArea::MC4Integral: returning " 550 << mean <<
" * " << intArea << endl;
551 return mean * intArea;
560 for(
int i=0; i < N; i++){
562 if(0 == evtPtr)
continue;
567 double mean = sum/((double)N);
568 double meansq = sumsq/((double)N);
569 double variance = (meansq - mean*mean)/((
double)N);
570 prec = sqrt(variance)/mean;
572 double xmi=0, xma=0, ymi=0, yma=0;
574 xmi =
sf(1,2).second->getSMi();
575 xma =
sf(1,2).second->getSMa();
577 ymi =
sf(3,4).second->getSMi();
578 yma =
sf(3,4).second->getSMa();
581 xmi =
sf(1,2,3).second->getSMi();
582 xma =
sf(1,2,3).second->getSMa();
584 ymi =
sf(1,2).second->getSMi();
585 yma =
sf(1,2).second->getSMa();
592 intArea = (xma - xmi)*(yma - ymi);
594 intArea = (xma - xmi);
597 cout <<
"DalitzBWArea::MC4IntegralNoTransform() negative area? " 598 <<
"\n x: ( " << xma <<
" - " << xmi <<
") = " 600 <<
"\n y: ( " << yma <<
" - " << ymi <<
") = " 605 cout <<
"DalitzBWArea::MC4IntegralNoTransform: returning " 606 << mean <<
" * " << intArea << endl;
607 return mean * intArea;
613 cout <<
" DalitzBWArea::checkIntegration() Checking integration." 614 <<
"\n ResonanceConfigurationNumber " 616 <<
"\n Analytical: ";
618 cout <<
"DalitzBWArea::checkIntegration() only works for 4-body decays" 619 <<
" returning 0." << endl;
628 analytical = psi.
getVal();
632 analytical = psi.
getVal();
634 double prec_1=-9999, prec_2=-9999;
639 cout <<
"DalitzBWArea::checkIntegration(): Result:" 640 <<
"\n\t root's integral " << analytical
641 <<
"\n\t MC with trafo " << numerical_1
642 <<
" +/- " << prec_1 * numerical_1
643 <<
"\n\t MC w/o trafo " << numerical_2
644 <<
" +/- " << prec_2 * numerical_2
654 cout <<
"DalitzBWArea::integral4() called, although this pattern: " 657 <<
" I'll crash now." << endl;
658 throw "wrong integral4";
661 if(
sf(1,2).
second->flat() &&
sf(3,4).second->flat()){
662 cout <<
"check this integral: " << endl;
665 double vA = psiA.
getVal();
666 cout <<
" 12, 34: " << vA << endl;
669 double vB = psiB.
getVal();
670 cout <<
" 123, 12: " << vB << endl;
673 cout <<
" tested " << vC << endl;
674 cout <<
" check integrals: " 675 << vA <<
" , " << vB <<
" , " << vC << endl;
708 return sf(1,2).second->integral() *
sf(3,4).second->integral();
716 return sf(1,2,3).second->integral() *
sf(1,2).second->integral();
726 cout <<
"Don't know how to calculate integral3WithPhaseSpace() " 727 <<
"with option \"unWeightPs\" - please implement this." 728 <<
"\n I will crash now." 730 throw "no unweighted ps for 3-body, yet";
732 return sf(1,2).second->integral();
745 && (!
sf(3,4).second->flat())){
747 }
else if((!
sf(1,2).second->flat())
748 &&
sf(3,4).second->flat()
749 &&
sf(1,2,3).second->flat()){
751 }
else if(
sf(1,2).second->flat()
752 &&
sf(3,4).second->flat()
753 &&
sf(1,2,3).second->flat()){
780 cout <<
" trying to make event with phase space for " 787 static TLorentzVector mumsP4;
788 mumsP4.SetXYZM(0, 0, 0,
_pat[0].mass());
790 static vector<TLorentzVector> p4_final(5);
791 static vector<TLorentzVector> p4_finalMapped(5);
794 static TLorentzVector p4_inter[4];
808 if(dbThis) cout <<
" making s12, s34 configuration " << endl;
810 double rho12 =
sf(1,2).second->generateRho(
_rnd);
811 double s12 =
sf(1,2).second->coordTransformToS(rho12);
813 if(
s12 < 0)
return nullEvtPtr;
814 double m12 = sqrt(
s12);
815 if(m12 <
_pat[1].mass() +
_pat[2].mass())
return nullEvtPtr;
817 double rho34 =
sf(3,4).second->generateRho(
_rnd);
818 double s34 =
sf(3,4).second->coordTransformToS(rho34);
820 if(
s34 < 0)
return nullEvtPtr;
821 double m34 = sqrt(
s34);
822 if(m34 <
_pat[3].mass() +
_pat[4].mass())
return nullEvtPtr;
823 if(m12 + m34 >
_pat[0].mass())
return nullEvtPtr;
825 double s12Min =
sf(1,2).second->getCoordinate().min();
826 double s12Max =
sf(1,2).second->getCoordinate().max();
827 double s34Min =
sf(3,4).second->getCoordinate().min();
828 double s34Max =
sf(3,4).second->getCoordinate().max();
834 double fct_12Max = 1;
835 double fct_34Max = 1;
837 maxWeight *= fct_12Max;
838 maxWeight *= fct_34Max;
846 mumsP4.SetXYZM(0, 0, 0,
_pat[0].mass());
847 p4_final[0] = mumsP4;
849 if(! gps.SetDecay(mumsP4, 2, dgt))
return nullEvtPtr;
859 p4_inter[0] = *(gps.GetDecay(0));
860 p4_inter[1] = *(gps.GetDecay(1));
868 if(ps1 <=0 )
return nullEvtPtr;
871 dgt[0] =
_pat[1].mass();
872 dgt[1] =
_pat[2].mass();
873 if(! gps.SetDecay(p4_inter[0], 2, dgt))
return nullEvtPtr;
875 p4_final[1] = *(gps.GetDecay(0));
876 p4_final[2] = *(gps.GetDecay(1));
885 if(ps2 <=0)
return nullEvtPtr;
888 dgt[0] =
_pat[3].mass();
889 dgt[1] =
_pat[4].mass();
890 if(! gps.SetDecay(p4_inter[1], 2, dgt))
return nullEvtPtr;
892 p4_final[3] = *(gps.GetDecay(0));
893 p4_final[4] = *(gps.GetDecay(1));
902 if(ps3 <= 0)
return nullEvtPtr;
904 double ps = ps1 * ps2 * ps3;
906 double w = fct_12 * fct_34 * ps;
908 mapP4(p4_final, mapping, p4_finalMapped);
913 cout <<
"WARNING in DalitzBWArea::try4EventWithPhaseSpace (0):" 914 <<
"\n made 'good' event with bad phase space " 916 <<
"\n" << *thisEvent
918 for(
int i=0; i <= 4; i++) cout << thisEvent->
p(i).M() <<
", ";
919 cout <<
"\n should be; \n";
920 for(
int i=0; i <= 4; i++) cout <<
_pat[i].mass() <<
", ";
921 cout <<
"\n momentum sum ";
922 TLorentzVector psum(.0,.0,.0,.0);
923 for(
int i=1; i <=4; i++) psum += thisEvent->
p(i);
925 cout <<
"\n ps1 " << ps1 <<
", ps2 " << ps2 <<
", ps3 " << ps3
931 returnEvent = thisEvent;
933 if(dbThis) cout <<
" making s123, s12 configuration " << endl;
936 double rho123 =
sf(1,2,3).second->generateRho(
_rnd);
937 double s123 =
sf(1,2,3).second->coordTransformToS(rho123);
938 if(s123 < 0)
return nullEvtPtr;
939 double m123 = sqrt(s123);
940 if(m123 +
_pat[4].mass() >
_pat[0].mass())
return nullEvtPtr;
941 if(m123 <
_pat[1].mass() +
_pat[2].mass() +
_pat[3].mass()){
945 double rho12 =
sf(1,2).second->generateRho(
_rnd);
946 double s12 =
sf(1,2).second->coordTransformToS(rho12);
947 if(
s12 < 0)
return nullEvtPtr;
948 double m12 = sqrt(
s12);
949 if(m12 +
_pat[3].mass() > m123)
return nullEvtPtr;
950 if(m12 +
_pat[3].mass() +
_pat[4].mass() >
_pat[0].mass() ){
953 if(m12 <
_pat[1].mass() +
_pat[2].mass())
return nullEvtPtr;
955 double s123Min =
sf(1,2,3).second->getCoordinate().min();
956 double s123Max =
sf(1,2,3).second->getCoordinate().max();
957 double s12Min =
sf(1,2).second->getCoordinate().min();
958 double s12Max =
sf(1,2).second->getCoordinate().max();
965 double fct_123Max = 1;
966 double fct_12Max = 1;
968 maxWeight *= fct_123Max;
969 maxWeight *= fct_12Max;
974 dgt[1] =
_pat[4].mass();
975 mumsP4.SetXYZM(0, 0, 0,
_pat[0].mass());
976 p4_final[0] = mumsP4;
978 if(! gps.SetDecay(mumsP4, 2, dgt))
return nullEvtPtr;
980 p4_inter[0] = *(gps.GetDecay(0));
981 p4_final[4] = *(gps.GetDecay(1));
990 if(ps1 <=0)
return nullEvtPtr;
993 dgt[1] =
_pat[3].mass();
994 if(! gps.SetDecay(p4_inter[0], 2, dgt))
return nullEvtPtr;
996 p4_inter[1] = *(gps.GetDecay(0));
997 p4_final[3] = *(gps.GetDecay(1));
1005 if(ps2 <=0)
return nullEvtPtr;
1008 dgt[0] =
_pat[1].mass();
1009 dgt[1] =
_pat[2].mass();
1010 if(! gps.SetDecay(p4_inter[1], 2, dgt))
return nullEvtPtr;
1012 p4_final[1] = *(gps.GetDecay(0));
1013 p4_final[2] = *(gps.GetDecay(1));
1022 if(ps3 <=0)
return nullEvtPtr;
1024 double ps = ps1 * ps2 * ps3;
1026 double w = fct_123 * fct_12 * ps;
1028 mapP4(p4_final, mapping, p4_finalMapped);
1033 cout <<
"WARNING in DalitzBWArea::try4EventWithPhaseSpace (2): " 1034 <<
" made 'good' event with bad phase space" 1035 <<
" for sqrt(s123) " << sqrt(s123) <<
" = " << m123
1036 <<
" , sqrt(s12) " << sqrt(
s12) <<
" = " << m12
1037 <<
" , sqrt(s12) + m3 " << sqrt(
s12) +
_pat[3].mass()
1038 <<
" , sqrt(s123) + m4 " << sqrt(s123) +
_pat[4].mass()
1039 <<
" and m(D) " <<
_pat[0].mass()
1041 cout <<
" compare " << s123 <<
", " << thisEvent->
t(4,0)
1042 <<
" compare " <<
s12 <<
", " << thisEvent->
s(1,2)
1044 cout <<
"compare mapping: " << endl;
1045 for(
unsigned int i=0; i < p4_final.size() && i < p4_finalMapped.size(); i++){
1046 cout <<
"premapping " << p4_final[i] <<
" post: " << p4_finalMapped[i] << endl;
1051 returnEvent = thisEvent;
1053 if(dbThis)cout <<
" got new event with weight " 1065 cout <<
" trying to make event with phase space for " 1071 TLorentzVector mumsP4;
1072 mumsP4.SetXYZM(0, 0, 0,
_pat[0].mass());
1074 static vector<TLorentzVector> p4_final(5), p4_finalMapped(5);
1075 static TLorentzVector p4_inter[4];
1089 if(dbThis) cout <<
" making s12, s34 configuration " << endl;
1091 double s12Min =
sf(1,2).second->getCoordinate().min();
1092 double s12Max =
sf(1,2).second->getCoordinate().max();
1093 double s34Min =
sf(3,4).second->getCoordinate().min();
1094 double s34Max =
sf(3,4).second->getCoordinate().max();
1096 double s12 = s12Min +
_rnd->Rndm()*(s12Max - s12Min);
1098 if(
s12 < 0)
return nullEvtPtr;
1099 if(sqrt(
s12) <
_pat[1].mass() +
_pat[2].mass())
return nullEvtPtr;
1101 double s34 = s34Min +
_rnd->Rndm()*(s34Max - s34Min);
1103 if(
s34 < 0)
return nullEvtPtr;
1104 if(sqrt(
s34) <
_pat[3].mass() +
_pat[4].mass())
return nullEvtPtr;
1105 if(sqrt(
s12) + sqrt(
s34) >
_pat[0].mass())
return nullEvtPtr;
1110 double fct_12Max = 1;
1111 double fct_34Max = 1;
1113 maxWeight *= fct_12Max;
1114 maxWeight *= fct_34Max;
1122 mumsP4.SetXYZM(0, 0, 0,
_pat[0].mass());
1123 p4_final[0] = mumsP4;
1125 if(! gps.SetDecay(mumsP4, 2, dgt))
return nullEvtPtr;
1135 p4_inter[0] = *(gps.GetDecay(0));
1136 p4_inter[1] = *(gps.GetDecay(1));
1144 if(ps1 <=0 )
return nullEvtPtr;
1147 dgt[0] =
_pat[1].mass();
1148 dgt[1] =
_pat[2].mass();
1149 if(! gps.SetDecay(p4_inter[0], 2, dgt))
return nullEvtPtr;
1151 p4_final[1] = *(gps.GetDecay(0));
1152 p4_final[2] = *(gps.GetDecay(1));
1161 if(ps2 <=0)
return nullEvtPtr;
1164 dgt[0] =
_pat[3].mass();
1165 dgt[1] =
_pat[4].mass();
1166 if(! gps.SetDecay(p4_inter[1], 2, dgt))
return nullEvtPtr;
1168 p4_final[3] = *(gps.GetDecay(0));
1169 p4_final[4] = *(gps.GetDecay(1));
1178 if(ps3 <= 0)
return nullEvtPtr;
1180 double ps = ps1 * ps2 * ps3;
1182 double w = fct_12 * fct_34 * ps;
1184 mapP4(p4_final, mapping, p4_finalMapped);
1188 cout <<
"WARNING in tryFlat4EventWithPhaseSpace: " 1189 <<
" made 'good' event with bad phase space" 1194 returnEvent = thisEvent;
1196 if(dbThis) cout <<
" making s123, s12 configuration " << endl;
1198 double s123Min =
sf(1,2,3).second->getCoordinate().min();
1199 double s123Max =
sf(1,2,3).second->getCoordinate().max();
1200 double s12Min =
sf(1,2).second->getCoordinate().min();
1201 double s12Max =
sf(1,2).second->getCoordinate().max();
1203 double s123 = s123Min +
_rnd->Rndm()*(s123Max - s123Min);
1205 if(s123 < 0)
return nullEvtPtr;
1206 if(sqrt(s123) +
_pat[4].mass() >
_pat[0].mass())
return nullEvtPtr;
1208 _pat[1].mass() +
_pat[2].mass() +
_pat[3].mass())
return nullEvtPtr;
1211 double s12 = s12Min +
_rnd->Rndm()*(s12Max - s12Min);
1213 if(
s12 < 0)
return nullEvtPtr;
1214 if(sqrt(
s12) +
_pat[3].mass() > sqrt(s123))
return nullEvtPtr;
1215 if(sqrt(
s12) +
_pat[3].mass() +
_pat[4].mass() >
_pat[0].mass() )
return nullEvtPtr;
1216 if(sqrt(
s12) <
_pat[1].mass() +
_pat[2].mass())
return nullEvtPtr;
1224 double fct_123Max = 1;
1225 double fct_12Max = 1;
1227 maxWeight *= fct_123Max;
1228 maxWeight *= fct_12Max;
1232 dgt[0] = sqrt(s123);
1233 dgt[1] =
_pat[4].mass();
1234 mumsP4.SetXYZM(0, 0, 0,
_pat[0].mass());
1235 p4_final[0] = mumsP4;
1237 if(! gps.SetDecay(mumsP4, 2, dgt))
return nullEvtPtr;
1239 p4_inter[0] = *(gps.GetDecay(0));
1240 p4_final[4] = *(gps.GetDecay(1));
1249 if(ps1 <=0)
return nullEvtPtr;
1252 dgt[1] =
_pat[3].mass();
1253 if(! gps.SetDecay(p4_inter[0], 2, dgt))
return nullEvtPtr;
1255 p4_inter[1] = *(gps.GetDecay(0));
1256 p4_final[3] = *(gps.GetDecay(1));
1264 if(ps2 <=0)
return nullEvtPtr;
1267 dgt[0] =
_pat[1].mass();
1268 dgt[1] =
_pat[2].mass();
1269 if(! gps.SetDecay(p4_inter[1], 2, dgt))
return nullEvtPtr;
1271 p4_final[1] = *(gps.GetDecay(0));
1272 p4_final[2] = *(gps.GetDecay(1));
1281 if(ps3 <=0)
return nullEvtPtr;
1283 double ps = ps1 * ps2 * ps3;
1285 double w = fct_123 * fct_12 * ps;
1287 mapP4(p4_final, mapping, p4_finalMapped);
1292 cout <<
"Warning in tryFlat4EventWithPhaseSpace " 1293 <<
" made 'good' event with bad phase space" 1294 <<
" for sqrt(s123) " << sqrt(s123)
1295 <<
" , sqrt(s12) " << sqrt(
s12)
1296 <<
" , sqrt(s12) + m3 " << sqrt(
s12) +
_pat[3].mass()
1297 <<
" , sqrt(s123) + m4 " << sqrt(s123) +
_pat[4].mass()
1298 <<
" and m(D) " <<
_pat[0].mass()
1300 cout <<
" compare " << s123 <<
", " << thisEvent->
t(4,0)
1301 <<
" compare " <<
s12 <<
", " << thisEvent->
s(1,2)
1306 returnEvent = thisEvent;
1308 if(dbThis)cout <<
" got new event with weight " << returnEvent->
getWeight() << endl;
1322 cout <<
" trying to make event with phase space for " 1329 TLorentzVector mumsP4;
1330 mumsP4.SetXYZM(0, 0, 0,
_pat[0].mass());
1332 static vector<TLorentzVector> p4_final(4), p4_finalMapped(4);
1333 static TLorentzVector p4_inter[1];
1344 double s12 =
sf(1,2).second->generate(
_rnd);
1345 if(
s12 < 0)
return nullEvtPtr;
1346 if(sqrt(
s12) <
_pat[1].mass() +
_pat[2].mass())
return nullEvtPtr;
1348 if(sqrt(
s12) +
_pat[3].mass() >
_pat[0].mass())
return nullEvtPtr;
1351 cout <<
"made s12 " <<
s12 << endl;
1353 double s12Min =
sf(1,2).second->getCoordinate().min();
1354 double s12Max =
sf(1,2).second->getCoordinate().max();
1361 dgt[1] =
_pat[3].mass();
1362 mumsP4.SetXYZM(0, 0, 0,
_pat[0].mass());
1363 p4_final[0] = mumsP4;
1365 if(! gps.SetDecay(mumsP4, 2, dgt))
return nullEvtPtr;
1367 cout <<
" set decay to " << mumsP4 <<
" -> " 1368 << dgt[0] <<
", " << dgt[1]
1380 p4_inter[0] = *(gps.GetDecay(0));
1381 p4_final[3] = *(gps.GetDecay(1));
1391 dgt[0] =
_pat[1].mass();
1392 dgt[1] =
_pat[2].mass();
1393 if(! gps.SetDecay(p4_inter[0], 2, dgt))
return nullEvtPtr;
1395 cout <<
" set decay to " << p4_inter[0] <<
" -> " 1396 << dgt[0] <<
", " << dgt[1]
1400 p4_final[1] = *(gps.GetDecay(0));
1401 p4_final[2] = *(gps.GetDecay(1));
1410 mapP4(p4_final, mapping, p4_finalMapped);
1415 cout <<
"WARNING in try3EventWithPhaseSpace: " 1416 <<
" made 'good' event with bad phase space" 1417 <<
" , sqrt(s12) " << sqrt(
s12)
1418 <<
" , sqrt(s12) + m3 " << sqrt(
s12) +
_pat[3].mass()
1419 <<
" and m(D) " <<
_pat[0].mass()
1421 cout <<
" compare " <<
s12 <<
", " << thisEvent->
s(1,2)
1426 returnEvent = thisEvent;
1428 cout <<
" got new event with weight " 1435 os <<
"Area size: " <<
size() << endl;
1441 os <<
"\n " << it->second.first;
std::map< DalitzCoordKey, std::pair< DalitzCoordinate, MINT::counted_ptr< IGenFct > > > _mappedCoords
virtual void setWeight(double w)
double sijMax(const MINT::PolymorphVector< int > &indices) const
void print(std::ostream &os=std::cout) const
std::pair< DalitzCoordinate, MINT::counted_ptr< IGenFct > > & sf(const DalitzCoordinate &c)
MINT::counted_ptr< IGenFct > f_t40()
MINT::counted_ptr< IGenFct > f_s23()
virtual double sij(const std::vector< int > &indices) const
virtual double generatingFctValue(double sij) const =0
double MC4IntegralNoTransform(double &prec) const
std::ostream & operator<<(std::ostream &os, const DalitzBWArea &da)
virtual void setLimits(double sMin, double sMax)=0
virtual double phaseSpace() const
virtual void P_conjugateYourself()
virtual const DalitzEventPattern & eventPattern() const
virtual double transformedFctValue(double rho) const
MINT::counted_ptr< DalitzEvent > try3Event(const Permutation &mapping=Permutation::unity()) const
MINT::counted_ptr< IGenFct > f_t01()
double genValueRho(const IDalitzEvent *evtPtr) const
virtual double sij(const MINT::PolymorphVector< int > &indices) const =0
MINT::counted_ptr< DalitzEvent > tryEventForOwner(const Permutation &mapping=Permutation::unity()) const
double phaseSpaceIntegral2body(double mum, double d1, double d2)
void setRandom(TRandom *rnd=gRandom)
bool setRnd(TRandom *rnd=gRandom)
void setFcn(const DalitzCoordinate &c, const MINT::counted_ptr< IGenFct > &fcn)
MINT::counted_ptr< IGenFct > f_s12()
double MC4Integral(double &prec) const
DalitzBWArea & operator=(const DalitzBWArea &other)
std::vector< TLorentzVector > & mapP4(const std::vector< TLorentzVector > &v_in, const Permutation &mapping, std::vector< TLorentzVector > &v_out) const
double sijMin(const MINT::PolymorphVector< int > &indices) const
virtual double getWeight() const
DalitzCoordinate mapMe(const Permutation &perm) const
bool checkIntegration() const
void makeCoord(int i, int j)
static const double second
virtual const DalitzEventPattern & eventPattern() const =0
virtual const TLorentzVector & p(unsigned int i) const
MINT::counted_ptr< DalitzEvent > try3EventWithPhaseSpace(double &maxWeight, const Permutation &mapping=Permutation::unity()) const
double genValue(const IDalitzEvent *evtPtr) const
const DalitzCoordKey & myKey() const
unsigned int size() const
MINT::counted_ptr< IGenFct > f_s34()
virtual double t(unsigned int i, unsigned int j) const
void setPattern(const DalitzEventPattern &pat)
virtual double coordTransformFromS(double s) const
virtual double s(unsigned int i, unsigned int j) const
std::map< DalitzCoordKey, std::pair< DalitzCoordinate, MINT::counted_ptr< IGenFct > > > _coords
MINT::counted_ptr< DalitzEvent > try4EventWithPhaseSpace(double &maxWeight, const Permutation &mapping=Permutation::unity()) const
double showPhaseSpaceFactorCalculation()
int ResonanceConfigurationNumber() const
double getVal(const DalitzEventPattern &_pat)
Calculate4BodyProps makeCalculate4BodyProps() const
double phaseSpaceFactor()
MINT::counted_ptr< DalitzEvent > try4Event(const Permutation &mapping=Permutation::unity()) const
bool isInside(const DalitzEvent &evt) const
void setMinMax(double min, double max)
std::vector< int > & mapValues(const std::vector< int > &in, std::vector< int > &out) const
std::vector< T > & mapOrder(const std::vector< T > &in, std::vector< T > &out) const
MINT::counted_ptr< DalitzEvent > tryFlat4EventWithPhaseSpace(double &maxWeight, const Permutation &mapping=Permutation::unity()) const
MINT::counted_ptr< DalitzEvent > make4EventWithPhaseSpace(const Permutation &mapping=Permutation::unity()) const