13 #include "TGenPhaseSpace.h" 14 #include "TMatrixDSym.h" 30 return _rememberVectorCounter++;
34 : _rememberPhaseSpace(-9999.)
37 , _generatorPdfRelativeToPhaseSpace(1)
40 , _permutationIndex(0)
46 ,
const std::vector<TLorentzVector>& mumAndDgtrs_p4
49 , _rememberPhaseSpace(-9999.)
52 , _generatorPdfRelativeToPhaseSpace(1)
57 , _permutationIndex(0)
68 ,
double s12_in,
double s23_in,
double s34_in
72 , _rememberPhaseSpace(-9999.)
75 , _generatorPdfRelativeToPhaseSpace(1)
80 , _permutationIndex(0)
86 cout <<
"DalitzEvent::DalitzEvent ERROR " 87 <<
" event pattern " << pat
88 <<
" doesn't fit 4-body constructor" 100 std::vector<TLorentzVector> p4List(5);
102 for(
int i=0; i<=4; i++){
103 p4List[i] = c4bp.
pVec(i);
104 if(dbThis)cout <<
"p4List[" << i <<
"] " << p4List[i] << endl;
107 for(
int i=0; i<=4; i++){
108 TLorentzVector p4(-9999, -9999, -9999, -9999);
117 cout <<
"constructed event from this pattern: " <<
_pat <<
"\n and " 118 << t01_in <<
", " << s12_in <<
", " << s23_in <<
", " << s34_in <<
", " << t40_in
121 cout <<
" and got out: " 130 const double s13,
const double s23
133 , _rememberPhaseSpace(-9999.)
136 , _generatorPdfRelativeToPhaseSpace(1)
141 , _permutationIndex(0)
147 cout <<
"DalitzEvent::DalitzEvent ERROR " 148 <<
" event pattern " << pat
149 <<
" doesn't fit 4-body constructor" 151 throw "shit happens";
154 double m0 = pat[0].mass() ;
155 double m1 = pat[1].mass() ;
156 double m2 = pat[2].mass() ;
157 double m3 = pat[3].mass() ;
160 double E1 = ( m0 * m0 + m1 * m1 - s23 ) / (2 * m0) ;
161 double E2 = ( m0 * m0 +
m2 *
m2 - s13 ) / (2 * m0) ;
164 double E3 = m0 - E1 - E2 ;
167 double pz1Sq = E1 * E1 - m1 * m1 ;
169 cout <<
"Invalid phase space point for the given pattern (s13, s23) = (" 170 << s13 <<
", " << s23 <<
")" << endl ;
171 throw out_of_range(
"") ;
175 double pz1 = sqrt(pz1Sq) ;
178 double pz3 = ( E2 * E2 -
m2 *
m2 - E3 * E3 +
m3 *
m3 - pz1 * pz1 ) / ( 2*pz1 ) ;
181 double py3Sq = E3 * E3 -
m3 *
m3 - pz3 * pz3 ;
185 cout <<
"Invalid phase space point for the given pattern (s13, s23) = (" 186 << s13 <<
", " << s23 <<
")" << endl ;
187 throw out_of_range(
"") ;
190 double py3 = sqrt(py3Sq) ;
192 double py2 = -1 * py3 ;
193 double pz2 = -1 * (pz1 + pz3) ;
194 std::vector<TLorentzVector> p4List(4, TLorentzVector(0, 0, 0, m0));
195 p4List[1] = TLorentzVector(0., 0., pz1, E1) ;
196 p4List[2] = TLorentzVector(0., py2, pz2, E2) ;
197 p4List[3] = TLorentzVector(0., py3, pz3, E3) ;
204 cout <<
"Event not kinematically allowed! Was given (s13, s23) = (" 205 << s13 <<
", " << s23 <<
"), got (" <<
s_intern(1, 3) <<
", " 207 throw out_of_range(
"") ;
213 ,
const std::vector<TVector3>& mumAndDgtrs_p3
216 , _rememberPhaseSpace(-9999.)
219 , _generatorPdfRelativeToPhaseSpace(1)
224 , _permutationIndex(0)
234 , _rememberPhaseSpace(-9999.)
237 , _generatorPdfRelativeToPhaseSpace(1)
242 , _permutationIndex(0)
253 , _rememberPhaseSpace(-9999.)
256 , _generatorPdfRelativeToPhaseSpace(1)
261 , _permutationIndex(0)
271 : _pat(other->eventPattern())
274 , _rememberComplexFast()
275 , _rememberDoubleFast()
276 , _aValue(other->getAValue())
278 , _generatorPdfRelativeToPhaseSpace(other->getGeneratorPdfRelativeToPhaseSpace())
279 , _vectorOfValues(other->getVectorOfValues())
280 , _vectorOfWeights(other->getVectorOfWeights())
283 , _permutationIndex(0)
284 , _perm(other->eventPattern())
288 for(
int i=0; i < np; i++)
_p[i] = other->
p(i);
294 : _pat(other.eventPattern())
296 , _rememberComplexFast()
297 , _rememberDoubleFast()
298 , _aValue(other.getAValue())
300 , _generatorPdfRelativeToPhaseSpace(other.getGeneratorPdfRelativeToPhaseSpace())
301 , _vectorOfValues(other.getVectorOfValues())
302 , _vectorOfWeights(other.getVectorOfWeights())
303 , _permutationIndex(0)
304 , _perm(other.eventPattern())
308 for(
int i=0; i < np; i++)
_p[i] = other.
p(i);
319 , _rememberPhaseSpace(other->_rememberPhaseSpace)
320 , _rememberComplexFast(other->_rememberComplexFast)
321 , _rememberDoubleFast(other->_rememberDoubleFast)
322 , _aValue(other->_aValue)
323 , _weight(other->_weight)
324 , _generatorPdfRelativeToPhaseSpace(other->_generatorPdfRelativeToPhaseSpace)
325 , _vectorOfValues(other->_vectorOfValues)
326 , _vectorOfWeights(other->_vectorOfWeights)
329 , _sijMap(other->_sijMap)
330 , _permutationIndex(other->_permutationIndex)
331 , _perm(other->_perm)
334 if(dbThis) cout <<
" copy constructor of DalitzEvent called." 335 <<
" weight before " << other->
getWeight()
344 , _rememberPhaseSpace(other._rememberPhaseSpace)
345 , _rememberComplexFast(other._rememberComplexFast)
346 , _rememberDoubleFast(other._rememberDoubleFast)
347 , _aValue(other._aValue)
348 , _weight(other._weight)
349 , _generatorPdfRelativeToPhaseSpace(other._generatorPdfRelativeToPhaseSpace)
350 , _vectorOfValues(other._vectorOfValues)
351 , _vectorOfWeights(other._vectorOfWeights)
354 , _sijMap(other._sijMap)
355 , _permutationIndex(other._permutationIndex)
359 if(dbThis) cout <<
" copy constructor of DalitzEvent called." 360 <<
" weight before " << other.
getWeight()
366 : _rememberPhaseSpace(-9999.)
369 , _generatorPdfRelativeToPhaseSpace(1)
372 , _permutationIndex(0)
375 cout <<
"ERROR in DalitzEvent constructor from ntuple" 376 <<
" something went wrong!" 436 cout <<
"ERROR in DalitzEvent::m(unsigned int i)" 437 <<
" index i= " << i <<
" out of range!" 438 <<
" allowed range: [0," <<
_pat.
size()-1 <<
"]" 439 <<
" returning -9999" 443 return _pat[i].mass();
447 cout <<
"ERROR in DalitzEvent::m2(unsigned int i)" 448 <<
" index i= " << i <<
" out of range!" 449 <<
" allowed range: [0," <<
_pat.
size()-1 <<
"]" 450 <<
" returning -9999" 458 TLorentzVector pd(0.0, 0.0, 0.0, 0.0);
460 for(
unsigned int i=1; i<
_p.size(); i++){
474 for(
unsigned int i=0; i<4; i++){
475 diffsum += pdiff[i]*pdiff[i];
476 sumsum += psum[i] *psum[i];
478 double avsum = sumsum/2.0;
480 if(diffsum > epsilon*epsilon * avsum){
482 cout <<
"DalitzEvent::kinematicallyAllowed? " 483 <<
" failing diffsum: " << diffsum
484 <<
" max allowed: " << epsilon*epsilon*avsum << endl;
489 for(
unsigned int i = 0; i<
_pat.
size(); i++){
490 double mreco =
p(i).M();
492 if(dbThis) cout <<
"failing mreco " << mreco <<
" < 0" << endl;
495 double avmass = (mreco +
m(i))/2.0;
496 if( fabs(mreco -
m(i)) > epsilon*avmass ){
498 cout <<
" failing mreco - m(i) fabs(" 499 << mreco <<
" - " <<
m(i) <<
") = " 500 << fabs(mreco -
m(i)) <<
" > " << epsilon*avmass
516 cout <<
"ERROR in DalitzEvent::phaseSpace: inconsistency!" 517 <<
" pattern array size != momentum array size" 519 <<
". returning -9999" 532 }
else if(
nDgtr() == 4){
536 cout <<
"ERROR in DalitzEvent::phaseSpace inconsistency!" 537 <<
"\n > Sorry, don't know how to calculate phase-space" 538 <<
" factor for nDgtr = " <<
nDgtr()
539 <<
"\n > - can only do up to nDgtr <= 4" 540 <<
". returning -9999" 556 if(dbthis) cout <<
"got called" << endl;
557 TRandom* remember_gRandom = gRandom;
558 bool needToReset_gRandom=
false;
560 needToReset_gRandom=
true;
564 if(dbthis) cout <<
"got so far" << endl;
570 TLorentzVector mumsP4;
571 mumsP4.SetXYZM(mumsp3.X()
576 Double_t* mdgt =
new Double_t[
nDgtr()];
577 if(dbthis) cout <<
"booked " <<
nDgtr() <<
" daughters " << endl;
578 for(
int i=1; i<=
nDgtr(); i++){
579 mdgt[i-1] = this->
m(i);
582 gps.SetDecay(mumsP4,
nDgtr() , mdgt);
583 double maxWeight = 1.0;
585 if(dbthis) cout <<
" maxWeight " << maxWeight << endl;
588 weight=gps.Generate();
589 }
while(weight < gRandom->Rndm() * maxWeight);
593 if(needToReset_gRandom){
594 gRandom = remember_gRandom;
596 if(weight > maxWeight){
597 cout <<
"ERROR in DalitzEvent::generateThisToPhaseSpace" 598 <<
" weight = " << weight <<
" > " << maxWeight <<
" = maxWeight" 599 <<
"\n > this is a programming error that needs to be fixed." 601 throw "...so I got maxWeight wrong.";
603 if(dbthis) cout <<
" this weight " << weight << endl;
604 if(dbthis) cout <<
" max weight " << gps.GetWtMax() << endl;
607 if(dbthis) cout <<
"generated event" << endl;
609 if(dbthis)cout <<
"set p0" << endl;
610 for(
unsigned int i=1; i<
_pat.
size(); i++){
611 if(dbthis)cout <<
"setting P (" << i <<
") " 612 << (*(gps.GetDecay(i-1)))
614 setP(i, (*(gps.GetDecay(i-1))));
615 if(dbthis)cout <<
" and look what I've set: " <<
p(i) << endl;
625 cout <<
"in TLorentzVector& DalitzEvent::p(unsigned int i):" 626 <<
" index out of range. DalitzEventPattern:" 628 <<
"\n > num mother + daughters = " <<
_p.size()
630 throw "index out or range in TLorentzVector& DalitzEvent::p(unsigned int i)";
637 cout <<
"in TLorentzVector& DalitzEvent::p(unsigned int i):" 638 <<
" index out of range. DalitzEventPattern:" 640 <<
"\n > num mother + daughters = " <<
_p.size()
642 throw "index out or range in TLorentzVector& DalitzEvent::p(unsigned int i)";
656 bool successFlag=
false;
658 , (
double) 0, successFlag);
661 _sijMap[intern_indices] = returnVal;
666 vector<int> intern_indices(indices);
667 for(
unsigned int i=0; i < intern_indices.size(); i++){
676 cout <<
"p(" << i <<
") called. Current permutation: " 685 cout <<
"p(" << i <<
") called. Current permutation: " 700 intern_indices)
const{
701 TLorentzVector psum(0.0, 0.0, 0.0, 0.0);
702 for(
unsigned int i=0; i< intern_indices.size(); i++){
704 psum +=
p_intern(intern_indices[i]);
712 if(1 == indices.size()){
713 return p(indices[0]).Mag2();
714 }
else if(2 == indices.size()){
715 return s(indices[0], indices[1]);
718 TLorentzVector psum(0.0, 0.0, 0.0, 0.0);
719 for(
unsigned int i=0; i< indices.size(); i++){
721 psum +=
p(indices[i]);
723 cout <<
"DalitzEvent sij: compare " << psum.Mag2()
724 <<
" = " <<
sijMap(indices) << endl;
738 TLorentzVector newMum4;
739 newMum4.SetXYZM(mp3.X(), mp3.Y(), mp3.Z(),
_p[0].M());
741 TVector3 boostToOldMumsRest(-
_p[0].BoostVector());
742 TVector3 boostToNewMumsLab(newMum4.BoostVector());
743 for(
unsigned int i=0; i <
_p.size(); i++){
744 _p[i].Boost(boostToOldMumsRest);
745 _p[i].Boost(boostToNewMumsLab);
753 cout <<
"ERROR in DalitzEvent::makeCalculate4BodyProps()" 754 <<
"\n > You can't expect a sensible Calculate4BodyProps" 755 <<
" Object for a " <<
nDgtr() <<
" body decay!" 760 ,
m(0),
m(1),
m(2),
m(3),
m(4)
765 os <<
"Dalitz event for pattern " 767 for(
unsigned int i=0; i<
_p.size(); i++){
768 cout <<
"\n\t p(" << i <<
") " <<
p(i);
771 for(
unsigned int i=0; i<
_p.size(); i++){
772 cout <<
m(i) <<
" ; ";
776 <<
t(0,1) <<
", " <<
s(1,2) <<
", " <<
s(2,3)
777 <<
", " <<
s(3,4) <<
", " <<
t(4, 0);
780 os <<
"\t weight = " << this->
getWeight();
788 cout <<
"FATAL ERROR in DalitzEvent:" 789 <<
"\n > pattern: \"" <<
_pat <<
"\"" 790 <<
"\n > 4-vector list size: " <<
_p.size()
792 throw "probably insonsistent pattern in DalitzEvent";
799 if(
_p.empty())
return;
800 TVector3 mums3Momentum(
_p[0].X(),
_p[0].Y(),
_p[0].Z());
801 for(
unsigned int i=0; i <
_p.size(); i++){
802 _p[i].SetX( -
_p[i].X() );
803 _p[i].SetY( -
_p[i].Y() );
804 _p[i].SetZ( -
_p[i].Z() );
820 for(
unsigned int i=0; i<
_s.size(); i++){
823 for(
unsigned int j=0; j<
_s[i].size(); j++){
829 for(
unsigned int i=0; i<
_t.size(); i++){
832 for(
unsigned int j=0; j<
_t[i].size(); j++){
852 _p.resize(p4List.size());
853 for(
unsigned int i=0; i<p4List.size(); i++){
862 _p.resize(p3List.size());
866 for(
unsigned int i=0; i<
_pat.
size(); i++){
867 const TVector3& p3 = p3List[i];
868 double m =
_pat[i].mass();
869 _p[i].SetXYZM(p3.X(), p3.Y(), p3.Z(),
m);
892 cout <<
"ERROR in DalitzEvent::BDet(): nDgtr() = " 893 <<
nDgtr() <<
" < 4. How did this happen?" 900 B(1,0)=B(0,1)=
m2(2); B(1,1) = 0;
901 B(2,0)=B(0,2)=
s(2,3) ; B(2,1)=B(1,2) =
m2(3); B(2,2)=0;
902 B(3,0)=B(0,3)=
t(0,1) ; B(3,1)=B(1,3) =
s(3,4) ; B(3,2)=B(2,3)=
m2(4); B(3,3)=0;
903 B(4,0)=B(0,4)=
m2(1); B(4,1)=B(1,4) =
s(1,2) ; B(4,2)=B(2,4)=
t(4,0) ; B(4,3)=B(3,4)=
m2(0); B(4,4)=0;
904 B(5,0)=B(0,5)=B(5,1)=B(1,5)=B(5,2)=B(2,5)=B(5,3)=B(3,5)=B(5,4)=B(4,5)=1;
912 return B.Determinant();
919 if(dbThis)cout <<
"\n\n called phaseSpace4() " << endl;
921 cout <<
"ERROR in DalitzEvent::phaseSpace4: nDgtr() = " 922 <<
nDgtr() <<
" < 4. How did this happen?" 929 ,
m(0),
m(1),
m(2),
m(3),
m(4)
932 cout <<
"4-body probs gets this phase space: " 934 cout <<
" ... for t01 <<... = " 944 double invPhsp2 = -
Delta4();
945 if(invPhsp2 <= 0)
return 0;
946 double phsp =
pi*
pi/(32.0*
m(0)*
m(0)) * 1./sqrt(invPhsp2);
947 if(dbThis) cout <<
" ... I get: phsp = " << phsp << endl;
948 if(phsp < 0)
return 0;
958 cout <<
"DalitzEvent::phaseSpace3(" << epsilon <<
")" 959 <<
" returning 1" << endl;
965 cout <<
"DalitzEvent::phaseSpace3(" << epsilon <<
")" 966 <<
" returning 0" << endl;
993 for(
unsigned int i=0; i<
_pat.
size(); i++){
1021 for(
unsigned int i=0; i<
_p.size() && counter < maxCounter; i++){
1022 array.at(counter++) =
_pat[i];
1023 array.
at(counter++) =
_p[i].E();
1024 array.at(counter++) =
_p[i].X();
1025 array.at(counter++) =
_p[i].Y();
1026 array.at(counter++) =
_p[i].Z();
1050 if(0 == tree)
return 0;
1051 std::string treeName(tree->ClassName());
1052 if(dbThis) cout <<
"ClassName \"" << treeName <<
"\"" << endl;
1053 if(treeName == (std::string)
"TNtupleD"){
1054 if(dbThis)cout <<
"DalitzEvent::fromTree: tree is TNtupleD" << endl;
1057 if(dbThis) cout <<
"DalitzEvent::fromTree: tree is ParasTree" << endl;
1065 if(dbThis) cout <<
"DalitzEvent::fromNtuple(" << ntp->GetName() <<
") called" << endl;
1066 int arraySize = ntp->GetNvar();
1068 if(dbThis) cout <<
" arraySize " << arraySize << endl;
1069 bool newFormat =
false;
1071 if(dbThis) cout <<
"New Format" << endl;
1076 cout <<
"ERROR in DalitzEvent::fromNtuple length of array" 1077 <<
" in ntuple = " << arraySize
1078 <<
"\n > not a multiple of # entries per particle = " 1083 const Double_t* array = ntp->GetArgs();
1085 if(dbThis) cout <<
" array ptr " << array << endl;
1088 if(newFormat) maxCounter -= 2;
1096 cout <<
"nParticles = " << nParticles
1097 <<
" arraySize = " << arraySize
1102 _p.resize(nParticles);
1103 for(
int i=0; i< nParticles && counter < maxCounter; i++){
1104 if(dbThis) cout <<
"filling " << i <<
" th particle: " << endl;
1106 _p[i].SetE(array[counter++]);
1107 _p[i].SetX(array[counter++]);
1108 _p[i].SetY(array[counter++]);
1109 _p[i].SetZ(array[counter++]);
1115 double dMeV = abs(
_pat[i].mass() -
_p[i].M()*
MeV);
1116 double dGeV = abs(
_pat[i].mass() -
_p[i].M()*
GeV);
1117 if(dMeV < dGeV) units=
MeV;
1122 cout <<
"\t" <<
_pat[i] <<
" " <<
_p[i]
1123 <<
", m= " <<
_p[i].M() << endl;
1131 cout <<
" weight, pdf " 1138 cout <<
"this is me now " << endl;
1140 cout <<
"done it all, returning" << endl;
1146 bool forcePDGMassForFinalState=
true;
1148 if(dbThis) cout <<
"DalitzEvent::fromTREE(" << ntp <<
") OLD called" << endl;
1150 int arraySize = ntp->GetNbranches();
1151 if(dbThis) cout <<
" arraySize " << arraySize << endl;
1152 bool newFormat =
false;
1155 if(dbThis) cout <<
" new Format" << endl;
1158 if(dbThis) cout <<
" old Format" << endl;
1160 cout <<
"ERROR in DalitzEvent::fromTree length of array" 1161 <<
" in ntuple = " << arraySize
1162 <<
"\n > not a multiple of # entries per particle = " 1167 const TObjArray* branchArray = ntp->GetListOfBranches();
1169 if(dbThis) cout <<
" array ptr " << branchArray << endl;
1172 if(newFormat) maxCounter -= 2;
1180 cout <<
"nParticles = " << nParticles
1181 <<
" arraySize = " << arraySize
1186 _p.resize(nParticles);
1187 for(
int i=0; i< nParticles && counter < maxCounter; i++){
1188 if(dbThis) cout <<
"filling " << i <<
" th particle: " << endl;
1189 TObjArray* leafArray;
1190 double leafVal = -9999;
1191 std::string leafName;
1193 ((TBranch*) (*branchArray)[counter++])->GetListOfLeaves();
1194 leafVal = ((TLeaf*) (*leafArray)[0])->GetValue();
1195 leafName = ((TLeaf*) (*leafArray)[0])->GetName();
1196 if(dbThis) cout <<
" leaf[ " << counter-1 <<
"] " 1198 _p[i].SetE(leafVal*
GeV);
1200 ((TBranch*) (*branchArray)[counter++])->GetListOfLeaves();
1201 leafVal = ((TLeaf*) (*leafArray)[0])->GetValue();
1202 leafName = ((TLeaf*) (*leafArray)[0])->GetName();
1204 cout <<
" leaf[ " << counter-1 <<
"] " << leafName
1205 <<
": " << leafVal << endl;
1207 _p[i].SetX(leafVal*
GeV);
1209 ((TBranch*) (*branchArray)[counter++])->GetListOfLeaves();
1210 leafVal = ((TLeaf*) (*leafArray)[0])->GetValue();
1211 if(dbThis) cout <<
" leaf[ " << counter-1 <<
"] " << leafVal << endl;
1212 _p[i].SetY(leafVal*
GeV);
1214 ((TBranch*) (*branchArray)[counter++])->GetListOfLeaves();
1215 leafVal = ((TLeaf*) (*leafArray)[0])->GetValue();
1216 if(dbThis) cout <<
" leaf[ " << counter-1 <<
"] " << leafVal << endl;
1217 _p[i].SetZ(leafVal*
GeV);
1219 ((TBranch*) (*branchArray)[counter++])->GetListOfLeaves();
1220 leafVal = ((TLeaf*) (*leafArray)[0])->GetValue();
1221 if(dbThis) cout <<
" leaf[ " << counter-1 <<
"] " << leafVal << endl;
1224 if(forcePDGMassForFinalState && i > 0){
1225 double m=
_pat[i].mass();
1226 _p[i].SetE(sqrt(
m*
m +
_p[i].Rho()*
_p[i].Rho()));
1228 if(dbThis) cout <<
" got pattern " << (int)
_pat[i] << endl;
1231 cout <<
"\t" <<
_pat[i] <<
" " <<
_p[i]
1232 <<
", m= " <<
_p[i].M() << endl;
1236 TObjArray* leafArray;
1237 double leafVal = -9999;
1239 ((TBranch*) (*branchArray)[counter++])->GetListOfLeaves();
1240 leafVal = ((TLeaf*) (*leafArray)[0])->GetValue();
1241 if(dbThis) cout <<
" leaf[ " << counter-1 <<
"] " << leafVal << endl;
1245 ((TBranch*) (*branchArray)[counter++])->GetListOfLeaves();
1246 leafVal = ((TLeaf*) (*leafArray)[0])->GetValue();
1250 cout <<
" weight, pdf " 1256 if(dbThis) cout <<
"done it all, returning" << endl;
1261 , std::string& part1
1262 , std::string& part2){
1263 int posOf_ = entry.find_last_of(
'_');
1264 if(std::string::npos == posOf_)
1266 part1 = entry.substr(0, posOf_);
1267 part2 = entry.substr(posOf_ +1);
1273 bool forcePDGMassForFinalState=
true;
1275 if(dbThis) cout <<
"DalitzEvent::fromTREE(" << ntp <<
") called" << endl;
1277 int arraySize = ntp->GetNbranches();
1278 if(dbThis) cout <<
" arraySize " << arraySize << endl;
1279 const TObjArray* branchArray = ntp->GetListOfBranches();
1281 map<string, map<std::string, double> > prtMap;
1285 for(
int i=0; i< arraySize; i++){
1286 TObjArray* leafArray=
1287 ((TBranch*) (*branchArray)[i])->GetListOfLeaves();
1288 double leafVal = ((TLeaf*) (*leafArray)[0])->GetValue();
1289 std::string leafName = ((TLeaf*) (*leafArray)[0])->GetName();
1291 std::string parName, element;
1294 cout <<
" leaf[ " << i <<
"] " 1295 << leafName <<
"; " << leafVal << endl;
1298 if(
"weight" == leafName) weight=leafVal;
1299 else if(
"genPdf" == leafName) genPdf = leafVal;
1301 std::string parName, element;
1306 (prtMap[parName])[element] = leafVal;
1308 cout <<
"\t leaf[ " << i <<
"] name parsed: " 1309 << parName <<
", " << element
1314 int nParticles = prtMap.size();
1315 if(dbThis) cout <<
"nParticles = " << nParticles << endl;
1317 _p.resize(nParticles);
1320 for(map<
string, map<string, double> >::iterator it =
1324 _pat[counter] = (it->second)[
"pdg"];
1326 cout <<
"just filled _pat[" << counter <<
"] with: " 1327 << (it->second)[
"pdg"] <<
"; see: " <<
_pat[counter]
1330 _p[counter].SetE((it->second)[
"E"]);
1331 _p[counter].SetPx((it->second)[
"Px"]);
1332 _p[counter].SetPy((it->second)[
"Py"]);
1333 _p[counter].SetPz((it->second)[
"Pz"]);
1337 double dMeV = abs(
_pat[counter].mass() -
_p[counter].M()*
MeV);
1338 double dGeV = abs(
_pat[counter].mass() -
_p[counter].M()*
GeV);
1339 if(dMeV < dGeV) units=
MeV;
1341 _p[counter] *= units;
1343 if(forcePDGMassForFinalState && counter > 0){
1344 double m =
_pat[counter].mass();
1345 double p3 =
_p[counter].Rho();
1346 _p[counter].SetE(sqrt(
m*
m + p3*p3));
1352 cout <<
" weight, pdf " 1355 for(
int i=0; i < nParticles; i++){
1356 cout <<
_pat[i] <<
" ) " <<
_p[i] <<
" m = " <<
_p[i].M() << endl;
1361 if(dbThis) cout <<
"done it all, returning" << endl;
virtual double getValueFromVector(unsigned int i) const
virtual void setWeight(double w)
double sijMax(const MINT::PolymorphVector< int > &indices) const
std::vector< double > _vectorOfValues
virtual void setMothers3Momentum(const TVector3 &mp3)
static std::string prtToNtpName(const std::string &s_in)
std::vector< std::vector< double > > _t
void setPattern(const DalitzEventPattern &pat)
int numPermutations() const
bool fromParasTreeOld(TTree *ntp)
virtual const std::vector< double > & getVectorOfValues() const
static long int _rememberVectorCounter
virtual double sij(const std::vector< int > &indices) const
void resize(unsigned int N)
const TLorentzVector & p_intern(unsigned int i) const
double phaseSpace4() const
std::string makeNtupleVarnames() const
virtual void CP_conjugateYourself()
IDalitzEvent * clone() const
bool fillNtupleVarArray(std::vector< Double_t > &array) const
bool setMomenta(const std::vector< TLorentzVector > &mumAndDgtr_p4)
TLorentzVector pVec(int i)
virtual double phaseSpace() const
virtual void P_conjugateYourself()
const Permutation & currentPermutation() const
virtual const DalitzEventPattern & eventPattern() const
bool fromTree(TTree *tree)
virtual void setValueInVector(unsigned int i, double value)
static long int assignUniqueRememberNumber()
bool fromParasTree(TTree *ntp)
virtual double getWeightFromVector(unsigned int i) const
std::vector< double > _vectorOfWeights
virtual const std::vector< double > & getVectorOfWeights() const
std::vector< std::vector< double > > _s
void setPermutationIndex(int i)
double m2(unsigned int i) const
virtual void setWeightInVector(unsigned int i, double weight)
double phaseSpace3(double epsilon=1.e-9) const
static bool parseNtpEntryName(const std::string &entry, std::string &part1, std::string &part2)
void generateThisToPhaseSpace(TRandom *rnd=0)
virtual const TLorentzVector & p(unsigned int i) const =0
double sijMin(const MINT::PolymorphVector< int > &indices) const
virtual double getWeight() const
double _rememberPhaseSpace
double _generatorPdfRelativeToPhaseSpace
TLorentzVector p_dgtr_sum() const
static std::string ntpToPrtName(const std::string &s_in)
virtual void C_conjugateYourself()
virtual double getGeneratorPdfRelativeToPhaseSpace() const
const Val & keyFinder(const Key &k, const std::map< Key, Val > &m, const Val &dummy, bool &successFlag)
std::vector< TLorentzVector > _p
virtual const DalitzEventPattern & eventPattern() const =0
unsigned int ntupleVarArraySize() const
double getWeight(const EVT_TYPE &)
double sijMap_intern(const std::vector< int > &intern_indices) const
virtual const TLorentzVector & p(unsigned int i) const
unsigned int size() const
double t_intern(unsigned int i, unsigned int j) const
bool fromNtuple(TNtupleD *ntp)
virtual double t(unsigned int i, unsigned int j) const
std::string anythingToString(const T &anything)
static const char prtNameChars[]
double sijMin(const std::vector< int > &indices) const
DalitzEventPattern makeCPConjugate() const
double m(unsigned int i) const
void print(std::ostream &os=std::cout) const
virtual double s(unsigned int i, unsigned int j) const
std::ostream & operator<<(std::ostream &os, const DalitzEvent &de)
static long int _eventCounter
double evalsij_intern(const std::vector< int > &intern_indices) const
virtual void setGeneratorPdfRelativeToPhaseSpace(double gpdf)
static int singleParticleNtpArraySize()
Calculate4BodyProps makeCalculate4BodyProps() const
double phaseSpaceFactor()
double s_intern(unsigned int i, unsigned int j) const
static const char ntpNameChars[]
Double_t phaseSpace(Double_t *x, Double_t *par)
double sijMap(const std::vector< int > &indices) const
std::map< std::vector< int >, double > _sijMap
bool kinematicallyAllowed(double epsilon=1.e-9) const
double sijMax(const std::vector< int > &indices) const
void setP(unsigned int i, const TLorentzVector &p4)