27 #include "TLorentzVector.h"
30 #include "TDatabasePDG.h"
46 fIsAResonance ( kFALSE ),
61 for (
int i=0;
i<30;
i++ ) {
fPidLH[
i]=-999999.;}
72 fIsAResonance ( kFALSE ),
86 SetP7 ( ( vp!=0 ? *((TVector3*)vp) : TVector3 ( 0.,0.,0. ) ), v );
89 for (
int i=0;
i<30;
i++ ) {
fPidLH[
i]=-999999.;}
101 fIsAResonance ( kFALSE ),
114 SetPos ( vp!=0 ? *((TVector3*)vp) : TVector3 ( 0.,0.,0. ) );
119 for (
int i=0;
i<30;
i++ ) {
fPidLH[
i]=-999999.; }
167 for (
int i=0;
i<30;
i++ ) {
172 SetInsertHistory(kFALSE);
173 AddLinks(o.GetLinksWithType(FairRootManager::Instance()->GetBranchId(
"MCTrack")));
184 fFastMode ( kFALSE ),
190 fIsAResonance ( kFALSE ),
217 SetInsertHistory(kFALSE);
218 AddLinks(a.GetLinksWithType(FairRootManager::Instance()->GetBranchId(
"MCTrack")));
231 fIsAResonance ( kFALSE ),
258 SetInsertHistory(kFALSE);
259 AddLinks(a.GetLinksWithType(FairRootManager::Instance()->GetBranchId(
"MCTrack")));
283 FairMultiLinkedData_Interface::operator=(o);
325 for (
int i=0;
i<30;
i++ ) {
347 Double_t P2 = pow ( mEnergy, 2 ) - pow ( mass, 2 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
575 const TLorentzVector& p4,
589 SetP4 ( mass, p3Err );
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;
606 for (
int i=0;
i<3;
i++ ) {
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 );
695 if ( b!=0 ) {
return b; }
734 Double_t gamma2 = b2 > 0 ? ( gamma - 1.0 ) /b2 : 0.0;
738 fZmomentum = fZmomentum + gamma2*bp*bz + gamma*bz*
fEnergy;
739 fEnergy = gamma* ( fEnergy +
bp );
787 Double_t pscale = (
P() == 0 ? 0 : newp /
P() );
795 TDatabasePDG* pdg = TDatabasePDG::Instance();
796 TParticlePDG* pdt=pdg->GetParticle ( pdgcode );
797 if ( pdt ) {
SetType ( pdt ); }
804 TDatabasePDG* pdg = TDatabasePDG::Instance();
805 TParticlePDG* pdt=pdg->GetParticle ( name );
806 if ( pdt ) {
SetType ( pdt ); }
807 else Warning(
"RhoCandidate::SetType",
"unknown particle \"%s\"",name);
813 if ( pdt==
fPdtEntry || pdt==0 ) {
return; }
824 if(
fabs(pdgcharge)>2) pdgcharge/=3.;
829 if (
Charge() !=pdgcharge ) {
831 <<
"ERROR: attempt to call RhoCandidate::SetType(\""
833 <<
" RhoCandidate whose daughters have total charge "
931 cerr <<
"RhoCandidate::AddDaughterLinkSimple: Can not add more than "<<
MAXDAUG<<
" daughters." << endl;
934 cout <<
"; want to add "<< d->
PdgCode() <<endl;
956 assert ( d!=0 && d->
TheMother() ==this );
993 if ( n >=0 && n <
fNDaug ) {
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 );
1149 o.unsetf ( ios::hex | ios::showbase );
1158 for (
int k=0; k<5; k++ ) { o <<
fPidLH[k] <<
","; }
1159 o <<
" mc truth pointer: " <<
fMcTruth <<
" ";
1160 #ifdef _HavePrintLinkInfo
1161 FairMultiLinkedData_Interface::PrintLinkInfo(o);
1178 }
else if ( n<64 ) {
1180 }
else if ( n<96 ) {
1182 }
else if ( n<128 ) {
1185 cout <<
"RhoCandidate warning: More than 128 tracks; overlap may occur" << endl;
1267 static UInt_t u = 10000;
1282 if (
Uid() == o.
Uid() && !checkType ) {
return kTRUE; }
1290 return (
Uid() == o.
Uid() &&
1325 cand->AddDaughterLinkSimple(
this);
1326 cand->AddDaughterLinkSimple(c);
1344 cand->AddDaughterLinkSimple(
this);
1345 cand->AddDaughterLinkSimple(c1);
1346 cand->AddDaughterLinkSimple(c2);
1363 cand->AddDaughterLinkSimple(
this);
1364 cand->AddDaughterLinkSimple(c1);
1365 cand->AddDaughterLinkSimple(c2);
1366 cand->AddDaughterLinkSimple(c3);
1383 cand->AddDaughterLinkSimple(
this);
1384 cand->AddDaughterLinkSimple(c1);
1385 cand->AddDaughterLinkSimple(c2);
1386 cand->AddDaughterLinkSimple(c3);
1387 cand->AddDaughterLinkSimple(c4);
1405 cand->AddDaughterLinkSimple(
this);
1406 cand->AddDaughterLinkSimple(c1);
1407 cand->AddDaughterLinkSimple(c2);
1408 cand->AddDaughterLinkSimple(c3);
1409 cand->AddDaughterLinkSimple(c4);
1410 cand->AddDaughterLinkSimple(c5);
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);
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);
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);
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);
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);
1553 cout <<
"RhoCandidate: Trying to set non-existent marker " << m << endl;
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];
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];
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];
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];
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];
1684 for (
int i=0;
i<6;
i++ )
1685 for (
int j=
i+1; j<7; j++ ) {
1686 cov (
i,j ) =cov ( j,
i );
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];
1718 const int nparm = cov.GetNcols();
1720 for (
int i=0;
i<nparm;
i++ ) {
1721 const double d1 = deriv ( x1,
i );
1722 if ( d1==0.0 ) {
continue; }
1723 for (
int j=0; j<nparm; j++ ) {
1724 const double d2 = deriv ( x2,j );
1725 if ( d2==0.0 ) {
continue; }
1726 error+=d1*cov (
i,j ) *d2;
1740 for (
int i=0;
i<30;
i++ )
1741 if ( pidinfo ) {
fPidLH[
i]=pidinfo[
i]; }
1747 if ( hypo>=0 && hypo<30 ) {
1754 if ( hypo>=0 && hypo<30 ) {
Bool_t IsAResonance() const
const RhoCandidate * CloneInTree(const RhoCandidate &) const
int fPdgCode
Pointer to particle database.
void AddDaughterLinkSimple(const RhoCandidate *, bool verbose=true)
void SetP7(const TVector3 &pos, const TLorentzVector &p4)
RhoCandidate * Combine(RhoCandidate *c)
Int_t GetTrackNumber() const
void SetPos(const TVector3 &pos)
RhoVector3Err fDecayVtx
Do not stream.
void SetMotherLink(RhoCandidate *m, bool verbose=true)
void SetUid(UInt_t uid=0)
void SetMassAndEnergy(Double_t mass, Double_t energy)
friend F32vec4 sqrt(const F32vec4 &a)
RhoLorentzVectorErr P4WErr() const
TLorentzVector GetLorentzVector() const
Bool_t fLocked
Do not stream.
Double_t Correlation(Int_t x1, Int_t x2, const TMatrixD &m, const TMatrixD &cov) const
Bool_t IsComposite() const
RhoCandidate * Daughter(Int_t n)
void RemoveDaughter(RhoCandidate *)
void Boost(Double_t bx, Double_t by, Double_t bz)
std::ostream & operator<<(std::ostream &o, const PndEventInfo &a)
Float_t fErrP7[MATRIXSIZE]
RhoCandidate * fFit
pointer, objects created by RhoFactory
RhoCandidate * fTheMother
Do not stream.
void SetPosition(const TVector3 &pos)
static void error(int no)
const Float_t * GetErrorP7() const
Int_t fNDaug
List of Daughters.
void SetType(const TParticlePDG *pdt)
Char_t fCharge
pointer, objects created by RhoFactory
void SetP4(Double_t mass, const TVector3 &p3)
const double * GetPidInfo() const
int uid(int lev, int lrun, int lmode)
void SetMomentum(Double_t newP)
PndPidCandidate * fMicroCand
Rsonance flag.
void SetP3(const TVector3 &p3)
void SetPidInfo(double *pidinfo=0)
double fPidLH[30]
Overlap.
const TParticlePDG * PdtEntry() const
void RemoveAssociations()
RhoCandidate * fDaughters[MAXDAUG]
unique number
void PrintOn(std::ostream &o=std::cout) const
TLorentzVector P4() const
void Set(const TVector3 &pos, const TLorentzVector &p4, const TMatrixD &cov7)
friend F32vec4 fabs(const F32vec4 &a)
static RhoFactory * Instance()
void SetMass(Double_t mass)
RhoError Similarity(const TMatrixD &m1) const
Bool_t Equals(const RhoCandidate *c) const
RhoVector3Err PosWCov() const
RhoCandidate & operator=(const RhoCandidate &)
void SetCovP4(const TMatrixD &covP4)
static RhoCandidate * NewCandidate()
TVector3 GetPosition() const
void SetEnergy(Double_t newE)
const TParticlePDG * fPdtEntry
Vertex.
const RhoError & CovMatrix() const
void SetCharge(Double_t charge)
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
UInt_t fUid
Micro association.
void SetCovPos(const TMatrixD &covPos)
Bool_t operator==(const RhoCandidate *) const
RhoVector3Err P3WErr() const
UInt_t GetMarker(UInt_t m=0) const
void SetCov7(const TMatrixD &cov7)
const RhoCandidate * TheMother() const
TMatrixT< double > TMatrixD
UInt_t fMarker[4]
Number of constraints.