#include <VertexFit.h>
Inheritance diagram for VertexFit:
Public Member Functions | |
void | AddBeamFit (int number, VertexParameter vpar, int n) |
void | AddBeamFit (int number, VertexParameter vpar, int n) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4) |
std::vector< int > | AddList (int n1, int n2, int n3) |
std::vector< int > | AddList (int n1, int n2) |
std::vector< int > | AddList (int n1) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5, int n6) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4, int n5) |
std::vector< int > | AddList (int n1, int n2, int n3, int n4) |
std::vector< int > | AddList (int n1, int n2, int n3) |
std::vector< int > | AddList (int n1, int n2) |
std::vector< int > | AddList (int n1) |
void | AddMissTrack (const int number, const HepLorentzVector p4) |
void | AddMissTrack (const int number, const RecEmcShower *trk) |
void | AddMissTrack (const int number, const double mass, const RecEmcShower *trk) |
void | AddMissTrack (const int number, const double mass, const HepLorentzVector p4) |
void | AddMissTrack (const int number, const double mass) |
void | AddMissTrack (const int number, const HepLorentzVector p4) |
void | AddMissTrack (const int number, const RecEmcShower *trk) |
void | AddMissTrack (const int number, const double mass, const RecEmcShower *trk) |
void | AddMissTrack (const int number, const double mass, const HepLorentzVector p4) |
void | AddMissTrack (const int number, const double mass) |
void | AddTrack (const int number, const WTrackParameter wtrk) |
void | AddTrack (const int number, const double mass, const RecEmcShower *trk) |
void | AddTrack (const int number, const double mass, const RecMdcKalTrack *trk) |
void | AddTrack (const int number, const double mass, const RecMdcTrack *trk) |
void | AddTrack (const int number, const WTrackParameter wtrk) |
void | AddTrack (const int number, const double mass, const RecEmcShower *trk) |
void | AddTrack (const int number, const double mass, const RecMdcKalTrack *trk) |
void | AddTrack (const int number, const double mass, const RecMdcTrack *trk) |
void | AddTrackVertex (const int number, const double mass, const RecEmcShower *trk) |
void | AddTrackVertex (const int number, const double mass, const RecEmcShower *trk) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2) |
void | AddVertex (int number, VertexParameter vpar, std::vector< int > lis) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3) |
void | AddVertex (int number, VertexParameter vpar, int n1, int n2) |
void | AddVertex (int number, VertexParameter vpar, std::vector< int > lis) |
bool | BeamFit (int n) |
bool | BeamFit (int n) |
void | BuildVirtualParticle (int number) |
void | BuildVirtualParticle (int number) |
double | chisq (int n) const |
double | chisq () const |
double | chisq (int n) const |
double | chisq () const |
void | clearGammaShape () |
void | clearGammaShape () |
void | clearGammaShapeList () |
void | clearGammaShapeList () |
void | clearMapkinematic () |
void | clearMapkinematic () |
void | clearMappositionA () |
void | clearMappositionA () |
void | clearMappositionB () |
void | clearMappositionB () |
void | clearone () |
void | clearone () |
void | cleartwo () |
void | cleartwo () |
void | clearWTrackInfit () |
void | clearWTrackInfit () |
void | clearWTrackList () |
void | clearWTrackList () |
void | clearWTrackOrigin () |
void | clearWTrackOrigin () |
HepVector | cpu () const |
HepVector | cpu () const |
double | errorVx (int n, int i) const |
double | errorVx (int n, int i) const |
HepSymMatrix | Evx (int n) const |
HepSymMatrix | Evx (int n) const |
HepSymMatrix | Ew (int n) const |
HepSymMatrix | Ew (int n) const |
bool | Fit (int n) |
bool | Fit () |
bool | Fit (int n) |
bool | Fit () |
int | GammaShapeList (int n) const |
std::vector< int > | GammaShapeList () const |
int | GammaShapeList (int n) const |
std::vector< int > | GammaShapeList () const |
GammaShape | GammaShapeValue (int n) const |
std::vector< GammaShape > | GammaShapeValue () const |
GammaShape | GammaShapeValue (int n) const |
std::vector< GammaShape > | GammaShapeValue () const |
HepPoint3D | getBeamPosition () const |
HepPoint3D | getBeamPosition () const |
HepSymMatrix | getVBeamPosition () const |
HepSymMatrix | getVBeamPosition () const |
void | init () |
void | init () |
vector< int > | mapkinematic () const |
vector< int > | mapkinematic () const |
vector< int > | mappositionA () const |
vector< int > | mappositionA () const |
vector< int > | mappositionB () const |
vector< int > | mappositionB () const |
int | numberGammaShape () const |
int | numberGammaShape () const |
int | numberone () const |
int | numberone () const |
int | numbertwo () const |
int | numbertwo () const |
int | numberWTrack () const |
int | numberWTrack () const |
HepLorentzVector | pfit (int n) const |
HepLorentzVector | pfit (int n) const |
bool | pull (int n, int itk, HepVector &p) |
bool | pull (int n, int itk, HepVector &p) |
void | setBeamPosition (const HepPoint3D BeamPosition) |
void | setBeamPosition (const HepPoint3D BeamPosition) |
void | setChisqCut (const double chicut=1000, const double chiter=1.0e-3) |
void | setChisqCut (const double chicut=1000, const double chiter=1.0e-3) |
void | setGammaShape (const GammaShape gammashape) |
void | setGammaShape (const int n, const GammaShape gammashape) |
void | setGammaShape (const GammaShape gammashape) |
void | setGammaShape (const int n, const GammaShape gammashape) |
void | setGammaShapeList (const int n) |
void | setGammaShapeList (const int n) |
void | setIterNumber (const int niter=10) |
void | setIterNumber (const int niter=10) |
void | setMapkinematic (const int n) |
void | setMapkinematic (const int n) |
void | setMappositionA (const int n) |
void | setMappositionA (const int n) |
void | setMappositionB (const int n) |
void | setMappositionB (const int n) |
void | setVBeamPosition (const HepSymMatrix VBeamPosition) |
void | setVBeamPosition (const HepSymMatrix VBeamPosition) |
void | setWTrackInfit (const WTrackParameter wtrk) |
void | setWTrackInfit (const int n, const WTrackParameter wtrk) |
void | setWTrackInfit (const WTrackParameter wtrk) |
void | setWTrackInfit (const int n, const WTrackParameter wtrk) |
void | setWTrackList (const int n) |
void | setWTrackList (const int n) |
void | setWTrackOrigin (const WTrackParameter wtrk) |
void | setWTrackOrigin (const int n, const WTrackParameter wtrk) |
void | setWTrackOrigin (const WTrackParameter wtrk) |
void | setWTrackOrigin (const int n, const WTrackParameter wtrk) |
void | Swim (int n) |
void | Swim (int n) |
VertexParameter | vpar (int n) const |
VertexParameter | vpar (int n) const |
HepVector | Vx (int n) const |
HepPoint3D | vx (int n) const |
HepVector | Vx (int n) const |
HepPoint3D | vx (int n) const |
HepVector | w (int n) const |
HepVector | w (int n) const |
WTrackParameter | wTrackInfit (int n) const |
std::vector< WTrackParameter > | wTrackInfit () const |
WTrackParameter | wTrackInfit (int n) const |
std::vector< WTrackParameter > | wTrackInfit () const |
int | wTrackList (int n) const |
std::vector< int > | wTrackList () const |
int | wTrackList (int n) const |
std::vector< int > | wTrackList () const |
WTrackParameter | wTrackOrigin (int n) const |
std::vector< WTrackParameter > | wTrackOrigin () const |
WTrackParameter | wTrackOrigin (int n) const |
std::vector< WTrackParameter > | wTrackOrigin () const |
WTrackParameter | wtrk (int n) const |
WTrackParameter | wtrk (int n) const |
WTrackParameter | wVirtualTrack (int n) const |
WTrackParameter | wVirtualTrack (int n) const |
HepPoint3D | xfit (int n) const |
HepPoint3D | xfit (int n) const |
~VertexFit () | |
~VertexFit () | |
Static Public Member Functions | |
VertexFit * | instance () |
VertexFit * | instance () |
Private Member Functions | |
HepVector | Convert67 (const double &mass, const HepVector &p) |
HepVector | Convert67 (const double &mass, const HepVector &p) |
HepVector | Convert76 (const HepVector &p) |
HepVector | Convert76 (const HepVector &p) |
void | fitBeam (int n) |
void | fitBeam (int n) |
void | fitVertex (int n) |
void | fitVertex (int n) |
HepSymMatrix | pcovInfit (int i) const |
HepSymMatrix | pcovInfit (int i) const |
HepSymMatrix | pcovOrigin (int i) const |
HepSymMatrix | pcovOrigin (int i) const |
HepVector | pInfit (int i) const |
HepVector | pInfit (int i) const |
HepVector | pOrigin (int i) const |
HepVector | pOrigin (int i) const |
void | setA (int i, const HepMatrix &d) |
void | setA (int i, const HepMatrix &d) |
void | setAT (int i, const HepMatrix &d) |
void | setAT (int i, const HepMatrix &d) |
void | setB (int i, const HepMatrix &e) |
void | setB (int i, const HepMatrix &e) |
void | setBT (int i, const HepMatrix &e) |
void | setBT (int i, const HepMatrix &e) |
void | setE (int i, const HepMatrix &p) |
void | setE (int i, const HepMatrix &p) |
void | setG (int i, const HepVector &p) |
void | setG (int i, const HepVector &p) |
void | setKQ (int i, const HepMatrix &d) |
void | setKQ (int i, const HepMatrix &d) |
void | setPCovInfit (int i, const HepSymMatrix &v) |
void | setPCovInfit (int i, const HepSymMatrix &v) |
void | setPCovOrigin (int i, const HepSymMatrix &v) |
void | setPCovOrigin (int i, const HepSymMatrix &v) |
void | setPInfit (int i, const HepVector &p) |
void | setPInfit (int i, const HepVector &p) |
void | setPOrigin (int i, const HepVector &p) |
void | setPOrigin (int i, const HepVector &p) |
void | setW (int i, HepSymMatrix &m) |
void | setW (int i, HepSymMatrix &m) |
void | setXCovInfit (const HepSymMatrix &v) |
void | setXCovInfit (const HepSymMatrix &v) |
void | setXCovInfitInversed (const HepSymMatrix &v) |
void | setXCovInfitInversed (const HepSymMatrix &v) |
void | setXCovOrigin (const HepSymMatrix &v) |
void | setXCovOrigin (const HepSymMatrix &v) |
void | setXCovOriginInversed (const HepSymMatrix &v) |
void | setXCovOriginInversed (const HepSymMatrix &v) |
void | setXInfit (const HepVector &x) |
void | setXInfit (const HepVector &x) |
void | setXOrigin (const HepVector &x) |
void | setXOrigin (const HepVector &x) |
void | swimBeam (int n) |
void | swimBeam (int n) |
void | swimVertex (int n) |
void | swimVertex (int n) |
void | UpdateConstraints (const VertexConstraints &vc) |
void | UpdateConstraints (const VertexConstraints &vc) |
void | vertexCovMatrix (int n) |
void | vertexCovMatrix (int n) |
VertexFit () | |
VertexFit () | |
HepMatrix | vfA (int i) const |
HepMatrix | vfA (int i) const |
HepMatrix | vfAT (int i) const |
HepMatrix | vfAT (int i) const |
HepMatrix | vfB (int i) const |
HepMatrix | vfB (int i) const |
HepMatrix | vfBT (int i) const |
HepMatrix | vfBT (int i) const |
HepMatrix | vfE (int i) const |
HepMatrix | vfE (int i) const |
HepVector | vfG (int i) const |
HepVector | vfG (int i) const |
HepMatrix | vfKQ (int i) const |
HepMatrix | vfKQ (int i) const |
HepSymMatrix | vfW (int i) const |
HepSymMatrix | vfW (int i) const |
HepSymMatrix | xcovInfit () const |
HepSymMatrix | xcovInfit () const |
HepSymMatrix | xcovInfitInversed () const |
HepSymMatrix | xcovInfitInversed () const |
HepSymMatrix | xcovOrigin () const |
HepSymMatrix | xcovOrigin () const |
HepSymMatrix | xcovOriginInversed () const |
HepSymMatrix | xcovOriginInversed () const |
HepVector | xInfit () const |
HepVector | xInfit () const |
HepVector | xOrigin () const |
HepVector | xOrigin () const |
Private Attributes | |
HepMatrix | m_A |
HepMatrix | m_AT |
HepMatrix | m_B |
HepMatrix | m_BT |
double | m_chi |
double | m_chicut |
std::vector< double > | m_chisq |
std::vector< double > | m_chisq |
double | m_chiter |
HepVector | m_cpu |
HepMatrix | m_E |
HepVector | m_G |
HepMatrix | m_KQ |
int | m_niter |
int | m_nvtrk |
HepSymMatrix | m_pcovInfit |
HepSymMatrix | m_pcovOrigin |
HepVector | m_pInfit |
HepVector | m_pOrigin |
HepMatrix | m_TRA |
HepMatrix | m_TRB |
std::vector< VertexConstraints > | m_vc |
std::vector< VertexConstraints > | m_vc |
std::vector< WTrackParameter > | m_virtual_wtrk |
std::vector< WTrackParameter > | m_virtual_wtrk |
std::vector< VertexParameter > | m_vpar_infit |
std::vector< VertexParameter > | m_vpar_infit |
std::vector< VertexParameter > | m_vpar_origin |
std::vector< VertexParameter > | m_vpar_origin |
HepSymMatrix | m_W |
HepSymMatrix | m_xcovInfit |
HepSymMatrix | m_xcovInfitInversed |
HepSymMatrix | m_xcovOrigin |
HepSymMatrix | m_xcovOriginInversed |
HepVector | m_xInfit |
HepVector | m_xOrigin |
Static Private Attributes | |
VertexFit * | m_pointer |
VertexFit * | m_pointer = 0 |
const int | NCONSTR = 2 |
const int | NTRKPAR = 6 |
const int | NVTXPAR = 3 |
|
00021 {
00022 //if (m_pointer) delete m_pointer;
00023 }
|
|
00025 {;}
|
|
|
|
|
|
|
|
00071 { 00072 std::vector<int> tlis = AddList(n); 00073 VertexConstraints vc; 00074 vc.FixedVertexConstraints(tlis); 00075 m_vc.push_back(vc); 00076 m_vpar_origin.push_back(vpar); 00077 m_vpar_infit.push_back(vpar); 00078 if ((unsigned int)number != m_vc.size() - 1) 00079 std::cout << "wrong kinematic constraints index" << std::endl; 00080 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00619 {
00620 std::vector<int> lis;
00621 lis.clear();
00622 lis.push_back(n1);
00623 lis.push_back(n2);
00624 lis.push_back(n3);
00625 lis.push_back(n4);
00626 lis.push_back(n5);
00627 lis.push_back(n6);
00628 lis.push_back(n7);
00629 lis.push_back(n8);
00630 lis.push_back(n9);
00631 lis.push_back(n10);
00632 lis.push_back(n11);
00633 lis.push_back(n12);
00634 return lis;
00635 }
|
|
00601 {
00602 std::vector<int> lis;
00603 lis.clear();
00604 lis.push_back(n1);
00605 lis.push_back(n2);
00606 lis.push_back(n3);
00607 lis.push_back(n4);
00608 lis.push_back(n5);
00609 lis.push_back(n6);
00610 lis.push_back(n7);
00611 lis.push_back(n8);
00612 lis.push_back(n9);
00613 lis.push_back(n10);
00614 lis.push_back(n11);
00615 return lis;
00616 }
|
|
00584 {
00585 std::vector<int> lis;
00586 lis.clear();
00587 lis.push_back(n1);
00588 lis.push_back(n2);
00589 lis.push_back(n3);
00590 lis.push_back(n4);
00591 lis.push_back(n5);
00592 lis.push_back(n6);
00593 lis.push_back(n7);
00594 lis.push_back(n8);
00595 lis.push_back(n9);
00596 lis.push_back(n10);
00597 return lis;
00598 }
|
|
00568 {
00569 std::vector<int> lis;
00570 lis.clear();
00571 lis.push_back(n1);
00572 lis.push_back(n2);
00573 lis.push_back(n3);
00574 lis.push_back(n4);
00575 lis.push_back(n5);
00576 lis.push_back(n6);
00577 lis.push_back(n7);
00578 lis.push_back(n8);
00579 lis.push_back(n9);
00580 return lis;
00581 }
|
|
00553 {
00554 std::vector<int> lis;
00555 lis.clear();
00556 lis.push_back(n1);
00557 lis.push_back(n2);
00558 lis.push_back(n3);
00559 lis.push_back(n4);
00560 lis.push_back(n5);
00561 lis.push_back(n6);
00562 lis.push_back(n7);
00563 lis.push_back(n8);
00564 return lis;
00565 }
|
|
00540 {
00541 std::vector<int> lis;
00542 lis.clear();
00543 lis.push_back(n1);
00544 lis.push_back(n2);
00545 lis.push_back(n3);
00546 lis.push_back(n4);
00547 lis.push_back(n5);
00548 lis.push_back(n6);
00549 lis.push_back(n7);
00550 return lis;
00551 }
|
|
00528 {
00529 std::vector<int> lis;
00530 lis.clear();
00531 lis.push_back(n1);
00532 lis.push_back(n2);
00533 lis.push_back(n3);
00534 lis.push_back(n4);
00535 lis.push_back(n5);
00536 lis.push_back(n6);
00537 return lis;
00538 }
|
|
00517 {
00518 std::vector<int> lis;
00519 lis.clear();
00520 lis.push_back(n1);
00521 lis.push_back(n2);
00522 lis.push_back(n3);
00523 lis.push_back(n4);
00524 lis.push_back(n5);
00525 return lis;
00526 }
|
|
00507 {
00508 std::vector<int> lis;
00509 lis.clear();
00510 lis.push_back(n1);
00511 lis.push_back(n2);
00512 lis.push_back(n3);
00513 lis.push_back(n4);
00514 return lis;
00515 }
|
|
00498 {
00499 std::vector<int> lis;
00500 lis.clear();
00501 lis.push_back(n1);
00502 lis.push_back(n2);
00503 lis.push_back(n3);
00504 return lis;
00505 }
|
|
00490 {
00491 std::vector<int> lis;
00492 lis.clear();
00493 lis.push_back(n1);
00494 lis.push_back(n2);
00495 return lis;
00496 }
|
|
00483 {
00484 std::vector<int> lis;
00485 lis.clear();
00486 lis.push_back(n1);
00487 return lis;
00488 }
|
|
|
|
|
|
|
|
|
|
|
|
00403 { 00404 double dphi = 1E+3; 00405 double dthe = 1E+3; 00406 double dE = 1E+3; 00407 WTrackParameter wtrk(p4, dphi, dthe, dE); 00408 HepSymMatrix Ew = HepSymMatrix(7,0); 00409 for (int i = 0; i < 7; i++) { 00410 for (int j = 0; j < 7; j++) { 00411 if(i==j) Ew[i][j] = 1E+6; 00412 } 00413 } 00414 wtrk.setType(1); 00415 wtrk.setEw(Ew); 00416 setWTrackOrigin(wtrk); 00417 setWTrackInfit(wtrk); 00418 setWTrackList(number); 00419 setMapkinematic(2); 00420 setMappositionA(m_numberone); 00421 setMappositionB(m_numbertwo); 00422 m_numbertwo = m_numbertwo + 4; 00423 }
|
|
00250 { 00251 // 00252 //parameters: phi lambda mass E 00253 // 00254 00255 double mass = 0; 00256 double ptrk = trk->energy(); 00257 double e = sqrt(ptrk*ptrk + mass * mass); 00258 double the = trk->theta(); 00259 double phi = trk->phi(); 00260 HepLorentzVector p4( e* sin(the) * cos(phi), 00261 e * sin(the) * sin(phi), 00262 e * cos(the), 00263 e); 00264 double dphi = trk->dphi(); 00265 double dthe = trk->dtheta(); 00266 double de = 1E+6; 00267 double x = trk->x(); 00268 double y = trk->y(); 00269 double z = trk->z(); 00270 00271 HepPoint3D x3 (x, y ,z); 00272 WTrackParameter wtrk(x3, p4 ,dphi ,dthe, de); 00273 HepSymMatrix Vpe = HepSymMatrix(2,0); 00274 //=== get Vclus=== 00275 HepSymMatrix Vclus = HepSymMatrix (3,0); 00276 Vclus = (wtrk.Ew()).sub(5,7); 00277 double xpr = x - m_BeamPosition[0]; 00278 double ypr = y - m_BeamPosition[1]; 00279 double zpr = z - m_BeamPosition[2]; 00280 double Rpr = sqrt(xpr*xpr + ypr*ypr); 00281 // === get jacobi === 00282 HepMatrix J(2,3,0); 00283 J[0][0] = -ypr/(Rpr*Rpr); 00284 J[0][1] = xpr/(Rpr*Rpr); 00285 J[1][0] = -xpr * zpr/(Rpr*Rpr*Rpr); 00286 J[1][1] = -ypr * zpr/(Rpr*Rpr*Rpr); 00287 J[1][2] = 1/Rpr; 00288 Vpe = Vclus.similarity(J) + m_VBeamPosition.similarity(J); 00289 Vpe[0][1]=0; 00290 double phipre = atan(ypr/xpr); 00291 00292 if(xpr<0){ 00293 phipre = atan(ypr/xpr) + 3.1415926; 00294 } 00295 double lambdapre = zpr/Rpr; 00296 00297 00298 HepVector plmp(4 , 0); 00299 plmp[0] = phipre; 00300 plmp[1] = lambdapre; 00301 plmp[2] = mass; 00302 plmp[3] = e; 00303 wtrk.setPlmp(plmp); 00304 00305 HepSymMatrix Vplm(2,0); 00306 Vplm[0][0] = Vpe[0][0]; 00307 Vplm[1][1] = Vpe[1][1]; 00308 wtrk.setVplm(Vplm); 00309 00310 00311 00312 // === set p4 === 00313 double p0x = ptrk*cos(phipre)/sqrt(1 + lambdapre*lambdapre); 00314 double p0y = ptrk*sin(phipre)/sqrt(1 + lambdapre*lambdapre); 00315 double p0z = ptrk*lambdapre/sqrt(1 + lambdapre*lambdapre); 00316 double p0e = e; 00317 00318 wtrk.setW(0,p0x); 00319 wtrk.setW(1,p0y); 00320 wtrk.setW(2,p0z); 00321 wtrk.setW(3,p0e); 00322 00323 wtrk.setType(1); 00324 setWTrackOrigin(wtrk); 00325 setWTrackInfit(wtrk); 00326 setWTrackList(number); 00327 GammaShape gtrk(p4,dphi,dthe,de); 00328 setGammaShape(gtrk); 00329 setGammaShapeList(number); 00330 setMapkinematic(4); 00331 setMappositionA(m_numberone); 00332 setMappositionB(m_numbertwo); 00333 00334 m_numberone = m_numberone + 2; 00335 m_numbertwo = m_numbertwo + 2; 00336 }
|
|
00160 { 00161 // 00162 //parameters: phi lambda mass ptrk 00163 // 00164 double ptrk = trk->energy(); 00165 double e = sqrt(ptrk*ptrk + mass * mass); 00166 double the = trk->theta(); 00167 double phi = trk->phi(); 00168 HepLorentzVector p4( e* sin(the) * cos(phi), 00169 e * sin(the) * sin(phi), 00170 e * cos(the), 00171 e); 00172 double dphi = trk->dphi(); 00173 double dthe = trk->dtheta(); 00174 double de = 1E+6; 00175 double x = trk->x(); 00176 double y = trk->y(); 00177 double z = trk->z(); 00178 00179 HepPoint3D x3 (x, y ,z); 00180 WTrackParameter wtrk(x3, p4 ,dphi ,dthe, de); 00181 HepSymMatrix Vpe = HepSymMatrix(2,0); 00182 //=== get Vclus=== 00183 HepSymMatrix Vclus = HepSymMatrix (3,0); 00184 Vclus = (wtrk.Ew()).sub(5,7); 00185 double xpr = x - m_BeamPosition[0]; 00186 double ypr = y - m_BeamPosition[1]; 00187 double zpr = z - m_BeamPosition[2]; 00188 double Rpr = sqrt(xpr*xpr + ypr*ypr); 00189 // === get jacobi === 00190 HepMatrix J(2,3,0); 00191 J[0][0] = -ypr/(Rpr*Rpr); 00192 J[0][1] = xpr/(Rpr*Rpr); 00193 J[1][0] = -xpr * zpr/(Rpr*Rpr*Rpr); 00194 J[1][1] = -ypr * zpr/(Rpr*Rpr*Rpr); 00195 J[1][2] = 1/Rpr; 00196 Vpe = Vclus.similarity(J) + m_VBeamPosition.similarity(J); 00197 Vpe[0][1]=0; 00198 00199 double phipre = atan(ypr/xpr); 00200 00201 if(xpr<0){ 00202 phipre = atan(ypr/xpr) + 3.1415926; 00203 } 00204 double lambdapre = zpr/Rpr; 00205 00206 00207 HepVector plmp(4 , 0); 00208 plmp[0] = phipre; 00209 plmp[1] = lambdapre; 00210 plmp[2] = mass; 00211 plmp[3] = ptrk; 00212 wtrk.setPlmp(plmp); 00213 00214 HepSymMatrix Vplm(3,0); 00215 Vplm[0][0] = Vpe[0][0]; 00216 Vplm[1][1] = Vpe[1][1]; 00217 wtrk.setVplm(Vplm); 00218 00219 00220 00221 // === set p4 === 00222 double p0x = ptrk*cos(phipre)/sqrt(1 + lambdapre*lambdapre); 00223 double p0y = ptrk*sin(phipre)/sqrt(1 + lambdapre*lambdapre); 00224 double p0z = ptrk*lambdapre/sqrt(1 + lambdapre*lambdapre); 00225 double p0e = e; 00226 00227 wtrk.setW(0,p0x); 00228 wtrk.setW(1,p0y); 00229 wtrk.setW(2,p0z); 00230 wtrk.setW(3,p0e); 00231 00232 wtrk.setType(1); 00233 setWTrackOrigin(wtrk); 00234 setWTrackInfit(wtrk); 00235 setWTrackList(number); 00236 GammaShape gtrk(p4,dphi,dthe,de); 00237 setGammaShape(gtrk); 00238 setGammaShapeList(number); 00239 setMapkinematic(5); 00240 setMappositionA(m_numberone); 00241 setMappositionB(m_numbertwo); 00242 00243 m_numberone = m_numberone + 3; 00244 m_numbertwo = m_numbertwo + 1; 00245 }
|
|
00341 { 00342 // 00343 //parameters: mass px py pz 00344 // 00345 00346 double dphi = 1E+6; 00347 double dthe = 1E+6; 00348 double dE = 1E+6; 00349 WTrackParameter wtrk(p4, dphi, dthe, dE); 00350 HepVector plmp(4, 0); 00351 double phipre = atan(p4[1]/p4[0]); 00352 00353 if(p4[0]<0){ 00354 phipre = atan(p4[1]/p4[0]) + 3.1415926; 00355 } 00356 plmp[0] = phipre; 00357 plmp[1] = wtrk.Lambda(); 00358 plmp[2] = mass; 00359 plmp[3] = p4[3]; 00360 HepSymMatrix Vplm(3, 0); 00361 wtrk.setPlmp(plmp); 00362 wtrk.setVplm(Vplm); 00363 wtrk.setType(1); 00364 setWTrackOrigin(wtrk); 00365 setWTrackInfit(wtrk); 00366 setWTrackList(number); 00367 setMapkinematic(3); 00368 setMappositionA(m_numberone); 00369 setMappositionB(m_numbertwo); 00370 m_numberone = m_numberone + 1; 00371 m_numbertwo = m_numbertwo + 3; 00372 }
|
|
00375 { 00376 // 00377 //parameters: mass px py pz, but px,py,pz 's error matrix is set as 10e^6 00378 // 00379 WTrackParameter wtrk; 00380 wtrk.setMass(mass); 00381 HepVector w(7,0); 00382 HepSymMatrix Ew(7,0); 00383 w[0] = 0.2; 00384 w[1] = 0.2; 00385 w[2] = 0.2; 00386 w[3] = sqrt(0.2*0.2*3 + mass*mass); 00387 Ew[0][0] = 1E+6; 00388 Ew[1][1] = 1E+6; 00389 Ew[2][2] = 1E+6; 00390 wtrk.setW(w); 00391 wtrk.setEw(Ew); 00392 setWTrackOrigin(wtrk); 00393 setWTrackInfit(wtrk); 00394 setWTrackList(number); 00395 setMapkinematic(7); 00396 setMappositionA(m_numberone); 00397 setMappositionB(m_numbertwo); 00398 m_numberone = m_numberone + 4; 00399 00400 }
|
|
|
|
|
|
|
|
|
|
00429 { 00430 setWTrackOrigin(wtrk); 00431 setWTrackInfit(wtrk); 00432 setWTrackList(number); 00433 if(number != numberWTrack()-1) { 00434 std::cout << "TrackPool: wrong track index" <<" " 00435 <<number<<" , " <<numberWTrack()<< std::endl; 00436 } 00437 setMapkinematic(0); 00438 setMappositionA(m_numberone); 00439 setMappositionB(m_numbertwo); 00440 m_numberone = m_numberone + 4; 00441 }
|
|
00045 { 00046 // 00047 //parameters: phi lambda mass energy 00048 // 00049 double ptrk = trk->energy(); 00050 double e = sqrt(ptrk*ptrk + mass * mass); 00051 double the = trk->theta(); 00052 double phi = trk->phi(); 00053 HepLorentzVector p4(ptrk * sin(the) * cos(phi), 00054 ptrk * sin(the) * sin(phi), 00055 ptrk * cos(the), 00056 e); 00057 double dphi = trk->dphi(); 00058 double dthe = trk->dtheta(); 00059 double de = trk->dE(); 00060 double x = trk->x(); 00061 double y = trk->y(); 00062 double z = trk->z(); 00063 HepPoint3D x3 (x, y ,z); 00064 WTrackParameter wtrk(x3, p4 ,dphi ,dthe, de); 00065 HepSymMatrix Vpl = HepSymMatrix(2,0); 00066 //=== get Vclus=== 00067 HepSymMatrix Vclus = HepSymMatrix (3,0); 00068 Vclus = (wtrk.Ew()).sub(5,7); 00069 double xpr = x - m_BeamPosition[0]; 00070 double ypr = y - m_BeamPosition[1]; 00071 double zpr = z - m_BeamPosition[2]; 00072 double Rpr = sqrt(xpr*xpr + ypr*ypr); 00073 // === get jacobi === 00074 HepMatrix J(2,3,0); 00075 J[0][0] = -ypr/(Rpr*Rpr); 00076 J[0][1] = xpr/(Rpr*Rpr); 00077 J[1][0] = -xpr * zpr/(Rpr*Rpr*Rpr); 00078 J[1][1] = -ypr * zpr/(Rpr*Rpr*Rpr); 00079 J[1][2] = 1/Rpr; 00080 Vpl = Vclus.similarity(J) + m_VBeamPosition.similarity(J); 00081 Vpl[0][1]=0; 00082 // === get phipre, lambda=== 00083 00084 double phipre = atan(ypr/xpr); 00085 00086 if(xpr<0){ 00087 phipre = atan(ypr/xpr) + 3.1415926; 00088 } 00089 double lambdapre = zpr/Rpr; 00090 00091 00092 // === set p4 === 00093 double p0x = ptrk*cos(phipre)/sqrt(1 + lambdapre*lambdapre); 00094 double p0y = ptrk*sin(phipre)/sqrt(1 + lambdapre*lambdapre); 00095 double p0z = ptrk*lambdapre/sqrt(1 + lambdapre*lambdapre); 00096 double p0e = e; 00097 00098 00099 double p0ver = sqrt(p0x*p0x + p0y*p0y); 00100 00101 00102 HepMatrix B(4,3,0); 00103 B[0][0] = -p0y; 00104 B[0][1] = -p0z * p0x * p0ver/(p0e * p0e); 00105 B[0][2] = p0x/p0e; 00106 B[1][0] = p0x; 00107 B[1][1] = -p0z * p0y * p0ver/(p0e * p0e); 00108 B[1][2] = p0y/p0e; 00109 B[2][1] = p0ver * p0ver * p0ver/(p0e * p0e); 00110 B[2][2] = p0z/p0e; 00111 B[3][2] = 1; 00112 00113 HepSymMatrix Vple(3,0); 00114 Vple[0][0] = Vpl[0][0]; 00115 Vple[1][1] = Vpl[1][1]; 00116 Vple[2][2] = de * de; 00117 00118 HepSymMatrix Vpxyze(4,0); 00119 Vpxyze = Vple.similarity(B); 00120 00121 wtrk.setW(0,p0x); 00122 wtrk.setW(1,p0y); 00123 wtrk.setW(2,p0z); 00124 wtrk.setW(3,p0e); 00125 00126 wtrk.setEw(Vpxyze); 00127 00128 HepSymMatrix Vplme(4,0); 00129 Vplme[0][0] = Vpl[0][0]; 00130 Vplme[1][1] = Vpl[1][1]; 00131 Vplme[3][3] = de * de; 00132 wtrk.setVplm(Vplme); 00133 00134 HepVector plmp(4 , 0); 00135 plmp[0] = phipre; 00136 plmp[1] = lambdapre; 00137 plmp[2] = mass; 00138 plmp[3] = e; 00139 wtrk.setPlmp(plmp); 00140 00141 00142 setWTrackOrigin(wtrk); 00143 setWTrackInfit(wtrk); 00144 setWTrackList(number); 00145 if(number != numberWTrack()-1) { 00146 std::cout << "TrackPool: wrong track index" <<" " 00147 <<number<<" , " <<numberWTrack()<< std::endl; 00148 } 00149 GammaShape gtrk(p4,dphi,dthe,de); 00150 setGammaShape(gtrk); 00151 setGammaShapeList(number); 00152 setMapkinematic(1); 00153 setMappositionA(m_numberone); 00154 setMappositionB(m_numbertwo); 00155 m_numberone = m_numberone + 4; 00156 }
|
|
|
|
00023 { 00024 HepVector helix(5,0); 00025 double error[15]; 00026 for(int i = 0; i < 5; i++) 00027 helix[i] = trk->helix(i); 00028 for(int i = 0; i < 15; i++) 00029 error[i] = trk->err(i); 00030 WTrackParameter wtrk(mass, helix, error); 00031 setWTrackOrigin(wtrk); 00032 setWTrackInfit(wtrk); 00033 setWTrackList(number); 00034 if(number != numberWTrack()-1) { 00035 std::cout << "TrackPool: wrong track index" <<" " 00036 <<number<<" , " <<numberWTrack()<< std::endl; 00037 } 00038 setMapkinematic(0); 00039 setMappositionA(m_numberone); 00040 setMappositionB(m_numbertwo); 00041 m_numberone = m_numberone + 4; 00042 }
|
|
|
|
00444 { 00445 double ptrk = trk->energy(); 00446 double e = sqrt(ptrk*ptrk + mass * mass); 00447 double the = trk->theta(); 00448 double phi = trk->phi(); 00449 HepLorentzVector p4(ptrk * sin(the) * cos(phi), 00450 ptrk * sin(the) * sin(phi), 00451 ptrk * cos(the), 00452 e); 00453 double dphi = trk->dphi(); 00454 double dthe = trk->dtheta(); 00455 double de = trk->dE(); 00456 double x = trk->x(); 00457 double y = trk->y(); 00458 double z = trk->z(); 00459 HepPoint3D x3 (x, y ,z); 00460 WTrackParameter wtrk(x3, p4 ,dphi ,dthe, de); 00461 setWTrackOrigin(wtrk); 00462 setWTrackInfit(wtrk); 00463 setWTrackList(number); 00464 if(number != numberWTrack()-1) { 00465 std::cout << "TrackPool: wrong track index" <<" " 00466 <<number<<" , " <<numberWTrack()<< std::endl; 00467 } 00468 GammaShape gtrk(p4,dphi,dthe,de); 00469 setGammaShape(gtrk); 00470 setGammaShapeList(number); 00471 setMapkinematic(6); 00472 m_numbertwo = 0; 00473 setMappositionA(m_numberone); 00474 setMappositionB(m_numbertwo); 00475 00476 m_numberone = m_numberone + 4; 00477 m_numbertwo = m_numbertwo + 3; 00478 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00166 { 00167 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12); 00168 AddVertex(number, vpar, tlis); 00169 }
|
|
00160 { 00161 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11); 00162 AddVertex(number, vpar, tlis); 00163 }
|
|
00154 { 00155 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10); 00156 AddVertex(number, vpar, tlis); 00157 }
|
|
00148 { 00149 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8, n9); 00150 AddVertex(number, vpar, tlis); 00151 }
|
|
00142 { 00143 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8); 00144 AddVertex(number, vpar, tlis); 00145 }
|
|
00136 { 00137 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7); 00138 AddVertex(number, vpar, tlis); 00139 }
|
|
00130 { 00131 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6); 00132 AddVertex(number, vpar, tlis); 00133 }
|
|
00124 { 00125 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5); 00126 AddVertex(number, vpar, tlis); 00127 }
|
|
00118 { 00119 std::vector<int> tlis = AddList(n1, n2, n3, n4); 00120 AddVertex(number, vpar, tlis); 00121 }
|
|
00112 { 00113 std::vector<int> tlis = AddList(n1, n2, n3); 00114 AddVertex(number, vpar, tlis); 00115 }
|
|
|
|
00086 { 00087 VertexConstraints vc; 00088 vc.CommonVertexConstraints(tlis); 00089 m_vc.push_back(vc); 00090 HepVector vx(3, 0); 00091 for (unsigned int i = 0; i < tlis.size(); i++) 00092 vx += wTrackOrigin(tlis[i]).X(); 00093 vx = vx/tlis.size(); 00094 VertexParameter n_vpar = vpar; 00095 n_vpar.setVx(vx); 00096 m_vpar_origin.push_back(n_vpar); 00097 m_vpar_infit.push_back(n_vpar); 00098 WTrackParameter vwtrk; 00099 m_virtual_wtrk.push_back(vwtrk); 00100 if ((unsigned int)number != m_vc.size() - 1) 00101 std::cout << "wrong kinematic constraints index" << std::endl; 00102 }
|
|
|
|
00256 { 00257 bool okfit = false; 00258 if (n < 0 || (unsigned int)n >= m_vc.size()) 00259 return okfit; 00260 for (unsigned int i = 0; i < (m_vc[n].Ltrk()).size(); i++) 00261 { 00262 int itk = (m_vc[n].Ltrk())[i]; 00263 setWTrackInfit(itk, wTrackOrigin(itk)); 00264 } 00265 m_vpar_infit[n] = m_vpar_origin[n]; 00266 00267 // iteration loop 00268 std::vector<double> chisq; 00269 chisq.clear(); 00270 for (int it = 0; it < m_niter; it++) 00271 { 00272 std::vector<WTrackParameter> wlis; 00273 wlis.clear(); 00274 for (unsigned int i = 0; i < (m_vc[n].Ltrk()).size(); i++) 00275 { 00276 int itk = (m_vc[n].Ltrk())[i]; 00277 wlis.push_back(wTrackInfit(itk)); 00278 } 00279 VertexParameter vpar = m_vpar_infit[n]; 00280 m_vc[n].UpdateConstraints(vpar, wlis); 00281 00282 fitBeam(n); 00283 chisq.push_back(m_chisq[n]); 00284 if (it > 0) 00285 { 00286 double delchi = chisq[it] - chisq[it-1]; 00287 if(fabs(delchi) < m_chiter) 00288 break; 00289 } 00290 } 00291 if(m_chisq[n]>=m_chicut) return okfit; 00292 swimBeam(n); 00293 okfit = true; 00294 return okfit; 00295 }
|
|
|
|
00615 { 00616 00617 vertexCovMatrix(n); 00618 TStopwatch timer; 00619 timer.Start(); 00620 00621 HepMatrix A(NTRKPAR, NTRKPAR * m_nvtrk, 0); 00622 HepMatrix B(NTRKPAR, NVTXPAR, 0); 00623 VertexConstraints vc = m_vc[n]; 00624 unsigned int NSIZE = vc.Ltrk().size(); 00625 int charge = 0; 00626 00627 HepMatrix Ai(6, 6, 0); 00628 Ai[0][0] = 1.0; 00629 Ai[1][1] = 1.0; 00630 Ai[2][2] = 1.0; 00631 HepMatrix Bi(6, 3, 0); 00632 Bi[3][0] = 1.0; 00633 Bi[4][1] = 1.0; 00634 Bi[5][2] = 1.0; 00635 HepVector w1(6, 0); 00636 HepVector w2(7, 0); 00637 HepSymMatrix Ew(7, 0); 00638 HepMatrix ew1(6, 6, 0); 00639 HepMatrix ew2(7, 7, 0); 00640 double totalE = 0; 00641 00642 for(unsigned int i = 0; i < NSIZE; i++) 00643 { 00644 int itk = vc.Ltrk()[i]; 00645 charge += wTrackInfit(itk).charge(); 00646 double afield = VertexFitBField::instance()->getCBz(m_xInfit, pInfit(itk).sub(4, 6)); 00647 double a = afield * wTrackInfit(itk).charge(); 00648 00649 totalE += wTrackOrigin(itk).w()[3]; 00650 Ai[0][4] = a; 00651 Ai[1][3] = -a; 00652 Bi[0][1] = -a; 00653 Bi[1][0] = a; 00654 A.sub(1, NTRKPAR*itk + 1, Ai); 00655 B += Bi; 00656 } 00657 B[3][0] = 1.0; 00658 B[4][1] = 1.0; 00659 B[5][2] = 1.0; 00660 00661 w1 = A * m_pInfit + B * m_xInfit; 00662 ew1 = m_pcovInfit.similarity(A) + m_xcovInfit.similarity(B) + A*m_E*B.T()+B*(m_E.T())*A.T(); 00663 00664 //convert w1(6x1) to w2(7x1) 00665 w2[0] = w1[0]; 00666 w2[1] = w1[1]; 00667 w2[2] = w1[2]; 00668 w2[3] = totalE; 00669 w2[4] = w1[3]; 00670 w2[5] = w1[4]; 00671 w2[6] = w1[5]; 00672 //convert ew1(6x6) to ew2(7x7) 00673 m_TRB[3][0] = w1[0] / totalE; 00674 m_TRB[3][1] = w1[1] / totalE; 00675 m_TRB[3][2] = w1[2] / totalE; 00676 ew2 = m_TRB * ew1 * m_TRB.T(); 00677 Ew.assign(ew2); 00678 WTrackParameter vwtrk; 00679 vwtrk.setCharge(charge); 00680 vwtrk.setW(w2); 00681 vwtrk.setEw(Ew); 00682 00683 m_virtual_wtrk[n] = vwtrk; 00684 timer.Stop(); 00685 m_cpu[5] += timer.CpuTime(); 00686 }
|
|
00072 {return m_chisq[n];}
|
|
00071 {return m_chi;}
|
|
00072 {return m_chisq[n];}
|
|
00071 {return m_chi;}
|
|
00133 {m_gammashape.clear();}
|
|
00133 {m_gammashape.clear();}
|
|
00134 {m_lgammashape.clear();}
|
|
00134 {m_lgammashape.clear();}
|
|
00118 {m_mapkinematic.clear();}
|
|
00118 {m_mapkinematic.clear();}
|
|
00119 {m_mappositionA.clear();}
|
|
00119 {m_mappositionA.clear();}
|
|
00120 {m_mappositionB.clear();}
|
|
00120 {m_mappositionB.clear();}
|
|
00109 {m_numberone = 0;}
|
|
00109 {m_numberone = 0;}
|
|
00110 {m_numbertwo = 0;}
|
|
00110 {m_numbertwo = 0;}
|
|
00106 {m_wtrk_infit.clear();}
|
|
00106 {m_wtrk_infit.clear();}
|
|
00107 {m_lwtrk.clear();}
|
|
00107 {m_lwtrk.clear();}
|
|
00105 {m_wtrk_origin.clear();}
|
|
00105 {m_wtrk_origin.clear();}
|
|
|
|
00885 { 00886 // assert(p.num_row() == 6); 00887 HepVector m(7, 0); 00888 m.sub(1, p.sub(1, 3)); 00889 m.sub(5, p.sub(4, 6)); 00890 m[3] = sqrt(mass*mass + p[0]*p[0] + p[1]*p[1] + p[2]*p[2]); 00891 return m; 00892 }
|
|
|
|
00895 { 00896 // assert(p.num_row() == 7); 00897 HepVector m(6, 0); 00898 m.sub(1, p.sub(1, 3)); 00899 m.sub(4, p.sub(5, 7)); 00900 return m; 00901 }
|
|
00087 {return m_cpu;}
|
|
00087 {return m_cpu;}
|
|
00093 { return sqrt((m_vpar_infit[n].Evx())[i][i]);}
|
|
00093 { return sqrt((m_vpar_infit[n].Evx())[i][i]);}
|
|
00092 { return m_vpar_infit[n].Evx();}
|
|
00092 { return m_vpar_infit[n].Evx();}
|
|
00083 {return wTrackInfit(n).Ew();}
|
|
00083 {return wTrackInfit(n).Ew();}
|
|
|
|
|
|
00172 { 00173 bool okfit = false; 00174 TStopwatch timer; 00175 m_cpu = HepVector(10, 0); 00176 if (n < 0 || (unsigned int)n >= m_vc.size()) return okfit; 00177 00178 timer.Start(); 00179 int ifail; 00180 m_nvtrk = numberWTrack(); 00181 00182 m_pOrigin = HepVector(m_nvtrk * NTRKPAR, 0); 00183 m_pInfit = HepVector(m_nvtrk * NTRKPAR, 0); 00184 m_pcovOrigin = HepSymMatrix(m_nvtrk * NTRKPAR, 0); 00185 m_pcovInfit = HepSymMatrix(m_nvtrk * NTRKPAR, 0); 00186 00187 int ntrk = numberWTrack(); 00188 for(unsigned int itk = 0; itk < ntrk; itk++) 00189 { 00190 setWTrackInfit(itk, wTrackOrigin(itk)); 00191 setPOrigin(itk, Convert76(wTrackOrigin(itk).w())); 00192 setPCovOrigin(itk, wTrackOrigin(itk).Ew().similarity(m_TRA)); 00193 } 00194 m_pInfit = m_pOrigin; 00195 00196 m_xOrigin = HepVector(NVTXPAR, 0); 00197 m_xInfit = HepVector(NVTXPAR, 0); 00198 m_xcovOrigin = HepSymMatrix(NVTXPAR, 0); 00199 m_xcovInfit = HepSymMatrix(NVTXPAR, 0); 00200 m_xcovOriginInversed = HepSymMatrix(NVTXPAR, 0); 00201 m_xcovInfitInversed = HepSymMatrix(NVTXPAR, 0); 00202 00203 m_xOrigin = m_vpar_origin[n].Vx(); 00204 m_xcovOrigin = m_vpar_origin[n].Evx(); 00205 m_xcovOriginInversed = m_xcovOrigin.inverse(ifail); 00206 m_xInfit = m_xOrigin; 00207 00208 m_vpar_infit[n] = m_vpar_origin[n]; 00209 00210 m_B = HepMatrix(NCONSTR*m_nvtrk, NVTXPAR, 0); 00211 m_A = HepMatrix(NCONSTR*m_nvtrk, NTRKPAR*m_nvtrk, 0); 00212 m_BT = HepMatrix(NVTXPAR,NCONSTR*m_nvtrk, 0); 00213 m_AT = HepMatrix(NTRKPAR*m_nvtrk, NCONSTR*m_nvtrk, 0); 00214 m_G = HepVector(NCONSTR*m_nvtrk, 0); 00215 m_W = HepSymMatrix(NCONSTR*m_nvtrk, 0); 00216 m_E = HepMatrix(NTRKPAR*m_nvtrk, NVTXPAR, 0); 00217 00218 timer.Stop(); 00219 m_cpu[0] += timer.CpuTime(); 00220 00221 // iteration loop 00222 std::vector<double> chisq; 00223 chisq.clear(); 00224 for (int it = 0; it < m_niter; it++) 00225 { 00226 timer.Start(); 00227 UpdateConstraints(m_vc[n]); 00228 timer.Stop(); 00229 m_cpu[1] += timer.CpuTime(); 00230 timer.Start(); 00231 fitVertex(n); 00232 timer.Stop(); 00233 m_cpu[2] += timer.CpuTime(); 00234 chisq.push_back(m_chisq[n]); 00235 if (it > 0) 00236 { 00237 double delchi = chisq[it] - chisq[it-1]; 00238 if (fabs(delchi) < m_chiter) break; 00239 } 00240 } 00241 00242 /*REVISED 00243 if(m_chisq[n] >= m_chicut || m_chisq[n] < 0) return okfit; 00244 REVISED*/ 00245 if (m_chisq[n] >= m_chicut) return okfit; 00246 00247 // update vertex and its covariance 00248 m_vpar_infit[n].setVx(m_xInfit); 00249 m_vpar_infit[n].setEvx(m_xcovInfit); 00250 00251 okfit = true; 00252 return okfit; 00253 }
|
|
00298 { 00299 bool okfit = false; 00300 double mychi = 0; 00301 for (unsigned int n = 0; n<(int)(m_vc.size()); n++) 00302 { 00303 Fit(n); 00304 if (m_chisq[n] >= m_chicut) return okfit; 00305 swimVertex(n); 00306 mychi = mychi + m_chisq[n]; 00307 } 00308 m_chi = mychi; 00309 okfit = true; 00310 return okfit; 00311 }
|
|
|
|
00489 { 00490 /* 00491 if(m_chisq.size() == 0) { 00492 for(unsigned int i = 0; i < m_vc.size(); i++) 00493 m_chisq.push_back(0.0); 00494 } 00495 00496 VertexConstraints vc = m_vc[n]; 00497 VertexParameter vpar = m_vpar_origin[n]; 00498 00499 unsigned int NSIZE = vc.Ltrk().size(); 00500 int ifail; 00501 00502 // get VD, lambda 00503 for(unsigned int i = 0; i < NSIZE; i++) { 00504 int itk = vc.Ltrk()[i]; 00505 HepVector dela0(7, 0); 00506 dela0 = wTrackOrigin(itk).w()-wTrackInfit(itk).w(); 00507 HepSymMatrix vd(2, 0); 00508 vd = ((wTrackOrigin(itk).Ew()).similarity(vc.Dc()[i])).inverse(ifail); 00509 HepVector lambda(2, 0); 00510 lambda = vd*(vc.Dc()[i]*dela0+vc.dc()[i]); 00511 vc.setVD(i, vd); 00512 vc.setLambda(i, lambda); 00513 } 00514 // get new dela = dela0 - Va0 Dt lambda 00515 // get new Va 00516 // get chisq 00517 HepMatrix covax(7, 3, 0); 00518 m_chisq[n] = 0; 00519 for(unsigned int i = 0; i < NSIZE; i++) { 00520 HepVector DtL(7, 0); 00521 DtL = (vc.Dc()[i]).T() * vc.lambda()[i]; 00522 int itk = vc.Ltrk()[i]; 00523 HepVector dela(7, 0); 00524 HepVector dela0(7, 0); 00525 dela0 = wTrackOrigin(itk).w()-wTrackInfit(itk).w(); 00526 WTrackParameter wtrk = wTrackOrigin(itk); 00527 dela = -wTrackOrigin(itk).Ew() * DtL; 00528 wtrk.setW(wtrk.w()+dela); 00529 HepSymMatrix Va(7, 0); 00530 HepSymMatrix Va0(7, 0); 00531 Va0 = wTrackOrigin(itk).Ew(); 00532 HepMatrix DcT(7, 2, 0); 00533 DcT = (vc.Dc()[i]).T(); 00534 HepSymMatrix DVdD(7, 0); 00535 DVdD = (vc.VD()[i]).similarity(DcT); 00536 Va = Va0 - DVdD.similarity(Va0); 00537 wtrk.setEw(Va); 00538 setWTrackInfit(itk, wtrk); 00539 HepVector dc(2, 0); 00540 dc = vc.Dc()[i]*dela0 +vc.dc()[i]; 00541 m_chisq[n] = m_chisq[n] + dot(vc.lambda()[i], dc); 00542 } 00543 m_vpar_infit[n] = vpar; 00544 m_vc[n] = vc; 00545 */ 00546 //No needed 00547 }
|
|
|
|
00314 { 00315 if (m_chisq.size() == 0) 00316 { 00317 for (unsigned int i = 0; i < m_vc.size(); i++) 00318 m_chisq.push_back(9999.0); 00319 } 00320 TStopwatch timer; 00321 VertexConstraints vc = m_vc[n]; 00322 00323 int ifail; 00324 int NSIZE = (vc.Ltrk()).size(); 00325 00326 // get new Vx 00327 timer.Start(); 00328 m_xcovInfitInversed = m_xcovOriginInversed; 00329 00330 for (unsigned int i = 0; i < NSIZE; i++) 00331 { 00332 int itk = (vc.Ltrk())[i]; 00333 m_xcovInfitInversed += vfW(itk).similarity(vfBT(itk)); 00334 } 00335 m_xcovInfit = m_xcovInfitInversed.inverse(ifail); 00336 00337 // calculate Kq and E 00338 m_KQ = HepMatrix(NVTXPAR, m_nvtrk * NCONSTR, 0); 00339 m_E = HepMatrix(m_nvtrk*NTRKPAR, NVTXPAR, 0); 00340 for (unsigned int i = 0; i < NSIZE; i++) 00341 { 00342 int itk = (vc.Ltrk())[i]; 00343 setKQ(itk, (m_xcovInfit * vfBT(itk) * vfW(itk))); 00344 setE(itk, (-pcovOrigin(itk) * vfAT(itk) * vfKQ(itk).T())); 00345 } 00346 // update vertex position 00347 m_xInfit = m_xOrigin; 00348 for (unsigned int i = 0; i < NSIZE; i++) 00349 { 00350 int itk = (vc.Ltrk())[i]; 00351 m_xInfit -= vfKQ(itk) * vfG(itk); 00352 } 00353 // update Track parameter 00354 HepVector dq0q(NVTXPAR, 0); 00355 dq0q = m_xcovInfitInversed * (m_xOrigin - m_xInfit); 00356 for (unsigned int i = 0; i < NSIZE; i++) 00357 { 00358 int itk = (vc.Ltrk())[i]; 00359 HepVector alpha(NTRKPAR, 0); 00360 alpha = pOrigin(itk) - pcovOrigin(itk) * vfAT(itk) * (vfW(itk)*vfG(itk) - vfKQ(itk).T()*dq0q); 00361 setPInfit(itk, alpha); 00362 } 00363 // get chisquare value 00364 m_chisq[n] = (m_W.similarity(m_G.T())- m_xcovInfitInversed.similarity((m_xInfit-m_xOrigin).T()))[0][0]; 00365 }
|
|
00092 {return m_lgammashape[n];}
|
|
00090 {return m_lgammashape;}
|
|
00092 {return m_lgammashape[n];}
|
|
00090 {return m_lgammashape;}
|
|
00091 {return m_gammashape[n];}
|
|
00089 {return m_gammashape;}
|
|
00091 {return m_gammashape[n];}
|
|
00089 {return m_gammashape;}
|
|
00141 {return m_BeamPosition;}
|
|
00141 {return m_BeamPosition;}
|
|
00142 {return m_VBeamPosition;}
|
|
00142 {return m_VBeamPosition;}
|
|
|
|
00028 { 00029 //derived from TrackPool 00030 clearWTrackOrigin(); 00031 clearWTrackInfit(); 00032 clearWTrackList(); 00033 clearGammaShape(); 00034 clearGammaShapeList(); 00035 clearMapkinematic(); 00036 clearMappositionA(); 00037 clearMappositionB(); 00038 clearone(); 00039 cleartwo(); 00040 00041 m_vpar_origin.clear(); 00042 m_vpar_infit.clear(); 00043 m_vc.clear(); 00044 m_chisq.clear(); 00045 m_chi = 9999.; 00046 m_virtual_wtrk.clear(); 00047 m_niter = 10; 00048 m_chiter = 1.0e-3; 00049 m_chicut = 1000; 00050 00051 m_TRA = HepMatrix(6, 7, 0); 00052 m_TRA[0][0] = 1.0; 00053 m_TRA[1][1] = 1.0; 00054 m_TRA[2][2] = 1.0; 00055 m_TRA[3][4] = 1.0; 00056 m_TRA[4][5] = 1.0; 00057 m_TRA[5][6] = 1.0; 00058 m_TRB = HepMatrix(7, 6, 0); 00059 m_TRB[0][0] = 1.0; 00060 m_TRB[1][1] = 1.0; 00061 m_TRB[2][2] = 1.0; 00062 m_TRB[4][3] = 1.0; 00063 m_TRB[5][4] = 1.0; 00064 m_TRB[6][5] = 1.0; 00065 }
|
|
|
|
00014 { 00015 if (m_pointer) return m_pointer; 00016 m_pointer = new VertexFit(); 00017 return m_pointer; 00018 }
|
|
00116 {return m_mapkinematic;}
|
|
00116 {return m_mapkinematic;}
|
|
00114 {return m_mappositionA;}
|
|
00114 {return m_mappositionA;}
|
|
00115 {return m_mappositionB;}
|
|
00115 {return m_mappositionB;}
|
|
00093 { return ((int)(m_lgammashape.size()) );}
|
|
00093 { return ((int)(m_lgammashape.size()) );}
|
|
00111 {return m_numberone;}
|
|
00111 {return m_numberone;}
|
|
00112 {return m_numbertwo;}
|
|
00112 {return m_numbertwo;}
|
|
00073 { return ((int)(m_lwtrk.size()));}
|
|
00073 { return ((int)(m_lwtrk.size()));}
|
|
00162 { return m_pcovInfit.sub(i*NTRKPAR+1, (i+1)*NTRKPAR); }
|
|
00162 { return m_pcovInfit.sub(i*NTRKPAR+1, (i+1)*NTRKPAR); }
|
|
00154 { return m_pcovOrigin.sub(i*NTRKPAR+1, (i+1)*NTRKPAR); }
|
|
00154 { return m_pcovOrigin.sub(i*NTRKPAR+1, (i+1)*NTRKPAR); }
|
|
00080 {return wTrackInfit(n).p();}
|
|
00080 {return wTrackInfit(n).p();}
|
|
00160 { return m_pInfit.sub(i*NTRKPAR+1, (i+1)*NTRKPAR); }
|
|
00160 { return m_pInfit.sub(i*NTRKPAR+1, (i+1)*NTRKPAR); }
|
|
00152 { return m_pOrigin.sub(i*NTRKPAR+1, (i+1)*NTRKPAR); }
|
|
00152 { return m_pOrigin.sub(i*NTRKPAR+1, (i+1)*NTRKPAR); }
|
|
|
|
00453 { 00454 assert(p.num_row() == 5); 00455 vertexCovMatrix(n); 00456 00457 WTrackParameter wtrk0, wtrk1; 00458 HepVector w1(6, 0); 00459 HepVector w2(7, 0); 00460 HepSymMatrix ew1(6, 0); 00461 HepSymMatrix ew2(7, 0); 00462 wtrk0 = wTrackOrigin(itk); 00463 w1 = pInfit(itk); 00464 ew1 = pcovInfit(itk); 00465 w2 = Convert67(wtrk0.mass(), w1); 00466 m_TRB[3][0] = w2[0] / w2[3]; 00467 m_TRB[3][1] = w2[1] / w2[3]; 00468 m_TRB[3][2] = w2[2] / w2[3]; 00469 ew2 = ew1.similarity(m_TRB); 00470 wtrk1.setW(w2); 00471 wtrk1.setEw(ew2); 00472 wtrk1.setCharge(wtrk0.charge()); 00473 00474 HTrackParameter htrk0(wtrk0); 00475 HTrackParameter htrk1(wtrk1); 00476 for (int i = 0; i < 5; i++) 00477 { 00478 double del = htrk0.eHel()[i][i] - htrk1.eHel()[i][i]; 00479 if (del == 0.0) 00480 { 00481 return false; 00482 } 00483 p[i] = (htrk0.helix()[i] - htrk1.helix()[i]) / sqrt(abs(del)); 00484 } 00485 return true; 00486 }
|
|
00176 {m_A.sub(i*NCONSTR+1, i*NTRKPAR+1, d);}
|
|
00176 {m_A.sub(i*NCONSTR+1, i*NTRKPAR+1, d);}
|
|
00180 {m_AT.sub(i*NTRKPAR+1, i*NCONSTR+1, d);}
|
|
00180 {m_AT.sub(i*NTRKPAR+1, i*NCONSTR+1, d);}
|
|
00168 {m_B.sub(i*NCONSTR+1, 1, e);}
|
|
00168 {m_B.sub(i*NCONSTR+1, 1, e);}
|
|
00137 {m_BeamPosition = BeamPosition;}
|
|
00137 {m_BeamPosition = BeamPosition;}
|
|
00172 {m_BT.sub(1, i*NCONSTR+1, e);}
|
|
00172 {m_BT.sub(1, i*NCONSTR+1, e);}
|
|
|
|
|
|
00196 {m_E.sub(i*NTRKPAR+1, 1, p);}
|
|
00196 {m_E.sub(i*NTRKPAR+1, 1, p);}
|
|
00188 {m_G.sub(i*NCONSTR+1, p);}
|
|
00188 {m_G.sub(i*NCONSTR+1, p);}
|
|
00130 {m_gammashape.push_back(gammashape);}
|
|
00129 {m_gammashape[n] = gammashape;}
|
|
00130 {m_gammashape.push_back(gammashape);}
|
|
00129 {m_gammashape[n] = gammashape;}
|
|
00131 {m_lgammashape.push_back(n);}
|
|
00131 {m_lgammashape.push_back(n);}
|
|
00055 { m_niter = niter; }
|
|
00055 { m_niter = niter; }
|
|
00184 {m_KQ.sub(1, i*NCONSTR+1, d);}
|
|
00184 {m_KQ.sub(1, i*NCONSTR+1, d);}
|
|
00122 {m_mapkinematic.push_back(n);}
|
|
00122 {m_mapkinematic.push_back(n);}
|
|
00123 {m_mappositionA.push_back(n);}
|
|
00123 {m_mappositionA.push_back(n);}
|
|
00124 {m_mappositionB.push_back(n);}
|
|
00124 {m_mappositionB.push_back(n);}
|
|
00163 { m_pcovInfit.sub(i*NTRKPAR+1, v); }
|
|
00163 { m_pcovInfit.sub(i*NTRKPAR+1, v); }
|
|
00155 { m_pcovOrigin.sub(i*NTRKPAR+1,v); }
|
|
00155 { m_pcovOrigin.sub(i*NTRKPAR+1,v); }
|
|
00161 { m_pInfit.sub(i*NTRKPAR+1, p); }
|
|
00161 { m_pInfit.sub(i*NTRKPAR+1, p); }
|
|
00153 { m_pOrigin.sub(i*NTRKPAR+1, p); }
|
|
00153 { m_pOrigin.sub(i*NTRKPAR+1, p); }
|
|
00138 {m_VBeamPosition = VBeamPosition;}
|
|
00138 {m_VBeamPosition = VBeamPosition;}
|
|
00192 {m_W.sub(i*NCONSTR+1, m);}
|
|
00192 {m_W.sub(i*NCONSTR+1, m);}
|
|
00102 {m_wtrk_infit.push_back(wtrk);}
|
|
00100 {m_wtrk_infit[n] = wtrk;}
|
|
00102 {m_wtrk_infit.push_back(wtrk);}
|
|
00100 {m_wtrk_infit[n] = wtrk;}
|
|
00103 {m_lwtrk.push_back(n);}
|
|
00103 {m_lwtrk.push_back(n);}
|
|
00101 {m_wtrk_origin.push_back(wtrk);}
|
|
00099 {m_wtrk_origin[n] = wtrk;}
|
|
00101 {m_wtrk_origin.push_back(wtrk);}
|
|
00099 {m_wtrk_origin[n] = wtrk;}
|
|
00145 {m_xcovInfit = v;}
|
|
00145 {m_xcovInfit = v;}
|
|
00147 {m_xcovInfitInversed = v;}
|
|
00147 {m_xcovInfitInversed = v;}
|
|
00134 {m_xcovOrigin = v;}
|
|
00134 {m_xcovOrigin = v;}
|
|
00136 {m_xcovOriginInversed = v;}
|
|
00136 {m_xcovOriginInversed = v;}
|
|
00143 {m_xInfit = x;}
|
|
00143 {m_xInfit = x;}
|
|
00132 { m_xOrigin = x;}
|
|
00132 { m_xOrigin = x;}
|
|
00064 { vertexCovMatrix(n); swimVertex(n);}
|
|
00064 { vertexCovMatrix(n); swimVertex(n);}
|
|
|
|
00551 { 00552 /* 00553 // const double alpha = -0.00299792458; 00554 // 00555 // Track parameter can be expressed as: 00556 // 00557 // px = px0 + a*(y0 - yv) 00558 // py = py0 - a*(x0 - xv) 00559 // pz = pz0 00560 // e = e 00561 // x = xv 00562 // y = yv 00563 // z = zv 00564 // 00565 // thus p = A * a + B * vx 00566 // x = vx 00567 00568 00569 VertexConstraints vc = m_vc[n]; 00570 VertexParameter vpar = m_vpar_infit[n]; 00571 unsigned int NSIZE = vc.Ltrk().size(); 00572 00573 for(unsigned int i = 0; i < NSIZE; i++) { 00574 int itk = vc.Ltrk()[i]; 00575 HepMatrix A(4, 7, 0); 00576 HepMatrix B(4, 3, 0); 00577 00578 double afield = VertexFitBField::instance()->getCBz(vpar.Vx(), pInfit(itk).sub(4, 6)); 00579 double a = afield * wTrackInfit(itk).charge(); 00580 A[0][0] = 1.0; 00581 A[0][5] = a; 00582 A[1][1] = 1.0; 00583 A[1][4] = -a; 00584 A[2][2] = 1.0; 00585 A[3][3] = 1.0; 00586 B[0][1] = -a; 00587 B[1][0] = a; 00588 HepVector p(4, 0); 00589 p = A * wTrackInfit(itk).w() + B * vpar.Vx(); 00590 HepVector x(3, 0); 00591 x = vpar.Vx(); 00592 HepVector w(7, 0); 00593 HepSymMatrix Ew(7, 0); 00594 for(int j = 0; j < 4; j++) 00595 w[j] = p[j]; 00596 for(int j = 0; j < 3; j++) 00597 w[j+4] = x[j]; 00598 00599 WTrackParameter wtrk; 00600 wtrk.setCharge(wTrackInfit(itk).charge()); 00601 wtrk.setW(w); 00602 HepSymMatrix Vpv(4, 0); 00603 Vpv = (wTrackInfit(itk).Ew()).similarity(A); 00604 for(int j = 0; j < 4; j++) 00605 for(int k= 0; k < 4; k++) 00606 Ew[j][k] = Vpv[j][k]; 00607 wtrk.setEw(Ew); 00608 setWTrackInfit(itk, wtrk); 00609 } 00610 */ 00611 //No needed 00612 }
|
|
|
|
00389 { 00390 TStopwatch timer; 00391 timer.Start(); 00392 // Track parameter can be expressed as: 00393 // 00394 // px = px0 + a*(y0 - yv) 00395 // py = py0 - a*(x0 - xv) 00396 // pz = pz0 00397 // e = e 00398 // x = xv 00399 // y = yv 00400 // z = zv 00401 // 00402 // thus p = A * a + B * vx 00403 // x = vx 00404 VertexConstraints vc = m_vc[n]; 00405 unsigned int NSIZE = vc.Ltrk().size(); 00406 00407 HepMatrix A(6, 6, 0); 00408 A[0][0] = 1.0; 00409 A[1][1] = 1.0; 00410 A[2][2] = 1.0; 00411 HepMatrix B(6, 3, 0); 00412 B[3][0] = 1.0; 00413 B[4][1] = 1.0; 00414 B[5][2] = 1.0; 00415 HepVector w1(6, 0); 00416 HepVector w2(7, 0); 00417 HepSymMatrix Ew(7, 0); 00418 HepMatrix ew1(6, 6, 0); 00419 HepMatrix ew2(7, 7, 0); 00420 00421 for (unsigned int i = 0; i < NSIZE; i++) 00422 { 00423 int itk = vc.Ltrk()[i]; 00424 double afield = VertexFitBField::instance()->getCBz(m_xInfit, pInfit(itk).sub(4, 6)); 00425 double a = afield * wTrackInfit(itk).charge(); 00426 00427 A[0][4] = a; 00428 A[1][3] = -a; 00429 B[0][1] = -a; 00430 B[1][0] = a; 00431 w1 = A * pInfit(itk) + B * m_xInfit; 00432 ew1 = pcovInfit(itk).similarity(A) + m_xcovInfit.similarity(B) + A*vfE(itk)*B.T() + B*(vfE(itk).T())*A.T(); 00433 00434 WTrackParameter wtrk = wTrackOrigin(itk); 00435 w2 = Convert67(wtrk.mass(), w1); 00436 wtrk.setW(w2); 00437 00438 m_TRB[3][0] = w2[0] / w2[3]; 00439 m_TRB[3][1] = w2[1] / w2[3]; 00440 m_TRB[3][2] = w2[2] / w2[3]; 00441 00442 ew2 = m_TRB * ew1 * m_TRB.T(); 00443 Ew.assign(ew2); 00444 wtrk.setEw(Ew); 00445 //renew parameters of input track 00446 setWTrackInfit(itk, wtrk); 00447 } 00448 timer.Stop(); 00449 m_cpu[4] += timer.CpuTime(); 00450 }
|
|
|
|
00689 { 00690 int ntrk = (vc.Ltrk()).size(); 00691 int type = vc.type(); 00692 switch(type) 00693 { 00694 case 1: 00695 { 00696 for (unsigned int i = 0; i < ntrk; i++) 00697 { 00698 int itk = (vc.Ltrk())[i]; 00699 HepVector alpha(6, 0); 00700 double mass, e; 00701 HepLorentzVector p; 00702 HepPoint3D x, vx; 00703 alpha = pInfit(itk); 00704 00705 mass = wTrackOrigin(itk).mass(); 00706 e = sqrt(mass*mass + alpha[0]*alpha[0] + alpha[1]*alpha[1] + alpha[2]*alpha[2]); 00707 p = HepLorentzVector(alpha[0], alpha[1], alpha[2], e); 00708 x = HepPoint3D(alpha[3], alpha[4], alpha[5]); 00709 00710 vx = HepPoint3D(m_xInfit[0], m_xInfit[1], m_xInfit[2]); 00711 HepPoint3D delx = vx - x; 00712 00713 double afield = VertexFitBField::instance()->getCBz(m_xInfit, wTrackOrigin(itk).X()); 00714 double a = afield * (0.0+wTrackOrigin(itk).charge()); 00715 00716 double J = a * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2(); 00717 J = std::min(J, 1-1e-4); 00718 J = std::max(J, -1+1e-4); 00719 double Rx = delx.x() - 2 * p.px() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2(); 00720 double Ry = delx.y() - 2 * p.py() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2(); 00721 double S = 1.0 / sqrt(1-J*J) / p.perp2(); 00722 // dc 00723 HepVector dc(2, 0); 00724 dc[0] = delx.y()*p.px() - delx.x()*p.py() - 0.5*a*(delx.x()*delx.x() + delx.y()*delx.y()); 00725 dc[1] = delx.z() - p.pz()/a*asin(J); 00726 //setd(itk, dc); 00727 // Ec 00728 HepMatrix Ec(2, 3, 0); 00729 // m_Ec.push_back(Ec); 00730 // Dc 00731 HepMatrix Dc(2, 6, 0); 00732 Dc[0][0] = delx.y(); 00733 Dc[0][1] = -delx.x(); 00734 Dc[0][2] = 0; 00735 Dc[0][3] = p.py() + a * delx.x(); 00736 Dc[0][4] = -p.px() + a * delx.y(); 00737 Dc[0][5] = 0; 00738 Dc[1][0] = -p.pz() * S * Rx; 00739 Dc[1][1] = -p.pz() * S * Ry; 00740 Dc[1][2] = - asin(J) / a; 00741 Dc[1][3] = p.px() * p.pz() * S; 00742 Dc[1][4] = p.py() * p.pz() * S; 00743 Dc[1][5] = -1.0; 00744 // setD(itk, Dc); 00745 // setDT(itk, Dc.T()); 00746 // VD 00747 HepSymMatrix vd(2, 0); 00748 int ifail; 00749 vd = pcovOrigin(itk).similarity(Dc); 00750 vd.invert(ifail); 00751 // setVD(itk, vd); 00752 } 00753 break; 00754 } 00755 case 2: 00756 default: 00757 { 00758 for (unsigned int i = 0; i < ntrk; i++) 00759 { 00760 int itk = (vc.Ltrk())[i]; 00761 HepVector alpha(6, 0); 00762 double mass, e; 00763 HepLorentzVector p; 00764 HepPoint3D x, vx; 00765 alpha = pInfit(itk); 00766 p = HepLorentzVector(alpha[0], alpha[1], alpha[2], alpha[3]); 00767 x = HepPoint3D(alpha[4], alpha[5], alpha[6]); 00768 00769 mass = wTrackOrigin(itk).mass(); 00770 e = sqrt(mass*mass + alpha[0]*alpha[0] + alpha[1]*alpha[1] + alpha[2]*alpha[2]); 00771 p = HepLorentzVector(alpha[0], alpha[1], alpha[2], e); 00772 x = HepPoint3D(alpha[3], alpha[4], alpha[5]); 00773 00774 vx = HepPoint3D(m_xInfit[0], m_xInfit[1], m_xInfit[2]); 00775 HepPoint3D delx = vx - x; 00776 00777 if (wTrackOrigin(itk).charge() == 0) 00778 { 00779 // dc -->g 00780 HepVector dc(2, 0); 00781 dc[0] = p.pz()*delx.x() - p.px()*delx.z(); 00782 dc[1] = p.pz()*delx.y() - p.py()*delx.z(); 00783 // Ec --> B 00784 HepMatrix Ec(2, 3, 0); 00785 Ec[0][0] = p.pz(); 00786 Ec[0][1] = 0; 00787 Ec[0][2] = -p.px(); 00788 Ec[1][0] = 0; 00789 Ec[1][1] = p.pz(); 00790 Ec[1][2] = -p.py(); 00791 setB(itk, Ec); 00792 setBT(itk, Ec.T()); 00793 // Dc 00794 HepMatrix Dc(2, 6, 0); 00795 Dc[0][0] = -delx.z(); 00796 Dc[0][1] = 0; 00797 Dc[0][2] = delx.x(); 00798 Dc[0][3] = -p.pz(); 00799 Dc[0][4] = 0; 00800 Dc[0][5] = p.px(); 00801 Dc[1][0] = 0; 00802 Dc[1][1] = -delx.z(); 00803 Dc[1][2] = delx.y(); 00804 Dc[1][3] = 0; 00805 Dc[1][4] = -p.pz(); 00806 Dc[1][5] = p.py(); 00807 setA(itk, Dc); 00808 setAT(itk, Dc.T()); 00809 00810 // VD --> W 00811 HepSymMatrix vd(2, 0); 00812 int ifail; 00813 00814 vd = pcovOrigin(itk).similarity(Dc); 00815 vd.invert(ifail); 00816 setW(itk,vd); 00817 00818 //G=A(p0-pe)+B(x0-xe)+d 00819 HepVector gc(2,0); 00820 gc = Dc*(pOrigin(itk)-pInfit(itk)) + Ec*(m_xOrigin-m_xInfit) + dc; 00821 setG(itk,gc); 00822 00823 } 00824 else 00825 { 00826 double afield = VertexFitBField::instance()->getCBz(m_xInfit,wTrackOrigin(itk).X()); 00827 double a = afield * (0.0+wTrackOrigin(itk).charge()); 00828 double J = a * (delx.x()*p.px() + delx.y()*p.py())/p.perp2(); 00829 J = std::min(J, 1-1e-4); 00830 J = std::max(J, -1+1e-4); 00831 double Rx = delx.x() - 2*p.px()*(delx.x()*p.px() + delx.y()*p.py())/p.perp2(); 00832 double Ry = delx.y() - 2*p.py()*(delx.x()*p.px() + delx.y()*p.py())/p.perp2(); 00833 double S = 1.0 / sqrt(1-J*J) / p.perp2(); 00834 00835 // dc 00836 HepVector dc(2, 0); 00837 dc[0] = delx.y() * p.px() - delx.x() * p.py() - 0.5 * a * (delx.x() * delx.x() + delx.y() * delx.y()); 00838 dc[1] = delx.z() - p.pz() / a*asin(J); 00839 // Ec 00840 HepMatrix Ec(2, 3, 0); 00841 Ec[0][0] = -p.py()- a * delx.x(); 00842 Ec[0][1] = p.px() - a * delx.y(); 00843 Ec[0][2] = 0; 00844 Ec[1][0] = -p.px() * p.pz() * S ; 00845 Ec[1][1] = -p.py() * p.pz() * S ; 00846 Ec[1][2] = 1.0; 00847 setB(itk, Ec); 00848 setBT(itk, Ec.T()); 00849 00850 //Dc 00851 HepMatrix Dc(2,6,0); 00852 Dc[0][0] = delx.y(); 00853 Dc[0][1] = -delx.x(); 00854 Dc[0][2] = 0; 00855 Dc[0][3] = p.py() + a*delx.x(); 00856 Dc[0][4] = -p.px() + a*delx.y(); 00857 Dc[0][5] = 0; 00858 00859 Dc[1][0] = -p.pz()*S*Rx; 00860 Dc[1][1] = -p.pz()*S*Ry; 00861 Dc[1][2] = -asin(J)/a; 00862 Dc[1][3] = p.px()*p.pz()*S; 00863 Dc[1][4] = p.py()*p.pz()*S; 00864 Dc[1][5] = -1.0; 00865 setA(itk,Dc); 00866 setAT(itk,Dc.T()); 00867 // VD 00868 HepSymMatrix vd(2, 0); 00869 int ifail; 00870 vd = pcovOrigin(itk).similarity(Dc); 00871 vd.invert(ifail); 00872 setW(itk, vd); 00873 // G = A(p0-pe)+B(x0-xe)+d 00874 HepVector gc(2, 0); 00875 gc = Dc * (pOrigin(itk) - pInfit(itk)) + Ec *(m_xOrigin - m_xInfit) + dc; 00876 setG(itk, gc); 00877 } 00878 } 00879 break; 00880 } 00881 } 00882 }
|
|
|
|
00368 { 00369 TStopwatch timer; 00370 timer.Start(); 00371 00372 VertexConstraints vc = m_vc[n]; 00373 00374 unsigned int NSIZE = vc.Ltrk().size(); 00375 int ifail; 00376 m_pcovInfit = HepSymMatrix(NTRKPAR*m_nvtrk, 0); 00377 for (unsigned int i = 0; i < NSIZE; i++) 00378 { 00379 int itk = vc.Ltrk()[i]; 00380 setPCovInfit(itk, pcovOrigin(itk) - vfW(itk).similarity(pcovOrigin(itk) * vfAT(itk))); 00381 } 00382 m_pcovInfit = m_pcovInfit + m_xcovInfitInversed.similarity(m_E); 00383 00384 timer.Stop(); 00385 m_cpu[3] += timer.CpuTime(); 00386 }
|
|
00175 {return m_A.sub(i*NCONSTR+1, (i+1)*NCONSTR, i*NTRKPAR+1, (i+1)*NTRKPAR);}
|
|
00175 {return m_A.sub(i*NCONSTR+1, (i+1)*NCONSTR, i*NTRKPAR+1, (i+1)*NTRKPAR);}
|
|
00179 {return m_AT.sub(i*NTRKPAR+1, (i+1)*NTRKPAR, i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00179 {return m_AT.sub(i*NTRKPAR+1, (i+1)*NTRKPAR, i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00167 {return m_B.sub(i*NCONSTR+1, (i+1)*NCONSTR, 1, NVTXPAR);}
|
|
00167 {return m_B.sub(i*NCONSTR+1, (i+1)*NCONSTR, 1, NVTXPAR);}
|
|
00171 {return m_BT.sub(1, NVTXPAR, i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00171 {return m_BT.sub(1, NVTXPAR, i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00195 {return m_E.sub(i*NTRKPAR+1, (i+1)*NTRKPAR, 1, NVTXPAR);}
|
|
00195 {return m_E.sub(i*NTRKPAR+1, (i+1)*NTRKPAR, 1, NVTXPAR);}
|
|
00187 {return m_G.sub(i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00187 {return m_G.sub(i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00183 {return m_KQ.sub(1, NVTXPAR, i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00183 {return m_KQ.sub(1, NVTXPAR, i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00191 {return m_W.sub(i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00191 {return m_W.sub(i*NCONSTR+1, (i+1)*NCONSTR);}
|
|
00094 {return m_vpar_infit[n];}
|
|
00094 {return m_vpar_infit[n];}
|
|
00091 { return m_vpar_infit[n].Vx();}
|
|
00090 { return m_vpar_infit[n].vx();}
|
|
00091 { return m_vpar_infit[n].Vx();}
|
|
00090 { return m_vpar_infit[n].vx();}
|
|
00082 {return wTrackInfit(n).w();}
|
|
00082 {return wTrackInfit(n).w();}
|
|
00070 {return m_wtrk_infit[n];}
|
|
00067 {return m_wtrk_infit;}
|
|
00070 {return m_wtrk_infit[n];}
|
|
00067 {return m_wtrk_infit;}
|
|
00071 {return m_lwtrk[n];}
|
|
00068 {return m_lwtrk;}
|
|
00071 {return m_lwtrk[n];}
|
|
00068 {return m_lwtrk;}
|
|
00069 {return m_wtrk_origin[n];}
|
|
00066 {return m_wtrk_origin;}
|
|
00069 {return m_wtrk_origin[n];}
|
|
00066 {return m_wtrk_origin;}
|
|
00084 {return wTrackInfit(n);}
|
|
00084 {return wTrackInfit(n);}
|
|
00097 {return m_virtual_wtrk[n];}
|
|
00097 {return m_virtual_wtrk[n];}
|
|
00144 {return m_xcovInfit;}
|
|
00144 {return m_xcovInfit;}
|
|
00146 {return m_xcovInfitInversed;}
|
|
00146 {return m_xcovInfitInversed;}
|
|
00133 {return m_xcovOrigin;}
|
|
00133 {return m_xcovOrigin;}
|
|
00135 {return m_xcovOriginInversed;}
|
|
00135 {return m_xcovOriginInversed;}
|
|
00081 {return wTrackInfit(n).x();}
|
|
00081 {return wTrackInfit(n).x();}
|
|
00142 {return m_xInfit;}
|
|
00142 {return m_xInfit;}
|
|
00131 {return m_xOrigin;}
|
|
00131 {return m_xOrigin;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|