25 _exampleDecay->addDgtr(310, 113)->addDgtr(211, -211);
26 _exampleDecay->addDgtr(-211, 200321)->addDgtr(321, -10323);
28 return *_exampleDecay;
32 return getExampleDecay();
37 cout <<
" SpinFactor3::setSpin can't set spin, R==0" 38 <<
" probably need to parse tree, first." 42 if(R->getVal().J() ==
"0"){
44 }
else if(R->getVal().J() ==
"1"){
46 }
else if(R->getVal().J() ==
"2"){
49 cout <<
"SpinFactor3::setSpin() Don't know how to" 50 <<
" handle resonance with spin = " << R->getVal().J()
51 <<
"\n > looking at decay\n" << theDecay()
52 <<
"\n > Sorry, will crash now!" << endl;
59 if(fsPS.size() < 3) fsPS.reserve(3);
61 if(theDecay(pat).nDgtr() == (
int)(theDecay(pat).finalState().size())){
66 for(
int i=0; i< theDecay(pat).nDgtr(); i++){
71 if(0==R || 0==fsPS[0]){
72 cout <<
"SpinFactor3::parseTree" 73 <<
" Didn't find R or P1 " << R <<
", " << fsPS[0] << endl;
77 cout <<
"ERROR in SpinFactor3::parseTree" 78 <<
" Resonance should have 2 daughters, but it says it has " 83 fsPS[1] = R->getDgtrTreePtr(0);
84 fsPS[2] = R->getDgtrTreePtr(1);
96 os <<
"INFO from SpinFactor3::printYourself():\n" 97 <<
" > parsed the following tree " 98 << theDecay().oneLiner() <<
" like this:\n" 99 <<
" > R = " << R->getVal().name()
100 <<
", fsPS[0]=C= " << fsPS[0]->getVal().name()
101 <<
", fsPS[1]=A= " << fsPS[1]->getVal().name()
102 <<
", fsPS[2]=B= " << fsPS[2]->getVal().name()
111 if(! ( fsPS[0] && fsPS[1] && fsPS[2])) parseTree(evt.
eventPattern());
114 cout <<
"ERROR in SpinFactor3::getVal(): 0 == R" 116 throw "such things shouldn't happen";
120 return spinZeroVal();
121 }
else if(_spin == 1){
122 return spinOneVal(evt);
123 }
else if(_spin == 2){
124 return spinTwoVal(evt);
126 cout <<
"SpinFactor3::getVal() Don't know how to" 127 <<
" handle resonance with spin = " << R->getVal().J()
128 <<
"\n > looking at decay\n" << theDecay()
129 <<
"\n > Sorry, will crash now!" << endl;
138 double m2AC = (p(0, evt) + p(1, evt)).M2();
139 double m2BC = (p(0, evt) + p(2, evt)).M2();
142 return (m2AC - m2BC)/(
GeV*
GeV);
152 TLorentzVector pV = p(1, evt) + p(2, evt);
153 TLorentzVector pD = pV + p(0, evt);
154 double mr = mRes(R, evt);
157 TLorentzVector lhs = pD + p(0, evt);
158 TLorentzVector rhs = p(1, evt) - p(2, evt);
161 cout <<
" spinOneVal for " << theDecay().oneLiner()
162 <<
"\n > compare: Sandwich: " 164 <<
"\n > from masses " 165 << spinOneFromMasses(evt)
166 <<
"\n > ratio sw/m " 167 << -spin_sum.
Sandwich(lhs, rhs)/spinOneFromMasses(evt)
168 <<
"\n > from Zemach " << spinOneFromZemach(evt)
169 <<
"\n > ratios sw/Zemach " 170 << spin_sum.
Sandwich(lhs, rhs)/spinOneFromZemach(evt)
184 TLorentzVector pV = p(1, evt) + p(2, evt);
185 TLorentzVector qV = p(1, evt) - p(2, evt);
186 TLorentzVector pD = pV + p(0, evt);
187 TLorentzVector qD = pV - p(0, evt);
190 double mr = mRes(R, evt);
214 double MV = mRes(R, evt);
215 double mA = fsPS[1]->getVal().mass();
216 double mB = fsPS[2]->getVal().mass();
218 double mC = fsPS[0]->getVal().mass();
220 double mD = (p(0, evt)+p(1, evt)+p(2, evt)).M();
222 double m2AC = (p(0, evt) + p(1, evt)).M2();
223 double m2BC = (p(0, evt) + p(2, evt)).M2();
225 return (m2AC - m2BC + (mD*mD - mC*mC)*(mB*mB-mA*mA)/(MV*MV))/(
GeV*
GeV);
234 double MV = mRes(R, evt);
235 double mA = fsPS[1]->getVal().mass();
236 double mB = fsPS[2]->getVal().mass();
238 double mC = fsPS[0]->getVal().mass();
240 double mD = (p(0, evt)+p(1, evt)+p(2, evt)).M();
242 double m2AB = (p(1, evt) + p(2, evt)).M2();
243 double m2AC = (p(0, evt) + p(1, evt)).M2();
244 double m2BC = (p(0, evt) + p(2, evt)).M2();
246 Double_t term1 = m2BC-m2AC+(mD*mD-mC*mC)*(mA*mA-mB*mB)/(MV*MV);
247 Double_t term2 = m2AB-2.0*mD*mD-2.0*mC*mC+pow(mD*mD-mC*mC,2)/(MV*MV);
248 Double_t term3 = m2AB-2.0*mA*mA-2.0*mB*mB+pow(mA*mA-mB*mB,2)/(MV*MV);
250 return (pow(term1,2)-(1.0/3.0)*term2*term3)/(
GeV*
GeV*
GeV*
GeV);
258 TLorentzVector pT = p(1, evt) + p(2, evt);
259 TLorentzVector pD = pT + p(0, evt);
260 double mr = mRes(R, evt);
263 TLorentzVector lhs = pD + p(0, evt);
264 TLorentzVector rhs = p(1, evt) - p(2, evt);
268 cout <<
"spin-2 spin factor got called for " 269 << theDecay().oneLiner()
270 <<
"\n > returning " << returnVal
271 <<
"\n > compare " << spinTwoFromMasses(evt)
272 <<
"\n > ratio " << returnVal/spinTwoFromMasses(evt)
double spinOneFromZemach(IDalitzEvent &evt)
double spinOneFromMasses(IDalitzEvent &evt)
static DecayTree * _exampleDecay
double Sandwich(const TLorentzVector &lhs, const TLorentzVector &rhs) const
bool parseTree(const DalitzEventPattern &pat)
virtual double getVal(IDalitzEvent &evt)
bool isFinalState() const
virtual void printYourself(std::ostream &os=std::cout) const
double GSSpinFactor(IDalitzEvent &evt)
double Contract(const TLorentzVector &rhs) const
double spinTwoFromMasses(IDalitzEvent &evt)
virtual const DalitzEventPattern & eventPattern() const =0
double spinOneVal(IDalitzEvent &evt)
static const DecayTree & getExampleDecay()
double Sandwich(const TLorentzVector &lm, const TLorentzVector &ln, const TLorentzVector &ra, const TLorentzVector &rb)
DDTree< DecayTreeItem > DecayTree
double spinTwoVal(IDalitzEvent &evt)
virtual const DecayTree & exampleDecay()