FairRoot/PandaRoot
RhoCandidate.cxx
Go to the documentation of this file.
1 // //
3 // RhoCandidate //
4 // //
5 // Contains (polymorphic) contents for RhoCandidate objects //
6 // Candidate "Tracks" or "Particles" for analysis use //
7 // //
8 // Author List: //
9 // Sascha Berger, RUB, Feb.99 //
10 // Marcel Kunze, RUB, Aug.99 //
11 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
12 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
13 // //
15 
16 #include <assert.h>
17 
18 //#include "RhoBase/TRho.h"
19 #include "RhoBase/RhoFactory.h"
20 #include "RhoBase/RhoCandidate.h"
21 #include "RhoBase/RhoCandidate.h"
22 #include "RhoBase/RhoCandList.h"
24 #include "RhoMath/RhoError.h"
25 #include "RhoMath/RhoVector3Err.h"
26 #include "TVector3.h"
27 #include "TLorentzVector.h"
28 #include "RhoCalculationTools.h"
29 
30 #include "TDatabasePDG.h"
31 
33 
34 #include <iostream>
35 #include <iomanip>
36 #include <sstream>
37 using namespace std;
38 
40  fFastMode ( kFALSE ),
41  fLocked ( kFALSE ),
42  fTheMother ( 0 ),
43 // fDecayVtx ( 0 ),
44  fPdtEntry ( 0 ),
45  fPdgCode ( 0 ),
46  fIsAResonance ( kFALSE ),
47  //fTruth ( 0 ),
48  fMicroCand ( 0 ),
49  fTrackNumber ( -1 ),
50  fUid ( 0 ),
51  fNDaug ( 0 ),
52  //fDaugList ( 0 ),
53  fNCons ( 0 ),
54  fChi2 ( 0 ),
55  fMcTruth ( 0 ),
56  fFit ( 0 )
57 {
58  fMarker[0] = fMarker[1] = fMarker[2] = fMarker[3] = 0;
59  SetUid();
60  SetPidInfo ( 0 );
61  for ( int i=0; i<30; i++ ) { fPidLH[i]=-999999.;}
62  for ( int i=0; i<MATRIXSIZE; i++ ) { fErrP7[i] = 0.; }
63 }
64 
65 RhoCandidate::RhoCandidate ( const TLorentzVector& v, Double_t charge, RhoVector3Err* vp ) :
66  fFastMode ( kFALSE ),
67  fLocked ( kFALSE ),
68  fTheMother ( 0 ),
69 // fDecayVtx ( vp ),
70  fPdtEntry ( 0 ),
71  fPdgCode ( 0 ),
72  fIsAResonance ( kFALSE ),
73  // fTruth ( 0 ),
74  fMicroCand ( 0 ),
75  fTrackNumber ( -1 ),
76  fUid ( 0 ),
77  fNDaug ( 0 ),
78  //fDaugList ( 0 ),
79  fNCons ( 0 ),
80  fChi2 ( 0 ),
81  fMcTruth ( 0 ),
82  fFit ( 0 )
83 {
84  fMarker[0] = fMarker[1] = fMarker[2] = fMarker[3] = 0;
85  SetCharge ( charge );
86  SetP7 ( ( vp!=0 ? *((TVector3*)vp) : TVector3 ( 0.,0.,0. ) ), v );
87  SetUid();
88  SetPidInfo ( 0 );
89  for ( int i=0; i<30; i++ ) { fPidLH[i]=-999999.;}
90  for ( int i=0; i<MATRIXSIZE; i++ ) { fErrP7[i] = 0.; }
91 }
92 
93 
94 RhoCandidate::RhoCandidate ( const TVector3& v, const TParticlePDG* pdt, RhoVector3Err* vp ) :
95  fFastMode ( kFALSE ),
96  fLocked ( kFALSE ),
97  fTheMother ( 0 ),
98 // fDecayVtx ( vp ),
99  fPdtEntry ( 0 ),
100  fPdgCode ( 0 ),
101  fIsAResonance ( kFALSE ),
102 // fTruth ( 0 ),
103  fMicroCand ( 0 ),
104  fTrackNumber ( -1 ),
105  fUid ( 0 ),
106  fNDaug ( 0 ),
107  // fDaugList ( 0 ),
108  fNCons ( 0 ),
109  fChi2 ( 0 ),
110  fMcTruth ( 0 ),
111  fFit ( 0 )
112 {
113  fMarker[0] = fMarker[1] = fMarker[2] = fMarker[3] = 0;
114  SetPos ( vp!=0 ? *((TVector3*)vp) : TVector3 ( 0.,0.,0. ) );
115  SetP3 ( v );
116  SetType ( pdt );
117  SetUid();
118  SetPidInfo ( 0 );
119  for ( int i=0; i<30; i++ ) {fPidLH[i]=-999999.; }
120  for ( int i=0; i<MATRIXSIZE; i++ ) { fErrP7[i] = 0.; }
121 }
122 
123 
124 RhoCandidate::RhoCandidate ( const RhoCandidate& o ) : FairMultiLinkedData_Interface(o)
125 {
126  fFastMode = o.fFastMode;
127  fLocked = kFALSE;
128  fTheMother = 0;
129  fDecayVtx = o.fDecayVtx;
130  fPdtEntry = o.fPdtEntry;
131  fPdgCode = o.fPdgCode;
133 // fTruth = o.fTruth;
135  fUid = o.fUid;
136  fNDaug = o.fNDaug;
138 
139  fMarker[0] = o.fMarker[0];
140  fMarker[1] = o.fMarker[1];
141  fMarker[2] = o.fMarker[2];
142  fMarker[3] = o.fMarker[3];
143 
144  fCharge = o.fCharge;
151  fEnergy = o.fEnergy;
152 
153  if ( !fFastMode ) {
154  int i;
155  for ( i=0; i<MATRIXSIZE; i++ ) { fErrP7[i] = o.fErrP7[i]; }
156  }
157 
158  for ( int i=0; i<o.fNDaug; i++ ) {
159  fDaughters[i] = o.fDaughters[i];
160  }
161 
162  fNCons = 0;
163 // if (o.nCons > 0) {
164 // for (int i=0;i<o.nCons;i++) AddConstraint(*o.fConstraints[i]);
165 // }
166 
167  for ( int i=0; i<30; i++ ) {
168  fPidLH[i]=o.fPidLH[i];
169  }
170 
171  fMcTruth=o.fMcTruth;
172  SetInsertHistory(kFALSE);
173  AddLinks(o.GetLinksWithType(FairRootManager::Instance()->GetBranchId("MCTrack")));
174 
175  //FIXME Do we want to carry these status flags?
176  fChi2 = 0 ;
177  fFit = 0 ;
178 }
179 
180 // This is the special constructor to bring a RhoCandidate into
181 // life from the MicroCandidate
182 
184  fFastMode ( kFALSE ),
185  fLocked ( kFALSE ),
186  fTheMother ( 0 ),
187  fDecayVtx ( ), //default?
188  fPdtEntry ( 0 ),
189  fPdgCode ( 0 ),
190  fIsAResonance ( kFALSE ),
191  // fTruth ( 0 ),
192  fMicroCand ( &a ),
193  fTrackNumber ( -1 ),
194  fNDaug ( 0 ),
195  //fDaugList ( 0 ),
196  fNCons ( 0 ),
197  fChi2 ( 0 ),
198  fMcTruth ( 0 ),
199  fFit ( 0 )
200 {
201  fMarker[0] = fMarker[1] = fMarker[2] = fMarker[3] = 0;
202  // Set kinematics from MicroCandidate
203 
204  SetP4 ( a.GetLorentzVector() );
205  SetPos ( a.GetPosition() );
206  SetCharge ( a.GetCharge() );
207 
208  if ( !fFastMode ) {
209  const Float_t* err = a.GetErrorP7(); // 4 momentum & point
210  //const Float_t* cov = a.GetCov(); // helix cov
211  //const Float_t* par = a.GetParams(); // helix params
212  int i;
213  if ( err!=0 ) for ( i=0; i<MATRIXSIZE; i++ ) { fErrP7[i] = err[i]; }
214  }
215 
216  SetUid ( n );
217  SetInsertHistory(kFALSE);
218  AddLinks(a.GetLinksWithType(FairRootManager::Instance()->GetBranchId("MCTrack")));
219 
220  SetPidInfo ( 0 );
221 }
222 
223 
225  fFastMode ( fast ),
226  fLocked ( kFALSE ),
227  fTheMother ( 0 ),
228  fDecayVtx ( vp ),
229  fPdtEntry ( 0 ),
230  fPdgCode ( 0 ),
231  fIsAResonance ( kFALSE ),
232  // fTruth ( 0 ),
233  fMicroCand ( &a ),
234  fTrackNumber ( -1 ),
235  fNDaug ( 0 ),
236  //fDaugList ( 0 ),
237  fNCons ( 0 ),
238  fChi2 ( 0 ),
239  fMcTruth ( 0 ),
240  fFit ( 0 )
241 {
242  fMarker[0] = fMarker[1] = fMarker[2] = fMarker[3] = 0;
243  // Set kinematics from MicroCandidate
244 
245  SetP4 ( a.GetLorentzVector() );
246  SetPos ( a.GetPosition() );
247  SetCharge ( a.GetCharge() );
248 
249  if ( !fFastMode ) {
250  const Float_t* err = a.GetErrorP7(); // 4 momentum & point
251  //const Float_t* cov = a.GetCov(); // helix cov
252  //const Float_t* par = a.GetParams(); // helix params
253  int i;
254  if ( err!=0 ) for ( i=0; i<MATRIXSIZE; i++ ) { fErrP7[i] = err[i]; }
255  }
256 
257  SetUid ( n );
258  SetInsertHistory(kFALSE);
259  AddLinks(a.GetLinksWithType(FairRootManager::Instance()->GetBranchId("MCTrack")));
260 
261  SetPidInfo ( 0 );
262 }
263 
264 
265 
266 //--------------
267 // Destructor --
268 //--------------
269 
271 {
272  //RemoveAssociations();
273 }
274 
275 //--------------
276 // Operations --
277 //--------------
278 
279 // assignment double
282 {
283  FairMultiLinkedData_Interface::operator=(o);
284  fFastMode = o.fFastMode;
285  fLocked = kFALSE;
286  fTheMother = 0;
287  fDecayVtx = o.fDecayVtx;
288  fPdtEntry = o.fPdtEntry;
289  fPdgCode = o.fPdgCode;
291 // fTruth = o.fTruth;
293  fUid = o.fUid;
294  fNDaug = o.fNDaug;
296 
297  fMarker[0] = o.fMarker[0];
298  fMarker[1] = o.fMarker[1];
299  fMarker[2] = o.fMarker[2];
300  fMarker[3] = o.fMarker[3];
301 
302  fCharge = o.fCharge;
309  fEnergy = o.fEnergy;
310 
311  if ( !fFastMode ) {
312  int i;
313  for ( i=0; i<MATRIXSIZE; i++ ) { fErrP7[i] = o.fErrP7[i]; }
314  }
315 
316  for ( int i=0; i<o.fNDaug; i++ ) {
317  fDaughters[i] = o.fDaughters[i];
318  }
319 
320  fNCons = 0;
321 // if (o.nCons > 0) {
322 // for (int i=0;i<o.nCons;i++) AddConstraint(*o.fConstraints[i]);
323 // }
324 
325  for ( int i=0; i<30; i++ ) {
326  fPidLH[i]=o.fPidLH[i];
327  }
328 
329  fMcTruth=o.fMcTruth;
330 
331  return *this;
332 }
333 
334 
335 
336 void
338 {
339  SetP4 ( m, P3() );
340 }
341 
342 void
344 {
345  Double_t oldP = P();
346  assert ( oldP>0 );
347  Double_t P2 = pow ( mEnergy, 2 ) - pow ( mass, 2 );
348  assert ( P2>0 );
349  Double_t newP = sqrt ( P2 );
350  fXmomentum = fXmomentum*newP/oldP;
351  fYmomentum = fYmomentum*newP/oldP;
352  fZmomentum = fZmomentum*newP/oldP;
353  fEnergy = mEnergy;
354 }
355 
356 void
357 RhoCandidate::SetPosition ( const TVector3& pos )
358 {
359  fXposition = pos.X();
360  fYposition = pos.Y();
361  fZposition = pos.Z();
362 }
363 
364 void
365 RhoCandidate::SetP3 ( const TVector3& p3 )
366 {
367  // assumes mass is well defined
368  Double_t mass = M();
369  SetP4 ( mass, p3 );
370 }
371 
372 void
373 RhoCandidate::SetP4 ( Double_t mass, const TVector3& p3 )
374 {
375  fXmomentum = p3.X();
376  fYmomentum = p3.Y();
377  fZmomentum = p3.Z();
378  Double_t En = sqrt ( mass*mass + p3.Mag2() );
379  //assert( En>0 );
380  fEnergy = En;
381 }
382 
383 void
384 RhoCandidate::SetP4 ( const TLorentzVector& p4 )
385 {
386  fXmomentum = p4.X();
387  fYmomentum = p4.Y();
388  fZmomentum = p4.Z();
389  fEnergy = p4.T();
390 }
391 
392 void
393 RhoCandidate::SetP7 ( const TVector3& pos, const TLorentzVector& p4 )
394 {
395  SetPos ( pos );
396  SetP4 ( p4 );
397 }
398 
399 void RhoCandidate::SetCovPos ( const TMatrixD& errPos )
400 {
401  //Int_t ind = 0;
402  // for(int i=0;i<3; i++)
403  // for(int j=i;j<3;j++)fErrP7[ind++] = errPos[j][i];
404  fErrP7[0] = errPos[0][0];
405  fErrP7[1] = errPos[1][0];
406  fErrP7[2] = errPos[1][1];
407  fErrP7[3] = errPos[2][0];
408  fErrP7[4] = errPos[2][1];
409  fErrP7[5] = errPos[2][2];
410 }
411 
412 void
414 {
415  // position error
416 
417  fErrP7[0] = cov7 ( 0,0 );
418  fErrP7[1] = cov7 ( 1,0 );
419  fErrP7[2] = cov7 ( 1,1 );
420  fErrP7[3] = cov7 ( 2,0 );
421  fErrP7[4] = cov7 ( 2,1 );
422  fErrP7[5] = cov7 ( 2,2 );
423 
424  // position-momentum covariance
425 
426  fErrP7[6] = cov7 ( 3,0 );
427  fErrP7[7] = cov7 ( 3,1 );
428  fErrP7[8] = cov7 ( 3,2 );
429  fErrP7[9] = cov7 ( 4,0 );
430  fErrP7[10] = cov7 ( 4,1 );
431  fErrP7[11] = cov7 ( 4,2 );
432  fErrP7[12] = cov7 ( 5,0 );
433  fErrP7[13] = cov7 ( 5,1 );
434  fErrP7[14] = cov7 ( 5,2 );
435  fErrP7[15] = cov7 ( 6,0 );
436  fErrP7[16] = cov7 ( 6,1 );
437  fErrP7[17] = cov7 ( 6,2 );
438 
439  // momentum error
440  fErrP7[18] = cov7 ( 3,3 );
441  fErrP7[19] = cov7 ( 4,3 );
442  fErrP7[20] = cov7 ( 4,4 );
443  fErrP7[21] = cov7 ( 5,3 );
444  fErrP7[22] = cov7 ( 5,4 );
445  fErrP7[23] = cov7 ( 5,5 );
446  fErrP7[24] = cov7 ( 6,3 );
447  fErrP7[25] = cov7 ( 6,4 );
448  fErrP7[26] = cov7 ( 6,5 );
449  fErrP7[27] = cov7 ( 6,6 );
450 }
451 
452 void
453 RhoCandidate::SetCov7 ( const TMatrixD& covPos, const TMatrixD& covP4 )
454 {
455  // position error
456 
457  fErrP7[0] = covPos ( 0,0 );
458  fErrP7[1] = covPos ( 1,0 );
459  fErrP7[2] = covPos ( 1,1 );
460  fErrP7[3] = covPos ( 2,0 );
461  fErrP7[4] = covPos ( 2,1 );
462  fErrP7[5] = covPos ( 2,2 );
463 
464  // position-momentum covariance
465 
466  fErrP7[6] = 0;
467  fErrP7[7] = 0;
468  fErrP7[8] = 0;
469  fErrP7[9] = 0;
470  fErrP7[10] = 0;
471  fErrP7[11] = 0;
472  fErrP7[12] = 0;
473  fErrP7[13] = 0;
474  fErrP7[14] = 0;
475  fErrP7[15] = 0;
476  fErrP7[16] = 0;
477  fErrP7[17] = 0;
478 
479  // momentum error
480  fErrP7[18] = covP4 ( 0,0 );
481  fErrP7[19] = covP4 ( 1,0 );
482  fErrP7[20] = covP4 ( 1,1 );
483  fErrP7[21] = covP4 ( 2,0 );
484  fErrP7[22] = covP4 ( 2,1 );
485  fErrP7[23] = covP4 ( 2,2 );
486  fErrP7[24] = covP4 ( 3,0 );
487  fErrP7[25] = covP4 ( 3,1 );
488  fErrP7[26] = covP4 ( 3,2 );
489  fErrP7[27] = covP4 ( 3,3 );
490 }
491 
492 void
493 RhoCandidate::SetCov7 ( const TMatrixD& covPos, const TMatrixD& covP4, const TMatrixD& covPosP4 )
494 {
495  // position error
496 
497  fErrP7[0] = covPos ( 0,0 );
498  fErrP7[1] = covPos ( 1,0 );
499  fErrP7[2] = covPos ( 1,1 );
500  fErrP7[3] = covPos ( 2,0 );
501  fErrP7[4] = covPos ( 2,1 );
502  fErrP7[5] = covPos ( 2,2 );
503 
504  // position-momentum covariance
505 
506  fErrP7[6] = covPosP4 ( 0,0 );
507  fErrP7[7] = covPosP4 ( 0,1 );
508  fErrP7[8] = covPosP4 ( 0,2 );
509  fErrP7[9] = covPosP4 ( 1,0 );
510  fErrP7[10] = covPosP4 ( 1,1 );
511  fErrP7[11] = covPosP4 ( 1,2 );
512  fErrP7[12] = covPosP4 ( 2,0 );
513  fErrP7[13] = covPosP4 ( 2,1 );
514  fErrP7[14] = covPosP4 ( 2,2 );
515  fErrP7[15] = covPosP4 ( 3,0 );
516  fErrP7[16] = covPosP4 ( 3,1 );
517  fErrP7[17] = covPosP4 ( 3,2 );
518 
519  // momentum error
520  fErrP7[18] = covP4 ( 0,0 );
521  fErrP7[19] = covP4 ( 1,0 );
522  fErrP7[20] = covP4 ( 1,1 );
523  fErrP7[21] = covP4 ( 2,0 );
524  fErrP7[22] = covP4 ( 2,1 );
525  fErrP7[23] = covP4 ( 2,2 );
526  fErrP7[24] = covP4 ( 3,0 );
527  fErrP7[25] = covP4 ( 3,1 );
528  fErrP7[26] = covP4 ( 3,2 );
529  fErrP7[27] = covP4 ( 3,3 );
530 }
531 
532 void
534 {
535  // position error
536 
537  fErrP7[0] = 0;
538  fErrP7[1] = 0;
539  fErrP7[2] = 0;
540  fErrP7[3] = 0;
541  fErrP7[4] = 0;
542  fErrP7[5] = 0;
543 
544  // position-momentum covariance
545 
546  fErrP7[6] = 0;
547  fErrP7[7] = 0;
548  fErrP7[8] = 0;
549  fErrP7[9] = 0;
550  fErrP7[10] = 0;
551  fErrP7[11] = 0;
552  fErrP7[12] = 0;
553  fErrP7[13] = 0;
554  fErrP7[14] = 0;
555  fErrP7[15] = 0;
556  fErrP7[16] = 0;
557  fErrP7[17] = 0;
558 
559  // momentum error
560  fErrP7[18] = covP4 ( 0,0 );
561  fErrP7[19] = covP4 ( 1,0 );
562  fErrP7[20] = covP4 ( 1,1 );
563  fErrP7[21] = covP4 ( 2,0 );
564  fErrP7[22] = covP4 ( 2,1 );
565  fErrP7[23] = covP4 ( 2,2 );
566  fErrP7[24] = covP4 ( 3,0 );
567  fErrP7[25] = covP4 ( 3,1 );
568  fErrP7[26] = covP4 ( 3,2 );
569  fErrP7[27] = covP4 ( 3,3 );
570 }
571 
572 
573 void
574 RhoCandidate::Set ( const TVector3& pos,
575  const TLorentzVector& p4,
576  const TMatrixD& cov7 )
577 {
578  SetP7 ( pos, p4 );
579  SetCov7 ( cov7 );
580 }
581 
582 void
584  const RhoVector3Err& posErr,
585  const RhoVector3Err& p3Err,
586  const TMatrixD& xpErr )
587 {
588  SetPos ( posErr );
589  SetP4 ( mass, p3Err );
590 
591  // compute the jacobian, assuming that mass is a well defined quantity
592  TMatrixD jacobian ( 4, 3 );
593  jacobian ( 0,0 ) = 1.0;
594  jacobian ( 0,1 ) = 0.0;
595  jacobian ( 0,2 ) = 0.0;
596  jacobian ( 1,0 ) = 0.0;
597  jacobian ( 1,1 ) = 1.0;
598  jacobian ( 1,2 ) = 0.0;
599  jacobian ( 2,0 ) = 0.0;
600  jacobian ( 2,1 ) = 0.0;
601  jacobian ( 2,2 ) = 1.0;
602  jacobian ( 3,0 ) = fXmomentum/fEnergy;
603  jacobian ( 3,1 ) = fYmomentum/fEnergy;
604  jacobian ( 3,2 ) = fZmomentum/fEnergy;
605  TMatrixD xp4Cov ( 3,4 );
606  for ( int i=0; i<3; i++ ) {
607  xp4Cov ( i,3 ) = 0;
608  for ( int j=0; j<3; j++ ) {
609  xp4Cov ( i,j ) = xpErr ( i,j );
610  xp4Cov ( i,3 ) += xpErr ( i,j ) *jacobian ( 3,j );
611  }
612  }
613 
614  // Sets the covariance matrix
615  SetCov7 ( posErr.CovMatrix(), p3Err.CovMatrix().Similarity ( jacobian ),xp4Cov );
616 }
617 
618 
619 
620 
621 
622 
623 void
625 {
626  assert ( m!=0 ); // what kind of mother is it ?!
627 
628  // we have already a mother ? not allowed !
629  assert ( fTheMother==0 );
630 
631  // should not be called for a local candidate...
632  //assert( !isLocal() );
633 
634  // commented by KG, 2/2012
635  // if (m->nDaug>=5) {
636  // cerr << "RhoCandidate::SetMotherLink: Can not add more than 5 daughters." << endl;
637  // return;
638  //}
639 
640  // set the mother link
641  fTheMother = m;
642 
643  // ... and the mother's daughter link
644  //fTheMother->fDaughters.push_back(this);
645  fTheMother->AddDaughterLinkSimple ( this , verbose);
646  // No markers set. MC candidates will not be "combined".
647 
648  // special for MC trees
649  if ( fTheMother==0 ) { fTheMother=m; }
650 
651  // if it's a resonance and the mother has already a decay vertex,
652  // set the decay vertex of the mother to the daughter
653  if ( IsAResonance()) {
655  // if it is a resonance and the mother has no other vertex, the vertex of the reonance is given to her.
656  }
657 
658 }
659 
660 void
662 {
663  // no mother
664  if ( fTheMother==0 ) { return; }
665 
666  // the mother looses this as a daughter
667  for ( int i=0; i<fTheMother->NDaughters(); i++ )
668  {
669  if ( fTheMother->fDaughters[i] == this ) {
670  fTheMother->RemoveDaughter(this);
671  break;
672  }
673  }
674  fTheMother = 0;
675 }
676 
677 
678 // void
679 // RhoCandidate::AddToVertexingList ( RhoCandList& outGoing )
680 // {
681 // if ( IsAResonance() )
682 // {
683 // for ( int i=0;i<nDaug;i++ ) fDaughters[i]->AddToVertexingList ( outGoing );
684 // }
685 // else
686 // outGoing.Put ( *this );
687 // }
688 
689 const RhoCandidate*
691 {
692  if ( IsCloneOf ( c ) ) { return this; }
693  for ( int i=0; i<NDaughters(); i++ ) {
694  const RhoCandidate* b = fDaughters[i]->CloneInTree ( c );
695  if ( b!=0 ) { return b; }
696  }
697  return 0;
698 }
699 
700 
701 void
703 {
704  // new function (GHM 05/99)
705  // this function invalidates the fit to let fitters know
706  // that if given this candidate, they have to refit it.
707 
708 // TVector3* theDecayVtx = DecayVtx();
709 // if ( theDecayVtx!=0 )
710 // {
711 // if ( theDecayVtx->Status() != VAbsVertex::UnFitted )
712 // {
713 // // clone the vertex...
714 // VAbsVertex* newDecayVtx = ( VAbsVertex* ) theDecayVtx->Clone();
715 //
716 // // ...and invalid the clone
717 // newDecayVtx->SetStatus ( VAbsVertex::UnFitted );
718 //
719 // // now set the new decay vertex
720 // SetDecayVtx ( newDecayVtx );
721 // }
722 // }
723 
724  // and do that recursively
725  for ( int i=0; i<NDaughters(); i++ ) { fDaughters[i]->InvalidateFit(); }
726 }
727 
728 
730 {
731  Double_t b2 = bx*bx + by*by + bz*bz;
732  Double_t gamma = 1.0 / sqrt ( 1.0 - b2 );
733  Double_t bp = bx*fXmomentum + by*fYmomentum + bz*fZmomentum;
734  Double_t gamma2 = b2 > 0 ? ( gamma - 1.0 ) /b2 : 0.0;
735 
736  fXmomentum = fXmomentum + gamma2*bp*bx + gamma*bx*fEnergy;
737  fYmomentum = fYmomentum + gamma2*bp*by + gamma*by*fEnergy;
738  fZmomentum = fZmomentum + gamma2*bp*bz + gamma*bz*fEnergy;
739  fEnergy = gamma* ( fEnergy + bp );
740 }
741 
742 
745 {
746  a.PrintOn ( o );
747  return o;
748 }
749 
750 // const RhoVector3Err* RhoCandidate::ProductionVtx() const
751 // {
752 // if ( fTheMother!=0 ) { return fTheMother->DecayVtx(); }
753 // else { return 0; }
754 // }
755 
757 {
758  return Equals ( c ) ;
759 }
760 
762 {
763  // return ( (*this)!=(*c) ) ;
764  return !Equals(c);
765 }
766 
767 // This comes from the content
768 
769 
770 
771 void
773 {
774  if ( IsComposite() ) {
775  // this implementation leaves P unchanged; subclasses may differ
776  fEnergy = mEnergy;
777  //RhoCandidate::SetEnergy ( mEnergy );
778  } else {
779  SetMassAndEnergy ( Mass(), mEnergy );
780  }
781 }
782 
783 void
785 {
786  // this implementation leaves mass unchanged; subclasses may differ
787  Double_t pscale = ( P() == 0 ? 0 : newp / P() );
788  SetP3 ( pscale*P3() );
789 }
790 
791 void
792 RhoCandidate::SetType ( int pdgcode )
793 {
794  fPdgCode=pdgcode;
795  TDatabasePDG* pdg = TDatabasePDG::Instance(); // Access particle DB
796  TParticlePDG* pdt=pdg->GetParticle ( pdgcode );
797  if ( pdt ) { SetType ( pdt ); }
798  //else Warning("RhoCandidate::SetType","unknown pdg code %i",pdgcode);
799 }
800 
801 void
803 {
804  TDatabasePDG* pdg = TDatabasePDG::Instance(); // Access particle DB
805  TParticlePDG* pdt=pdg->GetParticle ( name );
806  if ( pdt ) { SetType ( pdt ); }
807  else Warning("RhoCandidate::SetType","unknown particle \"%s\"",name);
808 }
809 
810 void
811 RhoCandidate::SetType ( const TParticlePDG* pdt )
812 {
813  if ( pdt==fPdtEntry || pdt==0 ) { return; }
814  fPdtEntry = pdt;
815  fPdgCode = pdt->PdgCode();
816 
817  // by default :
818  // if the proper lifetime multiplied by light velocity is less than a nanometer,
819  // the candidate is considered a resonance (a state that does not fly)
820  fIsAResonance=kFALSE;
821  if ( fPdtEntry->Width() >1E-15 /*Lifetime()<1e-08*/ ) { fIsAResonance=kTRUE; }
822 
823  double pdgcharge=fPdtEntry->Charge();
824  if(fabs(pdgcharge)>2) pdgcharge/=3.;// TParticlePDG contains charge in units of |e|/3
825  if ( !IsComposite() ) {
826  SetMass(fPdtEntry->Mass());// the mass has changed since the type has changed
827  SetCharge ( pdgcharge ); // set the charge
828  } else {
829  if ( Charge() !=pdgcharge ) {
830  cerr
831  << "ERROR: attempt to call RhoCandidate::SetType(\""
832  << fPdtEntry->GetName()<<" | "<<fPdtEntry->ParticleClass() <<" | Q=" << fPdtEntry->Charge()/3.<< "\") for a composite" << endl
833  << " RhoCandidate whose daughters have total charge "
834  << Charge() << endl;
835  //assert( Charge()==pdt->Charge() );
836  }
837  }
838 }
839 
840 
841 void
843 {
844 
845  // protection against null pointers
846  //if ( theVtx==0 ) { return; }
847 
848  //
849  // Warning : this is a recursive algorithm
850  //
851 
852  // this vertex is not already set
853  //if ( fDecayVtx!=theVtx ) {
854  // set the new decay vertex reference
855  fDecayVtx = theVtx;
856 
857  // } else {
858  // cerr << "trying to reset the same vertex ! " << endl;
859  // this is used to refresh the vertex links
860  //theVtx->_inComingCand=0;
861  //theVtx->_outGoingCands.clear();
862  //theVtx->_resonances.clear();
863  // }
864 
865  // update the vertex back links
866  /* if ( IsAResonance() )
867  theVtx->SetResonances ( this );
868  else
869  {
870  //assert( theVtx->GetInComingCand()==0 );
871  theVtx->SetInComingCand ( this );
872  }
873  // now loop on daughters
874  for ( int i=0;i<nDaug;i++ )
875  {
876  if ( fDaughters[i]->IsAResonance() )
877  fDaughters[i]->SetDecayVtx ( theVtx );
878  else
879  theVtx->SetOutGoingCands ( fDaughters[i] );
880  }*/
881 }
882 
883 // --------------------------------------------------
884 // Geneology functions, no longer in a separate class
885 // --------------------------------------------------
886 
887 Int_t
889 {
890  return fNDaug;
891 }
892 
893 // void
894 // RhoCandidate::AddDaughterLink ( const RhoCandidate* cand )
895 // {
896 // //assert( cand!=0 );
897 //
898 // // first copy the candidate pointer
899 // RhoCandidate* d = const_cast<RhoCandidate*> ( cand );
900 //
901 // // as soon as there are daughters, the charge is
902 // // given by the sum of the daughter charges
903 // if ( NDaughters()==0 ) { SetCharge ( 0 ); }
904 // SetCharge ( Charge() +cand->Charge() );
905 //
906 // // set the daughter's mother link
907 // // ******** modified K Goetzen
908 // d->SetMotherLink ( this );
909 //
910 // fMarker[0] |= d->GetMarker ( 0 );
911 // fMarker[1] |= d->GetMarker ( 1 );
912 // fMarker[2] |= d->GetMarker ( 2 );
913 // fMarker[3] |= d->GetMarker ( 3 );
914 // }
915 
916 void
918 {
919  //assert( cand!=0 );
920 
921  // first copy the candidate pointer
922  RhoCandidate* d = const_cast<RhoCandidate*> ( cand );
923  // as soon as there are daughters, the charge is
924  // given by the sum of the daughter charges
925  if ( NDaughters()==0 ) { SetCharge ( 0 ); }
926  SetCharge ( Charge() +cand->Charge() );
927 
928  if (NDaughters()>=MAXDAUG) {
929  if(verbose)
930  {
931  cerr << "RhoCandidate::AddDaughterLinkSimple: Can not add more than "<<MAXDAUG<<" daughters." << endl;
932  cout <<PdgCode()<<" -> ";
933  for (int i=0;i<fNDaug;++i) cout <<Daughter(i)->PdgCode()<<" ";
934  cout <<"; want to add "<< d->PdgCode() <<endl;
935  }
936  return;
937  }
938 
939  fDaughters[fNDaug++] = d;
940  //fDaughters.push_back(d);
941 
942  // set the daughter's mother link
943  // ******** modified K Goetzen
944  //d->SetMotherLink(this);
945 
946  //fMarker[0] |= d->GetMarker(0);
947  //fMarker[1] |= d->GetMarker(1);
948  //fMarker[2] |= d->GetMarker(2);
949  //fMarker[3] |= d->GetMarker(3);
950 }
951 
952 void
954 {
955  // check for consistency
956  assert ( d!=0 && d->TheMother() ==this );
957 
958  // the charge
959  SetCharge ( Charge() - d->Charge() );
960 
961  for(int i=0;i<NDaughters()-1;i++){
962  if(fDaughters[i]==d){
963  //put last element to a safe place, daughter order is screwed
965  break;
966  }
967  }
968  fNDaug--;
969  //fDaughters.pop_back(); //remove last element
970  // destroy the daughter
971  //delete d;
972 
973 }
974 
975 
976 //
977 // Access functions
978 //
979 
980 Double_t
982 {
983  if ( !IsComposite() && fPdtEntry!=0 ) {
984  return fPdtEntry->Mass();
985  } else {
986  return M();
987  }
988 }
989 
992 {
993  if ( n >=0 && n < fNDaug ) {
994  return fDaughters[n];
995  } else {
996  return 0;
997  }
998 }
999 
1000 // RhoCandListIterator
1001 // RhoCandidate::DaughterIterator() const
1002 // {
1003 // static RhoCandList emptyList;
1004 // static RhoCandListIterator empty ( emptyList );
1005 // if ( NDaughters() ==0 ) { return empty; }
1006 //
1007 // // return an iterator to the daughter list
1008 // RhoCandList* l = const_cast<RhoCandList*> ( fDaugList );
1009 // if ( l==0 ) { l = new RhoCandList ( "DaugList",NDaughters() ); }
1010 // l->Cleanup();
1011 // for ( int i=0; i<NDaughters(); i++ ) { l->Put ( *fDaughters[i] ); }
1012 // return RhoCandListIterator ( *l );
1013 // }
1014 
1015 // TConstraint&
1016 // RhoCandidate::AddConstraint( TConstraint& oneMore )
1017 // {
1018 // TConstraint *newConstraint = new TConstraint(oneMore);
1019 // fConstraints[nCons++] = newConstraint;
1020 // return *newConstraint;
1021 // }
1022 //
1023 // TConstraint&
1024 // RhoCandidate::AddConstraint( TConstraint::Type type )
1025 // {
1026 // TConstraint oneMore( type );
1027 // return AddConstraint( oneMore );
1028 // }
1029 //
1030 // void
1031 // RhoCandidate::RemoveConstraint( const TConstraint& oneLess )
1032 // {
1033 // }
1034 //
1035 // void
1036 // RhoCandidate::RemoveConstraint( TConstraint::Type type )
1037 // {
1038 // TConstraint oneLess(type);
1039 // RemoveConstraint( oneLess );
1040 // }
1041 //
1042 //
1043 // Int_t
1044 // RhoCandidate::NConstraints() const
1045 // {
1046 // return nCons;
1047 // }
1048 //
1049 // const TConstraint*
1050 // RhoCandidate::Constraint( Int_t i )
1051 // {
1052 // if(i>=nCons) return 0;
1053 // return fConstraints[i];
1054 // }
1055 //
1056 // const TConstraint*
1057 // RhoCandidate::Constraint( TConstraint::Type type ) const
1058 // {
1059 // Short_t i;
1060 // for( i=0; i<nCons; i++ )
1061 // {
1062 // if( type==fConstraints[i]->GetType() ) return fConstraints[i];
1063 // }
1064 // return 0;
1065 // }
1066 
1067 // former inline implementations
1068 
1069 // RhoVector3Err*
1070 // RhoCandidate::ProductionVtx()
1071 // {
1072 // if ( fTheMother!=0 ) { return fTheMother->DecayVtx(); }
1073 // else { return 0; }
1074 // }
1075 //
1076 // const RhoVector3Err*
1077 // RhoCandidate::DecayVtx() const
1078 // {
1079 // return fDecayVtx;
1080 // }
1081 //
1082 // RhoVector3Err*
1083 // RhoCandidate::DecayVtx()
1084 // {
1085 // return fDecayVtx;
1086 // }
1087 
1088 const TParticlePDG*
1090 {
1091  return fPdtEntry;
1092 }
1093 
1094 
1095 Bool_t
1097 {
1098  return NDaughters()>0;
1099 }
1100 
1101 Bool_t
1103 {
1104  return fIsAResonance;
1105 }
1106 
1107 void
1109 {
1110  if ( !fIsAResonance ) { return; }
1111  else {
1112  // can only change to new value is a vertex not already present
1113  //assert( fDecayVtx==0 );
1114  fIsAResonance = kFALSE;
1115  }
1116 }
1117 
1118 void
1120 {
1121  if ( fIsAResonance ) { return; }
1122  else {
1123  // can only change to new value is a vertex not already present
1124  //assert( fDecayVtx==0 );
1125  fIsAResonance = kTRUE;
1126  }
1127 }
1128 
1129 TVector3
1131 {
1132  return Pos();
1133 }
1134 
1135 
1137 {
1138  o <<"uid:"<<Uid() <<" trk:"<<GetTrackNumber() << " (" << P4().X() << "," << P4().Y() << "," << P4().Z() << ";" << P4().T() << ") " << Charge() <<"e" << " " << Mass() << " GeV/c2 ";
1139  o.setf ( ios::hex | ios::showbase );
1140  o << " ("
1141  << GetMarker ( 3 )
1142  << ","
1143  << GetMarker ( 2 )
1144  << ","
1145  << GetMarker ( 1 )
1146  << ","
1147  << GetMarker ( 0 )
1148  << ") ";
1149  o.unsetf ( ios::hex | ios::showbase );
1150 
1151  // print daughter links
1152  o << "daughters: "<< NDaughters() <<"(";
1153  for ( int i=0; i<NDaughters(); i++ ) { o << " " << fDaughters[i]->Uid(); }
1154  o <<")";
1155  //o << " dcy: "<<fDecayVtx;
1156  o << " pdg: " <<fPdgCode;
1157  o << " PID:";
1158  for ( int k=0; k<5; k++ ) { o << fPidLH[k] <<","; } // take the first 5 pid entries to check charged p,pi,e,mu,K
1159  o << " mc truth pointer: " << fMcTruth << " ";
1160 #ifdef _HavePrintLinkInfo
1161  FairMultiLinkedData_Interface::PrintLinkInfo(o);
1162 #else
1163 // std::stringstream ss;
1164 // ss << o.rdbuf();
1165 // std::string myString = ss.str();
1166 // FairMultiLinkedData_Interface::Print(myString.c_str());
1167 #endif
1168 }
1169 
1170 
1172 {
1173 
1174  fMarker[0] = fMarker[1] = fMarker[2] = fMarker[3] = 0;
1175 
1176  if ( n<32 ) {
1177  fMarker[0] = 1<<n;
1178  } else if ( n<64 ) {
1179  fMarker[1] = 1<< ( n%32 );
1180  } else if ( n<96 ) {
1181  fMarker[2] = 1<< ( n%64 );
1182  } else if ( n<128 ) {
1183  fMarker[3] = 1<< ( n%96 );
1184  } else {
1185  cout << "RhoCandidate warning: More than 128 tracks; overlap may occur" << endl;
1186  }
1187 }
1188 
1189 // Constructor from CandBase
1190 
1191 // RhoCandidate::RhoCandidate ( TLorentzVector p4,
1192 // RhoError& p4Err,
1193 // RhoCandListIterator& iterDau,
1194 // RhoVector3Err& theVertex,
1195 // const TParticlePDG* hypo )
1196 // :
1197 // fFastMode ( kFALSE ),
1198 // fLocked ( kFALSE ),
1199 // fTheMother ( 0 ),
1200 // fDecayVtx ( 0 ),
1201 // fPdtEntry ( 0 ),
1202 // fPdgCode ( 0 ),
1203 // fIsAResonance ( kFALSE ),
1204 // // fTruth ( 0 ),
1205 // fMicroCand ( 0 ),
1206 // fTrackNumber ( -1 ),
1207 // //fDaugList ( 0 ),
1208 // fNCons ( 0 )
1209 // {
1210 // fMarker[0] = fMarker[1] = fMarker[2] = fMarker[3] = 0;
1211 //
1212 // // create the local candidate
1213 // //createLocalCand();
1214 //
1215 // // first set the mother/daughter links
1216 // RhoCandidate* dau=0;
1217 // iterDau.Rewind();
1218 // Int_t nDau=0;
1219 // while ( dau=iterDau.Next() ) {
1220 // nDau++;
1221 // AddDaughterLink ( dau );
1222 // }
1223 //
1224 // // a composite cand is not supposed not to have a vertex...
1225 // if ( nDau==0 ) {
1226 // cerr << "A composite cand is supposed to have daughters ! " << endl;
1227 // }
1228 //
1229 // // set the trajector
1230 // SetTrajectory ( p4,p4Err, ( Int_t ) Charge(),hypo,&theVertex );
1231 // }
1232 
1233 
1234 // void RhoCandidate::SetTrajectory ( const TLorentzVector& p4, const RhoError& p4Err,
1235 // Int_t charge,const TParticlePDG* hypo,
1236 // RhoVector3Err dVtx )
1237 // {
1238 // if ( dVtx ) {
1239 // SetP7 ( ((TVector3*)dVtx),p4 );
1240 // //SetCov7 ( dVtx->XXCov(),p4Err,dVtx->XPCov() );
1241 // SetCov7 ( dVtx.CovMatrix(),p4Err );
1242 // //BbrPointErr pos(dVtx->point(),dVtx->xxCov());
1243 // //_deferCompTrk = true;
1244 //
1245 // // HepSymMatrix ppc(3);
1246 // // for(Int_t k=0;k<3;k++)
1247 // // for (Int_t j=k;j<3;j++)
1248 // // ppc[j][k]=p4Err[j][k];
1249 // // BbrVectorErr mom(p4.vect(),ppc);
1250 //
1251 // // TrkCompTrk * compTrk=new TrkCompTrk( pos,mom,dVtx->xpCov(),charge,
1252 // // dVtx->chiSquared(),dVtx->nDof());
1253 // // setTrkCompTrk(compTrk);
1254 //
1255 // SetDecayVtx ( dVtx );
1256 // } else {
1257 // SetP4 ( p4 );
1258 // SetCovP4 ( p4Err );
1259 // }
1260 //
1261 // if ( hypo ) { SetType ( hypo ); }
1262 // if ( Uid() ==0 ) { SetUid(); }
1263 // }
1264 
1265 void RhoCandidate::SetUid ( UInt_t uid )
1266 {
1267  static UInt_t u = 10000;
1268  if ( uid!=0 ) {
1269  u = uid;
1270  } else {
1271  u++;
1272  }
1273 
1274  fUid = u;
1275  if ( ( fMarker[0]|fMarker[1]|fMarker[2]|fMarker[3] ) ==0 ) { SetMarker ( u%128 ); }
1276 }
1277 
1278 Bool_t
1279 RhoCandidate::IsCloneOf ( const RhoCandidate& o, Bool_t checkType ) const
1280 {
1281  // Original behaviour of RhoCandidate::IsCloneOf()
1282  if ( Uid() == o.Uid() && !checkType ) { return kTRUE; }
1283 
1284  if ( ( IsComposite() && !o.IsComposite() ) ||
1285  ( !IsComposite() && o.IsComposite() ) ) { return kFALSE; }
1286 
1287  // for single tracks and clusters, it is enough to compare
1288  // UIDs and PDT types
1289  if ( !IsComposite() && !o.IsComposite() ) {
1290  return ( Uid() == o.Uid() &&
1291  ( !checkType || PdtEntry() == o.PdtEntry() ) );
1292  }
1293 
1294  // if we got here, must be true
1295  //return kTRUE;
1296  return kFALSE;
1297 }
1298 
1300 {
1301  // Clean up asociations to allow new w/ placement
1302  //if (fTheMother!=0) DropMotherLink(); fTheMother = 0;
1303 
1304  fTheMother=0; //make sure to drop associations only here.
1305  fNDaug=0;
1306 
1307  // ************************
1308 
1309  //if (fDecayVtx!=0) { delete fDecayVtx; fDecayVtx = 0; }
1310 // for (int i=0;i<nCons;i++) { delete fConstraints[i]; fConstraints[i]=0; nCons=0;}
1311 }
1312 
1314 {
1315  RhoCandidate tmp ( P4() +c->P4(),Charge() +c->Charge() );
1316  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1317  cand->SetMarker ( fMarker[0]|c->fMarker[0],0 );
1318  cand->SetMarker ( fMarker[1]|c->fMarker[1],1 );
1319  cand->SetMarker ( fMarker[2]|c->fMarker[2],2 );
1320  cand->SetMarker ( fMarker[3]|c->fMarker[3],3 );
1321 
1322  cand->SetCovP4 ( P4Cov() +c->P4Cov() );
1323 
1324  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1325  cand->AddDaughterLinkSimple(this);
1326  cand->AddDaughterLinkSimple(c);
1327 
1328  return cand;
1329 }
1330 
1331 //************** added Combine for more candidates K.Goetzen, 05/2008
1333 {
1334  RhoCandidate tmp ( P4() +c1->P4() +c2->P4(),Charge() +c1->Charge() +c2->Charge() );
1335  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1336  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0],0 );
1337  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1],1 );
1338  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2],2 );
1339  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3],3 );
1340 
1341  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() );
1342 
1343  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1344  cand->AddDaughterLinkSimple(this);
1345  cand->AddDaughterLinkSimple(c1);
1346  cand->AddDaughterLinkSimple(c2);
1347 
1348  return cand;
1349 }
1350 
1352 {
1353  RhoCandidate tmp ( P4() +c1->P4() +c2->P4() +c3->P4(),Charge() +c1->Charge() +c2->Charge() +c3->Charge() );
1354  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1355  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0]|c3->fMarker[0],0 );
1356  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1]|c3->fMarker[1],1 );
1357  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2]|c3->fMarker[2],2 );
1358  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3]|c3->fMarker[3],3 );
1359 
1360  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() +c3->P4Cov() );
1361 
1362  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1363  cand->AddDaughterLinkSimple(this);
1364  cand->AddDaughterLinkSimple(c1);
1365  cand->AddDaughterLinkSimple(c2);
1366  cand->AddDaughterLinkSimple(c3);
1367 
1368  return cand;
1369 }
1370 
1372 {
1373  RhoCandidate tmp ( P4() +c1->P4() +c2->P4() +c3->P4() + c4->P4(), Charge() +c1->Charge() +c2->Charge() +c3->Charge() +c4->Charge() );
1374  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1375  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0]|c3->fMarker[0]|c4->fMarker[0],0 );
1376  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1]|c3->fMarker[1]|c4->fMarker[1],1 );
1377  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2]|c3->fMarker[2]|c4->fMarker[2],2 );
1378  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3]|c3->fMarker[3]|c4->fMarker[3],3 );
1379 
1380  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() +c3->P4Cov() +c4->P4Cov() );
1381 
1382  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1383  cand->AddDaughterLinkSimple(this);
1384  cand->AddDaughterLinkSimple(c1);
1385  cand->AddDaughterLinkSimple(c2);
1386  cand->AddDaughterLinkSimple(c3);
1387  cand->AddDaughterLinkSimple(c4);
1388 
1389  return cand;
1390 }
1391 
1393 {
1394  RhoCandidate tmp ( P4() +c1->P4() +c2->P4() +c3->P4() + c4->P4() + c5->P4() ,
1395  Charge() +c1->Charge() +c2->Charge() +c3->Charge() +c4->Charge() +c5->Charge() );
1396  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1397  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0]|c3->fMarker[0]|c4->fMarker[0]|c5->fMarker[0],0 );
1398  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1]|c3->fMarker[1]|c4->fMarker[1]|c5->fMarker[1],1 );
1399  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2]|c3->fMarker[2]|c4->fMarker[2]|c5->fMarker[2],2 );
1400  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3]|c3->fMarker[3]|c4->fMarker[3]|c5->fMarker[3],3 );
1401 
1402  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() +c3->P4Cov() +c4->P4Cov() +c5->P4Cov());
1403 
1404  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1405  cand->AddDaughterLinkSimple(this);
1406  cand->AddDaughterLinkSimple(c1);
1407  cand->AddDaughterLinkSimple(c2);
1408  cand->AddDaughterLinkSimple(c3);
1409  cand->AddDaughterLinkSimple(c4);
1410  cand->AddDaughterLinkSimple(c5);
1411 
1412  return cand;
1413 }
1414 
1416 {
1417  RhoCandidate tmp ( P4() +c1->P4() +c2->P4() +c3->P4() + c4->P4() + c5->P4() + c6->P4() ,
1418  Charge() +c1->Charge() +c2->Charge() +c3->Charge() +c4->Charge() +c5->Charge() +c6->Charge() );
1419  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1420  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0]|c3->fMarker[0]|c4->fMarker[0]|c5->fMarker[0]|c6->fMarker[0],0 );
1421  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1]|c3->fMarker[1]|c4->fMarker[1]|c5->fMarker[1]|c6->fMarker[1],1 );
1422  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2]|c3->fMarker[2]|c4->fMarker[2]|c5->fMarker[2]|c6->fMarker[2],2 );
1423  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3]|c3->fMarker[3]|c4->fMarker[3]|c5->fMarker[3]|c6->fMarker[3],3 );
1424 
1425  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() +c3->P4Cov() +c4->P4Cov() +c5->P4Cov() +c6->P4Cov());
1426 
1427  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1428  cand->AddDaughterLinkSimple(this);
1429  cand->AddDaughterLinkSimple(c1);
1430  cand->AddDaughterLinkSimple(c2);
1431  cand->AddDaughterLinkSimple(c3);
1432  cand->AddDaughterLinkSimple(c4);
1433  cand->AddDaughterLinkSimple(c5);
1434  cand->AddDaughterLinkSimple(c6);
1435 
1436  return cand;
1437 }
1438 
1440 {
1441  RhoCandidate tmp ( P4() +c1->P4() +c2->P4() +c3->P4() + c4->P4() + c5->P4() + c6->P4() + c7->P4() ,
1442  Charge() +c1->Charge() +c2->Charge() +c3->Charge() +c4->Charge() +c5->Charge() +c6->Charge() +c7->Charge() );
1443  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1444  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0]|c3->fMarker[0]|c4->fMarker[0]|c5->fMarker[0]|c6->fMarker[0]|c7->fMarker[0],0 );
1445  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1]|c3->fMarker[1]|c4->fMarker[1]|c5->fMarker[1]|c6->fMarker[1]|c7->fMarker[1],1 );
1446  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2]|c3->fMarker[2]|c4->fMarker[2]|c5->fMarker[2]|c6->fMarker[2]|c7->fMarker[2],2 );
1447  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3]|c3->fMarker[3]|c4->fMarker[3]|c5->fMarker[3]|c6->fMarker[3]|c7->fMarker[3],3 );
1448 
1449  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() +c3->P4Cov() +c4->P4Cov() +c5->P4Cov() +c6->P4Cov() +c7->P4Cov() );
1450 
1451  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1452  cand->AddDaughterLinkSimple(this);
1453  cand->AddDaughterLinkSimple(c1);
1454  cand->AddDaughterLinkSimple(c2);
1455  cand->AddDaughterLinkSimple(c3);
1456  cand->AddDaughterLinkSimple(c4);
1457  cand->AddDaughterLinkSimple(c5);
1458  cand->AddDaughterLinkSimple(c6);
1459  cand->AddDaughterLinkSimple(c7);
1460 
1461  return cand;
1462 }
1463 
1465 {
1466  RhoCandidate tmp ( P4() +c1->P4() +c2->P4() +c3->P4() + c4->P4() + c5->P4() + c6->P4() + c7->P4() + c8->P4() ,
1467  Charge() +c1->Charge() +c2->Charge() +c3->Charge() +c4->Charge() +c5->Charge() +c6->Charge() +c7->Charge() +c8->Charge() );
1468  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1469  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0]|c3->fMarker[0]|c4->fMarker[0]|c5->fMarker[0]|c6->fMarker[0]|c7->fMarker[0]|c8->fMarker[0],0 );
1470  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1]|c3->fMarker[1]|c4->fMarker[1]|c5->fMarker[1]|c6->fMarker[1]|c7->fMarker[1]|c8->fMarker[1],1 );
1471  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2]|c3->fMarker[2]|c4->fMarker[2]|c5->fMarker[2]|c6->fMarker[2]|c7->fMarker[2]|c8->fMarker[2],2 );
1472  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3]|c3->fMarker[3]|c4->fMarker[3]|c5->fMarker[3]|c6->fMarker[3]|c7->fMarker[3]|c8->fMarker[3],3 );
1473 
1474  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() +c3->P4Cov() +c4->P4Cov() +c5->P4Cov() +c6->P4Cov() +c7->P4Cov() +c8->P4Cov() );
1475 
1476  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1477  cand->AddDaughterLinkSimple(this);
1478  cand->AddDaughterLinkSimple(c1);
1479  cand->AddDaughterLinkSimple(c2);
1480  cand->AddDaughterLinkSimple(c3);
1481  cand->AddDaughterLinkSimple(c4);
1482  cand->AddDaughterLinkSimple(c5);
1483  cand->AddDaughterLinkSimple(c6);
1484  cand->AddDaughterLinkSimple(c7);
1485  cand->AddDaughterLinkSimple(c8);
1486 
1487  return cand;
1488 }
1489 
1491 {
1492  RhoCandidate tmp ( P4() +c1->P4() +c2->P4() +c3->P4() + c4->P4() + c5->P4() + c6->P4() + c7->P4() + c8->P4() + c9->P4() ,
1493  Charge() +c1->Charge() +c2->Charge() +c3->Charge() +c4->Charge() +c5->Charge() +c6->Charge() +c7->Charge() +c8->Charge() +c9->Charge() );
1494  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1495  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0]|c3->fMarker[0]|c4->fMarker[0]|c5->fMarker[0]|c6->fMarker[0]|c7->fMarker[0]|c8->fMarker[0]|c9->fMarker[0],0 );
1496  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1]|c3->fMarker[1]|c4->fMarker[1]|c5->fMarker[1]|c6->fMarker[1]|c7->fMarker[1]|c8->fMarker[1]|c9->fMarker[1],1 );
1497  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2]|c3->fMarker[2]|c4->fMarker[2]|c5->fMarker[2]|c6->fMarker[2]|c7->fMarker[2]|c8->fMarker[2]|c9->fMarker[2],2 );
1498  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3]|c3->fMarker[3]|c4->fMarker[3]|c5->fMarker[3]|c6->fMarker[3]|c7->fMarker[3]|c8->fMarker[3]|c9->fMarker[3],3 );
1499 
1500  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() +c3->P4Cov() +c4->P4Cov() +c5->P4Cov() +c6->P4Cov() +c7->P4Cov() +c8->P4Cov() +c9->P4Cov());
1501 
1502  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1503  cand->AddDaughterLinkSimple(this);
1504  cand->AddDaughterLinkSimple(c1);
1505  cand->AddDaughterLinkSimple(c2);
1506  cand->AddDaughterLinkSimple(c3);
1507  cand->AddDaughterLinkSimple(c4);
1508  cand->AddDaughterLinkSimple(c5);
1509  cand->AddDaughterLinkSimple(c6);
1510  cand->AddDaughterLinkSimple(c7);
1511  cand->AddDaughterLinkSimple(c8);
1512  cand->AddDaughterLinkSimple(c9);
1513 
1514  return cand;
1515 }
1516 
1517 
1519 {
1520  RhoCandidate tmp ( P4() +c1->P4() +c2->P4() +c3->P4() + c4->P4() + c5->P4() + c6->P4() + c7->P4() + c8->P4() + c9->P4() + c10->P4() ,
1521  Charge() +c1->Charge() +c2->Charge() +c3->Charge() +c4->Charge() +c5->Charge() +c6->Charge() +c7->Charge() +c8->Charge() +c9->Charge() +c10->Charge() );
1522  RhoCandidate* cand = RhoFactory::Instance()->NewCandidate ( tmp );
1523  cand->SetMarker ( fMarker[0]|c1->fMarker[0]|c2->fMarker[0]|c3->fMarker[0]|c4->fMarker[0]|c5->fMarker[0]|c6->fMarker[0]|c7->fMarker[0]|c8->fMarker[0]|c9->fMarker[0]|c10->fMarker[0],0 );
1524  cand->SetMarker ( fMarker[1]|c1->fMarker[1]|c2->fMarker[1]|c3->fMarker[1]|c4->fMarker[1]|c5->fMarker[1]|c6->fMarker[1]|c7->fMarker[1]|c8->fMarker[1]|c9->fMarker[1]|c10->fMarker[1],1 );
1525  cand->SetMarker ( fMarker[2]|c1->fMarker[2]|c2->fMarker[2]|c3->fMarker[2]|c4->fMarker[2]|c5->fMarker[2]|c6->fMarker[2]|c7->fMarker[2]|c8->fMarker[2]|c9->fMarker[2]|c10->fMarker[2],2 );
1526  cand->SetMarker ( fMarker[3]|c1->fMarker[3]|c2->fMarker[3]|c3->fMarker[3]|c4->fMarker[3]|c5->fMarker[3]|c6->fMarker[3]|c7->fMarker[3]|c8->fMarker[3]|c9->fMarker[3]|c10->fMarker[3],3 );
1527 
1528  cand->SetCovP4 ( P4Cov() +c1->P4Cov() +c2->P4Cov() +c3->P4Cov() +c4->P4Cov() +c5->P4Cov() +c6->P4Cov() +c7->P4Cov() +c8->P4Cov() +c9->P4Cov() +c10->P4Cov() );
1529 
1530  //Only one-way link because we're not sure where else the daughters are used (combinatorics)
1531  cand->AddDaughterLinkSimple(this);
1532  cand->AddDaughterLinkSimple(c1);
1533  cand->AddDaughterLinkSimple(c2);
1534  cand->AddDaughterLinkSimple(c3);
1535  cand->AddDaughterLinkSimple(c4);
1536  cand->AddDaughterLinkSimple(c5);
1537  cand->AddDaughterLinkSimple(c6);
1538  cand->AddDaughterLinkSimple(c7);
1539  cand->AddDaughterLinkSimple(c8);
1540  cand->AddDaughterLinkSimple(c9);
1541  cand->AddDaughterLinkSimple(c10);
1542 
1543  return cand;
1544 }
1545 
1546 
1547 
1548 void RhoCandidate::SetMarker ( UInt_t l,UInt_t m )
1549 {
1550  if ( m<4 ) {
1551  fMarker[m]=l;
1552  } else {
1553  cout << "RhoCandidate: Trying to set non-existent marker " << m << endl;
1554  }
1555 }
1556 
1557 
1558 RhoError
1560 {
1561  RhoError covPos ( 3 );
1562  covPos ( 0,0 ) = fErrP7[0];
1563  covPos ( 1,0 ) = covPos ( 0,1 ) = fErrP7[1];
1564  covPos ( 1,1 ) = fErrP7[2];
1565  covPos ( 2,0 ) = covPos ( 0,2 ) = fErrP7[3];
1566  covPos ( 2,1 ) = covPos ( 1,2 ) = fErrP7[4];
1567  covPos ( 2,2 ) = fErrP7[5];
1568  return covPos;
1569 }
1570 
1573 {
1574  return RhoVector3Err ( Pos(),PosCov() );
1575 }
1576 
1577 
1578 RhoError
1580 {
1581  RhoError covP4 ( 4 );
1582  covP4 ( 0,0 ) = fErrP7[18];
1583  covP4 ( 1,0 ) = covP4 ( 0,1 ) = fErrP7[19];
1584  covP4 ( 1,1 ) = fErrP7[20];
1585  covP4 ( 2,0 ) = covP4 ( 0,2 ) = fErrP7[21];
1586  covP4 ( 2,1 ) = covP4 ( 1,2 ) = fErrP7[22];
1587  covP4 ( 2,2 ) = fErrP7[23];
1588  covP4 ( 3,0 ) = covP4 ( 0,3 ) = fErrP7[24];
1589  covP4 ( 3,1 ) = covP4 ( 1,3 ) = fErrP7[25];
1590  covP4 ( 3,2 ) = covP4 ( 2,3 ) = fErrP7[26];
1591  covP4 ( 3,3 ) = fErrP7[27];
1592  return covP4;
1593 }
1594 
1595 RhoError
1597 {
1598  RhoError covP3 ( 3 );
1599  covP3 ( 0,0 ) = fErrP7[18];
1600  covP3 ( 1,0 ) = covP3 ( 0,1 ) = fErrP7[19];
1601  covP3 ( 1,1 ) = fErrP7[20];
1602  covP3 ( 2,0 ) = covP3 ( 0,2 ) = fErrP7[21];
1603  covP3 ( 2,1 ) = covP3 ( 1,2 ) = fErrP7[22];
1604  covP3 ( 2,2 ) = fErrP7[23];
1605  return covP3;
1606 }
1607 
1610 {
1611  return RhoVector3Err ( P3(),P3Cov() );
1612 }
1613 
1614 
1617 {
1618  return RhoLorentzVectorErr ( P4(),P4Cov() );
1619 }
1620 
1621 
1622 Double_t
1624 {
1625  return fErrP7[27];
1626 }
1627 
1628 Double_t
1630 {
1631  return TVector3 ( fXmomentum,fYmomentum,fZmomentum ).Mag();
1632 }
1633 
1634 
1635 Double_t
1637 {
1638  return TLorentzVector ( fXmomentum,fYmomentum,fZmomentum,fEnergy ).Mag();
1639 }
1640 
1641 
1642 TMatrixD
1644 {
1645  TMatrixD cov ( 7,7 );
1646 
1647  // position error
1648 
1649  cov ( 0,0 ) = fErrP7[0];
1650  cov ( 1,0 ) = fErrP7[1];
1651  cov ( 1,1 ) = fErrP7[2];
1652  cov ( 2,0 ) = fErrP7[3];
1653  cov ( 2,1 ) = fErrP7[4];
1654  cov ( 2,2 ) = fErrP7[5];
1655 
1656  // position-momentum covariance
1657 
1658  cov ( 3,0 ) = fErrP7[6];
1659  cov ( 3,1 ) = fErrP7[7];
1660  cov ( 3,2 ) = fErrP7[8];
1661  cov ( 4,0 ) = fErrP7[9];
1662  cov ( 4,1 ) = fErrP7[10];
1663  cov ( 4,2 ) = fErrP7[11];
1664  cov ( 5,0 ) = fErrP7[12];
1665  cov ( 5,1 ) = fErrP7[13];
1666  cov ( 5,2 ) = fErrP7[14];
1667  cov ( 6,0 ) = fErrP7[15];
1668  cov ( 6,1 ) = fErrP7[16];
1669  cov ( 6,2 ) = fErrP7[17];
1670 
1671  // momentum error
1672  cov ( 3,3 ) = fErrP7[18];
1673  cov ( 4,3 ) = fErrP7[19];
1674  cov ( 4,4 ) = fErrP7[20];
1675  cov ( 5,3 ) = fErrP7[21];
1676  cov ( 5,4 ) = fErrP7[22];
1677  cov ( 5,5 ) = fErrP7[23];
1678  cov ( 6,3 ) = fErrP7[24];
1679  cov ( 6,4 ) = fErrP7[25];
1680  cov ( 6,5 ) = fErrP7[26];
1681  cov ( 6,6 ) = fErrP7[27];
1682 
1683  //latest modification :Dipak
1684  for ( int i=0; i<6; i++ )
1685  for ( int j=i+1; j<7; j++ ) {
1686  cov ( i,j ) =cov ( j,i );
1687  }
1688 
1689  return cov;
1690 }
1691 
1692 TMatrixD
1694 {
1695  TMatrixD covPosP4 ( 4,3 );
1696 
1697  // position-momentum covariance
1698 
1699  covPosP4 ( 0,0 ) = fErrP7[6];
1700  covPosP4 ( 0,1 ) = fErrP7[7];
1701  covPosP4 ( 0,2 ) = fErrP7[8];
1702  covPosP4 ( 1,0 ) = fErrP7[9];
1703  covPosP4 ( 1,1 ) = fErrP7[10];
1704  covPosP4 ( 1,2 ) = fErrP7[11];
1705  covPosP4 ( 2,0 ) = fErrP7[12];
1706  covPosP4 ( 2,1 ) = fErrP7[13];
1707  covPosP4 ( 2,2 ) = fErrP7[14];
1708  covPosP4 ( 3,0 ) = fErrP7[15];
1709  covPosP4 ( 3,1 ) = fErrP7[16];
1710  covPosP4 ( 3,2 ) = fErrP7[17];
1711 
1712  return covPosP4;
1713 }
1714 
1715 Double_t
1716 RhoCandidate::Correlation ( Int_t x1,Int_t x2,const TMatrixD& deriv,const TMatrixD& cov ) const
1717 {
1718  const int nparm = cov.GetNcols();
1719  Double_t error = 0.;
1720  for ( int i=0; i<nparm; i++ ) {
1721  const double d1 = deriv ( x1,i );
1722  if ( d1==0.0 ) { continue; } // No need to accumulate 0
1723  for ( int j=0; j<nparm; j++ ) {
1724  const double d2 = deriv ( x2,j );
1725  if ( d2==0.0 ) { continue; } // No need to accumulate 0
1726  error+=d1*cov ( i,j ) *d2;
1727  }
1728  }
1729  return error;
1730 }
1731 
1732 
1733 
1734 //
1735 // *************************** added for testing/use in pandaROOT, K.G. 11/2007
1736 //
1737 
1738 void RhoCandidate::SetPidInfo ( double* pidinfo )
1739 {
1740  for ( int i=0; i<30; i++ )
1741  if ( pidinfo ) { fPidLH[i]=pidinfo[i]; }
1742  else { fPidLH[i]=0; }
1743 }
1744 
1745 void RhoCandidate::SetPidInfo ( int hypo, double value )
1746 {
1747  if ( hypo>=0 && hypo<30 ) {
1748  fPidLH[hypo] = value;
1749  }
1750 }
1751 
1752 double RhoCandidate::GetPidInfo ( int hypo )
1753 {
1754  if ( hypo>=0 && hypo<30 ) {
1755  return fPidLH[hypo];
1756  } else {
1757  return -999.0;
1758  }
1759 }
1760 
1761 const double* RhoCandidate::GetPidInfo() const
1762 {
1763  return fPidLH;
1764 }
Bool_t IsAResonance() const
Double_t Mass() const
const RhoCandidate * CloneInTree(const RhoCandidate &) const
int fPdgCode
Pointer to particle database.
Definition: RhoCandidate.h:66
TVector3 pos
void AddDaughterLinkSimple(const RhoCandidate *, bool verbose=true)
UInt_t fTrackNumber
Definition: RhoCandidate.h:77
void SetP7(const TVector3 &pos, const TLorentzVector &p4)
c5
Definition: plot_dirc.C:75
Int_t GetCharge() const
TVector3 Origin() const
RhoCandidate * Combine(RhoCandidate *c)
TObjArray * d
Int_t GetTrackNumber() const
Definition: RhoCandidate.h:417
RhoError P3Cov() const
c4
Definition: plot_dirc.C:71
void SetPos(const TVector3 &pos)
Definition: RhoCandidate.h:235
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
TTree * b
RhoVector3Err fDecayVtx
Do not stream.
Definition: RhoCandidate.h:62
void SetMotherLink(RhoCandidate *m, bool verbose=true)
std::ostream & operator<<(std::ostream &o, const RhoCandidate &a)
void SetUid(UInt_t uid=0)
void SetMassAndEnergy(Double_t mass, Double_t energy)
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
TVector3 Pos() const
Definition: RhoCandidate.h:186
#define verbose
RhoLorentzVectorErr P4WErr() const
TCanvas * c10
TLorentzVector GetLorentzVector() const
RhoError PosCov() const
int n
Bool_t fLocked
Do not stream.
Definition: RhoCandidate.h:57
Double_t Correlation(Int_t x1, Int_t x2, const TMatrixD &m, const TMatrixD &cov) const
Bool_t IsComposite() const
c2
Definition: plot_dirc.C:39
RhoCandidate * Daughter(Int_t n)
void RemoveDaughter(RhoCandidate *)
void Boost(Double_t bx, Double_t by, Double_t bz)
Float_t fErrP7[MATRIXSIZE]
Definition: RhoCandidate.h:110
RhoCandidate * fFit
pointer, objects created by RhoFactory
Definition: RhoCandidate.h:100
void DropMotherLink()
RhoCandidate * fTheMother
Do not stream.
Definition: RhoCandidate.h:60
Int_t Uid() const
Definition: RhoCandidate.h:419
void SetPosition(const TVector3 &pos)
__m128 v
Definition: P4_F32vec4.h:4
static void error(int no)
Definition: ranlxd.cxx:419
const Float_t * GetErrorP7() const
TCanvas * c7
Int_t fNDaug
List of Daughters.
Definition: RhoCandidate.h:83
void SetType(const TParticlePDG *pdt)
Char_t fCharge
pointer, objects created by RhoFactory
Definition: RhoCandidate.h:102
void SetP4(Double_t mass, const TVector3 &p3)
const double * GetPidInfo() const
TMatrixD XPCov() const
Double_t En
Bool_t fIsAResonance
Definition: RhoCandidate.h:69
int uid(int lev, int lrun, int lmode)
Definition: autocutx.C:122
void SetMomentum(Double_t newP)
#define MAXDAUG
Definition: RhoCandidate.h:38
Int_t a
Definition: anaLmdDigi.C:126
Double_t fYmomentum
Definition: RhoCandidate.h:107
PndPidCandidate * fMicroCand
Rsonance flag.
Definition: RhoCandidate.h:75
void SetP3(const TVector3 &p3)
Double_t fZmomentum
Definition: RhoCandidate.h:108
void SetPidInfo(double *pidinfo=0)
void InvalidateFit()
double fPidLH[30]
Overlap.
Definition: RhoCandidate.h:91
Double_t
Float_t fXposition
Definition: RhoCandidate.h:103
RhoCandidate * fMcTruth
Definition: RhoCandidate.h:98
const TParticlePDG * PdtEntry() const
void RemoveAssociations()
RhoCandidate * fDaughters[MAXDAUG]
unique number
Definition: RhoCandidate.h:82
Double_t fEnergy
Definition: RhoCandidate.h:109
void PrintOn(std::ostream &o=std::cout) const
TLorentzVector P4() const
Definition: RhoCandidate.h:195
void Set(const TVector3 &pos, const TLorentzVector &p4, const TMatrixD &cov7)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t EVar() const
virtual ~RhoCandidate()
static RhoFactory * Instance()
Definition: RhoFactory.cxx:34
c1
Definition: plot_dirc.C:35
void SetMass(Double_t mass)
Double_t M() const
TString name
c3
Definition: plot_dirc.C:50
Double_t E() const
Definition: RhoCandidate.h:202
Double_t P() const
RhoError Similarity(const TMatrixD &m1) const
Definition: RhoError.cxx:104
Bool_t Equals(const RhoCandidate *c) const
Definition: RhoCandidate.h:401
RhoVector3Err PosWCov() const
RhoCandidate & operator=(const RhoCandidate &)
Float_t fYposition
Definition: RhoCandidate.h:104
RhoError P4Cov() const
Double_t fXmomentum
Definition: RhoCandidate.h:106
TMatrixD Cov7() const
void SetCovP4(const TMatrixD &covP4)
static RhoCandidate * NewCandidate()
Definition: RhoFactory.cxx:52
TVector3 GetPosition() const
#define MATRIXSIZE
Definition: RhoCandidate.h:37
void SetEnergy(Double_t newE)
Int_t NDaughters() const
Float_t fZposition
Definition: RhoCandidate.h:105
Double_t Charge() const
Definition: RhoCandidate.h:184
const TParticlePDG * fPdtEntry
Vertex.
Definition: RhoCandidate.h:65
ClassImp(RhoCandidate) using namespace std
const RhoError & CovMatrix() const
Definition: RhoVector3Err.h:68
void SetCharge(Double_t charge)
Definition: RhoCandidate.h:229
void SetMarker(UInt_t l, UInt_t m)
Bool_t operator!=(RhoCandidate *) const
void SetDecayVtx(RhoVector3Err theVtx)
Bool_t IsCloneOf(const RhoCandidate &, Bool_t checkType=kFALSE) const
Double_t fChi2
Definition: RhoCandidate.h:94
Bool_t fFastMode
Definition: RhoCandidate.h:54
UInt_t fUid
Micro association.
Definition: RhoCandidate.h:78
TF1 * bp
Definition: hist-t7.C:69
void SetCovPos(const TMatrixD &covPos)
Bool_t operator==(const RhoCandidate *) const
RhoVector3Err P3WErr() const
UInt_t GetMarker(UInt_t m=0) const
Definition: RhoCandidate.h:406
TCanvas * c8
RhoVector3Err DecayVtx()
Definition: RhoCandidate.h:288
void SetCov7(const TMatrixD &cov7)
const RhoCandidate * TheMother() const
Definition: RhoCandidate.h:272
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
TVector3 P3() const
Definition: RhoCandidate.h:199
UInt_t fMarker[4]
Number of constraints.
Definition: RhoCandidate.h:88
Short_t fNCons
Definition: RhoCandidate.h:86