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);
911 if(thisEvent->makeCalculate4BodyProps().phaseSpaceFactor() <= 0.0){
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
930 thisEvent->setWeight(w);
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);
1032 if(thisEvent->makeCalculate4BodyProps().phaseSpaceFactor() <= 0.0){
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;
1050 thisEvent->setWeight(w);
1051 returnEvent = thisEvent;
1053 if(dbThis)cout <<
" got new event with weight " 1054 << returnEvent->getWeight() << endl;
std::pair< DalitzCoordinate, MINT::counted_ptr< IGenFct > > & sf(const DalitzCoordinate &c)
double phaseSpaceIntegral2body(double mum, double d1, double d2)
std::vector< TLorentzVector > & mapP4(const std::vector< TLorentzVector > &v_in, const Permutation &mapping, std::vector< TLorentzVector > &v_out) const
double showPhaseSpaceFactorCalculation()
int ResonanceConfigurationNumber() const
std::vector< T > & mapOrder(const std::vector< T > &in, std::vector< T > &out) const