35 int RestFrame::m_class_key = 0;
37 RestFrame::RestFrame() : RFBase() {
38 m_Type = kVanillaFrame;
39 m_Log.SetSource(
"RestFrame "+GetName());
42 RestFrame::~RestFrame(){
46 RestFrame::RestFrame(
const std::string& sname,
const std::string& stitle)
47 : RFBase(sname, stitle, RestFrame::m_class_key++)
49 m_Log.SetSource(
"RestFrame "+GetName());
50 m_Type = kVanillaFrame;
51 m_ParentFramePtr =
nullptr;
52 m_ParentBoost.SetXYZ(0.,0.,0.);
55 void RestFrame::Clear(){
60 RestFrame& RestFrame::Empty(){
61 return ReconstructionFrame::Empty();
64 ConstRestFrameList
const& RestFrame::EmptyList(){
68 TVector3 RestFrame::m_Axis = TVector3(0.,0.,1.);
70 void RestFrame::SetAxis(
const TVector3& axis){
71 RestFrame::m_Axis = axis;
74 TVector3
const& RestFrame::GetAxis(){
75 return RestFrame::m_Axis;
78 RestFrameList RestFrame::operator + (RestFrame& frame){
85 RestFrameList RestFrame::operator + (
const RestFrameList& frames){
86 RestFrameList list = frames;
91 FrameType RestFrame::GetType()
const {
95 bool RestFrame::IsVisibleFrame()
const {
96 return m_Type == kVisibleFrame;
99 bool RestFrame::IsInvisibleFrame()
const {
100 return m_Type == kInvisibleFrame;
103 bool RestFrame::IsDecayFrame()
const {
104 return m_Type == kDecayFrame;
107 bool RestFrame::IsLabFrame()
const {
108 return m_Type == kLabFrame;
111 bool RestFrame::IsRecoFrame()
const {
112 return m_Ana == kRecoFrame;
115 bool RestFrame::IsGenFrame()
const {
116 return m_Ana == kGenFrame;
119 std::string RestFrame::PrintString(LogType type)
const {
122 output +=
" Frame Type: Lab \n";
124 output +=
" Frame Type: Decay \n";
126 output +=
" Frame Type: Visible \n";
127 if(IsInvisibleFrame())
128 output +=
" Frame Type: Invisible \n";
130 output +=
" Ana Type: Generator \n";
132 output +=
" Ana Type: Reconstruction \n";
136 bool RestFrame::IsSoundBody()
const {
137 if(RFBase::IsSoundBody())
return true;
138 int Nchild = GetNChildren();
139 for(
int i = 0; i < Nchild; i++)
140 if(!GetChildFrame(i)){
141 m_Log << LogWarning <<
"Empty child frame:";
142 m_Log << Log(GetChildFrame(i)) << LogEnd;
143 return SetBody(
false);
145 return SetBody(
true);
148 bool RestFrame::InitializeTreeRecursive() {
149 if(!IsSoundBody())
return false;
150 int Nchild = GetNChildren();
151 for(
int i = 0; i < Nchild; i++){
152 if(!GetChildFrame(i).InitializeTreeRecursive()){
154 m_Log <<
"Problem with recursive tree structure from frame: ";
155 m_Log << Log(GetChildFrame(i)) << LogEnd;
156 return SetBody(
false);
162 void RestFrame::RemoveChildFrame(RestFrame& frame){
164 bool contains = m_ChildFrames.Contains(frame);
165 m_ChildBoosts.erase(&frame);
166 m_ChildFrames.Remove(frame);
168 frame.SetParentFrame();
171 void RestFrame::RemoveChildFrames(){
173 while(GetNChildren() > 0)
174 RemoveChildFrame(m_ChildFrames[0]);
175 m_ChildFrames.Clear();
176 m_ChildBoosts.clear();
179 void RestFrame::SetParentFrame(RestFrame& frame){
180 if(IsEmpty())
return;
184 RestFrame* prevPtr = m_ParentFramePtr;
186 if(*m_ParentFramePtr != frame){
187 m_ParentFramePtr =
nullptr;
188 prevPtr->RemoveChildFrame(*
this);
191 m_ParentFramePtr =
nullptr;
193 m_ParentFramePtr = &frame;
196 void RestFrame::AddChildFrame(RestFrame& frame){
197 if(IsEmpty())
return;
203 m_Log <<
"Cannot add empty frame as child.";
207 if(frame.IsLabFrame()){
209 m_Log <<
"Cannot add LabFrame frame as child:";
210 m_Log << Log(frame) << LogEnd;
213 if(!m_ChildFrames.Add(frame)){
215 m_Log <<
"Unable to add child frame:";
216 m_Log << Log(frame) << LogEnd;
219 frame.SetParentFrame(*
this);
220 m_ChildBoosts[&frame] = m_Empty3Vector;
223 void RestFrame::AddChildFrames(
const RestFrameList& frames){
224 int N = frames.GetN();
225 for(
int i = 0; i < N; i++)
226 AddChildFrame(frames[i]);
229 int RestFrame::GetNChildren()
const {
230 return m_ChildFrames.GetN();
233 RestFrame& RestFrame::GetChildFrame(
int i)
const {
234 int Nchild = GetNChildren();
235 if(i >= Nchild || i < 0){
237 m_Log <<
"Cannot GetChildFrame(" << i <<
"). ";
238 m_Log <<
"No " << i <<
"th child" << LogEnd;
240 return m_ChildFrames[i];
243 RestFrame
const& RestFrame::GetParentFrame()
const {
245 return *m_ParentFramePtr;
247 return RestFrame::Empty();
250 RestFrameList
const& RestFrame::GetChildFrames()
const {
251 return m_ChildFrames;
254 RestFrame
const& RestFrame::GetLabFrame()
const {
258 if(!GetParentFrame()){
260 m_Log <<
"Unable to find LabFrame above this frame. ";
261 m_Log <<
"No parent frame set" << LogEnd;
262 return RestFrame::Empty();
264 return m_ParentFramePtr->GetLabFrame();
267 RestFrame
const& RestFrame::GetSiblingFrame()
const {
269 return RestFrame::Empty();
272 return RestFrame::Empty();
274 if(!GetParentFrame())
275 return RestFrame::Empty();
277 int Nsib = GetParentFrame().GetNChildren();
278 for(
int s = 0; s < Nsib; s++){
279 if(IsSame(m_ParentFramePtr->GetChildFrame(s)))
281 return m_ParentFramePtr->GetChildFrame(s);
283 return RestFrame::Empty();
286 int RestFrame::GetNDescendants()
const {
287 if(!IsSoundBody())
return 0.;
289 int Nchild = GetNChildren();
290 if(Nchild == 0)
return 1;
292 for(
int i = 0; i < Nchild; i++){
293 Nd += GetChildFrame(i).GetNDescendants();
298 void RestFrame::SetChildBoostVector(RestFrame& frame,
const TVector3& boost) {
299 if(!m_ChildFrames.Contains(frame)){
301 m_Log <<
"Unable to set child's boost vector. ";
302 m_Log <<
"Frame is not among children:";
303 m_Log << Log(frame) << LogEnd;
306 m_ChildBoosts[&frame] = boost;
307 frame.SetParentBoostVector(-1.*boost);
310 void RestFrame::SetParentBoostVector(
const TVector3& boost) {
311 if(!GetParentFrame()){
313 m_Log <<
"Unable to set parent boost vector. ";
314 m_Log <<
"No parent frame set.";
318 m_ParentBoost = boost;
321 TVector3
const& RestFrame::GetChildBoostVector(RestFrame& frame)
const {
322 if(!m_ChildFrames.Contains(frame)){
324 m_Log <<
"Unable to get child's boost vector. ";
325 m_Log <<
"Frame is not among children:";
326 m_Log << Log(frame) << LogEnd;
327 return m_Empty3Vector;
329 return m_ChildBoosts[&frame];
332 TVector3
const& RestFrame::GetParentBoostVector()
const {
333 return m_ParentBoost;
336 RestFrameList RestFrame::GetListFrames(FrameType type)
const {
337 RestFrameList frames;
338 FillListFramesRecursive(frames,type);
342 RestFrameList RestFrame::GetListVisibleFrames()
const {
343 return GetListFrames(kVisibleFrame);
346 RestFrameList RestFrame::GetListInvisibleFrames()
const {
347 return GetListFrames(kInvisibleFrame);
350 void RestFrame::FillListFramesRecursive(RestFrameList& frames, FrameType type)
const {
351 if(frames.Contains(*
this))
return;
352 if(type == GetType() || type == kLabFrame) frames.Add((RestFrame&)(*m_This));
353 int Nchild = GetNChildren();
354 for(
int i = 0; i < Nchild; i++)
355 GetChildFrame(i).FillListFramesRecursive(frames, type);
358 bool RestFrame::IsCircularTree(std::vector<RFKey>& keys)
const {
359 int Nkey = keys.size();
360 for(
int i = 0; i < Nkey; i++){
361 if(keys[i] == GetKey()){
363 m_Log <<
"This RestFrame appears more than once in the tree:";
364 m_Log << Log(*
this) << LogEnd;
368 keys.push_back(GetKey());
369 int Nchild = GetNChildren();
370 for(
int i = 0; i < Nchild; i++)
371 if(GetChildFrame(i).IsCircularTree(keys))
377 bool RestFrame::FindPathToFrame(
const RestFrame& dest_frame,
378 const RestFrame& prev_frame,
379 std::vector<const TVector3*>& boosts)
const {
380 if(IsSame(dest_frame))
return true;
382 std::vector<const RestFrame*> try_frames;
383 std::vector<const TVector3*> try_boosts;
385 if(!GetParentFrame().IsEmpty()){
386 try_frames.push_back(&GetParentFrame());
387 try_boosts.push_back(&GetParentBoostVector());
389 int Nchild = GetNChildren();
390 for(
int i = 0; i < Nchild; i++){
391 try_frames.push_back(&GetChildFrame(i));
392 try_boosts.push_back(&GetChildBoostVector(GetChildFrame(i)));
395 int Ntry = try_frames.size();
396 for(
int i = 0; i < Ntry; i++){
397 const RestFrame* nextPtr = try_frames[i];
398 if(nextPtr->IsSame(prev_frame))
continue;
399 boosts.push_back(try_boosts[i]);
400 if(nextPtr->FindPathToFrame(dest_frame,*
this,boosts))
407 void RestFrame::SetFourVector(
const TLorentzVector& V,
408 const RestFrame& frame){
410 UnSoundBody(RF_FUNCTION);
414 m_ProdFramePtr = &GetLabFrame();
416 m_ProdFramePtr = &frame;
425 RFCharge RestFrame::GetCharge()
const {
429 UnSoundBody(RF_FUNCTION);
433 int Nchild = GetNChildren();
434 if(Nchild == 0)
return charge;
435 for(
int i = 0; i < Nchild; i++){
436 charge += GetChildFrame(i).GetCharge();
441 double RestFrame::GetMass()
const {
442 if(!IsSoundSpirit()){
443 UnSoundSpirit(RF_FUNCTION);
449 TLorentzVector RestFrame::GetFourVector(
const RestFrame& frame)
const {
450 if(!IsSoundSpirit()){
451 UnSoundSpirit(RF_FUNCTION);
452 return m_Empty4Vector;
456 return GetFourVector(GetLabFrame());
458 if(!GetProductionFrame()){
460 m_Log <<
"Unable to get four vector. ";
461 m_Log <<
"Production frame is not defined." << LogEnd;
462 return m_Empty4Vector;
465 TLorentzVector V = m_P;
467 return m_Empty4Vector;
468 if(frame == GetProductionFrame())
return V;
470 std::vector<const TVector3*> boosts;
471 if(!GetProductionFrame().
472 FindPathToFrame(frame, RestFrame::Empty(), boosts)){
474 m_Log <<
"Unable to get four vector. ";
475 m_Log <<
"Cannot find a path to frame " << frame.GetName();
476 m_Log <<
" from frame " << GetProductionFrame().GetName() << LogEnd;
477 return m_Empty4Vector;
480 int Nboost = boosts.size();
481 for(
int i = 0; i < Nboost; i++)
482 V.Boost(-1.*(*boosts[i]));
486 TLorentzVector RestFrame::GetVisibleFourVector(
const RestFrame& frame)
const {
487 if(!IsSoundSpirit()){
488 UnSoundSpirit(RF_FUNCTION);
489 return m_Empty4Vector;
494 return m_Empty4Vector;
496 return GetVisibleFourVector(GetLabFrame());
500 return GetFourVector(frame);
502 TLorentzVector V(0.,0.,0.,0.);
503 int Nc = GetNChildren();
504 for(
int c = 0; c < Nc; c++){
505 RestFrameList frames = GetChildFrame(c).GetListVisibleFrames();
506 int Nf = frames.GetN();
507 for(
int f = 0; f < Nf; f++)
508 V += frames[f].GetFourVector(frame);
513 TLorentzVector RestFrame::GetInvisibleFourVector(
const RestFrame& frame)
const {
514 if(!IsSoundSpirit()){
515 UnSoundSpirit(RF_FUNCTION);
516 return m_Empty4Vector;
521 return m_Empty4Vector;
523 return GetInvisibleFourVector(GetLabFrame());
526 if(IsInvisibleFrame())
527 return GetFourVector(frame);
529 TLorentzVector V(0.,0.,0.,0.);
530 int Nc = GetNChildren();
531 for(
int c = 0; c < Nc; c++){
532 RestFrameList frames = GetChildFrame(c).GetListInvisibleFrames();
533 int Nf = frames.GetN();
534 for(
int f = 0; f < Nf; f++)
535 V += frames[f].GetFourVector(frame);
540 double RestFrame::GetEnergy(
const RestFrame& frame)
const {
541 if(!IsSoundSpirit()){
542 UnSoundSpirit(RF_FUNCTION);
545 return GetFourVector(frame).E();
548 double RestFrame::GetMomentum(
const RestFrame& frame)
const {
549 if(!IsSoundSpirit()){
550 UnSoundSpirit(RF_FUNCTION);
553 return GetFourVector(frame).P();
556 double RestFrame::GetTransverseMomentum(
const RestFrame& frame,
557 const TVector3& axis,
558 const RestFrame& axis_frame)
const {
559 if(!IsSoundSpirit()){
560 UnSoundSpirit(RF_FUNCTION);
564 if(frame == axis_frame){
565 TVector3 V = GetFourVector(frame).Vect();
566 return (V-V.Dot(axis.Unit())*axis.Unit()).Mag();
569 TLorentzVector Pthis = GetFourVector(axis_frame);
571 TLorentzVector Pframe;
572 if(!frame || frame.IsLabFrame()){
573 Pframe = axis_frame.GetFourVector(frame);
574 Pframe.SetVectM(-Pframe.Vect(),Pframe.M());
576 Pframe = frame.GetFourVector(axis_frame);
579 TVector3 boost_par = Pframe.BoostVector();
581 boost_par = boost_par.Dot(axis.Unit())*axis.Unit();
582 Pthis.Boost(-boost_par);
583 Pframe.Boost(-boost_par);
584 TVector3 boost_perp = Pframe.BoostVector();
585 Pthis.Boost(-boost_perp);
587 TVector3 V = Pthis.Vect();
588 return (V-V.Dot(axis.Unit())*axis.Unit()).Mag();
591 TLorentzVector RestFrame::GetFourVector(
const TLorentzVector& P,
592 const RestFrame& def_frame)
const {
593 if(!IsSoundSpirit()){
594 UnSoundSpirit(RF_FUNCTION);
595 return m_Empty4Vector;
598 if(IsSame(def_frame) || (!def_frame && IsLabFrame()))
601 TLorentzVector Pret = P;
603 std::vector<const TVector3*> boosts;
606 FindPathToFrame(*
this, RestFrame::Empty(), boosts)){
608 m_Log <<
"Unable to get four vector. ";
609 m_Log <<
"Cannot find a path to frame " << GetName();
610 m_Log <<
" from frame " << GetLabFrame().GetName() << LogEnd;
611 return m_Empty4Vector;
615 FindPathToFrame(*
this, RestFrame::Empty(), boosts)){
617 m_Log <<
"Unable to get four vector. ";
618 m_Log <<
"Cannot find a path to frame " << GetName();
619 m_Log <<
" from frame " << GetLabFrame().GetName() << LogEnd;
620 return m_Empty4Vector;
623 int Nboost = boosts.size();
624 for(
int i = 0; i < Nboost; i++)
625 Pret.Boost(-1.*(*boosts[i]));
629 double RestFrame::GetTransverseMomentum(
const TLorentzVector& P,
630 const TVector3& axis,
631 const RestFrame& axis_frame)
const {
632 if(!IsSoundSpirit()){
633 UnSoundSpirit(RF_FUNCTION);
637 if(IsLabFrame() && (!axis_frame || axis_frame.IsLabFrame())){
638 TVector3 V = P.Vect();
639 return (V-V.Dot(axis.Unit())*axis.Unit()).Mag();
642 TLorentzVector Pret = P;
645 if(!axis_frame.IsLabFrame() && !axis_frame.IsEmpty()){
646 std::vector<const TVector3*> boosts;
648 FindPathToFrame(axis_frame, RestFrame::Empty(), boosts)){
650 m_Log <<
"Unable to get four vector. ";
651 m_Log <<
"Cannot find a path to frame " << axis_frame.GetName();
652 m_Log <<
" from frame " << GetLabFrame().GetName() << LogEnd;
655 int Nboost = boosts.size();
656 for(
int i = 0; i < Nboost; i++)
657 Pret.Boost(-1.*(*boosts[i]));
660 if(*
this == axis_frame){
661 TVector3 V = Pret.Vect();
662 return (V-V.Dot(axis.Unit())*axis.Unit()).Mag();
665 TLorentzVector Pthis;
667 Pthis = axis_frame.GetFourVector();
668 Pthis.SetVectM(-Pthis.Vect(),Pthis.M());
670 Pthis = GetFourVector(axis_frame);
673 TVector3 boost_par = Pthis.BoostVector();
675 boost_par = boost_par.Dot(axis.Unit())*axis.Unit();
676 Pret.Boost(-boost_par);
677 Pthis.Boost(-boost_par);
678 TVector3 boost_perp = Pthis.BoostVector();
679 Pret.Boost(-boost_perp);
681 TVector3 V = Pret.Vect();
682 return (V-V.Dot(axis.Unit())*axis.Unit()).Mag();
686 int RestFrame::GetFrameDepth(
const RestFrame& frame)
const {
687 if(!IsSoundSpirit()){
688 UnSoundSpirit(RF_FUNCTION);
692 if(!frame)
return -1;
693 if(IsSame(frame))
return 0.;
694 int Nchild = GetNChildren();
695 for(
int i = 0; i < Nchild; i++){
696 int depth = GetChildFrame(i).GetFrameDepth(frame);
697 if(depth >= 0)
return depth+1;
702 RestFrame
const& RestFrame::GetFrameAtDepth(
int depth,
const RestFrame& frame)
const {
703 if(!IsSoundSpirit()){
704 UnSoundSpirit(RF_FUNCTION);
705 return RestFrame::Empty();
708 if(!frame || depth < 1)
709 return RestFrame::Empty();
711 int N = GetNChildren();
712 for(
int i = 0; i < N; i++){
713 RestFrame& child = GetChildFrame(i);
714 if(child.GetListFrames().Contains(frame)){
715 if(depth == 1)
return child;
716 else return child.GetFrameAtDepth(depth-1,frame);
719 return RestFrame::Empty();
722 double RestFrame::GetVisibleShape()
const {
723 if(!IsSoundSpirit()){
724 UnSoundSpirit(RF_FUNCTION);
729 int N = GetNChildren();
730 for(
int i = 0; i < N; i++)
731 Psum += GetChildFrame(i).GetVisibleFourVector(*this).P();
732 for(
int i = 0; i < N-1; i++){
733 TVector3 P1 = GetChildFrame(i).GetVisibleFourVector(*this).Vect();
734 for(
int j = i+1; j < N; j++){
735 TVector3 P2 = GetChildFrame(j).GetVisibleFourVector(*this).Vect();
736 Xsum += (P1.Mag()+P2.Mag())*(P1.Mag()+P2.Mag())-(P1-P2).Mag2();
740 return sqrt(Xsum)/Psum;
745 double RestFrame::GetSumVisibleMomentum()
const {
746 if(!IsSoundSpirit()){
747 UnSoundSpirit(RF_FUNCTION);
752 int N = GetNChildren();
753 for(
int i = 0; i < N; i++)
754 ret += GetChildFrame(i).GetVisibleFourVector(*this).P();
759 double RestFrame::GetSumInvisibleMomentum()
const {
760 if(!IsSoundSpirit()){
761 UnSoundSpirit(RF_FUNCTION);
766 int N = GetNChildren();
767 for(
int i = 0; i < N; i++)
768 ret += GetChildFrame(i).GetVisibleFourVector(*this).P();
773 RestFrame
const& RestFrame::GetProductionFrame()
const {
774 if(!IsSoundSpirit()){
775 UnSoundSpirit(RF_FUNCTION);
776 return RestFrame::Empty();
780 return *m_ProdFramePtr;
782 return RestFrame::Empty();
785 TVector3 RestFrame::GetBoostInParentFrame()
const {
786 TVector3 V(0.,0.,0.);
788 if(!IsSoundSpirit()){
789 UnSoundSpirit(RF_FUNCTION);
793 if(!GetParentFrame())
return V;
794 return -1.*GetParentBoostVector();
797 double RestFrame::GetGammaInParentFrame()
const {
798 if(!IsSoundSpirit()){
799 UnSoundSpirit(RF_FUNCTION);
803 TVector3 vbeta = GetBoostInParentFrame();
804 double beta = std::min(1.,vbeta.Mag());
805 return 1./sqrt(1.-beta*beta);
808 double RestFrame::GetCosDecayAngle(
const RestFrame& frame)
const {
809 if(!IsSoundSpirit()){
810 UnSoundSpirit(RF_FUNCTION);
814 TVector3 V1 = GetParentBoostVector().Unit();
816 V1 = RestFrame::GetAxis();
819 V2 = frame.GetFourVector(*this).Vect().Unit();
821 if(GetNChildren() < 1)
824 V2 = GetChildFrame(0).GetFourVector(*this).Vect().Unit();
829 TVector3 RestFrame::GetDecayPlaneNormalVector(
const RestFrame& frame)
const {
830 TVector3 n = RestFrame::GetAxis();
832 if(!IsSoundSpirit()){
833 UnSoundSpirit(RF_FUNCTION);
838 if(GetNChildren() < 1)
844 V1 = GetChildFrame(0).GetFourVector(GetParentFrame()).Vect();
846 V1 = frame.GetFourVector(GetParentFrame()).Vect();
847 V2 = GetFourVector(GetParentFrame()).Vect();
850 V1 = GetChildFrame(0).GetFourVector(*this).Vect().Unit();
852 V1 = frame.GetFourVector(*this).Vect().Unit();
855 TVector3 ret = V1.Cross(V2);
859 std::vector<TVector3> tries;
860 tries.push_back(TVector3(1.,0.,0.));
861 tries.push_back(TVector3(0.,1.,0.));
862 tries.push_back(TVector3(0.,0.,1.));
863 for(
int i = 0; i < 3; i++){
873 double RestFrame::GetDeltaPhiDecayPlanes(
const RestFrame& frame)
const {
874 if(!IsSoundSpirit()){
875 UnSoundSpirit(RF_FUNCTION);
879 if(!frame)
return 0.;
880 if(GetNChildren() < 1)
return 0.;
882 TVector3 vNorm_frame = frame.GetDecayPlaneNormalVector();
883 TVector3 vNorm_this = GetDecayPlaneNormalVector();
884 double dphi = vNorm_this.Angle(vNorm_frame);
886 if(frame.GetFourVector(*this).Vect().Cross(vNorm_frame).Dot(vNorm_this) < 0.){
887 dphi = TMath::Pi()*2. - dphi;
893 double RestFrame::GetDeltaPhiDecayAngle(
const TVector3& axis,
const RestFrame& frame)
const {
894 if(!IsSoundSpirit()){
895 UnSoundSpirit(RF_FUNCTION);
902 TLorentzVector Pthis = GetFourVector(frame);
903 TLorentzVector Pchild = GetChildFrame(0).GetFourVector(frame);
905 TVector3 boost_par = Pthis.BoostVector();
906 boost_par = boost_par.Dot(axis.Unit())*axis.Unit();
907 Pthis.Boost(-boost_par);
908 Pchild.Boost(-boost_par);
909 TVector3 boost_perp = Pthis.BoostVector();
910 Pchild.Boost(-boost_perp);
912 TVector3 V1 = boost_perp;
913 TVector3 V2 = Pchild.Vect();
914 V1 = V1 - V1.Dot(axis.Unit())*axis.Unit();
915 V2 = V2 - V2.Dot(axis.Unit())*axis.Unit();
922 double RestFrame::GetDeltaPhiBoostVisible(
const TVector3& axis,
const RestFrame& frame)
const {
923 if(!IsSoundSpirit()){
924 UnSoundSpirit(RF_FUNCTION);
928 TLorentzVector Pvis = GetVisibleFourVector(frame);
929 TLorentzVector Pthis = GetFourVector(frame);
931 TVector3 boost_par = Pthis.BoostVector();
932 boost_par = boost_par.Dot(axis.Unit())*axis.Unit();
933 Pthis.Boost(-boost_par);
934 Pvis.Boost(-boost_par);
935 TVector3 boost_perp = Pthis.BoostVector();
936 Pvis.Boost(-boost_perp);
938 TVector3 V = Pvis.Vect();
939 V = V - V.Dot(axis.Unit())*axis.Unit();
941 return V.Angle(boost_perp);
948 double RestFrame::GetDeltaPhiDecayVisible(
const TVector3& axis,
const RestFrame& frame)
const {
949 if(!IsSoundSpirit()){
950 UnSoundSpirit(RF_FUNCTION);
954 if(GetNChildren() < 1)
return 0.;
956 TLorentzVector Pvis = GetVisibleFourVector(frame);
957 TLorentzVector Pchild = GetChildFrame(0).GetFourVector(frame);
958 TLorentzVector Pthis = GetFourVector(frame);
960 TVector3 boost_par = Pthis.BoostVector();
961 boost_par = boost_par.Dot(axis.Unit())*axis.Unit();
962 Pthis.Boost(-boost_par);
963 Pvis.Boost(-boost_par);
964 Pchild.Boost(-boost_par);
965 TVector3 boost_perp = Pthis.BoostVector();
966 Pvis.Boost(-boost_perp);
967 Pchild.Boost(-boost_perp);
969 TVector3 Vv = Pvis.Vect();
970 Vv = Vv - Vv.Dot(axis.Unit())*axis.Unit();
971 TVector3 Vc = Pchild.Vect();
972 Vc = Vc - Vc.Dot(axis.Unit())*axis.Unit();
980 double RestFrame::GetDeltaPhiVisible(
const TVector3& axis,
const RestFrame& frame)
const {
981 if(!IsSoundSpirit()){
982 UnSoundSpirit(RF_FUNCTION);
986 if(GetNChildren() != 2)
return 0.;
988 TLorentzVector Pthis = GetFourVector(frame);
989 TLorentzVector P1 = GetChildFrame(0).GetVisibleFourVector(frame);
990 TLorentzVector P2 = GetChildFrame(1).GetVisibleFourVector(frame);
992 TVector3 boost_par = Pthis.BoostVector();
993 boost_par = boost_par.Dot(axis.Unit())*axis.Unit();
994 Pthis.Boost(-boost_par);
995 P1.Boost(-boost_par);
996 P2.Boost(-boost_par);
997 TVector3 boost_perp = Pthis.BoostVector();
998 P1.Boost(-boost_perp);
999 P2.Boost(-boost_perp);
1001 TVector3 V1 = P1.Vect();
1002 TVector3 V2 = P2.Vect();
1003 V1 = V1 - V1.Dot(axis.Unit())*axis.Unit();
1004 V2 = V2 - V2.Dot(axis.Unit())*axis.Unit();
1006 return V1.Angle(V2);
1009 const ConstRestFrameList RestFrame::m_EmptyList;
virtual std::string PrintString(LogType type) const
String of information associated with object.