FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RhoFindOmittedParticle Class Reference

#include <RhoFindOmittedParticle.h>

Inheritance diagram for RhoFindOmittedParticle:

Public Member Functions

 RhoFindOmittedParticle (const TLorentzVector &ip4Reson, const double imChild, const double imSought, const Bool_t izBoostApprox=kTRUE)
 
virtual ~RhoFindOmittedParticle ()
 
TLorentzVector FitToSeen (const TLorentzVector &p4Obs, const TVector3 &p3Seen)
 
TLorentzVector SecondVector () const
 

Protected Member Functions

void MakeCone (const TLorentzVector &p4Obs)
 
TLorentzVector ClosestFit (const TVector3 &p3Seen)
 

Protected Attributes

float mSought2
 
Bool_t zBoostApprox
 squared mass of Sought More...
 
float cmEChild
 Flag: do we approximate boost in. More...
 
float cmpChild2
 
TLorentzVector p4ObsCache
 energy, squared 3-momentum of Child. More...
 
TLorentzVector secondChoice
 
TVector3 beta
 The other vector, stored. More...
 
TVector3 cmAxis
 From lab to CM (-beta CM to lab) More...
 
double openCos
 Axis of CM cone. More...
 
double cmESought
 cos of opening angle. More...
 
double cmpSought2
 CM energy of sought particle. More...
 

Detailed Description

Definition at line 64 of file RhoFindOmittedParticle.h.

Constructor & Destructor Documentation

RhoFindOmittedParticle::RhoFindOmittedParticle ( const TLorentzVector &  ip4Reson,
const double  imChild,
const double  imSought,
const Bool_t  izBoostApprox = kTRUE 
)

Definition at line 87 of file RhoFindOmittedParticle.cxx.

References beta, cmEChild, cmpChild2, fabs(), and mSought2.

94  : mSought2 ( imSought* imSought )
95  , zBoostApprox ( izBoostApprox )
96  , p4ObsCache ( 0.0,0.0,0.0,-1.0 ) // Non-physical initial value
97 {
98  if ( imChild == 0.0 ) {
99  cerr << "RhoFindOmittedParticle constructed with mChild=0" << endl;
100  }
101 
102  if ( mSought2 == 0.0 ) {
103  cerr << "RhoFindOmittedParticle constructed with mSought=0" << endl;
104  }
105 
106  // Figure out the boost vectors to and from the center of mass
107 
108  //p4Reson = ip4Reson;
109  beta = -ip4Reson.BoostVector();
110 
111  // Figure out the decay energies, gamma factors, beta factors.
112  // Assume that resonance decays to two "child" particles (e.g. B + Bbar)
113 
114  cmEChild = ip4Reson.Mag() / 2;
115 
116  if ( cmEChild < fabs ( imChild ) ) {
117  cerr << "RhoFindOmittedParticle: mChild too large for decay" << endl;
118  }
119 
120  // The square of the three-momentum of the child (B0).
121  cmpChild2 = cmEChild*cmEChild - imChild*imChild;
122 
123 }
TVector3 beta
The other vector, stored.
TLorentzVector p4ObsCache
energy, squared 3-momentum of Child.
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
float cmEChild
Flag: do we approximate boost in.
Bool_t zBoostApprox
squared mass of Sought
RhoFindOmittedParticle::~RhoFindOmittedParticle ( )
virtual

Definition at line 130 of file RhoFindOmittedParticle.cxx.

131 {
132 }

Member Function Documentation

TLorentzVector RhoFindOmittedParticle::ClosestFit ( const TVector3 &  p3Seen)
protected

Definition at line 247 of file RhoFindOmittedParticle.cxx.

References beta, cmAxis, cmESought, cmpSought2, fabs(), openCos, secondChoice, sqrt(), X, Y, Z, and zBoostApprox.

Referenced by FitToSeen().

248 {
249  // Take care of these now to save clock cycles.
250  if ( fabs ( openCos ) > 1.0 ) {
251  return TLorentzVector ( 0.0,0.0,0.0,0.0 ); // Error condition.
252  }
253 
254  TLorentzVector cmp4Sought[2]; // Two intersection points...
255 
256  // Set up local coordinate system:
257  // z = normal z.
258  // x-z plane contains p3Seen. Since we only keep phi information,
259  // we needn't bother boosting.
260  // I'm doing more stuff by hand than in previous versions in order
261  // to speed things up.
262  double cmCosPlaneAxis2; // Squared cosine between the plane and axis.
263  {
264  // Original, most abstract method:
265  //const TVector3 cmZ(0.0, 0.0, 1.0);
266  //const TVector3 cmX = (p3Seen - p3Seen.dot(cmZ) * cmZ).unit();
267  //const TVector3 cmY = cmZ.cross(cmX);
268 
269  // Slightly faster method:
270  //const TVector3 cmX = TVector3(p3Seen.x(), p3Seen.y(), 0.0).unit();
271  //const TVector3 cmY = TVector3(-cmX.y(), cmX.x(), 0.0);
272 
273  TVector3 cmY;
274  // Fastest method:
275  if ( zBoostApprox ) {
276  cmY = TVector3 ( -p3Seen.Y(), p3Seen.X(), 0.0 ).Unit();
277  } else {
278  cmY = beta.Cross ( p3Seen ).Unit();
279  }
280 
281  const TVector3 unitAxis = cmAxis.Unit();
282 
283  // Projection of unit vector of axis into x-z plane.
284 
285  // Project unitAxis into the xz plane.
286  const TVector3 unitProj = unitAxis - unitAxis.Dot ( cmY ) * cmY;
287  // While we know cmY.z() == 0, doing it by hand would make the
288  // code too baroque for not a great speed advantage.
289 
290  // Square of cosine of angle between plane and axis:
291  cmCosPlaneAxis2 = unitProj.Mag2();
292 
293 
294  if ( cmCosPlaneAxis2 < openCos*openCos ) {
295  return TLorentzVector ( 0.0,0.0,0.0,0.0 ); // Error condition.
296  }
297 
298  // Projection of full axis into x-z plane.
299  // Actually, it's longer; touches the base of the cone.
300  // cmAxis is projection of unitProj, hence 1/cosine.
301 
302  const TVector3 axisProj =
303  ( cmAxis.Mag() / ( cmCosPlaneAxis2 ) ) * unitProj;
304 
305  // vector difference between axisProj and the true
306  // vector, which could lie to either side.
307 
308  //const TVector3 difference = cmAxis.mag() *
309  //sqrt(1/(openCos*openCos) - 1/(cmCosPlaneAxis2)) *
310  //unitProj.cross(cmY).unit();
311 
312  const TVector3 difference =
313  sqrt ( cmpSought2 - axisProj.Mag2() ) *
314  unitProj.Cross ( cmY ).Unit();
315 
316  cmp4Sought[0] = TLorentzVector ( axisProj + difference, cmESought );
317  cmp4Sought[1] = TLorentzVector ( axisProj - difference, cmESought );
318  }
319 
320 
321  // Boost the results back into the lab frame.
322  // Return whichever one is closer in angle to the seen vector.
323 
324  cmp4Sought[0].Boost ( -beta );
325  cmp4Sought[1].Boost ( -beta );
326 
327  if ( TVector3 ( cmp4Sought[0].X(),cmp4Sought[0].Y(),cmp4Sought[0].Z() ).Unit().Dot ( p3Seen ) >
328  TVector3 ( cmp4Sought[1].X(),cmp4Sought[1].Y(),cmp4Sought[1].Z() ).Unit().Dot ( p3Seen ) ) {
329  secondChoice = cmp4Sought[1];
330  return cmp4Sought[0];
331  } else {
332  secondChoice = cmp4Sought[0];
333  return cmp4Sought[1];
334  }
335 }
TVector3 beta
The other vector, stored.
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
double cmESought
cos of opening angle.
TVector3 cmAxis
From lab to CM (-beta CM to lab)
double Y
Definition: anaLmdDigi.C:68
double openCos
Axis of CM cone.
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
double X
Definition: anaLmdDigi.C:68
Bool_t zBoostApprox
squared mass of Sought
double Z
Definition: anaLmdDigi.C:68
double cmpSought2
CM energy of sought particle.
TLorentzVector RhoFindOmittedParticle::FitToSeen ( const TLorentzVector &  p4Obs,
const TVector3 &  p3Seen 
)

Definition at line 148 of file RhoFindOmittedParticle.cxx.

References ClosestFit(), MakeCone(), and p4ObsCache.

150 {
151  if ( p4Obs != p4ObsCache ) {
152  this->MakeCone ( p4Obs );
153  p4ObsCache = p4Obs;
154  }
155  return this->ClosestFit ( p3Seen );
156 }
TLorentzVector p4ObsCache
energy, squared 3-momentum of Child.
void MakeCone(const TLorentzVector &p4Obs)
TLorentzVector ClosestFit(const TVector3 &p3Seen)
void RhoFindOmittedParticle::MakeCone ( const TLorentzVector &  p4Obs)
protected

Definition at line 166 of file RhoFindOmittedParticle.cxx.

References beta, cmAxis, cmEChild, cmESought, cmpChild2, cmpSought2, mSought2, openCos, and sqrt().

Referenced by FitToSeen().

167 {
168  // Get the observed mass, figure out the decay momentum of the
169  // child -> sought + observed.
170 
171  // Square of mass of observed particle.
172  //const double mObs2 = p4Obs.Mag2();
173 
174  /* This was an old, labor-intensive way of calculating the
175  decay momentum. Using conservation of energy is much simpler to
176  understand and faster to compute.
177  // The following is a solution of sqrt(pDecay*pDecay + mSought*mSought)
178  // + sqrt(pDecay*pDecay + mObs*mObs) == mChild
179  double pDecay;
180  {
181  double temp;
182 
183  temp = (mObs2 - mSought*mSought) / mChild;
184  temp *= temp;
185  temp += mChild*mChild - 2 * (mObs2 + mSought*mSought);
186 
187  pDecay = 0.5 * sqrt(temp);
188  }
189 
190  //const double EObsDecay = sqrt(mObs2 + pDecay*pDecay);
191  //const double ESoughtDecay = sqrt(mSought*mSought + pDecay*pDecay);
192  */
193 
194 
195  // Boost vectors into the CM frame; extract vital statistics.
196 
197  TLorentzVector cmp4Obs ( p4Obs );
198  cmp4Obs.Boost ( beta );
199 
200  //const double cmEObs = cmp4Obs.t();
201  const double cmpObs2 = TVector3 ( cmp4Obs.X(),cmp4Obs.Y(),cmp4Obs.Z() ).Mag2();
202 
203  cmESought = cmEChild - cmp4Obs.T();
204  double cmESought2 = cmESought*cmESought;
205  if ( cmESought2 > mSought2 ) {
206  cmpSought2 = cmESought2 - mSought2;
207  } else {
208  cmpSought2 = 0.0;
209  }
210 
211 
212 
213  /*
214  * Because we know the lengths of the 3 momentum 3-vectors, we can
215  * get the angles using the law of cosines.
216  * abs(openCos) > 1 signifies an error, causing closestFit to return
217  * a zero vector, signifying an error.
218  */
219 
220  const double cmpSought = sqrt ( cmpSought2 );
221 
222  if ( cmpSought != 0 )
223  openCos =
224  ( cmpObs2 + cmpSought2 - cmpChild2 ) /
225  ( 2 * sqrt ( cmpObs2 ) * cmpSought );
226  else {
227  openCos = 2; // Error condition.
228  }
229 
230  cmAxis = -TVector3 ( cmp4Obs.X(),cmp4Obs.Y(),cmp4Obs.Z() ).Unit() * openCos * cmpSought;
231 
232 }
TVector3 beta
The other vector, stored.
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
double cmESought
cos of opening angle.
TVector3 cmAxis
From lab to CM (-beta CM to lab)
double openCos
Axis of CM cone.
float cmEChild
Flag: do we approximate boost in.
double cmpSought2
CM energy of sought particle.
TLorentzVector RhoFindOmittedParticle::SecondVector ( ) const

Definition at line 344 of file RhoFindOmittedParticle.cxx.

References secondChoice.

345 {
346  return secondChoice;
347 }

Member Data Documentation

TVector3 RhoFindOmittedParticle::beta
protected

The other vector, stored.

Definition at line 111 of file RhoFindOmittedParticle.h.

Referenced by ClosestFit(), MakeCone(), and RhoFindOmittedParticle().

TVector3 RhoFindOmittedParticle::cmAxis
protected

From lab to CM (-beta CM to lab)

Definition at line 114 of file RhoFindOmittedParticle.h.

Referenced by ClosestFit(), and MakeCone().

float RhoFindOmittedParticle::cmEChild
protected

Flag: do we approximate boost in.

Definition at line 102 of file RhoFindOmittedParticle.h.

Referenced by MakeCone(), and RhoFindOmittedParticle().

double RhoFindOmittedParticle::cmESought
protected

cos of opening angle.

Definition at line 116 of file RhoFindOmittedParticle.h.

Referenced by ClosestFit(), and MakeCone().

float RhoFindOmittedParticle::cmpChild2
protected

Definition at line 102 of file RhoFindOmittedParticle.h.

Referenced by MakeCone(), and RhoFindOmittedParticle().

double RhoFindOmittedParticle::cmpSought2
protected

CM energy of sought particle.

Definition at line 117 of file RhoFindOmittedParticle.h.

Referenced by ClosestFit(), and MakeCone().

float RhoFindOmittedParticle::mSought2
protected

Definition at line 96 of file RhoFindOmittedParticle.h.

Referenced by MakeCone(), and RhoFindOmittedParticle().

double RhoFindOmittedParticle::openCos
protected

Axis of CM cone.

Definition at line 115 of file RhoFindOmittedParticle.h.

Referenced by ClosestFit(), and MakeCone().

TLorentzVector RhoFindOmittedParticle::p4ObsCache
protected

energy, squared 3-momentum of Child.

Definition at line 105 of file RhoFindOmittedParticle.h.

Referenced by FitToSeen().

TLorentzVector RhoFindOmittedParticle::secondChoice
protected

Definition at line 108 of file RhoFindOmittedParticle.h.

Referenced by ClosestFit(), and SecondVector().

Bool_t RhoFindOmittedParticle::zBoostApprox
protected

squared mass of Sought

Definition at line 98 of file RhoFindOmittedParticle.h.

Referenced by ClosestFit().


The documentation for this class was generated from the following files: